From 2b9ff0c274a847af41b2f5a04de1b23ed6fbb9bb Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 25 八月 2025 15:50:15 +0800
Subject: [PATCH] mdc模块更新

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java |   99 -------------------------------------------------
 1 files changed, 0 insertions(+), 99 deletions(-)

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 ad9d45f..f62dd20 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
@@ -1,22 +1,18 @@
 package org.jeecg.modules.mdc.service.impl;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang3.StringUtils;
-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.util.oConvertUtils;
 import org.jeecg.modules.mdc.dto.MdcEquDepDto;
 import org.jeecg.modules.mdc.dto.MdcEquProDto;
 import org.jeecg.modules.mdc.dto.MdcEquipmentDetailedDto;
-import org.jeecg.modules.mdc.dto.MdcEquipmentDto;
 import org.jeecg.modules.mdc.entity.*;
 import org.jeecg.modules.mdc.mapper.MdcEquipmentMapper;
-import org.jeecg.modules.mdc.mapper.MdcTorqueConfigMapper;
 import org.jeecg.modules.mdc.model.MdcEquipmentTree;
 import org.jeecg.modules.mdc.service.*;
 import org.jeecg.modules.mdc.util.DateUtils;
@@ -72,27 +68,15 @@
     private IEquipmentWorkLineService equipmentWorkLineService;
     @Resource
     private IMdcDriveTypeParamConfigService mdcDriveTypeParamConfigService;
-    @Resource
-    private MdcTorqueConfigMapper mdcTorqueConfigMapper;
 
     @Resource
     private IEquipmentLogService equipmentLogService;
-
-    @Resource
-    private IEquipmentBaseInfoService equipmentBaseInfoService;
 
     @Resource
     private ISysBaseAPI sysBaseApi;
 
     @Resource
     private IMdcAlarmInfoService mdcAlarmInfoService;
-
-    @Resource
-    private IMdcEquipmentThresholdService mdcEquipmentThresholdService;
-
-    @Resource
-    private IMdcOverrunAlarmService mdcOverrunAlarmService;
-
 
     @Override
     public Map<String, String> getDepNamesByEquipmentIds(List<String> equipmentIds) {
@@ -407,14 +391,6 @@
                             BigDecimal load = spindleload == null ? BigDecimal.ZERO : new BigDecimal(spindleload.toString());
                             if (StringUtils.isNotEmpty(devicePower) && oporation == 3) {
                                 value = new BigDecimal(devicePower).divide(new BigDecimal("380"), 2, BigDecimal.ROUND_HALF_UP).add(load).toString();
-                            } else {
-                                value = "0";
-                            }
-                        } else if ("torque".equals(englishName)) {
-                            // 鎵煩瀛楁
-                            MdcTorqueConfig mdcTorqueConfig = mdcTorqueConfigMapper.findLast(mdcEquipmentDetailedDto.getEquipmentId());
-                            if (mdcTorqueConfig != null) {
-                                value = String.valueOf(mdcTorqueConfig.getTorqueValue());
                             } else {
                                 value = "0";
                             }
@@ -734,66 +710,6 @@
     }
 
     /**
-     * 鐩戞帶璁惧杩愯鍙傛暟浠诲姟
-     */
-    @Override
-    public void monitoringSpeedProcess() {
-//        List<MdcEquipment> equipmentList = super.list(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getDriveType, "FANUC"));
-        List<MdcEquipment> equipmentList = super.list();
-        //List<MdcEquipment> equipmentList = super.list(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, "2140198"));
-
-        for (MdcEquipment mdcEquipment : equipmentList) {
-            List<MdcEquipmentThreshold> mdcEquipmentThresholdList = mdcEquipmentThresholdService.list(new LambdaQueryWrapper<MdcEquipmentThreshold>().eq(MdcEquipmentThreshold::getControlSystemType, mdcEquipment.getDriveType()));
-            if (mdcEquipmentThresholdList != null && !mdcEquipmentThresholdList.isEmpty()) {
-                String saveTableName = mdcEquipment.getSaveTableName();
-                StringBuilder builder = new StringBuilder();
-                for (MdcEquipmentThreshold mdcEquipmentThreshold : mdcEquipmentThresholdList) {
-                    builder.append(",").append(mdcEquipmentThreshold.getEnglishName()).append(" as \"").append(mdcEquipmentThreshold.getEnglishName()).append("\"  ");
-                }
-                Map<String, Object> param = new HashMap<>();
-                param.put("columns", builder.toString());
-                param.put("tableName", saveTableName);
-                Map<String, Object> map = new HashMap<>();
-                try {
-                    map = this.baseMapper.getWorkLineLast(param);
-                } catch (Exception e) {
-                    log.error("鏌ヨ鍗曡〃鏁版嵁鍑哄樊锛�", e);
-                }
-                if (!map.isEmpty()) {
-                    for (MdcEquipmentThreshold mdcEquipmentThreshold : mdcEquipmentThresholdList) {
-                        Integer actualValue = Integer.valueOf(map.get(mdcEquipmentThreshold.getEnglishName()).toString());
-                        Integer max = mdcEquipmentThreshold.getMaxThreshold();
-                        Integer min = mdcEquipmentThreshold.getMinThreshold();
-                        MessageDTO messageDTO = new MessageDTO();
-                        messageDTO.setTitle("璁惧" + mdcEquipmentThreshold.getChineseName() + "鎶ヨ锛�");
-                        messageDTO.setCategory("棰勮娑堟伅");
-                        messageDTO.setFromUser("admin");
-                        messageDTO.setToUser("admin");
-                        MdcOverrunAlarm mdcOverrunAlarm = new MdcOverrunAlarm();
-                        mdcOverrunAlarm.setEquipmentId(mdcEquipment.getEquipmentId());
-                        mdcOverrunAlarm.setSetValue(min + "-" + max);
-                        mdcOverrunAlarm.setRealValue(actualValue.toString());
-                        if (actualValue > max) {
-                            // 楂�
-                            messageDTO.setContent("璁惧缂栧彿涓� [" + mdcEquipment.getEquipmentId() + "] 鐨勮澶�" + mdcEquipmentThreshold.getChineseName() + "楂樻姤璀︼紒");
-                            sysBaseApi.sendSysAnnouncement(messageDTO);
-                            mdcOverrunAlarm.setAlarmContent(mdcEquipmentThreshold.getChineseName() + "楂樻姤璀�");
-                            mdcOverrunAlarmService.save(mdcOverrunAlarm);
-                        } else if (actualValue < min) {
-                            // 浣�
-                            messageDTO.setContent("璁惧缂栧彿涓� [" + mdcEquipment.getEquipmentId() + "] 鐨勮澶�" + mdcEquipmentThreshold.getChineseName() + "浣庢姤璀︼紒");
-                            sysBaseApi.sendSysAnnouncement(messageDTO);
-                            mdcOverrunAlarm.setAlarmContent(mdcEquipmentThreshold.getChineseName() + "浣庢姤璀�");
-                            mdcOverrunAlarmService.save(mdcOverrunAlarm);
-                        }
-                    }
-                }
-            }
-        }
-
-    }
-
-    /**
      * 瀵煎嚭list
      *
      * @param mdcEquipment
@@ -834,21 +750,6 @@
         //濉厖璁惧鏁版嵁
         FillEquipmentByProduction(treeList);
         return treeList;
-    }
-
-    /**
-     * 鏌ヨ鍗曡〃鏁版嵁
-     *
-     * @param tableName
-     * @return
-     */
-    @Override
-    public MdcEquipmentDto getWorkLineLast(String tableName) {
-        try {
-            return this.baseMapper.findWorkLineLast(tableName);
-        } catch (Exception e) {
-            return null;
-        }
     }
 
     @Override

--
Gitblit v1.9.3