fix:空载具入库

This commit is contained in:
zhengxuming
2025-08-04 18:59:24 +08:00
parent 1bf135a0ff
commit 9a235d481d
2 changed files with 17 additions and 73 deletions

View File

@@ -171,12 +171,12 @@ public class PdaIosInController {
}
/**
* 空载具
* 空载具
*/
@PostMapping("vehicleInConfirm")
@Log("空载具入库")
public ResponseEntity<Object> vehicleInConfirm(@RequestBody JSONObject whereJson) {
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_code", "vehicle_code", "material_code", "stor_id", "site_code");
assertNotBlankJson(whereJson, "请求参数不能为空", "sect_code", "vehicle_code", "site_code");
return new ResponseEntity<>(pdaIosInService.vehicleInConfirm(whereJson), HttpStatus.OK);
}
}

View File

@@ -174,7 +174,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
private SchBasePointMapper schBasePointMapper;
/**
*
* 字典
*/
@Autowired
private SysDictMapper sysDictMapper;
@@ -182,6 +182,9 @@ public class PdaIosInServiceImpl implements PdaIosInService {
@Autowired
private ISchBaseTaskService iSchBaseTaskService;
@Autowired
private ISectattrService sectattrService;
/**
* 区域服务
@@ -390,80 +393,21 @@ public class PdaIosInServiceImpl implements PdaIosInService {
}
@Override
@Transactional
public PdaResponse vehicleInConfirm(JSONObject whereJson) {
// long qty = 1L;
// LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new LambdaQueryWrapper<>();
// //空托盘出库
// queryWrapper.eq(MdMeMaterialbase::getMaterial_id, StatusEnum.VEHICLE_TYPE.code("空托盘"));
//
// MdMeMaterialbase materDao = iMdMeMaterialbaseService.getOne(queryWrapper);
// if (materDao == null) {
// throw new BadRequestException("未找到空载具物料信息!");
// }
// 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("是"))
// );
// if (ObjectUtil.isEmpty(sectattr)) {
// throw new BadRequestException("该仓位所属的库区已禁用,请先启用该库区!");
// }
// BsrealStorattr storeDao = iSrealStorattrService.getById(sectattr.getStor_id());
// whereJson.put("stor_code", storeDao.getStor_code());
// whereJson.put("sect_code", sectattr.getSect_code());
// StrategyStructParam strategyStructParam = StrategyStructParam.builder()
// .ioType(whereJson.getString(StatusEnum.STRATEGY_TYPE.code("出库")))
// .sect_code(whereJson.getString("sect_code"))
// .stor_code(whereJson.getString("stor_code"))
// .material_code(whereJson.getString("material_id"))
// .material_code(whereJson.getString("material_code"))
// .qty(BigDecimal.valueOf(qty))
// .build();
// List<StrategyStructMaterialVO> structList = iStructattrService.outBoundSectDiv(strategyStructParam);
// if (CollectionUtils.isEmpty(structList)) {
// throw new BadRequestException("无可用库存!");
// }
// structList.forEach(r -> {
// //创建任务
// JSONObject taskForm = new JSONObject();
// taskForm.put("task_type", IOSConstant.VEHICLE_IN_TASK);
// taskForm.put("config_code", IOSConstant.VEHICLE_IN_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());
// VehicleInTask vehicleInTask = SpringContextHolder.getBean("VehicleInTask");
// applyTaskMap.get(IOSConstant.VEHICLE_IN_TASK).create(whereJson);
// vehicleInTask.create(taskForm);
// });
// //更新组盘记录表
// Set<String> vehicleCodeSet = structList.stream()
// .map(StrategyStructMaterialVO::getStoragevehicle_code)
// .collect(Collectors.toSet());
// mdPbGroupplateMapper.update(
// new GroupPlate(),
// new LambdaUpdateWrapper<GroupPlate>()
// .set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))
// .eq(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("入库"))
// .in(GroupPlate::getStoragevehicle_code, vehicleCodeSet)
// );
// //锁定仓位
// Set<String> structCodeSet = structList.stream()
// .map(StrategyStructMaterialVO::getStruct_code)
// .collect(Collectors.toSet());
// iStructattrService.update(
// new LambdaUpdateWrapper<Structattr>()
// .set(Structattr::getInv_id, null)
// .set(Structattr::getInv_code, null)
// .set(Structattr::getInv_type, null)
// .set(Structattr::getLock_type, IOSEnum.LOCK_TYPE.code("出库锁"))
// .in(Structattr::getStruct_code, structCodeSet)
// );
//空载具入库
Sectattr sectattr = sectattrService.findByCode(whereJson.getString("sect_code"));
if(sectattr == null){
throw new BadRequestException("库区" + whereJson.getString("sect_code") +"不存在");
}
whereJson.put("stor_id",sectattr.getStor_id());
whereJson.put("qty", 1);
String materialCode = StatusEnum.VEHICLE_TYPE.code("空托盘");
whereJson.put("material_id", materialCode);
whereJson.put("material_id", iMdMeMaterialbaseService.getByCode(materialCode,false).getMaterial_id());
whereJson.put("material_code", materialCode);
whereJson.put("pcsn","空托盘入库");
//组盘
groupPlate(whereJson);
// 生成空载具入库任务