add:退货入库位入空木箱功能
This commit is contained in:
@@ -170,7 +170,12 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
|
|||||||
@Override
|
@Override
|
||||||
public JSONObject boxIn(JSONObject whereJson) {
|
public JSONObject boxIn(JSONObject whereJson) {
|
||||||
// 调用接口
|
// 调用接口
|
||||||
|
String startCode = whereJson.getString("point_code");
|
||||||
|
if ("MXRKW1".equals(startCode)){
|
||||||
inBoxManageService.boxBinVehicle(whereJson);
|
inBoxManageService.boxBinVehicle(whereJson);
|
||||||
|
}else if ("THRKDJW1".equals(startCode)){
|
||||||
|
inBoxManageService.boxBinVehicleByTHRK(whereJson);
|
||||||
|
}
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("message", "入库成功!");
|
result.put("message", "入库成功!");
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -128,18 +128,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
new QueryWrapper<BstIvtBoxinfo>().lambda()
|
||||||
.eq(BstIvtBoxinfo::getBox_no, boxNo)
|
.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 height = "";
|
||||||
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
|
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
|
||||||
@@ -347,6 +335,58 @@ public class InBoxManageServiceImpl implements InBoxManageService {
|
|||||||
taskBean.immediateNotifyAcs(null);
|
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
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void returnIn(JSONObject whereJson) {
|
public void returnIn(JSONObject whereJson) {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public interface InBoxManageService {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
void boxBinVehicle(JSONObject whereJson);
|
void boxBinVehicle(JSONObject whereJson);
|
||||||
|
void boxBinVehicleByTHRK(JSONObject whereJson);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务异常处理(1.满入 2.浅货位有货-放货时)
|
* 任务异常处理(1.满入 2.浅货位有货-放货时)
|
||||||
|
|||||||
@@ -2099,10 +2099,6 @@ 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-退货入库
|
|
||||||
String materialBarcode = whereJson.getString("material_barcode");
|
String materialBarcode = whereJson.getString("material_barcode");
|
||||||
if(StrUtil.isEmpty(materialBarcode)){
|
if(StrUtil.isEmpty(materialBarcode)){
|
||||||
throw new BadRequestException("当前木箱号不能为空!");
|
throw new BadRequestException("当前木箱号不能为空!");
|
||||||
@@ -2112,6 +2108,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
// 处理分割结果不足的情况
|
// 处理分割结果不足的情况
|
||||||
throw new BadRequestException("当前木箱号数据异常!"+box_arr.toString());
|
throw new BadRequestException("当前木箱号数据异常!"+box_arr.toString());
|
||||||
}
|
}
|
||||||
|
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("bill_type", "000" + box_arr[1]);
|
||||||
whereJson.put("box_no", box_arr[0]);
|
whereJson.put("box_no", box_arr[0]);
|
||||||
@@ -2154,6 +2160,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
whereJson.put("material_barcode", material_barcode);
|
whereJson.put("material_barcode", material_barcode);
|
||||||
inBussManageService.inTask(whereJson);
|
inBussManageService.inTask(whereJson);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
result.put("status", HttpStatus.OK.value());
|
result.put("status", HttpStatus.OK.value());
|
||||||
result.put("message", "下发成功!");
|
result.put("message", "下发成功!");
|
||||||
log.info("applyTwo返回参数:---------------------------------------------" + result.toString());
|
log.info("applyTwo返回参数:---------------------------------------------" + result.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user