Merge remote-tracking branch 'origin/dev_business' into dev_business
| | |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "å建计éåä½") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:create')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:create')") |
| | | public CommonResult<Long> createUnitMeasure(@Valid @RequestBody MdmUnitMeasureSaveReqVO createReqVO) { |
| | | return success(unitMeasureService.createUnitMeasure(createReqVO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Operation(summary = "æ´æ°è®¡éåä½") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:update')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:update')") |
| | | public CommonResult<Boolean> updateUnitMeasure(@Valid @RequestBody MdmUnitMeasureSaveReqVO updateReqVO) { |
| | | unitMeasureService.updateUnitMeasure(updateReqVO); |
| | | return success(true); |
| | |
| | | @Operation(summary = "æ´æ°è®¡éåä½ç¶æ") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true, example = "1") |
| | | @Parameter(name = "status", description = "ç¶æ", required = true, example = "0") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:update')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:update')") |
| | | public CommonResult<Boolean> updateUnitMeasureStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) { |
| | | unitMeasureService.updateUnitMeasureStatus(id, status); |
| | | return success(true); |
| | |
| | | @DeleteMapping("/delete") |
| | | @Operation(summary = "å é¤è®¡éåä½") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true, example = "1") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:delete')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:delete')") |
| | | public CommonResult<Boolean> deleteUnitMeasure(@RequestParam("id") Long id) { |
| | | unitMeasureService.deleteUnitMeasure(id); |
| | | return success(true); |
| | |
| | | @GetMapping("/get") |
| | | @Operation(summary = "è·å¾è®¡éåä½") |
| | | @Parameter(name = "id", description = "ç¼å·", required = true, example = "1") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:query')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:query')") |
| | | public CommonResult<MdmUnitMeasureDO> getUnitMeasure(@RequestParam("id") Long id) { |
| | | return success(unitMeasureService.getUnitMeasure(id)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "è·å¾è®¡éåä½å页") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:query')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:query')") |
| | | public CommonResult<PageResult<MdmUnitMeasureDO>> getUnitMeasurePage(@Valid MdmUnitMeasurePageReqVO pageReqVO) { |
| | | return success(unitMeasureService.getUnitMeasurePage(pageReqVO)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å¾è®¡éåä½å表") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:query')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:query')") |
| | | public CommonResult<List<MdmUnitMeasureDO>> getUnitMeasureList() { |
| | | return success(unitMeasureService.getUnitMeasureList(null)); |
| | | } |
| | |
| | | @GetMapping("/list-by-ids") |
| | | @Operation(summary = "è·å¾è®¡éåä½å表") |
| | | @Parameter(name = "ids", description = "ç¼å·å表", required = true, example = "1,2,3") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:query')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:query')") |
| | | public CommonResult<List<MdmUnitMeasureDO>> getUnitMeasureListByIds(@RequestParam("ids") List<Long> ids) { |
| | | return success(unitMeasureService.getUnitMeasureList(ids)); |
| | | } |
| | | |
| | | @GetMapping("/export-excel") |
| | | @Operation(summary = "导åºè®¡éåä½ Excel") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:export')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:export')") |
| | | @ApiAccessLog(operateType = EXPORT) |
| | | public void exportUnitMeasureExcel(@Valid MdmUnitMeasurePageReqVO pageReqVO, |
| | | HttpServletResponse response) throws IOException { |
| | |
| | | |
| | | @GetMapping("/get-import-template") |
| | | @Operation(summary = "è·å¾å¯¼å
¥è®¡éå使¨¡æ¿") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:import')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:import')") |
| | | public void importTemplate(HttpServletResponse response) throws IOException { |
| | | List<MdmUnitMeasureImportExcelVO> list = Arrays.asList( |
| | | MdmUnitMeasureImportExcelVO.builder().code("PC").name("ç").primaryFlag(true).changeRate(new java.math.BigDecimal("1")).status(0).remark("示ä¾ï¼ä¸»åä½").build(), |
| | |
| | | @Parameter(name = "file", description = "Excel æä»¶", required = true), |
| | | @Parameter(name = "updateSupport", description = "æ¯å¦æ¯ææ´æ°ï¼é»è®¤ä¸º false", example = "true") |
| | | }) |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit-measure:import')") |
| | | @PreAuthorize("@ss.hasPermission('mdm:unit:import')") |
| | | public CommonResult<MdmUnitMeasureImportRespVO> importExcel(@RequestParam("file") MultipartFile file, |
| | | @RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception { |
| | | List<MdmUnitMeasureImportExcelVO> list = ExcelUtils.read(file, MdmUnitMeasureImportExcelVO.class); |
| | |
| | | @NotNull(message = "å·¥èºè·¯çº¿ç¼å·ä¸è½ä¸ºç©º") |
| | | private Long routeId; |
| | | |
| | | @Schema(description = "å·¥åºç¼å·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "å·¥åºç¼å·ä¸è½ä¸ºç©º") |
| | | @Schema(description = "å·¥åºç¼å·", example = "1") |
| | | private Long processId; |
| | | |
| | | @Schema(description = "å·¥èºåæ°æ¨¡æ¿ç¼å·", example = "1") |
| | | private Long paramTemplateId; |
| | | |
| | | @Schema(description = "åºå·", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @NotNull(message = "åºå·ä¸è½ä¸ºç©º") |
| | | @Schema(description = "åºå·", example = "1") |
| | | private Integer sort; |
| | | |
| | | @Schema(description = "ä¸ä¸ä¸éå·¥åºå
³ç³»", example = "0") |
| | |
| | | } |
| | | List<MesProWorkOrderBomDO> items = new ArrayList<>(); |
| | | for (MesProWorkOrderBomDO bom : bomList) { |
| | | if (bom.getProcessId().equals(process.getProcessId())) { |
| | | // è·³è¿æ å·¥åºç¼å·çææè¡ï¼å·¥å BOM ä¸ä»
æå·¥åºç»´æ¤æææç»ï¼æ å·¥åºçè¡ä¸åä¸å±å¼ï¼ |
| | | // ä¸ getProcessId å¯è½ä¸º nullï¼ç´æ¥ equals ä¼ NPEï¼ |
| | | if (Objects.equals(bom.getProcessId(), process.getProcessId())) { |
| | | items.add(bom); |
| | | } |
| | | } |
| | |
| | | // 3. 以æåä¸éå·¥åºçææä¸ºèµ·ç¹ |
| | | Map<Long, BigDecimal> currentLayer = new LinkedHashMap<>(); |
| | | for (MesProWorkOrderBomDO bom : bomList) { |
| | | if (bom.getProcessId().equals(lastProcess.getProcessId())) { |
| | | if (Objects.equals(bom.getProcessId(), lastProcess.getProcessId())) { |
| | | currentLayer.merge(bom.getItemId(), bom.getQuantity(), BigDecimal::add); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String name; |
| | | |
| | | @Schema(description = "IPQC æ£éªç±»å", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| | | @ExcelProperty("æ£éªç±»å") |
| | | @ExcelProperty(value = "æ£éªç±»å", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_IPQC_TYPE) |
| | | private Integer type; |
| | | |
| | | @Schema(description = "æ£éªæ¨¡æ¿ ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") |
| | |
| | | private String itemName; |
| | | |
| | | @Schema(description = "è§æ ¼åå·", example = "100mm*50mm") |
| | | @ExcelProperty("è§æ ¼åå·") |
| | | private String itemSpecification; |
| | | |
| | | @Schema(description = "åä½åç§°", example = "个") |
| | | @ExcelProperty("åä½") |
| | | private String unitName; |
| | | |
| | | // ========== æ°é ========== |
| | |
| | | // ========== æ£éª ========== |
| | | |
| | | @Schema(description = "æ£æµç»æ", example = "1") |
| | | @ExcelProperty("æ£æµç»æ") |
| | | @ExcelProperty(value = "æ£æµç»æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_QC_CHECK_RESULT) |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "æ£æµæ¥æ") |
| | |
| | | private String inspectorNickname; |
| | | |
| | | @Schema(description = "ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| | | @ExcelProperty("ç¶æ") |
| | | @ExcelProperty(value = "ç¶æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_ORDER_STATUS) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | private Long vendorId; |
| | | |
| | | @Schema(description = "ä¾åºåç®ç§°", example = "ä¾åºåA") |
| | | @ExcelProperty("ä¾åºåç®ç§°") |
| | | private String vendorNickname; |
| | | |
| | | @Schema(description = "ä¾åºåæ¹æ¬¡å·", example = "VB20250101") |
| | |
| | | // ========== æ£éª ========== |
| | | |
| | | @Schema(description = "æ£æµç»æ", example = "1") |
| | | @ExcelProperty("æ£æµç»æ") |
| | | @ExcelProperty(value = "æ£æµç»æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_QC_CHECK_RESULT) |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "æ¥ææ¥æ") |
| | |
| | | private String inspectorNickname; |
| | | |
| | | @Schema(description = "ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| | | @ExcelProperty("ç¶æ") |
| | | @ExcelProperty(value = "ç¶æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_ORDER_STATUS) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String itemName; |
| | | |
| | | @Schema(description = "è§æ ¼åå·", example = "100mm*50mm") |
| | | @ExcelProperty("è§æ ¼åå·") |
| | | private String itemSpecification; |
| | | |
| | | @Schema(description = "åä½åç§°", example = "个") |
| | | @ExcelProperty("åä½") |
| | | private String unitName; |
| | | |
| | | // ========== æ°é ========== |
| | |
| | | // ========== æ£éª ========== |
| | | |
| | | @Schema(description = "æ£æµç»æ", example = "1") |
| | | @ExcelProperty("æ£æµç»æ") |
| | | @ExcelProperty(value = "æ£æµç»æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_QC_CHECK_RESULT) |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "åºè´§æ¥æ") |
| | |
| | | private String inspectorNickname; |
| | | |
| | | @Schema(description = "ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| | | @ExcelProperty("ç¶æ") |
| | | @ExcelProperty(value = "ç¶æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_ORDER_STATUS) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | |
| | | |
| | | import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
| | | import cn.idev.excel.annotation.ExcelProperty; |
| | | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| | | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
| | | import cn.iocoder.yudao.module.mes.enums.DictTypeConstants; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | |
| | | // ========== æ¥æºåæ® ========== |
| | | |
| | | @Schema(description = "æ¥æºåæ®ç±»å", example = "116") |
| | | @ExcelProperty(value = "æ¥æºåæ®ç±»å", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_QC_SOURCE_DOC_TYPE) |
| | | private Integer sourceDocType; |
| | | |
| | | @Schema(description = "æ¥æºåæ® ID", example = "200") |
| | |
| | | private Long sourceLineId; |
| | | |
| | | @Schema(description = "æ¥æºåæ®ç¼ç ", example = "RT20250101001") |
| | | @ExcelProperty("æ¥æºåæ®ç¼ç ") |
| | | private String sourceDocCode; |
| | | |
| | | // ========== æ£éªç±»å ========== |
| | | |
| | | @Schema(description = "æ£éªç±»å", example = "1") |
| | | @ExcelProperty("æ£éªç±»å") |
| | | @ExcelProperty(value = "æ£éªç±»å", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_RQC_TYPE) |
| | | private Integer type; |
| | | |
| | | // ========== ç©æ ========== |
| | |
| | | private String itemName; |
| | | |
| | | @Schema(description = "è§æ ¼åå·", example = "100mm*50mm") |
| | | @ExcelProperty("è§æ ¼åå·") |
| | | private String itemSpecification; |
| | | |
| | | @Schema(description = "åä½åç§°", example = "个") |
| | | @ExcelProperty("åä½") |
| | | private String unitName; |
| | | |
| | | @Schema(description = "æ¹æ¬¡å·", example = "BATCH001") |
| | |
| | | // ========== æ£éª ========== |
| | | |
| | | @Schema(description = "æ£æµç»æ", example = "1") |
| | | @ExcelProperty("æ£æµç»æ") |
| | | @ExcelProperty(value = "æ£æµç»æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_QC_CHECK_RESULT) |
| | | private Integer checkResult; |
| | | |
| | | @Schema(description = "æ£æµæ¥æ") |
| | |
| | | private String inspectorNickname; |
| | | |
| | | @Schema(description = "ç¶æ", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") |
| | | @ExcelProperty("ç¶æ") |
| | | @ExcelProperty(value = "ç¶æ", converter = DictConvert.class) |
| | | @DictFormat(DictTypeConstants.MES_ORDER_STATUS) |
| | | private Integer status; |
| | | |
| | | @Schema(description = "夿³¨", example = "夿³¨") |
| | |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueBomItemRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLinePageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineReturnableRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; |
| | |
| | | return success(result); |
| | | } |
| | | |
| | | @GetMapping("/returnable-list") |
| | | @Operation(summary = "è·å¾é¢æåºåºåå¯éæè¡å表", |
| | | description = "è¿åæå®å·¥åä¸å·²å®æé¢æåçå¯éæè¡ï¼å¯éæ°é = 已颿°é - 已鿰é") |
| | | @Parameter(name = "workOrderId", description = "ç产工åID", required = true, example = "1") |
| | | @PreAuthorize("@ss.hasPermission('mes:wm-product-issue:query')") |
| | | public CommonResult<List<MesWmProductIssueLineReturnableRespVO>> getReturnableList(@RequestParam("workOrderId") Long workOrderId) { |
| | | return success(issueLineService.getReturnableList(workOrderId)); |
| | | } |
| | | |
| | | // ==================== æ¼æ¥ VO ==================== |
| | | |
| | | private List<MesWmProductIssueLineRespVO> buildRespVOList(List<MesWmProductIssueLineDO> list) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Schema(description = "管çåå° - MES 颿åºåºåè¡å¯éå表 Response VO") |
| | | @Data |
| | | public class MesWmProductIssueLineReturnableRespVO { |
| | | |
| | | @Schema(description = "颿åè¡ID", example = "1") |
| | | private Long id; |
| | | |
| | | @Schema(description = "ç©æID", example = "1") |
| | | private Long itemId; |
| | | |
| | | @Schema(description = "ç©æç¼ç ", example = "M001") |
| | | private String itemCode; |
| | | |
| | | @Schema(description = "ç©æåç§°", example = "颿¿") |
| | | private String itemName; |
| | | |
| | | @Schema(description = "è§æ ¼åå·", example = "10mm*100mm") |
| | | private String specification; |
| | | |
| | | @Schema(description = "计éåä½åç§°", example = "åå
") |
| | | private String unitMeasureName; |
| | | |
| | | @Schema(description = "å¯éæ°é", example = "30.00") |
| | | private BigDecimal quantity; |
| | | |
| | | @Schema(description = "æ¹æ¬¡ID", example = "1") |
| | | private Long batchId; |
| | | |
| | | @Schema(description = "æ¹æ¬¡å·", example = "BATCH20260101001") |
| | | private String batchCode; |
| | | |
| | | } |
| | |
| | | @Schema(description = "éæå ID", example = "1") |
| | | private Long issueId; |
| | | |
| | | @Schema(description = "颿åè¡ ID", example = "1") |
| | | private Long issueLineId; |
| | | |
| | | @Schema(description = "çäº§ä»»å¡ ID", example = "1") |
| | | private Long taskId; |
| | | |
| | |
| | | @NotNull(message = "éæå ID ä¸è½ä¸ºç©º") |
| | | private Long issueId; |
| | | |
| | | @Schema(description = "颿åè¡ ID", example = "1") |
| | | private Long issueLineId; |
| | | |
| | | @Schema(description = "çäº§ä»»å¡ ID", example = "1") |
| | | private Long taskId; |
| | | |
| | |
| | | */ |
| | | private Long issueId; |
| | | /** |
| | | * 颿åè¡ ID |
| | | * |
| | | * å
³è {@link cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueLineDO#getId()} |
| | | * ç¨äºè¿½è¸ªéææ¥æº |
| | | */ |
| | | private Long issueLineId; |
| | | /** |
| | | * çäº§ä»»å¡ ID |
| | | * |
| | | * å
³è {@link MesProTaskDO#getId()} |
| | |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueLineDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return selectList(MesWmProductIssueLineDO::getIssueId, issueId); |
| | | } |
| | | |
| | | default List<MesWmProductIssueLineDO> selectListByIssueIds(Collection<Long> issueIds) { |
| | | return selectList(MesWmProductIssueLineDO::getIssueId, issueIds); |
| | | } |
| | | |
| | | default void deleteByIssueId(Long issueId) { |
| | | delete(MesWmProductIssueLineDO::getIssueId, issueId); |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * MES 颿åºåºå Mapper |
| | | */ |
| | |
| | | return selectOne(MesWmProductIssueDO::getCode, code); |
| | | } |
| | | |
| | | default List<MesWmProductIssueDO> selectListByWorkOrderIdAndStatus(Long workOrderId, Integer status) { |
| | | return selectList(new LambdaQueryWrapperX<MesWmProductIssueDO>() |
| | | .eq(MesWmProductIssueDO::getWorkOrderId, workOrderId) |
| | | .eq(MesWmProductIssueDO::getStatus, status)); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return selectList(MesWmReturnIssueLineDO::getIssueId, issueId); |
| | | } |
| | | |
| | | default List<MesWmReturnIssueLineDO> selectListByIssueLineIds(Collection<Long> issueLineIds) { |
| | | return selectList(MesWmReturnIssueLineDO::getIssueLineId, issueLineIds); |
| | | } |
| | | |
| | | default void deleteByIssueId(Long issueId) { |
| | | delete(MesWmReturnIssueLineDO::getIssueId, issueId); |
| | | } |
| | |
| | | String MES_DEFECT_LEVEL = "mes_defect_level"; // MES 缺é·ç级 |
| | | String MES_QC_TYPE = "mes_qc_type"; // MES æ£æµç§ç±»ï¼IQC/IPQC/OQC/RQCï¼ |
| | | String MES_IPQC_TYPE = "mes_ipqc_type"; // MES IPQC æ£éªç±»å |
| | | String MES_RQC_TYPE = "mes_rqc_type"; // MES éè´§æ£éªç±»å |
| | | String MES_ORDER_STATUS = "mes_order_status"; // MES åæ®ç¶æï¼IQC/IPQC/OQC/RQC éç¨ï¼ |
| | | String MES_QC_CHECK_RESULT = "mes_qc_check_result"; // MES æ£æµç»æ |
| | | String MES_QC_SOURCE_DOC_TYPE = "mes_qc_source_doc_type"; // MES æ¥æºåæ®ç±»å |
| | |
| | | throw exception(PRO_FEEDBACK_UNCHECK_QUANTITY_EXISTS, feedback.getUncheckQuantity()); |
| | | } |
| | | |
| | | // 3. ç©ææ¶èï¼åå²å·¥åºæ BOM èªå¨æ£æï¼éåå²å·¥åºè·³è¿ï¼ç©æèµ°æå·¥é¢æ/ææï¼ |
| | | // 3. ç©ææ¶èï¼åå²å·¥åºææ¬å·¥åºææ BOM èªå¨æ£æï¼éåå²å·¥åºè·³è¿ï¼ç©æèµ°æå·¥é¢æ/ææï¼ |
| | | boolean backflushFlag = routeProcess != null && Boolean.TRUE.equals(routeProcess.getBackflushFlag()); |
| | | if (backflushFlag) { |
| | | // 3.1 æ ¡éªåå²å·¥åºå¿
é¡»é
ç½® BOM æ¶èï¼é¿å
éé»ä¸æ£æ |
| | | List<MesProWorkOrderBomDO> boms = workOrderBomService.getWorkOrderBomListByWorkOrderId( |
| | | feedback.getWorkOrderId()); |
| | | // 3.1 æ ¡éªåå²å·¥åºå¿
é¡»é
ç½®æ¬å·¥åºçææ BOMï¼é¿å
éé»ä¸æ£æ |
| | | // ï¼åªæ ¡éªå½åæ¥å·¥å·¥åºçææï¼å
¶ä»å·¥åºææç±åèªå·¥åºæ¥å·¥æ¶æ£é¤ï¼ |
| | | List<MesProWorkOrderBomDO> boms = workOrderBomService.getWorkOrderBomListByWorkOrderIdAndProcessId( |
| | | feedback.getWorkOrderId(), feedback.getProcessId()); |
| | | if (CollUtil.isEmpty(boms)) { |
| | | throw exception(PRO_FEEDBACK_BACKFLUSH_BOM_REQUIRED); |
| | | } |
| | | // 3.2 çææ¶èè®°å½å¹¶æ§è¡æ£åï¼BOM à æ¥å·¥æ°éï¼FIFO æ£çº¿è¾¹åºï¼ |
| | | // 3.2 çææ¶èè®°å½å¹¶æ§è¡æ£åï¼æ¬å·¥åºææç¨éæ¯ä¾ à æ¥å·¥æ°éï¼FIFO æ£çº¿è¾¹åºï¼ |
| | | MesWmItemConsumeDO itemConsume = itemConsumeService.generateItemConsume(feedback); |
| | | if (itemConsume != null) { |
| | | itemConsumeService.finishItemConsume(itemConsume.getId()); |
| | |
| | | public void updateRouteProcess(MesProRouteProcessSaveReqVO updateReqVO) { |
| | | // 1.0 å·²å¯ç¨çå·¥èºè·¯çº¿ï¼ä¸å
许æä½ |
| | | routeService.validateRouteNotEnable(updateReqVO.getRouteId()); |
| | | // 1.1 æ ¡éªåå¨ |
| | | validateRouteProcessExists(updateReqVO.getId()); |
| | | // 1.1 æ ¡éªåå¨ï¼é¨åæ´æ°ï¼å¦ä»
è°æ´äº§åºäº§åï¼æ¶æªä¼ çå¿
å¡«åæ®µç¨ç°æå¼åå¡« |
| | | MesProRouteProcessDO existing = validateRouteProcessExists(updateReqVO.getId()); |
| | | if (updateReqVO.getProcessId() == null) { |
| | | updateReqVO.setProcessId(existing.getProcessId()); |
| | | } |
| | | if (updateReqVO.getSort() == null) { |
| | | updateReqVO.setSort(existing.getSort()); |
| | | } |
| | | // 1.2 æ ¡éªå·¥èºè·¯çº¿ãå·¥åºåå¨ |
| | | validateRouteAndProcessExists(updateReqVO.getRouteId(), updateReqVO.getProcessId()); |
| | | // 1.3 æ ¡éªå¯ä¸æ§ |
| | |
| | | List<MesProWorkOrderBomDO> getWorkOrderBomListByWorkOrderId(Long workOrderId); |
| | | |
| | | /** |
| | | * æ ¹æ®å·¥åç¼å·ä¸å·¥åºç¼å·è·å¾ BOM å表ï¼å岿£æææ¥å·¥å·¥åºçæææç»è¿æ»¤ï¼ |
| | | * |
| | | * @param workOrderId å·¥åç¼å· |
| | | * @param processId å·¥åºç¼å· |
| | | * @return BOM å表 |
| | | */ |
| | | List<MesProWorkOrderBomDO> getWorkOrderBomListByWorkOrderIdAndProcessId(Long workOrderId, Long processId); |
| | | |
| | | /** |
| | | * æ ¹æ®å·¥åç¼å·å é¤ BOM |
| | | * |
| | | * @param workOrderId å·¥åç¼å· |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MesProWorkOrderBomDO> getWorkOrderBomListByWorkOrderIdAndProcessId(Long workOrderId, Long processId) { |
| | | return workOrderBomMapper.selectListByWorkOrderIdAndProcessId(workOrderId, processId); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteWorkOrderBomByWorkOrderId(Long workOrderId) { |
| | | workOrderBomMapper.deleteByWorkOrderId(workOrderId); |
| | | } |
| | |
| | | if (feedback.getWorkOrderId() == null) { |
| | | throw exception(PRO_FEEDBACK_ROUTE_PROCESS_INVALID); |
| | | } |
| | | // 1.2 æ¥è¯¢å·¥å BOM ç©æå表ï¼å岿工忿ï¼éå·¥èºè·¯çº¿ï¼ |
| | | List<MesProWorkOrderBomDO> boms = workOrderBomService.getWorkOrderBomListByWorkOrderId( |
| | | feedback.getWorkOrderId()); |
| | | // 1.2 æ¥è¯¢è¯¥åå²å·¥åºçææ BOM åè¡¨ï¼ææ¥å·¥å·¥åºè¿æ»¤ï¼åªæ£å½åå·¥åºçæææç»ï¼ |
| | | // é¿å
æå
¶ä»å·¥åºçææä¸å¹¶æ£é¤å¯¼è´å¤æ£ç©æï¼ |
| | | List<MesProWorkOrderBomDO> boms = workOrderBomService.getWorkOrderBomListByWorkOrderIdAndProcessId( |
| | | feedback.getWorkOrderId(), feedback.getProcessId()); |
| | | if (CollUtil.isEmpty(boms)) { |
| | | return null; |
| | | } |
| | |
| | | Long batchId, String batchCode, Long vendorId, LocalDateTime receiptTime); |
| | | |
| | | /** |
| | | * å建æ°çåºåè®°å½ï¼ä¸æ¥æ¾å·²æè®°å½ï¼å§ç»å建æ°è®°å½ï¼ |
| | | * |
| | | * ç¨äºéæçåºæ¯ï¼éè¦ä¸ºæ¯æ¬¡éæå建ç¬ç«çåºåè®°å½ |
| | | * |
| | | * @param itemId ç©æç¼å· |
| | | * @param warehouseId ä»åºç¼å· |
| | | * @param locationId åºåºç¼å· |
| | | * @param areaId åºä½ç¼å· |
| | | * @param batchId æ¹æ¬¡ç¼å· |
| | | * @param batchCode æ¹æ¬¡å· |
| | | * @param vendorId ä¾åºåç¼å· |
| | | * @param receiptTime å
¥åºæ¶é´ï¼ä¸ºç©ºåé»è®¤å½åæ¶é´ï¼ |
| | | * @return æ°å建çåºåè®°å½ |
| | | */ |
| | | MesWmMaterialStockDO createMaterialStock(Long itemId, Long warehouseId, Long locationId, Long areaId, |
| | | Long batchId, String batchCode, Long vendorId, LocalDateTime receiptTime); |
| | | |
| | | /** |
| | | * æç»å鮿¥æ¾åºåè®°å½ï¼åªæ¥ä¸åå»ºï¼ |
| | | * |
| | | * @param itemId ç©æç¼å· |
| | |
| | | } |
| | | |
| | | // 2. ä¸åå¨åæ°å»º |
| | | return createMaterialStock(itemId, warehouseId, locationId, areaId, batchId, batchCode, vendorId, receiptTime); |
| | | } |
| | | |
| | | @Override |
| | | public MesWmMaterialStockDO createMaterialStock(Long itemId, Long warehouseId, Long locationId, Long areaId, |
| | | Long batchId, String batchCode, Long vendorId, LocalDateTime receiptTime) { |
| | | // å§ç»å建æ°åºåè®°å½ |
| | | MesMdmItemDO item = mdmItemService.validateItemExists(itemId); |
| | | MesWmMaterialStockDO newStock = MesWmMaterialStockDO.builder() |
| | | .itemId(itemId).itemTypeId(item.getCategoryId()) |
| | |
| | | .frozen(false) |
| | | .build(); |
| | | materialStockMapper.insert(newStock); |
| | | // 3. éæ°æ¥è¯¢ï¼ç¡®ä¿æ¿å°æ°æ®åºçæç宿´è®°å½ï¼idãcreateTime çï¼ |
| | | // éæ°æ¥è¯¢ï¼ç¡®ä¿æ¿å°æ°æ®åºçæç宿´è®°å½ï¼idãcreateTime çï¼ |
| | | MesWmMaterialStockDO inserted = materialStockMapper.selectById(newStock.getId()); |
| | | return inserted != null ? inserted : newStock; |
| | | } |
| | |
| | | |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLinePageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineReturnableRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueLineDO; |
| | | import jakarta.validation.Valid; |
| | |
| | | */ |
| | | MesWmProductIssueLineDO validateProductIssueLineExists(Long id); |
| | | |
| | | /** |
| | | * è·åæå®å·¥åä¸å·²å®æé¢æåçå¯éæè¡å表 |
| | | * |
| | | * @param workOrderId ç产工åID |
| | | * @return å¯éæè¡å表ï¼å¯éæ°é > 0ï¼ |
| | | */ |
| | | List<MesWmProductIssueLineReturnableRespVO> getReturnableList(Long workOrderId); |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| | | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| | | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| | | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLinePageReqVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineReturnableRespVO; |
| | | import cn.iocoder.yudao.module.mes.controller.admin.wm.productissue.vo.line.MesWmProductIssueLineSaveReqVO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderBomDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueLineDO; |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.returnissue.MesWmReturnIssueLineDO; |
| | | import cn.iocoder.yudao.module.mes.dal.mysql.wm.productissue.MesWmProductIssueLineMapper; |
| | | import cn.iocoder.yudao.module.mes.service.mdm.MesMdmItemService; |
| | | import cn.iocoder.yudao.module.mes.enums.wm.MesWmProductIssueStatusEnum; |
| | | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| | | import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; |
| | | import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderBomService; |
| | | import cn.iocoder.yudao.module.mes.service.wm.productissue.MesWmProductIssueDetailService; |
| | | import cn.iocoder.yudao.module.mes.service.wm.productissue.MesWmProductIssueLineService; |
| | | import cn.iocoder.yudao.module.mes.service.wm.productissue.MesWmProductIssueService; |
| | | import cn.iocoder.yudao.module.mes.service.wm.returnissue.MesWmReturnIssueLineService; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.WM_PRODUCT_ISSUE_LINE_ITEM_NOT_IN_BOM; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.WM_PRODUCT_ISSUE_LINE_NOT_EXISTS; |
| | | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; |
| | | |
| | | /** |
| | | * MES 颿åºåºåè¡ Service å®ç°ç±» |
| | |
| | | @Lazy |
| | | private MesWmProductIssueService issueService; |
| | | @Resource |
| | | private MesMdmItemService mdmItemService; |
| | | private MesMdItemService mdmItemService; |
| | | @Resource |
| | | private MesProWorkOrderBomService workOrderBomService; |
| | | @Lazy |
| | | private MesWmReturnIssueLineService returnIssueLineService; |
| | | @Resource |
| | | private MesMdUnitMeasureService unitMeasureService; |
| | | @Resource |
| | | @Lazy |
| | | private MesWmProductIssueDetailService issueDetailService; |
| | | @Resource |
| | | private MesProWorkOrderBomService workOrderBomService; |
| | | |
| | | @Override |
| | | public Long createProductIssueLine(MesWmProductIssueLineSaveReqVO createReqVO) { |
| | |
| | | // æ ¡éªç©æå¨å·¥å BOM ä¸ |
| | | validateItemInWorkOrderBom(reqVO.getIssueId(), reqVO.getItemId()); |
| | | // æ ¡éªç©æåå¨ |
| | | mdmItemService.mesValidateItemExists(reqVO.getItemId()); |
| | | mdmItemService.validateItemExists(reqVO.getItemId()); |
| | | } |
| | | |
| | | private void validateItemInWorkOrderBom(Long issueId, Long itemId) { |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<MesWmProductIssueLineReturnableRespVO> getReturnableList(Long workOrderId) { |
| | | // 1. æ¥è¯¢è¯¥å·¥åä¸å·²å®æç颿å |
| | | List<MesWmProductIssueDO> finishedIssues = issueService.getFinishedIssuesByWorkOrderId(workOrderId); |
| | | if (CollUtil.isEmpty(finishedIssues)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | // 2. è·åè¿äºé¢æåçææè¡ |
| | | List<Long> issueIds = CollectionUtils.convertList(finishedIssues, MesWmProductIssueDO::getId); |
| | | List<MesWmProductIssueLineDO> lines = issueLineMapper.selectListByIssueIds(issueIds); |
| | | if (CollUtil.isEmpty(lines)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | // 3. æ¹éæ¥è¯¢å·²éæ°éï¼æ issueLineId æ±æ»ï¼ |
| | | List<Long> lineIds = CollectionUtils.convertList(lines, MesWmProductIssueLineDO::getId); |
| | | List<MesWmReturnIssueLineDO> returnLines = returnIssueLineService.getReturnIssueLineListByIssueLineIds(lineIds); |
| | | // æ issueLineId æ±æ»éææ°é |
| | | Map<Long, BigDecimal> returnedQtyMap = new java.util.HashMap<>(); |
| | | for (MesWmReturnIssueLineDO returnLine : returnLines) { |
| | | if (returnLine.getIssueLineId() != null && returnLine.getQuantity() != null) { |
| | | returnedQtyMap.merge(returnLine.getIssueLineId(), returnLine.getQuantity(), BigDecimal::add); |
| | | } |
| | | } |
| | | |
| | | // 4. æ¹éæ¥è¯¢ç©æååä½ä¿¡æ¯ |
| | | Map<Long, MesMdItemDO> itemMap = mdmItemService.getItemMap( |
| | | CollectionUtils.convertSet(lines, MesWmProductIssueLineDO::getItemId)); |
| | | Map<Long, MesMdUnitMeasureDO> unitMap = unitMeasureService.getUnitMeasureMap( |
| | | CollectionUtils.convertSet(itemMap.values(), MesMdItemDO::getUnitMeasureId)); |
| | | |
| | | // 5. ç»è£
ç»æï¼è¿æ»¤å¯éæ°é > 0 çè¡ |
| | | List<MesWmProductIssueLineReturnableRespVO> result = new ArrayList<>(); |
| | | for (MesWmProductIssueLineDO line : lines) { |
| | | BigDecimal issuedQty = line.getQuantity() != null ? line.getQuantity() : BigDecimal.ZERO; |
| | | BigDecimal returnedQty = returnedQtyMap.getOrDefault(line.getId(), BigDecimal.ZERO); |
| | | BigDecimal returnableQty = issuedQty.subtract(returnedQty); |
| | | |
| | | if (returnableQty.compareTo(BigDecimal.ZERO) > 0) { |
| | | MesWmProductIssueLineReturnableRespVO vo = new MesWmProductIssueLineReturnableRespVO(); |
| | | vo.setId(line.getId()); |
| | | vo.setItemId(line.getItemId()); |
| | | vo.setBatchId(line.getBatchId()); |
| | | vo.setQuantity(returnableQty); |
| | | |
| | | // å¡«å
ç©æä¿¡æ¯ |
| | | MesMdItemDO item = itemMap.get(line.getItemId()); |
| | | if (item != null) { |
| | | vo.setItemCode(item.getCode()); |
| | | vo.setItemName(item.getName()); |
| | | vo.setSpecification(item.getSpecification()); |
| | | // å¡«å
åä½ä¿¡æ¯ |
| | | MesMdUnitMeasureDO unit = unitMap.get(item.getUnitMeasureId()); |
| | | vo.setUnitMeasureName(unit != null ? unit.getName() : null); |
| | | } |
| | | |
| | | result.add(vo); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.iocoder.yudao.module.mes.dal.dataobject.wm.productissue.MesWmProductIssueDO; |
| | | import jakarta.validation.Valid; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * MES 颿åºåºå Service æ¥å£ |
| | | */ |
| | |
| | | */ |
| | | Boolean checkProductIssueQuantity(Long id); |
| | | |
| | | /** |
| | | * è·åæå®å·¥åä¸å·²å®æç颿åå表 |
| | | * |
| | | * @param workOrderId ç产工åID |
| | | * @return 已宿ç颿åå表 |
| | | */ |
| | | List<MesWmProductIssueDO> getFinishedIssuesByWorkOrderId(Long workOrderId); |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<MesWmProductIssueDO> getFinishedIssuesByWorkOrderId(Long workOrderId) { |
| | | return issueMapper.selectListByWorkOrderIdAndStatus(workOrderId, MesWmProductIssueStatusEnum.FINISHED.getStatus()); |
| | | } |
| | | |
| | | } |
| | |
| | | import jakarta.validation.Valid; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | void updateReturnIssueLineWhenRqcFinish(Long sourceLineId, Long sourceDocId, Integer checkResult, |
| | | BigDecimal qualifiedQuantity, BigDecimal unqualifiedQuantity); |
| | | |
| | | /** |
| | | * æ ¹æ®é¢æåè¡IDå表è·åéæåè¡å表 |
| | | * |
| | | * @param issueLineIds 颿åè¡IDå表 |
| | | * @return éæåè¡å表 |
| | | */ |
| | | List<MesWmReturnIssueLineDO> getReturnIssueLineListByIssueLineIds(Collection<Long> issueLineIds); |
| | | |
| | | } |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<MesWmReturnIssueLineDO> getReturnIssueLineListByIssueLineIds(Collection<Long> issueLineIds) { |
| | | if (CollUtil.isEmpty(issueLineIds)) { |
| | | return Collections.emptyList(); |
| | | } |
| | | return issueLineMapper.selectListByIssueLineIds(issueLineIds); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // 2.3 å
¥ä¸æ¶ç®æ ä»åºï¼åºåå¢å ï¼ |
| | | // 2.3 å
¥ä¸æ¶ç®æ ä»åºï¼åºåå¢å ï¼â å§ç»å建æ°çåºåè®°å½ï¼ä¸æ´æ°å·²æè®°å½ |
| | | wmTransactionService.createTransaction(new MesWmTransactionSaveReqDTO() |
| | | .setType(MesWmTransactionTypeEnum.IN.getType()).setItemId(detail.getItemId()) |
| | | .setQuantity(detail.getQuantity()) // åºåå¢å ï¼éæåä»ï¼ |
| | | .setBatchId(detail.getBatchId()).setBatchCode(detail.getBatchCode()) |
| | | .setWarehouseId(targetWarehouseId).setLocationId(targetLocationId).setAreaId(targetAreaId) |
| | | .setForceCreateNewStock(true) // 强å¶å建æ°åºåè®°å½ |
| | | .setBizType(MesBizTypeConstants.WM_RETURN_ISSUE).setBizId(issue.getId()) |
| | | .setBizCode(issue.getCode()).setBizLineId(detail.getLineId()) |
| | | .setRelatedTransactionId(outTransactionId)); // å
³èåºåºäºå¡ |
| | |
| | | MesWmMaterialStockDO materialStock; |
| | | MesWmTransactionTypeEnum transactionType = MesWmTransactionTypeEnum.valueOf(reqDTO.getType()); |
| | | boolean isInbound = transactionType != null && transactionType.isInbound(); |
| | | boolean forceCreateNewStock = Boolean.TRUE.equals(reqDTO.getForceCreateNewStock()); |
| | | |
| | | if (reqDTO.getMaterialStockId() != null) { |
| | | // ä¼ å
¥äº materialStockIdï¼ç´æ¥ä½¿ç¨ |
| | | materialStock = materialStockService.getMaterialStock(reqDTO.getMaterialStockId()); |
| | |
| | | throw exception(WM_MATERIAL_STOCK_SELECTION_MISMATCH); |
| | | } |
| | | } else if (isInbound) { |
| | | // å
¥åºäºå¡ï¼æ¾ä¸å°åèªå¨å建åºåè®°å½ |
| | | // å
¥åºäºå¡ï¼æ ¹æ® forceCreateNewStock æ å¿å³å®æ¯å建æ°è®°å½è¿æ¯æ¥æ¾/å建 |
| | | if (forceCreateNewStock) { |
| | | materialStock = materialStockService.createMaterialStock( |
| | | reqDTO.getItemId(), reqDTO.getWarehouseId(), reqDTO.getLocationId(), reqDTO.getAreaId(), |
| | | reqDTO.getBatchId(), reqDTO.getBatchCode(), reqDTO.getVendorId(), reqDTO.getReceiptTime()); |
| | | } else { |
| | | materialStock = materialStockService.getOrCreateMaterialStock( |
| | | reqDTO.getItemId(), reqDTO.getWarehouseId(), reqDTO.getLocationId(), reqDTO.getAreaId(), |
| | | reqDTO.getBatchId(), reqDTO.getBatchCode(), reqDTO.getVendorId(), reqDTO.getReceiptTime()); |
| | | } |
| | | } else { |
| | | // åºåºäºå¡ï¼åºåè®°å½å¿
须已åå¨ï¼ä¸å
许èªå¨å建ï¼é¤é checkFlag=false å
许è´åºåï¼ |
| | | materialStock = materialStockService.getMaterialStockByCompositeKey( |
| | |
| | | private Long materialStockId; |
| | | |
| | | /** |
| | | * å
³èäºå¡ IDï¼æå¯¹äºå¡ä¸ï¼å
¥åºäºå¡å
³èåºåºäºå¡ï¼ |
| | | * å
³èäºå¡ ID |
| | | */ |
| | | private Long relatedTransactionId; |
| | | |
| | | // ===== å¯éæ§å¶ï¼éåå¨åæ®µï¼ ===== |
| | | /** |
| | | * æ¯å¦å¼ºå¶å建æ°åºåè®°å½ï¼ä»
å
¥åºäºå¡ææï¼ |
| | | * |
| | | * 为 true æ¶ï¼å
¥åºäºå¡å§ç»å建æ°çåºåè®°å½ï¼ä¸æ¥æ¾å·²æè®°å½ |
| | | * ç¨äºéæçåºæ¯ï¼éè¦ä¸ºæ¯æ¬¡éæå建ç¬ç«çåºåè®°å½ |
| | | */ |
| | | private Boolean forceCreateNewStock; |
| | | |
| | | /** |
| | | * æ¯å¦æ ¡éªåºåå
è¶³ï¼é»è®¤ trueï¼çº¿è¾¹åºæ¶èçåºæ¯è®¾ false å
许è´åºåï¼ |
| | | * æ¯å¦æ ¡éªåºåå
è¶³ï¼ä»
åºåºäºå¡ææï¼ |
| | | * |
| | | * 为 trueï¼é»è®¤ï¼æ¶ï¼åºåºæ°éä¸è½è¶
è¿ç°æåºå |
| | | * 为 false æ¶ï¼å
许è´åºåï¼å¦èæçº¿è¾¹åºåºæ¯ï¼ |
| | | */ |
| | | private Boolean checkFlag; |
| | | |
| | |
| | | redis: |
| | | host: localhost # å°å |
| | | port: 6379 # ç«¯å£ |
| | | database: 0 # æ°æ®åºç´¢å¼ |
| | | database: 5 # æ°æ®åºç´¢å¼ |
| | | # password: # å¯ç ï¼å»ºè®®ç产ç¯å¢å¼å¯ |
| | | |
| | | --- #################### 宿¶ä»»å¡ç¸å
³é
ç½® #################### |
| | |
| | | primary: master |
| | | datasource: |
| | | master: |
| | | url: jdbc:mysql://172.17.0.1:9002/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:kingbase8://127.0.0.1:54321/test # 人大éä» KingbaseES è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:postgresql://127.0.0.1:5432/postgres # OpenGauss è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:postgresql://127.0.0.1:5866/ruoyi-vue-pro # çé« HighGo è¿æ¥çç¤ºä¾ |
| | | # url: jdbc:mysql://172.17.0.1:9002/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X è¿æ¥çç¤ºä¾ |
| | | url: jdbc:mysql://42.63.70.231:9002/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X è¿æ¥çç¤ºä¾ |
| | | username: root |
| | | password: yzfx@123456.. |
| | | # username: sa # SQL Server è¿æ¥çç¤ºä¾ |
| | | # password: Yudao@2024 # SQL Server è¿æ¥çç¤ºä¾ |
| | | # username: SYSDBA # DM è¿æ¥çç¤ºä¾ |
| | | # password: SYSDBA001 # DM è¿æ¥çç¤ºä¾ |
| | | # username: root # OpenGauss è¿æ¥çç¤ºä¾ |
| | | # password: Yudao@2024 # OpenGauss è¿æ¥çç¤ºä¾ |
| | | # username: root # çé« HighGo è¿æ¥çç¤ºä¾ |
| | | # password: 123456 # çé« HighGo è¿æ¥çç¤ºä¾ |
| | | # tdengine: # IoT æ°æ®åºï¼éè¦ IoT ç©èç½åå¼å¯å¢ï¼ï¼ |
| | | # lazy: true # å¼å¯æå è½½ï¼ä¿è¯å¯å¨é度 |
| | | # url: jdbc:TAOS-WS://127.0.0.1:6041/ruoyi_vue_pro?varcharAsString=true&enableAutoReconnect=true # åè§ï¼https://t.zsxq.com/qaX9cï¼å¼å¯ TDengine WebSocket èªå¨éè¿ |
| | | # driver-class-name: com.taosdata.jdbc.ws.WebSocketDriver |
| | | # username: root |
| | | # password: taosdata |
| | | # druid: |
| | | # validation-query: SELECT SERVER_STATUS() # TDengine æ°æ®æºçæææ§æ£æ¥ SQL |
| | | |
| | | # Redis é
ç½®ãRedisson é»è®¤çé
置足å¤ä½¿ç¨ï¼ä¸è¬ä¸éè¦è¿è¡è°ä¼ |
| | | data: |