Commit b0adeb36db668b50efafdba31ff0d7682c4c7e32
1 parent
fc2d27ba
✨ feat(mes): 添加 MES 条码配置和清单相关的请求与响应 VO
Showing
21 changed files
with
1115 additions
and
19 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/MesWmBarcodeConfigController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 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.barcode.vo.config.MesWmBarcodeConfigPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config.MesWmBarcodeConfigRespVO; | |
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config.MesWmBarcodeConfigSaveReqVO; | |
| 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeConfigDO; | |
| 10 | +import cn.iocoder.yudao.module.mes.service.wm.barcode.MesWmBarcodeConfigService; | |
| 11 | +import io.swagger.v3.oas.annotations.Operation; | |
| 12 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 14 | +import jakarta.annotation.Resource; | |
| 15 | +import jakarta.validation.Valid; | |
| 16 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | +import org.springframework.web.bind.annotation.*; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 21 | + | |
| 22 | +@Tag(name = "管理后台 - MES 条码配置") | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/mes/wm/barcode-config") | |
| 25 | +@Validated | |
| 26 | +public class MesWmBarcodeConfigController { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private MesWmBarcodeConfigService barcodeConfigService; | |
| 30 | + | |
| 31 | + @PostMapping("/create") | |
| 32 | + @Operation(summary = "创建条码配置") | |
| 33 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode-config:create')") | |
| 34 | + public CommonResult<Long> createBarcodeConfig(@Valid @RequestBody MesWmBarcodeConfigSaveReqVO createReqVO) { | |
| 35 | + return success(barcodeConfigService.createBarcodeConfig(createReqVO)); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @PutMapping("/update") | |
| 39 | + @Operation(summary = "更新条码配置") | |
| 40 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode-config:update')") | |
| 41 | + public CommonResult<Boolean> updateBarcodeConfig(@Valid @RequestBody MesWmBarcodeConfigSaveReqVO updateReqVO) { | |
| 42 | + barcodeConfigService.updateBarcodeConfig(updateReqVO); | |
| 43 | + return success(true); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @DeleteMapping("/delete") | |
| 47 | + @Operation(summary = "删除条码配置") | |
| 48 | + @Parameter(name = "id", description = "编号", required = true) | |
| 49 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode-config:delete')") | |
| 50 | + public CommonResult<Boolean> deleteBarcodeConfig(@RequestParam("id") Long id) { | |
| 51 | + barcodeConfigService.deleteBarcodeConfig(id); | |
| 52 | + return success(true); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @GetMapping("/get") | |
| 56 | + @Operation(summary = "获得条码配置") | |
| 57 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 58 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode-config:query')") | |
| 59 | + public CommonResult<MesWmBarcodeConfigRespVO> getBarcodeConfig(@RequestParam("id") Long id) { | |
| 60 | + MesWmBarcodeConfigDO config = barcodeConfigService.getBarcodeConfig(id); | |
| 61 | + return success(BeanUtils.toBean(config, MesWmBarcodeConfigRespVO.class)); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @GetMapping("/page") | |
| 65 | + @Operation(summary = "获得条码配置分页") | |
| 66 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode-config:query')") | |
| 67 | + public CommonResult<PageResult<MesWmBarcodeConfigRespVO>> getBarcodeConfigPage( | |
| 68 | + @Valid MesWmBarcodeConfigPageReqVO pageReqVO) { | |
| 69 | + PageResult<MesWmBarcodeConfigDO> pageResult = barcodeConfigService.getBarcodeConfigPage(pageReqVO); | |
| 70 | + return success(BeanUtils.toBean(pageResult, MesWmBarcodeConfigRespVO.class)); | |
| 71 | + } | |
| 72 | + | |
| 73 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/MesWmBarcodeController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 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.barcode.vo.MesWmBarcodePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.MesWmBarcodeRespVO; | |
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.MesWmBarcodeSaveReqVO; | |
| 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeDO; | |
| 10 | +import cn.iocoder.yudao.module.mes.service.wm.barcode.MesWmBarcodeService; | |
| 11 | +import io.swagger.v3.oas.annotations.Operation; | |
| 12 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 14 | +import jakarta.annotation.Resource; | |
| 15 | +import jakarta.validation.Valid; | |
| 16 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | +import org.springframework.web.bind.annotation.*; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 21 | + | |
| 22 | +@Tag(name = "管理后台 - MES 条码清单") | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/mes/wm/barcode") | |
| 25 | +@Validated | |
| 26 | +public class MesWmBarcodeController { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private MesWmBarcodeService barcodeService; | |
| 30 | + | |
| 31 | + @PostMapping("/create") | |
| 32 | + @Operation(summary = "创建条码") | |
| 33 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode:create')") | |
| 34 | + public CommonResult<Long> createBarcode(@Valid @RequestBody MesWmBarcodeSaveReqVO createReqVO) { | |
| 35 | + return success(barcodeService.createBarcode(createReqVO)); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @PutMapping("/update") | |
| 39 | + @Operation(summary = "更新条码") | |
| 40 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode:update')") | |
| 41 | + public CommonResult<Boolean> updateBarcode(@Valid @RequestBody MesWmBarcodeSaveReqVO updateReqVO) { | |
| 42 | + barcodeService.updateBarcode(updateReqVO); | |
| 43 | + return success(true); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @DeleteMapping("/delete") | |
| 47 | + @Operation(summary = "删除条码") | |
| 48 | + @Parameter(name = "id", description = "编号", required = true) | |
| 49 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode:delete')") | |
| 50 | + public CommonResult<Boolean> deleteBarcode(@RequestParam("id") Long id) { | |
| 51 | + barcodeService.deleteBarcode(id); | |
| 52 | + return success(true); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @GetMapping("/get") | |
| 56 | + @Operation(summary = "获得条码") | |
| 57 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 58 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode:query')") | |
| 59 | + public CommonResult<MesWmBarcodeRespVO> getBarcode(@RequestParam("id") Long id) { | |
| 60 | + MesWmBarcodeDO barcode = barcodeService.getBarcode(id); | |
| 61 | + return success(BeanUtils.toBean(barcode, MesWmBarcodeRespVO.class)); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @GetMapping("/page") | |
| 65 | + @Operation(summary = "获得条码分页") | |
| 66 | + @PreAuthorize("@ss.hasPermission('mes:wm-barcode:query')") | |
| 67 | + public CommonResult<PageResult<MesWmBarcodeRespVO>> getBarcodePage(@Valid MesWmBarcodePageReqVO pageReqVO) { | |
| 68 | + PageResult<MesWmBarcodeDO> pageResult = barcodeService.getBarcodePage(pageReqVO); | |
| 69 | + return success(BeanUtils.toBean(pageResult, MesWmBarcodeRespVO.class)); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @GetMapping("/get-by-business") | |
| 73 | + @Operation(summary = "根据业务对象获取条码信息", description = "前端用于生成条码图片") | |
| 74 | + @Parameter(name = "bizType", description = "业务类型", required = true, example = "102") | |
| 75 | + @Parameter(name = "bizId", description = "业务编号", required = true, example = "1024") | |
| 76 | + public CommonResult<MesWmBarcodeRespVO> getBarcodeByBusiness( | |
| 77 | + @RequestParam("bizType") Integer bizType, | |
| 78 | + @RequestParam("bizId") Long bizId) { | |
| 79 | + MesWmBarcodeDO barcode = barcodeService.getBarcodeByBizTypeAndBizId(bizType, bizId); | |
| 80 | + return success(BeanUtils.toBean(barcode, MesWmBarcodeRespVO.class)); | |
| 81 | + } | |
| 82 | + | |
| 83 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/vo/MesWmBarcodePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.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 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | + | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | + | |
| 12 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | + | |
| 14 | +@Schema(description = "管理后台 - MES 条码清单分页 Request VO") | |
| 15 | +@Data | |
| 16 | +@EqualsAndHashCode(callSuper = true) | |
| 17 | +@ToString(callSuper = true) | |
| 18 | +public class MesWmBarcodePageReqVO extends PageParam { | |
| 19 | + | |
| 20 | + @Schema(description = "条码配置编号", example = "1") | |
| 21 | + private Long configId; | |
| 22 | + | |
| 23 | + @Schema(description = "条码格式", example = "1") | |
| 24 | + private Integer format; | |
| 25 | + | |
| 26 | + @Schema(description = "业务类型", example = "102") | |
| 27 | + private Integer bizType; | |
| 28 | + | |
| 29 | + @Schema(description = "条码内容", example = "WH-WH001") | |
| 30 | + private String content; | |
| 31 | + | |
| 32 | + @Schema(description = "业务编号", example = "1024") | |
| 33 | + private Long bizId; | |
| 34 | + | |
| 35 | + @Schema(description = "业务编码", example = "WH001") | |
| 36 | + private String bizCode; | |
| 37 | + | |
| 38 | + @Schema(description = "状态", example = "0") | |
| 39 | + private Integer status; | |
| 40 | + | |
| 41 | + @Schema(description = "创建时间") | |
| 42 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 43 | + private LocalDateTime[] createTime; | |
| 44 | + | |
| 45 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/vo/MesWmBarcodeRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.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 MesWmBarcodeRespVO { | |
| 14 | + | |
| 15 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 16 | + @ExcelProperty("编号") | |
| 17 | + private Long id; | |
| 18 | + | |
| 19 | + @Schema(description = "条码配置编号", example = "1") | |
| 20 | + private Long configId; | |
| 21 | + | |
| 22 | + @Schema(description = "条码格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 23 | + @ExcelProperty("条码格式") | |
| 24 | + private Integer format; | |
| 25 | + | |
| 26 | + @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "102") | |
| 27 | + @ExcelProperty("业务类型") | |
| 28 | + private Integer bizType; | |
| 29 | + | |
| 30 | + @Schema(description = "条码内容", requiredMode = Schema.RequiredMode.REQUIRED, example = "WH-WH001") | |
| 31 | + @ExcelProperty("条码内容") | |
| 32 | + private String content; | |
| 33 | + | |
| 34 | + @Schema(description = "业务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 35 | + private Long bizId; | |
| 36 | + | |
| 37 | + @Schema(description = "业务编码", example = "WH001") | |
| 38 | + @ExcelProperty("业务编码") | |
| 39 | + private String bizCode; | |
| 40 | + | |
| 41 | + @Schema(description = "业务名称", example = "原料仓") | |
| 42 | + @ExcelProperty("业务名称") | |
| 43 | + private String bizName; | |
| 44 | + | |
| 45 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") | |
| 46 | + @ExcelProperty("状态") | |
| 47 | + private Integer status; | |
| 48 | + | |
| 49 | + @Schema(description = "备注", example = "备注") | |
| 50 | + @ExcelProperty("备注") | |
| 51 | + private String remark; | |
| 52 | + | |
| 53 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 54 | + @ExcelProperty("创建时间") | |
| 55 | + private LocalDateTime createTime; | |
| 56 | + | |
| 57 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/vo/MesWmBarcodeSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotEmpty; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - MES 条码清单新增/修改 Request VO") | |
| 9 | +@Data | |
| 10 | +public class MesWmBarcodeSaveReqVO { | |
| 11 | + | |
| 12 | + @Schema(description = "编号", example = "1024") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "条码配置编号", example = "1") | |
| 16 | + private Long configId; | |
| 17 | + | |
| 18 | + @Schema(description = "条码格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 19 | + @NotNull(message = "条码格式不能为空") | |
| 20 | + private Integer format; | |
| 21 | + | |
| 22 | + @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "102") | |
| 23 | + @NotNull(message = "业务类型不能为空") | |
| 24 | + private Integer bizType; | |
| 25 | + | |
| 26 | + @Schema(description = "条码内容", example = "WH-WH001") | |
| 27 | + private String content; | |
| 28 | + | |
| 29 | + @Schema(description = "业务编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | |
| 30 | + @NotNull(message = "业务编号不能为空") | |
| 31 | + private Long bizId; | |
| 32 | + | |
| 33 | + @Schema(description = "业务编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "WH001") | |
| 34 | + @NotEmpty(message = "业务编码不能为空") | |
| 35 | + private String bizCode; | |
| 36 | + | |
| 37 | + @Schema(description = "业务名称", example = "原料仓") | |
| 38 | + private String bizName; | |
| 39 | + | |
| 40 | + @Schema(description = "状态", example = "0") | |
| 41 | + private Integer status; | |
| 42 | + | |
| 43 | + @Schema(description = "备注", example = "备注") | |
| 44 | + private String remark; | |
| 45 | + | |
| 46 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/vo/config/MesWmBarcodeConfigPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config; | |
| 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 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | + | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | + | |
| 12 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | + | |
| 14 | +@Schema(description = "管理后台 - MES 条码配置分页 Request VO") | |
| 15 | +@Data | |
| 16 | +@EqualsAndHashCode(callSuper = true) | |
| 17 | +@ToString(callSuper = true) | |
| 18 | +public class MesWmBarcodeConfigPageReqVO extends PageParam { | |
| 19 | + | |
| 20 | + @Schema(description = "条码格式", example = "1") | |
| 21 | + private Integer format; | |
| 22 | + | |
| 23 | + @Schema(description = "业务类型", example = "102") | |
| 24 | + private Integer bizType; | |
| 25 | + | |
| 26 | + @Schema(description = "是否自动生成", example = "true") | |
| 27 | + private Boolean autoGenerateFlag; | |
| 28 | + | |
| 29 | + @Schema(description = "状态", example = "0") | |
| 30 | + private Integer status; | |
| 31 | + | |
| 32 | + @Schema(description = "创建时间") | |
| 33 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 34 | + private LocalDateTime[] createTime; | |
| 35 | + | |
| 36 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/vo/config/MesWmBarcodeConfigRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config; | |
| 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 MesWmBarcodeConfigRespVO { | |
| 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 = "1") | |
| 20 | + @ExcelProperty("条码格式") | |
| 21 | + private Integer format; | |
| 22 | + | |
| 23 | + @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "102") | |
| 24 | + @ExcelProperty("业务类型") | |
| 25 | + private Integer bizType; | |
| 26 | + | |
| 27 | + @Schema(description = "内容格式模板", requiredMode = Schema.RequiredMode.REQUIRED, example = "WH-{BUSINESSCODE}") | |
| 28 | + @ExcelProperty("内容格式模板") | |
| 29 | + private String contentFormat; | |
| 30 | + | |
| 31 | + @Schema(description = "内容样例", example = "WH-WH001") | |
| 32 | + @ExcelProperty("内容样例") | |
| 33 | + private String contentExample; | |
| 34 | + | |
| 35 | + @Schema(description = "是否自动生成", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 36 | + @ExcelProperty("是否自动生成") | |
| 37 | + private Boolean autoGenerateFlag; | |
| 38 | + | |
| 39 | + @Schema(description = "默认打印模板", example = "template1") | |
| 40 | + @ExcelProperty("默认打印模板") | |
| 41 | + private String defaultTemplate; | |
| 42 | + | |
| 43 | + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0") | |
| 44 | + @ExcelProperty("状态") | |
| 45 | + private Integer status; | |
| 46 | + | |
| 47 | + @Schema(description = "备注", example = "备注") | |
| 48 | + @ExcelProperty("备注") | |
| 49 | + private String remark; | |
| 50 | + | |
| 51 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | |
| 52 | + @ExcelProperty("创建时间") | |
| 53 | + private LocalDateTime createTime; | |
| 54 | + | |
| 55 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/barcode/vo/config/MesWmBarcodeConfigSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import jakarta.validation.constraints.NotEmpty; | |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +@Schema(description = "管理后台 - MES 条码配置新增/修改 Request VO") | |
| 9 | +@Data | |
| 10 | +public class MesWmBarcodeConfigSaveReqVO { | |
| 11 | + | |
| 12 | + @Schema(description = "编号", example = "1024") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "条码格式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | |
| 16 | + @NotNull(message = "条码格式不能为空") | |
| 17 | + private Integer format; | |
| 18 | + | |
| 19 | + @Schema(description = "业务类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "102") | |
| 20 | + @NotNull(message = "业务类型不能为空") | |
| 21 | + private Integer bizType; | |
| 22 | + | |
| 23 | + @Schema(description = "内容格式模板", requiredMode = Schema.RequiredMode.REQUIRED, example = "WH-{BUSINESSCODE}") | |
| 24 | + @NotEmpty(message = "内容格式模板不能为空") | |
| 25 | + private String contentFormat; | |
| 26 | + | |
| 27 | + @Schema(description = "内容样例", example = "WH-WH001") | |
| 28 | + private String contentExample; | |
| 29 | + | |
| 30 | + @Schema(description = "是否自动生成", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | |
| 31 | + @NotNull(message = "是否自动生成不能为空") | |
| 32 | + private Boolean autoGenerateFlag; | |
| 33 | + | |
| 34 | + @Schema(description = "默认打印模板", example = "template1") | |
| 35 | + private String defaultTemplate; | |
| 36 | + | |
| 37 | + @Schema(description = "状态", example = "0") | |
| 38 | + private Integer status; | |
| 39 | + | |
| 40 | + @Schema(description = "备注", example = "备注") | |
| 41 | + private String remark; | |
| 42 | + | |
| 43 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/barcode/MesWmBarcodeConfigDO.java
| ... | ... | @@ -8,6 +8,8 @@ import lombok.*; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * MES 条码配置 DO |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 11 | 13 | */ |
| 12 | 14 | @TableName("mes_wm_barcode_config") |
| 13 | 15 | @KeySequence("mes_wm_barcode_config_seq") |
| ... | ... | @@ -20,21 +22,31 @@ import lombok.*; |
| 20 | 22 | public class MesWmBarcodeConfigDO extends BaseDO { |
| 21 | 23 | |
| 22 | 24 | /** |
| 25 | + * 内容格式模板占位符 | |
| 26 | + */ | |
| 27 | + public static final String PLACEHOLDER_BUSINESS_CODE = "{BUSINESSCODE}"; | |
| 28 | + | |
| 29 | + /** | |
| 23 | 30 | * 编号 |
| 24 | 31 | */ |
| 25 | 32 | @TableId |
| 26 | 33 | private Long id; |
| 27 | 34 | /** |
| 28 | 35 | * 条码格式 |
| 36 | + * | |
| 37 | + * 枚举 {@link cn.iocoder.yudao.module.mes.enums.wm.BarcodeFormatEnum} | |
| 29 | 38 | */ |
| 30 | - private String format; | |
| 31 | - // TODO DONE @AI:需要有个枚举类;这样后续方便使用;=> 条码业务类型为字符串字典值,具体枚举值由业务字典管理,暂无需 Java 枚举类 | |
| 39 | + private Integer format; | |
| 32 | 40 | /** |
| 33 | - * 条码业务类型 | |
| 41 | + * 业务类型 | |
| 42 | + * | |
| 43 | + * 枚举 {@link cn.iocoder.yudao.module.mes.enums.wm.BarcodeBizTypeEnum} | |
| 34 | 44 | */ |
| 35 | - private String type; | |
| 45 | + private Integer bizType; | |
| 36 | 46 | /** |
| 37 | - * 内容格式 | |
| 47 | + * 内容格式模板(支持 {BUSINESSCODE} 占位符) | |
| 48 | + * | |
| 49 | + * @see #PLACEHOLDER_BUSINESS_CODE | |
| 38 | 50 | */ |
| 39 | 51 | private String contentFormat; |
| 40 | 52 | /** |
| ... | ... | @@ -45,7 +57,6 @@ public class MesWmBarcodeConfigDO extends BaseDO { |
| 45 | 57 | * 是否自动生成 |
| 46 | 58 | */ |
| 47 | 59 | private Boolean autoGenerateFlag; |
| 48 | - // todo DONE @AI:printTemplate 改成这个字段;=> 已改名为 defaultTemplate | |
| 49 | 60 | /** |
| 50 | 61 | * 默认打印模板 |
| 51 | 62 | */ | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/wm/barcode/MesWmBarcodeDO.java
| ... | ... | @@ -8,6 +8,8 @@ import lombok.*; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * MES 条码清单 DO |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 11 | 13 | */ |
| 12 | 14 | @TableName("mes_wm_barcode") |
| 13 | 15 | @KeySequence("mes_wm_barcode_seq") |
| ... | ... | @@ -32,34 +34,32 @@ public class MesWmBarcodeDO extends BaseDO { |
| 32 | 34 | private Long configId; |
| 33 | 35 | /** |
| 34 | 36 | * 条码格式 |
| 37 | + * | |
| 38 | + * 枚举 {@link cn.iocoder.yudao.module.mes.enums.wm.BarcodeFormatEnum} | |
| 35 | 39 | */ |
| 36 | - private String format; | |
| 37 | - // TODO DONE @AI:需要有个枚举类;这样后续方便使用;=> 条码业务类型为字符串字典值,具体枚举值由业务字典管理,暂无需 Java 枚举类 | |
| 40 | + private Integer format; | |
| 38 | 41 | /** |
| 39 | - * 条码业务类型 | |
| 42 | + * 业务类型 | |
| 43 | + * | |
| 44 | + * 枚举 {@link cn.iocoder.yudao.module.mes.enums.wm.BarcodeBizTypeEnum} | |
| 40 | 45 | */ |
| 41 | - private String type; | |
| 46 | + private Integer bizType; | |
| 42 | 47 | /** |
| 43 | - * 条码内容 | |
| 48 | + * 条码内容(核心字段,前端根据此内容生成条码图片) | |
| 44 | 49 | */ |
| 45 | 50 | private String content; |
| 46 | 51 | /** |
| 47 | 52 | * 业务编号 |
| 48 | 53 | */ |
| 49 | - private Long businessId; | |
| 54 | + private Long bizId; | |
| 50 | 55 | /** |
| 51 | 56 | * 业务编码 |
| 52 | 57 | */ |
| 53 | - private String businessCode; | |
| 58 | + private String bizCode; | |
| 54 | 59 | /** |
| 55 | 60 | * 业务名称 |
| 56 | 61 | */ |
| 57 | - private String businessName; | |
| 58 | - // TODO DONE @AI:条码必须后端生成么?可以前端生成么?=> 条码建议后端生成,保证全局唯一性、可追溯,且避免前端伪造 | |
| 59 | - /** | |
| 60 | - * 条码地址 | |
| 61 | - */ | |
| 62 | - private String imageUrl; | |
| 62 | + private String bizName; | |
| 63 | 63 | /** |
| 64 | 64 | * 状态 |
| 65 | 65 | * | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/barcode/MesWmBarcodeConfigMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.wm.barcode; | |
| 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.barcode.vo.config.MesWmBarcodeConfigPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeConfigDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * MES 条码配置 Mapper | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface MesWmBarcodeConfigMapper extends BaseMapperX<MesWmBarcodeConfigDO> { | |
| 19 | + | |
| 20 | + default PageResult<MesWmBarcodeConfigDO> selectPage(MesWmBarcodeConfigPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesWmBarcodeConfigDO>() | |
| 22 | + .eqIfPresent(MesWmBarcodeConfigDO::getFormat, reqVO.getFormat()) | |
| 23 | + .eqIfPresent(MesWmBarcodeConfigDO::getBizType, reqVO.getBizType()) | |
| 24 | + .eqIfPresent(MesWmBarcodeConfigDO::getAutoGenerateFlag, reqVO.getAutoGenerateFlag()) | |
| 25 | + .eqIfPresent(MesWmBarcodeConfigDO::getStatus, reqVO.getStatus()) | |
| 26 | + .betweenIfPresent(MesWmBarcodeConfigDO::getCreateTime, reqVO.getCreateTime()) | |
| 27 | + .orderByDesc(MesWmBarcodeConfigDO::getId)); | |
| 28 | + } | |
| 29 | + | |
| 30 | + default MesWmBarcodeConfigDO selectByBizType(Integer bizType) { | |
| 31 | + return selectOne(MesWmBarcodeConfigDO::getBizType, bizType); | |
| 32 | + } | |
| 33 | + | |
| 34 | + default List<MesWmBarcodeConfigDO> selectListByAutoGenerateFlag(Boolean autoGenerateFlag) { | |
| 35 | + return selectList(MesWmBarcodeConfigDO::getAutoGenerateFlag, autoGenerateFlag); | |
| 36 | + } | |
| 37 | + | |
| 38 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/wm/barcode/MesWmBarcodeMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.dal.mysql.wm.barcode; | |
| 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.barcode.vo.MesWmBarcodePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * MES 条码清单 Mapper | |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 14 | + */ | |
| 15 | +@Mapper | |
| 16 | +public interface MesWmBarcodeMapper extends BaseMapperX<MesWmBarcodeDO> { | |
| 17 | + | |
| 18 | + default PageResult<MesWmBarcodeDO> selectPage(MesWmBarcodePageReqVO reqVO) { | |
| 19 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesWmBarcodeDO>() | |
| 20 | + .eqIfPresent(MesWmBarcodeDO::getConfigId, reqVO.getConfigId()) | |
| 21 | + .eqIfPresent(MesWmBarcodeDO::getFormat, reqVO.getFormat()) | |
| 22 | + .eqIfPresent(MesWmBarcodeDO::getBizType, reqVO.getBizType()) | |
| 23 | + .likeIfPresent(MesWmBarcodeDO::getContent, reqVO.getContent()) | |
| 24 | + .eqIfPresent(MesWmBarcodeDO::getBizId, reqVO.getBizId()) | |
| 25 | + .likeIfPresent(MesWmBarcodeDO::getBizCode, reqVO.getBizCode()) | |
| 26 | + .eqIfPresent(MesWmBarcodeDO::getStatus, reqVO.getStatus()) | |
| 27 | + .betweenIfPresent(MesWmBarcodeDO::getCreateTime, reqVO.getCreateTime()) | |
| 28 | + .orderByDesc(MesWmBarcodeDO::getId)); | |
| 29 | + } | |
| 30 | + | |
| 31 | + default MesWmBarcodeDO selectByBizTypeAndBizId(Integer bizType, Long bizId) { | |
| 32 | + return selectOne(new LambdaQueryWrapperX<MesWmBarcodeDO>() | |
| 33 | + .eq(MesWmBarcodeDO::getBizType, bizType) | |
| 34 | + .eq(MesWmBarcodeDO::getBizId, bizId)); | |
| 35 | + } | |
| 36 | + | |
| 37 | + default MesWmBarcodeDO selectByContent(String content) { | |
| 38 | + return selectOne(MesWmBarcodeDO::getContent, content); | |
| 39 | + } | |
| 40 | + | |
| 41 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/ErrorCodeConstants.java
| ... | ... | @@ -497,4 +497,13 @@ public interface ErrorCodeConstants { |
| 497 | 497 | ErrorCode WM_SALES_NOTICE_LINE_NOT_EXISTS = new ErrorCode(1_040_720_010, "发货通知单行不存在"); |
| 498 | 498 | ErrorCode WM_SALES_NOTICE_LINE_EMPTY = new ErrorCode(1_040_720_011, "发货通知单行为空,不能提交"); |
| 499 | 499 | |
| 500 | + // ========== MES 仓库管理-条码配置(1-040-730-000) ========== | |
| 501 | + ErrorCode WM_BARCODE_CONFIG_NOT_EXISTS = new ErrorCode(1_040_730_000, "条码配置不存在"); | |
| 502 | + ErrorCode WM_BARCODE_CONFIG_BIZ_TYPE_DUPLICATE = new ErrorCode(1_040_730_001, "该业务类型的条码配置已存在"); | |
| 503 | + | |
| 504 | + // ========== MES 仓库管理-条码清单(1-040-731-000) ========== | |
| 505 | + ErrorCode WM_BARCODE_NOT_EXISTS = new ErrorCode(1_040_731_000, "条码不存在"); | |
| 506 | + ErrorCode WM_BARCODE_ALREADY_EXISTS = new ErrorCode(1_040_731_001, "该业务对象的条码已存在"); | |
| 507 | + ErrorCode WM_BARCODE_CONTENT_DUPLICATE = new ErrorCode(1_040_731_002, "条码内容已存在"); | |
| 508 | + | |
| 500 | 509 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/MesBizTypeConstants.java
| ... | ... | @@ -23,6 +23,11 @@ public final class MesBizTypeConstants { |
| 23 | 23 | |
| 24 | 24 | public static final int WM_ARRIVAL_NOTICE = 100; // 到货通知单:MesWmArrivalNoticeDO |
| 25 | 25 | // public static final int WM_OUTSOURCE_RECPT = 101; // TODO 外协入库单:未实现,占位 |
| 26 | + public static final int WM_WAREHOUSE = 102; // 仓库:MesWmWarehouseDO | |
| 27 | + public static final int WM_AREA = 103; // 库位:MesWmStorageAreaDO | |
| 28 | + public static final int WM_PACKAGE = 104; // 装箱单:MesWmPackageDO | |
| 29 | + public static final int WM_STOCK = 105; // 库存:MesWmMaterialStockDO | |
| 30 | + public static final int WM_BATCH = 106; // 批次:MesWmBatchDO | |
| 26 | 31 | |
| 27 | 32 | // ========== CAL 排班模块 [200, 300) ========== |
| 28 | 33 | |
| ... | ... | @@ -31,10 +36,24 @@ public final class MesBizTypeConstants { |
| 31 | 36 | |
| 32 | 37 | // ========== PRO 生产模块 [300, 400) ========== |
| 33 | 38 | |
| 39 | + public static final int PRO_CARD = 300; // 流转卡:MesProCardDO | |
| 40 | + public static final int PRO_WORKORDER = 301; // 工单:MesProWorkOrderDO | |
| 41 | + public static final int PRO_TRANS_ORDER = 302; // 流转单:MesProTransOrderDO | |
| 42 | + | |
| 34 | 43 | // ========== DV 设备模块 [400, 500) ========== |
| 35 | 44 | |
| 45 | + public static final int DV_MACHINERY = 400; // 设备:MesDvMachineryDO | |
| 46 | + | |
| 36 | 47 | // ========== TM 工装夹具模块 [500, 600) ========== |
| 37 | 48 | |
| 49 | + public static final int TM_TOOL = 500; // 工装:MesToolDO | |
| 50 | + | |
| 38 | 51 | // ========== MD 主数据模块 [600, 700) ========== |
| 39 | 52 | |
| 53 | + public static final int MD_ITEM = 600; // 物料:MesMdItemDO | |
| 54 | + public static final int MD_VENDOR = 601; // 供应商:MesMdVendorDO | |
| 55 | + public static final int MD_WORKSTATION = 602; // 工作站:MesMdWorkstationDO | |
| 56 | + public static final int MD_WORKSHOP = 603; // 车间:MesMdWorkshopDO | |
| 57 | + public static final int MD_USER = 604; // 人员:系统用户 | |
| 58 | + | |
| 40 | 59 | } | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/wm/BarcodeBizTypeEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.enums.wm; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.core.ArrayValuable; | |
| 4 | +import cn.iocoder.yudao.module.mes.enums.MesBizTypeConstants; | |
| 5 | +import lombok.AllArgsConstructor; | |
| 6 | +import lombok.Getter; | |
| 7 | + | |
| 8 | +import java.util.Arrays; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * MES 条码业务类型枚举 | |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 14 | + */ | |
| 15 | +@Getter | |
| 16 | +@AllArgsConstructor | |
| 17 | +public enum BarcodeBizTypeEnum implements ArrayValuable<Integer> { | |
| 18 | + | |
| 19 | + // ========== WM 仓库模块 [100, 200) ========== | |
| 20 | + WAREHOUSE(MesBizTypeConstants.WM_WAREHOUSE, "仓库"), | |
| 21 | + AREA(MesBizTypeConstants.WM_AREA, "库位"), | |
| 22 | + PACKAGE(MesBizTypeConstants.WM_PACKAGE, "装箱单"), | |
| 23 | + STOCK(MesBizTypeConstants.WM_STOCK, "库存"), | |
| 24 | + BATCH(MesBizTypeConstants.WM_BATCH, "批次"), | |
| 25 | + | |
| 26 | + // ========== PRO 生产模块 [300, 400) ========== | |
| 27 | + PROCARD(MesBizTypeConstants.PRO_CARD, "流转卡"), | |
| 28 | + WORKORDER(MesBizTypeConstants.PRO_WORKORDER, "工单"), | |
| 29 | + TRANSORDER(MesBizTypeConstants.PRO_TRANS_ORDER, "流转单"), | |
| 30 | + | |
| 31 | + // ========== DV 设备模块 [400, 500) ========== | |
| 32 | + MACHINERY(MesBizTypeConstants.DV_MACHINERY, "设备"), | |
| 33 | + | |
| 34 | + // ========== TM 工装夹具模块 [500, 600) ========== | |
| 35 | + TOOL(MesBizTypeConstants.TM_TOOL, "工装"), | |
| 36 | + | |
| 37 | + // ========== MD 主数据模块 [600, 700) ========== | |
| 38 | + ITEM(MesBizTypeConstants.MD_ITEM, "物料"), | |
| 39 | + VENDOR(MesBizTypeConstants.MD_VENDOR, "供应商"), | |
| 40 | + WORKSTATION(MesBizTypeConstants.MD_WORKSTATION, "工作站"), | |
| 41 | + WORKSHOP(MesBizTypeConstants.MD_WORKSHOP, "车间"), | |
| 42 | + USER(MesBizTypeConstants.MD_USER, "人员"); | |
| 43 | + | |
| 44 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(BarcodeBizTypeEnum::getValue).toArray(Integer[]::new); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 业务类型值 | |
| 48 | + */ | |
| 49 | + private final Integer value; | |
| 50 | + /** | |
| 51 | + * 业务类型名称 | |
| 52 | + */ | |
| 53 | + private final String label; | |
| 54 | + | |
| 55 | + @Override | |
| 56 | + public Integer[] array() { | |
| 57 | + return ARRAYS; | |
| 58 | + } | |
| 59 | + | |
| 60 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/wm/BarcodeFormatEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.enums.wm; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.core.ArrayValuable; | |
| 4 | +import lombok.AllArgsConstructor; | |
| 5 | +import lombok.Getter; | |
| 6 | + | |
| 7 | +import java.util.Arrays; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * MES 条码格式枚举 | |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 13 | + */ | |
| 14 | +@Getter | |
| 15 | +@AllArgsConstructor | |
| 16 | +public enum BarcodeFormatEnum implements ArrayValuable<Integer> { | |
| 17 | + | |
| 18 | + QR_CODE(1, "二维码"), | |
| 19 | + EAN13(2, "EAN13 商品条码"), | |
| 20 | + CODE39(3, "CODE39 工业条码"), | |
| 21 | + UPC_A(4, "UPC-A 美国商品码"); | |
| 22 | + | |
| 23 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(BarcodeFormatEnum::getValue).toArray(Integer[]::new); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 格式值 | |
| 27 | + */ | |
| 28 | + private final Integer value; | |
| 29 | + /** | |
| 30 | + * 格式名称 | |
| 31 | + */ | |
| 32 | + private final String label; | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Integer[] array() { | |
| 36 | + return ARRAYS; | |
| 37 | + } | |
| 38 | + | |
| 39 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/framework/barcode/MesWmBarcodeAutoGenerator.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.framework.barcode; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.MesWmBarcodeSaveReqVO; | |
| 5 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeConfigDO; | |
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeDO; | |
| 7 | +import cn.iocoder.yudao.module.mes.service.wm.barcode.MesWmBarcodeConfigService; | |
| 8 | +import cn.iocoder.yudao.module.mes.service.wm.barcode.MesWmBarcodeService; | |
| 9 | +import jakarta.annotation.Resource; | |
| 10 | +import lombok.extern.slf4j.Slf4j; | |
| 11 | +import org.springframework.scheduling.annotation.Async; | |
| 12 | +import org.springframework.stereotype.Component; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * MES 条码自动生成器 | |
| 16 | + * | |
| 17 | + * @author 芋道源码 | |
| 18 | + */ | |
| 19 | +@Component | |
| 20 | +@Slf4j | |
| 21 | +public class MesWmBarcodeAutoGenerator { | |
| 22 | + | |
| 23 | + @Resource | |
| 24 | + private MesWmBarcodeConfigService barcodeConfigService; | |
| 25 | + | |
| 26 | + @Resource | |
| 27 | + private MesWmBarcodeService barcodeService; | |
| 28 | + | |
| 29 | + // TODO @AI:合并到 MesWmBarcodeServiceImpl 中; | |
| 30 | + /** | |
| 31 | + * 自动生成条码 | |
| 32 | + * | |
| 33 | + * @param bizType 业务类型 | |
| 34 | + * @param bizId 业务编号 | |
| 35 | + * @param bizCode 业务编码 | |
| 36 | + * @param bizName 业务名称 | |
| 37 | + */ | |
| 38 | + @Async | |
| 39 | + // TODO @AI:就不异步处理了,必要性不大; | |
| 40 | + public void autoGenerateBarcode(Integer bizType, Long bizId, String bizCode, String bizName) { | |
| 41 | + // TODO @AI:不要 try catch;;;;必须成功! | |
| 42 | + try { | |
| 43 | + // 1.1 检查是否配置自动生成 | |
| 44 | + MesWmBarcodeConfigDO config = barcodeConfigService.getBarcodeConfigByBizType(bizType); | |
| 45 | + if (config == null) { | |
| 46 | + return; | |
| 47 | + } | |
| 48 | + // TODO @AI:Boolean.False 去比较;跳过; | |
| 49 | + if (!config.getAutoGenerateFlag()) { | |
| 50 | + return; | |
| 51 | + } | |
| 52 | + // TODO @AI;CommonStatusEnum.isFalse(config.getStatus()) 去比较;把上面 3 个判断,合并下; | |
| 53 | + if (!CommonStatusEnum.ENABLE.getStatus().equals(config.getStatus())) { | |
| 54 | + return; | |
| 55 | + } | |
| 56 | + // 1.2 检查是否已存在条码 | |
| 57 | + MesWmBarcodeDO existBarcode = barcodeService.getBarcodeByBizTypeAndBizId(bizType, bizId); | |
| 58 | + if (existBarcode != null) { | |
| 59 | + return; | |
| 60 | + } | |
| 61 | + | |
| 62 | + // 2. 创建条码记录 | |
| 63 | + MesWmBarcodeSaveReqVO createReqVO = new MesWmBarcodeSaveReqVO() | |
| 64 | + .setFormat(config.getFormat()).setStatus(CommonStatusEnum.ENABLE.getStatus()) | |
| 65 | + .setBizType(bizType).setBizId(bizId).setBizCode(bizCode).setBizName(bizName); | |
| 66 | + Long barcodeId = barcodeService.createBarcode(createReqVO); | |
| 67 | + // TODO @AI:这里就不打日志了; | |
| 68 | + log.info("自动生成条码成功 [业务类型={}, 业务ID={}, 条码ID={}]", bizType, bizId, barcodeId); | |
| 69 | + } catch (Exception e) { | |
| 70 | + log.error("自动生成条码失败 [业务类型={}, 业务ID={}]", bizType, bizId, e); | |
| 71 | + } | |
| 72 | + } | |
| 73 | + | |
| 74 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/barcode/MesWmBarcodeConfigService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.barcode; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config.MesWmBarcodeConfigPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config.MesWmBarcodeConfigSaveReqVO; | |
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeConfigDO; | |
| 7 | +import jakarta.validation.Valid; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * MES 条码配置 Service 接口 | |
| 13 | + * | |
| 14 | + * @author 芋道源码 | |
| 15 | + */ | |
| 16 | +public interface MesWmBarcodeConfigService { | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 创建条码配置 | |
| 20 | + * | |
| 21 | + * @param createReqVO 创建信息 | |
| 22 | + * @return 编号 | |
| 23 | + */ | |
| 24 | + Long createBarcodeConfig(@Valid MesWmBarcodeConfigSaveReqVO createReqVO); | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 更新条码配置 | |
| 28 | + * | |
| 29 | + * @param updateReqVO 更新信息 | |
| 30 | + */ | |
| 31 | + void updateBarcodeConfig(@Valid MesWmBarcodeConfigSaveReqVO updateReqVO); | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 删除条码配置 | |
| 35 | + * | |
| 36 | + * @param id 编号 | |
| 37 | + */ | |
| 38 | + void deleteBarcodeConfig(Long id); | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * 获得条码配置 | |
| 42 | + * | |
| 43 | + * @param id 编号 | |
| 44 | + * @return 条码配置 | |
| 45 | + */ | |
| 46 | + MesWmBarcodeConfigDO getBarcodeConfig(Long id); | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 获得条码配置分页 | |
| 50 | + * | |
| 51 | + * @param pageReqVO 分页参数 | |
| 52 | + * @return 条码配置分页 | |
| 53 | + */ | |
| 54 | + PageResult<MesWmBarcodeConfigDO> getBarcodeConfigPage(MesWmBarcodeConfigPageReqVO pageReqVO); | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 根据业务类型获取条码配置 | |
| 58 | + * | |
| 59 | + * @param bizType 业务类型 | |
| 60 | + * @return 条码配置 | |
| 61 | + */ | |
| 62 | + MesWmBarcodeConfigDO getBarcodeConfigByBizType(Integer bizType); | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 校验条码配置存在(根据业务类型) | |
| 66 | + * | |
| 67 | + * @param bizType 业务类型 | |
| 68 | + * @return 条码配置 | |
| 69 | + */ | |
| 70 | + MesWmBarcodeConfigDO validateBarcodeConfigByBizType(Integer bizType); | |
| 71 | + | |
| 72 | + // TODO @AI:是不是删除掉?貌似没用哈。 | |
| 73 | + /** | |
| 74 | + * 获取自动生成的条码配置列表 | |
| 75 | + * | |
| 76 | + * @return 条码配置列表 | |
| 77 | + */ | |
| 78 | + List<MesWmBarcodeConfigDO> getAutoGenerateBarcodeConfigList(); | |
| 79 | + | |
| 80 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/barcode/MesWmBarcodeConfigServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.barcode; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.ObjUtil; | |
| 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.barcode.vo.config.MesWmBarcodeConfigPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.config.MesWmBarcodeConfigSaveReqVO; | |
| 8 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeConfigDO; | |
| 9 | +import cn.iocoder.yudao.module.mes.dal.mysql.wm.barcode.MesWmBarcodeConfigMapper; | |
| 10 | +import jakarta.annotation.Resource; | |
| 11 | +import org.springframework.stereotype.Service; | |
| 12 | +import org.springframework.validation.annotation.Validated; | |
| 13 | + | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 17 | +import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * MES 条码配置 Service 实现类 | |
| 21 | + * | |
| 22 | + * @author 芋道源码 | |
| 23 | + */ | |
| 24 | +@Service | |
| 25 | +@Validated | |
| 26 | +public class MesWmBarcodeConfigServiceImpl implements MesWmBarcodeConfigService { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private MesWmBarcodeConfigMapper barcodeConfigMapper; | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public Long createBarcodeConfig(MesWmBarcodeConfigSaveReqVO createReqVO) { | |
| 33 | + // 校验业务类型唯一 | |
| 34 | + validateBarcodeConfigBizTypeUnique(null, createReqVO.getBizType()); | |
| 35 | + | |
| 36 | + // 插入 | |
| 37 | + MesWmBarcodeConfigDO config = BeanUtils.toBean(createReqVO, MesWmBarcodeConfigDO.class); | |
| 38 | + barcodeConfigMapper.insert(config); | |
| 39 | + return config.getId(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public void updateBarcodeConfig(MesWmBarcodeConfigSaveReqVO updateReqVO) { | |
| 44 | + // 校验存在 | |
| 45 | + validateBarcodeConfigExists(updateReqVO.getId()); | |
| 46 | + // 校验业务类型唯一 | |
| 47 | + validateBarcodeConfigBizTypeUnique(updateReqVO.getId(), updateReqVO.getBizType()); | |
| 48 | + | |
| 49 | + // 更新 | |
| 50 | + MesWmBarcodeConfigDO updateObj = BeanUtils.toBean(updateReqVO, MesWmBarcodeConfigDO.class); | |
| 51 | + barcodeConfigMapper.updateById(updateObj); | |
| 52 | + } | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + public void deleteBarcodeConfig(Long id) { | |
| 56 | + // 校验存在 | |
| 57 | + validateBarcodeConfigExists(id); | |
| 58 | + // 删除 | |
| 59 | + barcodeConfigMapper.deleteById(id); | |
| 60 | + } | |
| 61 | + | |
| 62 | + private MesWmBarcodeConfigDO validateBarcodeConfigExists(Long id) { | |
| 63 | + MesWmBarcodeConfigDO config = barcodeConfigMapper.selectById(id); | |
| 64 | + if (config == null) { | |
| 65 | + throw exception(WM_BARCODE_CONFIG_NOT_EXISTS); | |
| 66 | + } | |
| 67 | + return config; | |
| 68 | + } | |
| 69 | + | |
| 70 | + private void validateBarcodeConfigBizTypeUnique(Long id, Integer bizType) { | |
| 71 | + MesWmBarcodeConfigDO config = barcodeConfigMapper.selectByBizType(bizType); | |
| 72 | + if (config == null) { | |
| 73 | + return; | |
| 74 | + } | |
| 75 | + if (ObjUtil.notEqual(config.getId(), id)) { | |
| 76 | + throw exception(WM_BARCODE_CONFIG_BIZ_TYPE_DUPLICATE); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Override | |
| 81 | + public MesWmBarcodeConfigDO getBarcodeConfig(Long id) { | |
| 82 | + return barcodeConfigMapper.selectById(id); | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + public PageResult<MesWmBarcodeConfigDO> getBarcodeConfigPage(MesWmBarcodeConfigPageReqVO pageReqVO) { | |
| 87 | + return barcodeConfigMapper.selectPage(pageReqVO); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @Override | |
| 91 | + public MesWmBarcodeConfigDO getBarcodeConfigByBizType(Integer bizType) { | |
| 92 | + return barcodeConfigMapper.selectByBizType(bizType); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Override | |
| 96 | + public MesWmBarcodeConfigDO validateBarcodeConfigByBizType(Integer bizType) { | |
| 97 | + MesWmBarcodeConfigDO config = barcodeConfigMapper.selectByBizType(bizType); | |
| 98 | + if (config == null) { | |
| 99 | + throw exception(WM_BARCODE_CONFIG_NOT_EXISTS); | |
| 100 | + } | |
| 101 | + return config; | |
| 102 | + } | |
| 103 | + | |
| 104 | + // TODO @AI:getBarcodeConfigListByAutoGenerateFlag,获取自动生成条码的配置列表(Boolean ) | |
| 105 | + @Override | |
| 106 | + public List<MesWmBarcodeConfigDO> getAutoGenerateBarcodeConfigList() { | |
| 107 | + return barcodeConfigMapper.selectListByAutoGenerateFlag(true); | |
| 108 | + } | |
| 109 | + | |
| 110 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/barcode/MesWmBarcodeService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.barcode; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.MesWmBarcodePageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.MesWmBarcodeSaveReqVO; | |
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeDO; | |
| 7 | +import jakarta.validation.Valid; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * MES 条码清单 Service 接口 | |
| 11 | + * | |
| 12 | + * @author 芋道源码 | |
| 13 | + */ | |
| 14 | +public interface MesWmBarcodeService { | |
| 15 | + | |
| 16 | + /** | |
| 17 | + * 创建条码 | |
| 18 | + * | |
| 19 | + * @param createReqVO 创建信息 | |
| 20 | + * @return 编号 | |
| 21 | + */ | |
| 22 | + Long createBarcode(@Valid MesWmBarcodeSaveReqVO createReqVO); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 更新条码 | |
| 26 | + * | |
| 27 | + * @param updateReqVO 更新信息 | |
| 28 | + */ | |
| 29 | + void updateBarcode(@Valid MesWmBarcodeSaveReqVO updateReqVO); | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 删除条码 | |
| 33 | + * | |
| 34 | + * @param id 编号 | |
| 35 | + */ | |
| 36 | + void deleteBarcode(Long id); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 获得条码 | |
| 40 | + * | |
| 41 | + * @param id 编号 | |
| 42 | + * @return 条码 | |
| 43 | + */ | |
| 44 | + MesWmBarcodeDO getBarcode(Long id); | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * 获得条码分页 | |
| 48 | + * | |
| 49 | + * @param pageReqVO 分页参数 | |
| 50 | + * @return 条码分页 | |
| 51 | + */ | |
| 52 | + PageResult<MesWmBarcodeDO> getBarcodePage(MesWmBarcodePageReqVO pageReqVO); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 根据业务类型和业务编号获取条码 | |
| 56 | + * | |
| 57 | + * @param bizType 业务类型 | |
| 58 | + * @param bizId 业务编号 | |
| 59 | + * @return 条码 | |
| 60 | + */ | |
| 61 | + MesWmBarcodeDO getBarcodeByBizTypeAndBizId(Integer bizType, Long bizId); | |
| 62 | + | |
| 63 | +} | ... | ... |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/wm/barcode/MesWmBarcodeServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.service.wm.barcode; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.StrUtil; | |
| 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.barcode.vo.MesWmBarcodePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.mes.controller.admin.wm.barcode.vo.MesWmBarcodeSaveReqVO; | |
| 8 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeConfigDO; | |
| 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.wm.barcode.MesWmBarcodeDO; | |
| 10 | +import cn.iocoder.yudao.module.mes.dal.mysql.wm.barcode.MesWmBarcodeMapper; | |
| 11 | +import jakarta.annotation.Resource; | |
| 12 | +import org.springframework.stereotype.Service; | |
| 13 | +import org.springframework.validation.annotation.Validated; | |
| 14 | + | |
| 15 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 16 | +import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * MES 条码清单 Service 实现类 | |
| 20 | + * | |
| 21 | + * @author 芋道源码 | |
| 22 | + */ | |
| 23 | +@Service | |
| 24 | +@Validated | |
| 25 | +public class MesWmBarcodeServiceImpl implements MesWmBarcodeService { | |
| 26 | + | |
| 27 | + @Resource | |
| 28 | + private MesWmBarcodeMapper barcodeMapper; | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private MesWmBarcodeConfigService barcodeConfigService; | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public Long createBarcode(MesWmBarcodeSaveReqVO createReqVO) { | |
| 35 | + // 1.1 校验条码配置 | |
| 36 | + MesWmBarcodeConfigDO config = barcodeConfigService.validateBarcodeConfigByBizType(createReqVO.getBizType()); | |
| 37 | + // 1.2 校验是否已存在条码 | |
| 38 | + MesWmBarcodeDO existBarcode = barcodeMapper.selectByBizTypeAndBizId( | |
| 39 | + createReqVO.getBizType(), createReqVO.getBizId()); | |
| 40 | + if (existBarcode != null) { | |
| 41 | + throw exception(WM_BARCODE_ALREADY_EXISTS); | |
| 42 | + } | |
| 43 | + | |
| 44 | + // 2.1 生成条码内容(根据配置模板) | |
| 45 | + String content = generateBarcodeContent(config.getContentFormat(), createReqVO.getBizCode()); | |
| 46 | + // 2.2 校验条码内容唯一性 | |
| 47 | + MesWmBarcodeDO contentBarcode = barcodeMapper.selectByContent(content); | |
| 48 | + if (contentBarcode != null) { | |
| 49 | + throw exception(WM_BARCODE_CONTENT_DUPLICATE); | |
| 50 | + } | |
| 51 | + | |
| 52 | + // 3. 保存条码记录 | |
| 53 | + MesWmBarcodeDO barcode = BeanUtils.toBean(createReqVO, MesWmBarcodeDO.class) | |
| 54 | + .setConfigId(config.getId()).setContent(content).setFormat(config.getFormat()); | |
| 55 | + barcodeMapper.insert(barcode); | |
| 56 | + return barcode.getId(); | |
| 57 | + } | |
| 58 | + | |
| 59 | + @Override | |
| 60 | + public void updateBarcode(MesWmBarcodeSaveReqVO updateReqVO) { | |
| 61 | + // 校验存在 | |
| 62 | + validateBarcodeExists(updateReqVO.getId()); | |
| 63 | + | |
| 64 | + // 更新 | |
| 65 | + MesWmBarcodeDO updateObj = BeanUtils.toBean(updateReqVO, MesWmBarcodeDO.class); | |
| 66 | + barcodeMapper.updateById(updateObj); | |
| 67 | + } | |
| 68 | + | |
| 69 | + @Override | |
| 70 | + public void deleteBarcode(Long id) { | |
| 71 | + // 校验存在 | |
| 72 | + validateBarcodeExists(id); | |
| 73 | + // 删除 | |
| 74 | + barcodeMapper.deleteById(id); | |
| 75 | + } | |
| 76 | + | |
| 77 | + private MesWmBarcodeDO validateBarcodeExists(Long id) { | |
| 78 | + MesWmBarcodeDO barcode = barcodeMapper.selectById(id); | |
| 79 | + if (barcode == null) { | |
| 80 | + throw exception(WM_BARCODE_NOT_EXISTS); | |
| 81 | + } | |
| 82 | + return barcode; | |
| 83 | + } | |
| 84 | + | |
| 85 | + @Override | |
| 86 | + public MesWmBarcodeDO getBarcode(Long id) { | |
| 87 | + return barcodeMapper.selectById(id); | |
| 88 | + } | |
| 89 | + | |
| 90 | + @Override | |
| 91 | + public PageResult<MesWmBarcodeDO> getBarcodePage(MesWmBarcodePageReqVO pageReqVO) { | |
| 92 | + return barcodeMapper.selectPage(pageReqVO); | |
| 93 | + } | |
| 94 | + | |
| 95 | + @Override | |
| 96 | + public MesWmBarcodeDO getBarcodeByBizTypeAndBizId(Integer bizType, Long bizId) { | |
| 97 | + return barcodeMapper.selectByBizTypeAndBizId(bizType, bizId); | |
| 98 | + } | |
| 99 | + | |
| 100 | + /** | |
| 101 | + * 生成条码内容 | |
| 102 | + * | |
| 103 | + * @param contentFormat 内容格式模板 | |
| 104 | + * @param bizCode 业务编码 | |
| 105 | + * @return 条码内容 | |
| 106 | + */ | |
| 107 | + private String generateBarcodeContent(String contentFormat, String bizCode) { | |
| 108 | + if (StrUtil.isBlank(contentFormat)) { | |
| 109 | + return bizCode; | |
| 110 | + } | |
| 111 | + return contentFormat.replace(MesWmBarcodeConfigDO.PLACEHOLDER_BUSINESS_CODE, bizCode); | |
| 112 | + } | |
| 113 | + | |
| 114 | +} | ... | ... |