fix:获取堆叠模版优化

This commit is contained in:
zhouz
2024-07-09 19:19:14 +08:00
parent aa86828ea2
commit 1105f0dd28

View File

@@ -88,13 +88,13 @@ public class LashManageServiceImpl implements LashManageService {
);
if (ObjectUtil.isEmpty(boxDao)) {
throw new BadRequestException("没有此木箱信息:"+whereJson.getString("vehicle_code"));
throw new BadRequestException("没有此木箱信息:" + whereJson.getString("vehicle_code"));
}
// 获取次木箱对应的木箱类型
MdpbBoxtype boxTypeDao = iMdpbBoxtypeService.getById(boxDao.getMaterial_code());
if (ObjectUtil.isEmpty(boxTypeDao)) {
throw new BadRequestException("木箱类型不存在!"+boxDao.getMaterial_code());
throw new BadRequestException("木箱类型不存在!" + boxDao.getMaterial_code());
}
JSONObject jsonSub = WQLObject.getWQLObject("pdm_bi_subpackagerelation")
@@ -137,12 +137,12 @@ public class LashManageServiceImpl implements LashManageService {
// 加载具数量
JSONObject jsonPoint = likeBoxList.get(0);
jsonPoint.put("vehicle_qty", NumberUtil.add(jsonPoint.getBigDecimal("vehicle_qty"),1));
jsonPoint.put("vehicle_qty", NumberUtil.add(jsonPoint.getBigDecimal("vehicle_qty"), 1));
if (jsonPoint.getIntValue("vehicle_qty") == Integer.parseInt(boxTypeDao.getLash_num_tow())) {
if (jsonPoint.getIntValue("vehicle_qty") == Integer.parseInt(boxTypeDao.getLash_num())) {
// 相同清空载具以及数量
jsonPoint.put("vehicle_qty",0);
jsonPoint.put("vehicle_code","");
jsonPoint.put("vehicle_qty", 0);
jsonPoint.put("vehicle_code", "");
is_move = IOSEnum.IS_NOTANDYES.code("");
}
end_point = jsonPoint.getString("point_code");
@@ -174,8 +174,8 @@ public class LashManageServiceImpl implements LashManageService {
JSONObject jsonPoint = empPointList.get(0);
// 加载具数量、更新载具号
jsonPoint.put("vehicle_qty", NumberUtil.add(jsonPoint.getBigDecimal("vehicle_qty"),1));
jsonPoint.put("vehicle_code",boxDao.getBox_no());
jsonPoint.put("vehicle_qty", NumberUtil.add(jsonPoint.getBigDecimal("vehicle_qty"), 1));
jsonPoint.put("vehicle_code", boxDao.getBox_no());
end_point = jsonPoint.getString("point_code");
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
@@ -215,7 +215,7 @@ public class LashManageServiceImpl implements LashManageService {
// 比较两行架点位的任务个数
List<JSONObject> executeArr = WQLObject.getWQLObject("SCH_BASE_Task")
.query("handle_class = '" + TwoOutHeapTask.class.getName() + "' and task_status IN ('05','06') and is_delete = '0' " )
.query("handle_class = '" + TwoOutHeapTask.class.getName() + "' and task_status IN ('05','06') and is_delete = '0' ")
.getResultJSONArray(0).toJavaList(JSONObject.class);
// 根据终点点位进行分组
@@ -228,7 +228,7 @@ public class LashManageServiceImpl implements LashManageService {
List<JSONObject> heapOne = Optional.ofNullable(groupPointMap.get(IOSEnum.OUT_HANGER.code("行架位1"))).orElse(new ArrayList<>());
List<JSONObject> heapTwo = Optional.ofNullable(groupPointMap.get(IOSEnum.OUT_HANGER.code("行架位2"))).orElse(new ArrayList<>());
if (heapOne.size() > heapTwo.size()) {
next_device_code = IOSEnum.OUT_HANGER.code("行架位2");
}
@@ -237,7 +237,7 @@ public class LashManageServiceImpl implements LashManageService {
JSONObject jsonVeExt = extTab.query("pcsn = '" + whereJson.getString("vehicle_code") + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(jsonVeExt)) {
throw new BadRequestException("此木箱没有绑定托盘号!"+whereJson.getString("vehicle_code"));
throw new BadRequestException("此木箱没有绑定托盘号!" + whereJson.getString("vehicle_code"));
}
// 创建任务并下发
@@ -271,7 +271,7 @@ public class LashManageServiceImpl implements LashManageService {
throw new BadRequestException("未查询到托盘对应的扩展属性");
}
String box_no = vehicle_ext.getString("pcsn");
if (StrUtil.isEmpty(box_no)){
if (StrUtil.isEmpty(box_no)) {
throw new BadRequestException("未查询到托盘绑定了相关木箱!");
}
// 查询木箱信息
@@ -283,7 +283,7 @@ public class LashManageServiceImpl implements LashManageService {
// 根据木箱料号查询木箱类型信息
MdpbBoxtype boxTypeDao = iMdpbBoxtypeService.getById(boxDao.getMaterial_code());
if (ObjectUtil.isEmpty(boxTypeDao)) {
throw new BadRequestException("木箱类型信息不存在!木箱料号为:"+boxDao.getMaterial_code());
throw new BadRequestException("木箱类型信息不存在!木箱料号为:" + boxDao.getMaterial_code());
}
// 返回参数