fix:拼单逻辑修改
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
WHERE bic.point_type = #{type}
|
||||
AND bic.is_used = '1'
|
||||
AND bic.point_status = #{pointStatus}
|
||||
AND bic.point_location = #{area}
|
||||
<if test="area != null and area != ''">
|
||||
AND bic.point_location = #{area}
|
||||
</if>
|
||||
AND 0 = (SELECT COUNT(*)
|
||||
FROM sch_base_task t
|
||||
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07'
|
||||
|
||||
@@ -153,13 +153,16 @@ public class SlitterDownNewTrussTask extends AbstractAcsTask {
|
||||
JSONObject requestParam = JSONObject.parseObject(task.getRequest_param());
|
||||
// 下来的分切计划
|
||||
JSONArray downContainers = requestParam.getJSONArray("down_roll");
|
||||
List<String> downCons = downContainers.toJavaList(String.class);
|
||||
if (!downCons.isEmpty()) {
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("05");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getContainer_name, downCons));
|
||||
if (ObjectUtil.isNotEmpty(downContainers)){
|
||||
List<String> downCons = downContainers.toJavaList(String.class);
|
||||
if (!downCons.isEmpty()) {
|
||||
JSONObject downCon = downContainers.getJSONObject(0);
|
||||
PdmBiSlittingproductionplan p = new PdmBiSlittingproductionplan();
|
||||
p.setStatus("05");
|
||||
TaskUtils.updateOptMessageBySlitterPlan(p);
|
||||
slittingproductionplanService.update(p, new LambdaQueryWrapper<PdmBiSlittingproductionplan>()
|
||||
.in(PdmBiSlittingproductionplan::getQzzno, downCon.getString("qzzno")));
|
||||
}
|
||||
}
|
||||
// 上去的分切计划状态:04 -> 03
|
||||
if (ObjectUtil.isNotEmpty(nextPlanQzzNo)) {
|
||||
@@ -257,7 +260,9 @@ public class SlitterDownNewTrussTask extends AbstractAcsTask {
|
||||
public List<PdmBiSlittingproductionplan> updateDownRollPlan(JSONObject requestParam) {
|
||||
// 下来的分切计划状态:06 -> 09, 不在需要设置重量
|
||||
JSONArray downContainers = requestParam.getJSONArray("down_roll");
|
||||
List<String> downCons = downContainers.toJavaList(String.class);
|
||||
List<String> downCons = downContainers.stream()
|
||||
.map(obj -> ((JSONObject) obj).getString("container_name"))
|
||||
.collect(Collectors.toList());
|
||||
log.info("即将下卷的上下轴的子卷号数据:{}", downCons);
|
||||
List<PdmBiSlittingproductionplan> downPlans = slittingproductionplanService.getByContainerNames(downCons);
|
||||
// 下来的卷的集合
|
||||
@@ -317,7 +322,7 @@ public class SlitterDownNewTrussTask extends AbstractAcsTask {
|
||||
cutpointivtService.updateById(devicePoint);
|
||||
// 站点赋值
|
||||
trussPoint.setPoint_status("3");
|
||||
if (trussPoint.getTruss_point_code1().equals(task.getPoint_code4())) {
|
||||
if (trussPoint.getTruss_point_code1().equals(task.getPoint_code2())) {
|
||||
trussPoint.setQzz_no1(pdmBiSlittingproductionplans.get(0).getQzzno());
|
||||
} else {
|
||||
trussPoint.setQzz_no2(pdmBiSlittingproductionplans.get(0).getQzzno());
|
||||
@@ -370,7 +375,7 @@ public class SlitterDownNewTrussTask extends AbstractAcsTask {
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setPoint_code3(form.getString("point_code3"));
|
||||
task.setPoint_code4(form.getString("point_code4"));
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code(form.getString("vehicle_code"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("6");
|
||||
task.setIs_delete("0");
|
||||
|
||||
@@ -145,7 +145,7 @@ public class TrussDisassemblyCacheTask extends AbstractAcsTask {
|
||||
deliverycachepointivtService.updateById(endPointObj);
|
||||
|
||||
if (endPointObj2 != null) {
|
||||
endPointObj2.setQzzno(task.getVehicle_code());
|
||||
endPointObj2.setQzzno(task.getVehicle_code2());
|
||||
endPointObj2.setPoint_status("02");
|
||||
TaskUtils.updateOptMessageByCachePoint(endPointObj2);
|
||||
deliverycachepointivtService.updateById(endPointObj2);
|
||||
@@ -188,6 +188,8 @@ public class TrussDisassemblyCacheTask extends AbstractAcsTask {
|
||||
: TaskStatusEnum.START_AND_POINT.getCode());
|
||||
task.setPoint_code1(form.getString("point_code1"));
|
||||
task.setPoint_code2(form.getString("point_code2"));
|
||||
task.setPoint_code3(form.getString("point_code3"));
|
||||
task.setPoint_code4(form.getString("point_code4"));
|
||||
task.setVehicle_code(form.getString("vehicle_code1"));
|
||||
task.setVehicle_code2(form.getString("vehicle_code2"));
|
||||
task.setAcs_task_type("6");
|
||||
|
||||
@@ -382,10 +382,10 @@
|
||||
INNER JOIN pdm_bi_slittingproductionplan p
|
||||
ON p.is_delete = '0'
|
||||
AND p.status = '03'
|
||||
AND p.resource_name = #{point_code}
|
||||
AND (p.qzzno = sd.qzz_no1 OR p.qzzno = sd.qzz_no2)
|
||||
WHERE sd.product_area = #{area}
|
||||
AND sd.point_location = #{location}
|
||||
AND p.resource_name = #{ext_code}
|
||||
AND p.qzzno = sd.qzzno
|
||||
WHERE sd.product_area = #{product_area}
|
||||
AND sd.point_location = #{point_location}
|
||||
AND sd.point_status = '02'
|
||||
AND sd.point_type = '02'
|
||||
AND sd.is_used = '1'
|
||||
|
||||
@@ -778,6 +778,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("up_roll", nextUpPlan != null ? nextUpPlans : nextDownPlans);
|
||||
// 下来的子卷好
|
||||
taskParam.put("down_roll", currentUpPlan != null ? currentUpPlans : currentDownPlans);
|
||||
taskParam.put("to_Task1_Axis_Type", demo.getQzz_size());
|
||||
break;
|
||||
case "01":
|
||||
// 下单上双(下单上单 + 单上 任务)
|
||||
@@ -788,32 +789,65 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
if (ObjectUtil.isEmpty(ivt1) || ObjectUtil.isEmpty(ivt2)) {
|
||||
throw new BadRequestException("没找到完整的气胀轴为空气胀轴暂存点!");
|
||||
}
|
||||
taskParam.put("point_code1", ivt1.getPoint_code());
|
||||
taskParam.put("point_code2", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code4", slitterDownNewADto.getTruss_code());
|
||||
taskParam.put("truss_type", "13");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("groupId", groupId);
|
||||
// 上去的气胀轴编码
|
||||
taskParam.put("vehicle_code", nextUpPlan.getQzzno());
|
||||
// 下来的子卷的气胀轴编码
|
||||
taskParam.put("vehicle_code2", currentUpPlan.getQzzno());
|
||||
// 上去的子卷号
|
||||
taskParam.put("up_roll", nextUpPlans);
|
||||
// 下来的子卷好
|
||||
taskParam.put("down_roll", currentUpPlans);
|
||||
taskParam.put("flag", "1"); // 标记是上单下单的
|
||||
if (currentUpPlan !=null){
|
||||
taskParam.put("point_code1", ivt1.getPoint_code());
|
||||
taskParam.put("point_code2", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code4", slitterDownNewADto.getTruss_code());
|
||||
taskParam.put("truss_type", "10");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("groupId", groupId);
|
||||
// 上去的气胀轴编码
|
||||
taskParam.put("vehicle_code", nextUpPlan.getQzzno());
|
||||
// 下来的子卷的气胀轴编码
|
||||
taskParam.put("vehicle_code2", currentUpPlan.getQzzno());
|
||||
// 上去的子卷号
|
||||
taskParam.put("up_roll", nextUpPlans);
|
||||
// 下来的子卷好
|
||||
taskParam.put("down_roll", currentUpPlans);
|
||||
taskParam.put("flag", "1"); // 标记是上单下单的
|
||||
taskParam.put("to_Task1_Axis_Type", nextUpPlan.getQzz_size());
|
||||
|
||||
taskParam2.put("point_code1", ivt2.getPoint_code());
|
||||
taskParam2.put("point_code2", actualDevice.getDown_point_code());
|
||||
taskParam2.put("truss_type", "13");
|
||||
taskParam2.put("empty_site", "0");
|
||||
taskParam2.put("groupId", groupId);
|
||||
// 上去的气胀轴编码
|
||||
taskParam2.put("vehicle_code", nextDownPlan.getQzzno());
|
||||
taskParam2.put("up_roll", nextDownPlans);
|
||||
taskParam2.put("flag", "3");
|
||||
taskParam2.put("point_code1", ivt2.getPoint_code());
|
||||
taskParam2.put("point_code2", actualDevice.getDown_point_code());
|
||||
taskParam2.put("truss_type", "9");
|
||||
taskParam2.put("empty_site", "0");
|
||||
taskParam2.put("groupId", groupId);
|
||||
// 上去的气胀轴编码
|
||||
taskParam2.put("vehicle_code", nextDownPlan.getQzzno());
|
||||
taskParam2.put("up_roll", nextDownPlans);
|
||||
taskParam2.put("flag", "3");
|
||||
taskParam2.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
}else {
|
||||
taskParam.put("point_code1", ivt1.getPoint_code());
|
||||
taskParam.put("point_code2", actualDevice.getDown_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getDown_point_code());
|
||||
taskParam.put("point_code4", slitterDownNewADto.getTruss_code());
|
||||
taskParam.put("truss_type", "10");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("groupId", groupId);
|
||||
// 上去的气胀轴编码
|
||||
taskParam.put("vehicle_code", nextDownPlan.getQzzno());
|
||||
// 下来的子卷的气胀轴编码
|
||||
taskParam.put("vehicle_code2", currentDownPlan.getQzzno());
|
||||
// 上去的子卷号
|
||||
taskParam.put("up_roll", nextDownPlans);
|
||||
// 下来的子卷好
|
||||
taskParam.put("down_roll", currentDownPlans);
|
||||
taskParam.put("flag", "1"); // 标记是上单下单的
|
||||
taskParam.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
|
||||
taskParam2.put("point_code1", ivt2.getPoint_code());
|
||||
taskParam2.put("point_code2", actualDevice.getUp_point_code());
|
||||
taskParam2.put("truss_type", "9");
|
||||
taskParam2.put("empty_site", "0");
|
||||
taskParam2.put("groupId", groupId);
|
||||
// 上去的气胀轴编码
|
||||
taskParam2.put("vehicle_code", nextUpPlan.getQzzno());
|
||||
taskParam2.put("up_roll", nextUpPlans);
|
||||
taskParam2.put("flag", "3");
|
||||
taskParam2.put("to_Task1_Axis_Type", nextUpPlan.getQzz_size());
|
||||
}
|
||||
break;
|
||||
case "10":
|
||||
// 下双上单(下单上单 + 单下 任务) : 先下上面的卷
|
||||
@@ -834,7 +868,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("point_code2", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code4", slitterDownNewA1Dto.getTruss_code());
|
||||
taskParam.put("truss_type", "14");
|
||||
taskParam.put("truss_type", "10");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("groupId", groupId);
|
||||
taskParam.put("seq", 1);
|
||||
@@ -847,10 +881,11 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 下来的子卷好
|
||||
taskParam.put("down_roll", currentUpPlans);
|
||||
taskParam.put("flag", "1"); // 标记是上单下单的
|
||||
taskParam.put("to_Task1_Axis_Type", nextUpPlan.getQzz_size());
|
||||
// 单下
|
||||
taskParam2.put("point_code1", actualDevice.getDown_point_code());
|
||||
taskParam2.put("point_code2", slitterDownNewB1Dto.getTruss_code());
|
||||
taskParam2.put("truss_type", "14");
|
||||
taskParam2.put("truss_type", "1");
|
||||
taskParam2.put("empty_site", "0");
|
||||
taskParam2.put("groupId", groupId);
|
||||
taskParam2.put("seq", 2);
|
||||
@@ -863,7 +898,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 下一个是分切机下面的轴(第一个任务就是2点任务)
|
||||
taskParam.put("point_code1", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code2", slitterDownNewA1Dto.getTruss_code());
|
||||
taskParam.put("truss_type", "14");
|
||||
taskParam.put("truss_type", "1");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("groupId", groupId);
|
||||
taskParam.put("seq", 1);
|
||||
@@ -877,7 +912,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam2.put("point_code2", actualDevice.getDown_point_code());
|
||||
taskParam2.put("point_code3", actualDevice.getDown_point_code());
|
||||
taskParam2.put("point_code4", slitterDownNewB1Dto.getTruss_code());
|
||||
taskParam2.put("truss_type", "14");
|
||||
taskParam2.put("truss_type", "10");
|
||||
taskParam2.put("empty_site", "0");
|
||||
taskParam2.put("groupId", groupId);
|
||||
taskParam2.put("seq", 2);
|
||||
@@ -890,6 +925,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
// 下来的子卷好
|
||||
taskParam2.put("down_roll", currentDownPlans);
|
||||
taskParam2.put("flag", "1"); // 标记是上单下单的
|
||||
taskParam2.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
}
|
||||
break;
|
||||
case "11":
|
||||
@@ -909,7 +945,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("point_code2", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code3", actualDevice.getUp_point_code());
|
||||
taskParam.put("point_code4", slitterDownNewA2Dto.getTruss_code());
|
||||
taskParam.put("truss_type", "11");
|
||||
taskParam.put("truss_type", "10");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("groupId", groupId);
|
||||
taskParam.put("seq", 1);
|
||||
@@ -922,12 +958,13 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("up_roll", nextUpPlans);
|
||||
// 下来的子卷好
|
||||
taskParam.put("down_roll", currentUpPlans);
|
||||
taskParam.put("to_Task1_Axis_Type", nextUpPlan.getQzz_size());
|
||||
|
||||
taskParam2.put("point_code1", ivtDown.getPoint_code());
|
||||
taskParam2.put("point_code2", actualDevice.getDown_point_code());
|
||||
taskParam2.put("point_code3", actualDevice.getDown_point_code());
|
||||
taskParam2.put("point_code4", slitterDownNewB2Dto.getTruss_code());
|
||||
taskParam2.put("truss_type", "11");
|
||||
taskParam2.put("truss_type", "10");
|
||||
taskParam2.put("empty_site", "0");
|
||||
taskParam2.put("groupId", groupId);
|
||||
taskParam2.put("seq", 2);
|
||||
@@ -940,6 +977,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam2.put("up_roll", nextDownPlans);
|
||||
// 下来的子卷好
|
||||
taskParam2.put("down_roll", currentDownPlans);
|
||||
taskParam2.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("错误表达式");
|
||||
@@ -2530,8 +2568,10 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("point_code2", device.getDown_point_code());
|
||||
taskParam.put("point_code3", upNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code4", device.getUp_point_code());
|
||||
taskParam.put("vehicle_code1", upNeedPoint.getQzzno());
|
||||
taskParam.put("vehicle_code2", downNeedPoint.getQzzno());
|
||||
taskParam.put("vehicle_code1", downNeedPoint.getQzzno());
|
||||
taskParam.put("vehicle_code2", upNeedPoint.getQzzno());
|
||||
taskParam.put("to_Task1_Axis_Type", nextUpPlan.getQzz_size());
|
||||
taskParam.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
log.info("双轴任务构建完成,上轴卷:{},下轴卷:{}", upNeedPoint.getQzzno(), downNeedPoint.getQzzno());
|
||||
} else {
|
||||
// 单轴任务
|
||||
@@ -2542,6 +2582,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("point_code1", upNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code2", device.getUp_point_code());
|
||||
taskParam.put("vehicle_code1", upNeedPoint.getQzzno());
|
||||
taskParam.put("to_Task1_Axis_Type", nextUpPlan.getQzz_size());
|
||||
log.info("单上轴任务,卷号:{}", upNeedPoint.getQzzno());
|
||||
} else if (nextDownPlan != null) {
|
||||
if (downNeedPoint == null) {
|
||||
@@ -2550,6 +2591,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
taskParam.put("point_code1", downNeedPoint.getPoint_code());
|
||||
taskParam.put("point_code2", device.getDown_point_code());
|
||||
taskParam.put("vehicle_code1", downNeedPoint.getQzzno());
|
||||
taskParam.put("to_Task1_Axis_Type", nextDownPlan.getQzz_size());
|
||||
log.info("单下轴任务,卷号:{}", downNeedPoint.getQzzno());
|
||||
} else {
|
||||
log.error("未找到上轴/下轴类型计划,plans:{}", plans);
|
||||
@@ -2558,7 +2600,7 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
}
|
||||
|
||||
// 7. 公共任务参数
|
||||
taskParam.put("truss_type", "1");
|
||||
taskParam.put("truss_type", "9");
|
||||
taskParam.put("empty_site", "0");
|
||||
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("缓存上空轴任务"));
|
||||
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||
@@ -2593,15 +2635,25 @@ public class SlitterServiceImpl implements SlitterService {
|
||||
log.info("获取下一组分切计划:{}", timePlans);
|
||||
if (timePlans.size() > 0) {
|
||||
// 寻找备好轴的对接点位
|
||||
StIvtCutpointivt deviceInfo = cutpointivtService.getPintByExtCode(deviceCode, true);
|
||||
|
||||
List<BstIvtCutpointivt> cutPointList = slitterMapper.getReadyShaftPoint(deviceCode);
|
||||
if (cutPointList.size() == 0) {
|
||||
List<Deliverycachepointivt> cachePointList = slitterMapper.getReadyShaftCachePointByDevice(deviceInfo);
|
||||
if (cutPointList.size() == 0 && cachePointList.size() == 0) {
|
||||
tips.add("没有为设备[" + deviceCode + "]套好轴的位置!或者已经创建任务!");
|
||||
} else {
|
||||
String collect = timePlans.stream().map(PdmBiSlittingproductionplan::getContainer_name).collect(Collectors.joining("','"));
|
||||
// 找到该分切计划的点位
|
||||
BstIvtCutpointivt newCutPoint = cutPointList.get(0);
|
||||
tips.add("为设备[" + deviceCode + "]套好轴的位置在[" + newCutPoint.getPoint_code() + "], " +
|
||||
"对应的计划: " + collect);
|
||||
if (cutPointList.size() > 0){
|
||||
// 找到该分切计划的点位
|
||||
BstIvtCutpointivt newCutPoint = cutPointList.get(0);
|
||||
tips.add("为设备[" + deviceCode + "]套好轴的位置在[" + newCutPoint.getPoint_code() + "], " +
|
||||
"对应的计划: " + collect);
|
||||
} else {
|
||||
Deliverycachepointivt newCutPoint = cachePointList.get(0);
|
||||
tips.add("为设备[" + deviceCode + "]套好轴的位置在[" + newCutPoint.getPoint_code() + "], " +
|
||||
"对应的计划: " + collect);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
tips.add("没有为设备[" + deviceCode + "]套好轴的位置!");
|
||||
|
||||
@@ -160,6 +160,12 @@
|
||||
AND sd.point_status = #{pointStatus}
|
||||
AND sd.plan = #{plan}
|
||||
AND sd.is_used = '1'
|
||||
<if test='size != null and size == "3"'>
|
||||
AND FIND_IN_SET('3', can_size) > 0
|
||||
</if>
|
||||
<if test='size != null and size == "6"'>
|
||||
AND FIND_IN_SET('6', can_size) > 0
|
||||
</if>
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM sch_base_task sbt
|
||||
|
||||
@@ -21,4 +21,6 @@ public class AreaBCachePointDto implements Serializable {
|
||||
private String pointStatus;
|
||||
/** 子区域 */
|
||||
private String plan;
|
||||
/** 气胀轴尺寸 */
|
||||
private String size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user