Commit 5845ef525953b5ffff98a1dc904e72ea5aaf9ceb
1 parent
8bfe74fe
✨ feat(mes): 添加工单完成功能,优化任务管理界面
Showing
3 changed files
with
16 additions
and
6 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteProcessServiceImpl.java
| @@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.mes.controller.admin.pro.route.vo.process.MesProR | @@ -6,7 +6,6 @@ import cn.iocoder.yudao.module.mes.controller.admin.pro.route.vo.process.MesProR | ||
| 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProcessDO; | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProcessDO; |
| 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProductDO; | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProductDO; |
| 8 | import cn.iocoder.yudao.module.mes.dal.mysql.pro.route.MesProRouteProcessMapper; | 8 | import cn.iocoder.yudao.module.mes.dal.mysql.pro.route.MesProRouteProcessMapper; |
| 9 | -import cn.iocoder.yudao.module.mes.dal.mysql.pro.route.MesProRouteProductMapper; | ||
| 10 | import cn.iocoder.yudao.module.mes.service.pro.process.MesProProcessService; | 9 | import cn.iocoder.yudao.module.mes.service.pro.process.MesProProcessService; |
| 11 | import jakarta.annotation.Resource; | 10 | import jakarta.annotation.Resource; |
| 12 | import org.springframework.context.annotation.Lazy; | 11 | import org.springframework.context.annotation.Lazy; |
| @@ -34,14 +33,12 @@ public class MesProRouteProcessServiceImpl implements MesProRouteProcessService | @@ -34,14 +33,12 @@ public class MesProRouteProcessServiceImpl implements MesProRouteProcessService | ||
| 34 | @Resource | 33 | @Resource |
| 35 | private MesProRouteProcessMapper routeProcessMapper; | 34 | private MesProRouteProcessMapper routeProcessMapper; |
| 36 | 35 | ||
| 37 | - // TODO @AI:应该使用 MesProRouteProductService; | ||
| 38 | @Resource | 36 | @Resource |
| 39 | - private MesProRouteProductMapper routeProductMapper; | ||
| 40 | - | 37 | + @Lazy |
| 38 | + private MesProRouteProductService routeProductService; | ||
| 41 | @Resource | 39 | @Resource |
| 42 | @Lazy | 40 | @Lazy |
| 43 | private MesProProcessService processService; | 41 | private MesProProcessService processService; |
| 44 | - | ||
| 45 | @Resource | 42 | @Resource |
| 46 | @Lazy | 43 | @Lazy |
| 47 | private MesProRouteService routeService; | 44 | private MesProRouteService routeService; |
| @@ -192,7 +189,7 @@ public class MesProRouteProcessServiceImpl implements MesProRouteProcessService | @@ -192,7 +189,7 @@ public class MesProRouteProcessServiceImpl implements MesProRouteProcessService | ||
| 192 | @Override | 189 | @Override |
| 193 | public List<MesProRouteProcessDO> getRouteProcessListByProductId(Long productId) { | 190 | public List<MesProRouteProcessDO> getRouteProcessListByProductId(Long productId) { |
| 194 | // 1. 根据产品查找关联的工艺路线产品记录 | 191 | // 1. 根据产品查找关联的工艺路线产品记录 |
| 195 | - MesProRouteProductDO routeProduct = routeProductMapper.selectByItemId(productId); | 192 | + MesProRouteProductDO routeProduct = routeProductService.getRouteProductByItemId(productId); |
| 196 | if (routeProduct == null) { | 193 | if (routeProduct == null) { |
| 197 | // TODO @芋艿:会不会存在配置了多个的情况??? | 194 | // TODO @芋艿:会不会存在配置了多个的情况??? |
| 198 | return Collections.emptyList(); | 195 | return Collections.emptyList(); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteProductService.java
| @@ -34,6 +34,14 @@ public interface MesProRouteProductService { | @@ -34,6 +34,14 @@ public interface MesProRouteProductService { | ||
| 34 | MesProRouteProductDO getRouteProduct(Long id); | 34 | MesProRouteProductDO getRouteProduct(Long id); |
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | + * 按产品(物料)获得工艺路线产品 | ||
| 38 | + * | ||
| 39 | + * @param itemId 产品编号 | ||
| 40 | + * @return 工艺路线产品,如果未配置则返回 null | ||
| 41 | + */ | ||
| 42 | + MesProRouteProductDO getRouteProductByItemId(Long itemId); | ||
| 43 | + | ||
| 44 | + /** | ||
| 37 | * 按工艺路线获得产品列表 | 45 | * 按工艺路线获得产品列表 |
| 38 | */ | 46 | */ |
| 39 | List<MesProRouteProductDO> getRouteProductListByRouteId(Long routeId); | 47 | List<MesProRouteProductDO> getRouteProductListByRouteId(Long routeId); |
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteProductServiceImpl.java
| @@ -105,6 +105,11 @@ public class MesProRouteProductServiceImpl implements MesProRouteProductService | @@ -105,6 +105,11 @@ public class MesProRouteProductServiceImpl implements MesProRouteProductService | ||
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | @Override | 107 | @Override |
| 108 | + public MesProRouteProductDO getRouteProductByItemId(Long itemId) { | ||
| 109 | + return routeProductMapper.selectByItemId(itemId); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + @Override | ||
| 108 | public List<MesProRouteProductDO> getRouteProductListByRouteId(Long routeId) { | 113 | public List<MesProRouteProductDO> getRouteProductListByRouteId(Long routeId) { |
| 109 | return routeProductMapper.selectListByRouteId(routeId); | 114 | return routeProductMapper.selectListByRouteId(routeId); |
| 110 | } | 115 | } |