gaoluyang
5 天以前 a0b4de611e3b1986b2713c6a161cc1613ec31a5b
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/MesWmArrivalNoticeController.java
@@ -77,7 +77,6 @@
    @GetMapping("/get")
    @Operation(summary = "获得到货通知单")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')")
    public CommonResult<MesWmArrivalNoticeRespVO> getArrivalNotice(@RequestParam("id") Long id) {
        MesWmArrivalNoticeDO notice = arrivalNoticeService.getArrivalNotice(id);
        if (notice == null) {
@@ -88,7 +87,6 @@
    @GetMapping("/page")
    @Operation(summary = "获得到货通知单分页")
    @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')")
    public CommonResult<PageResult<MesWmArrivalNoticeRespVO>> getArrivalNoticePage(
            @Valid MesWmArrivalNoticePageReqVO pageReqVO) {
        PageResult<MesWmArrivalNoticeDO> pageResult = arrivalNoticeService.getArrivalNoticePage(pageReqVO);
@@ -114,6 +112,14 @@
    public CommonResult<Boolean> submitArrivalNotice(@RequestParam("id") Long id) {
        arrivalNoticeService.submitArrivalNotice(id);
        return success(true);
    }
    @PostMapping("/create-iqc")
    @Operation(summary = "执行质检:为到货通知单的需检行生成来料检验单")
    @Parameter(name = "id", description = "到货通知单编号", required = true)
    @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:update')")
    public CommonResult<Integer> createArrivalNoticeIqc(@RequestParam("id") Long id) {
        return success(arrivalNoticeService.createIqcForArrivalNotice(id));
    }
    @PostMapping("/generate-from-purchase-order")
@@ -147,8 +153,13 @@
        return BeanUtils.toBean(list, MesWmArrivalNoticeRespVO.class, vo -> {
            MapUtils.findAndThen(supplierMap, vo.getVendorId(), supplier ->
                    vo.setVendorName(supplier.getName()));
            MapUtils.findAndThen(purchaseOrderMap, vo.getPurchaseOrderId(), purchaseOrder ->
                    vo.setPurchaseOrderNo(purchaseOrder.getNo()));
            MapUtils.findAndThen(purchaseOrderMap, vo.getPurchaseOrderId(), purchaseOrder -> {
                vo.setPurchaseOrderNo(purchaseOrder.getNo());
                // 历史单据未快照合同号时,回填采购订单上的合同号
                if (cn.hutool.core.util.StrUtil.isBlank(vo.getContractNo())) {
                    vo.setContractNo(purchaseOrder.getContractNo());
                }
            });
        });
    }