rev:发货区修改

This commit is contained in:
2024-06-20 10:57:11 +08:00
parent 3c2da9058f
commit d04e626131

View File

@@ -384,21 +384,13 @@ public class SendOutManageServiceImpl implements SendOutManageService {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
// 根据任务号找到第一次申请时的任务 // 根据任务号找到第一次申请时的任务
JSONObject taskJson = taskTab.query("task_code = '" + whereJson.getString("task_code") + "'").uniqueResult(0); JSONObject taskJson = taskTab.query("task_code = '" + whereJson.getString("task_code") + "' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(taskJson)) { if (ObjectUtil.isEmpty(taskJson)) {
throw new BadRequestException("任务号为:"+ whereJson.getString("task_code")+ "的任务不存在!"); throw new BadRequestException("任务号为:"+ whereJson.getString("task_code")+ "的任务不存在!");
} }
String point_code4 = ""; String point_code4 = "";
// 判断当前点位是否被堵住
JSONObject paramJson = new JSONObject();
paramJson.put("point_code", taskJson.getString("point_code4"));
paramJson.put("region_id", RegionTypeEnum.TWO_FH01.getId());
List<JSONObject> isBlock = schBasePointMapper.isBlock(paramJson);
if (ObjectUtil.isNotEmpty(isBlock)) {
// 堵住: 找这一排的的空位
// 所有发货区点位 // 所有发货区点位
List<SchBasePoint> pointDaoList = ischBasePointService.list( List<SchBasePoint> pointDaoList = ischBasePointService.list(
new QueryWrapper<SchBasePoint>().lambda() new QueryWrapper<SchBasePoint>().lambda()
@@ -414,8 +406,7 @@ public class SendOutManageServiceImpl implements SendOutManageService {
// 找出这一排所有空位 // 找出这一排所有空位
List<SchBasePoint> rowPointList = pointDaoList.stream() List<SchBasePoint> rowPointList = pointDaoList.stream()
.filter(row -> row.getRow_num().toString().equals(pointDao.getRow_num().toString()) && .filter(row -> row.getRow_num().toString().equals(pointDao.getRow_num().toString()) &&
ObjectUtil.isEmpty(row.getVehicle_code()) && ObjectUtil.isEmpty(row.getVehicle_code())
row.getLock_type().equals(IOSEnum.LOCK_TYPE.code("未锁定"))
) )
.sorted(Comparator.comparing(SchBasePoint::getIn_order_seq)) .sorted(Comparator.comparing(SchBasePoint::getIn_order_seq))
.collect(Collectors.toList()); .collect(Collectors.toList());
@@ -431,33 +422,31 @@ public class SendOutManageServiceImpl implements SendOutManageService {
if (ObjectUtil.isNotEmpty(isBlock2)) { if (ObjectUtil.isNotEmpty(isBlock2)) {
continue; continue;
} else { } else {
JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(rowPointList.get(0))); JSONObject jsonNewRow = JSONObject.parseObject(JSON.toJSONString(json));
point_code4 = jsonNewRow.getString("point_code"); point_code4 = jsonNewRow.getString("point_code");
break; break;
} }
} }
// 更新原仓位
JSONObject jsonUpdate = new JSONObject();
jsonUpdate.put("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"));
pointTab.update(jsonUpdate,"point_code = '"+taskJson.getString("point_code4")+"'");
if (ObjectUtil.isEmpty(point_code4)) { if (ObjectUtil.isEmpty(point_code4)) {
// 如果没有找到此排空位 则重新下发到别的排 throw new BadRequestException("此排没有空位!"+pointDao.getRow_num());
JSONObject param = new JSONObject();
param.put("device_code", taskJson.getString("point_code2"));
param.put("vehicle_code", taskJson.getString("vehicle_code"));
createSendOutTaskOne(param);
return;
} else {
// 更新现仓位
jsonUpdate.put("lock_type", IOSEnum.LOCK_TYPE.code("其它"));
pointTab.update(jsonUpdate,"point_code = '"+point_code4+"'");
} }
} else { // 判断货位是否是第一次申请的货位
point_code4 = taskJson.getString("point_code4"); if (!point_code4.equals(taskJson.getString("point_code4"))) {
// 更新现仓位
JSONObject jsonUpdate = new JSONObject();
jsonUpdate.put("lock_type", IOSEnum.LOCK_TYPE.code("其它"));
pointTab.update(jsonUpdate,"point_code = '"+point_code4+"'");
// 判断此货位是否是最后一个入库的货位 如果是就解锁: 5 / 9
if ("5,9".contains(pointDao.getIn_order_seq().toString())) {
// 更新原仓位
jsonUpdate.put("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"));
pointTab.update(jsonUpdate,"point_code = '"+taskJson.getString("point_code4")+"'");
}
} }
//创建任务 //创建任务