Commit a19352f18e5ec794c649d93c6d05db49942445e3
1 parent
4c5e3074
feat(mes): 新增设备和点检保养项目精简列表接口及批次号字段
Showing
12 changed files
with
60 additions
and
1 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/machinery/MesDvMachineryController.java
| @@ -108,6 +108,14 @@ public class MesDvMachineryController { | @@ -108,6 +108,14 @@ public class MesDvMachineryController { | ||
| 108 | buildMachineryRespVOList(list)); | 108 | buildMachineryRespVOList(list)); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | + @GetMapping("/simple-list") | ||
| 112 | + @Operation(summary = "获得设备精简列表", description = "主要用于前端的下拉选项") | ||
| 113 | + @PreAuthorize("@ss.hasPermission('mes:dv-machinery:query')") | ||
| 114 | + public CommonResult<List<MesDvMachineryRespVO>> getMachinerySimpleList() { | ||
| 115 | + List<MesDvMachineryDO> list = machineryService.getMachinerySimpleList(); | ||
| 116 | + return success(BeanUtils.toBean(list, MesDvMachineryRespVO.class)); | ||
| 117 | + } | ||
| 118 | + | ||
| 111 | // ==================== 拼接 VO ==================== | 119 | // ==================== 拼接 VO ==================== |
| 112 | 120 | ||
| 113 | private List<MesDvMachineryRespVO> buildMachineryRespVOList(List<MesDvMachineryDO> list) { | 121 | private List<MesDvMachineryRespVO> buildMachineryRespVOList(List<MesDvMachineryDO> list) { |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/dv/subject/MesDvSubjectController.java
| @@ -77,6 +77,14 @@ public class MesDvSubjectController { | @@ -77,6 +77,14 @@ public class MesDvSubjectController { | ||
| 77 | return success(BeanUtils.toBean(pageResult, MesDvSubjectRespVO.class)); | 77 | return success(BeanUtils.toBean(pageResult, MesDvSubjectRespVO.class)); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | + @GetMapping("/simple-list") | ||
| 81 | + @Operation(summary = "获得点检保养项目精简列表", description = "主要用于前端的下拉选项") | ||
| 82 | + @PreAuthorize("@ss.hasPermission('mes:dv-subject:query')") | ||
| 83 | + public CommonResult<List<MesDvSubjectRespVO>> getSubjectSimpleList() { | ||
| 84 | + List<MesDvSubjectDO> list = subjectService.getSubjectSimpleList(); | ||
| 85 | + return success(BeanUtils.toBean(list, MesDvSubjectRespVO.class)); | ||
| 86 | + } | ||
| 87 | + | ||
| 80 | @GetMapping("/export-excel") | 88 | @GetMapping("/export-excel") |
| 81 | @Operation(summary = "导出点检保养项目 Excel") | 89 | @Operation(summary = "导出点检保养项目 Excel") |
| 82 | @PreAuthorize("@ss.hasPermission('mes:dv-subject:export')") | 90 | @PreAuthorize("@ss.hasPermission('mes:dv-subject:export')") |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkorderController.java
| @@ -167,7 +167,7 @@ public class MesProWorkOrderController { | @@ -167,7 +167,7 @@ public class MesProWorkOrderController { | ||
| 167 | MapUtils.findAndThen(clientMap, vo.getClientId(), | 167 | MapUtils.findAndThen(clientMap, vo.getClientId(), |
| 168 | client -> vo.setClientName(client.getName()).setClientCode(client.getCode())); | 168 | client -> vo.setClientName(client.getName()).setClientCode(client.getCode())); |
| 169 | MapUtils.findAndThen(vendorMap, vo.getVendorId(), | 169 | MapUtils.findAndThen(vendorMap, vo.getVendorId(), |
| 170 | - vendor -> vo.setVendorName(vendor.getName())); | 170 | + vendor -> vo.setVendorName(vendor.getName()).setVendorCode(vendor.getCode())); |
| 171 | MapUtils.findAndThen(unitMeasureMap, vo.getUnitMeasureId(), | 171 | MapUtils.findAndThen(unitMeasureMap, vo.getUnitMeasureId(), |
| 172 | unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName())); | 172 | unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName())); |
| 173 | MapUtils.findAndThen(parentMap, vo.getParentId(), | 173 | MapUtils.findAndThen(parentMap, vo.getParentId(), |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/MesProWorkorderPageReqVO.java
| @@ -35,6 +35,9 @@ public class MesProWorkOrderPageReqVO extends PageParam { | @@ -35,6 +35,9 @@ public class MesProWorkOrderPageReqVO extends PageParam { | ||
| 35 | @Schema(description = "客户编号", example = "300") | 35 | @Schema(description = "客户编号", example = "300") |
| 36 | private Long clientId; | 36 | private Long clientId; |
| 37 | 37 | ||
| 38 | + @Schema(description = "批次号", example = "BATCH-001") | ||
| 39 | + private String batchCode; | ||
| 40 | + | ||
| 38 | @Schema(description = "工单状态", example = "0") | 41 | @Schema(description = "工单状态", example = "0") |
| 39 | private Integer status; | 42 | private Integer status; |
| 40 | 43 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/MesProWorkorderRespVO.java
| @@ -94,10 +94,18 @@ public class MesProWorkOrderRespVO { | @@ -94,10 +94,18 @@ public class MesProWorkOrderRespVO { | ||
| 94 | @Schema(description = "供应商编号", example = "400") | 94 | @Schema(description = "供应商编号", example = "400") |
| 95 | private Long vendorId; | 95 | private Long vendorId; |
| 96 | 96 | ||
| 97 | + @Schema(description = "供应商编码", example = "V-001") | ||
| 98 | + @ExcelProperty("供应商编码") | ||
| 99 | + private String vendorCode; | ||
| 100 | + | ||
| 97 | @Schema(description = "供应商名称", example = "供应商 A") | 101 | @Schema(description = "供应商名称", example = "供应商 A") |
| 98 | @ExcelProperty("供应商名称") | 102 | @ExcelProperty("供应商名称") |
| 99 | private String vendorName; | 103 | private String vendorName; |
| 100 | 104 | ||
| 105 | + @Schema(description = "批次号", example = "BATCH-001") | ||
| 106 | + @ExcelProperty("批次号") | ||
| 107 | + private String batchCode; | ||
| 108 | + | ||
| 101 | @Schema(description = "需求日期") | 109 | @Schema(description = "需求日期") |
| 102 | @ExcelProperty("需求日期") | 110 | @ExcelProperty("需求日期") |
| 103 | private LocalDateTime requestDate; | 111 | private LocalDateTime requestDate; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/MesProWorkorderSaveReqVO.java
| @@ -61,6 +61,9 @@ public class MesProWorkOrderSaveReqVO { | @@ -61,6 +61,9 @@ public class MesProWorkOrderSaveReqVO { | ||
| 61 | @Schema(description = "供应商编号", example = "400") | 61 | @Schema(description = "供应商编号", example = "400") |
| 62 | private Long vendorId; | 62 | private Long vendorId; |
| 63 | 63 | ||
| 64 | + @Schema(description = "批次号", example = "BATCH-001") | ||
| 65 | + private String batchCode; | ||
| 66 | + | ||
| 64 | @Schema(description = "需求日期", requiredMode = Schema.RequiredMode.REQUIRED) | 67 | @Schema(description = "需求日期", requiredMode = Schema.RequiredMode.REQUIRED) |
| 65 | @NotNull(message = "需求日期不能为空") | 68 | @NotNull(message = "需求日期不能为空") |
| 66 | private LocalDateTime requestDate; | 69 | private LocalDateTime requestDate; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/pro/workorder/MesProWorkorderDO.java
| @@ -101,6 +101,10 @@ public class MesProWorkOrderDO extends BaseDO { | @@ -101,6 +101,10 @@ public class MesProWorkOrderDO extends BaseDO { | ||
| 101 | */ | 101 | */ |
| 102 | private Long vendorId; | 102 | private Long vendorId; |
| 103 | /** | 103 | /** |
| 104 | + * 批次号 | ||
| 105 | + */ | ||
| 106 | + private String batchCode; | ||
| 107 | + /** | ||
| 104 | * 需求日期 | 108 | * 需求日期 |
| 105 | */ | 109 | */ |
| 106 | private LocalDateTime requestDate; | 110 | private LocalDateTime requestDate; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/pro/workorder/MesProWorkorderMapper.java
| @@ -23,6 +23,7 @@ public interface MesProWorkOrderMapper extends BaseMapperX<MesProWorkOrderDO> { | @@ -23,6 +23,7 @@ public interface MesProWorkOrderMapper extends BaseMapperX<MesProWorkOrderDO> { | ||
| 23 | .eqIfPresent(MesProWorkOrderDO::getOrderSourceType, reqVO.getOrderSourceType()) | 23 | .eqIfPresent(MesProWorkOrderDO::getOrderSourceType, reqVO.getOrderSourceType()) |
| 24 | .eqIfPresent(MesProWorkOrderDO::getProductId, reqVO.getProductId()) | 24 | .eqIfPresent(MesProWorkOrderDO::getProductId, reqVO.getProductId()) |
| 25 | .eqIfPresent(MesProWorkOrderDO::getClientId, reqVO.getClientId()) | 25 | .eqIfPresent(MesProWorkOrderDO::getClientId, reqVO.getClientId()) |
| 26 | + .likeIfPresent(MesProWorkOrderDO::getBatchCode, reqVO.getBatchCode()) | ||
| 26 | .eqIfPresent(MesProWorkOrderDO::getStatus, reqVO.getStatus()) | 27 | .eqIfPresent(MesProWorkOrderDO::getStatus, reqVO.getStatus()) |
| 27 | .betweenIfPresent(MesProWorkOrderDO::getRequestDate, reqVO.getRequestDate()) | 28 | .betweenIfPresent(MesProWorkOrderDO::getRequestDate, reqVO.getRequestDate()) |
| 28 | .orderByDesc(MesProWorkOrderDO::getId)); | 29 | .orderByDesc(MesProWorkOrderDO::getId)); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/dv/machinery/MesDvMachineryService.java
| @@ -73,6 +73,13 @@ public interface MesDvMachineryService { | @@ -73,6 +73,13 @@ public interface MesDvMachineryService { | ||
| 73 | void validateMachineryExists(Long id); | 73 | void validateMachineryExists(Long id); |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | + * 获得设备精简列表(下拉选项用) | ||
| 77 | + * | ||
| 78 | + * @return 设备列表 | ||
| 79 | + */ | ||
| 80 | + List<MesDvMachineryDO> getMachinerySimpleList(); | ||
| 81 | + | ||
| 82 | + /** | ||
| 76 | * 获得设备列表 | 83 | * 获得设备列表 |
| 77 | * | 84 | * |
| 78 | * @param ids 编号数组 | 85 | * @param ids 编号数组 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/dv/machinery/MesDvMachineryServiceImpl.java
| @@ -118,6 +118,11 @@ public class MesDvMachineryServiceImpl implements MesDvMachineryService { | @@ -118,6 +118,11 @@ public class MesDvMachineryServiceImpl implements MesDvMachineryService { | ||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | @Override | 120 | @Override |
| 121 | + public List<MesDvMachineryDO> getMachinerySimpleList() { | ||
| 122 | + return machineryMapper.selectList(); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + @Override | ||
| 121 | public List<MesDvMachineryDO> getMachineryList(Collection<Long> ids) { | 126 | public List<MesDvMachineryDO> getMachineryList(Collection<Long> ids) { |
| 122 | if (CollUtil.isEmpty(ids)) { | 127 | if (CollUtil.isEmpty(ids)) { |
| 123 | return Collections.emptyList(); | 128 | return Collections.emptyList(); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/dv/subject/MesDvSubjectService.java
| @@ -65,6 +65,13 @@ public interface MesDvSubjectService { | @@ -65,6 +65,13 @@ public interface MesDvSubjectService { | ||
| 65 | void validateSubjectExists(Long id); | 65 | void validateSubjectExists(Long id); |
| 66 | 66 | ||
| 67 | /** | 67 | /** |
| 68 | + * 获得点检保养项目精简列表(下拉选项用) | ||
| 69 | + * | ||
| 70 | + * @return 项目列表 | ||
| 71 | + */ | ||
| 72 | + List<MesDvSubjectDO> getSubjectSimpleList(); | ||
| 73 | + | ||
| 74 | + /** | ||
| 68 | * 获得点检保养项目列表 | 75 | * 获得点检保养项目列表 |
| 69 | * | 76 | * |
| 70 | * @param ids 编号数组 | 77 | * @param ids 编号数组 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/dv/subject/MesDvSubjectServiceImpl.java
| @@ -93,6 +93,11 @@ public class MesDvSubjectServiceImpl implements MesDvSubjectService { | @@ -93,6 +93,11 @@ public class MesDvSubjectServiceImpl implements MesDvSubjectService { | ||
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | @Override | 95 | @Override |
| 96 | + public List<MesDvSubjectDO> getSubjectSimpleList() { | ||
| 97 | + return subjectMapper.selectList(); | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + @Override | ||
| 96 | public List<MesDvSubjectDO> getSubjectList(Collection<Long> ids) { | 101 | public List<MesDvSubjectDO> getSubjectList(Collection<Long> ids) { |
| 97 | if (CollUtil.isEmpty(ids)) { | 102 | if (CollUtil.isEmpty(ids)) { |
| 98 | return Collections.emptyList(); | 103 | return Collections.emptyList(); |