From ce3f55e4daea0640fd5065b8e655c3b177e79b9b Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期一, 25 八月 2025 15:55:22 +0800
Subject: [PATCH] 设备管理首页列表接口

---
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml           |    1 
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java   |   16 ++++++--
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml         |    2 
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentServiceImpl.java      |    4 +-
 lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java |   18 ++++++--
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportRepairDto.java                    |   35 +++++++++++++++++
 lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java           |   37 ++++++++++++++++++
 7 files changed, 101 insertions(+), 12 deletions(-)

diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportRepairDto.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportRepairDto.java
index 7f4dad5..9dd52ee 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportRepairDto.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/dto/EamReportRepairDto.java
@@ -1,5 +1,6 @@
 package org.jeecg.modules.eam.dto;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
@@ -88,6 +89,7 @@
     @TableField(exist = false)
     private String installationPosition;
 
+
     /**鏄惁鏈夎澶囨搷浣滆瘉 鏄惁*/
     @Dict(dicCode = "yn")
     private String operationCertificate;
@@ -112,4 +114,37 @@
     /**閫犳垚缁撴灉*/
     private String causingResults;
 
+    /**鎶�鏈姸鎬�*/
+    @TableField(exist = false)
+    @Excel(name = "鎶�鏈姸鎬�", width = 15, orderNum = "8",dicCode = "equipment_technology_status")
+    @ApiModelProperty(value = "鎶�鏈姸鎬�")
+    @Dict(dicCode = "equipment_technology_status")
+    private String technologyStatus;
+
+    @ApiModelProperty(value = "涓績")
+    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
+    private transient String zxfactoryOrgCode;
+
+    @ApiModelProperty(value = "宸ュ尯")
+    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
+    private transient String gqfactoryOrgCode;
+
+    @ApiModelProperty(value = "涓績/宸ュ尯/宸ユ")
+    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "factory_code")
+    private String factoryOrgCode;
+
+    public void setFactoryOrgCode(String factoryOrgCode){
+        this.factoryOrgCode = factoryOrgCode;
+        if(StrUtil.isNotEmpty(factoryOrgCode)){
+            if(factoryOrgCode.length()==12){
+                this.gqfactoryOrgCode = factoryOrgCode.substring(0,9);
+                this.zxfactoryOrgCode = factoryOrgCode.substring(0,6);
+            }
+
+            if(factoryOrgCode.length()==9){
+                this.zxfactoryOrgCode = factoryOrgCode.substring(0,6);
+            }
+
+        }
+    }
 }
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java
index 3c1fdae..157037a 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamThirdMaintenanceOrder.java
@@ -1,5 +1,6 @@
 package org.jeecg.modules.eam.entity;
 
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -259,4 +260,40 @@
     /**娴佺▼涓氬姟瀹炰緥id 涓�涓祦绋嬩笟鍔″敮涓�锛屾湰琛ㄤ腑涔熷敮涓�*/
     @TableField(exist = false)
     private String processInstanceId;
+
+    /**鎶�鏈姸鎬�*/
+    @TableField(exist = false)
+    @ApiModelProperty(value = "鎶�鏈姸鎬�")
+    @Dict(dicCode = "equipment_technology_status")
+    private String technologyStatus;
+
+    @ApiModelProperty(value = "涓績")
+    @TableField(exist = false)
+    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
+    private transient String zxfactoryOrgCode;
+
+    @ApiModelProperty(value = "宸ュ尯")
+    @TableField(exist = false)
+    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code")
+    private transient String gqfactoryOrgCode;
+
+    @ApiModelProperty(value = "涓績/宸ュ尯/宸ユ")
+    @TableField(exist = false)
+    @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "factory_code")
+    private String factoryOrgCode;
+
+    public void setFactoryOrgCode(String factoryOrgCode){
+        this.factoryOrgCode = factoryOrgCode;
+        if(StrUtil.isNotEmpty(factoryOrgCode)){
+            if(factoryOrgCode.length()==12){
+                this.gqfactoryOrgCode = factoryOrgCode.substring(0,9);
+                this.zxfactoryOrgCode = factoryOrgCode.substring(0,6);
+            }
+
+            if(factoryOrgCode.length()==9){
+                this.zxfactoryOrgCode = factoryOrgCode.substring(0,6);
+            }
+
+        }
+    }
 }
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
index a4d054b..acaadef 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
@@ -50,6 +50,7 @@
     </select>
     <select id="queryPageList" resultType="org.jeecg.modules.eam.dto.EamReportRepairDto">
         select wmo.*, e.equipment_code, e.equipment_name,e.equipment_model, e.installation_position,
+               e.factory_org_code,
               aar.operation_certificate, power_off_restart, batch_first_piece, variable_factors,
               variable_factors_value, execute_nc, accident_phenomenon, measure, causing_results
         from eam_report_repair wmo
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 24afdf3..df82d08 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
@@ -187,7 +187,7 @@
                 queryWrapper.like("e.asset_status", eamEquipment.getAssetStatus());
             }
             if (StringUtils.isNotBlank(eamEquipment.getTechnologyStatus())) {
-                queryWrapper.like("e.technology_status", eamEquipment.getTechnologyStatus());
+                queryWrapper.like("ext.technology_status", eamEquipment.getTechnologyStatus());
             }
             if (StringUtils.isNotBlank(eamEquipment.getOperationSystem())) {
                 queryWrapper.like("e.operation_system", eamEquipment.getOperationSystem());
@@ -368,7 +368,7 @@
                 queryWrapper.like("e.asset_status", eamEquipment.getAssetStatus());
             }
             if (StringUtils.isNotBlank(eamEquipment.getTechnologyStatus())) {
-                queryWrapper.like("e.technology_status", eamEquipment.getTechnologyStatus());
+                queryWrapper.like("ext.technology_status", eamEquipment.getTechnologyStatus());
             }
             if (StringUtils.isNotBlank(eamEquipment.getOperationSystem())) {
                 queryWrapper.like("e.operation_system", eamEquipment.getOperationSystem());
diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
index c4cb2a2..0f5f2b3 100644
--- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
+++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java
@@ -54,7 +54,6 @@
 
     @Resource
     private IEamEquipmentExtendService eamEquipmentExtendService;
-
     @Autowired
     private IBaseFactoryUserService baseFactoryUserService;
     @Autowired
@@ -467,6 +466,7 @@
      */
     @Override
     public IPage<EamReportRepairDto> reportRepairList(String code, Page<EamReportRepairDto> page){
+        IPage<EamReportRepairDto> eamReportRepairDtoIPage=new Page<>();
         // 鐢ㄦ埛鏁版嵁鏉冮檺妫�鏌�
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         if (sysUser == null) {
@@ -503,11 +503,19 @@
         queryWrapper.orderByDesc("wmo.create_time");
         switch (code){
             case "bx":
-                return baseMapper.queryPageList(page,queryWrapper);
+                eamReportRepairDtoIPage=baseMapper.queryPageList(page,queryWrapper);
+                break;
             case "stop":
-                return baseMapper.queryPageList(page,queryWrapper.eq("breakdown_flag", "1"));
+                eamReportRepairDtoIPage=baseMapper.queryPageList(page,queryWrapper.eq("breakdown_flag", "1"));
+                break;
             default:
-                return baseMapper.queryPageList(page,queryWrapper.eq("breakdown_flag", "0"));
+                eamReportRepairDtoIPage=baseMapper.queryPageList(page,queryWrapper.eq("breakdown_flag", "0"));
+                break;
         }
+        eamReportRepairDtoIPage.getRecords().forEach(eamReportRepairDto -> {
+            eamReportRepairDto.setTechnologyStatus(eamEquipmentExtendService.getById(eamReportRepairDto.getEquipmentId()).getTechnologyStatus());
+        });
+        return eamReportRepairDtoIPage;
     }
+
 }
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml
index e7d4de6..5ebb726 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamThirdMaintenanceOrderMapper.xml
@@ -3,7 +3,7 @@
 <mapper namespace="org.jeecg.modules.eam.mapper.EamThirdMaintenanceOrderMapper">
 
     <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder">
-        select wmo.*, e.equipment_code, e.equipment_name, e.equipment_model,f.process_instance_id as 'procInstId',
+        select wmo.*, e.equipment_code, e.equipment_name, e.equipment_model,e.factory_org_code,f.process_instance_id as 'procInstId',
                f.process_definition_key,
                f.process_definition_id,
                f.process_instance_id
diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
index abd8ec3..97133c1 100644
--- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
+++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamThirdMaintenanceOrderServiceImpl.java
@@ -814,6 +814,7 @@
      */
     @Override
     public IPage<EamThirdMaintenanceOrder> maintenanceList(String code, Page<EamThirdMaintenanceOrder> page){
+        IPage<EamThirdMaintenanceOrder> eamThirdMaintenanceOrderIPage=new Page<>();
         // 鐢ㄦ埛鏁版嵁鏉冮檺妫�鏌�
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         if (sysUser == null) {
@@ -852,23 +853,30 @@
         switch (code){
             case "bysbzs":
                 // 鏈湀涓変繚璁″垝鎬绘暟
-                return this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", currentYearMonth));
+                eamThirdMaintenanceOrderIPage=this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", currentYearMonth));
+                break;
             case "bwc":
                 // 鏈湀瀹屾垚
-                return this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", currentYearMonth)
+                eamThirdMaintenanceOrderIPage=this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", currentYearMonth)
                         .eq("maintenance_status", ThirdMaintenanceStatusEnum.COMPLETE.name()));
+                break;
             case "xysb":
                 // 涓嬫湀涓変繚璁″垝
                 String nextMonth = LocalDate.now().plusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
-                return this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", nextMonth));
+                eamThirdMaintenanceOrderIPage=this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", nextMonth));
+                break;
             case "xxysb":
                 // 涓嬩笅鏈堜笁淇濊鍒�
                 String nextNextMonth = LocalDate.now().plusMonths(2).format(DateTimeFormatter.ofPattern("yyyy-MM"));
-                return this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", nextNextMonth));
+                eamThirdMaintenanceOrderIPage=this.baseMapper.queryPageList(page,queryWrapper.clone().like("maintenance_date", nextNextMonth));
+                break;
             default:
                 break;
         }
-        return null;
+        eamThirdMaintenanceOrderIPage.getRecords().forEach(eamThirdMaintenanceOrder -> {
+            eamThirdMaintenanceOrder.setTechnologyStatus(eamEquipmentExtendService.getById(eamThirdMaintenanceOrder.getEquipmentId()).getTechnologyStatus());
+        });
+        return eamThirdMaintenanceOrderIPage;
     }
 
     /**

--
Gitblit v1.9.3