优化信息丢失问题

This commit is contained in:
zhangjiangwei
2023-03-14 18:27:05 +08:00
parent 1ea70e17d0
commit fc9dd6a476
2 changed files with 18 additions and 19 deletions

View File

@@ -476,17 +476,19 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} else { } else {
throw new BadRequestException("未找到指令号'" + task_id); throw new BadRequestException("未找到指令号'" + task_id);
} }
//将之前的托盘信息删除 if ("RYSMW01".equals(device_code)) {
groupTable.delete("vehicle_code='" + vehicle_code + "' and task_id <>'" + task_id + "'"); //将之前的托盘信息删除
JSONObject groupObj = groupTable.query("task_id='" + task_id + "'").uniqueResult(0); // groupTable.delete("vehicle_code='" + vehicle_code + "' and task_id <>'" + task_id + "'");
if (ObjectUtil.isEmpty(groupObj)) { JSONObject groupObj = groupTable.query("task_id='" + task_id + "'").uniqueResult(0);
throw new BadRequestException("未找到指令号为'" + task_id + "'的组盘信息!"); if (ObjectUtil.isEmpty(groupObj)) {
throw new BadRequestException("未找到指令号为'" + task_id + "'的组盘信息!");
}
groupObj.put("vehicle_code", vehicle_code);
groupObj.put("update_optid", SecurityUtils.getCurrentUserId());
groupObj.put("update_optname", SecurityUtils.getNickName());
groupObj.put("update_time", DateUtil.now());
groupTable.update(groupObj);
} }
groupObj.put("vehicle_code", vehicle_code);
groupObj.put("update_optid", SecurityUtils.getCurrentUserId());
groupObj.put("update_optname", SecurityUtils.getNickName());
groupObj.put("update_time", DateUtil.now());
groupTable.update(groupObj);
//更新入库单单据的托盘条码 //更新入库单单据的托盘条码
WQLObject iosTable = WQLObject.getWQLObject("ST_IVT_workProcedureIOS"); WQLObject iosTable = WQLObject.getWQLObject("ST_IVT_workProcedureIOS");
JSONObject iosObj = iosTable.query("task_id ='" + task_id + "'").uniqueResult(0); JSONObject iosObj = iosTable.query("task_id ='" + task_id + "'").uniqueResult(0);

View File

@@ -91,14 +91,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
startPointObj.put("vehicle_code", ""); startPointObj.put("vehicle_code", "");
pointTab.update(startPointObj); pointTab.update(startPointObj);
taskTab.update(jsonTask); taskTab.update(jsonTask);
//将组盘表删除
WQLObject group_Table = WQLObject.getWQLObject("st_buss_vehiclegroup");
JSONObject groupObj = group_Table.query("vehicle_code='" + vehicle_code + "' and is_delete='0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(groupObj)) {
groupObj.put("is_delete", "0");
group_Table.update(groupObj);
}
} }
} }
@@ -146,7 +138,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
} }
PointDto startPoint = pointService.findByCode(start_point_code); PointDto startPoint = pointService.findByCode(start_point_code);
//假如载具为空,去点位表里面去取空托盘 //假如载具为空,去点位表里面去取空托盘
if (StrUtil.isEmpty(vehicle_code)) { if (StrUtil.isEmpty(vehicle_code) || "0000".equals(vehicle_code) || "0".equals(vehicle_code)) {
vehicle_code = startPoint.getVehicle_code(); vehicle_code = startPoint.getVehicle_code();
} }
if (StrUtil.isEmpty(vehicle_code)) { if (StrUtil.isEmpty(vehicle_code)) {
@@ -205,6 +197,11 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
taskObj.put("create_time", DateUtil.now()); taskObj.put("create_time", DateUtil.now());
taskObj.put("is_delete", "0"); taskObj.put("is_delete", "0");
taskTable.insert(taskObj); taskTable.insert(taskObj);
//将组盘表删除
WQLObject.getWQLObject("st_buss_vehiclegroup")
.delete("vehicle_code = '" + vehicle_code + "'");
return task_id; return task_id;
} }