fix:退货口入库优化

This commit is contained in:
zhouz
2024-07-04 15:31:01 +08:00
parent d9f374983d
commit 89fe7c4488
3 changed files with 36 additions and 37 deletions

View File

@@ -2039,10 +2039,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
whereJson.put("box_no", whereJson.getString("material_barcode"));
inBoxManageService.inBox(whereJson);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("退货入库"))) {
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
// 载具扩展属性表
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
// 6-退货入库
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("退货入库"));
whereJson.put("box_no", whereJson.getString("material_barcode"));
JSONArray resultJSONArray = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + whereJson.getString("material_barcode") + "' AND status in ('0','1','99')").getResultJSONArray(0);
String materialBarcode = whereJson.getString("material_barcode");
String[] box_arr = materialBarcode.split("-");
//获取当前的入库类型
whereJson.put("bill_type", "000" + box_arr[1]);
whereJson.put("box_no", box_arr[0]);
JSONArray resultJSONArray = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + whereJson.getString("box_no") + "' AND status in ('0','1','99')").getResultJSONArray(0);
if (ObjectUtil.isEmpty(resultJSONArray)) {
throw new BadRequestException("未查询到子卷包装信息!");
}
@@ -2055,6 +2061,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
material_barcode += "," + resultObj.getString("container_name");
}
}
JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(jsonVehicle)) {
throw new BadRequestException("载具不存在!");
}
JSONObject ext_jo = veExtTab.query("storagevehicle_code = '" + jsonVehicle.getString("storagevehicle_code") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(ext_jo)) {
JSONObject jsonVeExt = new JSONObject();
jsonVeExt.put("storagevehicleext_id", org.nl.common.utils.IdUtil.getLongId());
jsonVeExt.put("storagevehicle_id", jsonVehicle.getLongValue("storagevehicle_id"));
jsonVeExt.put("storagevehicle_code", jsonVehicle.getString("storagevehicle_code"));
jsonVeExt.put("storagevehicle_type", jsonVehicle.getString("storagevehicle_type"));
jsonVeExt.put("pcsn", whereJson.getString("box_no"));
jsonVeExt.put("device_uuid", org.nl.common.utils.IdUtil.getLongId());
jsonVeExt.put("update_time", DateUtil.now());
veExtTab.insert(jsonVeExt);
} else {
ext_jo.put("pcsn", whereJson.getString("box_no"));
ext_jo.put("device_uuid", org.nl.common.utils.IdUtil.getLongId());
ext_jo.put("update_time", DateUtil.now());
veExtTab.update(ext_jo);
}
whereJson.put("material_barcode", material_barcode);
inBussManageService.inTask(whereJson);
}