|
|
@ -40,6 +40,10 @@ import org.nl.b_lms.storage_manage.ios.enums.IOSEnum; |
|
|
|
import org.nl.b_lms.storage_manage.ios.enums.TASKEnum; |
|
|
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvOutService; |
|
|
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.*; |
|
|
|
import org.nl.b_lms.storage_manage.md.dao.MdPdStorageVehicleInfo; |
|
|
|
import org.nl.b_lms.storage_manage.md.dao.MdPdStoragevehicleext; |
|
|
|
import org.nl.b_lms.storage_manage.md.dao.mapper.MdPdStoragevehicleextMapper; |
|
|
|
import org.nl.b_lms.storage_manage.md.dao.mapper.MdStorageVehicleInfoMapper; |
|
|
|
import org.nl.common.enums.NoticeTypeEnum; |
|
|
|
import org.nl.common.enums.PackageInfoIvtEnum; |
|
|
|
import org.nl.common.enums.SpecEnum; |
|
|
@ -87,7 +91,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
private static Map<String, String> Task_Status_Convers = MapOf.of("1", TaskStatusEnum.EXECUTING.getCode(), "2", TaskStatusEnum.FINISHED.getCode(), "3", "0"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final StorPublicService storPublicService; |
|
|
|
|
|
|
|
private final CutConveyorTask cutConveyorTask; |
|
|
@ -147,7 +150,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
private IbstIvtPackageinfoivtService packageinfoivtService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IMdpbBoxtypeService iMdpbBoxtypeService; |
|
|
|
|
|
|
@ -168,6 +170,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
@Autowired |
|
|
|
private IBstIvtShafttubeivtService shafttubeivtService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MdStorageVehicleInfoMapper mdStorageVehicleInfoMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private MdPdStoragevehicleextMapper mdPdStoragevehicleextMapper; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* task_id:任务标识 |
|
|
@ -267,7 +276,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> orderFinish(String string) { |
|
|
|
JSONObject orderJson = JSONObject.parseObject(string); |
|
|
@ -1200,8 +1208,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@SneakyThrows |
|
|
@ -1236,13 +1242,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
if (ObjectUtil.isEmpty(whereJson.getString("material_barcode"))) { |
|
|
|
throw new BadRequestException("子卷号不能为空!"); |
|
|
|
} |
|
|
|
// 5-木箱入库.木箱回库
|
|
|
|
String materialBarcode = whereJson.getString("material_barcode"); |
|
|
|
if (materialBarcode.contains("BRMX")){ |
|
|
|
String brBox = Arrays.asList(materialBarcode.split(",")).get(0); |
|
|
|
whereJson.put("box_no", brBox.replace("BR", "")); |
|
|
|
inBoxManageService.inBox(whereJson); |
|
|
|
}else { |
|
|
|
if (whereJson.getIntValue("weight") <= 0) { |
|
|
|
throw new BadRequestException("上报的重量不能为0!"); |
|
|
|
} |
|
|
@ -1259,11 +1258,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
.eq("vehicle_code2", whereJson.getString("vehicle_code")) |
|
|
|
.eq("is_delete", "0") |
|
|
|
.lt("task_status", TaskStatusEnum.EXECUTING.getCode())); |
|
|
|
JSONObject jsonExt = WQLObject.getWQLObject("md_pb_storagevehicleext").query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'").uniqueResult(0); |
|
|
|
if (ObjectUtil.isEmpty(jsonExt)) { |
|
|
|
|
|
|
|
MdPdStoragevehicleext mdPdStoragevehicleext = mdPdStoragevehicleextMapper.selectOne(new QueryWrapper<MdPdStoragevehicleext>().eq("storagevehicle_code", whereJson.getString("vehicle_code"))); |
|
|
|
if (ObjectUtil.isEmpty(mdPdStoragevehicleext)) { |
|
|
|
errorMsg.add("载具无数据" + whereJson.getString("vehicle_code")); |
|
|
|
} else { |
|
|
|
String pcsn = jsonExt.getString("pcsn"); |
|
|
|
String pcsn = mdPdStoragevehicleext.getPcsn(); |
|
|
|
if (StringUtils.isNotEmpty(pcsn)) { |
|
|
|
JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + pcsn + "'").getResultJSONArray(0); |
|
|
|
if (stIvtStructattr != null && stIvtStructattr.size() > 0) { |
|
|
@ -1323,7 +1323,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
bean.immediateNotifyAcs(null); |
|
|
|
PdmProductSpecServiceImpl.doRecord(SpecEnum.TYCK, null, Boolean.FALSE, errorMsg.toString(), containers); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) { |
|
|
|
// 2-空盘入库
|
|
|
@ -1362,16 +1361,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
// 处理分割结果不足的情况
|
|
|
|
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("box_no", box_arr[0]); |
|
|
@ -1388,10 +1379,8 @@ 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)) { |
|
|
|
MdPdStorageVehicleInfo mdPdStorageVehicleInfo = mdStorageVehicleInfoMapper.selectOne(new QueryWrapper<MdPdStorageVehicleInfo>().eq("storagevehicle_code", whereJson.getString("vehicle_code"))); |
|
|
|
if (ObjectUtil.isEmpty(mdPdStorageVehicleInfo)) { |
|
|
|
throw new BadRequestException("载具不存在!"); |
|
|
|
} |
|
|
|
int hasTask = taskService.count(new QueryWrapper<SchBaseTask>() |
|
|
@ -1401,33 +1390,37 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
if (hasTask > 0) { |
|
|
|
throw new BadRequestException("托盘" + whereJson.getString("vehicle_code") + "存在执行的任务"); |
|
|
|
} |
|
|
|
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); |
|
|
|
|
|
|
|
MdPdStoragevehicleext mdPdStoragevehicleext = mdPdStoragevehicleextMapper.selectOne(new QueryWrapper<MdPdStoragevehicleext>().eq("storagevehicle_code", mdPdStorageVehicleInfo.getStoragevehicle_code())); |
|
|
|
|
|
|
|
if (ObjectUtil.isEmpty(mdPdStoragevehicleext)) { |
|
|
|
|
|
|
|
MdPdStoragevehicleext mdPdStoragevehicleextInsert = new MdPdStoragevehicleext(); |
|
|
|
mdPdStoragevehicleextInsert.setStoragevehicleext_id(org.nl.common.utils.IdUtil.getStringId()); |
|
|
|
mdPdStoragevehicleextInsert.setStoragevehicle_code(mdPdStorageVehicleInfo.getStoragevehicle_code()); |
|
|
|
mdPdStoragevehicleextInsert.setStoragevehicle_id(mdPdStorageVehicleInfo.getStoragevehicle_id()); |
|
|
|
mdPdStoragevehicleextInsert.setStoragevehicle_type(mdPdStorageVehicleInfo.getStoragevehicle_type()); |
|
|
|
mdPdStoragevehicleextInsert.setPcsn(whereJson.getString("box_no")); |
|
|
|
mdPdStoragevehicleextInsert.setDevice_uuid(org.nl.common.utils.IdUtil.getLongId()); |
|
|
|
mdPdStoragevehicleextInsert.setUpdate_time(DateUtil.now()); |
|
|
|
mdPdStoragevehicleextMapper.insert(mdPdStoragevehicleextInsert); |
|
|
|
|
|
|
|
} else { |
|
|
|
String pcsn = ext_jo.getString("pcsn"); |
|
|
|
String pcsn = mdPdStoragevehicleext.getPcsn(); |
|
|
|
if (StringUtils.isNotEmpty(pcsn)) { |
|
|
|
JSONArray stIvtStructattr = WQLObject.getWQLObject("st_ivt_structattr").query("storagevehicle_code = '" + pcsn + "'").getResultJSONArray(0); |
|
|
|
if (stIvtStructattr != null && stIvtStructattr.size() > 0) { |
|
|
|
throw new BadRequestException("当前托盘" + whereJson.getString("vehicle_code") + "已经绑定木箱" + pcsn); |
|
|
|
} |
|
|
|
} |
|
|
|
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); |
|
|
|
mdPdStoragevehicleext.setPcsn(whereJson.getString("box_no")); |
|
|
|
mdPdStoragevehicleext.setDevice_uuid(org.nl.common.utils.IdUtil.getLongId()); |
|
|
|
mdPdStoragevehicleext.setUpdate_time(DateUtil.now()); |
|
|
|
mdPdStoragevehicleextMapper.updateById(mdPdStoragevehicleext); |
|
|
|
} |
|
|
|
whereJson.put("material_barcode", material_barcode); |
|
|
|
inBussManageService.inTask(whereJson); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
result.put("status", HttpStatus.OK.value()); |
|
|
|
result.put("message", "下发成功!"); |
|
|
|