From 227eff61120aaca63e068035d745d86452e6499a Mon Sep 17 00:00:00 2001
From: hsy <1029150275@qq.com>
Date: 星期一, 17 八月 2026 09:35:12 +0800
Subject: [PATCH] feat(mes): 优化生产订单与排产任务列表显示,新增启停工及校验逻辑 1. 生产订单列表展示优化 (WorkOrder) - 新增「生产状态」列,全局注册 `ORDER_PRODUCTION_STATUS` 常量并绑定系统动态字典。 - 彻底重构「工序生产进度」单元格显示:弃用臃肿的 Steps 组件,改为极简横向布局(彩色状态圆点 + 进度百分比),解决表格行高被强行撑开及内容截断问题,支持横向滚动。 - 优化「完成进度」列宽及展示样式,将百分比数值外置同行显示,更加直观。 2. 排产任务列表改造 (Task) - 顶部表头重构,由单一标题重构为「全部 / 未完成 / 已完成」的 Tabs 标签页切换结构。 - 重写数据过滤逻辑,剥离写死的 status 查询,改为使用 `scheduleStatus` 字段动态响应 Tabs 切换 (0: 未完成, 1: 已完成)。 3. 工单业务逻辑增强与状态流转 - 落实「工单查询逻辑设计方案」,优化底层的工单条件检索逻辑。 - 实现「添加工单启停功能」与「停工状态」,支持工单在执行过程中的暂停与恢复业务流转。 - 强化容错与防呆设计:操作「完成订单」时增加前置校验 `handleCheckFinish`,若生产状态为未完成,强制弹出二次确认 Modal,避免误操作。 # 相关讨论/参考方案 # - 添加工单启停功能 # - 停工状态功能设计方案 # - 工单查询逻辑设计方案 # - 工单完成进度显示优化
---
yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java | 94 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 94 insertions(+), 0 deletions(-)
diff --git a/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java
new file mode 100644
index 0000000..1309623
--- /dev/null
+++ b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/dal/mysql/item/MdmItemMapper.java
@@ -0,0 +1,94 @@
+package cn.iocoder.yudao.module.mdm.dal.mysql.item;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.mdm.controller.admin.item.vo.MdmItemPageReqVO;
+import cn.iocoder.yudao.module.mdm.dal.dataobject.item.MdmItemDO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * MDM 鐗╂枡涓绘暟鎹� Mapper
+ *
+ * @author 瓒呯骇绠$悊鍛�
+ */
+@Mapper
+public interface MdmItemMapper extends BaseMapperX<MdmItemDO> {
+
+ default PageResult<MdmItemDO> selectPage(MdmItemPageReqVO reqVO, Collection<Long> categoryIds) {
+ return selectPage(reqVO, new LambdaQueryWrapperX<MdmItemDO>()
+ .likeIfPresent(MdmItemDO::getCode, reqVO.getCode())
+ .likeIfPresent(MdmItemDO::getName, reqVO.getName())
+ .likeIfPresent(MdmItemDO::getBarCode, reqVO.getBarCode())
+ .inIfPresent(MdmItemDO::getCategoryId, categoryIds)
+ .eqIfPresent(MdmItemDO::getItemType, reqVO.getItemType())
+ .eqIfPresent(MdmItemDO::getBrandId, reqVO.getBrandId())
+ .eqIfPresent(MdmItemDO::getStatus, reqVO.getStatus())
+ .betweenIfPresent(MdmItemDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(MdmItemDO::getId));
+ }
+
+ default List<MdmItemDO> selectList(MdmItemPageReqVO reqVO, Collection<Long> categoryIds) {
+ return selectList(new LambdaQueryWrapperX<MdmItemDO>()
+ .likeIfPresent(MdmItemDO::getCode, reqVO.getCode())
+ .likeIfPresent(MdmItemDO::getName, reqVO.getName())
+ .inIfPresent(MdmItemDO::getCategoryId, categoryIds)
+ .eqIfPresent(MdmItemDO::getItemType, reqVO.getItemType())
+ .eqIfPresent(MdmItemDO::getStatus, reqVO.getStatus())
+ .orderByDesc(MdmItemDO::getId));
+ }
+
+ default MdmItemDO selectByCode(String code) {
+ return selectOne(MdmItemDO::getCode, code);
+ }
+
+ /**
+ * 鏍规嵁缂栫爜鍜屽垹闄ょ姸鎬佹煡璇㈢墿鏂欙紙鐢ㄤ簬瑙e喅杞垹闄ゅ敮涓�閿啿绐侊級
+ */
+ default MdmItemDO selectByCodeAndDeleted(String code, Boolean deleted) {
+ return selectOne(new LambdaQueryWrapperX<MdmItemDO>()
+ .eq(MdmItemDO::getCode, code)
+ .eq(MdmItemDO::getDeleted, deleted));
+ }
+
+ /**
+ * 鐗╃悊鍒犻櫎锛堢敤浜庢竻鐞嗗凡杞垹闄ょ殑閲嶅璁板綍锛�
+ * 娉ㄦ剰锛氱敱浜� BaseDO 鏈� @TableLogic锛宒eleteById 鏄蒋鍒犻櫎锛岄渶瑕佷娇鐢ㄥ師鐢� SQL
+ */
+ @org.apache.ibatis.annotations.Delete("DELETE FROM mdm_item WHERE id = #{id}")
+ void physicalDeleteById(Long id);
+
+ default MdmItemDO selectByBarCode(String barCode) {
+ return selectOne(MdmItemDO::getBarCode, barCode);
+ }
+
+ default Long selectCountByCategoryId(Long categoryId) {
+ return selectCount(MdmItemDO::getCategoryId, categoryId);
+ }
+
+ default Long selectCountByUnitMeasureId(Long unitMeasureId) {
+ return selectCount(MdmItemDO::getUnitMeasureId, unitMeasureId);
+ }
+
+ default Long selectCountByBrandId(Long brandId) {
+ return selectCount(MdmItemDO::getBrandId, brandId);
+ }
+
+ default List<MdmItemDO> selectListByIds(Collection<Long> ids) {
+ return selectList(MdmItemDO::getId, ids);
+ }
+
+ /**
+ * 鏌ヨ鐗╂枡琚摢浜涗笟鍔¤〃寮曠敤锛堟湭鍒犻櫎鐨勮褰曪級
+ *
+ * @param itemId 鐗╂枡缂栧彿
+ * @return 寮曠敤鏉ユ簮鍒楄〃锛屾瘡椤瑰寘鍚� source(鏉ユ簮鍚�) 鍜� cnt(寮曠敤鏁伴噺)锛屼粎杩斿洖 cnt > 0 鐨�
+ */
+ List<Map<String, Object>> selectItemReferenceCount(@Param("itemId") Long itemId);
+
+}
\ No newline at end of file
--
Gitblit v1.9.3