add:退货入库位入空木箱功能
This commit is contained in:
@@ -170,7 +170,12 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
||||
@Override
|
||||
public JSONObject boxIn(JSONObject whereJson) {
|
||||
// 调用接口
|
||||
inBoxManageService.boxBinVehicle(whereJson);
|
||||
String startCode = whereJson.getString("point_code");
|
||||
if ("MXRKW1".equals(startCode)){
|
||||
inBoxManageService.boxBinVehicle(whereJson);
|
||||
}else if ("THRKDJW1".equals(startCode)){
|
||||
inBoxManageService.boxBinVehicleByTHRK(whereJson);
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("message", "入库成功!");
|
||||
return result;
|
||||
|
||||
@@ -128,18 +128,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||
.eq(BstIvtBoxinfo::getBox_no, boxNo)
|
||||
);
|
||||
/*
|
||||
* 找一个木箱区的一个仓位,生成任务并下发
|
||||
*/
|
||||
/* // 判断起点点位是否存在
|
||||
JSONObject jsonPoint = schBasePointService.query("point_code = '" + whereJson.getString("device_code") + "' AND is_delete = '" +
|
||||
IOSEnum.IS_NOTANDYES.code("否") + "' AND is_used = '" +
|
||||
IOSEnum.IS_NOTANDYES.code("是") + "'")
|
||||
.uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("起始点位不存在或未启用!");
|
||||
}*/
|
||||
// 找一个木箱区空位
|
||||
//根据木箱高度,判断入库仓位的高度
|
||||
String height = "";
|
||||
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
|
||||
@@ -347,6 +335,58 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
||||
taskBean.immediateNotifyAcs(null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void boxBinVehicleByTHRK(JSONObject whereJson) {
|
||||
//查询仓库是否存在相同木箱
|
||||
final String boxSn = whereJson.getString("box_no");
|
||||
JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + boxSn + "'").getResultJSONArray(0);
|
||||
if (stIvtStructattr != null && stIvtStructattr.size() > 0) {
|
||||
throw new BadRequestException("当前木箱已经存在库中" + stIvtStructattr.getJSONObject(0).getString("struct_code"));
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("box_no", boxSn);
|
||||
// lmsToMesService.momGetPackingInfo(jo);
|
||||
// 查询木箱信息
|
||||
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
|
||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||
.eq(BstIvtBoxinfo::getBox_no, whereJson.getString("box_no"))
|
||||
);
|
||||
// 下发桁架任务
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("task_type", "010713");
|
||||
taskParam.put("start_device_code", whereJson.getString("point_code"));
|
||||
taskParam.put("next_device_code", "CK2005");
|
||||
taskParam.put("vehicle_code", whereJson.getString("box_no"));
|
||||
//taskParam.put("vehicle_code2", whereJson.getString("box_no"));
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("layer", whereJson.getString("layer"));
|
||||
param.put("length", boxDao.getBox_length());
|
||||
param.put("width", boxDao.getBox_width());
|
||||
param.put("height", boxDao.getBox_high());
|
||||
param.put("containerType", boxDao.getVehicle_type());
|
||||
|
||||
param.put("barcode", whereJson.getString("box_no") + "-9" );
|
||||
//根据木箱高度,判断入库仓位的高度
|
||||
String height = "";
|
||||
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
|
||||
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
|
||||
String box_high = boxDao.getBox_high();
|
||||
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
|
||||
height = "1";
|
||||
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
|
||||
height = "2";
|
||||
} else {
|
||||
height = "3";
|
||||
}
|
||||
param.put("heightLevel", height);
|
||||
taskParam.put("request_param", param.toString());
|
||||
TwoInBoxTrussTask taskBean = new TwoInBoxTrussTask();
|
||||
taskBean.createTask(taskParam);
|
||||
taskBean.immediateNotifyAcs(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void returnIn(JSONObject whereJson) {
|
||||
|
||||
@@ -36,6 +36,7 @@ public interface InBoxManageService {
|
||||
* }
|
||||
*/
|
||||
void boxBinVehicle(JSONObject whereJson);
|
||||
void boxBinVehicleByTHRK(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 任务异常处理(1.满入 2.浅货位有货-放货时)
|
||||
|
||||
@@ -2099,10 +2099,6 @@ 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-退货入库
|
||||
String materialBarcode = whereJson.getString("material_barcode");
|
||||
if(StrUtil.isEmpty(materialBarcode)){
|
||||
throw new BadRequestException("当前木箱号不能为空!");
|
||||
@@ -2112,47 +2108,58 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
// 处理分割结果不足的情况
|
||||
throw new BadRequestException("当前木箱号数据异常!"+box_arr.toString());
|
||||
}
|
||||
//获取当前的入库类型
|
||||
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("未查询到子卷包装信息!");
|
||||
}
|
||||
String material_barcode = "";
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject resultObj = resultJSONArray.getJSONObject(i);
|
||||
if (i == 0) {
|
||||
material_barcode = resultObj.getString("container_name");
|
||||
} else {
|
||||
material_barcode += "," + resultObj.getString("container_name");
|
||||
if (box_arr[1].equals("9")){
|
||||
//空木箱入库
|
||||
// -{"material_barcode":"MX250324000091-1","device_code":"CK2005","vehicle_code":"B00165","type":"6"}
|
||||
whereJson.put("box_no", box_arr[0]);
|
||||
inBoxManageService.inBox(whereJson);
|
||||
}else {
|
||||
//退货入库
|
||||
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
||||
// 载具扩展属性表
|
||||
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
//获取当前的入库类型
|
||||
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("未查询到子卷包装信息!");
|
||||
}
|
||||
String material_barcode = "";
|
||||
for (int i = 0; i < resultJSONArray.size(); i++) {
|
||||
JSONObject resultObj = resultJSONArray.getJSONObject(i);
|
||||
if (i == 0) {
|
||||
material_barcode = resultObj.getString("container_name");
|
||||
} else {
|
||||
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 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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "下发成功!");
|
||||
|
||||
Reference in New Issue
Block a user