From ee530992793ed7d0b7f16f1ce07b6c53ae265068 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期二, 22 七月 2025 13:56:40 +0800
Subject: [PATCH] art: 技术状态变更申请-字典转译

---
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java |   46 +++++++++++++++++++++++++++++++---------------
 1 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
index 7c1226b..5dbd7b1 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java
@@ -14,25 +14,22 @@
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog;
-import org.jeecg.modules.eam.tree.FindsEquipmentEamCenterUtil;
-import org.jeecg.modules.system.entity.BaseFactory;
-import org.jeecg.modules.system.entity.BaseFactoryUser;
-import org.jeecg.modules.system.service.IBaseFactoryService;
-import org.jeecg.modules.system.service.IBaseFactoryUserService;
-import org.jeecg.modules.eam.constant.AssetStatusEnum;
-import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus;
-import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum;
-import org.jeecg.modules.eam.constant.EquipmentRepairStatus;
+import org.jeecg.modules.eam.constant.*;
 import org.jeecg.modules.eam.entity.EamEquipment;
 import org.jeecg.modules.eam.entity.EamEquipmentExtend;
 import org.jeecg.modules.eam.mapper.EamEquipmentMapper;
 import org.jeecg.modules.eam.request.EamEquipmentQuery;
 import org.jeecg.modules.eam.service.IEamEquipmentExtendService;
 import org.jeecg.modules.eam.service.IEamEquipmentService;
+import org.jeecg.modules.eam.tree.FindsEquipmentEamCenterUtil;
 import org.jeecg.modules.eam.tree.FindsEquipmentProductionUtil;
 import org.jeecg.modules.eam.vo.EamEquipmentTree;
 import org.jeecg.modules.eam.vo.EquipmentSearchResult;
+import org.jeecg.modules.system.entity.BaseFactory;
+import org.jeecg.modules.system.entity.BaseFactoryUser;
 import org.jeecg.modules.system.entity.MdcProduction;
+import org.jeecg.modules.system.service.IBaseFactoryService;
+import org.jeecg.modules.system.service.IBaseFactoryUserService;
 import org.jeecg.modules.system.service.IMdcProductionService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -205,6 +202,12 @@
             if (StringUtils.isNotBlank(eamEquipment.getEquipmentCategory())) {
                 queryWrapper.like("e.equipment_category", eamEquipment.getEquipmentCategory());
             }
+            if (StringUtils.isNotBlank(eamEquipment.getFactoryOrgCode())) {
+                queryWrapper.like("e.factory_org_code", eamEquipment.getFactoryOrgCode());
+            }
+            if (StringUtils.isNotBlank(eamEquipment.getRepairDepartOrgCode())) {
+                queryWrapper.like("e.repair_depart_org_code", eamEquipment.getRepairDepartOrgCode());
+            }
             if (StringUtils.isNotBlank(eamEquipment.getId())) {
                 queryWrapper.eq("e.id", eamEquipment.getId());
             }
@@ -232,7 +235,7 @@
     }
 
     @Override
-    public List<EquipmentSearchResult> asyncLoadEquipment(String keyword, Integer pageSize, String id) {
+    public List<EquipmentSearchResult> asyncLoadEquipment(String keyword, Integer pageSize, String id, String factoryOrgCode) {
         if (StringUtils.isNotBlank(id)) {
             EamEquipment eamEquipment = eamEquipmentMapper.selectById(id);
             if (eamEquipment != null) {
@@ -258,7 +261,7 @@
                     list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId()));
             if(!CollectionUtils.isEmpty(baseFactoryUserList)){
                 Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet());
-                Set<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet());
+                Set<String> factoryCode = baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet());
                 queryWrapper.in("e.factory_org_code", factoryCode);
             } else {
                 return Collections.emptyList();
@@ -266,10 +269,13 @@
         }
 
         if (StringUtils.isNotBlank(keyword)) {
-            queryWrapper.like("equipment_code", keyword);
-            queryWrapper.or().like("equipment_name", keyword);
+            queryWrapper.like("e.equipment_code", keyword);
+            queryWrapper.or().like("e.equipment_name", keyword);
         }
-        queryWrapper.eq("del_flag", CommonConstant.DEL_FLAG_0);
+        if(StringUtils.isNotBlank(factoryOrgCode)){
+            queryWrapper.likeRight("e.factory_org_code", factoryOrgCode);
+        }
+        queryWrapper.eq("e.del_flag", CommonConstant.DEL_FLAG_0);
         IPage<EamEquipment> pageResult = eamEquipmentMapper.queryPageList(page, queryWrapper);
         if (pageResult != null && CollectionUtil.isNotEmpty(pageResult.getRecords())) {
             List<EquipmentSearchResult> resultList = new ArrayList<>();
@@ -292,7 +298,7 @@
         if (sysUser == null) {
             return null;
         }
-        if (StringUtils.isNotBlank(sysUser.getEquipmentIds())) {
+        if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) {
             //閫夋嫨浜嗚澶囷紝鏍规嵁璁惧id杩囨护璁惧
             List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(","));
             queryWrapper.in("equipment_code", equipArr);
@@ -401,6 +407,16 @@
         return eamEquipmentMapper.queryList(queryWrapper);
     }
 
+    @Override
+    public List<EamEquipment> selectTechnicalEquipmentList() {
+        QueryWrapper<EamEquipment> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("e.del_flag", CommonConstant.DEL_FLAG_0);
+        queryWrapper.ne("ext.technology_status", TechnologyStatusEnum.PROHIBITED.name());
+        queryWrapper.isNotNull("ext.technology_check_period");
+        queryWrapper.isNotNull("ext.next_technology_check");
+        return this.getBaseMapper().selectTechnicalEquipmentList(queryWrapper);
+    }
+
     /**
      * 鑾峰彇鎵�鏈夌殑浜х嚎id锛堝寘鍚墍鏈変笂绾э級
      */

--
Gitblit v1.9.3