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

@@ -141,6 +141,7 @@ public class TwoInBoxTrussTask extends AbstractAcsTask {
json.put("task_group_id", form.getLongValue("task_group_id")); json.put("task_group_id", form.getLongValue("task_group_id"));
json.put("point_code1", form.getString("start_device_code")); json.put("point_code1", form.getString("start_device_code"));
json.put("point_code2", form.getString("next_device_code")); json.put("point_code2", form.getString("next_device_code"));
json.put("product_area", "BLK");
json.put("handle_class", this.getClass().getName()); json.put("handle_class", this.getClass().getName());
json.put("create_id", SecurityUtils.getCurrentUserId()); json.put("create_id", SecurityUtils.getCurrentUserId());
json.put("create_name", SecurityUtils.getCurrentUsername()); json.put("create_name", SecurityUtils.getCurrentUsername());

View File

@@ -301,21 +301,11 @@ public class InBoxManageServiceImpl implements InBoxManageService {
public void returnIn(JSONObject whereJson) { public void returnIn(JSONObject whereJson) {
// 载具表 // 载具表
///api/twoPda/vehicle/returnIn ///api/twoPda/vehicle/returnIn
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
// 载具扩展属性表
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
/* /*
* 查询mes木箱信息插入木箱信息表 * 查询mes木箱信息插入木箱信息表
*/ */
// TODO 调用mes接口 //lmsToMesService.momGetPackingInfo(whereJson);
// JSONObject mesBoxInfo = lmsToMesService.momGetPackingInfo(whereJson);
// 插入木箱信息表
// iBstIvtBoxinfoService.mesInsert(mesBoxInfo);
/*
* 插入木箱对应载具表
*/
//查询对应的木箱信息 //查询对应的木箱信息
// 查询木箱信息 // 查询木箱信息
@@ -327,28 +317,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
throw new BadRequestException("木箱不存在!"); throw new BadRequestException("木箱不存在!");
} }
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", 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", 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", IdUtil.getLongId());
ext_jo.put("update_time", DateUtil.now());
veExtTab.update(ext_jo);
}
// 下发桁架任务 // 下发桁架任务
JSONObject taskParam = new JSONObject(); JSONObject taskParam = new JSONObject();
taskParam.put("task_type", "010713"); taskParam.put("task_type", "010713");
@@ -362,7 +330,8 @@ public class InBoxManageServiceImpl implements InBoxManageService {
param.put("width", boxDao.getBox_width()); param.put("width", boxDao.getBox_width());
param.put("height", boxDao.getBox_high()); param.put("height", boxDao.getBox_high());
param.put("containerType", boxDao.getVehicle_type()); param.put("containerType", boxDao.getVehicle_type());
param.put("barcode", whereJson.getString("box_no")); String type = whereJson.getString("bill_type");
param.put("barcode", whereJson.getString("box_no") + "-" + type.substring(3, 4));
//根据木箱高度,判断入库仓位的高度 //根据木箱高度,判断入库仓位的高度
String height = ""; String height = "";

View File

@@ -2039,10 +2039,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
whereJson.put("box_no", whereJson.getString("material_barcode")); whereJson.put("box_no", whereJson.getString("material_barcode"));
inBoxManageService.inBox(whereJson); inBoxManageService.inBox(whereJson);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("退货入库"))) { } else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("退货入库"))) {
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
// 载具扩展属性表
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
// 6-退货入库 // 6-退货入库
whereJson.put("bill_type", IOSEnum.IN_TYPE.code("退货入库")); String materialBarcode = whereJson.getString("material_barcode");
whereJson.put("box_no", whereJson.getString("material_barcode")); String[] box_arr = materialBarcode.split("-");
JSONArray resultJSONArray = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + whereJson.getString("material_barcode") + "' AND status in ('0','1','99')").getResultJSONArray(0); //获取当前的入库类型
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)) { if (ObjectUtil.isEmpty(resultJSONArray)) {
throw new BadRequestException("未查询到子卷包装信息!"); throw new BadRequestException("未查询到子卷包装信息!");
} }
@@ -2055,6 +2061,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
material_barcode += "," + resultObj.getString("container_name"); 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); whereJson.put("material_barcode", material_barcode);
inBussManageService.inTask(whereJson); inBussManageService.inTask(whereJson);
} }