diff --git a/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/demand/controller/PdaPlatingDemandController.java b/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/demand/controller/PdaPlatingDemandController.java index 5d32c26f..6344f7cc 100644 --- a/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/demand/controller/PdaPlatingDemandController.java +++ b/nladmin-system/wms-server/src/main/java/org/nl/wms/pda_manage/demand/controller/PdaPlatingDemandController.java @@ -1,5 +1,6 @@ package org.nl.wms.pda_manage.demand.controller; +import cn.dev33.satoken.annotation.SaIgnore; import org.nl.common.base.ResponseData; import org.nl.common.logging.annotation.Log; import org.nl.wms.pm_manage.demand.service.IPlatingDemandService; @@ -13,19 +14,23 @@ import javax.annotation.Resource; @RestController @RequestMapping("/api/pda/platingDemand") public class PdaPlatingDemandController { - @Resource private IPlatingDemandService platingDemandService; + @Resource + private IPlatingDemandService platingDemandService; @GetMapping + @SaIgnore public ResponseEntity unfinished() { return ResponseData.build(platingDemandService.unfinished(), HttpStatus.OK); } @GetMapping("/{id}") + @SaIgnore public ResponseEntity detail(@PathVariable String id) { return ResponseData.build(platingDemandService.detail(id), HttpStatus.OK); } @PostMapping("/{id}/complete") + @SaIgnore @Log("PDA完成托盘配料需求单") public ResponseEntity complete(@PathVariable String id, @RequestBody PlatingDemandCompleteParam param) { platingDemandService.complete(id, param); diff --git a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/dto/PlatingDemandCompleteParam.java b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/dto/PlatingDemandCompleteParam.java index 188440d5..50d6d404 100644 --- a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/dto/PlatingDemandCompleteParam.java +++ b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/dto/PlatingDemandCompleteParam.java @@ -5,4 +5,6 @@ import lombok.Data; @Data public class PlatingDemandCompleteParam { private String palletCode; + private String storeCode; + private String pointCode; } diff --git a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PlatingDemandServiceImpl.java b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PlatingDemandServiceImpl.java index bda87509..de41e276 100644 --- a/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PlatingDemandServiceImpl.java +++ b/nladmin-system/wms-server/src/main/java/org/nl/wms/pm_manage/demand/service/impl/PlatingDemandServiceImpl.java @@ -12,6 +12,7 @@ import org.nl.common.utils.IdUtil; import org.nl.common.utils.SecurityUtils; import org.nl.wms.basedata_manage.enums.BaseDataEnum; import org.nl.wms.basedata_manage.service.IMdMeMaterialbaseService; +import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService; import org.nl.wms.basedata_manage.service.IStructattrService; import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase; import org.nl.wms.basedata_manage.service.dao.Structattr; @@ -22,6 +23,8 @@ import org.nl.wms.pm_manage.demand.service.dao.mapper.PmPlatingDemandItemMapper; import org.nl.wms.pm_manage.demand.service.dao.mapper.PmPlatingDemandMapper; import org.nl.wms.pm_manage.demand.service.dto.PlatingDemandCompleteParam; import org.nl.wms.pm_manage.demand.service.dto.PlatingDemandDto; +import org.nl.wms.sch_manage.service.ISchBasePointService; +import org.nl.wms.sch_manage.service.dao.SchBasePoint; import org.nl.wms.warehouse_manage.enums.IOSEnum; import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInv; import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis; @@ -75,6 +78,10 @@ public class PlatingDemandServiceImpl implements IPlatingDemandService { private IStInventoryService inventoryService; @Resource private IPmStockReturnService stockReturnService; + @Resource + private ISchBasePointService schBasePointService; + @Resource + private IMdPbStoragevehicleinfoService storagevehicleinfoService; @Override public List preview(List workOrderCodes) { @@ -167,17 +174,20 @@ public class PlatingDemandServiceImpl implements IPlatingDemandService { @Override @Transactional(rollbackFor = Exception.class) public void complete(String id, PlatingDemandCompleteParam param) { + SchBasePoint point = schBasePointService.selectByCode(param.getPointCode()); + if (point == null) throw new BadRequestException("点位不存在:" + param.getPointCode()); PmPlatingDemand demand = demandMapper.selectById(id); if (demand == null || demand.getStatus() == 2) throw new BadRequestException("需求单不存在或已完成"); if (param == null || param.getPalletCode() == null || param.getPalletCode().trim().isEmpty()) throw new BadRequestException("请输入托盘编码"); + storagevehicleinfoService.chackAndInsert(param.getPalletCode()); List items = items(id); List plates = groupplateService.list(new LambdaQueryWrapper().eq(GroupPlate::getStoragevehicle_code, param.getPalletCode()).ne(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("出库"))); Map palletQty = plates.stream().collect(Collectors.groupingBy(GroupPlate::getMaterial_code, Collectors.mapping(GroupPlate::getQty, Collectors.reducing(BigDecimal.ZERO, BigDecimal::add)))); for (PmPlatingDemandItem item : items) if (palletQty.getOrDefault(item.getMaterial_code(), BigDecimal.ZERO).compareTo(item.getDemand_qty()) < 0) throw new BadRequestException("托盘物料不足:" + item.getMaterial_code()); - Structattr struct = structattrService.getOne(new LambdaQueryWrapper().eq(Structattr::getStoragevehicle_code, param.getPalletCode()).last("limit 1")); + Structattr struct = structattrService.getOne(new LambdaQueryWrapper().eq(Structattr::getSect_code, param.getStoreCode()).last("limit 1")); if (struct == null) throw new BadRequestException("托盘未绑定库位:" + param.getPalletCode()); saveOutbound(demand, items, struct, param.getPalletCode()); demandMapper.update(null, new LambdaUpdateWrapper().eq(PmPlatingDemand::getId, id).set(PmPlatingDemand::getStatus, 2).set(PmPlatingDemand::getPallet_code, param.getPalletCode()).set(PmPlatingDemand::getFinish_time, DateUtil.now())); diff --git a/pda/pda/src/views/PlatingDemand.vue b/pda/pda/src/views/PlatingDemand.vue new file mode 100644 index 00000000..ae87e98d --- /dev/null +++ b/pda/pda/src/views/PlatingDemand.vue @@ -0,0 +1,98 @@ + + + + +