rev:发货区修改

This commit is contained in:
2024-06-19 14:59:15 +08:00
parent 810e8bb510
commit 5bb695619e
2 changed files with 23 additions and 30 deletions

View File

@@ -106,7 +106,7 @@
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
WHERE
IFNULL( point2.vehicle_code, '' ) != ''
AND point2.out_order_seq > point1.out_order_seq
AND point1.out_order_seq > point2.out_order_seq
<if test="point_code != null and point_code != ''">
AND point1.point_code= #{point_code}
@@ -125,7 +125,7 @@
LEFT JOIN sch_base_point point2 ON point1.row_num = point2.row_num
WHERE
IFNULL( point2.vehicle_code, '' ) = ''
AND point2.out_order_seq > point1.out_order_seq
AND point1.out_order_seq > point2.out_order_seq
<if test="point_code != null and point_code != ''">
AND point1.point_code= #{point_code}

View File

@@ -61,7 +61,6 @@ public class SendOutManageServiceImpl implements SendOutManageService {
* 1有相同订单号有空位的相同订单号的放在一排
* 2没有相同订单号的新开一排
* 3有相同订单号的但是没有空位新开一排
* 2.删除载具对应木箱记录
*/
CutConveyorTask cutConveyorTask = new CutConveyorTask();
@@ -72,16 +71,14 @@ public class SendOutManageServiceImpl implements SendOutManageService {
.eq(SchBasePoint::getIs_used, IOSEnum.IS_NOTANDYES.code(""))
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))
);
// 1.查询此木箱号的子卷包装关系
if(StringUtils.isEmpty(whereJson.getString("vehicle_code"))){
throw new BadRequestException("木箱号不能为空!");
}
//木箱号可能用逗号隔开
String vehicleCode = Arrays.asList(whereJson.getString("vehicle_code").split(",")).get(0);
JSONObject jsonSub = subTab.query("package_box_sn = '" + vehicleCode + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonSub)) {
throw new BadRequestException("未查询到该木箱对应的包装关系!");
}
// 2.找相同订单号的所有排
jsonSub.put("region_id", RegionTypeEnum.TWO_FH01.getId());
List<JSONObject> pointLikeOrder = schBasePointMapper.queryLikeOrderRow(jsonSub);
@@ -99,7 +96,7 @@ public class SendOutManageServiceImpl implements SendOutManageService {
ObjectUtil.isEmpty(row.getVehicle_code()) &&
row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))
)
.sorted(Comparator.comparing(SchBasePoint::getOut_order_seq))
.sorted(Comparator.comparing(SchBasePoint::getIn_order_seq))
.collect(Collectors.toList());
joArr.addAll(rowPointList);
@@ -122,19 +119,17 @@ public class SendOutManageServiceImpl implements SendOutManageService {
ObjectUtil.isEmpty(row.getVehicle_code()) &&
row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))
)
.sorted(Comparator.comparing(SchBasePoint::getOut_order_seq))
.sorted(Comparator.comparing(SchBasePoint::getIn_order_seq))
.collect(Collectors.toList());
if (rowPointList.size() == 4) {
JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0)));
JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0)));
if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) {
continue;
}
point_code = jsonNewRow.getString("point_code");
break;
if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) {
continue;
}
point_code = jsonNewRow.getString("point_code");
break;
}
} else {
// 校验此货位是否被堵住1.如果被堵住则判断下一个是否被堵住 2.如果全部被堵住则新开一排
@@ -178,19 +173,17 @@ public class SendOutManageServiceImpl implements SendOutManageService {
ObjectUtil.isEmpty(row.getVehicle_code()) &&
row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))
)
.sorted(Comparator.comparing(SchBasePoint::getOut_order_seq))
.sorted(Comparator.comparing(SchBasePoint::getIn_order_seq))
.collect(Collectors.toList());
if (rowPointList.size() == 4) {
JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0)));
JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0)));
if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) {
continue;
}
point_code = jsonNewRow.getString("point_code");
break;
if (cutConveyorTask.isSingleTask(jsonNewRow.getString("point_code"))) {
continue;
}
point_code = jsonNewRow.getString("point_code");
break;
}
}
@@ -200,8 +193,8 @@ public class SendOutManageServiceImpl implements SendOutManageService {
//创建任务
JSONObject task_jo = new JSONObject();
task_jo.put("point_code1", whereJson.getString("device_code"));
task_jo.put("point_code2", "CK2023");
task_jo.put("vehicle_code", whereJson.getString("vehicle_code"));
task_jo.put("point_code2", point_code);
task_jo.put("vehicle_code", vehicleCode);
task_jo.put("task_type", "010708");
TwoSendOutTask taskBean = new TwoSendOutTask();
taskBean.createTask(task_jo);
@@ -209,9 +202,9 @@ public class SendOutManageServiceImpl implements SendOutManageService {
// 锁住点位
ischBasePointService.update(
new UpdateWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, "CK2023")
.eq(SchBasePoint::getPoint_code, point_code)
.set(SchBasePoint::getLock_type, IOSEnum.LOCK_TYPE.code("其它"))
.set(SchBasePoint::getVehicle_code, whereJson.getString("vehicle_code"))
.set(SchBasePoint::getVehicle_code, vehicleCode)
);
// 删除载具对应木箱记录