Commit 71c9a8ad90c329cacb8bd4ee37c963a37430f0de
1 parent
b070e13e
✨ feat(mes): 优化工艺路线管理功能,调整状态处理逻辑
移除工艺路线状态的必填验证,调整状态字段为可选。更新状态切换逻辑,增强用户交互体验,确保状态操作的可用性和提示信息的准确性。
Showing
1 changed file
with
3 additions
and
2 deletions
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/service/pro/route/MesProRouteServiceImpl.java
| ... | ... | @@ -59,6 +59,7 @@ public class MesProRouteServiceImpl implements MesProRouteService { |
| 59 | 59 | validateRouteCodeUnique(null, createReqVO.getCode()); |
| 60 | 60 | // 2. 插入 |
| 61 | 61 | MesProRouteDO route = BeanUtils.toBean(createReqVO, MesProRouteDO.class); |
| 62 | + route.setStatus(CommonStatusEnum.DISABLE.getStatus()); | |
| 62 | 63 | routeMapper.insert(route); |
| 63 | 64 | return route.getId(); |
| 64 | 65 | } |
| ... | ... | @@ -143,8 +144,8 @@ public class MesProRouteServiceImpl implements MesProRouteService { |
| 143 | 144 | List<MesProRouteProductBomDO> bomList = routeProductBomService |
| 144 | 145 | .getRouteProductBomList(routeId, null, product.getItemId()); |
| 145 | 146 | if (CollUtil.isEmpty(bomList)) { |
| 146 | - MesMdItemDO item = itemService.getItem(product.getItemId()); | |
| 147 | - throw exception(PRO_ROUTE_ENABLE_PRODUCT_NO_BOM, item != null ? item.getItemName() : product.getItemId()); | |
| 147 | + MesMdItemDO item = itemService.validateItemExists(product.getItemId()); | |
| 148 | + throw exception(PRO_ROUTE_ENABLE_PRODUCT_NO_BOM, item.getName()); | |
| 148 | 149 | } |
| 149 | 150 | } |
| 150 | 151 | } | ... | ... |