代码更新

This commit is contained in:
2022-11-02 14:27:11 +08:00
parent 56bffff406
commit 1259a360a3
17 changed files with 265 additions and 173 deletions

View File

@@ -79,4 +79,13 @@ public class WmsToAcsController {
}
@PostMapping("/updateTask")
@Log("WMS向acs发送更新任务状态")
@ApiOperation("WMS向acs发送更新任务状态")
public ResponseEntity<Object> updateTask(@RequestBody Map whereJson) {
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data")));
return new ResponseEntity<>(wmsToAcsService.updateTask(arr), HttpStatus.OK);
}
}

View File

@@ -55,4 +55,11 @@ public interface WmsToAcsService {
* @return
*/
JSONObject getPointStatus(JSONArray whereJson);
/**
* 更新任务状态
* @param arr /
* @return JSONObject
*/
JSONObject updateTask(JSONArray arr);
}

View File

@@ -54,4 +54,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
return AcsUtil.notifyAcs(api, whereJson);
}
@Override
public JSONObject updateTask(JSONArray whereJson) {
String api = "api/wms/updateTask";
return AcsUtil.notifyAcs(api, whereJson);
}
}

View File

@@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
@Slf4j
public class LmsToMesServiceImpl implements LmsToMesService {
public class LmsToMesServiceImpl implements LmsToMesService {
/**
* LMS的PDA操作AGV下卷AGV称重完成后AGV称重信息发送MES

View File

@@ -10,9 +10,11 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.ext.mes.service.MesToLmsService;
import org.nl.wms.log.LokiLog;
import org.nl.wms.log.LokiLogType;
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl;
import org.springframework.stereotype.Service;
import sun.security.krb5.internal.crypto.Des;
@@ -210,13 +212,40 @@ public class MesToLmsServiceImpl implements MesToLmsService {
@Override
public JSONObject momRollFoilComplete(JSONObject param) {
log.info("momRollFoilComplete接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
System.out.println(result);
WQLObject sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔点位库存表
try {
String resourceName = param.getString("ResourceName");
if (ObjectUtil.isEmpty(resourceName)) throw new BadRequestException("机台编码不能为空");
JSONObject jsonSb = sbTab.query("ext_code = '" + resourceName + "' and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSb)) throw new BadRequestException("点位设备不存在");
// 下发ACS更改任务状态
JSONArray paramArr = new JSONArray();
JSONObject json = new JSONObject();
json.put("device_code", jsonSb.getString("point_code"));
json.put("option ", "2");
paramArr.add(json);
JSONObject resultAcs = new WmsToAcsServiceImpl().updateTask(paramArr);
if (!StrUtil.equals(resultAcs.getString("status"), "200")) {
throw new BadRequestException(resultAcs.getString("message "));
}
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", resultAcs);
} catch (Exception e) {
result.put("RTYPE", "1");
result.put("RTMSG", "操作失败!"+e.getMessage());
result.put("RTOAL", 1);
result.put("RTDAT", null);
}
log.info("momRollFoilComplete接口输出参数为-------------------" + result.toString());
return result;
}
@@ -230,13 +259,74 @@ public class MesToLmsServiceImpl implements MesToLmsService {
@Override
public JSONObject momRollBakeNextSpecTransfer(JSONObject param) {
log.info("momRollBakeNextSpecTransfer接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
System.out.println(result);
WQLObject coolIvtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区点位库存表
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
JSONObject jsonParam = new JSONObject();
try {
String containerName = param.getString("ContainerName"); // 母卷号
String nextSpec = param.getString("NextSpec"); // 下工序1-入烘箱2-入冷却
String bakingTemperature = param.getString("BakingTemperature"); // 温度
String bakingTimer = param.getString("BakingTimer"); // 烘烤时间
if (ObjectUtil.isEmpty(containerName)) throw new BadRequestException("母卷号不能为空");
if (ObjectUtil.isEmpty(nextSpec)) throw new BadRequestException("下工序不能为空");
if (StrUtil.equals(nextSpec, "1")) {
/*
* 入烘箱
*/
if (ObjectUtil.isEmpty(bakingTemperature)) throw new BadRequestException("温度不能为空");
if (ObjectUtil.isEmpty(bakingTimer)) throw new BadRequestException("烘烤时间不能为空");
JSONObject jsonCoolIvt = coolIvtTab.query("container_name = '" + containerName + "' and full_point_status = '02' and cool_ivt_status <> '03'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonCoolIvt)) throw new BadRequestException("母卷不存在或已烘烤完成");
// 调用接口输入参数
jsonParam.put("option", "1");
jsonParam.put("container_name", containerName);
jsonParam.put("temperature", bakingTemperature);
jsonParam.put("hours", bakingTimer);
jsonParam.put("point_code", jsonCoolIvt.getString("full_point_code"));
// 调用手持接口
BakingServiceImpl bakingService = new BakingServiceImpl();
bakingService.ovenInAndOut(jsonParam);
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
} else {
/*
* 入冷却区
*/
JSONObject jsonPoint = pointTab.query("material_code = '" + containerName + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("母卷不存在");
// 调用接口输入参数
jsonParam.put("point_code", jsonPoint.getString("point_code"));
jsonParam.put("container_name", containerName);
// 调用手持接口
BakingServiceImpl bakingService = new BakingServiceImpl();
bakingService.inCoolIvt(jsonParam);
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");
result.put("RTOAL", 1);
result.put("RTDAT", null);
}
} catch (Exception e) {
result.put("RTYPE", "1");
result.put("RTMSG", "操作失败!"+e.getMessage());
result.put("RTOAL", 1);
result.put("RTDAT", null);
}
log.info("momRollBakeNextSpecTransfer接口输出参数为-------------------" + result.toString());
return result;
}

View File

@@ -48,7 +48,6 @@ public class RawFoilController {
@Log("呼叫空轴")
@ApiOperation("呼叫空轴")
public ResponseEntity<Object> needEmptyAxis(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(rawFoilService.needEmptyAxis(whereJson), HttpStatus.OK);
}

View File

@@ -12,7 +12,7 @@ public interface BakingService {
JSONObject ovenInAndOut(JSONObject whereJson);
/**
* 烘箱出
* 入冷却
* @param whereJson /
* @return JSONObject
*/

View File

@@ -26,14 +26,14 @@ public interface RawFoilService {
JSONObject queryRawFoilList(JSONObject whereJson);
/**
* 确认下卷
* 呼叫空卷轴
* @param whereJson /
* @return JSONObject
*/
JSONObject needEmptyAxis(JSONObject whereJson);
/**
* 查询生箔工单
* 下卷确认
* @param whereJson /
* @return JSONObject
*/

View File

@@ -53,6 +53,8 @@ public class BakingServiceImpl implements BakingService {
WQLObject hosIvtTab = WQLObject.getWQLObject("ST_IVT_HotPointIvt"); // 烤箱区点位库存表
WQLObject hosReMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烤箱区出入主表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
if (StrUtil.equals(option, "1")) {
@@ -100,15 +102,6 @@ public class BakingServiceImpl implements BakingService {
hotParam.put("temperature", temperature);
hotParam.put("oven_time", hours);
this.createHotDtl(hotParam);
// 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);
}*/
} else {
/*
* 冷却区入烘箱
@@ -201,15 +194,19 @@ public class BakingServiceImpl implements BakingService {
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
JSONObject jsonCool = new JSONObject();
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
jsonCool.put("io_type", "1");
jsonCool.put("material_id", "");
jsonCool.put("pcsn", "");
jsonCool.put("material_id", jsonMater.getString("material_id"));
jsonCool.put("pcsn", container_name);
jsonCool.put("bill_status", "10");
jsonCool.put("task_id", task_id);
jsonCool.put("qty_unit_id", "1");
jsonCool.put("qty_unit_id", jsonMater.getString("base_unit_id"));
jsonCool.put("start_point_code", point_code1);
jsonCool.put("end_point_code", jsonHotIvt.getString("point_code"));
jsonCool.put("create_mode", "03");
@@ -223,19 +220,6 @@ public class BakingServiceImpl implements BakingService {
jsonCool.put("confirm_optname", currentUsername);
jsonCool.put("confirm_time", DateUtil.now());
coolTab.insert(jsonCool);
// 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")) {
// 出箱
@@ -287,6 +271,7 @@ public class BakingServiceImpl implements BakingService {
JSONObject param = new JSONObject();
param.put("point_code1", point_code1);
param.put("point_code2", point_code2);
param.put("material_code", jsonHotIvt.getString("container_name"));
OutHotTask outHotTask = new OutHotTask();
String task_id = outHotTask.createTask(param);
@@ -301,15 +286,6 @@ public class BakingServiceImpl implements BakingService {
hotParam.put("start_point_code", point_code1);
hotParam.put("next_point_code", point_code2);
this.createHotDtl(hotParam);
// 5.下发任务
/* JSONObject jsonObject = outHotTask.immediateNotifyAcs();
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", "操作成功!");
@@ -319,10 +295,12 @@ 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");
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point"); // 点位点
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
WQLObject hotMstTab = WQLObject.getWQLObject("ST_IVT_HotRegionIOMst"); // 烘箱出入主表
WQLObject coolTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料表
String point_code1 = whereJson.getString("point_code"); // 暂存位:起点
@@ -373,14 +351,18 @@ public class BakingServiceImpl implements BakingService {
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonRaw = rawTab.query("container_name = '" + container_name + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("物料不存在");
JSONObject jsonCool = new JSONObject();
jsonCool.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
jsonCool.put("bill_code", CodeUtil.getNewCode("COOLREGION_BILL_CODE"));
jsonCool.put("io_type", "0");
jsonCool.put("material_id", "");
jsonCool.put("pcsn", "");
jsonCool.put("material_id", jsonMater.getString("material_id"));
jsonCool.put("pcsn", container_name);
jsonCool.put("bill_status", "10");
jsonCool.put("qty_unit_id", "1");
jsonCool.put("qty_unit_id", jsonMater.get("base_unit_id"));
jsonCool.put("task_id", task_id);
jsonCool.put("start_point_code", point_code1);
jsonCool.put("end_point_code", jsonCooIvt.getString("full_point_code"));
@@ -396,15 +378,6 @@ public class BakingServiceImpl implements BakingService {
jsonCool.put("confirm_time", DateUtil.now());
coolTab.insert(jsonCool);
// 5.下发任务
/* JSONObject jsonObject = inCoolIvtTask.immediateNotifyAcs();
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;

View File

@@ -16,6 +16,7 @@ import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.pda.mps.service.RawFoilService;
import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.tasks.CallEmpReelTask;
@@ -124,6 +125,9 @@ public class RawFoilServiceImpl implements RawFoilService {
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
WQLObject regionTab = WQLObject.getWQLObject("ST_IVT_CoolRegionIO"); // 冷却区出入表
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase"); // 物料信息表
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
@@ -187,6 +191,33 @@ public class RawFoilServiceImpl implements RawFoilService {
CallEmpReelTask callEmpReelTask = new CallEmpReelTask();
String task_id = callEmpReelTask.createTask(param);
// 插入入库单
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject jsonMater = materTab.query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("产品不存在");
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("pcsn", jsonRaw.getString("container_name"));
jsonRegion.put("vehicle_code", "");
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", jsonMater.get("base_unit_id"));
jsonRegion.put("bill_status", "10");
jsonRegion.put("start_point_code", jsonRaw.getString("point_code"));
jsonRegion.put("end_point_code", point_code4);
jsonRegion.put("cust_id", "");
jsonRegion.put("create_mode", "03");
jsonRegion.put("task_id", task_id);
jsonRegion.put("create_id", currentUserId);
jsonRegion.put("create_name", currentUsername);
jsonRegion.put("create_time", DateUtil.now());
regionTab.insert(jsonRegion);
// 更新工单状态
jsonRaw.put("status", "02");
rawTab.update(jsonRaw);
@@ -198,7 +229,8 @@ public class RawFoilServiceImpl implements RawFoilService {
@Override
public void confirmBlanking(JSONObject whereJson) {
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder");
WQLObject rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单
WQLObject sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔点位库存表
JSONObject raw_jo = whereJson.getJSONObject("raw_jo");
JSONObject jsonRaw = rawTab.query("workorder_id = '" + raw_jo.getString("workorder_id") + "'").uniqueResult(0);
@@ -207,9 +239,25 @@ public class RawFoilServiceImpl implements RawFoilService {
//查询该母卷号对应的任务
String container_name = whereJson.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"' and task_status <> '07'").uniqueResult(0);
// 查询生箔点位库存表
JSONObject jsonSb = sbTab.query("ext_code = '" + jsonRaw.getString("resource_name") + "'and is_used = '1'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSb)) throw new BadRequestException("点位不存在");
//下发ACS执行取满放空的AGV动作
JSONArray paramArr = new JSONArray();
JSONObject param = new JSONObject();
param.put("device_code", jsonSb.getString("point_code"));
param.put("option ", "1");
paramArr.add(param);
WmsToAcsServiceImpl wmsToAcsService = new WmsToAcsServiceImpl();
JSONObject result = wmsToAcsService.updateTask(paramArr);
if (!StrUtil.equals(result.getString("status"), "200")) {
throw new BadRequestException("操作失败:"+result.getString("message "));
}
// 更新工单状态为确认下卷
jsonRaw.put("status","03");
@@ -220,92 +268,15 @@ public class RawFoilServiceImpl implements RawFoilService {
public JSONObject finishBlanking(JSONObject whereJson) {
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 rawTab = WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder"); // 生箔工单表
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
//查询该母卷号对应的任务
String container_name = raw_jo.getString("container_name");
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("material_code = '"+container_name+"'").uniqueResult(0);
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();
map.put("flag", "2");
map.put("product_area", jsonPoint.getProduct_area());
map.put("point_location", jsonPoint.getPoint_location());
JSONObject jsonIvt = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
// 3.如果没找到则继续找下一节点
if (ObjectUtil.isEmpty(jsonIvt)) {
String point_location = jsonPoint.getPoint_location();
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt_tow)) throw new BadRequestException("没有空位");
end_point_code = jsonIvt_tow.getString("full_point_code");
} else {
end_point_code = jsonIvt.getString("full_point_code");
}
// 4.起点和终点确定 生成任务
JSONObject param = new JSONObject();
param.put("start_pint_code", start_pint_code);
param.put("end_pint_code", end_point_code);
String task_id = bookTwoConfirmTask.createTask(param);*/
// 插入入库单
Long currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
// 测试暂时注释
// 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("pcsn", "");
jsonRegion.put("vehicle_code", "");
jsonRegion.put("qty", jsonRaw.getString("productin_qty"));
jsonRegion.put("qty_unit_id", "1");
jsonRegion.put("bill_status", "10");
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"));
jsonRegion.put("create_id", currentUserId);
jsonRegion.put("create_name", currentUsername);
jsonRegion.put("create_time", DateUtil.now());
regionTab.insert(jsonRegion);
// 更新工单状态为下卷完成
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);
jsonTask.put("task_status", "05");
taskTab.update(jsonTask);
// 更新出入表状态
jsonRegion.put("bill_status", "30");
jsonRegion.put("update_optid", currentUserId);
jsonRegion.put("update_optname", currentUsername);
jsonRegion.put("update_time", DateUtil.now());
regionTab.update(jsonRegion);
}*/
JSONObject jo = new JSONObject();
jo.put("message", "操作成功!");
return jo;

View File

@@ -59,12 +59,12 @@ public class CallEmpReelTask extends AbstractAcsTask {
@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 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 sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔工序工单
WQLObject sbTab = WQLObject.getWQLObject("st_ivt_sbpointivt"); // 生箔区域点位
String task_id = taskObj.getString("task_id");
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
@@ -72,18 +72,36 @@ public class CallEmpReelTask extends AbstractAcsTask {
if (StrUtil.equals(status, "0")) {
// 取消删除任务
taskTab.delete("task_id = '" + task_id + "'");
// 删除冷却区出入单据
coolTab.delete("task_id = '"+task_id+"'");
// 更新生箔工单状态为开始、清除称重信息
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
jsonRaw.put("status", "01");
jsonRaw.put("productin_qty", 0);
rawTab.update(jsonRaw);
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
taskTab.update(jsonTask);
// 更新冷却区出入表 状态为执行中
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());
taskTab.update(jsonTask);
// 更新生箔工单称重信息
String weight = taskObj.getString("weight");
if (ObjectUtil.isNotEmpty(weight)) {
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
jsonRaw.put("productin_qty", taskObj.getDoubleValue(weight));
rawTab.update(jsonRaw);
}
}
if (StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
@@ -178,7 +196,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
JSONObject json = new JSONObject();
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_status", "01");
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("material_code", form.getString("material_code"));
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));

View File

@@ -74,6 +74,12 @@ public class InCoolIvtTask extends AbstractAcsTask {
if (StrUtil.equals(status,"0")) {
// 取消删除任务
taskTab.delete("task_id = '"+task_id+"'");
// 删除烘箱任务明细
hotDtlTab.delete("task_id = '"+task_id+"'");
// 删除冷却区出入表
coolTab.delete("task_id = '"+task_id+"'");
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
@@ -106,7 +112,8 @@ public class InCoolIvtTask extends AbstractAcsTask {
// 更新暂存位状态为空位
JSONObject jsonPoint = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);
jsonPoint.put("point_status","00");
jsonPoint.put("point_status","1");
jsonPoint.put("material_code","");
pointTab.update(jsonPoint);
// 更新冷却库存状态
@@ -168,7 +175,7 @@ public class InCoolIvtTask extends AbstractAcsTask {
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("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("point_code1", point_code1);
json.put("point_code2", point_code2);
json.put("material_code", form.getString("container_name"));

View File

@@ -69,9 +69,21 @@ public class InHotTask extends AbstractAcsTask {
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
if (StrUtil.equals(status,"0")) {
// 判断此条明细是否是冷却区 -> 烘箱,是则删除主表
if (ObjectUtil.isNotEmpty(jsonTask.getString("point_code3"))) {
JSONObject jsonHotDtl = hotDtlTab.query("task_id = '" + task_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonHotDtl)) throw new BadRequestException("明细单据不存在");
hotMstTab.delete("iostorinv_id = '"+jsonHotDtl.getString("iostorinv_id")+"'");
}
// 取消删除任务
taskTab.delete("task_id = '"+task_id+"'");
}
// 删除烘箱明细
hotDtlTab.delete("task_id = '"+task_id+"'");
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
// 更新任务状态为执行中
@@ -131,7 +143,8 @@ public class InHotTask extends AbstractAcsTask {
// 更新暂存区点位状态为空位
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
jsonPoint.put("point_status", "00");
jsonPoint.put("point_status", "1");
jsonPoint.put("material_code", "");
pointTab.update(jsonPoint);
} else {
/*
@@ -213,7 +226,7 @@ public class InHotTask extends AbstractAcsTask {
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("task_status", TaskStatusEnum.START_AND_POINT.getCode());
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

@@ -68,6 +68,9 @@ public class OutHotTask extends AbstractAcsTask {
if (StrUtil.equals(status,"0")) {
// 取消删除任务
taskTab.delete("task_id = '"+task_id+"'");
// 删除出入烘箱任务明细
hotDtlTab.delete("task_id = '"+task_id+"'");
}
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
@@ -81,10 +84,6 @@ public class OutHotTask extends AbstractAcsTask {
jsonHotDtl.put("dtl_status", "40");
hotDtlTab.update(jsonHotDtl);
// 更新主表状态
// JSONObject jsonHotMst = hotMstTab.query("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'").uniqueResult(0);
// jsonHotMst.put("bill_status", "40");
// hotMstTab.update(jsonHotMst);
}
if(StrUtil.equals(status, TaskStatusEnum.FINISHED.getCode())) {
@@ -110,12 +109,14 @@ public class OutHotTask extends AbstractAcsTask {
JSONObject jsonHotMst = hotMstTab.query("iostorinv_id = '" + jsonHotDtl.getString("iostorinv_id") + "'").uniqueResult(0);
// 更新暂存区点位状态
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
JSONObject jsonPoint2 = pointTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
jsonPoint2.put("point_status", "02");
jsonPoint2.put("point_status", "2");
jsonPoint2.put("material_code", jsonHotIvt.getString("container_name"));
pointTab.update(jsonPoint2);
// 更新烘箱区库存状态
JSONObject jsonHotIvt = hotIvtTab.query("point_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
jsonHotIvt.put("point_status", "00");
jsonHotIvt.put("container_name","" );
jsonHotIvt.put("workorder_id","" );
@@ -160,9 +161,10 @@ public class OutHotTask extends AbstractAcsTask {
json.put("task_id",IdUtil.getSnowflake(1,1).nextId());
json.put("task_code", CodeUtil.getNewCode("TASK_CODE"));
json.put("task_type", "010202");
json.put("task_status", "01");
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("material_code", form.getString("material_code"));
json.put("sort_seq", "1");
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);