fix:换标入库不回传,托盘两边条码不一致处理

This commit is contained in:
zhouz
2025-10-10 11:12:01 +08:00
parent 2aa091125c
commit 5387fad522
3 changed files with 24 additions and 19 deletions

View File

@@ -1005,7 +1005,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
}
//返检入库将回传字段改为1
if (mstDao.getBill_type().equals(IOSEnum.IN_TYPE.code("返检入库"))) {
if (mstDao.getBill_type().equals(IOSEnum.IN_TYPE.code("返检入库")) || mstDao.getBill_type().equals(IOSEnum.IN_TYPE.code("换标入库"))) {
mstDao.setIs_upload(IOSEnum.IS_NOTANDYES.code(""));
}

View File

@@ -2082,7 +2082,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (whereJson.getIntValue("weight") <= 0) {
throw new BadRequestException("上报的重量不能为0!");
}
String material_barcode = whereJson.getString("material_barcode");
// 处理子卷号
if (ObjectUtil.isEmpty(material_barcode)) {
throw new BadRequestException("子卷号不能为空!");
}
List<String> pcsnList = Arrays.asList(material_barcode.split(","));
// 查询子卷包装关系
List<JSONObject> subList = WQLObject.getWQLObject("pdm_bi_subpackagerelation").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("未查询到子卷包装信息!");
}
List<String> errorMsg = new ArrayList<>();
whereJson.put("sub_box",subList.get(0).getString("package_box_sn"));
JSONObject jsonObject = ComPareUtil.CompareWhight(whereJson);
Boolean inbound = jsonObject.getBoolean("inbound");
Boolean compaerResult = jsonObject.getBoolean("compaer_result");
@@ -2115,12 +2128,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
}
String is_normal_rk = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_normal_rk").getValue();
if (!inbound && is_normal_rk.equals("0")){
if (!inbound && is_normal_rk.equals("0")) {
errorMsg.add("手动至异常口");
}
if (count > 0) {
errorMsg.add(whereJson.getString("vehicle_code") + "存在任务");
}
if (StringUtils.isBlank(subList.get(0).getString("package_box_sn"))) {
throw new BadRequestException("包装关系的木箱号不能为空!");
}
if (!subList.get(0).getString("package_box_sn").equals(jsonExt.getString("pcsn"))) {
errorMsg.add("托盘绑定的木箱号与当前的不一致!");
}
//"material_barcode":"C1101,","device_code":"RK1018","weight":500.95,"vehicle_code":"B01401","type":"1"
if (CollectionUtils.isEmpty(errorMsg)) {
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("生产入库"));
@@ -2152,7 +2171,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject param = new JSONObject();
param.put("status", IOSEnum.IS_NOTANDYES.code(""));
WQLObject.getWQLObject("pdm_bi_subpackagerelation")
.update(param, "package_box_sn = '" + jsonObject.getString("box_no") + "'");
.update(param, "package_box_sn = '" + subList.get(0).getString("package_box_sn") + "'");
jsonTaskParam.put("request_param", request_param);
TwoExceptionInTask bean = SpringContextHolder.getBean(TwoExceptionInTask.class);

View File

@@ -27,8 +27,6 @@ public class ComPareUtil {
public static JSONObject CompareWhight(JSONObject jsonObject) {
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
String vehicle_code = jsonObject.getString("vehicle_code");
// 处理子卷号
@@ -37,26 +35,14 @@ public class ComPareUtil {
throw new BadRequestException("子卷号不能为空!");
}
List<String> pcsnList = Arrays.asList(material_barcode.split(","));
// 查询子卷包装关系
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("未查询到子卷包装信息!");
}
if (StringUtils.isBlank(subList.get(0).getString("package_box_sn"))) {
throw new BadRequestException("木箱号不能为空!");
}
//查询托盘重量
JSONObject vehicle_ext = WQLObject.getWQLObject("md_pb_storagevehicleext").query("storagevehicle_code = '" + vehicle_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(vehicle_ext)) {
throw new BadRequestException("未查询到托盘的扩展信息");
}
if (!subList.get(0).getString("package_box_sn").equals(vehicle_ext.getString("pcsn"))) {
throw new BadRequestException("托盘绑定的木箱号与当前的不一致!");
}
IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService = SpringContextHolder.getBean(IpdmBiSubpackagerelationService.class);
List<PdmBiSubpackagerelation> list = ipdmBiSubpackagerelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, vehicle_ext.getString("pcsn")));
List<PdmBiSubpackagerelation> list = ipdmBiSubpackagerelationService.list(new LambdaQueryWrapper<PdmBiSubpackagerelation>().eq(PdmBiSubpackagerelation::getPackage_box_sn, jsonObject.getString("sub_box")));
if (ObjectUtil.isEmpty(list)) {
throw new BadRequestException("未查询到对应的木箱包装关系!");
}