| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| | | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| | |
| | | convertSet(list, MesWmItemReceiptDO::getNoticeId)); |
| | | // 2. 构建结果 |
| | | return BeanUtils.toBean(list, MesWmItemReceiptRespVO.class, vo -> { |
| | | MapUtils.findAndThen(supplierMap, vo.getVendorId(), |
| | | supplier -> vo.setVendorName(supplier.getName())); |
| | | // 供应商名称、到货通知单编码以单据上的文本为准(支持手工填写);为空时才回退到按编号反查,兼容历史数据 |
| | | if (StrUtil.isEmpty(vo.getVendorName())) { |
| | | MapUtils.findAndThen(supplierMap, vo.getVendorId(), |
| | | supplier -> vo.setVendorName(supplier.getName())); |
| | | } |
| | | MapUtils.findAndThen(iqcMap, vo.getIqcId(), |
| | | iqc -> vo.setIqcCode(iqc.getCode())); |
| | | MapUtils.findAndThen(noticeMap, vo.getNoticeId(), notice -> |
| | | vo.setNoticeCode(notice.getCode())); |
| | | if (StrUtil.isEmpty(vo.getNoticeCode())) { |
| | | MapUtils.findAndThen(noticeMap, vo.getNoticeId(), notice -> |
| | | vo.setNoticeCode(notice.getCode())); |
| | | } |
| | | }); |
| | | } |
| | | |