|
|
@ -164,7 +164,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
public PdaResponse getMaterialDtl(JSONObject whereJson) { |
|
|
|
List<StructattrVechielDto> list = iStructattrService.collectVechicle( |
|
|
|
MapOf.of("search", whereJson.getString("search"), |
|
|
|
"stor_code", "XB01", |
|
|
|
"stor_code", "XB", |
|
|
|
"status", GROUP_PLATE_STATUS.code("入库"), |
|
|
|
"is_lock", "false", |
|
|
|
"order_by", "gro.create_time asc")); |
|
|
@ -240,28 +240,23 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
@Transactional |
|
|
|
public PdaResponse vehicleOutConfirm(JSONObject whereJson) { |
|
|
|
long qty = 1L; |
|
|
|
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
String materialCode = StatusEnum.VEHICLE_TYPE.code("空托盘"); |
|
|
|
//空料箱出库
|
|
|
|
if (StringUtils.isNotBlank(whereJson.getString("qty"))) { |
|
|
|
qty = whereJson.getLongValue("qty"); |
|
|
|
if (qty > 6) { |
|
|
|
throw new BadRequestException("一次性只能输入小于7以内的载具数量"); |
|
|
|
} |
|
|
|
queryWrapper.eq(MdMeMaterialbase::getMaterial_id, StatusEnum.VEHICLE_TYPE.code("空料箱")); |
|
|
|
} else { |
|
|
|
queryWrapper.eq(MdMeMaterialbase::getMaterial_id, StatusEnum.VEHICLE_TYPE.code("空托盘")); |
|
|
|
|
|
|
|
materialCode = StatusEnum.VEHICLE_TYPE.code("空料箱"); |
|
|
|
} |
|
|
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getOne(queryWrapper); |
|
|
|
MdMeMaterialbase materDao = iMdMeMaterialbaseService.getByCode(materialCode); |
|
|
|
if (materDao == null) { |
|
|
|
throw new BadRequestException("未找到空载具物料信息!"); |
|
|
|
} |
|
|
|
whereJson.put("pcsn", "1"); |
|
|
|
whereJson.put("material_id", materDao.getMaterial_id()); |
|
|
|
whereJson.put("material_code", materDao.getMaterial_code()); |
|
|
|
Sectattr sectattr = iSectattrService.getById(new LambdaQueryWrapper<>(Sectattr.class) |
|
|
|
.eq(Sectattr::getSect_id, whereJson.getString("sect_id")) |
|
|
|
.eq(Sectattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是")) |
|
|
|
); |
|
|
|
Sectattr sectattr = iSectattrService.getById(whereJson.getString("sect_id")); |
|
|
|
if (ObjectUtil.isEmpty(sectattr)) { |
|
|
|
throw new BadRequestException("该仓位所属的库区已禁用,请先启用该库区!"); |
|
|
|
} |
|
|
@ -276,7 +271,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
.material_code(whereJson.getString("material_code")) |
|
|
|
.qty(BigDecimal.valueOf(qty)) |
|
|
|
.build(); |
|
|
|
List<StrategyStructMaterialVO> structList = iStructattrService.outBoundSectDiv(strategyStructParam); |
|
|
|
List<StructattrVechielDto> structList = iStructattrService.outBoundSectDiv(strategyStructParam); |
|
|
|
if (CollectionUtils.isEmpty(structList)) { |
|
|
|
throw new BadRequestException("无可用库存!"); |
|
|
|
} |
|
|
@ -284,18 +279,16 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
//创建任务
|
|
|
|
JSONObject taskForm = new JSONObject(); |
|
|
|
taskForm.put("task_type", IOSConstant.VEHICLE_OUT_TASK); |
|
|
|
taskForm.put("config_code", IOSConstant.VEHICLE_IN_TASK); |
|
|
|
taskForm.put("config_code", IOSConstant.VEHICLE_OUT_TASK); |
|
|
|
taskForm.put("TaskCode", CodeUtil.getNewCode("TASK_CODE")); |
|
|
|
taskForm.put("PickingLocation", r.getStruct_code()); |
|
|
|
taskForm.put("PlacedLocation", whereJson.getString("siteCode")); |
|
|
|
taskForm.put("vehicle_code", r.getStoragevehicle_code()); |
|
|
|
VehicleOutTask vehicleOutTask = SpringContextHolder.getBean("VehicleOutTask"); |
|
|
|
applyTaskMap.get(IOSConstant.VEHICLE_IN_TASK).create(whereJson); |
|
|
|
vehicleOutTask.create(taskForm); |
|
|
|
applyTaskMap.get(IOSConstant.VEHICLE_OUT_TASK).create(taskForm); |
|
|
|
}); |
|
|
|
//更新组盘记录表
|
|
|
|
Set<String> vehicleCodeSet = structList.stream() |
|
|
|
.map(StrategyStructMaterialVO::getStoragevehicle_code) |
|
|
|
.map(StructattrVechielDto::getStoragevehicle_code) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
mdPbGroupplateMapper.update( |
|
|
|
new GroupPlate(), |
|
|
@ -306,7 +299,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
); |
|
|
|
//锁定仓位
|
|
|
|
Set<String> structCodeSet = structList.stream() |
|
|
|
.map(StrategyStructMaterialVO::getStruct_code) |
|
|
|
.map(StructattrVechielDto::getStruct_code) |
|
|
|
.collect(Collectors.toSet()); |
|
|
|
iStructattrService.update( |
|
|
|
new LambdaUpdateWrapper<Structattr>() |
|
|
@ -337,7 +330,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
io_mst.put("stor_name", whereJson.get("store_name")); |
|
|
|
io_mst.put("detail_count", 1); |
|
|
|
io_mst.put("bill_status", IOSEnum.BILL_STATUS.code("分配完")); |
|
|
|
io_mst.put("create_mode", IOSEnum.CREATE_MODE.code("PC产生")); |
|
|
|
io_mst.put("create_mode", ObjectUtils.isEmpty(whereJson.get("create_mode")) ? IOSEnum.CREATE_MODE.code("PC产生") : whereJson.get("create_mode")); |
|
|
|
io_mst.put("input_optid", currentUserId + ""); |
|
|
|
io_mst.put("input_optname", nickName); |
|
|
|
io_mst.put("input_time", now); |
|
|
@ -358,6 +351,12 @@ public class PdaIosOutServiceImpl implements PdaIosOutService { |
|
|
|
ioStorInvDtl.put("seq_no", "1"); |
|
|
|
ioStorInvDtl.put("material_id", whereJson.get("material_id")); |
|
|
|
ioStorInvDtl.put("material_code", whereJson.get("material_code")); |
|
|
|
ioStorInvDtl.put("sect_id", whereJson.get("sect_id")); |
|
|
|
ioStorInvDtl.put("sect_code", whereJson.get("sect_code")); |
|
|
|
ioStorInvDtl.put("sect_name", whereJson.get("sect_name")); |
|
|
|
ioStorInvDtl.put("struct_id", whereJson.get("struct_id")); |
|
|
|
ioStorInvDtl.put("struct_code", whereJson.get("struct_code")); |
|
|
|
ioStorInvDtl.put("struct_name", whereJson.get("struct_name")); |
|
|
|
ioStorInvDtl.put("Pcsn", whereJson.get("pcsn")); |
|
|
|
ioStorInvDtl.put("bill_status", IOSEnum.BILL_STATUS.code("分配完")); |
|
|
|
ioStorInvDtl.put("qty_unit_id", whereJson.get("unit_id")); |
|
|
|