fix:优化

This commit is contained in:
zhengxuming
2025-08-14 09:59:37 +08:00
parent 48041252d7
commit b186315906
3 changed files with 34 additions and 1 deletions

View File

@@ -180,6 +180,26 @@ public class MesToWmsServiceImpl implements MesToWmsService {
throw new BadRequestException("task_code" + dto.getTask_code() + "已存在,请勿重复提交!");
}
//根据料桶号去载具表匹配料桶类型
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = iMdPbStoragevehicleinfoService.getByCode(outStructAttr.getStoragevehicle_code());
if(mdPbStoragevehicleinfo == null){
throw new BadRequestException("未找到" + outStructAttr.getStruct_code() + "点位上的的载具!");
}
//通过料桶号的料桶类型,匹配确认入库库区
Dict dict= dictService.getDictByCodeAndValue("storagevehicle_type",mdPbStoragevehicleinfo.getStoragevehicle_type());
if(dict==null){
throw new BadRequestException("未找到载具编码为" + outStructAttr.getStoragevehicle_code() + "的载具库区,请检查字典中是否维护!只允许料桶叫料!");
}
//查询库区
Sectattr sectattr = sectattrService.findByCode(dict.getPara1());
if (sectattr == null) {
throw new BadRequestException("未找到载具编码为" + outStructAttr.getStoragevehicle_code() + "的载具库区,请检查字典中是否维护!只允许料桶叫料!");
}
//1、单独上料2、下空桶上满料
if("1".equals(dto.getTask_type())){
log.info("单独上料叫料,请求参数:【{}】", JSONObject.toJSONString(dto));
@@ -467,6 +487,10 @@ public class MesToWmsServiceImpl implements MesToWmsService {
//查询库区
Sectattr sectattr = sectattrService.findByCode(dict.getPara1());
if(sectattr==null){
throw new BadRequestException("未找到载具编码为" + dto.getVehicle_code() + "的载具入库库区,请检查字典中是否维护!");
}
JSONObject param = new JSONObject();
if(dto.getIsManual() != null && dto.getIsManual()){
param.put("create_mode", "手动" );

View File

@@ -158,4 +158,13 @@ public class OutBillController {
dto.setIsManual(true);
return new ResponseEntity<>(mesToWmsService.callMaterial(dto), HttpStatus.OK);
}
@PostMapping("/BackMaterial")
@Log("人工退料")
public ResponseEntity<Object> backMaterial(@RequestBody @Validated MesManualBackMaterialRequestDto manualDto) {
MesBackMaterialRequestDto dto = new MesBackMaterialRequestDto();
BeanUtils.copyProperties(manualDto, dto);
dto.setIsManual(true);
return new ResponseEntity<>(mesToWmsService.backMaterial(dto), HttpStatus.OK);
}
}

View File

@@ -177,7 +177,7 @@ public class UpdateIvtUtils {
.eq(GroupPlate::getPcsn, where.getString("pcsn"))
);
if (ObjectUtil.isEmpty(extDao)) {
throw new BadRequestException("当前载具【" + extDao.getStoragevehicle_code() + "】不存在相关物料批次库存,请检查数据!");
throw new BadRequestException("当前载具【" + where.getString("storagevehicle_code") + "】不存在相关物料批次库存,请检查数据!");
}
// 减可用数
double canuse_qty = NumberUtil.sub(extDao.getQty(), where.getDoubleValue("change_qty")).doubleValue();