Commit 95b09b98c451522e9acb60e79c569bc6314be279
1 parent
06d79561
review(mes):cal-plan 的实现
Showing
62 changed files
with
899 additions
and
362 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/plan/MesCalPlanController.java
| @@ -9,7 +9,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | @@ -9,7 +9,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 9 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; | 9 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; |
| 10 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanRespVO; | 10 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanRespVO; |
| 11 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanSaveReqVO; | 11 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanSaveReqVO; |
| 12 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanDO; | 12 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 13 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanService; | 13 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanService; |
| 14 | import io.swagger.v3.oas.annotations.Operation; | 14 | import io.swagger.v3.oas.annotations.Operation; |
| 15 | import io.swagger.v3.oas.annotations.Parameter; | 15 | import io.swagger.v3.oas.annotations.Parameter; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/plan/MesCalPlanShiftController.java
| @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | @@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; |
| 7 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftRespVO; | 7 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftRespVO; |
| 8 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO; | 8 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO; |
| 9 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanShiftDO; | 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO; |
| 10 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanShiftService; | 10 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanShiftService; |
| 11 | import io.swagger.v3.oas.annotations.Operation; | 11 | import io.swagger.v3.oas.annotations.Operation; |
| 12 | import io.swagger.v3.oas.annotations.Parameter; | 12 | import io.swagger.v3.oas.annotations.Parameter; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/cal/plan/MesCalPlanTeamController.java
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamRespVO; | 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamRespVO; |
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; |
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanTeamDO; | 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanTeamDO; |
| 8 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanTeamService; | 8 | import cn.iocoder.yudao.module.mes.service.cal.plan.MesCalPlanTeamService; |
| 9 | import io.swagger.v3.oas.annotations.Operation; | 9 | import io.swagger.v3.oas.annotations.Operation; |
| 10 | import io.swagger.v3.oas.annotations.Parameter; | 10 | import io.swagger.v3.oas.annotations.Parameter; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkorderBomController.java
| @@ -5,15 +5,15 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | @@ -5,15 +5,15 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 6 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 8 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomPageReqVO; | ||
| 9 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomRespVO; | ||
| 10 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomSaveReqVO; | 8 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomPageReqVO; |
| 9 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomRespVO; | ||
| 10 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomSaveReqVO; | ||
| 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| 12 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; | 12 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; |
| 13 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderBomDO; | 13 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderBomDO; |
| 14 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; | 14 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| 15 | import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; | 15 | import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; |
| 16 | -import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkorderBomService; | 16 | +import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderBomService; |
| 17 | import io.swagger.v3.oas.annotations.Operation; | 17 | import io.swagger.v3.oas.annotations.Operation; |
| 18 | import io.swagger.v3.oas.annotations.Parameter; | 18 | import io.swagger.v3.oas.annotations.Parameter; |
| 19 | import io.swagger.v3.oas.annotations.tags.Tag; | 19 | import io.swagger.v3.oas.annotations.tags.Tag; |
| @@ -32,12 +32,12 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. | @@ -32,12 +32,12 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. | ||
| 32 | 32 | ||
| 33 | @Tag(name = "管理后台 - MES 生产工单 BOM") | 33 | @Tag(name = "管理后台 - MES 生产工单 BOM") |
| 34 | @RestController | 34 | @RestController |
| 35 | -@RequestMapping("/mes/pro/workorder-bom") | 35 | +@RequestMapping("/mes/pro/work-order-bom") |
| 36 | @Validated | 36 | @Validated |
| 37 | -public class MesProWorkorderBomController { | 37 | +public class MesProWorkOrderBomController { |
| 38 | 38 | ||
| 39 | @Resource | 39 | @Resource |
| 40 | - private MesProWorkorderBomService workorderBomService; | 40 | + private MesProWorkOrderBomService workOrderBomService; |
| 41 | 41 | ||
| 42 | @Resource | 42 | @Resource |
| 43 | private MesMdItemService itemService; | 43 | private MesMdItemService itemService; |
| @@ -47,67 +47,64 @@ public class MesProWorkorderBomController { | @@ -47,67 +47,64 @@ public class MesProWorkorderBomController { | ||
| 47 | 47 | ||
| 48 | @PostMapping("/create") | 48 | @PostMapping("/create") |
| 49 | @Operation(summary = "创建工单 BOM") | 49 | @Operation(summary = "创建工单 BOM") |
| 50 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:update')") | ||
| 51 | - public CommonResult<Long> createWorkorderBom(@Valid @RequestBody MesProWorkorderBomSaveReqVO createReqVO) { | ||
| 52 | - return success(workorderBomService.createWorkorderBom(createReqVO)); | 50 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:update')") |
| 51 | + public CommonResult<Long> createWorkOrderBom(@Valid @RequestBody MesProWorkOrderBomSaveReqVO createReqVO) { | ||
| 52 | + return success(workOrderBomService.createWorkOrderBom(createReqVO)); | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | @PutMapping("/update") | 55 | @PutMapping("/update") |
| 56 | @Operation(summary = "更新工单 BOM") | 56 | @Operation(summary = "更新工单 BOM") |
| 57 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:update')") | ||
| 58 | - public CommonResult<Boolean> updateWorkorderBom(@Valid @RequestBody MesProWorkorderBomSaveReqVO updateReqVO) { | ||
| 59 | - workorderBomService.updateWorkorderBom(updateReqVO); | 57 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:update')") |
| 58 | + public CommonResult<Boolean> updateWorkOrderBom(@Valid @RequestBody MesProWorkOrderBomSaveReqVO updateReqVO) { | ||
| 59 | + workOrderBomService.updateWorkOrderBom(updateReqVO); | ||
| 60 | return success(true); | 60 | return success(true); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | @DeleteMapping("/delete") | 63 | @DeleteMapping("/delete") |
| 64 | @Operation(summary = "删除工单 BOM") | 64 | @Operation(summary = "删除工单 BOM") |
| 65 | @Parameter(name = "id", description = "编号", required = true) | 65 | @Parameter(name = "id", description = "编号", required = true) |
| 66 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:update')") | ||
| 67 | - public CommonResult<Boolean> deleteWorkorderBom(@RequestParam("id") Long id) { | ||
| 68 | - workorderBomService.deleteWorkorderBom(id); | 66 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:update')") |
| 67 | + public CommonResult<Boolean> deleteWorkOrderBom(@RequestParam("id") Long id) { | ||
| 68 | + workOrderBomService.deleteWorkOrderBom(id); | ||
| 69 | return success(true); | 69 | return success(true); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | @GetMapping("/get") | 72 | @GetMapping("/get") |
| 73 | @Operation(summary = "获得工单 BOM") | 73 | @Operation(summary = "获得工单 BOM") |
| 74 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 74 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 75 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:query')") | ||
| 76 | - public CommonResult<MesProWorkorderBomRespVO> getWorkorderBom(@RequestParam("id") Long id) { | ||
| 77 | - MesProWorkorderBomDO workorderBom = workorderBomService.getWorkorderBom(id); | ||
| 78 | - if (workorderBom == null) { | 75 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')") |
| 76 | + public CommonResult<MesProWorkOrderBomRespVO> getWorkOrderBom(@RequestParam("id") Long id) { | ||
| 77 | + MesProWorkOrderBomDO workOrderBom = workOrderBomService.getWorkOrderBom(id); | ||
| 78 | + if (workOrderBom == null) { | ||
| 79 | return success(null); | 79 | return success(null); |
| 80 | } | 80 | } |
| 81 | - return success(buildWorkorderBomRespVOList(List.of(workorderBom)).get(0)); | 81 | + return success(buildWorkOrderBomRespVOList(List.of(workOrderBom)).get(0)); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | @GetMapping("/page") | 84 | @GetMapping("/page") |
| 85 | @Operation(summary = "获得工单 BOM 分页") | 85 | @Operation(summary = "获得工单 BOM 分页") |
| 86 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:query')") | ||
| 87 | - public CommonResult<PageResult<MesProWorkorderBomRespVO>> getWorkorderBomPage(@Valid MesProWorkorderBomPageReqVO pageReqVO) { | ||
| 88 | - PageResult<MesProWorkorderBomDO> pageResult = workorderBomService.getWorkorderBomPage(pageReqVO); | ||
| 89 | - return success(new PageResult<>(buildWorkorderBomRespVOList(pageResult.getList()), pageResult.getTotal())); | 86 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')") |
| 87 | + public CommonResult<PageResult<MesProWorkOrderBomRespVO>> getWorkOrderBomPage(@Valid MesProWorkOrderBomPageReqVO pageReqVO) { | ||
| 88 | + PageResult<MesProWorkOrderBomDO> pageResult = workOrderBomService.getWorkOrderBomPage(pageReqVO); | ||
| 89 | + return success(new PageResult<>(buildWorkOrderBomRespVOList(pageResult.getList()), pageResult.getTotal())); | ||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | // ==================== 拼接 VO ==================== | 92 | // ==================== 拼接 VO ==================== |
| 93 | 93 | ||
| 94 | - private List<MesProWorkorderBomRespVO> buildWorkorderBomRespVOList(List<MesProWorkorderBomDO> list) { | 94 | + private List<MesProWorkOrderBomRespVO> buildWorkOrderBomRespVOList(List<MesProWorkOrderBomDO> list) { |
| 95 | if (CollUtil.isEmpty(list)) { | 95 | if (CollUtil.isEmpty(list)) { |
| 96 | return Collections.emptyList(); | 96 | return Collections.emptyList(); |
| 97 | } | 97 | } |
| 98 | // 1. 批量获取关联数据 | 98 | // 1. 批量获取关联数据 |
| 99 | Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( | 99 | Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( |
| 100 | - convertSet(list, MesProWorkorderBomDO::getItemId)); | 100 | + convertSet(list, MesProWorkOrderBomDO::getItemId)); |
| 101 | Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( | 101 | Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( |
| 102 | - convertSet(list, MesProWorkorderBomDO::getUnitMeasureId)); | 102 | + convertSet(list, MesProWorkOrderBomDO::getUnitMeasureId)); |
| 103 | // 2. 拼接 VO | 103 | // 2. 拼接 VO |
| 104 | - return BeanUtils.toBean(list, MesProWorkorderBomRespVO.class, vo -> { | ||
| 105 | - MapUtils.findAndThen(itemMap, vo.getItemId(), item -> { | ||
| 106 | - // TODO @AI:少了 spec 字段?另外,改成链式调用; | ||
| 107 | - vo.setItemName(item.getName()); | ||
| 108 | - vo.setItemCode(item.getCode()); | ||
| 109 | - vo.setItemSpec(item.getSpec()); | ||
| 110 | - }); | 104 | + return BeanUtils.toBean(list, MesProWorkOrderBomRespVO.class, vo -> { |
| 105 | + MapUtils.findAndThen(itemMap, vo.getItemId(), item -> | ||
| 106 | + vo.setItemName(item.getName()).setItemCode(item.getCode()) | ||
| 107 | + .setItemSpec(item.getSpecification())); | ||
| 111 | MapUtils.findAndThen(unitMeasureMap, vo.getUnitMeasureId(), | 108 | MapUtils.findAndThen(unitMeasureMap, vo.getUnitMeasureId(), |
| 112 | unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName())); | 109 | unitMeasure -> vo.setUnitMeasureName(unitMeasure.getName())); |
| 113 | }); | 110 | }); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/MesProWorkorderController.java
| @@ -8,19 +8,19 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -8,19 +8,19 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 8 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 8 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 9 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 9 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 10 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | 10 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 11 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderPageReqVO; | ||
| 12 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderRespVO; | ||
| 13 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderSaveReqVO; | 11 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderPageReqVO; |
| 12 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderRespVO; | ||
| 13 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderSaveReqVO; | ||
| 14 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.client.MesMdClientDO; | 14 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.client.MesMdClientDO; |
| 15 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | 15 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| 16 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; | 16 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; |
| 17 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; | 17 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; |
| 18 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderDO; | 18 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderDO; |
| 19 | import cn.iocoder.yudao.module.mes.service.md.client.MesMdClientService; | 19 | import cn.iocoder.yudao.module.mes.service.md.client.MesMdClientService; |
| 20 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; | 20 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| 21 | import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; | 21 | import cn.iocoder.yudao.module.mes.service.md.unitmeasure.MesMdUnitMeasureService; |
| 22 | import cn.iocoder.yudao.module.mes.service.md.vendor.MesMdVendorService; | 22 | import cn.iocoder.yudao.module.mes.service.md.vendor.MesMdVendorService; |
| 23 | -import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkorderService; | 23 | +import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderService; |
| 24 | import io.swagger.v3.oas.annotations.Operation; | 24 | import io.swagger.v3.oas.annotations.Operation; |
| 25 | import io.swagger.v3.oas.annotations.Parameter; | 25 | import io.swagger.v3.oas.annotations.Parameter; |
| 26 | import io.swagger.v3.oas.annotations.tags.Tag; | 26 | import io.swagger.v3.oas.annotations.tags.Tag; |
| @@ -42,12 +42,12 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. | @@ -42,12 +42,12 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils. | ||
| 42 | 42 | ||
| 43 | @Tag(name = "管理后台 - MES 生产工单") | 43 | @Tag(name = "管理后台 - MES 生产工单") |
| 44 | @RestController | 44 | @RestController |
| 45 | -@RequestMapping("/mes/pro/workorder") | 45 | +@RequestMapping("/mes/pro/work-order") |
| 46 | @Validated | 46 | @Validated |
| 47 | -public class MesProWorkorderController { | 47 | +public class MesProWorkOrderController { |
| 48 | 48 | ||
| 49 | @Resource | 49 | @Resource |
| 50 | - private MesProWorkorderService workorderService; | 50 | + private MesProWorkOrderService workOrderService; |
| 51 | 51 | ||
| 52 | @Resource | 52 | @Resource |
| 53 | private MesMdItemService itemService; | 53 | private MesMdItemService itemService; |
| @@ -63,102 +63,98 @@ public class MesProWorkorderController { | @@ -63,102 +63,98 @@ public class MesProWorkorderController { | ||
| 63 | 63 | ||
| 64 | @PostMapping("/create") | 64 | @PostMapping("/create") |
| 65 | @Operation(summary = "创建生产工单") | 65 | @Operation(summary = "创建生产工单") |
| 66 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:create')") | ||
| 67 | - public CommonResult<Long> createWorkorder(@Valid @RequestBody MesProWorkorderSaveReqVO createReqVO) { | ||
| 68 | - return success(workorderService.createWorkorder(createReqVO)); | 66 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:create')") |
| 67 | + public CommonResult<Long> createWorkOrder(@Valid @RequestBody MesProWorkOrderSaveReqVO createReqVO) { | ||
| 68 | + return success(workOrderService.createWorkOrder(createReqVO)); | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | @PutMapping("/update") | 71 | @PutMapping("/update") |
| 72 | @Operation(summary = "更新生产工单") | 72 | @Operation(summary = "更新生产工单") |
| 73 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:update')") | ||
| 74 | - public CommonResult<Boolean> updateWorkorder(@Valid @RequestBody MesProWorkorderSaveReqVO updateReqVO) { | ||
| 75 | - workorderService.updateWorkorder(updateReqVO); | 73 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:update')") |
| 74 | + public CommonResult<Boolean> updateWorkOrder(@Valid @RequestBody MesProWorkOrderSaveReqVO updateReqVO) { | ||
| 75 | + workOrderService.updateWorkOrder(updateReqVO); | ||
| 76 | return success(true); | 76 | return success(true); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | @DeleteMapping("/delete") | 79 | @DeleteMapping("/delete") |
| 80 | @Operation(summary = "删除生产工单") | 80 | @Operation(summary = "删除生产工单") |
| 81 | @Parameter(name = "id", description = "编号", required = true) | 81 | @Parameter(name = "id", description = "编号", required = true) |
| 82 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:delete')") | ||
| 83 | - public CommonResult<Boolean> deleteWorkorder(@RequestParam("id") Long id) { | ||
| 84 | - workorderService.deleteWorkorder(id); | 82 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:delete')") |
| 83 | + public CommonResult<Boolean> deleteWorkOrder(@RequestParam("id") Long id) { | ||
| 84 | + workOrderService.deleteWorkOrder(id); | ||
| 85 | return success(true); | 85 | return success(true); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | @GetMapping("/get") | 88 | @GetMapping("/get") |
| 89 | @Operation(summary = "获得生产工单") | 89 | @Operation(summary = "获得生产工单") |
| 90 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 90 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 91 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:query')") | ||
| 92 | - public CommonResult<MesProWorkorderRespVO> getWorkorder(@RequestParam("id") Long id) { | ||
| 93 | - MesProWorkorderDO workorder = workorderService.getWorkorder(id); | ||
| 94 | - if (workorder == null) { | 91 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')") |
| 92 | + public CommonResult<MesProWorkOrderRespVO> getWorkOrder(@RequestParam("id") Long id) { | ||
| 93 | + MesProWorkOrderDO workOrder = workOrderService.getWorkOrder(id); | ||
| 94 | + if (workOrder == null) { | ||
| 95 | return success(null); | 95 | return success(null); |
| 96 | } | 96 | } |
| 97 | - return success(buildWorkorderRespVOList(List.of(workorder)).get(0)); | 97 | + return success(buildWorkOrderRespVOList(List.of(workOrder)).get(0)); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | @GetMapping("/page") | 100 | @GetMapping("/page") |
| 101 | @Operation(summary = "获得生产工单分页") | 101 | @Operation(summary = "获得生产工单分页") |
| 102 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:query')") | ||
| 103 | - public CommonResult<PageResult<MesProWorkorderRespVO>> getWorkorderPage(@Valid MesProWorkorderPageReqVO pageReqVO) { | ||
| 104 | - PageResult<MesProWorkorderDO> pageResult = workorderService.getWorkorderPage(pageReqVO); | ||
| 105 | - return success(new PageResult<>(buildWorkorderRespVOList(pageResult.getList()), pageResult.getTotal())); | 102 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')") |
| 103 | + public CommonResult<PageResult<MesProWorkOrderRespVO>> getWorkOrderPage(@Valid MesProWorkOrderPageReqVO pageReqVO) { | ||
| 104 | + PageResult<MesProWorkOrderDO> pageResult = workOrderService.getWorkOrderPage(pageReqVO); | ||
| 105 | + return success(new PageResult<>(buildWorkOrderRespVOList(pageResult.getList()), pageResult.getTotal())); | ||
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | @GetMapping("/export-excel") | 108 | @GetMapping("/export-excel") |
| 109 | @Operation(summary = "导出生产工单 Excel") | 109 | @Operation(summary = "导出生产工单 Excel") |
| 110 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:export')") | 110 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:export')") |
| 111 | @ApiAccessLog(operateType = EXPORT) | 111 | @ApiAccessLog(operateType = EXPORT) |
| 112 | - public void exportWorkorderExcel(@Valid MesProWorkorderPageReqVO pageReqVO, | 112 | + public void exportWorkOrderExcel(@Valid MesProWorkOrderPageReqVO pageReqVO, |
| 113 | HttpServletResponse response) throws IOException { | 113 | HttpServletResponse response) throws IOException { |
| 114 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | 114 | pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); |
| 115 | - List<MesProWorkorderDO> list = workorderService.getWorkorderPage(pageReqVO).getList(); | ||
| 116 | - List<MesProWorkorderRespVO> voList = buildWorkorderRespVOList(list); | ||
| 117 | - ExcelUtils.write(response, "生产工单.xls", "数据", MesProWorkorderRespVO.class, voList); | 115 | + List<MesProWorkOrderDO> list = workOrderService.getWorkOrderPage(pageReqVO).getList(); |
| 116 | + List<MesProWorkOrderRespVO> voList = buildWorkOrderRespVOList(list); | ||
| 117 | + ExcelUtils.write(response, "生产工单.xls", "数据", MesProWorkOrderRespVO.class, voList); | ||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | @PutMapping("/finish") | 120 | @PutMapping("/finish") |
| 121 | @Operation(summary = "完成工单") | 121 | @Operation(summary = "完成工单") |
| 122 | @Parameter(name = "id", description = "编号", required = true) | 122 | @Parameter(name = "id", description = "编号", required = true) |
| 123 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:update')") | ||
| 124 | - public CommonResult<Boolean> finishWorkorder(@RequestParam("id") Long id) { | ||
| 125 | - workorderService.finishWorkorder(id); | 123 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:update')") |
| 124 | + public CommonResult<Boolean> finishWorkOrder(@RequestParam("id") Long id) { | ||
| 125 | + workOrderService.finishWorkOrder(id); | ||
| 126 | return success(true); | 126 | return success(true); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | @PutMapping("/cancel") | 129 | @PutMapping("/cancel") |
| 130 | @Operation(summary = "取消工单") | 130 | @Operation(summary = "取消工单") |
| 131 | @Parameter(name = "id", description = "编号", required = true) | 131 | @Parameter(name = "id", description = "编号", required = true) |
| 132 | - @PreAuthorize("@ss.hasPermission('mes:pro-workorder:update')") | ||
| 133 | - public CommonResult<Boolean> cancelWorkorder(@RequestParam("id") Long id) { | ||
| 134 | - workorderService.cancelWorkorder(id); | 132 | + @PreAuthorize("@ss.hasPermission('mes:pro-work-order:update')") |
| 133 | + public CommonResult<Boolean> cancelWorkOrder(@RequestParam("id") Long id) { | ||
| 134 | + workOrderService.cancelWorkOrder(id); | ||
| 135 | return success(true); | 135 | return success(true); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | // ==================== 拼接 VO ==================== | 138 | // ==================== 拼接 VO ==================== |
| 139 | 139 | ||
| 140 | - @SuppressWarnings("CodeBlock2Expr") | ||
| 141 | - private List<MesProWorkorderRespVO> buildWorkorderRespVOList(List<MesProWorkorderDO> list) { | 140 | + private List<MesProWorkOrderRespVO> buildWorkOrderRespVOList(List<MesProWorkOrderDO> list) { |
| 142 | if (CollUtil.isEmpty(list)) { | 141 | if (CollUtil.isEmpty(list)) { |
| 143 | return Collections.emptyList(); | 142 | return Collections.emptyList(); |
| 144 | } | 143 | } |
| 145 | // 1. 批量获取关联数据 | 144 | // 1. 批量获取关联数据 |
| 146 | Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( | 145 | Map<Long, MesMdItemDO> itemMap = itemService.getItemMap( |
| 147 | - convertSet(list, MesProWorkorderDO::getProductId)); | 146 | + convertSet(list, MesProWorkOrderDO::getProductId)); |
| 148 | Map<Long, MesMdClientDO> clientMap = clientService.getClientMap( | 147 | Map<Long, MesMdClientDO> clientMap = clientService.getClientMap( |
| 149 | - convertSet(list, MesProWorkorderDO::getClientId)); | 148 | + convertSet(list, MesProWorkOrderDO::getClientId)); |
| 150 | Map<Long, MesMdVendorDO> vendorMap = vendorService.getVendorMap( | 149 | Map<Long, MesMdVendorDO> vendorMap = vendorService.getVendorMap( |
| 151 | - convertSet(list, MesProWorkorderDO::getVendorId)); | 150 | + convertSet(list, MesProWorkOrderDO::getVendorId)); |
| 152 | Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( | 151 | Map<Long, MesMdUnitMeasureDO> unitMeasureMap = unitMeasureService.getUnitMeasureMap( |
| 153 | - convertSet(list, MesProWorkorderDO::getUnitMeasureId)); | 152 | + convertSet(list, MesProWorkOrderDO::getUnitMeasureId)); |
| 154 | // 2. 拼接 VO | 153 | // 2. 拼接 VO |
| 155 | - return BeanUtils.toBean(list, MesProWorkorderRespVO.class, vo -> { | ||
| 156 | - MapUtils.findAndThen(itemMap, vo.getProductId(), item -> { | ||
| 157 | - // TODO @AI:少了 spec 字段?另外,改成链式调用; | ||
| 158 | - vo.setProductName(item.getName()); | ||
| 159 | - vo.setProductCode(item.getCode()); | ||
| 160 | - vo.setProductSpec(item.getSpec()); | ||
| 161 | - }); | 154 | + return BeanUtils.toBean(list, MesProWorkOrderRespVO.class, vo -> { |
| 155 | + MapUtils.findAndThen(itemMap, vo.getProductId(), item -> | ||
| 156 | + vo.setProductName(item.getName()).setProductCode(item.getCode()) | ||
| 157 | + .setProductSpec(item.getSpecification())); | ||
| 162 | MapUtils.findAndThen(clientMap, vo.getClientId(), | 158 | MapUtils.findAndThen(clientMap, vo.getClientId(), |
| 163 | client -> vo.setClientName(client.getName())); | 159 | client -> vo.setClientName(client.getName())); |
| 164 | MapUtils.findAndThen(vendorMap, vo.getVendorId(), | 160 | MapUtils.findAndThen(vendorMap, vo.getVendorId(), |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/MesProWorkorderPageReqVO.java
| @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 15 | @Data | 15 | @Data |
| 16 | @EqualsAndHashCode(callSuper = true) | 16 | @EqualsAndHashCode(callSuper = true) |
| 17 | @ToString(callSuper = true) | 17 | @ToString(callSuper = true) |
| 18 | -public class MesProWorkorderPageReqVO extends PageParam { | 18 | +public class MesProWorkOrderPageReqVO extends PageParam { |
| 19 | 19 | ||
| 20 | @Schema(description = "工单编码", example = "WO-001") | 20 | @Schema(description = "工单编码", example = "WO-001") |
| 21 | private String code; | 21 | private String code; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/MesProWorkorderRespVO.java
| @@ -14,7 +14,7 @@ import java.time.LocalDateTime; | @@ -14,7 +14,7 @@ import java.time.LocalDateTime; | ||
| 14 | @Schema(description = "管理后台 - MES 生产工单 Response VO") | 14 | @Schema(description = "管理后台 - MES 生产工单 Response VO") |
| 15 | @Data | 15 | @Data |
| 16 | @ExcelIgnoreUnannotated | 16 | @ExcelIgnoreUnannotated |
| 17 | -public class MesProWorkorderRespVO { | 17 | +public class MesProWorkOrderRespVO { |
| 18 | 18 | ||
| 19 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 19 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 20 | @ExcelProperty("编号") | 20 | @ExcelProperty("编号") |
| @@ -30,12 +30,12 @@ public class MesProWorkorderRespVO { | @@ -30,12 +30,12 @@ public class MesProWorkorderRespVO { | ||
| 30 | 30 | ||
| 31 | @Schema(description = "工单类型", example = "1") | 31 | @Schema(description = "工单类型", example = "1") |
| 32 | @ExcelProperty(value = "工单类型", converter = DictConvert.class) | 32 | @ExcelProperty(value = "工单类型", converter = DictConvert.class) |
| 33 | - @DictFormat(DictTypeConstants.MES_PRO_WORKORDER_TYPE) | 33 | + @DictFormat(DictTypeConstants.MES_PRO_WORK_ORDER_TYPE) |
| 34 | private Integer type; | 34 | private Integer type; |
| 35 | 35 | ||
| 36 | @Schema(description = "来源类型", example = "1") | 36 | @Schema(description = "来源类型", example = "1") |
| 37 | @ExcelProperty(value = "来源类型", converter = DictConvert.class) | 37 | @ExcelProperty(value = "来源类型", converter = DictConvert.class) |
| 38 | - @DictFormat(DictTypeConstants.MES_PRO_WORKORDER_SOURCE_TYPE) | 38 | + @DictFormat(DictTypeConstants.MES_PRO_WORK_ORDER_SOURCE_TYPE) |
| 39 | private Integer orderSourceType; | 39 | private Integer orderSourceType; |
| 40 | 40 | ||
| 41 | @Schema(description = "来源单据编号", example = "SO-001") | 41 | @Schema(description = "来源单据编号", example = "SO-001") |
| @@ -105,9 +105,6 @@ public class MesProWorkorderRespVO { | @@ -105,9 +105,6 @@ public class MesProWorkorderRespVO { | ||
| 105 | @Schema(description = "父工单编号", example = "0") | 105 | @Schema(description = "父工单编号", example = "0") |
| 106 | private Long parentId; | 106 | private Long parentId; |
| 107 | 107 | ||
| 108 | - @Schema(description = "所有父节点编号", example = "0") | ||
| 109 | - private String ancestors; | ||
| 110 | - | ||
| 111 | @Schema(description = "完成时间") | 108 | @Schema(description = "完成时间") |
| 112 | @ExcelProperty("完成时间") | 109 | @ExcelProperty("完成时间") |
| 113 | private LocalDateTime finishDate; | 110 | private LocalDateTime finishDate; |
| @@ -118,7 +115,7 @@ public class MesProWorkorderRespVO { | @@ -118,7 +115,7 @@ public class MesProWorkorderRespVO { | ||
| 118 | 115 | ||
| 119 | @Schema(description = "工单状态", example = "0") | 116 | @Schema(description = "工单状态", example = "0") |
| 120 | @ExcelProperty(value = "工单状态", converter = DictConvert.class) | 117 | @ExcelProperty(value = "工单状态", converter = DictConvert.class) |
| 121 | - @DictFormat(DictTypeConstants.MES_PRO_WORKORDER_STATUS) | 118 | + @DictFormat(DictTypeConstants.MES_PRO_WORK_ORDER_STATUS) |
| 122 | private Integer status; | 119 | private Integer status; |
| 123 | 120 | ||
| 124 | @Schema(description = "备注", example = "备注") | 121 | @Schema(description = "备注", example = "备注") |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/MesProWorkorderSaveReqVO.java
| @@ -10,7 +10,7 @@ import java.time.LocalDateTime; | @@ -10,7 +10,7 @@ import java.time.LocalDateTime; | ||
| 10 | 10 | ||
| 11 | @Schema(description = "管理后台 - MES 生产工单新增/修改 Request VO") | 11 | @Schema(description = "管理后台 - MES 生产工单新增/修改 Request VO") |
| 12 | @Data | 12 | @Data |
| 13 | -public class MesProWorkorderSaveReqVO { | 13 | +public class MesProWorkOrderSaveReqVO { |
| 14 | 14 | ||
| 15 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 15 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 16 | private Long id; | 16 | private Long id; |
| @@ -71,9 +71,6 @@ public class MesProWorkorderSaveReqVO { | @@ -71,9 +71,6 @@ public class MesProWorkorderSaveReqVO { | ||
| 71 | @Schema(description = "父工单编号", example = "0") | 71 | @Schema(description = "父工单编号", example = "0") |
| 72 | private Long parentId; | 72 | private Long parentId; |
| 73 | 73 | ||
| 74 | - @Schema(description = "所有父节点编号", example = "0") | ||
| 75 | - private String ancestors; | ||
| 76 | - | ||
| 77 | @Schema(description = "备注", example = "备注") | 74 | @Schema(description = "备注", example = "备注") |
| 78 | private String remark; | 75 | private String remark; |
| 79 | 76 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/bom/MesProWorkorderBomPageReqVO.java
| @@ -11,10 +11,10 @@ import lombok.ToString; | @@ -11,10 +11,10 @@ import lombok.ToString; | ||
| 11 | @Data | 11 | @Data |
| 12 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 13 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 14 | -public class MesProWorkorderBomPageReqVO extends PageParam { | 14 | +public class MesProWorkOrderBomPageReqVO extends PageParam { |
| 15 | 15 | ||
| 16 | @Schema(description = "生产工单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") | 16 | @Schema(description = "生产工单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") |
| 17 | @NotNull(message = "生产工单编号不能为空") | 17 | @NotNull(message = "生产工单编号不能为空") |
| 18 | - private Long workorderId; | 18 | + private Long workOrderId; |
| 19 | 19 | ||
| 20 | } | 20 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/bom/MesProWorkorderBomRespVO.java
| @@ -11,14 +11,14 @@ import java.time.LocalDateTime; | @@ -11,14 +11,14 @@ import java.time.LocalDateTime; | ||
| 11 | @Schema(description = "管理后台 - MES 生产工单 BOM Response VO") | 11 | @Schema(description = "管理后台 - MES 生产工单 BOM Response VO") |
| 12 | @Data | 12 | @Data |
| 13 | @ExcelIgnoreUnannotated | 13 | @ExcelIgnoreUnannotated |
| 14 | -public class MesProWorkorderBomRespVO { | 14 | +public class MesProWorkOrderBomRespVO { |
| 15 | 15 | ||
| 16 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 16 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 17 | @ExcelProperty("编号") | 17 | @ExcelProperty("编号") |
| 18 | private Long id; | 18 | private Long id; |
| 19 | 19 | ||
| 20 | @Schema(description = "生产工单编号", example = "100") | 20 | @Schema(description = "生产工单编号", example = "100") |
| 21 | - private Long workorderId; | 21 | + private Long workOrderId; |
| 22 | 22 | ||
| 23 | @Schema(description = "BOM 物料编号", example = "200") | 23 | @Schema(description = "BOM 物料编号", example = "200") |
| 24 | private Long itemId; | 24 | private Long itemId; |
| @@ -42,10 +42,6 @@ public class MesProWorkorderBomRespVO { | @@ -42,10 +42,6 @@ public class MesProWorkorderBomRespVO { | ||
| 42 | @ExcelProperty("单位") | 42 | @ExcelProperty("单位") |
| 43 | private String unitMeasureName; | 43 | private String unitMeasureName; |
| 44 | 44 | ||
| 45 | - @Schema(description = "物料产品标识", example = "ITEM") | ||
| 46 | - @ExcelProperty("物料产品标识") | ||
| 47 | - private String itemOrProduct; | ||
| 48 | - | ||
| 49 | @Schema(description = "预计使用量", example = "10.00") | 45 | @Schema(description = "预计使用量", example = "10.00") |
| 50 | @ExcelProperty("预计使用量") | 46 | @ExcelProperty("预计使用量") |
| 51 | private BigDecimal quantity; | 47 | private BigDecimal quantity; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/workorder/vo/bom/MesProWorkorderBomSaveReqVO.java
| 1 | package cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom; | 1 | package cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom; |
| 2 | 2 | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import jakarta.validation.constraints.NotEmpty; | ||
| 5 | import jakarta.validation.constraints.NotNull; | 4 | import jakarta.validation.constraints.NotNull; |
| 6 | import lombok.Data; | 5 | import lombok.Data; |
| 7 | 6 | ||
| @@ -9,14 +8,14 @@ import java.math.BigDecimal; | @@ -9,14 +8,14 @@ import java.math.BigDecimal; | ||
| 9 | 8 | ||
| 10 | @Schema(description = "管理后台 - MES 生产工单 BOM 新增/修改 Request VO") | 9 | @Schema(description = "管理后台 - MES 生产工单 BOM 新增/修改 Request VO") |
| 11 | @Data | 10 | @Data |
| 12 | -public class MesProWorkorderBomSaveReqVO { | 11 | +public class MesProWorkOrderBomSaveReqVO { |
| 13 | 12 | ||
| 14 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 13 | @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
| 15 | private Long id; | 14 | private Long id; |
| 16 | 15 | ||
| 17 | @Schema(description = "生产工单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") | 16 | @Schema(description = "生产工单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") |
| 18 | @NotNull(message = "生产工单编号不能为空") | 17 | @NotNull(message = "生产工单编号不能为空") |
| 19 | - private Long workorderId; | 18 | + private Long workOrderId; |
| 20 | 19 | ||
| 21 | @Schema(description = "BOM 物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "200") | 20 | @Schema(description = "BOM 物料编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "200") |
| 22 | @NotNull(message = "BOM 物料不能为空") | 21 | @NotNull(message = "BOM 物料不能为空") |
| @@ -26,10 +25,6 @@ public class MesProWorkorderBomSaveReqVO { | @@ -26,10 +25,6 @@ public class MesProWorkorderBomSaveReqVO { | ||
| 26 | @NotNull(message = "单位不能为空") | 25 | @NotNull(message = "单位不能为空") |
| 27 | private Long unitMeasureId; | 26 | private Long unitMeasureId; |
| 28 | 27 | ||
| 29 | - @Schema(description = "物料产品标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "ITEM") | ||
| 30 | - @NotEmpty(message = "物料产品标识不能为空") | ||
| 31 | - private String itemOrProduct; | ||
| 32 | - | ||
| 33 | @Schema(description = "预计使用量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.00") | 28 | @Schema(description = "预计使用量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10.00") |
| 34 | @NotNull(message = "预计使用量不能为空") | 29 | @NotNull(message = "预计使用量不能为空") |
| 35 | private BigDecimal quantity; | 30 | private BigDecimal quantity; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/MesQcDefectController.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/defect/MesQcDefectController.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.defect; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | 3 | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| @@ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 8 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | 8 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 9 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectPageReqVO; | ||
| 10 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectRespVO; | ||
| 11 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectSaveReqVO; | 9 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectPageReqVO; |
| 10 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectRespVO; | ||
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectSaveReqVO; | ||
| 12 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; | 12 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; |
| 13 | import cn.iocoder.yudao.module.mes.service.qc.MesQcDefectService; | 13 | import cn.iocoder.yudao.module.mes.service.qc.MesQcDefectService; |
| 14 | import io.swagger.v3.oas.annotations.Operation; | 14 | import io.swagger.v3.oas.annotations.Operation; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/vo/MesQcDefectPageReqVO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/defect/vo/MesQcDefectPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc.vo; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/vo/MesQcDefectRespVO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/defect/vo/MesQcDefectRespVO.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc.vo; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/vo/MesQcDefectSaveReqVO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/defect/vo/MesQcDefectSaveReqVO.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc.vo; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import jakarta.validation.constraints.NotEmpty; | 4 | import jakarta.validation.constraints.NotEmpty; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/MesQcIndicatorController.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/indicator/MesQcIndicatorController.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.indicator; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | 3 | import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| @@ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | @@ -6,9 +6,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 7 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 8 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | 8 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 9 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorPageReqVO; | ||
| 10 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorRespVO; | ||
| 11 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorSaveReqVO; | 9 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorPageReqVO; |
| 10 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorRespVO; | ||
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorSaveReqVO; | ||
| 12 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; | 12 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; |
| 13 | import cn.iocoder.yudao.module.mes.service.qc.MesQcIndicatorService; | 13 | import cn.iocoder.yudao.module.mes.service.qc.MesQcIndicatorService; |
| 14 | import io.swagger.v3.oas.annotations.Operation; | 14 | import io.swagger.v3.oas.annotations.Operation; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/vo/MesQcIndicatorPageReqVO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/indicator/vo/MesQcIndicatorPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc.vo; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/vo/MesQcIndicatorRespVO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/indicator/vo/MesQcIndicatorRespVO.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc.vo; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | 3 | import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; |
| 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | 4 | import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/vo/MesQcIndicatorSaveReqVO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/indicator/vo/MesQcIndicatorSaveReqVO.java
| 1 | -package cn.iocoder.yudao.module.mes.controller.admin.qc.vo; | 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo; |
| 2 | 2 | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import jakarta.validation.constraints.NotEmpty; | 4 | import jakarta.validation.constraints.NotEmpty; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/MesQcTemplateController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; | ||
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 7 | +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||
| 8 | +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 9 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.MesQcTemplatePageReqVO; | ||
| 10 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.MesQcTemplateRespVO; | ||
| 11 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.MesQcTemplateSaveReqVO; | ||
| 12 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator.MesQcTemplateIndicatorPageReqVO; | ||
| 13 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator.MesQcTemplateIndicatorRespVO; | ||
| 14 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator.MesQcTemplateIndicatorSaveReqVO; | ||
| 15 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemPageReqVO; | ||
| 16 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemRespVO; | ||
| 17 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item.MesQcTemplateItemSaveReqVO; | ||
| 18 | +import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateDO; | ||
| 19 | +import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateIndicatorDO; | ||
| 20 | +import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcTemplateItemDO; | ||
| 21 | +import cn.iocoder.yudao.module.mes.service.qc.MesQcTemplateService; | ||
| 22 | +import io.swagger.v3.oas.annotations.Operation; | ||
| 23 | +import io.swagger.v3.oas.annotations.Parameter; | ||
| 24 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 25 | +import jakarta.annotation.Resource; | ||
| 26 | +import jakarta.servlet.http.HttpServletResponse; | ||
| 27 | +import jakarta.validation.Valid; | ||
| 28 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 29 | +import org.springframework.validation.annotation.Validated; | ||
| 30 | +import org.springframework.web.bind.annotation.*; | ||
| 31 | + | ||
| 32 | +import java.io.IOException; | ||
| 33 | +import java.util.List; | ||
| 34 | + | ||
| 35 | +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; | ||
| 36 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 37 | + | ||
| 38 | +@Tag(name = "管理后台 - MES 质检方案") | ||
| 39 | +@RestController | ||
| 40 | +@RequestMapping("/mes/qc/template") | ||
| 41 | +@Validated | ||
| 42 | +public class MesQcTemplateController { | ||
| 43 | + | ||
| 44 | + @Resource | ||
| 45 | + private MesQcTemplateService templateService; | ||
| 46 | + | ||
| 47 | + // ========== 质检方案主表 ========== | ||
| 48 | + | ||
| 49 | + @PostMapping("/create") | ||
| 50 | + @Operation(summary = "创建质检方案") | ||
| 51 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:create')") | ||
| 52 | + public CommonResult<Long> createTemplate(@Valid @RequestBody MesQcTemplateSaveReqVO createReqVO) { | ||
| 53 | + return success(templateService.createTemplate(createReqVO)); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + @PutMapping("/update") | ||
| 57 | + @Operation(summary = "更新质检方案") | ||
| 58 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:update')") | ||
| 59 | + public CommonResult<Boolean> updateTemplate(@Valid @RequestBody MesQcTemplateSaveReqVO updateReqVO) { | ||
| 60 | + templateService.updateTemplate(updateReqVO); | ||
| 61 | + return success(true); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + @DeleteMapping("/delete") | ||
| 65 | + @Operation(summary = "删除质检方案") | ||
| 66 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 67 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:delete')") | ||
| 68 | + public CommonResult<Boolean> deleteTemplate(@RequestParam("id") Long id) { | ||
| 69 | + templateService.deleteTemplate(id); | ||
| 70 | + return success(true); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + @GetMapping("/get") | ||
| 74 | + @Operation(summary = "获得质检方案") | ||
| 75 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 76 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") | ||
| 77 | + public CommonResult<MesQcTemplateRespVO> getTemplate(@RequestParam("id") Long id) { | ||
| 78 | + MesQcTemplateDO template = templateService.getTemplate(id); | ||
| 79 | + return success(BeanUtils.toBean(template, MesQcTemplateRespVO.class)); | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @GetMapping("/page") | ||
| 83 | + @Operation(summary = "获得质检方案分页") | ||
| 84 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") | ||
| 85 | + public CommonResult<PageResult<MesQcTemplateRespVO>> getTemplatePage(@Valid MesQcTemplatePageReqVO pageReqVO) { | ||
| 86 | + PageResult<MesQcTemplateDO> pageResult = templateService.getTemplatePage(pageReqVO); | ||
| 87 | + return success(BeanUtils.toBean(pageResult, MesQcTemplateRespVO.class)); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @GetMapping("/simple-list") | ||
| 91 | + @Operation(summary = "获得质检方案精简列表", description = "主要用于前端的下拉选项") | ||
| 92 | + public CommonResult<List<MesQcTemplateRespVO>> getTemplateSimpleList() { | ||
| 93 | + List<MesQcTemplateDO> list = templateService.getTemplateList(); | ||
| 94 | + return success(BeanUtils.toBean(list, MesQcTemplateRespVO.class)); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + @GetMapping("/export-excel") | ||
| 98 | + @Operation(summary = "导出质检方案 Excel") | ||
| 99 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:export')") | ||
| 100 | + @ApiAccessLog(operateType = EXPORT) | ||
| 101 | + public void exportTemplateExcel(@Valid MesQcTemplatePageReqVO pageReqVO, | ||
| 102 | + HttpServletResponse response) throws IOException { | ||
| 103 | + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); | ||
| 104 | + List<MesQcTemplateDO> list = templateService.getTemplatePage(pageReqVO).getList(); | ||
| 105 | + ExcelUtils.write(response, "质检方案.xls", "数据", MesQcTemplateRespVO.class, | ||
| 106 | + BeanUtils.toBean(list, MesQcTemplateRespVO.class)); | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + // ========== 质检方案-检测指标项 ========== | ||
| 110 | + | ||
| 111 | + // TODO @AI:是不是拆分成独立的 controller;类似别的模块 | ||
| 112 | + | ||
| 113 | + @PostMapping("/indicator/create") | ||
| 114 | + @Operation(summary = "创建质检方案-检测指标项") | ||
| 115 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:create')") | ||
| 116 | + public CommonResult<Long> createTemplateIndicator(@Valid @RequestBody MesQcTemplateIndicatorSaveReqVO createReqVO) { | ||
| 117 | + return success(templateService.createTemplateIndicator(createReqVO)); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + @PutMapping("/indicator/update") | ||
| 121 | + @Operation(summary = "更新质检方案-检测指标项") | ||
| 122 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:update')") | ||
| 123 | + public CommonResult<Boolean> updateTemplateIndicator(@Valid @RequestBody MesQcTemplateIndicatorSaveReqVO updateReqVO) { | ||
| 124 | + templateService.updateTemplateIndicator(updateReqVO); | ||
| 125 | + return success(true); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + @DeleteMapping("/indicator/delete") | ||
| 129 | + @Operation(summary = "删除质检方案-检测指标项") | ||
| 130 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 131 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:update')") | ||
| 132 | + public CommonResult<Boolean> deleteTemplateIndicator(@RequestParam("id") Long id) { | ||
| 133 | + templateService.deleteTemplateIndicator(id); | ||
| 134 | + return success(true); | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + @GetMapping("/indicator/get") | ||
| 138 | + @Operation(summary = "获得质检方案-检测指标项") | ||
| 139 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 140 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") | ||
| 141 | + public CommonResult<MesQcTemplateIndicatorRespVO> getTemplateIndicator(@RequestParam("id") Long id) { | ||
| 142 | + MesQcTemplateIndicatorDO indicator = templateService.getTemplateIndicator(id); | ||
| 143 | + return success(BeanUtils.toBean(indicator, MesQcTemplateIndicatorRespVO.class)); | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + @GetMapping("/indicator/page") | ||
| 147 | + @Operation(summary = "获得质检方案-检测指标项分页") | ||
| 148 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") | ||
| 149 | + public CommonResult<PageResult<MesQcTemplateIndicatorRespVO>> getTemplateIndicatorPage( | ||
| 150 | + @Valid MesQcTemplateIndicatorPageReqVO pageReqVO) { | ||
| 151 | + PageResult<MesQcTemplateIndicatorDO> pageResult = templateService.getTemplateIndicatorPage(pageReqVO); | ||
| 152 | + return success(BeanUtils.toBean(pageResult, MesQcTemplateIndicatorRespVO.class)); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + // ========== 质检方案-产品关联 ========== | ||
| 156 | + | ||
| 157 | + // TODO @AI:是不是拆分成独立的 controller;类似别的模块 | ||
| 158 | + | ||
| 159 | + @PostMapping("/item/create") | ||
| 160 | + @Operation(summary = "创建质检方案-产品关联") | ||
| 161 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:create')") | ||
| 162 | + public CommonResult<Long> createTemplateItem(@Valid @RequestBody MesQcTemplateItemSaveReqVO createReqVO) { | ||
| 163 | + return success(templateService.createTemplateItem(createReqVO)); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + @PutMapping("/item/update") | ||
| 167 | + @Operation(summary = "更新质检方案-产品关联") | ||
| 168 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:update')") | ||
| 169 | + public CommonResult<Boolean> updateTemplateItem(@Valid @RequestBody MesQcTemplateItemSaveReqVO updateReqVO) { | ||
| 170 | + templateService.updateTemplateItem(updateReqVO); | ||
| 171 | + return success(true); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + @DeleteMapping("/item/delete") | ||
| 175 | + @Operation(summary = "删除质检方案-产品关联") | ||
| 176 | + @Parameter(name = "id", description = "编号", required = true) | ||
| 177 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:update')") | ||
| 178 | + public CommonResult<Boolean> deleteTemplateItem(@RequestParam("id") Long id) { | ||
| 179 | + templateService.deleteTemplateItem(id); | ||
| 180 | + return success(true); | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + @GetMapping("/item/get") | ||
| 184 | + @Operation(summary = "获得质检方案-产品关联") | ||
| 185 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||
| 186 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") | ||
| 187 | + public CommonResult<MesQcTemplateItemRespVO> getTemplateItem(@RequestParam("id") Long id) { | ||
| 188 | + MesQcTemplateItemDO item = templateService.getTemplateItem(id); | ||
| 189 | + return success(BeanUtils.toBean(item, MesQcTemplateItemRespVO.class)); | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + @GetMapping("/item/page") | ||
| 193 | + @Operation(summary = "获得质检方案-产品关联分页") | ||
| 194 | + @PreAuthorize("@ss.hasPermission('mes:qc-template:query')") | ||
| 195 | + public CommonResult<PageResult<MesQcTemplateItemRespVO>> getTemplateItemPage( | ||
| 196 | + @Valid MesQcTemplateItemPageReqVO pageReqVO) { | ||
| 197 | + PageResult<MesQcTemplateItemDO> pageResult = templateService.getTemplateItemPage(pageReqVO); | ||
| 198 | + return success(BeanUtils.toBean(pageResult, MesQcTemplateItemRespVO.class)); | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/MesQcTemplatePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 质检方案分页 Request VO") | ||
| 10 | +@Data | ||
| 11 | +@EqualsAndHashCode(callSuper = true) | ||
| 12 | +@ToString(callSuper = true) | ||
| 13 | +public class MesQcTemplatePageReqVO extends PageParam { | ||
| 14 | + | ||
| 15 | + @Schema(description = "方案编号", example = "QCT001") | ||
| 16 | + private String code; | ||
| 17 | + | ||
| 18 | + @Schema(description = "方案名称", example = "出货检验") | ||
| 19 | + private String name; | ||
| 20 | + | ||
| 21 | + // TODO @AI:会用 List<String> | ||
| 22 | + @Schema(description = "检测种类(模糊匹配)", example = "IQC") | ||
| 23 | + private String types; | ||
| 24 | + | ||
| 25 | + // TODO @AI:使用 Boolean; | ||
| 26 | + @Schema(description = "是否启用(Y/N)", example = "Y") | ||
| 27 | + private String enableFlag; | ||
| 28 | + | ||
| 29 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/MesQcTemplateRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.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 MesQcTemplateRespVO { | ||
| 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 = "QCT001") | ||
| 20 | + @ExcelProperty("方案编号") | ||
| 21 | + private String code; | ||
| 22 | + | ||
| 23 | + @Schema(description = "方案名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "成品出货检验方案") | ||
| 24 | + @ExcelProperty("方案名称") | ||
| 25 | + private String name; | ||
| 26 | + | ||
| 27 | + // TODO @AI:会用 List<String>;这里不用 (逗号分隔:IQC,IPQC,OQC,RQC) 注释; | ||
| 28 | + @Schema(description = "检测种类(逗号分隔:IQC,IPQC,OQC,RQC)", requiredMode = Schema.RequiredMode.REQUIRED, example = "IQC,OQC") | ||
| 29 | + @ExcelProperty("检测种类") | ||
| 30 | + private String types; | ||
| 31 | + | ||
| 32 | + // TODO @AI:Boolean; | ||
| 33 | + @Schema(description = "是否启用(Y/N)", requiredMode = Schema.RequiredMode.REQUIRED, example = "Y") | ||
| 34 | + @ExcelProperty("是否启用") | ||
| 35 | + private String enableFlag; | ||
| 36 | + | ||
| 37 | + @Schema(description = "备注", example = "备注") | ||
| 38 | + @ExcelProperty("备注") | ||
| 39 | + private String remark; | ||
| 40 | + | ||
| 41 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 42 | + @ExcelProperty("创建时间") | ||
| 43 | + private LocalDateTime createTime; | ||
| 44 | + | ||
| 45 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/MesQcTemplateSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import jakarta.validation.constraints.NotEmpty; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +@Schema(description = "管理后台 - MES 质检方案新增/修改 Request VO") | ||
| 8 | +@Data | ||
| 9 | +public class MesQcTemplateSaveReqVO { | ||
| 10 | + | ||
| 11 | + @Schema(description = "编号", example = "1024") | ||
| 12 | + private Long id; | ||
| 13 | + | ||
| 14 | + @Schema(description = "方案编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "QCT001") | ||
| 15 | + @NotEmpty(message = "方案编号不能为空") | ||
| 16 | + private String code; | ||
| 17 | + | ||
| 18 | + @Schema(description = "方案名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "成品出货检验方案") | ||
| 19 | + @NotEmpty(message = "方案名称不能为空") | ||
| 20 | + private String name; | ||
| 21 | + | ||
| 22 | + // TODO @AI:会用 List<String>;这里不用 (逗号分隔:IQC,IPQC,OQC,RQC) 注释; | ||
| 23 | + @Schema(description = "检测种类(逗号分隔:IQC,IPQC,OQC,RQC)", requiredMode = Schema.RequiredMode.REQUIRED, example = "IQC,OQC") | ||
| 24 | + @NotEmpty(message = "检测种类不能为空") | ||
| 25 | + private String types; | ||
| 26 | + | ||
| 27 | + // TODO @AI:Boolean; | ||
| 28 | + @Schema(description = "是否启用(Y/N)", requiredMode = Schema.RequiredMode.REQUIRED, example = "Y") | ||
| 29 | + @NotEmpty(message = "是否启用不能为空") | ||
| 30 | + private String enableFlag; | ||
| 31 | + | ||
| 32 | + @Schema(description = "备注", example = "备注") | ||
| 33 | + private String remark; | ||
| 34 | + | ||
| 35 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/indicator/MesQcTemplateIndicatorPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import jakarta.validation.constraints.NotNull; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.ToString; | ||
| 9 | + | ||
| 10 | +@Schema(description = "管理后台 - MES 质检方案-检测指标项分页 Request VO") | ||
| 11 | +@Data | ||
| 12 | +@EqualsAndHashCode(callSuper = true) | ||
| 13 | +@ToString(callSuper = true) | ||
| 14 | +public class MesQcTemplateIndicatorPageReqVO extends PageParam { | ||
| 15 | + | ||
| 16 | + @Schema(description = "质检方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 17 | + @NotNull(message = "质检方案ID不能为空") | ||
| 18 | + private Long templateId; | ||
| 19 | + | ||
| 20 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/indicator/MesQcTemplateIndicatorRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator; | ||
| 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.math.BigDecimal; | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | + | ||
| 11 | +@Schema(description = "管理后台 - MES 质检方案-检测指标项 Response VO") | ||
| 12 | +@Data | ||
| 13 | +@ExcelIgnoreUnannotated | ||
| 14 | +public class MesQcTemplateIndicatorRespVO { | ||
| 15 | + | ||
| 16 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 17 | + @ExcelProperty("编号") | ||
| 18 | + private Long id; | ||
| 19 | + | ||
| 20 | + @Schema(description = "质检方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 21 | + private Long templateId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "质检指标ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 24 | + @ExcelProperty("质检指标ID") | ||
| 25 | + private Long indicatorId; | ||
| 26 | + | ||
| 27 | + @Schema(description = "检测方法/检测要求", example = "目视检查外观") | ||
| 28 | + @ExcelProperty("检测方法") | ||
| 29 | + private String checkMethod; | ||
| 30 | + | ||
| 31 | + @Schema(description = "标准值", example = "10.0000") | ||
| 32 | + @ExcelProperty("标准值") | ||
| 33 | + private BigDecimal standardValue; | ||
| 34 | + | ||
| 35 | + @Schema(description = "单位", example = "mm") | ||
| 36 | + @ExcelProperty("单位") | ||
| 37 | + private String unit; | ||
| 38 | + | ||
| 39 | + @Schema(description = "误差上限", example = "10.5000") | ||
| 40 | + @ExcelProperty("误差上限") | ||
| 41 | + private BigDecimal thresholdMax; | ||
| 42 | + | ||
| 43 | + @Schema(description = "误差下限", example = "9.5000") | ||
| 44 | + @ExcelProperty("误差下限") | ||
| 45 | + private BigDecimal thresholdMin; | ||
| 46 | + | ||
| 47 | + @Schema(description = "说明图URL", example = "https://example.com/doc.png") | ||
| 48 | + private String docUrl; | ||
| 49 | + | ||
| 50 | + @Schema(description = "备注", example = "备注") | ||
| 51 | + @ExcelProperty("备注") | ||
| 52 | + private String remark; | ||
| 53 | + | ||
| 54 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 55 | + @ExcelProperty("创建时间") | ||
| 56 | + private LocalDateTime createTime; | ||
| 57 | + | ||
| 58 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/indicator/MesQcTemplateIndicatorSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.indicator; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import jakarta.validation.constraints.NotNull; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.math.BigDecimal; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 质检方案-检测指标项新增/修改 Request VO") | ||
| 10 | +@Data | ||
| 11 | +public class MesQcTemplateIndicatorSaveReqVO { | ||
| 12 | + | ||
| 13 | + @Schema(description = "编号", example = "1024") | ||
| 14 | + private Long id; | ||
| 15 | + | ||
| 16 | + @Schema(description = "质检方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 17 | + @NotNull(message = "质检方案ID不能为空") | ||
| 18 | + private Long templateId; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * TODO @芋艿:等 qc_indicator 完成后,改为选择器,此处改为 @NotNull 强校验 | ||
| 22 | + */ | ||
| 23 | + @Schema(description = "质检指标ID(关联 mes_qc_indicator)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 24 | + @NotNull(message = "质检指标ID不能为空") | ||
| 25 | + private Long indicatorId; | ||
| 26 | + | ||
| 27 | + @Schema(description = "检测方法/检测要求", example = "目视检查外观") | ||
| 28 | + private String checkMethod; | ||
| 29 | + | ||
| 30 | + @Schema(description = "标准值", example = "10.0000") | ||
| 31 | + private BigDecimal standardValue; | ||
| 32 | + | ||
| 33 | + @Schema(description = "单位", example = "mm") | ||
| 34 | + private String unit; | ||
| 35 | + | ||
| 36 | + @Schema(description = "误差上限", example = "10.5000") | ||
| 37 | + private BigDecimal thresholdMax; | ||
| 38 | + | ||
| 39 | + @Schema(description = "误差下限", example = "9.5000") | ||
| 40 | + private BigDecimal thresholdMin; | ||
| 41 | + | ||
| 42 | + @Schema(description = "说明图URL", example = "https://example.com/doc.png") | ||
| 43 | + private String docUrl; | ||
| 44 | + | ||
| 45 | + @Schema(description = "备注", example = "备注") | ||
| 46 | + private String remark; | ||
| 47 | + | ||
| 48 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/item/MesQcTemplateItemPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import jakarta.validation.constraints.NotNull; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.ToString; | ||
| 9 | + | ||
| 10 | +@Schema(description = "管理后台 - MES 质检方案-产品关联分页 Request VO") | ||
| 11 | +@Data | ||
| 12 | +@EqualsAndHashCode(callSuper = true) | ||
| 13 | +@ToString(callSuper = true) | ||
| 14 | +public class MesQcTemplateItemPageReqVO extends PageParam { | ||
| 15 | + | ||
| 16 | + @Schema(description = "质检方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 17 | + @NotNull(message = "质检方案ID不能为空") | ||
| 18 | + private Long templateId; | ||
| 19 | + | ||
| 20 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/item/MesQcTemplateItemRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item; | ||
| 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.math.BigDecimal; | ||
| 9 | +import java.time.LocalDateTime; | ||
| 10 | + | ||
| 11 | +@Schema(description = "管理后台 - MES 质检方案-产品关联 Response VO") | ||
| 12 | +@Data | ||
| 13 | +@ExcelIgnoreUnannotated | ||
| 14 | +public class MesQcTemplateItemRespVO { | ||
| 15 | + | ||
| 16 | + @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 17 | + @ExcelProperty("编号") | ||
| 18 | + private Long id; | ||
| 19 | + | ||
| 20 | + @Schema(description = "质检方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 21 | + private Long templateId; | ||
| 22 | + | ||
| 23 | + @Schema(description = "产品物料ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 24 | + @ExcelProperty("产品物料ID") | ||
| 25 | + private Long itemId; | ||
| 26 | + | ||
| 27 | + @Schema(description = "最低检测数", example = "5") | ||
| 28 | + @ExcelProperty("最低检测数") | ||
| 29 | + private Integer quantityCheck; | ||
| 30 | + | ||
| 31 | + // TODO @AI:VO 里,(0=不启用) 去掉 | ||
| 32 | + @Schema(description = "最大不合格数(0=不启用)", example = "0") | ||
| 33 | + @ExcelProperty("最大不合格数") | ||
| 34 | + private Integer quantityUnqualified; | ||
| 35 | + | ||
| 36 | + // TODO @AI:VO 里,(0=不允许) 去掉 | ||
| 37 | + @Schema(description = "最大致命缺陷率(%,0=不允许)", example = "0") | ||
| 38 | + @ExcelProperty("致命缺陷率%") | ||
| 39 | + private BigDecimal criticalRate; | ||
| 40 | + | ||
| 41 | + // TODO @AI:VO 里,(0=不允许) 去掉 | ||
| 42 | + @Schema(description = "最大严重缺陷率(%,0=不允许)", example = "0") | ||
| 43 | + @ExcelProperty("严重缺陷率%") | ||
| 44 | + private BigDecimal majorRate; | ||
| 45 | + | ||
| 46 | + @Schema(description = "最大轻微缺陷率(%)", example = "100") | ||
| 47 | + @ExcelProperty("轻微缺陷率%") | ||
| 48 | + private BigDecimal minorRate; | ||
| 49 | + | ||
| 50 | + @Schema(description = "备注", example = "备注") | ||
| 51 | + @ExcelProperty("备注") | ||
| 52 | + private String remark; | ||
| 53 | + | ||
| 54 | + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 55 | + @ExcelProperty("创建时间") | ||
| 56 | + private LocalDateTime createTime; | ||
| 57 | + | ||
| 58 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/qc/template/vo/item/MesQcTemplateItemSaveReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.mes.controller.admin.qc.template.vo.item; | ||
| 2 | + | ||
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | +import jakarta.validation.constraints.NotNull; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.math.BigDecimal; | ||
| 8 | + | ||
| 9 | +@Schema(description = "管理后台 - MES 质检方案-产品关联新增/修改 Request VO") | ||
| 10 | +@Data | ||
| 11 | +public class MesQcTemplateItemSaveReqVO { | ||
| 12 | + | ||
| 13 | + @Schema(description = "编号", example = "1024") | ||
| 14 | + private Long id; | ||
| 15 | + | ||
| 16 | + @Schema(description = "质检方案ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 17 | + @NotNull(message = "质检方案ID不能为空") | ||
| 18 | + private Long templateId; | ||
| 19 | + | ||
| 20 | + @Schema(description = "产品物料ID(关联 mes_md_item)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 21 | + @NotNull(message = "产品物料ID不能为空") | ||
| 22 | + private Long itemId; | ||
| 23 | + | ||
| 24 | + @Schema(description = "最低检测数", example = "5") | ||
| 25 | + private Integer quantityCheck; | ||
| 26 | + | ||
| 27 | + // TODO @AI:VO 里,(0=不启用) 去掉 | ||
| 28 | + @Schema(description = "最大不合格数(0=不启用)", example = "0") | ||
| 29 | + private Integer quantityUnqualified; | ||
| 30 | + | ||
| 31 | + // TODO @AI:VO 里,(0=不允许) 去掉 | ||
| 32 | + @Schema(description = "最大致命缺陷率(%,0=不允许)", example = "0") | ||
| 33 | + private BigDecimal criticalRate; | ||
| 34 | + | ||
| 35 | + // TODO @AI:VO 里,(0=不允许) 去掉 | ||
| 36 | + @Schema(description = "最大严重缺陷率(%,0=不允许)", example = "0") | ||
| 37 | + private BigDecimal majorRate; | ||
| 38 | + | ||
| 39 | + @Schema(description = "最大轻微缺陷率(%)", example = "100") | ||
| 40 | + private BigDecimal minorRate; | ||
| 41 | + | ||
| 42 | + @Schema(description = "备注", example = "备注") | ||
| 43 | + private String remark; | ||
| 44 | + | ||
| 45 | +} |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/MesCalPlanDO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/plan/MesCalPlanDO.java
| 1 | -package cn.iocoder.yudao.module.mes.dal.dataobject.cal; | 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalCalendarTypeEnum; | 4 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalCalendarTypeEnum; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/MesCalPlanShiftDO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/plan/MesCalPlanShiftDO.java
| 1 | -package cn.iocoder.yudao.module.mes.dal.dataobject.cal; | 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | import com.baomidou.mybatisplus.annotation.KeySequence; | 4 | import com.baomidou.mybatisplus.annotation.KeySequence; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/MesCalPlanTeamDO.java renamed to yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/cal/plan/MesCalPlanTeamDO.java
| 1 | -package cn.iocoder.yudao.module.mes.dal.dataobject.cal; | 1 | +package cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | import com.baomidou.mybatisplus.annotation.KeySequence; | 4 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| @@ -35,7 +35,7 @@ public class MesCalPlanTeamDO extends BaseDO { | @@ -35,7 +35,7 @@ public class MesCalPlanTeamDO extends BaseDO { | ||
| 35 | /** | 35 | /** |
| 36 | * 班组编号 | 36 | * 班组编号 |
| 37 | * | 37 | * |
| 38 | - * TODO @芋艿:关联 cal_team 表,等 cal_team 迁移后补充 | 38 | + * TODO @AI:关联 cal_team 表,等 cal_team 迁移后补充 |
| 39 | */ | 39 | */ |
| 40 | private Long teamId; | 40 | private Long teamId; |
| 41 | /** | 41 | /** |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/pro/workorder/MesProWorkorderBomDO.java
| @@ -15,15 +15,15 @@ import java.math.BigDecimal; | @@ -15,15 +15,15 @@ import java.math.BigDecimal; | ||
| 15 | * | 15 | * |
| 16 | * @author 芋道源码 | 16 | * @author 芋道源码 |
| 17 | */ | 17 | */ |
| 18 | -@TableName("mes_pro_workorder_bom") | ||
| 19 | -@KeySequence("mes_pro_workorder_bom_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | 18 | +@TableName("mes_pro_work_order_bom") |
| 19 | +@KeySequence("mes_pro_work_order_bom_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 20 | @Data | 20 | @Data |
| 21 | @EqualsAndHashCode(callSuper = true) | 21 | @EqualsAndHashCode(callSuper = true) |
| 22 | @ToString(callSuper = true) | 22 | @ToString(callSuper = true) |
| 23 | @Builder | 23 | @Builder |
| 24 | @NoArgsConstructor | 24 | @NoArgsConstructor |
| 25 | @AllArgsConstructor | 25 | @AllArgsConstructor |
| 26 | -public class MesProWorkorderBomDO extends BaseDO { | 26 | +public class MesProWorkOrderBomDO extends BaseDO { |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 编号 | 29 | * 编号 |
| @@ -33,9 +33,9 @@ public class MesProWorkorderBomDO extends BaseDO { | @@ -33,9 +33,9 @@ public class MesProWorkorderBomDO extends BaseDO { | ||
| 33 | /** | 33 | /** |
| 34 | * 生产工单编号 | 34 | * 生产工单编号 |
| 35 | * | 35 | * |
| 36 | - * 关联 {@link MesProWorkorderDO#getId()} | 36 | + * 关联 {@link MesProWorkOrderDO#getId()} |
| 37 | */ | 37 | */ |
| 38 | - private Long workorderId; | 38 | + private Long workOrderId; |
| 39 | /** | 39 | /** |
| 40 | * BOM 物料编号 | 40 | * BOM 物料编号 |
| 41 | * | 41 | * |
| @@ -48,11 +48,6 @@ public class MesProWorkorderBomDO extends BaseDO { | @@ -48,11 +48,6 @@ public class MesProWorkorderBomDO extends BaseDO { | ||
| 48 | * 关联 {@link MesMdUnitMeasureDO#getId()} | 48 | * 关联 {@link MesMdUnitMeasureDO#getId()} |
| 49 | */ | 49 | */ |
| 50 | private Long unitMeasureId; | 50 | private Long unitMeasureId; |
| 51 | - // TODO @AI:需要存储么?还是使用 itemId 的冗余? | ||
| 52 | - /** | ||
| 53 | - * 物料产品标识 | ||
| 54 | - */ | ||
| 55 | - private String itemOrProduct; | ||
| 56 | /** | 51 | /** |
| 57 | * 预计使用量 | 52 | * 预计使用量 |
| 58 | */ | 53 | */ |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/dataobject/pro/workorder/MesProWorkorderDO.java
| @@ -5,9 +5,9 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.md.client.MesMdClientDO; | @@ -5,9 +5,9 @@ import cn.iocoder.yudao.module.mes.dal.dataobject.md.client.MesMdClientDO; | ||
| 5 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | 5 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.unitmeasure.MesMdUnitMeasureDO; |
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.vendor.MesMdVendorDO; |
| 8 | -import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkorderSourceTypeEnum; | ||
| 9 | -import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkorderStatusEnum; | ||
| 10 | -import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkorderTypeEnum; | 8 | +import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkOrderSourceTypeEnum; |
| 9 | +import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkOrderStatusEnum; | ||
| 10 | +import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkOrderTypeEnum; | ||
| 11 | import com.baomidou.mybatisplus.annotation.KeySequence; | 11 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 12 | import com.baomidou.mybatisplus.annotation.TableId; | 12 | import com.baomidou.mybatisplus.annotation.TableId; |
| 13 | import com.baomidou.mybatisplus.annotation.TableName; | 13 | import com.baomidou.mybatisplus.annotation.TableName; |
| @@ -21,15 +21,15 @@ import java.time.LocalDateTime; | @@ -21,15 +21,15 @@ import java.time.LocalDateTime; | ||
| 21 | * | 21 | * |
| 22 | * @author 芋道源码 | 22 | * @author 芋道源码 |
| 23 | */ | 23 | */ |
| 24 | -@TableName("mes_pro_workorder") | ||
| 25 | -@KeySequence("mes_pro_workorder_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | 24 | +@TableName("mes_pro_work_order") |
| 25 | +@KeySequence("mes_pro_work_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | ||
| 26 | @Data | 26 | @Data |
| 27 | @EqualsAndHashCode(callSuper = true) | 27 | @EqualsAndHashCode(callSuper = true) |
| 28 | @ToString(callSuper = true) | 28 | @ToString(callSuper = true) |
| 29 | @Builder | 29 | @Builder |
| 30 | @NoArgsConstructor | 30 | @NoArgsConstructor |
| 31 | @AllArgsConstructor | 31 | @AllArgsConstructor |
| 32 | -public class MesProWorkorderDO extends BaseDO { | 32 | +public class MesProWorkOrderDO extends BaseDO { |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * 编号 | 35 | * 编号 |
| @@ -47,13 +47,13 @@ public class MesProWorkorderDO extends BaseDO { | @@ -47,13 +47,13 @@ public class MesProWorkorderDO extends BaseDO { | ||
| 47 | /** | 47 | /** |
| 48 | * 工单类型 | 48 | * 工单类型 |
| 49 | * | 49 | * |
| 50 | - * 枚举 {@link MesProWorkorderTypeEnum} | 50 | + * 枚举 {@link MesProWorkOrderTypeEnum} |
| 51 | */ | 51 | */ |
| 52 | private Integer type; | 52 | private Integer type; |
| 53 | /** | 53 | /** |
| 54 | * 来源类型 | 54 | * 来源类型 |
| 55 | * | 55 | * |
| 56 | - * 枚举 {@link MesProWorkorderSourceTypeEnum} | 56 | + * 枚举 {@link MesProWorkOrderSourceTypeEnum} |
| 57 | */ | 57 | */ |
| 58 | private Integer orderSourceType; | 58 | private Integer orderSourceType; |
| 59 | /** | 59 | /** |
| @@ -111,14 +111,9 @@ public class MesProWorkorderDO extends BaseDO { | @@ -111,14 +111,9 @@ public class MesProWorkorderDO extends BaseDO { | ||
| 111 | /** | 111 | /** |
| 112 | * 父工单编号 | 112 | * 父工单编号 |
| 113 | * | 113 | * |
| 114 | - * 关联 {@link MesProWorkorderDO#getId()} | 114 | + * 关联 {@link MesProWorkOrderDO#getId()} |
| 115 | */ | 115 | */ |
| 116 | private Long parentId; | 116 | private Long parentId; |
| 117 | - // TODO @AI:panrentId?不用父节点编号; | ||
| 118 | - /** | ||
| 119 | - * 所有父节点编号 | ||
| 120 | - */ | ||
| 121 | - private String ancestors; | ||
| 122 | /** | 117 | /** |
| 123 | * 完成时间 | 118 | * 完成时间 |
| 124 | */ | 119 | */ |
| @@ -130,7 +125,7 @@ public class MesProWorkorderDO extends BaseDO { | @@ -130,7 +125,7 @@ public class MesProWorkorderDO extends BaseDO { | ||
| 130 | /** | 125 | /** |
| 131 | * 工单状态 | 126 | * 工单状态 |
| 132 | * | 127 | * |
| 133 | - * 枚举 {@link MesProWorkorderStatusEnum} | 128 | + * 枚举 {@link MesProWorkOrderStatusEnum} |
| 134 | */ | 129 | */ |
| 135 | private Integer status; | 130 | private Integer status; |
| 136 | /** | 131 | /** |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/plan/MesCalPlanMapper.java
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; |
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanDO; | 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/plan/MesCalPlanShiftMapper.java
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; |
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanShiftDO; | 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | ||
| 10 | import java.util.List; | 10 | import java.util.List; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/cal/plan/MesCalPlanTeamMapper.java
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.mes.dal.mysql.cal.plan; | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.mes.dal.mysql.cal.plan; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 5 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanTeamDO; | 5 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanTeamDO; |
| 6 | import org.apache.ibatis.annotations.Mapper; | 6 | import org.apache.ibatis.annotations.Mapper; |
| 7 | 7 | ||
| 8 | import java.util.List; | 8 | import java.util.List; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/pro/workorder/MesProWorkorderBomMapper.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomPageReqVO; | ||
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderBomDO; | 6 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomPageReqVO; |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderBomDO; | ||
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | ||
| 10 | import java.util.List; | 10 | import java.util.List; |
| @@ -15,20 +15,20 @@ import java.util.List; | @@ -15,20 +15,20 @@ import java.util.List; | ||
| 15 | * @author 芋道源码 | 15 | * @author 芋道源码 |
| 16 | */ | 16 | */ |
| 17 | @Mapper | 17 | @Mapper |
| 18 | -public interface MesProWorkorderBomMapper extends BaseMapperX<MesProWorkorderBomDO> { | 18 | +public interface MesProWorkOrderBomMapper extends BaseMapperX<MesProWorkOrderBomDO> { |
| 19 | 19 | ||
| 20 | - default PageResult<MesProWorkorderBomDO> selectPage(MesProWorkorderBomPageReqVO reqVO) { | ||
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<MesProWorkorderBomDO>() | ||
| 22 | - .eqIfPresent(MesProWorkorderBomDO::getWorkorderId, reqVO.getWorkorderId()) | ||
| 23 | - .orderByDesc(MesProWorkorderBomDO::getId)); | 20 | + default PageResult<MesProWorkOrderBomDO> selectPage(MesProWorkOrderBomPageReqVO reqVO) { |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesProWorkOrderBomDO>() | ||
| 22 | + .eqIfPresent(MesProWorkOrderBomDO::getWorkOrderId, reqVO.getWorkOrderId()) | ||
| 23 | + .orderByDesc(MesProWorkOrderBomDO::getId)); | ||
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | - default List<MesProWorkorderBomDO> selectListByWorkorderId(Long workorderId) { | ||
| 27 | - return selectList(MesProWorkorderBomDO::getWorkorderId, workorderId); | 26 | + default List<MesProWorkOrderBomDO> selectListByWorkOrderId(Long workOrderId) { |
| 27 | + return selectList(MesProWorkOrderBomDO::getWorkOrderId, workOrderId); | ||
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | - default void deleteByWorkorderId(Long workorderId) { | ||
| 31 | - delete(MesProWorkorderBomDO::getWorkorderId, workorderId); | 30 | + default void deleteByWorkOrderId(Long workOrderId) { |
| 31 | + delete(MesProWorkOrderBomDO::getWorkOrderId, workOrderId); | ||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | } | 34 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/pro/workorder/MesProWorkorderMapper.java
| @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder; | @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderPageReqVO; | ||
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderDO; | 6 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderPageReqVO; |
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderDO; | ||
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| @@ -13,23 +13,23 @@ import org.apache.ibatis.annotations.Mapper; | @@ -13,23 +13,23 @@ import org.apache.ibatis.annotations.Mapper; | ||
| 13 | * @author 芋道源码 | 13 | * @author 芋道源码 |
| 14 | */ | 14 | */ |
| 15 | @Mapper | 15 | @Mapper |
| 16 | -public interface MesProWorkorderMapper extends BaseMapperX<MesProWorkorderDO> { | 16 | +public interface MesProWorkOrderMapper extends BaseMapperX<MesProWorkOrderDO> { |
| 17 | 17 | ||
| 18 | - default PageResult<MesProWorkorderDO> selectPage(MesProWorkorderPageReqVO reqVO) { | ||
| 19 | - return selectPage(reqVO, new LambdaQueryWrapperX<MesProWorkorderDO>() | ||
| 20 | - .likeIfPresent(MesProWorkorderDO::getCode, reqVO.getCode()) | ||
| 21 | - .likeIfPresent(MesProWorkorderDO::getName, reqVO.getName()) | ||
| 22 | - .eqIfPresent(MesProWorkorderDO::getType, reqVO.getType()) | ||
| 23 | - .eqIfPresent(MesProWorkorderDO::getOrderSourceType, reqVO.getOrderSourceType()) | ||
| 24 | - .eqIfPresent(MesProWorkorderDO::getProductId, reqVO.getProductId()) | ||
| 25 | - .eqIfPresent(MesProWorkorderDO::getClientId, reqVO.getClientId()) | ||
| 26 | - .eqIfPresent(MesProWorkorderDO::getStatus, reqVO.getStatus()) | ||
| 27 | - .betweenIfPresent(MesProWorkorderDO::getRequestDate, reqVO.getRequestDate()) | ||
| 28 | - .orderByDesc(MesProWorkorderDO::getId)); | 18 | + default PageResult<MesProWorkOrderDO> selectPage(MesProWorkOrderPageReqVO reqVO) { |
| 19 | + return selectPage(reqVO, new LambdaQueryWrapperX<MesProWorkOrderDO>() | ||
| 20 | + .likeIfPresent(MesProWorkOrderDO::getCode, reqVO.getCode()) | ||
| 21 | + .likeIfPresent(MesProWorkOrderDO::getName, reqVO.getName()) | ||
| 22 | + .eqIfPresent(MesProWorkOrderDO::getType, reqVO.getType()) | ||
| 23 | + .eqIfPresent(MesProWorkOrderDO::getOrderSourceType, reqVO.getOrderSourceType()) | ||
| 24 | + .eqIfPresent(MesProWorkOrderDO::getProductId, reqVO.getProductId()) | ||
| 25 | + .eqIfPresent(MesProWorkOrderDO::getClientId, reqVO.getClientId()) | ||
| 26 | + .eqIfPresent(MesProWorkOrderDO::getStatus, reqVO.getStatus()) | ||
| 27 | + .betweenIfPresent(MesProWorkOrderDO::getRequestDate, reqVO.getRequestDate()) | ||
| 28 | + .orderByDesc(MesProWorkOrderDO::getId)); | ||
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | - default MesProWorkorderDO selectByCode(String code) { | ||
| 32 | - return selectOne(MesProWorkorderDO::getCode, code); | 31 | + default MesProWorkOrderDO selectByCode(String code) { |
| 32 | + return selectOne(MesProWorkOrderDO::getCode, code); | ||
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | } | 35 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/qc/MesQcDefectMapper.java
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.dal.mysql.qc; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.dal.mysql.qc; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectPageReqVO; | 6 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectPageReqVO; |
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/qc/MesQcIndicatorMapper.java
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.dal.mysql.qc; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.dal.mysql.qc; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 5 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorPageReqVO; | 6 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorPageReqVO; |
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; |
| 8 | import org.apache.ibatis.annotations.Mapper; | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | 9 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/DictTypeConstants.java
| @@ -23,5 +23,6 @@ public interface DictTypeConstants { | @@ -23,5 +23,6 @@ public interface DictTypeConstants { | ||
| 23 | String MES_PRO_WORKORDER_STATUS = "mes_pro_workorder_status"; // MES 生产工单状态 | 23 | String MES_PRO_WORKORDER_STATUS = "mes_pro_workorder_status"; // MES 生产工单状态 |
| 24 | String MES_PRO_WORKORDER_SOURCE_TYPE = "mes_pro_workorder_source_type"; // MES 工单来源类型 | 24 | String MES_PRO_WORKORDER_SOURCE_TYPE = "mes_pro_workorder_source_type"; // MES 工单来源类型 |
| 25 | String MES_PRO_WORKORDER_TYPE = "mes_pro_workorder_type"; // MES 工单类型 | 25 | String MES_PRO_WORKORDER_TYPE = "mes_pro_workorder_type"; // MES 工单类型 |
| 26 | + String MES_QC_TYPE = "mes_qc_type"; // MES 检测种类(IQC/IPQC/OQC/RQC) | ||
| 26 | 27 | ||
| 27 | } | 28 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/ErrorCodeConstants.java
| @@ -145,8 +145,14 @@ public interface ErrorCodeConstants { | @@ -145,8 +145,14 @@ public interface ErrorCodeConstants { | ||
| 145 | // ========== MES 生产管理-生产任务(1-040-503-000) ========== | 145 | // ========== MES 生产管理-生产任务(1-040-503-000) ========== |
| 146 | ErrorCode PRO_TASK_NOT_EXISTS = new ErrorCode(1_040_503_000, "生产任务不存在"); | 146 | ErrorCode PRO_TASK_NOT_EXISTS = new ErrorCode(1_040_503_000, "生产任务不存在"); |
| 147 | 147 | ||
| 148 | - // ========== MES 质量管理-检验模板(1-040-600-000) ========== | ||
| 149 | - ErrorCode QC_TEMPLATE_NOT_EXISTS = new ErrorCode(1_040_600_000, "检验模板不存在"); | 148 | + // ========== MES 质量管理-质检方案(1-040-600-000) ========== |
| 149 | + ErrorCode QC_TEMPLATE_NOT_EXISTS = new ErrorCode(1_040_600_000, "质检方案不存在"); | ||
| 150 | + ErrorCode QC_TEMPLATE_CODE_DUPLICATE = new ErrorCode(1_040_600_001, "质检方案编号已存在"); | ||
| 151 | + // ========== MES 质量管理-质检方案检测指标项(1-040-600-100) ========== | ||
| 152 | + ErrorCode QC_TEMPLATE_INDICATOR_NOT_EXISTS = new ErrorCode(1_040_600_100, "质检方案检测指标项不存在"); | ||
| 153 | + // ========== MES 质量管理-质检方案产品关联(1-040-600-200) ========== | ||
| 154 | + ErrorCode QC_TEMPLATE_ITEM_NOT_EXISTS = new ErrorCode(1_040_600_200, "质检方案产品关联不存在"); | ||
| 155 | + ErrorCode QC_TEMPLATE_ITEM_DUPLICATE = new ErrorCode(1_040_600_201, "该产品已关联此质检方案"); | ||
| 150 | 156 | ||
| 151 | // ========== MES 质量管理-质检指标(1-040-601-000) ========== | 157 | // ========== MES 质量管理-质检指标(1-040-601-000) ========== |
| 152 | ErrorCode QC_INDICATOR_NOT_EXISTS = new ErrorCode(1_040_601_000, "质检指标不存在"); | 158 | ErrorCode QC_INDICATOR_NOT_EXISTS = new ErrorCode(1_040_601_000, "质检指标不存在"); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkorderSourceTypeEnum.java
| @@ -13,12 +13,12 @@ import java.util.Arrays; | @@ -13,12 +13,12 @@ import java.util.Arrays; | ||
| 13 | */ | 13 | */ |
| 14 | @Getter | 14 | @Getter |
| 15 | @AllArgsConstructor | 15 | @AllArgsConstructor |
| 16 | -public enum MesProWorkorderSourceTypeEnum implements ArrayValuable<Integer> { | 16 | +public enum MesProWorkOrderSourceTypeEnum implements ArrayValuable<Integer> { |
| 17 | 17 | ||
| 18 | ORDER(1, "客户订单"), | 18 | ORDER(1, "客户订单"), |
| 19 | STORE(2, "库存备货"); | 19 | STORE(2, "库存备货"); |
| 20 | 20 | ||
| 21 | - public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkorderSourceTypeEnum::getType).toArray(Integer[]::new); | 21 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkOrderSourceTypeEnum::getType).toArray(Integer[]::new); |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * 类型值 | 24 | * 类型值 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkorderStatusEnum.java
| @@ -13,14 +13,14 @@ import java.util.Arrays; | @@ -13,14 +13,14 @@ import java.util.Arrays; | ||
| 13 | */ | 13 | */ |
| 14 | @Getter | 14 | @Getter |
| 15 | @AllArgsConstructor | 15 | @AllArgsConstructor |
| 16 | -public enum MesProWorkorderStatusEnum implements ArrayValuable<Integer> { | 16 | +public enum MesProWorkOrderStatusEnum implements ArrayValuable<Integer> { |
| 17 | 17 | ||
| 18 | PREPARE(0, "草稿"), | 18 | PREPARE(0, "草稿"), |
| 19 | CONFIRMED(1, "已确认"), | 19 | CONFIRMED(1, "已确认"), |
| 20 | FINISHED(2, "已完成"), | 20 | FINISHED(2, "已完成"), |
| 21 | CANCELED(3, "已取消"); | 21 | CANCELED(3, "已取消"); |
| 22 | 22 | ||
| 23 | - public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkorderStatusEnum::getStatus).toArray(Integer[]::new); | 23 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkOrderStatusEnum::getStatus).toArray(Integer[]::new); |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * 状态值 | 26 | * 状态值 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/enums/pro/MesProWorkorderTypeEnum.java
| @@ -13,13 +13,13 @@ import java.util.Arrays; | @@ -13,13 +13,13 @@ import java.util.Arrays; | ||
| 13 | */ | 13 | */ |
| 14 | @Getter | 14 | @Getter |
| 15 | @AllArgsConstructor | 15 | @AllArgsConstructor |
| 16 | -public enum MesProWorkorderTypeEnum implements ArrayValuable<Integer> { | 16 | +public enum MesProWorkOrderTypeEnum implements ArrayValuable<Integer> { |
| 17 | 17 | ||
| 18 | SELF(1, "自行生产"), | 18 | SELF(1, "自行生产"), |
| 19 | OUTSOURCE(2, "代工"), | 19 | OUTSOURCE(2, "代工"), |
| 20 | PURCHASE(3, "采购"); | 20 | PURCHASE(3, "采购"); |
| 21 | 21 | ||
| 22 | - public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkorderTypeEnum::getType).toArray(Integer[]::new); | 22 | + public static final Integer[] ARRAYS = Arrays.stream(values()).map(MesProWorkOrderTypeEnum::getType).toArray(Integer[]::new); |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * 类型值 | 25 | * 类型值 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanService.java
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.service.cal.plan; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.service.cal.plan; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; | 4 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; |
| 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanSaveReqVO; | 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanSaveReqVO; |
| 6 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanDO; | 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanServiceImpl.java
| @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -4,7 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; | 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanPageReqVO; |
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanSaveReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.MesCalPlanSaveReqVO; |
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanDO; | 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 8 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanMapper; | 8 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanMapper; |
| 9 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalPlanStatusEnum; | 9 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalPlanStatusEnum; |
| 10 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftTypeEnum; | 10 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftTypeEnum; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanShiftService.java
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.service.cal.plan; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.mes.service.cal.plan; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; | 4 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; |
| 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO; | 5 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO; |
| 6 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanShiftDO; | 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO; |
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 | ||
| 9 | import java.util.List; | 9 | import java.util.List; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanShiftServiceImpl.java
| @@ -5,8 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -5,8 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 5 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; | 6 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftPageReqVO; |
| 7 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO; | 7 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.shift.MesCalPlanShiftSaveReqVO; |
| 8 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanDO; | ||
| 9 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanShiftDO; | 8 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanDO; |
| 9 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanShiftDO; | ||
| 10 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanMapper; | 10 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanMapper; |
| 11 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanShiftMapper; | 11 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanShiftMapper; |
| 12 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftTypeEnum; | 12 | import cn.iocoder.yudao.module.mes.enums.cal.MesCalShiftTypeEnum; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanTeamService.java
| 1 | package cn.iocoder.yudao.module.mes.service.cal.plan; | 1 | package cn.iocoder.yudao.module.mes.service.cal.plan; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; | 3 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; |
| 4 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanTeamDO; | 4 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanTeamDO; |
| 5 | import jakarta.validation.Valid; | 5 | import jakarta.validation.Valid; |
| 6 | 6 | ||
| 7 | import java.util.List; | 7 | import java.util.List; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/cal/plan/MesCalPlanTeamServiceImpl.java
| @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.mes.service.cal.plan; | @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.mes.service.cal.plan; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 3 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 4 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; | 4 | import cn.iocoder.yudao.module.mes.controller.admin.cal.plan.vo.team.MesCalPlanTeamSaveReqVO; |
| 5 | -import cn.iocoder.yudao.module.mes.dal.dataobject.cal.MesCalPlanTeamDO; | 5 | +import cn.iocoder.yudao.module.mes.dal.dataobject.cal.plan.MesCalPlanTeamDO; |
| 6 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanTeamMapper; | 6 | import cn.iocoder.yudao.module.mes.dal.mysql.cal.plan.MesCalPlanTeamMapper; |
| 7 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; |
| 8 | import org.springframework.context.annotation.Lazy; | 8 | import org.springframework.context.annotation.Lazy; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/md/item/MesMdItemService.java
| @@ -52,6 +52,14 @@ public interface MesMdItemService { | @@ -52,6 +52,14 @@ public interface MesMdItemService { | ||
| 52 | MesMdItemDO getItem(Long id); | 52 | MesMdItemDO getItem(Long id); |
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | + * 校验物料产品存在 | ||
| 56 | + * | ||
| 57 | + * @param id 编号 | ||
| 58 | + * @return 物料产品 | ||
| 59 | + */ | ||
| 60 | + MesMdItemDO validateItemExists(Long id); | ||
| 61 | + | ||
| 62 | + /** | ||
| 55 | * 获得物料产品分页 | 63 | * 获得物料产品分页 |
| 56 | * | 64 | * |
| 57 | * @param pageReqVO 分页查询 | 65 | * @param pageReqVO 分页查询 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/md/item/MesMdItemServiceImpl.java
| @@ -112,10 +112,13 @@ public class MesMdItemServiceImpl implements MesMdItemService { | @@ -112,10 +112,13 @@ public class MesMdItemServiceImpl implements MesMdItemService { | ||
| 112 | itemMapper.deleteById(id); | 112 | itemMapper.deleteById(id); |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | - private void validateItemExists(Long id) { | ||
| 116 | - if (itemMapper.selectById(id) == null) { | 115 | + @Override |
| 116 | + public MesMdItemDO validateItemExists(Long id) { | ||
| 117 | + MesMdItemDO item = itemMapper.selectById(id); | ||
| 118 | + if (item == null) { | ||
| 117 | throw exception(MD_ITEM_NOT_EXISTS); | 119 | throw exception(MD_ITEM_NOT_EXISTS); |
| 118 | } | 120 | } |
| 121 | + return item; | ||
| 119 | } | 122 | } |
| 120 | 123 | ||
| 121 | private void validateItemCodeUnique(Long id, String code) { | 124 | private void validateItemCodeUnique(Long id, String code) { |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/workorder/MesProWorkorderBomService.java
| 1 | package cn.iocoder.yudao.module.mes.service.pro.workorder; | 1 | package cn.iocoder.yudao.module.mes.service.pro.workorder; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomPageReqVO; | ||
| 5 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomSaveReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderBomDO; | 4 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomPageReqVO; |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomSaveReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderBomDO; | ||
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 | ||
| 9 | import java.util.List; | 9 | import java.util.List; |
| @@ -13,7 +13,7 @@ import java.util.List; | @@ -13,7 +13,7 @@ import java.util.List; | ||
| 13 | * | 13 | * |
| 14 | * @author 芋道源码 | 14 | * @author 芋道源码 |
| 15 | */ | 15 | */ |
| 16 | -public interface MesProWorkorderBomService { | 16 | +public interface MesProWorkOrderBomService { |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * 创建工单 BOM | 19 | * 创建工单 BOM |
| @@ -21,21 +21,21 @@ public interface MesProWorkorderBomService { | @@ -21,21 +21,21 @@ public interface MesProWorkorderBomService { | ||
| 21 | * @param createReqVO 创建信息 | 21 | * @param createReqVO 创建信息 |
| 22 | * @return 编号 | 22 | * @return 编号 |
| 23 | */ | 23 | */ |
| 24 | - Long createWorkorderBom(@Valid MesProWorkorderBomSaveReqVO createReqVO); | 24 | + Long createWorkOrderBom(@Valid MesProWorkOrderBomSaveReqVO createReqVO); |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 更新工单 BOM | 27 | * 更新工单 BOM |
| 28 | * | 28 | * |
| 29 | * @param updateReqVO 更新信息 | 29 | * @param updateReqVO 更新信息 |
| 30 | */ | 30 | */ |
| 31 | - void updateWorkorderBom(@Valid MesProWorkorderBomSaveReqVO updateReqVO); | 31 | + void updateWorkOrderBom(@Valid MesProWorkOrderBomSaveReqVO updateReqVO); |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * 删除工单 BOM | 34 | * 删除工单 BOM |
| 35 | * | 35 | * |
| 36 | * @param id 编号 | 36 | * @param id 编号 |
| 37 | */ | 37 | */ |
| 38 | - void deleteWorkorderBom(Long id); | 38 | + void deleteWorkOrderBom(Long id); |
| 39 | 39 | ||
| 40 | /** | 40 | /** |
| 41 | * 获得工单 BOM | 41 | * 获得工单 BOM |
| @@ -43,7 +43,7 @@ public interface MesProWorkorderBomService { | @@ -43,7 +43,7 @@ public interface MesProWorkorderBomService { | ||
| 43 | * @param id 编号 | 43 | * @param id 编号 |
| 44 | * @return 工单 BOM | 44 | * @return 工单 BOM |
| 45 | */ | 45 | */ |
| 46 | - MesProWorkorderBomDO getWorkorderBom(Long id); | 46 | + MesProWorkOrderBomDO getWorkOrderBom(Long id); |
| 47 | 47 | ||
| 48 | /** | 48 | /** |
| 49 | * 获得工单 BOM 分页 | 49 | * 获得工单 BOM 分页 |
| @@ -51,21 +51,21 @@ public interface MesProWorkorderBomService { | @@ -51,21 +51,21 @@ public interface MesProWorkorderBomService { | ||
| 51 | * @param pageReqVO 分页查询 | 51 | * @param pageReqVO 分页查询 |
| 52 | * @return 工单 BOM 分页 | 52 | * @return 工单 BOM 分页 |
| 53 | */ | 53 | */ |
| 54 | - PageResult<MesProWorkorderBomDO> getWorkorderBomPage(MesProWorkorderBomPageReqVO pageReqVO); | 54 | + PageResult<MesProWorkOrderBomDO> getWorkOrderBomPage(MesProWorkOrderBomPageReqVO pageReqVO); |
| 55 | 55 | ||
| 56 | /** | 56 | /** |
| 57 | * 根据工单编号获得 BOM 列表 | 57 | * 根据工单编号获得 BOM 列表 |
| 58 | * | 58 | * |
| 59 | - * @param workorderId 工单编号 | 59 | + * @param workOrderId 工单编号 |
| 60 | * @return BOM 列表 | 60 | * @return BOM 列表 |
| 61 | */ | 61 | */ |
| 62 | - List<MesProWorkorderBomDO> getWorkorderBomListByWorkorderId(Long workorderId); | 62 | + List<MesProWorkOrderBomDO> getWorkOrderBomListByWorkOrderId(Long workOrderId); |
| 63 | 63 | ||
| 64 | /** | 64 | /** |
| 65 | * 根据工单编号删除 BOM | 65 | * 根据工单编号删除 BOM |
| 66 | * | 66 | * |
| 67 | - * @param workorderId 工单编号 | 67 | + * @param workOrderId 工单编号 |
| 68 | */ | 68 | */ |
| 69 | - void deleteWorkorderBomByWorkorderId(Long workorderId); | 69 | + void deleteWorkOrderBomByWorkOrderId(Long workOrderId); |
| 70 | 70 | ||
| 71 | } | 71 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/workorder/MesProWorkorderBomServiceImpl.java
| @@ -2,18 +2,19 @@ package cn.iocoder.yudao.module.mes.service.pro.workorder; | @@ -2,18 +2,19 @@ package cn.iocoder.yudao.module.mes.service.pro.workorder; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 4 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 5 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomPageReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkorderBomSaveReqVO; | ||
| 7 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderBomDO; | ||
| 8 | -import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkorderBomMapper; | 5 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomPageReqVO; |
| 6 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.bom.MesProWorkOrderBomSaveReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderBomDO; | ||
| 8 | +import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkOrderBomMapper; | ||
| 9 | import jakarta.annotation.Resource; | 9 | import jakarta.annotation.Resource; |
| 10 | +import org.springframework.context.annotation.Lazy; | ||
| 10 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 11 | import org.springframework.validation.annotation.Validated; | 12 | import org.springframework.validation.annotation.Validated; |
| 12 | 13 | ||
| 13 | import java.util.List; | 14 | import java.util.List; |
| 14 | 15 | ||
| 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 16 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | -import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_WORKORDER_BOM_NOT_EXISTS; | 17 | +import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_WORK_ORDER_BOM_NOT_EXISTS; |
| 17 | 18 | ||
| 18 | /** | 19 | /** |
| 19 | * MES 生产工单 BOM Service 实现类 | 20 | * MES 生产工单 BOM Service 实现类 |
| @@ -22,60 +23,65 @@ import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_WORKORDER | @@ -22,60 +23,65 @@ import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.PRO_WORKORDER | ||
| 22 | */ | 23 | */ |
| 23 | @Service | 24 | @Service |
| 24 | @Validated | 25 | @Validated |
| 25 | -public class MesProWorkorderBomServiceImpl implements MesProWorkorderBomService { | 26 | +public class MesProWorkOrderBomServiceImpl implements MesProWorkOrderBomService { |
| 26 | 27 | ||
| 27 | @Resource | 28 | @Resource |
| 28 | - private MesProWorkorderBomMapper workorderBomMapper; | 29 | + private MesProWorkOrderBomMapper workOrderBomMapper; |
| 30 | + | ||
| 31 | + @Resource | ||
| 32 | + @Lazy // 延迟加载,避免循环依赖 | ||
| 33 | + private MesProWorkOrderService workOrderService; | ||
| 29 | 34 | ||
| 30 | @Override | 35 | @Override |
| 31 | - public Long createWorkorderBom(MesProWorkorderBomSaveReqVO createReqVO) { | ||
| 32 | - // TODO @AI:是不是要校验 workorder 存在?另外,大小写应该是 workOrder? | ||
| 33 | - MesProWorkorderBomDO workorderBom = BeanUtils.toBean(createReqVO, MesProWorkorderBomDO.class); | ||
| 34 | - workorderBomMapper.insert(workorderBom); | ||
| 35 | - return workorderBom.getId(); | 36 | + public Long createWorkOrderBom(MesProWorkOrderBomSaveReqVO createReqVO) { |
| 37 | + // 校验工单存在 | ||
| 38 | + workOrderService.validateWorkOrderExists(createReqVO.getWorkOrderId()); | ||
| 39 | + MesProWorkOrderBomDO workOrderBom = BeanUtils.toBean(createReqVO, MesProWorkOrderBomDO.class); | ||
| 40 | + workOrderBomMapper.insert(workOrderBom); | ||
| 41 | + return workOrderBom.getId(); | ||
| 36 | } | 42 | } |
| 37 | 43 | ||
| 38 | @Override | 44 | @Override |
| 39 | - public void updateWorkorderBom(MesProWorkorderBomSaveReqVO updateReqVO) { | 45 | + public void updateWorkOrderBom(MesProWorkOrderBomSaveReqVO updateReqVO) { |
| 40 | // 校验存在 | 46 | // 校验存在 |
| 41 | - validateWorkorderBomExists(updateReqVO.getId()); | 47 | + validateWorkOrderBomExists(updateReqVO.getId()); |
| 42 | // 更新 | 48 | // 更新 |
| 43 | - MesProWorkorderBomDO updateObj = BeanUtils.toBean(updateReqVO, MesProWorkorderBomDO.class); | ||
| 44 | - workorderBomMapper.updateById(updateObj); | 49 | + MesProWorkOrderBomDO updateObj = BeanUtils.toBean(updateReqVO, MesProWorkOrderBomDO.class); |
| 50 | + workOrderBomMapper.updateById(updateObj); | ||
| 45 | } | 51 | } |
| 46 | 52 | ||
| 47 | @Override | 53 | @Override |
| 48 | - public void deleteWorkorderBom(Long id) { | 54 | + public void deleteWorkOrderBom(Long id) { |
| 49 | // 校验存在 | 55 | // 校验存在 |
| 50 | - validateWorkorderBomExists(id); | 56 | + validateWorkOrderBomExists(id); |
| 51 | // 删除 | 57 | // 删除 |
| 52 | - workorderBomMapper.deleteById(id); | 58 | + workOrderBomMapper.deleteById(id); |
| 53 | } | 59 | } |
| 54 | 60 | ||
| 55 | - private void validateWorkorderBomExists(Long id) { | ||
| 56 | - if (workorderBomMapper.selectById(id) == null) { | ||
| 57 | - throw exception(PRO_WORKORDER_BOM_NOT_EXISTS); | 61 | + private void validateWorkOrderBomExists(Long id) { |
| 62 | + if (workOrderBomMapper.selectById(id) == null) { | ||
| 63 | + throw exception(PRO_WORK_ORDER_BOM_NOT_EXISTS); | ||
| 58 | } | 64 | } |
| 59 | } | 65 | } |
| 60 | 66 | ||
| 61 | @Override | 67 | @Override |
| 62 | - public MesProWorkorderBomDO getWorkorderBom(Long id) { | ||
| 63 | - return workorderBomMapper.selectById(id); | 68 | + public MesProWorkOrderBomDO getWorkOrderBom(Long id) { |
| 69 | + return workOrderBomMapper.selectById(id); | ||
| 64 | } | 70 | } |
| 65 | 71 | ||
| 66 | @Override | 72 | @Override |
| 67 | - public PageResult<MesProWorkorderBomDO> getWorkorderBomPage(MesProWorkorderBomPageReqVO pageReqVO) { | ||
| 68 | - return workorderBomMapper.selectPage(pageReqVO); | 73 | + public PageResult<MesProWorkOrderBomDO> getWorkOrderBomPage(MesProWorkOrderBomPageReqVO pageReqVO) { |
| 74 | + return workOrderBomMapper.selectPage(pageReqVO); | ||
| 69 | } | 75 | } |
| 70 | 76 | ||
| 71 | @Override | 77 | @Override |
| 72 | - public List<MesProWorkorderBomDO> getWorkorderBomListByWorkorderId(Long workorderId) { | ||
| 73 | - return workorderBomMapper.selectListByWorkorderId(workorderId); | 78 | + public List<MesProWorkOrderBomDO> getWorkOrderBomListByWorkOrderId(Long workOrderId) { |
| 79 | + return workOrderBomMapper.selectListByWorkOrderId(workOrderId); | ||
| 74 | } | 80 | } |
| 75 | 81 | ||
| 76 | @Override | 82 | @Override |
| 77 | - public void deleteWorkorderBomByWorkorderId(Long workorderId) { | ||
| 78 | - workorderBomMapper.deleteByWorkorderId(workorderId); | 83 | + public void deleteWorkOrderBomByWorkOrderId(Long workOrderId) { |
| 84 | + workOrderBomMapper.deleteByWorkOrderId(workOrderId); | ||
| 79 | } | 85 | } |
| 80 | 86 | ||
| 81 | } | 87 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/workorder/MesProWorkorderService.java
| 1 | package cn.iocoder.yudao.module.mes.service.pro.workorder; | 1 | package cn.iocoder.yudao.module.mes.service.pro.workorder; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderPageReqVO; | ||
| 5 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderSaveReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderDO; | 4 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderPageReqVO; |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderSaveReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderDO; | ||
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| @@ -11,7 +11,7 @@ import jakarta.validation.Valid; | @@ -11,7 +11,7 @@ import jakarta.validation.Valid; | ||
| 11 | * | 11 | * |
| 12 | * @author 芋道源码 | 12 | * @author 芋道源码 |
| 13 | */ | 13 | */ |
| 14 | -public interface MesProWorkorderService { | 14 | +public interface MesProWorkOrderService { |
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| 17 | * 创建生产工单 | 17 | * 创建生产工单 |
| @@ -19,21 +19,29 @@ public interface MesProWorkorderService { | @@ -19,21 +19,29 @@ public interface MesProWorkorderService { | ||
| 19 | * @param createReqVO 创建信息 | 19 | * @param createReqVO 创建信息 |
| 20 | * @return 编号 | 20 | * @return 编号 |
| 21 | */ | 21 | */ |
| 22 | - Long createWorkorder(@Valid MesProWorkorderSaveReqVO createReqVO); | 22 | + Long createWorkOrder(@Valid MesProWorkOrderSaveReqVO createReqVO); |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * 更新生产工单 | 25 | * 更新生产工单 |
| 26 | * | 26 | * |
| 27 | * @param updateReqVO 更新信息 | 27 | * @param updateReqVO 更新信息 |
| 28 | */ | 28 | */ |
| 29 | - void updateWorkorder(@Valid MesProWorkorderSaveReqVO updateReqVO); | 29 | + void updateWorkOrder(@Valid MesProWorkOrderSaveReqVO updateReqVO); |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * 删除生产工单 | 32 | * 删除生产工单 |
| 33 | * | 33 | * |
| 34 | * @param id 编号 | 34 | * @param id 编号 |
| 35 | */ | 35 | */ |
| 36 | - void deleteWorkorder(Long id); | 36 | + void deleteWorkOrder(Long id); |
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * 校验生产工单存在 | ||
| 40 | + * | ||
| 41 | + * @param id 编号 | ||
| 42 | + * @return 生产工单 | ||
| 43 | + */ | ||
| 44 | + MesProWorkOrderDO validateWorkOrderExists(Long id); | ||
| 37 | 45 | ||
| 38 | /** | 46 | /** |
| 39 | * 获得生产工单 | 47 | * 获得生产工单 |
| @@ -41,7 +49,7 @@ public interface MesProWorkorderService { | @@ -41,7 +49,7 @@ public interface MesProWorkorderService { | ||
| 41 | * @param id 编号 | 49 | * @param id 编号 |
| 42 | * @return 生产工单 | 50 | * @return 生产工单 |
| 43 | */ | 51 | */ |
| 44 | - MesProWorkorderDO getWorkorder(Long id); | 52 | + MesProWorkOrderDO getWorkOrder(Long id); |
| 45 | 53 | ||
| 46 | /** | 54 | /** |
| 47 | * 获得生产工单分页 | 55 | * 获得生产工单分页 |
| @@ -49,20 +57,20 @@ public interface MesProWorkorderService { | @@ -49,20 +57,20 @@ public interface MesProWorkorderService { | ||
| 49 | * @param pageReqVO 分页查询 | 57 | * @param pageReqVO 分页查询 |
| 50 | * @return 生产工单分页 | 58 | * @return 生产工单分页 |
| 51 | */ | 59 | */ |
| 52 | - PageResult<MesProWorkorderDO> getWorkorderPage(MesProWorkorderPageReqVO pageReqVO); | 60 | + PageResult<MesProWorkOrderDO> getWorkOrderPage(MesProWorkOrderPageReqVO pageReqVO); |
| 53 | 61 | ||
| 54 | /** | 62 | /** |
| 55 | * 完成工单 | 63 | * 完成工单 |
| 56 | * | 64 | * |
| 57 | * @param id 编号 | 65 | * @param id 编号 |
| 58 | */ | 66 | */ |
| 59 | - void finishWorkorder(Long id); | 67 | + void finishWorkOrder(Long id); |
| 60 | 68 | ||
| 61 | /** | 69 | /** |
| 62 | * 取消工单 | 70 | * 取消工单 |
| 63 | * | 71 | * |
| 64 | * @param id 编号 | 72 | * @param id 编号 |
| 65 | */ | 73 | */ |
| 66 | - void cancelWorkorder(Long id); | 74 | + void cancelWorkOrder(Long id); |
| 67 | 75 | ||
| 68 | } | 76 | } |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/workorder/MesProWorkorderServiceImpl.java
| @@ -4,16 +4,16 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,16 +4,16 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.util.ObjUtil; | 4 | import cn.hutool.core.util.ObjUtil; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderSaveReqVO; | ||
| 8 | -import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkorderPageReqVO; | 7 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderPageReqVO; |
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.pro.workorder.vo.MesProWorkOrderSaveReqVO; | ||
| 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemBatchConfigDO; | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemBatchConfigDO; |
| 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; | 10 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdItemDO; |
| 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdProductBomDO; | 11 | import cn.iocoder.yudao.module.mes.dal.dataobject.md.item.MesMdProductBomDO; |
| 12 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderBomDO; | ||
| 13 | -import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkorderDO; | ||
| 14 | -import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkorderBomMapper; | ||
| 15 | -import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkorderMapper; | ||
| 16 | -import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkorderStatusEnum; | 12 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderBomDO; |
| 13 | +import cn.iocoder.yudao.module.mes.dal.dataobject.pro.workorder.MesProWorkOrderDO; | ||
| 14 | +import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkOrderBomMapper; | ||
| 15 | +import cn.iocoder.yudao.module.mes.dal.mysql.pro.workorder.MesProWorkOrderMapper; | ||
| 16 | +import cn.iocoder.yudao.module.mes.enums.pro.MesProWorkOrderStatusEnum; | ||
| 17 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemBatchConfigService; | 17 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemBatchConfigService; |
| 18 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; | 18 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| 19 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdProductBomService; | 19 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdProductBomService; |
| @@ -25,7 +25,6 @@ import org.springframework.validation.annotation.Validated; | @@ -25,7 +25,6 @@ import org.springframework.validation.annotation.Validated; | ||
| 25 | import java.math.BigDecimal; | 25 | import java.math.BigDecimal; |
| 26 | import java.time.LocalDateTime; | 26 | import java.time.LocalDateTime; |
| 27 | import java.util.List; | 27 | import java.util.List; |
| 28 | -import java.util.Objects; | ||
| 29 | 28 | ||
| 30 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 29 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 31 | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; | 30 | import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; |
| @@ -37,13 +36,13 @@ import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; | @@ -37,13 +36,13 @@ import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*; | ||
| 37 | */ | 36 | */ |
| 38 | @Service | 37 | @Service |
| 39 | @Validated | 38 | @Validated |
| 40 | -public class MesProWorkorderServiceImpl implements MesProWorkorderService { | 39 | +public class MesProWorkOrderServiceImpl implements MesProWorkOrderService { |
| 41 | 40 | ||
| 42 | @Resource | 41 | @Resource |
| 43 | - private MesProWorkorderMapper workorderMapper; | 42 | + private MesProWorkOrderMapper workOrderMapper; |
| 44 | 43 | ||
| 45 | @Resource | 44 | @Resource |
| 46 | - private MesProWorkorderBomMapper workorderBomMapper; | 45 | + private MesProWorkOrderBomMapper workOrderBomMapper; |
| 47 | 46 | ||
| 48 | @Resource | 47 | @Resource |
| 49 | private MesMdItemService itemService; | 48 | private MesMdItemService itemService; |
| @@ -56,15 +55,11 @@ public class MesProWorkorderServiceImpl implements MesProWorkorderService { | @@ -56,15 +55,11 @@ public class MesProWorkorderServiceImpl implements MesProWorkorderService { | ||
| 56 | 55 | ||
| 57 | @Override | 56 | @Override |
| 58 | @Transactional(rollbackFor = Exception.class) | 57 | @Transactional(rollbackFor = Exception.class) |
| 59 | - public Long createWorkorder(MesProWorkorderSaveReqVO createReqVO) { | 58 | + public Long createWorkOrder(MesProWorkOrderSaveReqVO createReqVO) { |
| 60 | // 1.1 校验编码唯一 | 59 | // 1.1 校验编码唯一 |
| 61 | - validateWorkorderCodeUnique(null, createReqVO.getCode()); | 60 | + validateWorkOrderCodeUnique(null, createReqVO.getCode()); |
| 62 | // 1.2 校验产品存在 | 61 | // 1.2 校验产品存在 |
| 63 | - // TODO @AI:getItem 里面要有个校验方法,不然每次都要写 if (item == null) throw exception(MD_ITEM_NOT_EXISTS); | ||
| 64 | - MesMdItemDO product = itemService.getItem(createReqVO.getProductId()); | ||
| 65 | - if (product == null) { | ||
| 66 | - throw exception(MD_ITEM_NOT_EXISTS); | ||
| 67 | - } | 62 | + itemService.validateItemExists(createReqVO.getProductId()); |
| 68 | // 1.3 校验批次配置:如果产品有 clientFlag=true,则 clientId 必填 | 63 | // 1.3 校验批次配置:如果产品有 clientFlag=true,则 clientId 必填 |
| 69 | validateBatchConfig(createReqVO.getProductId(), createReqVO.getClientId()); | 64 | validateBatchConfig(createReqVO.getProductId(), createReqVO.getClientId()); |
| 70 | 65 | ||
| @@ -72,121 +67,112 @@ public class MesProWorkorderServiceImpl implements MesProWorkorderService { | @@ -72,121 +67,112 @@ public class MesProWorkorderServiceImpl implements MesProWorkorderService { | ||
| 72 | if (createReqVO.getParentId() == null) { | 67 | if (createReqVO.getParentId() == null) { |
| 73 | createReqVO.setParentId(0L); | 68 | createReqVO.setParentId(0L); |
| 74 | } | 69 | } |
| 75 | - if (createReqVO.getAncestors() == null) { | ||
| 76 | - createReqVO.setAncestors("0"); | ||
| 77 | - } | ||
| 78 | // 2.2 插入工单 | 70 | // 2.2 插入工单 |
| 79 | - MesProWorkorderDO workorder = BeanUtils.toBean(createReqVO, MesProWorkorderDO.class); | ||
| 80 | - if (workorder.getStatus() == null) { | ||
| 81 | - workorder.setStatus(MesProWorkorderStatusEnum.PREPARE.getStatus()); | 71 | + MesProWorkOrderDO workOrder = BeanUtils.toBean(createReqVO, MesProWorkOrderDO.class); |
| 72 | + if (workOrder.getStatus() == null) { | ||
| 73 | + workOrder.setStatus(MesProWorkOrderStatusEnum.PREPARE.getStatus()); | ||
| 82 | } | 74 | } |
| 83 | - workorderMapper.insert(workorder); | 75 | + workOrderMapper.insert(workOrder); |
| 84 | 76 | ||
| 85 | // 3. 自动生成 BOM:根据产品 BOM 生成工单 BOM | 77 | // 3. 自动生成 BOM:根据产品 BOM 生成工单 BOM |
| 86 | - generateWorkorderBom(workorder.getId(), createReqVO.getProductId(), createReqVO.getQuantity()); | ||
| 87 | - return workorder.getId(); | 78 | + generateWorkOrderBom(workOrder.getId(), createReqVO.getProductId(), createReqVO.getQuantity()); |
| 79 | + return workOrder.getId(); | ||
| 88 | } | 80 | } |
| 89 | 81 | ||
| 90 | @Override | 82 | @Override |
| 91 | @Transactional(rollbackFor = Exception.class) | 83 | @Transactional(rollbackFor = Exception.class) |
| 92 | - public void updateWorkorder(MesProWorkorderSaveReqVO updateReqVO) { | 84 | + public void updateWorkOrder(MesProWorkOrderSaveReqVO updateReqVO) { |
| 93 | // 1.1 校验存在 | 85 | // 1.1 校验存在 |
| 94 | - MesProWorkorderDO oldWorkorder = validateWorkorderExists(updateReqVO.getId()); | 86 | + MesProWorkOrderDO oldWorkOrder = validateWorkOrderExists(updateReqVO.getId()); |
| 95 | // 1.2 校验编码唯一 | 87 | // 1.2 校验编码唯一 |
| 96 | - validateWorkorderCodeUnique(updateReqVO.getId(), updateReqVO.getCode()); | 88 | + validateWorkOrderCodeUnique(updateReqVO.getId(), updateReqVO.getCode()); |
| 97 | // 1.3 校验批次配置 | 89 | // 1.3 校验批次配置 |
| 98 | validateBatchConfig(updateReqVO.getProductId(), updateReqVO.getClientId()); | 90 | validateBatchConfig(updateReqVO.getProductId(), updateReqVO.getClientId()); |
| 99 | 91 | ||
| 100 | // 2. 判断产品或数量是否变更,如果变更则重新生成 BOM | 92 | // 2. 判断产品或数量是否变更,如果变更则重新生成 BOM |
| 101 | - boolean productChanged = !Objects.equals(oldWorkorder.getProductId(), updateReqVO.getProductId()); | ||
| 102 | - boolean quantityChanged = oldWorkorder.getQuantity().compareTo(updateReqVO.getQuantity()) != 0; | 93 | + boolean productChanged = ObjUtil.notEqual(oldWorkOrder.getProductId(), updateReqVO.getProductId()); |
| 94 | + boolean quantityChanged = oldWorkOrder.getQuantity().compareTo(updateReqVO.getQuantity()) != 0; | ||
| 103 | if (productChanged || quantityChanged) { | 95 | if (productChanged || quantityChanged) { |
| 104 | // 删除旧 BOM 并重新生成 | 96 | // 删除旧 BOM 并重新生成 |
| 105 | - workorderBomMapper.deleteByWorkorderId(updateReqVO.getId()); | ||
| 106 | - generateWorkorderBom(updateReqVO.getId(), updateReqVO.getProductId(), updateReqVO.getQuantity()); | 97 | + workOrderBomMapper.deleteByWorkOrderId(updateReqVO.getId()); |
| 98 | + generateWorkOrderBom(updateReqVO.getId(), updateReqVO.getProductId(), updateReqVO.getQuantity()); | ||
| 107 | } | 99 | } |
| 108 | 100 | ||
| 109 | // 3. 更新 | 101 | // 3. 更新 |
| 110 | - MesProWorkorderDO updateObj = BeanUtils.toBean(updateReqVO, MesProWorkorderDO.class); | ||
| 111 | - workorderMapper.updateById(updateObj); | 102 | + MesProWorkOrderDO updateObj = BeanUtils.toBean(updateReqVO, MesProWorkOrderDO.class); |
| 103 | + workOrderMapper.updateById(updateObj); | ||
| 112 | } | 104 | } |
| 113 | 105 | ||
| 114 | @Override | 106 | @Override |
| 115 | @Transactional(rollbackFor = Exception.class) | 107 | @Transactional(rollbackFor = Exception.class) |
| 116 | - public void deleteWorkorder(Long id) { | 108 | + public void deleteWorkOrder(Long id) { |
| 117 | // 1.1 校验存在 | 109 | // 1.1 校验存在 |
| 118 | - MesProWorkorderDO workorder = validateWorkorderExists(id); | 110 | + MesProWorkOrderDO workOrder = validateWorkOrderExists(id); |
| 119 | // 1.2 只能删除草稿状态的工单 | 111 | // 1.2 只能删除草稿状态的工单 |
| 120 | - // TODO @AI:notEquals;ObjUtil | ||
| 121 | - if (!Objects.equals(workorder.getStatus(), MesProWorkorderStatusEnum.PREPARE.getStatus())) { | ||
| 122 | - throw exception(PRO_WORKORDER_NOT_PREPARE); | 112 | + if (ObjUtil.notEqual(workOrder.getStatus(), MesProWorkOrderStatusEnum.PREPARE.getStatus())) { |
| 113 | + throw exception(PRO_WORK_ORDER_NOT_PREPARE); | ||
| 123 | } | 114 | } |
| 124 | 115 | ||
| 125 | // 2. 删除工单 + BOM | 116 | // 2. 删除工单 + BOM |
| 126 | - workorderMapper.deleteById(id); | ||
| 127 | - workorderBomMapper.deleteByWorkorderId(id); | 117 | + workOrderMapper.deleteById(id); |
| 118 | + workOrderBomMapper.deleteByWorkOrderId(id); | ||
| 128 | } | 119 | } |
| 129 | 120 | ||
| 130 | @Override | 121 | @Override |
| 131 | - public MesProWorkorderDO getWorkorder(Long id) { | ||
| 132 | - return workorderMapper.selectById(id); | 122 | + public MesProWorkOrderDO validateWorkOrderExists(Long id) { |
| 123 | + MesProWorkOrderDO workOrder = workOrderMapper.selectById(id); | ||
| 124 | + if (workOrder == null) { | ||
| 125 | + throw exception(PRO_WORK_ORDER_NOT_EXISTS); | ||
| 126 | + } | ||
| 127 | + return workOrder; | ||
| 133 | } | 128 | } |
| 134 | 129 | ||
| 135 | @Override | 130 | @Override |
| 136 | - public PageResult<MesProWorkorderDO> getWorkorderPage(MesProWorkorderPageReqVO pageReqVO) { | ||
| 137 | - return workorderMapper.selectPage(pageReqVO); | 131 | + public MesProWorkOrderDO getWorkOrder(Long id) { |
| 132 | + return workOrderMapper.selectById(id); | ||
| 138 | } | 133 | } |
| 139 | 134 | ||
| 140 | @Override | 135 | @Override |
| 141 | - public void finishWorkorder(Long id) { | 136 | + public PageResult<MesProWorkOrderDO> getWorkOrderPage(MesProWorkOrderPageReqVO pageReqVO) { |
| 137 | + return workOrderMapper.selectPage(pageReqVO); | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + @Override | ||
| 141 | + public void finishWorkOrder(Long id) { | ||
| 142 | // 1. 校验存在 | 142 | // 1. 校验存在 |
| 143 | - validateWorkorderExists(id); | 143 | + validateWorkOrderExists(id); |
| 144 | 144 | ||
| 145 | // 2. 更新状态为已完成 | 145 | // 2. 更新状态为已完成 |
| 146 | - // TODO @AI:链式调用,不用逐个设置; | ||
| 147 | - MesProWorkorderDO updateObj = new MesProWorkorderDO(); | ||
| 148 | - updateObj.setId(id); | ||
| 149 | - updateObj.setStatus(MesProWorkorderStatusEnum.FINISHED.getStatus()); | ||
| 150 | - updateObj.setFinishDate(LocalDateTime.now()); | ||
| 151 | - workorderMapper.updateById(updateObj); | 146 | + workOrderMapper.updateById(new MesProWorkOrderDO().setId(id) |
| 147 | + .setStatus(MesProWorkOrderStatusEnum.FINISHED.getStatus()) | ||
| 148 | + .setFinishDate(LocalDateTime.now())); | ||
| 152 | // TODO @芋艿:pro_task 未迁移,暂不级联更新任务状态 | 149 | // TODO @芋艿:pro_task 未迁移,暂不级联更新任务状态 |
| 153 | } | 150 | } |
| 154 | 151 | ||
| 155 | @Override | 152 | @Override |
| 156 | - public void cancelWorkorder(Long id) { | 153 | + public void cancelWorkOrder(Long id) { |
| 157 | // 1. 校验存在 | 154 | // 1. 校验存在 |
| 158 | - validateWorkorderExists(id); | 155 | + validateWorkOrderExists(id); |
| 159 | 156 | ||
| 160 | // 2. 更新状态为已取消 | 157 | // 2. 更新状态为已取消 |
| 161 | - // TODO @AI:链式调用,不用逐个设置; | ||
| 162 | - MesProWorkorderDO updateObj = new MesProWorkorderDO(); | ||
| 163 | - updateObj.setId(id); | ||
| 164 | - updateObj.setStatus(MesProWorkorderStatusEnum.CANCELED.getStatus()); | ||
| 165 | - updateObj.setCancelDate(LocalDateTime.now()); | ||
| 166 | - workorderMapper.updateById(updateObj); | 158 | + workOrderMapper.updateById(new MesProWorkOrderDO().setId(id) |
| 159 | + .setStatus(MesProWorkOrderStatusEnum.CANCELED.getStatus()) | ||
| 160 | + .setCancelDate(LocalDateTime.now())); | ||
| 167 | // TODO @芋艿:pro_task 未迁移,暂不级联更新任务状态 | 161 | // TODO @芋艿:pro_task 未迁移,暂不级联更新任务状态 |
| 168 | } | 162 | } |
| 169 | 163 | ||
| 170 | // ==================== 校验方法 ==================== | 164 | // ==================== 校验方法 ==================== |
| 171 | 165 | ||
| 172 | - private MesProWorkorderDO validateWorkorderExists(Long id) { | ||
| 173 | - MesProWorkorderDO workorder = workorderMapper.selectById(id); | ||
| 174 | - if (workorder == null) { | ||
| 175 | - throw exception(PRO_WORKORDER_NOT_EXISTS); | ||
| 176 | - } | ||
| 177 | - return workorder; | ||
| 178 | - } | ||
| 179 | - | ||
| 180 | - private void validateWorkorderCodeUnique(Long id, String code) { | 166 | + private void validateWorkOrderCodeUnique(Long id, String code) { |
| 181 | if (code == null) { | 167 | if (code == null) { |
| 182 | return; | 168 | return; |
| 183 | } | 169 | } |
| 184 | - MesProWorkorderDO workorder = workorderMapper.selectByCode(code); | ||
| 185 | - if (workorder == null) { | 170 | + MesProWorkOrderDO workOrder = workOrderMapper.selectByCode(code); |
| 171 | + if (workOrder == null) { | ||
| 186 | return; | 172 | return; |
| 187 | } | 173 | } |
| 188 | - if (ObjUtil.notEqual(workorder.getId(), id)) { | ||
| 189 | - throw exception(PRO_WORKORDER_CODE_DUPLICATE); | 174 | + if (ObjUtil.notEqual(workOrder.getId(), id)) { |
| 175 | + throw exception(PRO_WORK_ORDER_CODE_DUPLICATE); | ||
| 190 | } | 176 | } |
| 191 | } | 177 | } |
| 192 | 178 | ||
| @@ -203,30 +189,22 @@ public class MesProWorkorderServiceImpl implements MesProWorkorderService { | @@ -203,30 +189,22 @@ public class MesProWorkorderServiceImpl implements MesProWorkorderService { | ||
| 203 | /** | 189 | /** |
| 204 | * 根据产品 BOM 自动生成工单 BOM 行 | 190 | * 根据产品 BOM 自动生成工单 BOM 行 |
| 205 | * | 191 | * |
| 206 | - * @param workorderId 工单编号 | 192 | + * @param workOrderId 工单编号 |
| 207 | * @param productId 产品编号 | 193 | * @param productId 产品编号 |
| 208 | * @param quantity 工单生产数量 | 194 | * @param quantity 工单生产数量 |
| 209 | */ | 195 | */ |
| 210 | - private void generateWorkorderBom(Long workorderId, Long productId, BigDecimal quantity) { | 196 | + private void generateWorkOrderBom(Long workOrderId, Long productId, BigDecimal quantity) { |
| 211 | List<MesMdProductBomDO> productBomList = productBomService.getProductBomListByItemId(productId); | 197 | List<MesMdProductBomDO> productBomList = productBomService.getProductBomListByItemId(productId); |
| 212 | if (CollUtil.isEmpty(productBomList)) { | 198 | if (CollUtil.isEmpty(productBomList)) { |
| 213 | return; | 199 | return; |
| 214 | } | 200 | } |
| 215 | for (MesMdProductBomDO productBom : productBomList) { | 201 | for (MesMdProductBomDO productBom : productBomList) { |
| 216 | - MesMdItemDO bomItem = itemService.getItem(productBom.getBomItemId()); | ||
| 217 | - // TODO @AI:bomItem 校验必须非空吧?! | ||
| 218 | - // TODO @AI:联会调用; | ||
| 219 | - MesProWorkorderBomDO workorderBom = new MesProWorkorderBomDO(); | ||
| 220 | - workorderBom.setWorkorderId(workorderId); | ||
| 221 | - workorderBom.setItemId(productBom.getBomItemId()); | ||
| 222 | - workorderBom.setItemOrProduct("ITEM"); | ||
| 223 | - // 预计使用量 = 工单数量 × BOM 用量 | ||
| 224 | - workorderBom.setQuantity(quantity.multiply(productBom.getQuantity())); | ||
| 225 | - // 设置单位:使用物料自身的单位 | ||
| 226 | - if (bomItem != null) { | ||
| 227 | - workorderBom.setUnitMeasureId(bomItem.getUnitMeasureId()); | ||
| 228 | - } | ||
| 229 | - workorderBomMapper.insert(workorderBom); | 202 | + MesMdItemDO bomItem = itemService.validateItemExists(productBom.getBomItemId()); |
| 203 | + workOrderBomMapper.insert(new MesProWorkOrderBomDO() | ||
| 204 | + .setWorkOrderId(workOrderId) | ||
| 205 | + .setItemId(productBom.getBomItemId()) | ||
| 206 | + .setQuantity(quantity.multiply(productBom.getQuantity())) | ||
| 207 | + .setUnitMeasureId(bomItem.getUnitMeasureId())); | ||
| 230 | } | 208 | } |
| 231 | } | 209 | } |
| 232 | 210 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/MesQcDefectService.java
| 1 | package cn.iocoder.yudao.module.mes.service.qc; | 1 | package cn.iocoder.yudao.module.mes.service.qc; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectPageReqVO; | ||
| 5 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectSaveReqVO; | 4 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectPageReqVO; |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectSaveReqVO; | ||
| 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; |
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/MesQcDefectServiceImpl.java
| @@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.util.ObjUtil; | 4 | import cn.hutool.core.util.ObjUtil; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectPageReqVO; | ||
| 8 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcDefectSaveReqVO; | 7 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectPageReqVO; |
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.defect.vo.MesQcDefectSaveReqVO; | ||
| 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcDefectDO; |
| 10 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.MesQcDefectMapper; | 10 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.MesQcDefectMapper; |
| 11 | import jakarta.annotation.Resource; | 11 | import jakarta.annotation.Resource; |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/MesQcIndicatorService.java
| 1 | package cn.iocoder.yudao.module.mes.service.qc; | 1 | package cn.iocoder.yudao.module.mes.service.qc; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorPageReqVO; | ||
| 5 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorSaveReqVO; | 4 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorPageReqVO; |
| 5 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorSaveReqVO; | ||
| 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; |
| 7 | import jakarta.validation.Valid; | 7 | import jakarta.validation.Valid; |
| 8 | 8 |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/qc/MesQcIndicatorServiceImpl.java
| @@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollUtil; | @@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.hutool.core.util.ObjUtil; | 4 | import cn.hutool.core.util.ObjUtil; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | 6 | import cn.iocoder.yudao.framework.common.util.object.BeanUtils; |
| 7 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorPageReqVO; | ||
| 8 | -import cn.iocoder.yudao.module.mes.controller.admin.qc.vo.MesQcIndicatorSaveReqVO; | 7 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorPageReqVO; |
| 8 | +import cn.iocoder.yudao.module.mes.controller.admin.qc.indicator.vo.MesQcIndicatorSaveReqVO; | ||
| 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; | 9 | import cn.iocoder.yudao.module.mes.dal.dataobject.qc.MesQcIndicatorDO; |
| 10 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.MesQcIndicatorMapper; | 10 | import cn.iocoder.yudao.module.mes.dal.mysql.qc.MesQcIndicatorMapper; |
| 11 | import jakarta.annotation.Resource; | 11 | import jakarta.annotation.Resource; |