Merge branch 'master_merge_dev' into master_merge

This commit is contained in:
2024-12-29 16:41:19 +08:00

View File

@@ -473,6 +473,7 @@ public class SlitterServiceImpl implements SlitterService {
// @Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public JSONObject mesSlittingMachineSendMaterial(JSONObject param) { public JSONObject mesSlittingMachineSendMaterial(JSONObject param) {
log.info("分切机下料的输入参数为:{}", param); log.info("分切机下料的输入参数为:{}", param);
String actualDeviceCode = param.getString("device_code");
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
// 获取子卷号数组 // 获取子卷号数组
JSONArray containers = param.getJSONArray("container"); JSONArray containers = param.getJSONArray("container");
@@ -501,6 +502,12 @@ public class SlitterServiceImpl implements SlitterService {
// 获得设备 // 获得设备
StIvtCutpointivt device = cutpointivtService.getOne(new LambdaQueryWrapper<StIvtCutpointivt>() StIvtCutpointivt device = cutpointivtService.getOne(new LambdaQueryWrapper<StIvtCutpointivt>()
.eq(StIvtCutpointivt::getExt_code, demoPlan.getResource_name())); .eq(StIvtCutpointivt::getExt_code, demoPlan.getResource_name()));
StIvtCutpointivt actualDevice = device;
if (!actualDeviceCode.equals(demoPlan.getResource_name())) {
// 如果设备与指定的设备不同
actualDevice = cutpointivtService.getOne(new LambdaQueryWrapper<StIvtCutpointivt>()
.eq(StIvtCutpointivt::getExt_code, actualDeviceCode));
}
String area = device.getProduct_area(); String area = device.getProduct_area();
// 获取当前分切机的下一组分切计划(最多四条分切计划) // 获取当前分切机的下一组分切计划(最多四条分切计划)
// hint: 获取到的分切可能是不同组的但具有一定时间顺序 // hint: 获取到的分切可能是不同组的但具有一定时间顺序
@@ -535,16 +542,16 @@ public class SlitterServiceImpl implements SlitterService {
// 创建任务 // 创建任务
if (currentUpPlan != null && currentDownPlan != null) { if (currentUpPlan != null && currentDownPlan != null) {
// 双轴任务 下双 // 双轴任务 下双
taskParam.put("point_code1", device.getUp_point_code()); taskParam.put("point_code1", actualDevice.getUp_point_code());
taskParam.put("point_code2", emptyPoint.getTruss_point_code1()); taskParam.put("point_code2", emptyPoint.getTruss_point_code1());
taskParam.put("point_code3", device.getDown_point_code()); taskParam.put("point_code3", actualDevice.getDown_point_code());
taskParam.put("point_code4", emptyPoint.getTruss_point_code2()); taskParam.put("point_code4", emptyPoint.getTruss_point_code2());
taskParam.put("truss_type", "1"); taskParam.put("truss_type", "1");
taskParam.put("empty_site", "0"); taskParam.put("empty_site", "0");
} else { } else {
// 单轴任务 下单 // 单轴任务 下单
taskParam.put("point_code1", currentUpPlan == null taskParam.put("point_code1", currentUpPlan == null
? device.getDown_point_code() : device.getUp_point_code()); ? actualDevice.getDown_point_code() : actualDevice.getUp_point_code());
taskParam.put("point_code2", currentUpPlan == null taskParam.put("point_code2", currentUpPlan == null
? emptyPoint.getTruss_point_code2() : emptyPoint.getTruss_point_code1()); ? emptyPoint.getTruss_point_code2() : emptyPoint.getTruss_point_code1());
taskParam.put("truss_type", "1"); taskParam.put("truss_type", "1");
@@ -590,9 +597,9 @@ public class SlitterServiceImpl implements SlitterService {
taskParam.put("point_code1", nextUpPlan != null taskParam.put("point_code1", nextUpPlan != null
? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2());
taskParam.put("point_code2", nextUpPlan != null taskParam.put("point_code2", nextUpPlan != null
? device.getUp_point_code() : device.getDown_point_code()); ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code());
taskParam.put("point_code3", currentUpPlan != null taskParam.put("point_code3", currentUpPlan != null
? device.getUp_point_code() : device.getDown_point_code()); ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code());
taskParam.put("point_code4", currentUpPlan != null taskParam.put("point_code4", currentUpPlan != null
? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2());
taskParam.put("truss_type", "1"); taskParam.put("truss_type", "1");
@@ -601,11 +608,11 @@ public class SlitterServiceImpl implements SlitterService {
case "01": case "01":
// 下单上双 // 下单上双
taskParam.put("point_code1", currentUpPlan != null taskParam.put("point_code1", currentUpPlan != null
? device.getUp_point_code() : device.getDown_point_code()); ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code());
taskParam.put("point_code2", currentUpPlan != null taskParam.put("point_code2", currentUpPlan != null
? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2());
taskParam.put("point_code3", currentUpPlan == null taskParam.put("point_code3", currentUpPlan == null
? device.getUp_point_code() : device.getDown_point_code()); ? actualDevice.getUp_point_code() : actualDevice.getDown_point_code());
taskParam.put("point_code4", currentUpPlan == null taskParam.put("point_code4", currentUpPlan == null
? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2()); ? newCutPoint.getTruss_point_code1() : newCutPoint.getTruss_point_code2());
taskParam.put("truss_type", "3"); taskParam.put("truss_type", "3");
@@ -613,18 +620,18 @@ public class SlitterServiceImpl implements SlitterService {
break; break;
case "10": case "10":
// 下双上单 // 下双上单
taskParam.put("point_code1", device.getUp_point_code()); taskParam.put("point_code1", actualDevice.getUp_point_code());
taskParam.put("point_code2", newCutPoint.getTruss_point_code1()); taskParam.put("point_code2", newCutPoint.getTruss_point_code1());
taskParam.put("point_code3", device.getDown_point_code()); taskParam.put("point_code3", actualDevice.getDown_point_code());
taskParam.put("point_code4", newCutPoint.getTruss_point_code2()); taskParam.put("point_code4", newCutPoint.getTruss_point_code2());
taskParam.put("truss_type", "4"); taskParam.put("truss_type", "4");
taskParam.put("empty_site", nextUpPlan == null ? "2" : "1"); taskParam.put("empty_site", nextUpPlan == null ? "2" : "1");
break; break;
case "11": case "11":
// 下双上双 // 下双上双
taskParam.put("point_code1", device.getUp_point_code()); taskParam.put("point_code1", actualDevice.getUp_point_code());
taskParam.put("point_code2", newCutPoint.getTruss_point_code1()); taskParam.put("point_code2", newCutPoint.getTruss_point_code1());
taskParam.put("point_code3", device.getDown_point_code()); taskParam.put("point_code3", actualDevice.getDown_point_code());
taskParam.put("point_code4", newCutPoint.getTruss_point_code2()); taskParam.put("point_code4", newCutPoint.getTruss_point_code2());
taskParam.put("truss_type", "2"); taskParam.put("truss_type", "2");
taskParam.put("empty_site", "3"); taskParam.put("empty_site", "3");
@@ -1140,6 +1147,7 @@ public class SlitterServiceImpl implements SlitterService {
// 调接口创建任务 // 调接口创建任务
JSONObject taskParam = new JSONObject(); JSONObject taskParam = new JSONObject();
taskParam.put("container", cons); taskParam.put("container", cons);
taskParam.put("device_code", outPlan.getResource_name());
try { try {
mesSlittingMachineSendMaterial(taskParam); mesSlittingMachineSendMaterial(taskParam);
} catch (Exception e) { } catch (Exception e) {