fix:发货出库木箱号解析错误导致查不到子卷问题;

This commit is contained in:
2024-06-18 15:33:14 +08:00
parent 15a46f0c62
commit cf95dc505c
2 changed files with 10 additions and 8 deletions

View File

@@ -215,11 +215,7 @@ public class InBussManageServiceImpl implements InBussManageService {
}
List<String> pcsnList = Arrays.asList(material_barcode.split(","));
// 查询子卷包装关系
// List<JSONObject> subList = subTab.query("container_name ='B2512402242302B1A1' and status in ('0','1')")
// .getResultJSONArray(0).toJavaList(JSONObject.class);
// List<JSONObject> subList = subTab.query("container_name ='B2512402242302B1A1' and status in ('0','1')")
// .getResultJSONArray(0).toJavaList(JSONObject.class);
List<JSONObject> subList = subTab.query("container_name in ('" + String.join("','", pcsnList) + "') and status in ('0','1')")
List<JSONObject> subList = subTab.query("container_name in ('" + String.join("','", pcsnList) + "') and status in ('0','1','99')")
.getResultJSONArray(0).toJavaList(JSONObject.class);
if (ObjectUtil.isEmpty(subList)) {
throw new BadRequestException("未查询到子卷包装信息!");

View File

@@ -1,11 +1,13 @@
package org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.sch.point.dao.SchBasePoint;
import org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper;
import org.nl.b_lms.sch.point.service.IschBasePointService;
@@ -20,6 +22,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@@ -69,13 +72,16 @@ public class SendOutManageServiceImpl implements SendOutManageService {
.eq(SchBasePoint::getIs_used, IOSEnum.IS_NOTANDYES.code(""))
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))
);
// 1.查询此木箱号的子卷包装关系
JSONObject jsonSub = subTab.query("package_box_sn = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0);
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);