# Conflicts:
#	lms/nladmin-system/src/main/resources/logback-spring.xml
This commit is contained in:
2022-10-25 18:44:19 +08:00
13 changed files with 595 additions and 232 deletions

View File

@@ -15,6 +15,7 @@ import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.pda.mps.service.BakingService;
import org.nl.wms.sch.manage.RegionTypeEnum;
import org.nl.wms.sch.tasks.InCoolIvtTask;
import org.nl.wms.sch.tasks.InHotTask;
import org.nl.wms.sch.tasks.OutHotTask;
import org.springframework.stereotype.Service;
@@ -50,7 +51,7 @@ public class BakingServiceImpl implements BakingService {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
WQLObject hosIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烤箱区点位库存表
WQLObject hosReMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烤箱区点位库存
WQLObject hosReMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烤箱区出入主
if (StrUtil.equals(option, "1")) {
@@ -70,22 +71,22 @@ public class BakingServiceImpl implements BakingService {
*/
JSONObject jsonPointZc = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonPointZc)) {
// 暂存区入烘箱
// 查询烘箱对应的空位
/*
* 暂存区入烘箱
*/
// 1.查询烘箱对应的空位
JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + jsonPointZc.getString("product_area") + "' and temperature = '" + temperature + "' and point_location = '"+jsonPointZc.getString("point_location")+"' and is_used = '1' and point_status = '01' order by point_code ASC").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
// 创建暂存位 --> 烘烤区任务
// 2.创建暂存位 --> 烘烤区任务
JSONObject param = new JSONObject();
param.put("type","2"); // 1- 冷却区入烘箱 2- 暂存位入烘箱
param.put("point_code1",point_code1);
param.put("point_code2",jsonHotIvt.getString("point_code"));
// 创建冷却区 --> 暂存位的任务
InHotTask inHotTask = new InHotTask(null);
InHotTask inHotTask = new InHotTask();
String task_id = inHotTask.createTask(param);
// 插入明细明细
// 3.插入明细明细
JSONObject jsonHotReMst = hosReMstTab.query("container_name = '" + container_name + "' and bill_status <> '50' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotReMst)) throw new BadRequestException("烘箱区出入主表不存在");
@@ -99,96 +100,114 @@ public class BakingServiceImpl implements BakingService {
hotParam.put("oven_time",hours);
this.createHotDtl(hotParam);
}
// 1.根据冷却区此母卷的点位找到对应的暂存区、找到空位
JSONObject jsonCoolIvt = coolIvtTab.query("container_name ='" + container_name + "' and is is_used = '1' and full_point_status = '02'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("母卷不存在");
String product_area = jsonCoolIvt.getString("product_area"); // 生产区域
String point_location = jsonCoolIvt.getString("point_location"); // 位置
String reging_id = "";
switch (product_area) {
case "A":
reging_id = RegionTypeEnum.A_HKZC.getId();
break;
case "B":
reging_id = RegionTypeEnum.B_HKZC.getId();
break;
case "C":
reging_id = RegionTypeEnum.C_HKZC.getId();
break;
case "D":
reging_id = RegionTypeEnum.D_HKZC.getId();
break;
}
JSONObject map = new JSONObject();
map.put("flag", "1");
map.put("reging_id", reging_id);
map.put("point_location", point_location);
JSONArray pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(pointArr)) {
if (StrUtil.equals(point_location, "0")) map.put("point_location","1");
if (StrUtil.equals(point_location, "1")) map.put("point_location","0");
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有空暂存位");
}
// 2.判断暂存位是否有任务:找到无任务的暂存位 、查询烘箱对应的空位
String point_code2 = "";
for (int i = 0; i < pointArr.size(); i++) {
JSONObject jsonPoint = pointArr.getJSONObject(i);
String point_code = jsonPoint.getString("point_code");
JSONObject json_point_code1 = taskTab.query("point_code1 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code2 = taskTab.query("point_code2 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code3 = taskTab.query("point_code3 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code4 = taskTab.query("point_code4 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(json_point_code1) && ObjectUtil.isEmpty(json_point_code2) && ObjectUtil.isEmpty(json_point_code3) && ObjectUtil.isEmpty(json_point_code4)) {
point_code2 = point_code;
break;
// 4.下发任务
JSONObject jsonObject = inHotTask.renotifyAcs(task_id);
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
// 成功返回 更新任务状态
JSONObject jsonTask = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
jsonTask.put("task_status", "05");
taskTab.update(jsonTask);
}
}
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有空暂存位");
} else {
/*
* 冷却区入烘箱
*/
// 查询烘箱对应的空位
JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + product_area + "' and temperature = '" + temperature + "' and point_location = '"+map.getString("point_location")+"' and is_used = '1' and point_status = '01' order by point_code ASC").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
// 1.根据冷却区此母卷的点位找到对应的暂存区、找到空位
// JSONObject jsonCoolIvt = coolIvtTab.query("container_name ='" + container_name + "' and is_used = '1' and full_point_status = '02' and cool_ivt_status = '01'").uniqueResult(0);
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + point_code1 + "'and container_name = '"+container_name+"' and is_used = '1' and full_point_status = '02' and cool_ivt_status = '01'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("点位不存在或母卷不存在");
// 3.创建冷却区 --> 烘烤区任务
JSONObject param = new JSONObject();
param.put("point_code1",point_code1);
param.put("point_code2",point_code2);
param.put("point_code3",jsonHotIvt.getString("point_code"));
String product_area = jsonCoolIvt.getString("product_area"); // 生产区域
String point_location = jsonCoolIvt.getString("point_location"); // 位置
String reging_id = "";
// 创建冷却区 --> 暂存位的任务
InHotTask inHotTask = new InHotTask(null);
String task_id = inHotTask.createTask(param);
switch (product_area) {
case "A":
reging_id = RegionTypeEnum.A_HKZC.getId();
break;
case "B":
reging_id = RegionTypeEnum.B_HKZC.getId();
break;
case "C":
reging_id = RegionTypeEnum.C_HKZC.getId();
break;
case "D":
reging_id = RegionTypeEnum.D_HKZC.getId();
break;
}
JSONObject map = new JSONObject();
map.put("flag", "1");
map.put("reging_id", reging_id);
map.put("point_location", point_location);
// 4.插入烘箱区出入主表 和 明细表
JSONObject hotParam = new JSONObject();
hotParam.put("container_name",container_name);
hotParam.put("task_id",task_id);
// 创建主表
String iostorinv_id = this.createHotIoMst(hotParam);
// 创建明细
hotParam.put("iostorinv_id",iostorinv_id);
hotParam.put("start_point_code",point_code2);
hotParam.put("next_point_code",jsonHotIvt.getString("point_code"));
hotParam.put("temperature",temperature);
hotParam.put("oven_time",hours);
this.createHotDtl(hotParam);
JSONArray pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
if (ObjectUtil.isEmpty(pointArr)) {
if (StrUtil.equals(point_location, "0")) map.put("point_location","1");
if (StrUtil.equals(point_location, "1")) map.put("point_location","0");
pointArr = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().getResultJSONArray(0);
// 5.下发任务
JSONObject jsonObject = inHotTask.renotifyAcs(task_id);
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
// 成功返回 更新任务状态
JSONObject jsonTask = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
jsonTask.put("task_status", "05");
taskTab.update(jsonTask);
if (ObjectUtil.isEmpty(pointArr)) throw new BadRequestException("没有空暂存位");
}
// 2.判断暂存位是否有任务:找到无任务的暂存位 、查询烘箱对应的空位
String point_code2 = "";
for (int i = 0; i < pointArr.size(); i++) {
JSONObject jsonPoint = pointArr.getJSONObject(i);
String point_code = jsonPoint.getString("point_code");
JSONObject json_point_code1 = taskTab.query("point_code1 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code2 = taskTab.query("point_code2 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code3 = taskTab.query("point_code3 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code4 = taskTab.query("point_code4 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(json_point_code1) && ObjectUtil.isEmpty(json_point_code2) && ObjectUtil.isEmpty(json_point_code3) && ObjectUtil.isEmpty(json_point_code4)) {
point_code2 = point_code;
break;
}
}
if (ObjectUtil.isEmpty(point_code2)) throw new BadRequestException("没有空暂存位");
// 查询烘箱对应的空位
JSONObject jsonHotIvt = hosIvtTab.query("product_area = '" + product_area + "' and temperature = '" + temperature + "' and point_location = '"+map.getString("point_location")+"' and is_used = '1' and point_status = '01' order by point_code ASC").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotIvt)) throw new BadRequestException("烘烤区没有对应空位");
// 3.创建冷却区 --> 烘烤区任务
JSONObject param = new JSONObject();
param.put("type","1"); // 1- 冷却区入烘箱 2- 暂存位入烘箱
param.put("point_code1",point_code1);
param.put("point_code2",point_code2);
param.put("point_code3",jsonHotIvt.getString("point_code"));
// 创建冷却区 --> 暂存位的任务
InHotTask inHotTask = new InHotTask();
String task_id = inHotTask.createTask(param);
// 4.插入烘箱区出入主表 和 明细表
JSONObject hotParam = new JSONObject();
hotParam.put("container_name",container_name);
hotParam.put("task_id",task_id);
// 创建主表
String iostorinv_id = this.createHotIoMst(hotParam);
// 创建明细
hotParam.put("iostorinv_id",iostorinv_id);
hotParam.put("start_point_code",point_code2);
hotParam.put("next_point_code",jsonHotIvt.getString("point_code"));
hotParam.put("temperature",temperature);
hotParam.put("oven_time",hours);
this.createHotDtl(hotParam);
// 5.下发任务
JSONObject jsonObject = inHotTask.renotifyAcs(task_id);
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
// 成功返回 更新任务状态
JSONObject jsonTask = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
jsonTask.put("task_status", "05");
taskTab.update(jsonTask);
// 更新烘烤区主表状态为执行中
JSONObject jsonHotMst = hosReMstTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
jsonHotMst.put("bill_status", "40");
}
}
} else if (StrUtil.equals(option, "2")) {
// 出箱
@@ -227,10 +246,10 @@ public class BakingServiceImpl implements BakingService {
JSONObject jsonPoint = pointArr.getJSONObject(i);
String point_code = jsonPoint.getString("point_code");
JSONObject json_point_code1 = taskTab.query("point_code1 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code2 = taskTab.query("point_code2 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code3 = taskTab.query("point_code3 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code4 = taskTab.query("point_code4 = '" + point_code + "' and task_status != '99' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code1 = taskTab.query("point_code1 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code2 = taskTab.query("point_code2 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code3 = taskTab.query("point_code3 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
JSONObject json_point_code4 = taskTab.query("point_code4 = '" + point_code + "' and task_status != '07' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(json_point_code1) && ObjectUtil.isEmpty(json_point_code2) && ObjectUtil.isEmpty(json_point_code3) && ObjectUtil.isEmpty(json_point_code4)) {
point_code2 = point_code;
break;
@@ -240,7 +259,7 @@ public class BakingServiceImpl implements BakingService {
JSONObject param = new JSONObject();
param.put("point_code1", point_code1);
param.put("point_code2", point_code2);
OutHotTask outHotTask = new OutHotTask(null);
OutHotTask outHotTask = new OutHotTask();
String task_id = outHotTask.createTask(param);
// 4.插入烘箱区出入明细表
@@ -272,6 +291,62 @@ public class BakingServiceImpl implements BakingService {
@Override
@Transactional
public JSONObject inCoolIvt(JSONObject whereJson) {
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst");
String point_code1 = whereJson.getString("point_code"); // 暂存位:起点
String container_name = whereJson.getString("container_name"); // 母卷号
if (ObjectUtil.isEmpty(point_code1)) throw new BadRequestException("点位不能为空");
if (ObjectUtil.isEmpty(container_name)) throw new BadRequestException("母卷号不能为空");
// 1.获取此暂存位的生产区域和上下位置
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
// 2.找冷却区空货位
JSONObject map = new JSONObject();
map.put("flag", "2");
map.put("product_area", jsonPoint.getString("product_area"));
map.put("point_location", jsonPoint.getString("point_location"));
JSONObject jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
// 如果为空
if (ObjectUtil.isEmpty(jsonCooIvt)) {
if (StrUtil.equals(jsonPoint.getString("point_location"), "0")) map.put("point_location","1");
if (StrUtil.equals(jsonPoint.getString("point_location"), "1")) map.put("point_location","0");
jsonCooIvt = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(map).process().uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonCooIvt)) throw new BadRequestException("冷却区空位不足");
// 3.创建任务
JSONObject param = new JSONObject();
param.put("point_code1", point_code1);
param.put("point_code2", jsonCooIvt.getString("full_point_code"));
param.put("container_name", container_name);
InCoolIvtTask inCoolIvtTask = new InCoolIvtTask();
String task_id = inCoolIvtTask.createTask(param);
// 4.插入明细
JSONObject jsonHotMst = hotMstTab.query("container_name = '" + container_name + "' and is_delete = '0' and bill_status <> '50'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotMst)) throw new BadRequestException("烘烤区出入主表不存在");
JSONObject hotParam = new JSONObject();
hotParam.put("task_id",task_id);
hotParam.put("iostorinv_id",jsonHotMst.getString("iostorinv_id"));
hotParam.put("start_point_code",point_code1);
hotParam.put("next_point_code",jsonCooIvt.getString("full_point_code"));
this.createHotDtl(hotParam);
// 5.下发任务
JSONObject jsonObject = inCoolIvtTask.renotifyAcs(task_id);
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
// 成功返回 更新任务状态
JSONObject jsonTask = taskTab.query("task_id ='" + task_id + "'").uniqueResult(0);
jsonTask.put("task_status", "05");
taskTab.update(jsonTask);
}
JSONObject result = new JSONObject();
result.put("message","操作成功!");
return result;
@@ -294,6 +369,7 @@ public class BakingServiceImpl implements BakingService {
jsonHotMst.put("workorder_id", jsonCoolIvt.getString("workorder_id"));
jsonHotMst.put("qty", jsonCoolIvt.getString("ivt_qty"));
jsonHotMst.put("bill_status", "10");
jsonHotMst.put("qty_unit_id", "1");
jsonHotMst.put("create_mode", "03");
jsonHotMst.put("task_id", param.getString("task_id"));
jsonHotMst.put("create_id", SecurityUtils.getCurrentUserId());

View File

@@ -125,8 +125,11 @@ public class RawFoilServiceImpl implements RawFoilService {
public JSONObject needEmptyAxis(JSONObject whereJson) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "01")) throw new BadRequestException("工单状态不为开始");
String start_pint_code = "";
// 2.根据就近原则查对应空卷抽
@@ -155,24 +158,24 @@ public class RawFoilServiceImpl implements RawFoilService {
map4.put("flag", "2");
map4.put("product_area", raw_jo.getString("product_area"));
map4.put("point_location", raw_jo.getString("point_location"));
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
JSONObject jsonIvt4 = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map4).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点
if (ObjectUtil.isEmpty(jsonIvt)) {
if (ObjectUtil.isEmpty(jsonIvt4)) {
String point_location = raw_jo.getString("point_location");
if (StrUtil.equals(point_location, "0")) {
map.put("point_location", "1");
map4.put("point_location", "1");
}
if (StrUtil.equals(point_location, "1")) {
map.put("point_location", "0");
map4.put("point_location", "0");
}
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map4).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt_tow)) {
throw new BadRequestException("没有空位");
}
point_code4 = jsonIvt_tow.getString("full_point_code");
} else {
point_code4 = jsonIvt.getString("full_point_code");
point_code4 = jsonIvt4.getString("full_point_code");
}
// 起点和终点确定 生成任务
JSONObject param = new JSONObject();
@@ -181,11 +184,15 @@ public class RawFoilServiceImpl implements RawFoilService {
param.put("point_code3", raw_jo.getString("point_code"));
param.put("point_code4", point_code4);
param.put("task_type", "010101");
param.put("material_code", whereJson.getString("container_name"));
param.put("material_code", raw_jo.getString("container_name"));
CallEmpReelTask callEmpReelTask = new CallEmpReelTask(null);
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
String task_id = callEmpReelTask.createTask(param);
// 更新工单状态
jsonRaw.put("status", "02");
rawTab.update(jsonRaw);
// 下发任务
JSONObject jsonObject = callEmpReelTask.renotifyAcs(task_id);
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
@@ -201,35 +208,39 @@ public class RawFoilServiceImpl implements RawFoilService {
@Override
public void confirmBlanking(JSONObject whereJson) {
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "02")) throw new BadRequestException("工单状态不为空轴搬出");
//查询该母卷号对应的任务
String container_name = whereJson.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
//下发ACS执行取满放空的AGV动作
// 更新工单状态为确认下卷
}
@Override
public JSONObject finishBlanking(JSONObject whereJson) {
String start_pint_code = whereJson.getString("point_code");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
String start_pint_code = raw_jo.getString("point_code");
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
//查询该母卷号对应的任务
String container_name = whereJson.getString("container_name");
String container_name = raw_jo.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(start_pint_code)) throw new BadRequestException("起点不能为空");
String end_point_code = "";
// 1.查询此点位是否存在
PointDto jsonPoint = pointService.findByCode(start_pint_code);
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("起点点位不存在");
JSONObject jsonRaw = rawTab.query("mfg_order_name = '" + raw_jo.getString("mfg_order_name") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonRaw.getString("status"), "03")) throw new BadRequestException("工单不为确认下卷");
/*// 2.根据就近原则查对应空卷抽
JSONObject map = new JSONObject();
@@ -256,24 +267,26 @@ public class RawFoilServiceImpl implements RawFoilService {
param.put("end_pint_code", end_point_code);
String task_id = bookTwoConfirmTask.createTask(param);*/
// 5.插入入库单
// 插入入库单
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonMater = materTab.query("material_code = '" + jsonCool.getString("product_name") + "'").uniqueResult(0);
// 测试暂时注释
// JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
JSONObject jsonRegion = new JSONObject();
jsonRegion.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonRegion.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
jsonRegion.put("io_type", "1");
jsonRegion.put("material_id", jsonMater.getString("material_id"));
// 测试暂时注释
// jsonRegion.put("material_id", jsonMater.getString("material_id"));
jsonRegion.put("pcsn", "");
jsonRegion.put("vehicle_code", "");
jsonRegion.put("qty", jsonCool.getString("productin_qty"));
jsonRegion.put("qty_unit_id", "");
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", "1");
jsonRegion.put("bill_status", "10");
jsonRegion.put("start_point_code", start_pint_code);
jsonRegion.put("end_point_code", end_point_code);
jsonRegion.put("start_point_code", task_jo.getString("point_code2"));
jsonRegion.put("end_point_code", task_jo.getString("point_code4"));
jsonRegion.put("cust_id", "");
jsonRegion.put("create_mode", "03");
jsonRegion.put("task_id", task_jo.getString("task_id"));
@@ -282,9 +295,13 @@ public class RawFoilServiceImpl implements RawFoilService {
jsonRegion.put("create_time", DateUtil.now());
regionTab.insert(jsonRegion);
// 6.下发任务入库任务
BookTwoConfirmTask bookTwoConfirmTask = new BookTwoConfirmTask(null);
JSONObject jsonObject = bookTwoConfirmTask.renotifyAcs(task_jo.getString("task_id"));
// 更新工单状态为下卷完成
jsonRaw.put("status", "04");
rawTab.update(jsonRaw);
// 下发任务入库任务
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
JSONObject jsonObject = callEmpReelTask.renotifyAcs(task_jo.getString("task_id"));
if (StrUtil.equals(jsonObject.getString("status"), "200")) {
// 成功返回 更新任务状态
JSONObject jsonTask = taskTab.query("task_id ='" + task_jo.getString("task_id") + "'").uniqueResult(0);
@@ -306,8 +323,13 @@ public class RawFoilServiceImpl implements RawFoilService {
public JSONObject finish(JSONObject whereJson) {
WQLObject coolTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + whereJson.getString("mfg_order_name") + "'").uniqueResult(0);
jsonCool.put("status", "2");
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonCool = coolTab.query("mfg_order_name = '" + raw_jo.getString("mfg_order_name") + "'").uniqueResult(0);
if (!StrUtil.equals(jsonCool.getString("status"), "04")) throw new BadRequestException("工单不为下卷完成");
jsonCool.put("status", "09");
jsonCool.put("realend_time", DateUtil.now());
jsonCool.put("finish_type", "02");
coolTab.update(jsonCool);

View File

@@ -16,6 +16,7 @@
输入.flag TYPEAS s_string
输入.reging_id TYPEAS s_string
输入.point_location TYPEAS s_string
输入.product_area TYPEAS s_string
[临时表]
@@ -59,6 +60,30 @@
point_location = 输入.point_location
ENDOPTION
order by point_code ASC
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "2"
QUERY
SELECT
*
FROM
ST_IVT_CoolPointIvt
WHERE
is_used = '1'
AND full_point_status = '01'
OPTION 输入.product_area <> ""
product_area = 输入.product_area
ENDOPTION
OPTION 输入.point_location <> ""
point_location = 输入.point_location
ENDOPTION
ENDSELECT
ENDQUERY

View File

@@ -132,7 +132,16 @@
IF 输入.flag = "5"
QUERY
SELECT
( CASE der.STATUS WHEN '1' THEN '开始' WHEN '2' THEN '结束' END ) AS status_name,
(
CASE
der.STATUS
WHEN '01' THEN '开始'
WHEN '02' THEN '空轴搬出'
WHEN '03' THEN '确认下卷'
WHEN '04' THEN '下卷完成'
WHEN '09' THEN '结束'
END
) AS status_name,
der.mfg_order_name AS mfg_order_name,
der.container_name AS container_name,
ivt.point_code,
@@ -145,13 +154,13 @@
der.product_area AS product_area,
der.update_time AS update_time,
ivt.point_location,
ivt.product_area
ivt.product_area,
der.workorder_id
FROM
PDM_BI_RawFoilWorkOrder der
LEFT JOIN st_ivt_sbpointivt ivt ON ivt.ext_code = der.resource_name
WHERE
der.status = '1'
AND der.is_delete = '0'
der.is_delete = '0'
OPTION 输入.point_code <> ""
der.resource_name = 输入.point_code

View File

@@ -34,7 +34,6 @@ import java.util.HashMap;
@Slf4j
public class CallEmpReelTask extends AbstractAcsTask {
private final String THIS_CLASS = CallEmpReelTask.class.getName();
private final CutConveyorTask conveyorTask;
@Override
@Transactional
@@ -55,6 +54,11 @@ public class CallEmpReelTask extends AbstractAcsTask {
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新冷却区出入表 状态为执行中
JSONObject jsonCool = coolTab.query("task_id = '" + task_id + "'").uniqueResult(0);
jsonCool.put("bill_status", "40");
coolTab.update(jsonCool);
// 更新任务状态为执行中
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
@@ -91,7 +95,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
// 更新冷却库存状态
JSONObject jsonRaw = rawTab.query("point_code ='" + point_code2 + "' AND status < 2 AND is_delete = '0'").uniqueResult(0);
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
jsonIvt2.put("full_point_status", "02");
jsonIvt2.put("instorage_time", DateUtil.now());
@@ -127,20 +131,22 @@ public class CallEmpReelTask extends AbstractAcsTask {
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
CutConveyorTask cutConveyorTask = new CutConveyorTask();
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
String point_code3 = form.getString("point_code3");
String point_code4 = form.getString("point_code4");
if (conveyorTask.isSingleTask(point_code1)){
if (cutConveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code2)){
if (cutConveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code3)){
if (cutConveyorTask.isSingleTask(point_code3)){
throw new BadRequestException("点位:"+point_code3+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code4)){
if (cutConveyorTask.isSingleTask(point_code4)){
throw new BadRequestException("点位:"+point_code4+"存在未完成的任务!");
}
@@ -148,6 +154,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_status", "01");
json.put("material_code", form.getString("material_code"));
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));

View File

@@ -154,10 +154,10 @@ public class CutConveyorTask extends AbstractAcsTask {
//判断该点位是否存在未完成的任务
public boolean isSingleTask(String point_code){
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code1 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code2 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code3 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Point").query("point_code4 = '"+point_code+"' AND task_status < '99' AND is_delete = '0'").uniqueResult(0);
JSONObject task1 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code1 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
JSONObject task2 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code2 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
JSONObject task3 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code3 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
JSONObject task4 = WQLObject.getWQLObject("SCH_BASE_Task").query("point_code4 = '"+point_code+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(task1) || ObjectUtil.isNotEmpty(task2) || ObjectUtil.isNotEmpty(task3) || ObjectUtil.isNotEmpty(task4)){
return true;

View File

@@ -0,0 +1,167 @@
package org.nl.wms.sch.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.dto.PointDto;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@RequiredArgsConstructor
@Slf4j
public class InCoolIvtTask extends AbstractAcsTask {
private final String THIS_CLASS = InCoolIvtTask.class.getName();
@Override
@Transactional
public void updateTaskStatus(JSONObject taskObj, String status) {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工序工单表
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱出入主表
WQLObject hotDtlTab = WQLObject.getWQLObject("ST_IVT_HotRegionIODtl"); // 烘箱出入明细表
String task_id = taskObj.getString("task_id");
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
if (StrUtil.equals(status,"0")) {
// 取消删除任务
taskTab.delete("task_id = '"+task_id+"'");
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
taskTab.update(jsonTask);
}
if(StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
// 更改任务状态为完成
jsonTask.put("task_status",TaskStatusEnum.FINISHED.getCode());
jsonTask.put("update_optid", SecurityUtils.getCurrentUserId());
jsonTask.put("update_optname", SecurityUtils.getCurrentUsername());
jsonTask.put("update_time", DateUtil.now());
taskTab.update(jsonTask);
String point_code1 = jsonTask.getString("point_code1");
String point_code2 = jsonTask.getString("point_code2");
PointService point = SpringContextHolder.getBean(PointService.class);
// 校验起点是否存在
PointDto startDto = point.findByCode(point_code1);
if (ObjectUtil.isEmpty(startDto)) throw new BadRequestException("起点未找到可用点位:" + point_code1);
// 校验终点是否存在
JSONObject jsonIvt = ivtTab.query("full_point_code ='" + point_code2 + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("终点未找到可用点位:" + point_code2);
// 更新暂存位状态为空位
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
jsonPoint.put("point_status","00");
pointTab.update(jsonPoint);
// 更新冷却库存状态
JSONObject jsonHotMst = hotMstTab.query("container_name = '" + jsonTask.getString("material_code") + "'").uniqueResult(0);
jsonIvt.put("full_point_status", "02");
jsonIvt.put("cool_ivt_status", "03");
jsonIvt.put("instorage_time", DateUtil.now());
jsonIvt.put("container_name", jsonHotMst.getString("container_name"));
jsonIvt.put("workorder_id", jsonHotMst.getString("workorder_id"));
jsonIvt.put("ivt_qty", jsonHotMst.getString("qty"));
ivtTab.update(jsonIvt);
// 更新烘烤出入主表为完成
jsonHotMst.put("bill_status", "50");
hotMstTab.update(jsonHotMst);
// 更新烘烤出入明细表为完成
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
jsonHotDtl.put("dtl_status", "50");
hotDtlTab.update(jsonHotDtl);
}
}
@Override
public void findStartPoint() {
}
@Override
public void findNextPoint() {
}
@Override
@Transactional
public String createTask(JSONObject form) {
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
CutConveyorTask cutConveyorTask = new CutConveyorTask();
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
if (cutConveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (cutConveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}
JSONObject json = new JSONObject();
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_type", "010204");
json.put("task_status", "01");
json.put("point_code1", point_code1);
json.put("point_code2", point_code2);
json.put("material_code", form.getString("container_name"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);
json.put("create_time", DateUtil.now());
json.put("priority","1" );
json.put("acs_task_type","4" );
tab.insert(json);
return json.getString("task_id");
}
@Override
@Transactional
public void forceFinish(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
}
@Override
public void pullBack(String task_id) {
}
@Override
public void cancel(String task_id) {
}
}

View File

@@ -24,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional;
@Slf4j
public class InHotTask extends AbstractAcsTask {
private final String THIS_CLASS = InHotTask.class.getName();
private final CutConveyorTask conveyorTask;
@Override
@Transactional
@@ -83,33 +82,61 @@ public class InHotTask extends AbstractAcsTask {
// 更新主表: 什么时候更新主表
JSONObject jsonHotMst = hotMstTab.query("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'").uniqueResult(0);
// 更新冷却区库存状态
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
String container_name = jsonCoolIvt.getString("container_name"); // 母卷号
String workorder_id = jsonCoolIvt.getString("workorder_id"); // 母卷工单标识
String ivt_qty = jsonCoolIvt.getString("ivt_qty"); // 库存
// 判断此任务是否有三个点位
if (ObjectUtil.isEmpty(jsonTask.getString("point_code3"))) {
/*
* 暂存区入烘箱任务
*/
// 更新烘箱区库存状态
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
jsonHotIvt.put("point_status", "02");
jsonHotIvt.put("container_name",jsonHotMst.getString("container_name"));
jsonHotIvt.put("workorder_id",jsonHotMst.getString("workorder_id") );
jsonHotIvt.put("ivt_qty",jsonHotMst.getString("qty") );
jsonHotIvt.put("instorage_time",DateUtil.now() );
jsonHotIvt.put("update_optid", currentUserId);
jsonHotIvt.put("update_optname", currentUsername);
jsonHotIvt.put("update_time", DateUtil.now());
hotIvtTab.update(jsonHotIvt);
jsonCoolIvt.put("full_point_status", "01");
jsonCoolIvt.put("container_name", "");
jsonCoolIvt.put("workorder_id", "");
jsonCoolIvt.put("ivt_qty", "0");
jsonCoolIvt.put("instorage_time", "");
jsonCoolIvt.put("update_optid", currentUserId);
jsonCoolIvt.put("update_optname", currentUsername);
jsonCoolIvt.put("update_time", DateUtil.now());
coolIvtTab.update(jsonCoolIvt);
// 更新暂存区点位状态为空位
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
jsonPoint.put("point_status", "00");
pointTab.update(jsonPoint);
} else {
/*
* 冷却区入烘箱任务
*/
// 更新冷却区库存状态
JSONObject jsonCoolIvt = coolIvtTab.query("full_point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
String container_name = jsonCoolIvt.getString("container_name"); // 母卷号
String workorder_id = jsonCoolIvt.getString("workorder_id"); // 母卷工单标识
String ivt_qty = jsonCoolIvt.getString("ivt_qty"); // 库存
jsonCoolIvt.put("full_point_status", "01");
jsonCoolIvt.put("container_name", "");
jsonCoolIvt.put("workorder_id", "");
jsonCoolIvt.put("ivt_qty", "0");
jsonCoolIvt.put("instorage_time", "");
jsonCoolIvt.put("update_optid", currentUserId);
jsonCoolIvt.put("update_optname", currentUsername);
jsonCoolIvt.put("update_time", DateUtil.now());
coolIvtTab.update(jsonCoolIvt);
// 更新烘箱区库存状态
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code3") + "'").uniqueResult(0);
jsonHotIvt.put("point_status", "02");
jsonHotIvt.put("container_name",container_name );
jsonHotIvt.put("workorder_id",workorder_id );
jsonHotIvt.put("ivt_qty",ivt_qty );
jsonHotIvt.put("instorage_time",DateUtil.now() );
jsonHotIvt.put("update_optid", currentUserId);
jsonHotIvt.put("update_optname", currentUsername);
jsonHotIvt.put("update_time", DateUtil.now());
hotIvtTab.update(jsonHotIvt);
}
// 更新烘箱区库存状态
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code3") + "'").uniqueResult(0);
jsonHotIvt.put("point_status", "02");
jsonHotIvt.put("container_name",container_name );
jsonHotIvt.put("workorder_id",workorder_id );
jsonHotIvt.put("ivt_qty",ivt_qty );
jsonHotIvt.put("instorage_time",DateUtil.now() );
jsonHotIvt.put("update_optid", currentUserId);
jsonHotIvt.put("update_optname", currentUsername);
jsonHotIvt.put("update_time", DateUtil.now());
hotIvtTab.update(jsonHotIvt);
}
}
@@ -127,39 +154,74 @@ public class InHotTask extends AbstractAcsTask {
@Transactional
public String createTask(JSONObject form) {
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
CutConveyorTask cutConveyorTask = new CutConveyorTask();
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
String point_code3 = form.getString("point_code3");
if (conveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code3)){
throw new BadRequestException("点位:"+point_code3+"存在未完成的任务!");
}
JSONObject json = new JSONObject();
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_type", "010201");
json.put("task_status", "01");
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);
json.put("create_time", DateUtil.now());
json.put("priority","1" );
json.put("acs_task_type","1" );
tab.insert(json);
String task_id = "";
return json.getString("task_id");
if (StrUtil.equals(form.getString("type"), "1")) {
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
String point_code3 = form.getString("point_code3");
if (cutConveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (cutConveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}
if (cutConveyorTask.isSingleTask(point_code3)){
throw new BadRequestException("点位:"+point_code3+"存在未完成的任务!");
}
JSONObject json = new JSONObject();
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_type", "010201");
json.put("task_status", "01");
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("point_code3", form.getString("point_code3"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);
json.put("create_time", DateUtil.now());
json.put("priority","1" );
json.put("acs_task_type","1" );
tab.insert(json);
task_id = json.getString("task_id");
}
if (StrUtil.equals(form.getString("type"), "2")) {
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
if (cutConveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (cutConveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}
JSONObject json = new JSONObject();
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_type", "010203");
json.put("task_status", "01");
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);
json.put("create_time", DateUtil.now());
json.put("priority","1" );
json.put("acs_task_type","1" );
tab.insert(json);
task_id = json.getString("task_id");
}
return task_id;
}
@Override

View File

@@ -20,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
@Slf4j
public class OutHotTask extends AbstractAcsTask {
private final String THIS_CLASS = OutHotTask.class.getName();
private final CutConveyorTask conveyorTask;
@Override
@Transactional
@@ -89,7 +88,7 @@ public class OutHotTask extends AbstractAcsTask {
jsonHotIvt.put("container_name","" );
jsonHotIvt.put("workorder_id","" );
jsonHotIvt.put("ivt_qty",0 );
jsonHotIvt.put("instorage_time",DateUtil.now() );
jsonHotIvt.put("instorage_time","");
jsonHotIvt.put("update_optid", currentUserId);
jsonHotIvt.put("update_optname", currentUsername);
jsonHotIvt.put("update_time", DateUtil.now());
@@ -111,15 +110,17 @@ public class OutHotTask extends AbstractAcsTask {
@Transactional
public String createTask(JSONObject form) {
WQLObject tab = WQLObject.getWQLObject("SCH_BASE_Task");
CutConveyorTask cutConveyorTask = new CutConveyorTask();
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
String point_code1 = form.getString("point_code1");
String point_code2 = form.getString("point_code2");
if (conveyorTask.isSingleTask(point_code1)){
if (cutConveyorTask.isSingleTask(point_code1)){
throw new BadRequestException("点位:"+point_code1+"存在未完成的任务!");
}
if (conveyorTask.isSingleTask(point_code2)){
if (cutConveyorTask.isSingleTask(point_code2)){
throw new BadRequestException("点位:"+point_code2+"存在未完成的任务!");
}

View File

@@ -30,11 +30,6 @@ task:
# 队列容量
queue-capacity: 50
#七牛云
qiniu:
# 文件大小 /M
max-size: 15
#邮箱验证码有效时间/秒
code:
expiration: 300
@@ -44,7 +39,7 @@ rsa:
private_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8mp0f3FE0GYP3AYPaJF7jUd1M0XxFSE2ceK3k2kw20YvQ09NJKk+OMjWQl9WitG9pB6tSCQIDAQABAkA2SimBrWC2/wvauBuYqjCFwLvYiRYqZKThUS3MZlebXJiLB+Ue/gUifAAKIg1avttUZsHBHrop4qfJCwAI0+YRAiEA+W3NK/RaXtnRqmoUUkb59zsZUBLpvZgQPfj1MhyHDz0CIQDYhsAhPJ3mgS64NbUZmGWuuNKp5coY2GIj/zYDMJp6vQIgUueLFXv/eZ1ekgz2Oi67MNCk5jeTF2BurZqNLR3MSmUCIFT3Q6uHMtsB9Eha4u7hS31tj1UWE+D+ADzp59MGnoftAiBeHT7gDMuqeJHPL4b+kC+gzV4FGTfhR9q3tTbklZkD2A==
logging:
file:
path: C:\log\wms
path: C:\log\lms
config: classpath:logback-spring.xml
# sa-token白名单配置
security: