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 | 6 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProcessDO; |
| 7 | 7 | import cn.iocoder.yudao.module.mes.dal.dataobject.pro.route.MesProRouteProductDO; |
| 8 | 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 | 9 | import cn.iocoder.yudao.module.mes.service.pro.process.MesProProcessService; |
| 11 | 10 | import jakarta.annotation.Resource; |
| 12 | 11 | import org.springframework.context.annotation.Lazy; |
| ... | ... | @@ -34,14 +33,12 @@ public class MesProRouteProcessServiceImpl implements MesProRouteProcessService |
| 34 | 33 | @Resource |
| 35 | 34 | private MesProRouteProcessMapper routeProcessMapper; |
| 36 | 35 | |
| 37 | - // TODO @AI:应该使用 MesProRouteProductService; | |
| 38 | 36 | @Resource |
| 39 | - private MesProRouteProductMapper routeProductMapper; | |
| 40 | - | |
| 37 | + @Lazy | |
| 38 | + private MesProRouteProductService routeProductService; | |
| 41 | 39 | @Resource |
| 42 | 40 | @Lazy |
| 43 | 41 | private MesProProcessService processService; |
| 44 | - | |
| 45 | 42 | @Resource |
| 46 | 43 | @Lazy |
| 47 | 44 | private MesProRouteService routeService; |
| ... | ... | @@ -192,7 +189,7 @@ public class MesProRouteProcessServiceImpl implements MesProRouteProcessService |
| 192 | 189 | @Override |
| 193 | 190 | public List<MesProRouteProcessDO> getRouteProcessListByProductId(Long productId) { |
| 194 | 191 | // 1. 根据产品查找关联的工艺路线产品记录 |
| 195 | - MesProRouteProductDO routeProduct = routeProductMapper.selectByItemId(productId); | |
| 192 | + MesProRouteProductDO routeProduct = routeProductService.getRouteProductByItemId(productId); | |
| 196 | 193 | if (routeProduct == null) { |
| 197 | 194 | // TODO @芋艿:会不会存在配置了多个的情况??? |
| 198 | 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 | 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 | 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 | 105 | } |
| 106 | 106 | |
| 107 | 107 | @Override |
| 108 | + public MesProRouteProductDO getRouteProductByItemId(Long itemId) { | |
| 109 | + return routeProductMapper.selectByItemId(itemId); | |
| 110 | + } | |
| 111 | + | |
| 112 | + @Override | |
| 108 | 113 | public List<MesProRouteProductDO> getRouteProductListByRouteId(Long routeId) { |
| 109 | 114 | return routeProductMapper.selectListByRouteId(routeId); |
| 110 | 115 | } | ... | ... |