Commit 09442e65616b19df0f4221d31ef339ece9ff7d8b
1 parent
cb051458
feat(mes): add VO and service for managing MES arrival notice and arrival notice line
Showing
16 changed files
with
1216 additions
and
0 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/MesWmArrivalNoticeController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.collection.CollUtil; | ||
| 4 | +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 7 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 8 | +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | ||
| 9 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 10 | +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticePageReqVO; | ||
| 12 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticeRespVO; | ||
| 13 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticeSaveReqVO; | ||
| 14 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; | ||
| 15 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; | ||
| 16 | +import cn.iocoder.yudao.module.mes.service.md.vendor.MesMdVendorService; | ||
| 17 | +import cn.iocoder.yudao.module.mes.service.wm.arrivalnotice.MesWmArrivalNoticeService; | ||
| 18 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 19 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 20 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 21 | +import jakarta.annotation.Resource; | ||
| 22 | +import jakarta.servlet.http.HttpServletResponse; | ||
| 23 | +import jakarta.validation.Valid; | ||
| 24 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 25 | +import org.springframework.validation.annotation.Validated; | ||
| 26 | +import org.springframework.web.bind.annotation.*; | ||
| 27 | + | ||
| 28 | +import java.io.IOException; | ||
| 29 | +import java.util.Collections; | ||
| 30 | +import java.util.List; | ||
| 31 | +import java.util.Map; | ||
| 32 | + | ||
| 33 | +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | ||
| 34 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 35 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | ||
| 36 | + | ||
| 37 | +@Tag(name = "管理后台 - MES 到货通知单") | ||
| 38 | +@RestController | ||
| 39 | +@RequestMapping("/mes/wm/arrival-notice") | ||
| 40 | +@Validated | ||
| 41 | +public class MesWmArrivalNoticeController { | ||
| 42 | + | ||
| 43 | + @Resource | ||
| 44 | + private MesWmArrivalNoticeService arrivalNoticeService; | ||
| 45 | + | ||
| 46 | + @Resource | ||
| 47 | + private MesMdVendorService vendorService; | ||
| 48 | + | ||
| 49 | + @PostMapping("/create") | ||
| 50 | + @Operation(summary = "创建到货通知单") | ||
| 51 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:create')") | ||
| 52 | + public CommonResult<Long> createArrivalNotice(@Valid @RequestBody MesWmArrivalNoticeSaveReqVO createReqVO) { | ||
| 53 | + return success(arrivalNoticeService.createArrivalNotice(createReqVO)); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @PutMapping("/update") | ||
| 57 | + @Operation(summary = "修改到货通知单") | ||
| 58 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:update')") | ||
| 59 | + public CommonResult<Boolean> updateArrivalNotice(@Valid @RequestBody MesWmArrivalNoticeSaveReqVO updateReqVO) { | ||
| 60 | + arrivalNoticeService.updateArrivalNotice(updateReqVO); | ||
| 61 | + return success(true); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + @DeleteMapping("/delete") | ||
| 65 | + @Operation(summary = "删除到货通知单") | ||
| 66 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 67 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:delete')") | ||
| 68 | + public CommonResult<Boolean> deleteArrivalNotice(@RequestParam("id") Long id) { | ||
| 69 | + arrivalNoticeService.deleteArrivalNotice(id); | ||
| 70 | + return success(true); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + @GetMapping("/get") | ||
| 74 | + @Operation(summary = "获得到货通知单") | ||
| 75 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 76 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')") | ||
| 77 | + public CommonResult<MesWmArrivalNoticeRespVO> getArrivalNotice(@RequestParam("id") Long id) { | ||
| 78 | + MesWmArrivalNoticeDO notice = arrivalNoticeService.getArrivalNotice(id); | ||
| 79 | + if (notice == null) { | ||
| 80 | + return success(null); | ||
| 81 | + } | ||
| 82 | + return success(buildRespVOList(Collections.singletonList(notice)).get(0)); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + @GetMapping("/page") | ||
| 86 | + @Operation(summary = "获得到货通知单分页") | ||
| 87 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')") | ||
| 88 | + public CommonResult<PageResult<MesWmArrivalNoticeRespVO>> getArrivalNoticePage( | ||
| 89 | + @Valid MesWmArrivalNoticePageReqVO pageReqVO) { | ||
| 90 | + PageResult<MesWmArrivalNoticeDO> pageResult = arrivalNoticeService.getArrivalNoticePage(pageReqVO); | ||
| 91 | + return success(new PageResult<>(buildRespVOList(pageResult.getList()), pageResult.getTotal())); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + @GetMapping("/export-excel") | ||
| 95 | + @Operation(summary = "导出到货通知单 Excel") | ||
| 96 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:export')") | ||
| 97 | + @ApiAccessLog(operateType = EXPORT) | ||
| 98 | + public void exportArrivalNoticeExcel(@Valid MesWmArrivalNoticePageReqVO pageReqVO, | ||
| 99 | + HttpServletResponse response) throws IOException { | ||
| 100 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | ||
| 101 | + PageResult<MesWmArrivalNoticeDO> pageResult = arrivalNoticeService.getArrivalNoticePage(pageReqVO); | ||
| 102 | + ExcelUtils.write(response, "到货通知单.xls", "数据", MesWmArrivalNoticeRespVO.class, | ||
| 103 | + buildRespVOList(pageResult.getList())); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + @PutMapping("/submit") | ||
| 107 | + @Operation(summary = "提交到货通知单") | ||
| 108 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 109 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:update')") | ||
| 110 | + public CommonResult<Boolean> submitArrivalNotice(@RequestParam("id") Long id) { | ||
| 111 | + arrivalNoticeService.submitArrivalNotice(id); | ||
| 112 | + return success(true); | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + @PutMapping("/approve") | ||
| 116 | + @Operation(summary = "审批到货通知单") | ||
| 117 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 118 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:update')") | ||
| 119 | + public CommonResult<Boolean> approveArrivalNotice(@RequestParam("id") Long id) { | ||
| 120 | + arrivalNoticeService.approveArrivalNotice(id); | ||
| 121 | + return success(true); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + // ==================== 拼接 VO ==================== | ||
| 125 | + | ||
| 126 | + private List<MesWmArrivalNoticeRespVO> buildRespVOList(List<MesWmArrivalNoticeDO> list) { | ||
| 127 | + if (CollUtil.isEmpty(list)) { | ||
| 128 | + return Collections.emptyList(); | ||
| 129 | + } | ||
| 130 | + // 1. 获得关联数据 | ||
| 131 | + Map<Long, MesMdVendorDO> vendorMap = vendorService.getVendorMap( | ||
| 132 | + convertSet(list, MesWmArrivalNoticeDO::getVendorId)); | ||
| 133 | + // 2. 构建结果 | ||
| 134 | + return BeanUtils.toBean(list, MesWmArrivalNoticeRespVO.class, vo -> { | ||
| 135 | + MapUtils.findAndThen(vendorMap, vo.getVendorId(), vendor -> | ||
| 136 | + vo.setVendorCode(vendor.getCode()).setVendorName(vendor.getName())); | ||
| 137 | + }); | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/MesWmArrivalNoticeLineController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.collection.CollUtil; | ||
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | +import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | ||
| 7 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLinePageReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLineRespVO; | ||
| 10 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLineSaveReqVO; | ||
| 11 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | ||
| 12 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; | ||
| 13 | +import cn.iocoder.yudao.module.mes.dal.dataobject.qc.lqc.MesQcIqcDO; | ||
| 14 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeLineDO; | ||
| 15 | +import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; | ||
| 16 | +import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; | ||
| 17 | +import cn.iocoder.yudao.module.mes.service.qc.lqc.MesQcIqcService; | ||
| 18 | +import cn.iocoder.yudao.module.mes.service.wm.arrivalnotice.MesWmArrivalNoticeLineService; | ||
| 19 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 20 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 21 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 22 | +import jakarta.annotation.Resource; | ||
| 23 | +import jakarta.validation.Valid; | ||
| 24 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 25 | +import org.springframework.validation.annotation.Validated; | ||
| 26 | +import org.springframework.web.bind.annotation.*; | ||
| 27 | + | ||
| 28 | +import java.util.Collections; | ||
| 29 | +import java.util.List; | ||
| 30 | +import java.util.Map; | ||
| 31 | + | ||
| 32 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 33 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | ||
| 34 | + | ||
| 35 | +@Tag(name = "管理后台 - MES 到货通知单行") | ||
| 36 | +@RestController | ||
| 37 | +@RequestMapping("/mes/wm/arrival-notice-line") | ||
| 38 | +@Validated | ||
| 39 | +public class MesWmArrivalNoticeLineController { | ||
| 40 | + | ||
| 41 | + @Resource | ||
| 42 | + private MesWmArrivalNoticeLineService arrivalNoticeLineService; | ||
| 43 | + | ||
| 44 | + @Resource | ||
| 45 | + private MesMdItemService itemService; | ||
| 46 | + | ||
| 47 | + @Resource | ||
| 48 | + private MesMdUnitMeasureService unitMeasureService; | ||
| 49 | + | ||
| 50 | + @Resource | ||
| 51 | + private MesQcIqcService iqcService; | ||
| 52 | + | ||
| 53 | + @PostMapping("/create") | ||
| 54 | + @Operation(summary = "创建到货通知单行") | ||
| 55 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:create')") | ||
| 56 | + public CommonResult<Long> createArrivalNoticeLine(@Valid @RequestBody MesWmArrivalNoticeLineSaveReqVO createReqVO) { | ||
| 57 | + return success(arrivalNoticeLineService.createArrivalNoticeLine(createReqVO)); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @PutMapping("/update") | ||
| 61 | + @Operation(summary = "修改到货通知单行") | ||
| 62 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:update')") | ||
| 63 | + public CommonResult<Boolean> updateArrivalNoticeLine(@Valid @RequestBody MesWmArrivalNoticeLineSaveReqVO updateReqVO) { | ||
| 64 | + arrivalNoticeLineService.updateArrivalNoticeLine(updateReqVO); | ||
| 65 | + return success(true); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + @DeleteMapping("/delete") | ||
| 69 | + @Operation(summary = "删除到货通知单行") | ||
| 70 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 71 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:delete')") | ||
| 72 | + public CommonResult<Boolean> deleteArrivalNoticeLine(@RequestParam("id") Long id) { | ||
| 73 | + arrivalNoticeLineService.deleteArrivalNoticeLine(id); | ||
| 74 | + return success(true); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @GetMapping("/get") | ||
| 78 | + @Operation(summary = "获得到货通知单行") | ||
| 79 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 80 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')") | ||
| 81 | + public CommonResult<MesWmArrivalNoticeLineRespVO> getArrivalNoticeLine(@RequestParam("id") Long id) { | ||
| 82 | + MesWmArrivalNoticeLineDO line = arrivalNoticeLineService.getArrivalNoticeLine(id); | ||
| 83 | + if (line == null) { | ||
| 84 | + return success(null); | ||
| 85 | + } | ||
| 86 | + return success(buildRespVOList(Collections.singletonList(line)).get(0)); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + @GetMapping("/page") | ||
| 90 | + @Operation(summary = "获得到货通知单行分页") | ||
| 91 | + @PreAuthorize("@ss.hasPermission('mes:wm-arrival-notice:query')") | ||
| 92 | + public CommonResult<PageResult<MesWmArrivalNoticeLineRespVO>> getArrivalNoticeLinePage( | ||
| 93 | + @Valid MesWmArrivalNoticeLinePageReqVO pageReqVO) { | ||
| 94 | + PageResult<MesWmArrivalNoticeLineDO> pageResult = arrivalNoticeLineService.getArrivalNoticeLinePage(pageReqVO); | ||
| 95 | + return success(new PageResult<>(buildRespVOList(pageResult.getList()), pageResult.getTotal())); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + // ==================== 拼接 VO ==================== | ||
| 99 | + | ||
| 100 | + private List<MesWmArrivalNoticeLineRespVO> buildRespVOList(List<MesWmArrivalNoticeLineDO> list) { | ||
| 101 | + if (CollUtil.isEmpty(list)) { | ||
| 102 | + return Collections.emptyList(); | ||
| 103 | + } | ||
| 104 | + // 1. 获得关联数据 | ||
| 105 | + Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( | ||
| 106 | + convertSet(list, MesWmArrivalNoticeLineDO::getItemId)); | ||
| 107 | + Map<Long, MesQcIqcDO> iqcMap = iqcService.getIqcMap( | ||
| 108 | + convertSet(list, MesWmArrivalNoticeLineDO::getIqcId)); | ||
| 109 | + // 2. 构建结果 | ||
| 110 | + return BeanUtils.toBean(list, MesWmArrivalNoticeLineRespVO.class, vo -> { | ||
| 111 | + MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { | ||
| 112 | + vo.setItemCode(item.getCode()).setItemName(item.getName()).setSpecification(item.getSpecification()); | ||
| 113 | + // 查询物料的计量单位名称 | ||
| 114 | + // TODO @AI:也批量查询,避免逐个; | ||
| 115 | + if (item.getUnitMeasureId() != null) { | ||
| 116 | + MesMdUnitMeasureDO unitMeasure = unitMeasureService.getUnitMeasure(item.getUnitMeasureId()); | ||
| 117 | + if (unitMeasure != null) { | ||
| 118 | + vo.setUnitMeasureName(unitMeasure.getName()); | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + }); | ||
| 122 | + MapUtils.findAndThen(iqcMap, vo.getIqcId(), iqc -> vo.setIqcCode(iqc.getCode())); | ||
| 123 | + }); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/MesWmArrivalNoticePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 到货通知单分页 Request VO") | ||
| 10 | +@Data | ||
| 11 | +@EqualsAndHashCode(callSuper = true) | ||
| 12 | +@ToString(callSuper = true) | ||
| 13 | +public class MesWmArrivalNoticePageReqVO extends PageParam { | ||
| 14 | + | ||
| 15 | + @Schema(description = "通知单编码", example = "AN2026020001") | ||
| 16 | + private String code; | ||
| 17 | + | ||
| 18 | + @Schema(description = "通知单名称", example = "钢板到货") | ||
| 19 | + private String name; | ||
| 20 | + | ||
| 21 | + @Schema(description = "采购订单编号", example = "PO20260101") | ||
| 22 | + private String purchaseOrderCode; | ||
| 23 | + | ||
| 24 | + @Schema(description = "供应商编号", example = "1") | ||
| 25 | + private Long vendorId; | ||
| 26 | + | ||
| 27 | + @Schema(description = "状态", example = "0") | ||
| 28 | + private Integer status; | ||
| 29 | + | ||
| 30 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/MesWmArrivalNoticeRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo; | ||
| 2 | + | ||
| 3 | +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; | ||
| 4 | +import cn.idev.excel.annotation.ExcelProperty; | ||
| 5 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 6 | +import lombok.Data; | ||
| 7 | + | ||
| 8 | +import java.time.LocalDateTime; | ||
| 9 | + | ||
| 10 | +@Schema(description = "管理后台 - MES 到货通知单 Response VO") | ||
| 11 | +@Data | ||
| 12 | +@ExcelIgnoreUnannotated | ||
| 13 | +public class MesWmArrivalNoticeRespVO { | ||
| 14 | + | ||
| 15 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 16 | + @ExcelProperty("编号") | ||
| 17 | + private Long id; | ||
| 18 | + | ||
| 19 | + @Schema(description = "通知单编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "AN2026020001") | ||
| 20 | + @ExcelProperty("通知单编码") | ||
| 21 | + private String code; | ||
| 22 | + | ||
| 23 | + @Schema(description = "通知单名称", example = "2 月份钢板到货") | ||
| 24 | + @ExcelProperty("通知单名称") | ||
| 25 | + private String name; | ||
| 26 | + | ||
| 27 | + @Schema(description = "采购订单编号", example = "PO20260101") | ||
| 28 | + @ExcelProperty("采购订单编号") | ||
| 29 | + private String purchaseOrderCode; | ||
| 30 | + | ||
| 31 | + @Schema(description = "供应商编号", example = "1") | ||
| 32 | + private Long vendorId; | ||
| 33 | + | ||
| 34 | + @Schema(description = "供应商编码", example = "V001") | ||
| 35 | + @ExcelProperty("供应商编码") | ||
| 36 | + private String vendorCode; | ||
| 37 | + | ||
| 38 | + @Schema(description = "供应商名称", example = "某供应商") | ||
| 39 | + @ExcelProperty("供应商名称") | ||
| 40 | + private String vendorName; | ||
| 41 | + | ||
| 42 | + @Schema(description = "到货日期") | ||
| 43 | + @ExcelProperty("到货日期") | ||
| 44 | + private LocalDateTime arrivalDate; | ||
| 45 | + | ||
| 46 | + @Schema(description = "联系人", example = "张三") | ||
| 47 | + @ExcelProperty("联系人") | ||
| 48 | + private String contactName; | ||
| 49 | + | ||
| 50 | + @Schema(description = "联系电话", example = "13800138000") | ||
| 51 | + @ExcelProperty("联系电话") | ||
| 52 | + private String contactTelephone; | ||
| 53 | + | ||
| 54 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") | ||
| 55 | + @ExcelProperty("状态") | ||
| 56 | + private Integer status; | ||
| 57 | + | ||
| 58 | + @Schema(description = "备注", example = "备注") | ||
| 59 | + @ExcelProperty("备注") | ||
| 60 | + private String remark; | ||
| 61 | + | ||
| 62 | + @Schema(description = "预留字段1") | ||
| 63 | + private String attribute1; | ||
| 64 | + | ||
| 65 | + @Schema(description = "预留字段2") | ||
| 66 | + private String attribute2; | ||
| 67 | + | ||
| 68 | + @Schema(description = "预留字段3") | ||
| 69 | + private Integer attribute3; | ||
| 70 | + | ||
| 71 | + @Schema(description = "预留字段4") | ||
| 72 | + private Integer attribute4; | ||
| 73 | + | ||
| 74 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 75 | + @ExcelProperty("创建时间") | ||
| 76 | + private LocalDateTime createTime; | ||
| 77 | + | ||
| 78 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/MesWmArrivalNoticeSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import jakarta.validation.constraints.NotEmpty; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 到货通知单新增/修改 Request VO") | ||
| 10 | +@Data | ||
| 11 | +public class MesWmArrivalNoticeSaveReqVO { | ||
| 12 | + | ||
| 13 | + @Schema(description = "编号", example = "1024") | ||
| 14 | + private Long id; | ||
| 15 | + | ||
| 16 | + @Schema(description = "通知单编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "AN2026020001") | ||
| 17 | + @NotEmpty(message = "通知单编码不能为空") | ||
| 18 | + private String code; | ||
| 19 | + | ||
| 20 | + @Schema(description = "通知单名称", example = "2 月份钢板到货") | ||
| 21 | + private String name; | ||
| 22 | + | ||
| 23 | + @Schema(description = "采购订单编号", example = "PO20260101") | ||
| 24 | + private String purchaseOrderCode; | ||
| 25 | + | ||
| 26 | + @Schema(description = "供应商编号", example = "1") | ||
| 27 | + private Long vendorId; | ||
| 28 | + | ||
| 29 | + @Schema(description = "到货日期") | ||
| 30 | + private LocalDateTime arrivalDate; | ||
| 31 | + | ||
| 32 | + @Schema(description = "联系人", example = "张三") | ||
| 33 | + private String contactName; | ||
| 34 | + | ||
| 35 | + @Schema(description = "联系电话", example = "13800138000") | ||
| 36 | + private String contactTelephone; | ||
| 37 | + | ||
| 38 | + @Schema(description = "备注", example = "备注") | ||
| 39 | + private String remark; | ||
| 40 | + | ||
| 41 | + @Schema(description = "预留字段1") | ||
| 42 | + private String attribute1; | ||
| 43 | + | ||
| 44 | + @Schema(description = "预留字段2") | ||
| 45 | + private String attribute2; | ||
| 46 | + | ||
| 47 | + @Schema(description = "预留字段3") | ||
| 48 | + private Integer attribute3; | ||
| 49 | + | ||
| 50 | + @Schema(description = "预留字段4") | ||
| 51 | + private Integer attribute4; | ||
| 52 | + | ||
| 53 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/line/MesWmArrivalNoticeLinePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 到货通知单行分页 Request VO") | ||
| 10 | +@Data | ||
| 11 | +@EqualsAndHashCode(callSuper = true) | ||
| 12 | +@ToString(callSuper = true) | ||
| 13 | +public class MesWmArrivalNoticeLinePageReqVO extends PageParam { | ||
| 14 | + | ||
| 15 | + @Schema(description = "到货通知单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 16 | + private Long noticeId; | ||
| 17 | + | ||
| 18 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/line/MesWmArrivalNoticeLineRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.math.BigDecimal; | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 到货通知单行 Response VO") | ||
| 10 | +@Data | ||
| 11 | +public class MesWmArrivalNoticeLineRespVO { | ||
| 12 | + | ||
| 13 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 14 | + private Long id; | ||
| 15 | + | ||
| 16 | + @Schema(description = "到货通知单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 17 | + private Long noticeId; | ||
| 18 | + | ||
| 19 | + @Schema(description = "物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 20 | + private Long itemId; | ||
| 21 | + | ||
| 22 | + @Schema(description = "物料编码", example = "M001") | ||
| 23 | + private String itemCode; | ||
| 24 | + | ||
| 25 | + @Schema(description = "物料名称", example = "钢板") | ||
| 26 | + private String itemName; | ||
| 27 | + | ||
| 28 | + @Schema(description = "规格型号", example = "10mm*100mm") | ||
| 29 | + private String specification; | ||
| 30 | + | ||
| 31 | + @Schema(description = "计量单位名称", example = "千克") | ||
| 32 | + private String unitMeasureName; | ||
| 33 | + | ||
| 34 | + @Schema(description = "到货数量", example = "500.00") | ||
| 35 | + private BigDecimal arrivalQuantity; | ||
| 36 | + | ||
| 37 | + @Schema(description = "合格数量", example = "500.00") | ||
| 38 | + private BigDecimal qualifiedQuantity; | ||
| 39 | + | ||
| 40 | + @Schema(description = "是否需要来料检验", example = "true") | ||
| 41 | + private Boolean iqcCheckFlag; | ||
| 42 | + | ||
| 43 | + @Schema(description = "来料检验单编号", example = "1") | ||
| 44 | + private Long iqcId; | ||
| 45 | + | ||
| 46 | + @Schema(description = "来料检验单编码", example = "IQC20260201") | ||
| 47 | + private String iqcCode; | ||
| 48 | + | ||
| 49 | + @Schema(description = "备注", example = "备注") | ||
| 50 | + private String remark; | ||
| 51 | + | ||
| 52 | + @Schema(description = "预留字段1") | ||
| 53 | + private String attribute1; | ||
| 54 | + | ||
| 55 | + @Schema(description = "预留字段2") | ||
| 56 | + private String attribute2; | ||
| 57 | + | ||
| 58 | + @Schema(description = "预留字段3") | ||
| 59 | + private Integer attribute3; | ||
| 60 | + | ||
| 61 | + @Schema(description = "预留字段4") | ||
| 62 | + private Integer attribute4; | ||
| 63 | + | ||
| 64 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 65 | + private LocalDateTime createTime; | ||
| 66 | + | ||
| 67 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/arrivalnotice/vo/line/MesWmArrivalNoticeLineSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import jakarta.validation.constraints.NotNull; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.math.BigDecimal; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 到货通知单行新增/修改 Request VO") | ||
| 10 | +@Data | ||
| 11 | +public class MesWmArrivalNoticeLineSaveReqVO { | ||
| 12 | + | ||
| 13 | + @Schema(description = "编号", example = "1024") | ||
| 14 | + private Long id; | ||
| 15 | + | ||
| 16 | + @Schema(description = "到货通知单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 17 | + @NotNull(message = "到货通知单编号不能为空") | ||
| 18 | + private Long noticeId; | ||
| 19 | + | ||
| 20 | + @Schema(description = "物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 21 | + @NotNull(message = "物料编号不能为空") | ||
| 22 | + private Long itemId; | ||
| 23 | + | ||
| 24 | + @Schema(description = "到货数量", example = "500.00") | ||
| 25 | + private BigDecimal arrivalQuantity; | ||
| 26 | + | ||
| 27 | + @Schema(description = "合格数量", example = "500.00") | ||
| 28 | + private BigDecimal qualifiedQuantity; | ||
| 29 | + | ||
| 30 | + @Schema(description = "是否需要来料检验", example = "true") | ||
| 31 | + private Boolean iqcCheckFlag; | ||
| 32 | + | ||
| 33 | + @Schema(description = "来料检验单编号", example = "1") | ||
| 34 | + private Long iqcId; | ||
| 35 | + | ||
| 36 | + @Schema(description = "备注", example = "备注") | ||
| 37 | + private String remark; | ||
| 38 | + | ||
| 39 | + @Schema(description = "预留字段1") | ||
| 40 | + private String attribute1; | ||
| 41 | + | ||
| 42 | + @Schema(description = "预留字段2") | ||
| 43 | + private String attribute2; | ||
| 44 | + | ||
| 45 | + @Schema(description = "预留字段3") | ||
| 46 | + private Integer attribute3; | ||
| 47 | + | ||
| 48 | + @Schema(description = "预留字段4") | ||
| 49 | + private Integer attribute4; | ||
| 50 | + | ||
| 51 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/arrivalnotice/MesWmArrivalNoticeDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.KeySequence; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 8 | +import lombok.*; | ||
| 9 | + | ||
| 10 | +import java.time.LocalDateTime; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * MES 到货通知单 DO | ||
| 14 | + */ | ||
| 15 | +@TableName("mes_wm_arrival_notice") | ||
| 16 | +@KeySequence("mes_wm_arrival_notice_seq") | ||
| 17 | +@Data | ||
| 18 | +@EqualsAndHashCode(callSuper = true) | ||
| 19 | +@ToString(callSuper = true) | ||
| 20 | +@Builder | ||
| 21 | +@NoArgsConstructor | ||
| 22 | +@AllArgsConstructor | ||
| 23 | +public class MesWmArrivalNoticeDO extends BaseDO { | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 编号 | ||
| 27 | + */ | ||
| 28 | + @TableId | ||
| 29 | + private Long id; | ||
| 30 | + /** | ||
| 31 | + * 通知单编码 | ||
| 32 | + */ | ||
| 33 | + private String code; | ||
| 34 | + /** | ||
| 35 | + * 通知单名称 | ||
| 36 | + */ | ||
| 37 | + private String name; | ||
| 38 | + /** | ||
| 39 | + * 采购订单编号 | ||
| 40 | + */ | ||
| 41 | + private String purchaseOrderCode; | ||
| 42 | + /** | ||
| 43 | + * 供应商编号 | ||
| 44 | + * | ||
| 45 | + * 关联 {@link MesMdVendorDO#getId()} | ||
| 46 | + */ | ||
| 47 | + private Long vendorId; | ||
| 48 | + /** | ||
| 49 | + * 到货日期 | ||
| 50 | + */ | ||
| 51 | + private LocalDateTime arrivalDate; | ||
| 52 | + /** | ||
| 53 | + * 联系人 | ||
| 54 | + */ | ||
| 55 | + private String contactName; | ||
| 56 | + /** | ||
| 57 | + * 联系电话 | ||
| 58 | + */ | ||
| 59 | + private String contactTelephone; | ||
| 60 | + // TODO @AI:枚举类;需要 @关联 | ||
| 61 | + // TODO @AI:字典类;需要 @关联 | ||
| 62 | + /** | ||
| 63 | + * 状态 | ||
| 64 | + * | ||
| 65 | + * 0=草稿 1=已提交 2=已审批 3=已完成 | ||
| 66 | + */ | ||
| 67 | + private Integer status; | ||
| 68 | + /** | ||
| 69 | + * 备注 | ||
| 70 | + */ | ||
| 71 | + private String remark; | ||
| 72 | + /** | ||
| 73 | + * 预留字段1 | ||
| 74 | + */ | ||
| 75 | + private String attribute1; | ||
| 76 | + /** | ||
| 77 | + * 预留字段2 | ||
| 78 | + */ | ||
| 79 | + private String attribute2; | ||
| 80 | + /** | ||
| 81 | + * 预留字段3 | ||
| 82 | + */ | ||
| 83 | + private Integer attribute3; | ||
| 84 | + /** | ||
| 85 | + * 预留字段4 | ||
| 86 | + */ | ||
| 87 | + private Integer attribute4; | ||
| 88 | + | ||
| 89 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/arrivalnotice/MesWmArrivalNoticeLineDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.KeySequence; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 8 | +import lombok.*; | ||
| 9 | + | ||
| 10 | +import java.math.BigDecimal; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * MES 到货通知单行 DO | ||
| 14 | + */ | ||
| 15 | +@TableName("mes_wm_arrival_notice_line") | ||
| 16 | +@KeySequence("mes_wm_arrival_notice_line_seq") | ||
| 17 | +@Data | ||
| 18 | +@EqualsAndHashCode(callSuper = true) | ||
| 19 | +@ToString(callSuper = true) | ||
| 20 | +@Builder | ||
| 21 | +@NoArgsConstructor | ||
| 22 | +@AllArgsConstructor | ||
| 23 | +public class MesWmArrivalNoticeLineDO extends BaseDO { | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 编号 | ||
| 27 | + */ | ||
| 28 | + @TableId | ||
| 29 | + private Long id; | ||
| 30 | + /** | ||
| 31 | + * 到货通知单编号 | ||
| 32 | + * | ||
| 33 | + * 关联 {@link MesWmArrivalNoticeDO#getId()} | ||
| 34 | + */ | ||
| 35 | + private Long noticeId; | ||
| 36 | + /** | ||
| 37 | + * 物料编号 | ||
| 38 | + * | ||
| 39 | + * 关联 {@link MesMdItemDO#getId()} | ||
| 40 | + */ | ||
| 41 | + private Long itemId; | ||
| 42 | + /** | ||
| 43 | + * 到货数量 | ||
| 44 | + */ | ||
| 45 | + private BigDecimal arrivalQuantity; | ||
| 46 | + /** | ||
| 47 | + * 合格数量 | ||
| 48 | + */ | ||
| 49 | + private BigDecimal qualifiedQuantity; | ||
| 50 | + /** | ||
| 51 | + * 是否需要来料检验 | ||
| 52 | + */ | ||
| 53 | + private Boolean iqcCheckFlag; | ||
| 54 | + // TODO @AI:关联下 iqcId 字段 | ||
| 55 | + /** | ||
| 56 | + * 来料检验单编号 | ||
| 57 | + * | ||
| 58 | + * 关联 mes_qc_iqc.id | ||
| 59 | + */ | ||
| 60 | + private Long iqcId; | ||
| 61 | + /** | ||
| 62 | + * 备注 | ||
| 63 | + */ | ||
| 64 | + private String remark; | ||
| 65 | + /** | ||
| 66 | + * 预留字段1 | ||
| 67 | + */ | ||
| 68 | + private String attribute1; | ||
| 69 | + /** | ||
| 70 | + * 预留字段2 | ||
| 71 | + */ | ||
| 72 | + private String attribute2; | ||
| 73 | + /** | ||
| 74 | + * 预留字段3 | ||
| 75 | + */ | ||
| 76 | + private Integer attribute3; | ||
| 77 | + /** | ||
| 78 | + * 预留字段4 | ||
| 79 | + */ | ||
| 80 | + private Integer attribute4; | ||
| 81 | + | ||
| 82 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/arrivalnotice/MesWmArrivalNoticeLineMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLinePageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeLineDO; | ||
| 8 | +import org.apache.ibatis.annotations.Mapper; | ||
| 9 | + | ||
| 10 | +import java.util.List; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * MES 到货通知单行 Mapper | ||
| 14 | + */ | ||
| 15 | +@Mapper | ||
| 16 | +public interface MesWmArrivalNoticeLineMapper extends BaseMapperX<MesWmArrivalNoticeLineDO> { | ||
| 17 | + | ||
| 18 | + default PageResult<MesWmArrivalNoticeLineDO> selectPage(MesWmArrivalNoticeLinePageReqVO reqVO) { | ||
| 19 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesWmArrivalNoticeLineDO>() | ||
| 20 | + .eqIfPresent(MesWmArrivalNoticeLineDO::getNoticeId, reqVO.getNoticeId()) | ||
| 21 | + .orderByDesc(MesWmArrivalNoticeLineDO::getId)); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + default List<MesWmArrivalNoticeLineDO> selectListByNoticeId(Long noticeId) { | ||
| 25 | + return selectList(MesWmArrivalNoticeLineDO::getNoticeId, noticeId); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + default void deleteByNoticeId(Long noticeId) { | ||
| 29 | + delete(MesWmArrivalNoticeLineDO::getNoticeId, noticeId); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/arrivalnotice/MesWmArrivalNoticeMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticePageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; | ||
| 8 | +import org.apache.ibatis.annotations.Mapper; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * MES 到货通知单 Mapper | ||
| 12 | + */ | ||
| 13 | +@Mapper | ||
| 14 | +public interface MesWmArrivalNoticeMapper extends BaseMapperX<MesWmArrivalNoticeDO> { | ||
| 15 | + | ||
| 16 | + default PageResult<MesWmArrivalNoticeDO> selectPage(MesWmArrivalNoticePageReqVO reqVO) { | ||
| 17 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesWmArrivalNoticeDO>() | ||
| 18 | + .likeIfPresent(MesWmArrivalNoticeDO::getCode, reqVO.getCode()) | ||
| 19 | + .likeIfPresent(MesWmArrivalNoticeDO::getName, reqVO.getName()) | ||
| 20 | + .likeIfPresent(MesWmArrivalNoticeDO::getPurchaseOrderCode, reqVO.getPurchaseOrderCode()) | ||
| 21 | + .eqIfPresent(MesWmArrivalNoticeDO::getVendorId, reqVO.getVendorId()) | ||
| 22 | + .eqIfPresent(MesWmArrivalNoticeDO::getStatus, reqVO.getStatus()) | ||
| 23 | + .orderByDesc(MesWmArrivalNoticeDO::getId)); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + default MesWmArrivalNoticeDO selectByCode(String code) { | ||
| 27 | + return selectOne(MesWmArrivalNoticeDO::getCode, code); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/arrivalnotice/MesWmArrivalNoticeLineService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLinePageReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLineSaveReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeLineDO; | ||
| 7 | +import jakarta.validation.Valid; | ||
| 8 | + | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * MES 到货通知单行 Service 接口 | ||
| 13 | + */ | ||
| 14 | +public interface MesWmArrivalNoticeLineService { | ||
| 15 | + | ||
| 16 | + /** | ||
| 17 | + * 创建到货通知单行 | ||
| 18 | + * | ||
| 19 | + * @param createReqVO 创建信息 | ||
| 20 | + * @return 编号 | ||
| 21 | + */ | ||
| 22 | + Long createArrivalNoticeLine(@Valid MesWmArrivalNoticeLineSaveReqVO createReqVO); | ||
| 23 | + | ||
| 24 | + /** | ||
| 25 | + * 修改到货通知单行 | ||
| 26 | + * | ||
| 27 | + * @param updateReqVO 修改信息 | ||
| 28 | + */ | ||
| 29 | + void updateArrivalNoticeLine(@Valid MesWmArrivalNoticeLineSaveReqVO updateReqVO); | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 删除到货通知单行 | ||
| 33 | + * | ||
| 34 | + * @param id 编号 | ||
| 35 | + */ | ||
| 36 | + void deleteArrivalNoticeLine(Long id); | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 获得到货通知单行 | ||
| 40 | + * | ||
| 41 | + * @param id 编号 | ||
| 42 | + * @return 到货通知单行 | ||
| 43 | + */ | ||
| 44 | + MesWmArrivalNoticeLineDO getArrivalNoticeLine(Long id); | ||
| 45 | + | ||
| 46 | + /** | ||
| 47 | + * 获得到货通知单行分页 | ||
| 48 | + * | ||
| 49 | + * @param pageReqVO 分页参数 | ||
| 50 | + * @return 到货通知单行分页 | ||
| 51 | + */ | ||
| 52 | + PageResult<MesWmArrivalNoticeLineDO> getArrivalNoticeLinePage(MesWmArrivalNoticeLinePageReqVO pageReqVO); | ||
| 53 | + | ||
| 54 | + // TODO @AI:不用的接口,就删除掉; | ||
| 55 | + /** | ||
| 56 | + * 按通知单编号获得行列表 | ||
| 57 | + * | ||
| 58 | + * @param noticeId 通知单编号 | ||
| 59 | + * @return 行列表 | ||
| 60 | + */ | ||
| 61 | + List<MesWmArrivalNoticeLineDO> getArrivalNoticeLineListByNoticeId(Long noticeId); | ||
| 62 | + | ||
| 63 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/arrivalnotice/MesWmArrivalNoticeLineServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLinePageReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.line.MesWmArrivalNoticeLineSaveReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeLineDO; | ||
| 8 | +import cn.iocoder.yudao.module.mes.dal.mysql.wm.arrivalnotice.MesWmArrivalNoticeLineMapper; | ||
| 9 | +import jakarta.annotation.Resource; | ||
| 10 | +import org.springframework.stereotype.Service; | ||
| 11 | +import org.springframework.validation.annotation.Validated; | ||
| 12 | + | ||
| 13 | +import java.util.List; | ||
| 14 | + | ||
| 15 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 16 | +import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.WM_ARRIVAL_NOTICE_LINE_NOT_EXISTS; | ||
| 17 | + | ||
| 18 | +/** | ||
| 19 | + * MES 到货通知单行 Service 实现类 | ||
| 20 | + */ | ||
| 21 | +@Service | ||
| 22 | +@Validated | ||
| 23 | +public class MesWmArrivalNoticeLineServiceImpl implements MesWmArrivalNoticeLineService { | ||
| 24 | + | ||
| 25 | + @Resource | ||
| 26 | + private MesWmArrivalNoticeLineMapper arrivalNoticeLineMapper; | ||
| 27 | + | ||
| 28 | + @Override | ||
| 29 | + public Long createArrivalNoticeLine(MesWmArrivalNoticeLineSaveReqVO createReqVO) { | ||
| 30 | + // TODO @AI:关联表的校验; | ||
| 31 | + | ||
| 32 | + // 插入 | ||
| 33 | + MesWmArrivalNoticeLineDO line = BeanUtils.toBean(createReqVO, MesWmArrivalNoticeLineDO.class); | ||
| 34 | + // 如果不需要检验,则合格品数量直接等于到货数量 | ||
| 35 | + // TODO @AI:isFalase,减少反向判断; | ||
| 36 | + if (!Boolean.TRUE.equals(line.getIqcCheckFlag())) { | ||
| 37 | + line.setQualifiedQuantity(line.getArrivalQuantity()); | ||
| 38 | + } | ||
| 39 | + arrivalNoticeLineMapper.insert(line); | ||
| 40 | + return line.getId(); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + @Override | ||
| 44 | + public void updateArrivalNoticeLine(MesWmArrivalNoticeLineSaveReqVO updateReqVO) { | ||
| 45 | + // 校验存在 | ||
| 46 | + validateArrivalNoticeLineExists(updateReqVO.getId()); | ||
| 47 | + // TODO @AI:关联表的校验; | ||
| 48 | + | ||
| 49 | + // 更新 | ||
| 50 | + MesWmArrivalNoticeLineDO updateObj = BeanUtils.toBean(updateReqVO, MesWmArrivalNoticeLineDO.class); | ||
| 51 | + // 如果不需要检验,则合格品数量直接等于到货数量 | ||
| 52 | + // TODO @AI:isFalase,减少反向判断; | ||
| 53 | + if (!Boolean.TRUE.equals(updateObj.getIqcCheckFlag())) { | ||
| 54 | + updateObj.setQualifiedQuantity(updateObj.getArrivalQuantity()); | ||
| 55 | + } | ||
| 56 | + arrivalNoticeLineMapper.updateById(updateObj); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + @Override | ||
| 60 | + public void deleteArrivalNoticeLine(Long id) { | ||
| 61 | + // 校验存在 | ||
| 62 | + validateArrivalNoticeLineExists(id); | ||
| 63 | + // 删除 | ||
| 64 | + arrivalNoticeLineMapper.deleteById(id); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + @Override | ||
| 68 | + public MesWmArrivalNoticeLineDO getArrivalNoticeLine(Long id) { | ||
| 69 | + return arrivalNoticeLineMapper.selectById(id); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + @Override | ||
| 73 | + public PageResult<MesWmArrivalNoticeLineDO> getArrivalNoticeLinePage(MesWmArrivalNoticeLinePageReqVO pageReqVO) { | ||
| 74 | + return arrivalNoticeLineMapper.selectPage(pageReqVO); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @Override | ||
| 78 | + public List<MesWmArrivalNoticeLineDO> getArrivalNoticeLineListByNoticeId(Long noticeId) { | ||
| 79 | + return arrivalNoticeLineMapper.selectListByNoticeId(noticeId); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + private void validateArrivalNoticeLineExists(Long id) { | ||
| 83 | + if (arrivalNoticeLineMapper.selectById(id) == null) { | ||
| 84 | + throw exception(WM_ARRIVAL_NOTICE_LINE_NOT_EXISTS); | ||
| 85 | + } | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/arrivalnotice/MesWmArrivalNoticeService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticePageReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticeSaveReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; | ||
| 7 | +import jakarta.validation.Valid; | ||
| 8 | + | ||
| 9 | +import java.util.Collection; | ||
| 10 | +import java.util.List; | ||
| 11 | +import java.util.Map; | ||
| 12 | + | ||
| 13 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * MES 到货通知单 Service 接口 | ||
| 17 | + */ | ||
| 18 | +public interface MesWmArrivalNoticeService { | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 创建到货通知单 | ||
| 22 | + * | ||
| 23 | + * @param createReqVO 创建信息 | ||
| 24 | + * @return 编号 | ||
| 25 | + */ | ||
| 26 | + Long createArrivalNotice(@Valid MesWmArrivalNoticeSaveReqVO createReqVO); | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * 修改到货通知单 | ||
| 30 | + * | ||
| 31 | + * @param updateReqVO 修改信息 | ||
| 32 | + */ | ||
| 33 | + void updateArrivalNotice(@Valid MesWmArrivalNoticeSaveReqVO updateReqVO); | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 删除到货通知单(级联删除行) | ||
| 37 | + * | ||
| 38 | + * @param id 编号 | ||
| 39 | + */ | ||
| 40 | + void deleteArrivalNotice(Long id); | ||
| 41 | + | ||
| 42 | + /** | ||
| 43 | + * 获得到货通知单 | ||
| 44 | + * | ||
| 45 | + * @param id 编号 | ||
| 46 | + * @return 到货通知单 | ||
| 47 | + */ | ||
| 48 | + MesWmArrivalNoticeDO getArrivalNotice(Long id); | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * 获得到货通知单分页 | ||
| 52 | + * | ||
| 53 | + * @param pageReqVO 分页参数 | ||
| 54 | + * @return 到货通知单分页 | ||
| 55 | + */ | ||
| 56 | + PageResult<MesWmArrivalNoticeDO> getArrivalNoticePage(MesWmArrivalNoticePageReqVO pageReqVO); | ||
| 57 | + | ||
| 58 | + // TODO @AI:0-》1、1-》2 尽量写状态;不要写这种; | ||
| 59 | + /** | ||
| 60 | + * 提交到货通知单(0→1) | ||
| 61 | + * | ||
| 62 | + * @param id 编号 | ||
| 63 | + */ | ||
| 64 | + void submitArrivalNotice(Long id); | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * 审批到货通知单(1→2) | ||
| 68 | + * | ||
| 69 | + * @param id 编号 | ||
| 70 | + */ | ||
| 71 | + void approveArrivalNotice(Long id); | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * 完成到货通知单(→3),内部调用 | ||
| 75 | + * | ||
| 76 | + * @param id 编号 | ||
| 77 | + */ | ||
| 78 | + void finishArrivalNotice(Long id); | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 按编号集合获得到货通知单列表 | ||
| 82 | + * | ||
| 83 | + * @param ids 编号集合 | ||
| 84 | + * @return 到货通知单列表 | ||
| 85 | + */ | ||
| 86 | + List<MesWmArrivalNoticeDO> getArrivalNoticeList(Collection<Long> ids); | ||
| 87 | + | ||
| 88 | + default Map<Long, MesWmArrivalNoticeDO> getArrivalNoticeMap(Collection<Long> ids) { | ||
| 89 | + return convertMap(getArrivalNoticeList(ids), MesWmArrivalNoticeDO::getId); | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/arrivalnotice/MesWmArrivalNoticeServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.arrivalnotice; | ||
| 2 | + | ||
| 3 | +import cn.hutool.core.collection.CollUtil; | ||
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticePageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.arrivalnotice.vo.MesWmArrivalNoticeSaveReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeDO; | ||
| 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.arrivalnotice.MesWmArrivalNoticeLineDO; | ||
| 10 | +import cn.iocoder.yudao.module.mes.dal.mysql.wm.arrivalnotice.MesWmArrivalNoticeLineMapper; | ||
| 11 | +import cn.iocoder.yudao.module.mes.dal.mysql.wm.arrivalnotice.MesWmArrivalNoticeMapper; | ||
| 12 | +import jakarta.annotation.Resource; | ||
| 13 | +import org.springframework.stereotype.Service; | ||
| 14 | +import org.springframework.transaction.annotation.Transactional; | ||
| 15 | +import org.springframework.validation.annotation.Validated; | ||
| 16 | + | ||
| 17 | +import java.util.Collection; | ||
| 18 | +import java.util.Collections; | ||
| 19 | +import java.util.List; | ||
| 20 | + | ||
| 21 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 22 | +import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * MES 到货通知单 Service 实现类 | ||
| 26 | + */ | ||
| 27 | +@Service | ||
| 28 | +@Validated | ||
| 29 | +public class MesWmArrivalNoticeServiceImpl implements MesWmArrivalNoticeService { | ||
| 30 | + | ||
| 31 | + @Resource | ||
| 32 | + private MesWmArrivalNoticeMapper arrivalNoticeMapper; | ||
| 33 | + | ||
| 34 | + // TODO @AI:不允许调用对方的,调用 service; | ||
| 35 | + @Resource | ||
| 36 | + private MesWmArrivalNoticeLineMapper arrivalNoticeLineMapper; | ||
| 37 | + | ||
| 38 | + @Override | ||
| 39 | + public Long createArrivalNotice(MesWmArrivalNoticeSaveReqVO createReqVO) { | ||
| 40 | + // 校验编码唯一 | ||
| 41 | + validateCodeUnique(null, createReqVO.getCode()); | ||
| 42 | + // TODO @AI:关联数据的校验 | ||
| 43 | + | ||
| 44 | + // 插入 | ||
| 45 | + MesWmArrivalNoticeDO notice = BeanUtils.toBean(createReqVO, MesWmArrivalNoticeDO.class); | ||
| 46 | + // TODO @AI:使用枚举类; | ||
| 47 | + notice.setStatus(0); // 草稿 | ||
| 48 | + arrivalNoticeMapper.insert(notice); | ||
| 49 | + return notice.getId(); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + @Override | ||
| 53 | + public void updateArrivalNotice(MesWmArrivalNoticeSaveReqVO updateReqVO) { | ||
| 54 | + // 校验存在 | ||
| 55 | + MesWmArrivalNoticeDO notice = validateArrivalNoticeExists(updateReqVO.getId()); | ||
| 56 | + // 校验状态:只有草稿才允许修改 | ||
| 57 | + // TODO @AI:使用枚举类; | ||
| 58 | + if (notice.getStatus() != 0) { | ||
| 59 | + throw exception(WM_ARRIVAL_NOTICE_STATUS_NOT_PREPARE); | ||
| 60 | + } | ||
| 61 | + // 校验编码唯一 | ||
| 62 | + validateCodeUnique(updateReqVO.getId(), updateReqVO.getCode()); | ||
| 63 | + // TODO @AI:关联数据的校验 | ||
| 64 | + | ||
| 65 | + // 更新 | ||
| 66 | + MesWmArrivalNoticeDO updateObj = BeanUtils.toBean(updateReqVO, MesWmArrivalNoticeDO.class); | ||
| 67 | + arrivalNoticeMapper.updateById(updateObj); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + @Override | ||
| 71 | + @Transactional(rollbackFor = Exception.class) | ||
| 72 | + public void deleteArrivalNotice(Long id) { | ||
| 73 | + // 校验存在 | ||
| 74 | + MesWmArrivalNoticeDO notice = validateArrivalNoticeExists(id); | ||
| 75 | + // 校验状态:只有草稿才允许删除 TODO @AI:抽个统一的校验+ 存在 “草稿”的方法,允许修改、删除 | ||
| 76 | + // TODO @AI:使用枚举类; | ||
| 77 | + if (notice.getStatus() != 0) { | ||
| 78 | + throw exception(WM_ARRIVAL_NOTICE_STATUS_NOT_PREPARE); | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + // 级联删除行 | ||
| 82 | + arrivalNoticeLineMapper.deleteByNoticeId(id); | ||
| 83 | + // 删除 | ||
| 84 | + arrivalNoticeMapper.deleteById(id); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + @Override | ||
| 88 | + public MesWmArrivalNoticeDO getArrivalNotice(Long id) { | ||
| 89 | + return arrivalNoticeMapper.selectById(id); | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + @Override | ||
| 93 | + public PageResult<MesWmArrivalNoticeDO> getArrivalNoticePage(MesWmArrivalNoticePageReqVO pageReqVO) { | ||
| 94 | + return arrivalNoticeMapper.selectPage(pageReqVO); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + @Override | ||
| 98 | + public void submitArrivalNotice(Long id) { | ||
| 99 | + // 校验存在 | ||
| 100 | + MesWmArrivalNoticeDO notice = validateArrivalNoticeExists(id); | ||
| 101 | + if (notice.getStatus() != 0) { // TODO @AI:抽个统一的校验+ 存在 “草稿”的方法,允许修改、删除 | ||
| 102 | + throw exception(WM_ARRIVAL_NOTICE_STATUS_NOT_PREPARE); | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + // 检查是否有行项目 | ||
| 106 | + // TODO @AI:搞个 count 方法,在对方 service,传递 noticeId + 状态 | ||
| 107 | + List<MesWmArrivalNoticeLineDO> lines = arrivalNoticeLineMapper.selectListByNoticeId(id); | ||
| 108 | + // 检查所有行的 iqcCheckFlag:如果没有需要检验的行,则直接审批通过 | ||
| 109 | + boolean needCheck = lines.stream().anyMatch(line -> Boolean.TRUE.equals(line.getIqcCheckFlag())); | ||
| 110 | + // TODO @AI:计算 status,然后去更新; | ||
| 111 | + if (!needCheck) { | ||
| 112 | + // 不需要检验,直接审批通过 | ||
| 113 | + arrivalNoticeMapper.updateById(new MesWmArrivalNoticeDO().setId(id).setStatus(2)); | ||
| 114 | + } else { | ||
| 115 | + // 需要检验,提交待审批 | ||
| 116 | + arrivalNoticeMapper.updateById(new MesWmArrivalNoticeDO().setId(id).setStatus(1)); | ||
| 117 | + } | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + @Override | ||
| 121 | + public void approveArrivalNotice(Long id) { | ||
| 122 | + // 校验存在 | ||
| 123 | + MesWmArrivalNoticeDO notice = validateArrivalNoticeExists(id); | ||
| 124 | + if (notice.getStatus() != 1) { | ||
| 125 | + throw exception(WM_ARRIVAL_NOTICE_STATUS_NOT_PREPARE); | ||
| 126 | + } | ||
| 127 | + // TODO @AI:校验状态 + 状态; | ||
| 128 | + | ||
| 129 | + // 校验所有 iqcCheckFlag=true 的行必须 iqcId 不为空 | ||
| 130 | + // TODO @AI:对方 service ;搞个 count 方法,在对方 service,传递 noticeId + 状态;另外,看看能不能和上面的,保持 service 方法,保持统一; | ||
| 131 | + List<MesWmArrivalNoticeLineDO> lines = arrivalNoticeLineMapper.selectListByNoticeId(id); | ||
| 132 | + boolean hasUnchecked = lines.stream() | ||
| 133 | + .anyMatch(line -> Boolean.TRUE.equals(line.getIqcCheckFlag()) && line.getIqcId() == null); | ||
| 134 | + if (hasUnchecked) { | ||
| 135 | + throw exception(WM_ARRIVAL_NOTICE_IQC_PENDING); | ||
| 136 | + } | ||
| 137 | + // 审批通过 | ||
| 138 | + arrivalNoticeMapper.updateById(new MesWmArrivalNoticeDO().setId(id).setStatus(2)); | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + @Override | ||
| 142 | + public void finishArrivalNotice(Long id) { | ||
| 143 | + validateArrivalNoticeExists(id); | ||
| 144 | + // TODO @AI:校验状态 + 状态; | ||
| 145 | + | ||
| 146 | + // 完成 | ||
| 147 | + arrivalNoticeMapper.updateById(new MesWmArrivalNoticeDO().setId(id).setStatus(3)); | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + @Override | ||
| 151 | + public List<MesWmArrivalNoticeDO> getArrivalNoticeList(Collection<Long> ids) { | ||
| 152 | + if (CollUtil.isEmpty(ids)) { | ||
| 153 | + return Collections.emptyList(); | ||
| 154 | + } | ||
| 155 | + return arrivalNoticeMapper.selectByIds(ids); | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + private MesWmArrivalNoticeDO validateArrivalNoticeExists(Long id) { | ||
| 159 | + MesWmArrivalNoticeDO notice = arrivalNoticeMapper.selectById(id); | ||
| 160 | + if (notice == null) { | ||
| 161 | + throw exception(WM_ARRIVAL_NOTICE_NOT_EXISTS); | ||
| 162 | + } | ||
| 163 | + return notice; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + private void validateCodeUnique(Long id, String code) { | ||
| 167 | + MesWmArrivalNoticeDO notice = arrivalNoticeMapper.selectByCode(code); | ||
| 168 | + if (notice == null) { | ||
| 169 | + return; | ||
| 170 | + } | ||
| 171 | + // TODO @AI:notEquals | ||
| 172 | + if (id == null || !id.equals(notice.getId())) { | ||
| 173 | + throw exception(WM_ARRIVAL_NOTICE_CODE_DUPLICATE); | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | +} |