Commit 0f0b39573a37816beac57ff6f374562068c61740
1 parent
bf026611
✨ feat(mes): 新增采购订单号字段及相关逻辑处理
Showing
5 changed files
with
13 additions
and
24 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/vo/MesWmItemReceiptSaveReqVO.java
| ... | ... | @@ -36,6 +36,9 @@ public class MesWmItemReceiptSaveReqVO { |
| 36 | 36 | @NotNull(message = "入库日期不能为空") |
| 37 | 37 | private LocalDateTime receiptDate; |
| 38 | 38 | |
| 39 | + @Schema(description = "采购订单号", example = "PO20260201") | |
| 40 | + private String purchaseOrderCode; | |
| 41 | + | |
| 39 | 42 | @Schema(description = "备注", example = "备注") |
| 40 | 43 | private String remark; |
| 41 | 44 | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/vo/line/MesWmItemReceiptLineSaveReqVO.java
| ... | ... | @@ -31,13 +31,6 @@ public class MesWmItemReceiptLineSaveReqVO { |
| 31 | 31 | @DecimalMin(value = "0", inclusive = false, message = "入库数量必须大于 0") |
| 32 | 32 | private BigDecimal receivedQuantity; |
| 33 | 33 | |
| 34 | - // TODO DONE @芋艿:已添加 batchCode 字段,前端可以使用 batchCode 输入批次编码 | |
| 35 | - @Schema(description = "批次编号", example = "1") | |
| 36 | - private Long batchId; | |
| 37 | - | |
| 38 | - @Schema(description = "批次编码", example = "BATCH20260225001") | |
| 39 | - private String batchCode; | |
| 40 | - | |
| 41 | 34 | @Schema(description = "生产日期") |
| 42 | 35 | private LocalDateTime productionDate; |
| 43 | 36 | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/itemreceipt/MesWmItemReceiptDO.java
| ... | ... | @@ -3,11 +3,8 @@ package cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemreceipt; |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | 4 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; |
| 5 | 5 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.iqc.MesQcIqcDO; |
| 6 | -import cn.iocoder.yudao.module.mes.enums.wm.MesWmItemReceiptStatusEnum; | |
| 7 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; |
| 8 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseAreaDO; | |
| 9 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseDO; | |
| 10 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.warehouse.MesWmWarehouseLocationDO; | |
| 7 | +import cn.iocoder.yudao.module.mes.enums.wm.MesWmItemReceiptStatusEnum; | |
| 11 | 8 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 12 | 9 | import com.baomidou.mybatisplus.annotation.TableId; |
| 13 | 10 | import com.baomidou.mybatisplus.annotation.TableName; |
| ... | ... | @@ -54,6 +51,12 @@ public class MesWmItemReceiptDO extends BaseDO { |
| 54 | 51 | */ |
| 55 | 52 | private Long noticeId; |
| 56 | 53 | /** |
| 54 | + * 采购订单号 | |
| 55 | + * | |
| 56 | + * 冗余自 {@link MesWmArrivalNoticeDO#getPurchaseOrderCode()},也可以手动填写 | |
| 57 | + */ | |
| 58 | + private String purchaseOrderCode; | |
| 59 | + /** | |
| 57 | 60 | * 供应商编号 |
| 58 | 61 | * |
| 59 | 62 | * 关联 {@link MesMdVendorDO#getId()} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/itemreceipt/MesWmItemReceiptLineServiceImpl.java
| ... | ... | @@ -6,13 +6,11 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 6 | 6 | import cn.iocoder.yudao.module.mes.controller.admin.wm.batch.vo.MesWmBatchGenerateReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.line.MesWmItemReceiptLinePageReqVO; |
| 8 | 8 | import cn.iocoder.yudao.module.mes.controller.admin.wm.itemreceipt.vo.line.MesWmItemReceiptLineSaveReqVO; |
| 9 | -import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; | |
| 10 | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.batch.MesWmBatchDO; |
| 11 | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemreceipt.MesWmItemReceiptDO; |
| 12 | 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.itemreceipt.MesWmItemReceiptLineDO; |
| 13 | 12 | import cn.iocoder.yudao.module.mes.dal.mysql.wm.itemreceipt.MesWmItemReceiptLineMapper; |
| 14 | 13 | import cn.iocoder.yudao.module.mes.service.wm.arrivalnotice.MesWmArrivalNoticeLineService; |
| 15 | -import cn.iocoder.yudao.module.mes.service.wm.arrivalnotice.MesWmArrivalNoticeService; | |
| 16 | 14 | import cn.iocoder.yudao.module.mes.service.wm.batch.MesWmBatchService; |
| 17 | 15 | import jakarta.annotation.Resource; |
| 18 | 16 | import org.springframework.context.annotation.Lazy; |
| ... | ... | @@ -45,9 +43,6 @@ public class MesWmItemReceiptLineServiceImpl implements MesWmItemReceiptLineServ |
| 45 | 43 | @Lazy |
| 46 | 44 | private MesWmArrivalNoticeLineService arrivalNoticeLineService; |
| 47 | 45 | @Resource |
| 48 | - @Lazy | |
| 49 | - private MesWmArrivalNoticeService arrivalNoticeService; | |
| 50 | - @Resource | |
| 51 | 46 | private MesWmBatchService batchService; |
| 52 | 47 | |
| 53 | 48 | @Override |
| ... | ... | @@ -183,14 +178,8 @@ public class MesWmItemReceiptLineServiceImpl implements MesWmItemReceiptLineServ |
| 183 | 178 | batchReqVO.setItemId(reqVO.getItemId()).setProduceDate(reqVO.getProductionDate()) |
| 184 | 179 | .setExpireDate(reqVO.getExpireDate()).setLotNumber(reqVO.getLotNumber()); |
| 185 | 180 | // 从父单据获取 |
| 186 | - batchReqVO.setVendorId(receipt.getVendorId()).setReceiptDate(receipt.getReceiptDate()); | |
| 187 | - // 从到货通知单获取采购订单号(如果关联了到货通知单) | |
| 188 | - if (receipt.getNoticeId() != null) { | |
| 189 | - MesWmArrivalNoticeDO notice = arrivalNoticeService.getArrivalNotice(receipt.getNoticeId()); | |
| 190 | - if (notice != null) { | |
| 191 | - batchReqVO.setPurchaseOrderCode(notice.getPurchaseOrderCode()); | |
| 192 | - } | |
| 193 | - } | |
| 181 | + batchReqVO.setVendorId(receipt.getVendorId()).setReceiptDate(receipt.getReceiptDate()) | |
| 182 | + .setPurchaseOrderCode(receipt.getPurchaseOrderCode()); | |
| 194 | 183 | |
| 195 | 184 | // 生成或获取批次 |
| 196 | 185 | return batchService.getOrGenerateBatchCode(batchReqVO); | ... | ... |
yudao-module-mes/src/test/resources/sql/create_tables.sql
| ... | ... | @@ -459,6 +459,7 @@ CREATE TABLE IF NOT EXISTS "mes_wm_item_receipt" ( |
| 459 | 459 | "iqc_id" bigint DEFAULT NULL, |
| 460 | 460 | "notice_id" bigint DEFAULT NULL, |
| 461 | 461 | "vendor_id" bigint DEFAULT NULL, |
| 462 | + "purchase_order_code" varchar(64) DEFAULT NULL, | |
| 462 | 463 | "receipt_date" timestamp DEFAULT NULL, |
| 463 | 464 | "status" tinyint NOT NULL DEFAULT 0, |
| 464 | 465 | "remark" varchar(500) DEFAULT NULL, | ... | ... |