From ebb0ec9bd15de8185994962c37b15a94c8b4ee0d Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 13 一月 2025 20:05:16 +0800
Subject: [PATCH] update

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentWorklineMapper.java       |    2 
 lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml                   |   45 ++++------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml         |    2 
 lxzn-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java               |    5 +
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java    |    2 
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java |   83 ++++++++++++++------
 lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml                  |   93 +++++++----------------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentVo.java                    |    1 
 8 files changed, 113 insertions(+), 120 deletions(-)

diff --git a/lxzn-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java b/lxzn-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
index d030448..77d57fb 100644
--- a/lxzn-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
+++ b/lxzn-boot-base-core/src/main/java/org/jeecg/common/constant/CommonConstant.java
@@ -605,4 +605,9 @@
 
     String CLOSE_TYPE_2 = "2";
 
+    /**
+     * 璁惧鐘舵�佸瓧鍏哥紪鍙�
+     */
+    String DICT_EQUIPMENT_STATUS = "mdc_equipment_status";
+
 }
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java
index 5f3a954..86271ab 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentController.java
@@ -233,7 +233,7 @@
         Result<MdcEquipment> result = new Result<>();
         String selectedDeparts = mdcEquipment.getSelectedDeparts();
         String selectedProduction = mdcEquipment.getSelectedProduction();
-        mdcEquipment.setEquipmentStatus(CommonConstant.STATUS_NORMAL);
+//        mdcEquipment.setEquipmentStatus(CommonConstant.STATUS_NORMAL);
         try {
             mdcEquipmentService.saveMdcEquipment(mdcEquipment, selectedDeparts, selectedProduction);
             result.success("娣诲姞鎴愬姛锛�");
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentWorklineMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentWorklineMapper.java
index 40de87a..49eef7a 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentWorklineMapper.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentWorklineMapper.java
@@ -25,7 +25,7 @@
 
     @InterceptorIgnore(tenantLine = "1")
     @Select("select Sequencenumber,CollectTime from  ${tableName} " +
-            " where CollectTime > #{startTime} and CollectTime <= #{endTime} and Sequencenumber is not null" +
+            " where CollectTime > #{startTime} and CollectTime <= #{endTime} and Sequencenumber is not null and Sequencenumber != ''" +
             "  order by CollectTime desc ")
     List<Map<String, Object>> getEquipmentSequenceNumber(@Param("tableName") String tableName, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
 
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
index 828999f..0d8024e 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentMapper.xml
@@ -142,6 +142,7 @@
             <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                 #{id}
             </foreach>
+            AND me.equipment_status = 0
         </where>
         ORDER BY sd.depart_order
     </select>
@@ -165,6 +166,7 @@
             <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")">
                 #{id}
             </foreach>
+            AND me.equipment_status = 0
         </where>
         ORDER BY mp.production_order
     </select>
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
index 6864afd..9795fa8 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
@@ -9,6 +9,7 @@
 import org.jeecg.common.api.dto.message.MessageDTO;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.api.ISysBaseAPI;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.mdc.dto.MdcEquDepDto;
 import org.jeecg.modules.mdc.dto.MdcEquProDto;
@@ -29,10 +30,7 @@
 import org.jeecg.modules.system.entity.SysDepart;
 import org.jeecg.modules.system.mapper.MdcEquipmentDepartMapper;
 import org.jeecg.modules.system.mapper.MdcProductionEquipmentMapper;
-import org.jeecg.modules.system.service.IMdcProductionService;
-import org.jeecg.modules.system.service.IMdcUserProductionService;
-import org.jeecg.modules.system.service.ISysDepartService;
-import org.jeecg.modules.system.service.ISysUserDepartService;
+import org.jeecg.modules.system.service.*;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -67,8 +65,6 @@
     @Resource
     private IMdcProductionService mdcProductionService;
     @Resource
-    private IControlSystemService controlSystemService;
-    @Resource
     private IEquipmentWorkLineService equipmentWorkLineService;
     @Resource
     private IMdcDriveTypeParamConfigService mdcDriveTypeParamConfigService;
@@ -77,9 +73,6 @@
 
     @Resource
     private IEquipmentLogService equipmentLogService;
-
-    @Resource
-    private IEquipmentBaseInfoService equipmentBaseInfoService;
 
     @Resource
     private ISysBaseAPI sysBaseApi;
@@ -93,6 +86,11 @@
     @Resource
     private IMdcOverrunAlarmService mdcOverrunAlarmService;
 
+    @Resource
+    private IEquipmentXYZService equipmentXYZService;
+
+    @Resource
+    private ISysDictService sysDictService;
 
     @Override
     public Map<String, String> getDepNamesByEquipmentIds(List<String> equipmentIds) {
@@ -326,25 +324,35 @@
         List<MdcEquipmentMonitor> result = this.baseMapper.checkStatusFromEquipmentIds(equipmentIds);
         if (result != null && !result.isEmpty()) {
             for (MdcEquipmentMonitor mdcEquipmentMonitor : result) {
-                if (mdcEquipmentMonitor.getOporation() != null) {
-                    switch (mdcEquipmentMonitor.getOporation()) {
-                        case 1:
-                        case 2:
-                            mdcEquipmentMonitor.setOporationDict("寰呮満");
-                            break;
-                        case 3:
-                            mdcEquipmentMonitor.setOporationDict("杩愯");
-                            break;
-                        case 22:
-                            mdcEquipmentMonitor.setOporationDict("鎶ヨ");
-                            break;
-                        default:
-                            mdcEquipmentMonitor.setOporationDict("鍏虫満");
-                            break;
+                if (mdcEquipmentMonitor.getEquipmentStatus() == 0) {
+                    if (mdcEquipmentMonitor.getOporation() != null) {
+                        switch (mdcEquipmentMonitor.getOporation()) {
+                            case 1:
+                            case 2:
+                                mdcEquipmentMonitor.setOporationDict("寰呮満");
+                                break;
+                            case 3:
+                                mdcEquipmentMonitor.setOporationDict("杩愯");
+                                break;
+                            case 22:
+                                mdcEquipmentMonitor.setOporationDict("鎶ヨ");
+                                break;
+                            default:
+                                mdcEquipmentMonitor.setOporationDict("鍏虫満");
+                                break;
+                        }
+                    } else {
+                        mdcEquipmentMonitor.setOporationDict("鍏虫満");
+                        mdcEquipmentMonitor.setOporation(0);
                     }
                 } else {
-                    mdcEquipmentMonitor.setOporationDict("鍏虫満");
-                    mdcEquipmentMonitor.setOporation(0);
+                    List<DictModel> dictList = sysDictService.queryEnableDictItemsByCode(CommonConstant.DICT_EQUIPMENT_STATUS);
+                    for (DictModel dictModel : dictList) {
+                        if (Integer.valueOf(dictModel.getValue()).equals(mdcEquipmentMonitor.getEquipmentStatus())) {
+                            mdcEquipmentMonitor.setOporationDict(dictModel.getLabel());
+                            mdcEquipmentMonitor.setOporation(88);
+                        }
+                    }
                 }
             }
         }
@@ -454,6 +462,26 @@
                 }
             }
             result.put("runData", runData);
+
+            //鍧愭爣淇℃伅
+            // 鏌ヨ鍧愭爣淇℃伅
+            EquipmentXYZ equipmentXYZ = equipmentXYZService.getByEquipmentId(mdcEquipmentDetailedDto.getEquipmentId());
+            if (equipmentXYZ != null) {
+                Map<String, Object> map = new HashMap<>();
+                map.put("xmachine", equipmentXYZ.getXMachine());
+                map.put("ymachine", equipmentXYZ.getYMachine());
+                map.put("zmachine", equipmentXYZ.getZMachine());
+                map.put("amachine", equipmentXYZ.getAMachine());
+                map.put("bmachine", equipmentXYZ.getBMachine());
+
+                map.put("xabsolute", equipmentXYZ.getXAbsolute());
+                map.put("yabsolute", equipmentXYZ.getYAbsolute());
+                map.put("zabsolute", equipmentXYZ.getZAbsolute());
+                map.put("aabsolute", equipmentXYZ.getAAbsolute());
+                map.put("babsolute", equipmentXYZ.getBAbsolute());
+                result.put("xyzList", map);
+            }
+
         }
         return result;
     }
@@ -578,6 +606,9 @@
         if (StringUtils.isNotEmpty(mdcEquipment.getEquipmentName())) {
             queryWrapper.like(MdcEquipment::getEquipmentName, mdcEquipment.getEquipmentName());
         }
+        if (mdcEquipment.getEquipmentStatus() != null) {
+            queryWrapper.eq(MdcEquipment::getEquipmentStatus, mdcEquipment.getEquipmentStatus());
+        }
         if (!allEquipments.isEmpty()) {
             queryWrapper.in(MdcEquipment::getEquipmentId, allEquipments);
         } else if (!equipmentIdsByDepart.isEmpty() && equipmentIdsProduction.isEmpty()) {
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentVo.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentVo.java
index 0f79ecb..d99d4e9 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentVo.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcEquipmentVo.java
@@ -15,6 +15,7 @@
     private String equipmentId;
     private String equipmentName;
     private String equipmentModel;
+    private Integer equipmentStatus;
     private String equipmentType;
     private String deviceLevel;
     private String deviceCategory;
diff --git a/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml b/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml
index 173a620..e1d3ec0 100644
--- a/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml
+++ b/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml
@@ -1,5 +1,7 @@
 锘縮erver:
   port: 9999
+#  connection-timeout: 80000
+#  disableUploadTimeout: false
   tomcat:
     max-swallow-size: -1
   error:
@@ -81,15 +83,15 @@
     type: com.alibaba.druid.pool.DruidDataSource
     druid:
       driverClassName: dm.jdbc.driver.DmDriver
-      url: jdbc:dm://192.168.124.118:5236/?LXZN_MDC_420&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
+      url: jdbc:dm://LOCALHOST:5236/?LXZN_MDC_420&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
       username: LXZN_MDC_420
       password: 123
   #redis 閰嶇疆
   redis:
     database: 0
-    host: 192.168.124.118
+    host: 127.0.0.1
     port: 6379
-    password:
+    password: 123456
 #mybatis plus 璁剧疆
 mybatis-plus:
   mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
@@ -177,7 +179,7 @@
     enabled: true
 #cas鍗曠偣鐧诲綍
 cas:
-  prefixUrl: http://cas.example.org:8443/cas
+  prefixUrl: http://127.0.0.1:8443/cas
 #Mybatis杈撳嚭sql鏃ュ織
 logging:
   level:
@@ -217,26 +219,15 @@
     type: default
     prefix: 'demo::'
     timeout: 1h
-#绗笁鏂笰PP瀵规帴
-third-app:
-  enabled: false
-  type:
-    #浼佷笟寰俊
-    WECHAT_ENTERPRISE:
-      enabled: false
-      #CORP_ID
-      client-id: ??
-      #SECRET
-      client-secret: ??
-      #鑷缓搴旂敤id
-      agent-id: ??
-      #鑷缓搴旂敤绉橀挜锛堟柊鐗堜紒寰渶瑕侀厤缃級
-      # agent-app-secret: ??
-    #閽夐拤
-    DINGTALK:
-      enabled: false
-      # appKey
-      client-id: ??
-      # appSecret
-      client-secret: ??
-      agent-id: ??
+fileService:
+  host: 127.0.0.1
+  port: 8299
+  username: admin
+  pwd: 123
+  addressToken: /outer/appAuth
+  addressUploadFile: /outer/fileUpload
+  localFilePath: D:/data/sql
+  servicePath: D:/data/sql
+  logIp: 127.0.0.1
+  logPort: 8888
+  newFilePath: D:/data/bak_sql/  #澶囦唤鍦板潃
diff --git a/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml b/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml
index 427bd7b..6f9feb1 100644
--- a/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml
+++ b/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml
@@ -38,39 +38,22 @@
   ## quartz瀹氭椂浠诲姟,閲囩敤鏁版嵁搴撴柟寮�
   quartz:
     job-store-type: jdbc
-    initialize-schema: embedded
+    jdbc:
+      initialize-schema: never
     #瀹氭椂浠诲姟鍚姩寮�鍏筹紝true-寮�  false-鍏�
     auto-startup: true
     #寤惰繜1绉掑惎鍔ㄥ畾鏃朵换鍔�
     startup-delay: 1s
     #鍚姩鏃舵洿鏂板繁瀛樺湪鐨凧ob
     overwrite-existing-jobs: true
-    properties:
-      org:
-        quartz:
-          scheduler:
-            instanceName: MyScheduler
-            instanceId: AUTO
-          jobStore:
-            selectWithLockSQL: SELECT* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?
-            # class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
-            # driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
-            # tablePrefix: QRTZ_
-            # isClustered: true
-            # misfireThreshold: 12000
-            # clusterCheckinInterval: 15000
-          threadPool:
-            class: org.quartz.simpl.SimpleThreadPool
-            threadCount: 10
-            threadPriority: 5
-            threadsInheritContextClassLoaderOfInitializingThread: true
   #json 鏃堕棿鎴崇粺涓�杞崲
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
   jpa:
-    open-in-view: false
-    database-platform: org.hibernate.dialect.SQLServerDialect
+    properties:
+      hibernate:
+        dialect: org.hibernate.dialect.Oracle8iDialect
   aop:
     proxy-target-class: true
   #閰嶇疆freemarker
@@ -95,53 +78,21 @@
       matching-strategy: ant_path_matcher
   resource:
     static-locations: classpath:/static/,classpath:/public/
-  autoconfigure:
-    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
+#  autoconfigure:
+#    exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
   datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
     druid:
-      stat-view-servlet:
-        enabled: true
-        loginUsername: admin
-        loginPassword: 123456
-        allow:
-      web-stat-filter:
-        enabled: true
-    dynamic:
-      druid: # 鍏ㄥ眬druid鍙傛暟锛岀粷澶ч儴鍒嗗�煎拰榛樿淇濇寔涓�鑷淬��(鐜板凡鏀寔鐨勫弬鏁板涓�,涓嶆竻妤氬惈涔変笉瑕佷贡璁剧疆)
-        # 杩炴帴姹犵殑閰嶇疆淇℃伅
-        # 鍒濆鍖栧ぇ灏忥紝鏈�灏忥紝鏈�澶�
-        initial-size: 5
-        min-idle: 5
-        maxActive: 1000
-        # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
-        maxWait: 60000
-        # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
-        timeBetweenEvictionRunsMillis: 60000
-        # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
-        minEvictableIdleTimeMillis: 300000
-        validationQuery: SELECT 1
-        testWhileIdle: true
-        testOnBorrow: false
-        testOnReturn: false
-        # 鎵撳紑PSCache锛屽苟涓旀寚瀹氭瘡涓繛鎺ヤ笂PSCache鐨勫ぇ灏�
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 20
-        # 閰嶇疆鐩戞帶缁熻鎷︽埅鐨刦ilters锛屽幓鎺夊悗鐩戞帶鐣岄潰sql鏃犳硶缁熻锛�'wall'鐢ㄤ簬闃茬伀澧�
-        filters: stat,wall,slf4j
-        # 閫氳繃connectProperties灞炴�ф潵鎵撳紑mergeSql鍔熻兘锛涙參SQL璁板綍
-        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
-      datasource:
-        master:
-          url: jdbc:sqlserver://195.0.1.10:1433;databasename=SSGX_kns
-          username: sa
-          password: Sa123456789
-          driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+      driverClassName: dm.jdbc.driver.DmDriver
+      url: jdbc:dm://LOCALHOST:5236/?LXZN_MDC&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
+      username: LXZN_MDC
+      password: 123
   #redis 閰嶇疆
   redis:
     database: 0
     host: 127.0.0.1
     port: 6379
-    password:
+    password: 123456
 #mybatis plus 璁剧疆
 mybatis-plus:
   mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
@@ -242,8 +193,8 @@
   production: false
   basic:
     enable: true
-    username: jeecg
-    password: jeecg1314
+    username: lxzn
+    password: lxzn1688
 #绗笁鏂圭櫥褰�
 justauth:
   enabled: true
@@ -291,4 +242,16 @@
       client-id: ??
       # appSecret
       client-secret: ??
-      agent-id: ??
\ No newline at end of file
+      agent-id: ??
+fileService:
+  host: 127.0.0.1
+  port: 8299
+  username: admin
+  pwd: 123
+  addressToken: /outer/appAuth
+  addressUploadFile: /outer/fileUpload
+  localFilePath: D:/data/sql
+  servicePath: D:/data/sql
+  logIp: 127.0.0.1
+  logPort: 8888
+  newFilePath: D:/data/bak_sql/  #澶囦唤鍦板潃
\ No newline at end of file

--
Gitblit v1.9.3