xushili hace 1 año
padre
commit
e203dff537
Se han modificado 32 ficheros con 1818 adiciones y 58 borrados
  1. 6 10
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/cache/InfoCache.java
  2. 2 5
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/controller/StationController.java
  3. 78 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/ModelConstants.java
  4. 36 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaAlertSnapDao.java
  5. 32 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaDeviceFaultDao.java
  6. 56 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaFaultHistoryDao.java
  7. 105 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaFaultSnapDao.java
  8. 44 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaLineDao.java
  9. 60 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaWarningDao.java
  10. 75 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaWindturbineDao.java
  11. 236 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/AlertRuleEntity.java
  12. 145 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/AlertSnapEntity.java
  13. 60 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/DeviceFaultEntity.java
  14. 67 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/FaultHistoryEntity.java
  15. 137 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/FaultInfoEntity.java
  16. 96 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/FaultSnapEntity.java
  17. 0 20
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/IThingsPointDao.java
  18. 117 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/LineEntity.java
  19. 89 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/WarningEntity.java
  20. 152 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/WindturbineEntity.java
  21. 13 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/AlertRuleRepository.java
  22. 29 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/AlertSnapRepository.java
  23. 19 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/DeviceFaultRepository.java
  24. 17 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/FaultHistoryRepository.java
  25. 28 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/FaultInfoRepository.java
  26. 54 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/FaultSnapRepository.java
  27. 1 1
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/IWindturbineDao.java
  28. 16 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/LineRepository.java
  29. 20 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/WarningRepository.java
  30. 27 0
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/WindturbineRepository.java
  31. 0 20
      web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/windturbine/IPowerStationDao.java
  32. 1 2
      web/runeconomy-xk/src/main/java/com/gyee/runeconomy/config/GyeeConfig.java

+ 6 - 10
web/runeconomy-xk/src/main/java/com/gyee/neic_service/cache/InfoCache.java

@@ -4,7 +4,6 @@ import com.alibaba.fastjson.TypeReference;
 import com.gyee.neic_service.config.FileManager;
 import com.gyee.neic_service.dao.alarm.IWarningDao;
 import com.gyee.neic_service.dao.entity.EquipmentModel;
-import com.gyee.neic_service.dao.entity.IThingsPointDao;
 import com.gyee.neic_service.dao.entity.Line;
 import com.gyee.neic_service.dao.entity.Windturbine;
 import com.gyee.neic_service.dao.repsoitory.ILineDao;
@@ -56,9 +55,6 @@ public class InfoCache {
     private IWindturbineDao windturbineDao;
 
     @Resource
-    private IThingsPointDao thingsPointDao;
-
-    @Resource
     private IWarningDao warningDao;
 
     @Resource
@@ -309,7 +305,7 @@ public class InfoCache {
      * 初始化场站标签点信息
      */
     private void initStationInfos() {
-        String[] ucs = getUniformCodes(WindStation.class);
+        /*String[] ucs = getUniformCodes(WindStation.class);
         // 获取所有的标签点
         List<TsPoint> pls = thingsPointDao.findTsPointByThingTypeAndUniformCodes("station", ucs);
         // 获取场站中的属性
@@ -322,14 +318,14 @@ public class InfoCache {
             WindStation ws = windStationMap.get(tp.getThingId());
             Field field = fieldsMap.get(tp.getUniformCode());
             setTagInfo(ws, field, tp.getId());
-        }
+        }*/
     }
 
     /**
      * 初始化风机信息
      */
     private void initWindtrubineInfos() {
-        // 获取需要刷新的UniformCode
+        /*// 获取需要刷新的UniformCode
         String[] ucs = getUniformCodes(WindturbineInfo.class);
         // 获取所有的标签点
         List<TsPoint> pls = thingsPointDao.findTsPointByThingTypeAndUniformCodes("windturbine", ucs);
@@ -345,7 +341,7 @@ public class InfoCache {
             Field field = fieldsMap.get(tp.getUniformCode());
             // 初始化TagInfo并添加
             setTagInfo(wi, field, tp.getId());
-        }
+        }*/
     }
 
     /**
@@ -434,7 +430,7 @@ public class InfoCache {
      * 根据tingId和uniformCode获取TsPoint
      */
     public TsPoint getTsPointByIdAndUniformCode(String tingtype, String id, String uniformCode) {
-        String key = id + uniformCode;
+        /*String key = id + uniformCode;
         if (tsPoints.containsKey((key))) {
             return tsPoints.get(key);
         }
@@ -443,7 +439,7 @@ public class InfoCache {
         if (tss != null && tss.size() > 0) {
             tsPoints.put(key, tss.get(0));
             return tss.get(0);
-        }
+        }*/
         return null;
     }
 

+ 2 - 5
web/runeconomy-xk/src/main/java/com/gyee/neic_service/controller/StationController.java

@@ -3,7 +3,6 @@ package com.gyee.neic_service.controller;
 import com.gyee.neic_service.cache.InfoCache;
 import com.gyee.neic_service.dao.entity.StationStatusEntity;
 import com.gyee.neic_service.dao.repsoitory.IStationStatusRepository;
-import com.gyee.neic_service.dao.windturbine.IPowerStationDao;
 import com.gyee.neic_service.model.BoostStationData;
 import com.gyee.neic_service.model.StationStatus;
 import com.gyee.neic_service.model.WindturbineInfo;
@@ -34,14 +33,12 @@ public class StationController {
     private ComparedSvc comparedSvc;
 
     @Resource
-    private IPowerStationDao powerStationDao;
-
-    @Resource
     private IStationStatusRepository iStationStatusRepository;
 
     @GetMapping("/")
     public Object getStationInfo() {
-        return powerStationDao.getAll();
+//        return powerStationDao.getAll();
+        return null;
     }
 
     @GetMapping("/agc")

+ 78 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/ModelConstants.java

@@ -0,0 +1,78 @@
+package com.gyee.control.calc.dao.sql;
+
+/**
+ * 字符串常量池
+ */
+public class ModelConstants {
+
+    private ModelConstants() {
+    }
+
+    //jpa会将驼峰写法转化为下划线分割形式,如StationId->station_id
+    public static final String ID_ = "id";
+
+
+    public static final String NAME_ = "name";
+    public static final String DESCRIPTION = "description";
+
+    public static final String USER_ID = "user_id";
+
+
+    public static final String TYPE_ = "type";
+
+
+    public static final String CODE_ = "code";
+
+    public static final String CAPACITY_ = "capacity";
+    public static final String CAPACITY_UNIT = "capacity_unit";
+    public static final String QUANTITY = "quantity";
+
+    public static final String MODEL_ = "model";
+    public static final String ORDER_NUM = "order_num";
+    public static final String WINDTURBINE_ID = "windturbine_id";
+
+
+    public static final String WINPOWERSATIONID_ = "station_id";
+    public static final String PROJECT_ID = "project_id";
+    public static final String PHOTO_ = "photo";
+    //项目
+    public static final String PROJECT_ = "project";
+    public static final String STATION_ID = "station_id";
+    public static final String ANAME_ = "aname";
+    public static final String COMMISSION_DATE = "commission_date";
+    public static final String MASTER_PHONE = "master_phone";
+    public static final String SHIFT_FOREMAN = "shift_foreman";
+    public static final String SHIFT_FOREMAN_PHONE = "shift_foreman_phone";
+    //线路
+    public static final String EQUIPMENT_MODEL = "EQUIPMENTMODEL";
+    public static final String LINE_ = "line";
+    public static final String STATION_CODE = "station_code";
+    //模型
+    public static final String POWER_PRODUCTION = "power_production";
+    public static final String CUTIN_WIND_SPEED = "cutin_wind_speed";
+    public static final String RATED_WIND_SPEED = "rated_wind_speed";
+    public static final String CUTOUT_WIND_SPEED = "cutout_wind_speed";
+    public static final String WINDTURBINE_MANUFACTURER_ID = "windturbine_manufacturer_id";
+    public static final String UNIT_ = "unit";
+    public static final String SWEPT_AREA = "swept_area";
+    public static final String EQUIPMENT_CATEGORY = "equipment_category";
+
+    public static final String UNIFORM_CODE = "uniform_code";
+    public static final String DATA_TYPE = "data_type";
+
+    public static final String THING_TYPE = "thing_type";//主题表
+    public static final String THING_ID = "thing_id";
+
+    public static final String GYCP_CMD_INFO = "gycp_cmd_info";
+    public static final String CMD_ID = "cmd_id";
+    public static final String CMD_VALUE = "cmd_value";
+    public static final String Time = "time";
+    public static final String ISSUCCESS = "is_success";
+    public static final String CONTROL_ERRORS_CODE = "control_errors_code";
+
+    public static final String INPUT_OR_OUTPUT_SPEED_TOTAL = "inputoroutputspeedtotal";
+    public static final String WINDTURBINEID = "windturbineid";
+    public static final String INPUT_SMALL = "inputsmall";
+    public static final String RECORDE_DATE = "recorddate";
+    public static final String CONTROL_INFO = "control_info";
+}

+ 36 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaAlertSnapDao.java

@@ -0,0 +1,36 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.AlertSnapEntity;
+import com.gyee.neic_service.dao.repsoitory.AlertSnapRepository;
+import com.gyee.neic_service.model.alarm.AlertSnap;
+import com.gyee.neic_service.util.DataUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Component;
+
+import javax.persistence.criteria.Predicate;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Component
+@Slf4j
+public class JpaAlertSnapDao implements IAlertSnapDao {
+    @Autowired
+    private AlertSnapRepository alertsnapRepository;
+
+
+    @Override
+    public List<AlertSnap> findAll() {
+        List<AlertSnap> listalertsnap = DataUtil.convertDataList(alertsnapRepository.findAll());
+        return listalertsnap;
+    }
+
+    @Override
+    public AlertSnap findById(String id) {
+        AlertSnap alertsnap = alertsnapRepository.findById(id).get().toData();
+        return alertsnap;
+    }
+
+}

+ 32 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaDeviceFaultDao.java

@@ -0,0 +1,32 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.DeviceFaultEntity;
+import com.gyee.neic_service.dao.repsoitory.DeviceFaultRepository;
+import com.gyee.neic_service.model.alarm.DeviceFault;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-10-24
+ */
+@Component
+public class JpaDeviceFaultDao implements IDeviceFaultDao {
+
+    @Autowired
+    private DeviceFaultRepository deviceFaultRepository;
+
+    @Override
+    public List<DeviceFault> findAll() {
+        List<DeviceFault> resultList = new ArrayList<>();
+        List<DeviceFaultEntity> entityList = deviceFaultRepository.findAll();
+        for (int i = 0; i < entityList.size(); i++) {
+            resultList.add(entityList.get(i).toData());
+        }
+        return resultList;
+    }
+}

+ 56 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaFaultHistoryDao.java

@@ -0,0 +1,56 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.FaultHistory;
+import com.gyee.neic_service.dao.entity.FaultHistoryEntity;
+import com.gyee.neic_service.dao.repsoitory.FaultHistoryRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Component
+@Slf4j
+public class JpaFaultHistoryDao implements IFaultHistoryDao {
+
+    @Autowired
+    private FaultHistoryRepository historyRepository;
+
+
+    @Override
+    public void save(FaultHistory faultHistory) {
+        historyRepository.saveAndFlush(new FaultHistoryEntity(faultHistory));
+    }
+
+    public void faultConfirm(long id, int confirmType, String user, long alertSnapId) {
+
+        FaultHistoryEntity entity = historyRepository.findFirstById(id);
+        if (entity != null) {
+            entity.setConfirmType(confirmType);
+            entity.setConfirmPerson(user);
+            entity.setAlertSnapId(String.valueOf(alertSnapId));
+            entity.setConfirmTime(new Date());
+            historyRepository.saveAndFlush(entity);
+
+        }
+    }
+
+    @Override
+    public void save(List<FaultHistory> faultHistorys) {
+        ArrayList<FaultHistoryEntity> entities = new ArrayList<>();
+        for (FaultHistory his : faultHistorys) {
+            FaultHistoryEntity et = new FaultHistoryEntity(his);
+            entities.add(et);
+        }
+        try {
+            historyRepository.saveAll(entities);
+            historyRepository.flush();
+        } catch (Exception e) {
+            log.error("--------保存报警历史信息error--------{}", e.getMessage());
+        }
+
+    }
+
+}

+ 105 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaFaultSnapDao.java

@@ -0,0 +1,105 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.FaultSnap;
+import com.gyee.neic_service.dao.entity.FaultSnapEntity;
+import com.gyee.neic_service.dao.repsoitory.FaultSnapRepository;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Component
+@Slf4j
+public class JpaFaultSnapDao implements IFaultSnapDao {
+    @Autowired
+    private FaultSnapRepository faultSnapRepository;
+
+
+    @Override
+    public FaultSnap save(FaultSnap alertsnap) {
+        return faultSnapRepository.saveAndFlush(new FaultSnapEntity(alertsnap)).toData();
+    }
+
+
+    @Override
+    public FaultSnap findByWindturbineIdAndAlertValue(String windturbineid, int alertvalue) {
+        FaultSnapEntity alertsnapEntity = faultSnapRepository.findByWindturbineIdAndAlertValue(windturbineid, alertvalue);
+        if (alertsnapEntity != null) {
+            return alertsnapEntity.toData();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public FaultSnap findByStationIdAndAlertValue(String stationId, int alertvalue) {
+        FaultSnapEntity alertsnapEntity = faultSnapRepository.findByStationIdAndAlertValue(stationId, alertvalue);
+        if (alertsnapEntity != null) {
+            return alertsnapEntity.toData();
+        } else {
+            return null;
+        }
+    }
+
+    @Override
+    public FaultSnap findByTestingpointkey(String testingpointkey) {
+        FaultSnapEntity alertsnapEntity = faultSnapRepository.findByTestingpointKey(testingpointkey);
+        return alertsnapEntity == null ? null : alertsnapEntity.toData();
+    }
+
+    @Override
+    public List<FaultSnap> findAllFaultWindturbine() {
+        List<FaultSnap> resultList = new ArrayList<>();
+        List<FaultSnapEntity> entityList = faultSnapRepository.searchAllFaultWindturbineId();
+        for (int i = 0; i < entityList.size(); i++) {
+            resultList.add(entityList.get(i).toData());
+        }
+        return resultList;
+    }
+
+    @Override
+    public List<FaultSnap> findRealTimeFaultWindturbine(Date startTime) {
+        List<FaultSnap> resultList = new ArrayList<>();
+        List<FaultSnapEntity> entityList = faultSnapRepository.searchAllFaultWindturbine(startTime);
+        for (int i = 0; i < entityList.size(); i++) {
+            resultList.add(entityList.get(i).toData());
+        }
+        return resultList;
+    }
+
+    @Override
+    public List<FaultSnap> findSnapByIdList(List<Long> idList) {
+        List<FaultSnap> resultList = new ArrayList<>();
+        List<FaultSnapEntity> entityList = faultSnapRepository.findAllByIdIn(idList);
+        for (int i = 0; i < entityList.size(); i++) {
+            resultList.add(entityList.get(i).toData());
+        }
+        return resultList;
+    }
+
+
+//    public List<Long> oneKeyRemoveSYZFaultSnap(Date nowTime, Long faultSanpId)
+//    {
+//        return null;
+//    }
+
+    @Override
+    public List<Long> oneKeyRemoveSYZFaultSnap(Date nowTime) {
+        List<Long> fids = new ArrayList<>();
+        try {
+            //faultSnapRepository.OneKeyRemove(Constant.webSocketDateFomart.format(nowTime));
+            List<FaultSnapEntity> faultSanpIdList = faultSnapRepository.getFaultSnapEntitiesByIsOpenedAndLastUpdateTimeAfter(0, nowTime);
+            faultSanpIdList.forEach(element -> {
+                fids.add(element.getId());
+            });
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return fids;
+    }
+
+
+}

+ 44 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaLineDao.java

@@ -0,0 +1,44 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.Line;
+import com.gyee.neic_service.dao.entity.LineEntity;
+import com.gyee.neic_service.dao.repsoitory.ILineDao;
+import com.gyee.neic_service.dao.repsoitory.LineRepository;
+import com.gyee.neic_service.util.DataUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class JpaLineDao implements ILineDao {
+    @Autowired
+    private LineRepository lineRepository;
+
+    @Override
+    public List<Line> findAll() {
+        List<Line> listline = DataUtil.convertDataList(lineRepository.findAll());
+        return listline;
+    }
+
+    @Override
+    public Line findById(String id) {
+        Line line = lineRepository.findById(id).get().toData();
+        return line;
+    }
+
+    @Override
+    public void deletebyid(String id) {
+        lineRepository.deleteById(id);
+    }
+
+    @Override
+    public void save(Line line) {
+        lineRepository.save(new LineEntity(line));
+    }
+
+    @Override
+    public List<Line> findByprojectId(String id) {
+        return DataUtil.convertDataList(lineRepository.findFirstByProjectId(id));
+    }
+}

+ 60 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaWarningDao.java

@@ -0,0 +1,60 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.WarningEntity;
+import com.gyee.neic_service.dao.repsoitory.WarningRepository;
+import com.gyee.neic_service.model.alarm.Warning;
+import com.gyee.neic_service.util.DataUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Component
+public class JpaWarningDao implements IWarningDao {
+    @Autowired
+    private WarningRepository warningRepository;
+
+
+    @Override
+    public List<Warning> findAll() {
+        List<Warning> warning = DataUtil.convertDataList(warningRepository.findAll());
+        return warning;
+    }
+
+    @Override
+    public Warning findById(String id) {
+        Warning warning = warningRepository.findById(id).get().toData();
+        return warning;
+    }
+
+    @Override
+    public void deletebyid(String id) {
+        warningRepository.deleteById(id);
+    }
+
+
+    @Override
+    public void save(Warning warning) {
+        warningRepository.save(new WarningEntity(warning));
+    }
+
+    @Override
+    public Warning findByprojectId(String id) {
+        return warningRepository.findAllById(id).toData();
+    }
+
+    @Override
+    public Warning findByEdnavalue(int ednavalue) {
+        return warningRepository.findByEdnaValue(ednavalue).toData();
+    }
+
+    @Override
+    public List<Warning> findByModelId(String modelid) {
+        return DataUtil.convertDataList(warningRepository.findByModelId(modelid));
+    }
+
+    @Override
+    public List<Warning> findByIsReset(Integer isReset) {
+        return DataUtil.convertDataList(warningRepository.findByIsReset(isReset));
+    }
+}

+ 75 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/alarm/JpaWindturbineDao.java

@@ -0,0 +1,75 @@
+package com.gyee.neic_service.dao.alarm;
+
+import com.gyee.neic_service.dao.entity.Windturbine;
+import com.gyee.neic_service.dao.entity.WindturbineEntity;
+import com.gyee.neic_service.dao.repsoitory.IWindturbineDao;
+import com.gyee.neic_service.dao.repsoitory.WindturbineRepository;
+import com.gyee.neic_service.util.DataUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * @author songwb<songwb @ aliyun.com>
+ */
+@Component
+public class JpaWindturbineDao implements IWindturbineDao {
+
+    @Autowired
+    private WindturbineRepository windturbineRepository;
+
+
+    @Override
+    public void del(String id) {
+        windturbineRepository.deleteById(id);
+    }
+
+    @Override
+    public void save(Windturbine win) {
+        return;
+    }
+
+
+    @Override
+    public List<Windturbine> find() {
+        List<WindturbineEntity> all = windturbineRepository.findAll();
+        return DataUtil.convertDataList(all);
+    }
+
+    @Override
+    public Windturbine findbyid(String id) {
+        return windturbineRepository.findById(id).get().toData();
+    }
+
+    @Override
+    public List<Windturbine> findByStationId(String stationId) {
+        return null;
+    }
+
+    @Override
+    public List<Windturbine> findByProjectId(String projectId) {
+        return null;
+    }
+
+    @Override
+    public List<Windturbine> findByLineId(String lineId) {
+        return null;
+    }
+
+    @Override
+    public List<Windturbine> findByModelId(String modelId) {
+        return null;
+    }
+
+    @Override
+    public List<Windturbine> findByStationIdAndModelId(String stationId, String modelId) {
+        return null;
+    }
+
+    @Override
+    public List<Windturbine> findFDCWindturbine() {
+        return null;
+    }
+
+}

+ 236 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/AlertRuleEntity.java

@@ -0,0 +1,236 @@
+package com.gyee.neic_service.dao.entity;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 预警规则
+ */
+@Entity
+@Table(name = "alertrule2")
+public class AlertRuleEntity {
+    /**
+     * ID
+     */
+    @Id
+    @Column(name = "id")
+    private String id;
+    /**
+     * 名称
+     */
+    @Column(name = "name")
+    private String name;
+    /**
+     * 表达式
+     */
+    @Column(name = "expression")
+    private String expression;
+    /**
+     * 描述
+     */
+    @Column(name = "description")
+    private String description;
+    /**
+     * 标签
+     */
+    @Column(name = "tag")
+    private String tag;
+    /**
+     * 级别
+     */
+    @Column(name = "rank")
+    private String rank;
+    /**
+     * 是否启用
+     */
+    @Column(name = "enabled")
+    private boolean enabled;
+    /**
+     * 设备类型
+     */
+    @Column(name = "modelid")
+    private String modelId;
+    /**
+     * 报警值
+     */
+    @Column(name = "ednavalue")
+    private int ednaValue;
+    /**
+     * 报警类别
+     */
+    @Column(name = "category")
+    private String category;
+    /**
+     * 范围
+     */
+    @Column(name = "range")
+    private String range;
+    /**
+     * 场站
+     */
+    @Column(name = "station")
+    private String station;
+    /**
+     * 风机
+     */
+    @Column(name = "windturbine")
+    private String windturbine;
+    /**
+     * 线路
+     */
+    @Column(name = "line")
+    private String line;
+    /**
+     * 工程
+     */
+    @Column(name = "project")
+    private String project;
+    /**
+     * 电气
+     */
+    @Column(name = "electrical")
+    private String electrical;
+    /**
+     * 关联部件
+     */
+    @Column(name = "relatedparts")
+    private String relatedParts;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getExpression() {
+        return expression;
+    }
+
+    public void setExpression(String expression) {
+        this.expression = expression;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getTag() {
+        return tag;
+    }
+
+    public void setTag(String tag) {
+        this.tag = tag;
+    }
+
+    public String getRank() {
+        return rank;
+    }
+
+    public void setRank(String rank) {
+        this.rank = rank;
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    public String getModelId() {
+        return modelId;
+    }
+
+    public void setModelId(String modelId) {
+        this.modelId = modelId;
+    }
+
+    public int getEdnaValue() {
+        return ednaValue;
+    }
+
+    public void setEdnaValue(int ednaValue) {
+        this.ednaValue = ednaValue;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getRange() {
+        return range;
+    }
+
+    public void setRange(String range) {
+        this.range = range;
+    }
+
+    public String getStation() {
+        return station;
+    }
+
+    public void setStation(String station) {
+        this.station = station;
+    }
+
+    public String getWindturbine() {
+        return windturbine;
+    }
+
+    public void setWindturbine(String windturbine) {
+        this.windturbine = windturbine;
+    }
+
+    public String getLine() {
+        return line;
+    }
+
+    public void setLine(String line) {
+        this.line = line;
+    }
+
+    public String getProject() {
+        return project;
+    }
+
+    public void setProject(String project) {
+        this.project = project;
+    }
+
+    public String getElectrical() {
+        return electrical;
+    }
+
+    public void setElectrical(String electrical) {
+        this.electrical = electrical;
+    }
+
+    public String getRelatedParts() {
+        return relatedParts;
+    }
+
+    public void setRelatedParts(String relatedParts) {
+        this.relatedParts = relatedParts;
+    }
+}

+ 145 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/AlertSnapEntity.java

@@ -0,0 +1,145 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.model.alarm.AlertSnap;
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name = "ALARMSNAP")
+public class AlertSnapEntity implements ToData<AlertSnap>, Serializable {
+    @Id
+    @Column(name = "id")
+    private long id;
+    @Column(name = "stationid")
+    private String stationId;
+    @Column(name = "projectid")
+    private String projectId;
+    @Column(name = "lineid")
+    private String lineId;
+    @Column(name = "windturbineid")
+    private String windturbineId;
+    @Column(name = "alertvalue")
+    private int alertValue;
+    @Column(name = "category1")
+    private String cateGory1;
+    @Column(name = "category2")
+    private String cateGory2;
+    @Column(name = "category3")
+    private String cateGory3;
+    @Column(name = "rank")
+    private String rank;
+    @Column(name = "isopened")
+    private int isOpened;
+    @Column(name = "isconfirmed")
+    private Integer confirmed;
+    @Column(name = "confirmtime")
+    private Date confirmTime;
+    @Column(name = "confirmperson")
+    private String confirmPerson;
+    @Column(name = "lastupdatetime")
+    private Date lastUpdateTime;
+    @Column(name = "lastupdateperson")
+    private String lastUpdatePerson;
+    @Column(name = "stationname")
+    private String stationName;
+    @Column(name = "projectname")
+    private String projectName;
+    @Column(name = "linename")
+    private String lineName;
+    @Column(name = "windturbinename")
+    private String windturbineName;
+    @Column(name = "alerttext")
+    private String alertText;
+    @Column(name = "modelid")
+    private String modelId;
+    @Column(name = "testingpointkey")
+    private String testingpointKey;
+    @Column(name = "ifixpicture")
+    private String ifixPicture;
+    @Column(name = "ifixtag")
+    private String ifixTag;
+    @Column(name = "lastclosetime")
+    private Date lastCloseTime;
+    @Column(name = "lastcloseperson")
+    private String lastClosePerson;
+    @Column(name = "datainfo")
+    private String dataInfo;
+
+    @Override
+    public AlertSnap toData() {
+        AlertSnap alertsnap = new AlertSnap();
+        alertsnap.setId(this.id);
+        alertsnap.setStationId(this.stationId);
+        alertsnap.setProjectId(this.projectId);
+        alertsnap.setLineId(this.lineId);
+        alertsnap.setWindturbineId(this.windturbineId);
+        alertsnap.setAlertValue(this.alertValue);
+        alertsnap.setCategory1(this.cateGory1);
+        alertsnap.setCategory2(this.cateGory2);
+        alertsnap.setCategory3(this.cateGory3);
+        alertsnap.setRank(this.rank);
+        alertsnap.setIsOpened(this.isOpened);
+        alertsnap.setIsConfirmed(this.confirmed);
+        alertsnap.setConfirmTime(this.confirmTime);
+        alertsnap.setConfirmPerson(this.confirmPerson);
+        alertsnap.setLastUpdateTime(this.lastUpdateTime);
+        alertsnap.setLastUpdatePerson(this.lastUpdatePerson);
+        alertsnap.setStationName(this.stationName);
+        alertsnap.setProjectName(this.projectName);
+        alertsnap.setLineName(this.lineName);
+        alertsnap.setWindturbineName(this.windturbineName);
+        alertsnap.setAlertText(this.alertText);
+        alertsnap.setModelId(this.modelId);
+        alertsnap.setTestingpointKey(this.testingpointKey);
+        alertsnap.setIfixPicture(this.ifixPicture);
+        alertsnap.setIfixTag(this.ifixTag);
+        alertsnap.setLastCloseTime(this.lastCloseTime);
+        alertsnap.setLastClosePerson(this.lastClosePerson);
+        alertsnap.setDataInfo(this.dataInfo);
+        return alertsnap;
+
+    }
+
+    public AlertSnapEntity(AlertSnap alertsnap) {
+        this.id = alertsnap.getId();
+        this.stationId = alertsnap.getStationId();
+        this.projectId = alertsnap.getProjectId();
+        this.lineId = alertsnap.getLineId();
+        this.windturbineId = alertsnap.getWindturbineId();
+        this.alertValue = alertsnap.getAlertValue();
+        this.cateGory1 = alertsnap.getCategory1();
+        this.cateGory2 = alertsnap.getCategory2();
+        this.cateGory3 = alertsnap.getCategory3();
+        this.rank = alertsnap.getRank();
+        this.isOpened = alertsnap.getIsOpened();
+        this.setConfirmed(alertsnap.getIsConfirmed());
+        this.confirmTime = alertsnap.getConfirmTime();
+        this.confirmPerson = alertsnap.getConfirmPerson();
+        this.lastUpdateTime = alertsnap.getLastUpdateTime();
+        this.lastUpdatePerson = alertsnap.getLastUpdatePerson();
+        this.stationName = alertsnap.getStationName();
+        this.projectName = alertsnap.getProjectName();
+        this.lineName = alertsnap.getLineName();
+        this.windturbineName = alertsnap.getWindturbineName();
+        this.alertText = alertsnap.getAlertText();
+        this.modelId = alertsnap.getModelId();
+        this.testingpointKey = alertsnap.getTestingpointKey();
+        this.ifixPicture = alertsnap.getIfixPicture();
+        this.ifixTag = alertsnap.getIfixTag();
+        this.lastCloseTime = alertsnap.getLastCloseTime();
+        this.lastClosePerson = alertsnap.getLastClosePerson();
+        this.dataInfo = alertsnap.getDataInfo();
+
+    }
+
+}

+ 60 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/DeviceFaultEntity.java

@@ -0,0 +1,60 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.model.alarm.DeviceFault;
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-10-24
+ */
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name = "P3_DEVICE_FAULT")
+public class DeviceFaultEntity implements ToData<DeviceFault>, Serializable {
+    @Id
+    @Column(name = "id")
+    private String id;
+    @Column(name = "CODE")
+    private String code;
+    @Column(name = "FAULTID")
+    private String faultId;
+    @Column(name = "NAME")
+    private String name;
+    @Column(name = "HALTTYPE")
+    private String haltType;
+    @Column(name = "CATEGORY")
+    private String cateGory;
+    @Column(name = "FAULTLEVEL")
+    private int faultLevel;
+    @Column(name = "CAUSE")
+    private String cause;
+    @Column(name = "DEVICEMODEL")
+    private String deviceModel;
+
+
+    @Override
+    public DeviceFault toData() {
+
+        DeviceFault data = new DeviceFault();
+        data.setId(this.id);
+        data.setCode(this.code);
+        data.setFaultId(this.faultId);
+        data.setName(this.name);
+        data.setHaltType(this.haltType);
+        data.setCateGory(this.cateGory);
+        data.setFaultLevel(this.faultLevel);
+        data.setCause(this.cause);
+        data.setDeviceModel(this.deviceModel);
+        return data;
+    }
+}

+ 67 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/FaultHistoryEntity.java

@@ -0,0 +1,67 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@NoArgsConstructor
+@Entity
+@Table(name = "faulthistory")
+public class FaultHistoryEntity implements ToData<FaultHistory>, Serializable {
+
+    private static final long serialVersionUID = -9116357102786444345L;
+    @Id
+    @Column(name = "id")
+//    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_FAULTHISTORY")
+//    @SequenceGenerator(name = "SEQ_FAULTHISTORY", sequenceName = "NXFD_FAULTHISTORY_ID")
+    @GeneratedValue
+    private Long id;
+    @Column(name = "faulttime")
+    private Date faultTime;
+    @Column(name = "operator")
+    private String operator;
+    @Column(name = "snapid")
+    private Long snapId;
+    @Column(name = "confirmtype")
+    private Integer confirmType;
+    @Column(name = "confirmtime")
+    private Date confirmTime;
+    @Column(name = "confirmperson")
+    private String confirmPerson;
+    @Column(name = "messagetype")
+    private int messageType;
+    @Column(name = "alertsnapid")
+    private String alertSnapId;
+
+    @Override
+    public FaultHistory toData() {
+        if (this != null) {
+            FaultHistory history = new FaultHistory();
+            BeanUtils.copyProperties(this, history);
+            return history;
+        } else {
+            return null;
+        }
+    }
+
+    public FaultHistoryEntity(FaultHistory history) {
+
+        this.id = history.getId();
+        this.faultTime = history.getFaultTime();
+        this.operator = history.getOperator();
+        this.snapId = history.getSnapId();
+        this.confirmType = history.getConfirmType();
+        this.confirmTime = history.getConfirmTime();
+        this.confirmPerson = history.getConfirmPerson();
+        this.messageType = history.getMessageType();
+
+    }
+
+
+}

+ 137 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/FaultInfoEntity.java

@@ -0,0 +1,137 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.model.alarm.FaultInfo;
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-10-10
+ */
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name = "view_faulthistory")
+public class FaultInfoEntity implements ToData<FaultInfo>, Serializable {
+
+    @Id
+    @Column(name = "id")
+    private long id;
+    //报警时间
+    @Column(name = "faulttime")
+    private Date faultTime;
+    //对象类型
+    @Column(name = "messagetype")
+    private int messageType;
+    //报警内容
+    @Column(name = "snapid")
+    private long snapID;
+
+    @Column(name = "confirmtype")
+    private int confirmType;
+
+    @Column(name = "confirmtime")
+    private Date confirmTime;
+
+    @Column(name = "confirmperson")
+    private String confirmPerson;
+
+    @Column(name = "stationid")
+    private String stationId;
+
+    @Column(name = "projectid")
+    private String projectId;
+
+    @Column(name = "lineid")
+    private String lineId;
+
+    @Column(name = "windturbineid")
+    private String windturbineId;
+
+    //报警对应故障编码
+    @Column(name = "alertvalue")
+    private int alertValue;
+
+
+    //报警级别
+    @Column(name = "rank")
+    private String rank;
+
+    @Column(name = "category1")
+    private String category1;
+
+    @Column(name = "category2")
+    private String category2;
+
+    @Column(name = "category3")
+    private String category3;
+
+    @Column(name = "isopened")
+    private int opened;
+
+    @Column(name = "lastupdatetime")
+    private Date lastUpdateTime;
+
+    @Column(name = "lastupdateperson")
+    private String lastUpdatePerson;
+
+    @Column(name = "stationname")
+    private String stationName;
+
+    @Column(name = "projectname")
+    private String projectName;
+
+    @Column(name = "linename")
+    private String lineName;
+
+    @Column(name = "windturbinename")
+    private String windturbineName;
+
+    @Column(name = "alerttext")
+    private String alertText;
+
+    @Column(name = "modelid")
+    private String modelId;
+
+
+    @Override
+    public FaultInfo toData() {
+        FaultInfo info = new FaultInfo();
+        info.setId(this.id);
+        info.setFaultTime(this.faultTime);
+        info.setMessageType(this.messageType);
+        info.setSnapID(this.snapID);
+        info.setConfirmType(this.confirmType);
+        info.setConfirmTime(this.confirmTime);
+        info.setConfirmPerson(this.confirmPerson);
+        info.setStationId(this.stationId);
+        info.setProjectId(this.projectId);
+        info.setLineId(this.lineId);
+        info.setWindturbineId(this.windturbineId);
+        info.setAlertValue(this.alertValue);//
+        info.setRank(this.rank);
+        info.setCategory1(this.category1);
+        info.setCategory2(this.category2);
+        info.setCategory3(this.category3);
+        info.setOpened(this.opened == 1);
+        info.setLastUpdateTime(this.lastUpdateTime);
+        info.setLastUpdatePerson(this.lastUpdatePerson);
+        info.setStationName(this.stationName);
+        info.setProjectName(this.projectName);
+        info.setLineName(this.lineName);
+        info.setWindturbineName(this.windturbineName);
+        info.setAlertText(this.alertText);
+        info.setModelId(this.modelId);
+
+        return info;
+    }
+}

+ 96 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/FaultSnapEntity.java

@@ -0,0 +1,96 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name = "faultsnap")
+public class FaultSnapEntity implements ToData<FaultSnap>, Serializable {
+    private static final long serialVersionUID = -8348866240826071549L;
+    @Id
+    @Column(name = "id")
+//    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_FAULTSNAP")
+//    @SequenceGenerator(name = "SEQ_FAULTSNAP", sequenceName = "NXFD_FAULTSNAP_ID")
+    @GeneratedValue
+    private Long id;
+    @Column(name = "stationid")
+    private String stationId;
+    @Column(name = "projectid")
+    private String projectId;
+    @Column(name = "lineid")
+    private String lineId;
+    @Column(name = "windturbineid")
+    private String windturbineId;
+    @Column(name = "alertvalue")
+    private int alertValue;
+    @Column(name = "category1")
+    private String cateGory1;
+    @Column(name = "category2")
+    private String cateGory2;
+    @Column(name = "category3")
+    private String cateGory3;
+    @Column(name = "rank")
+    private String rank;
+    @Column(name = "isopened")
+    private int isOpened;
+    @Column(name = "lastupdatetime")
+    private Date lastUpdateTime;
+    @Column(name = "lastupdateperson")
+    private String lastUpdatePerson;
+    @Column(name = "stationname")
+    private String stationName;
+    @Column(name = "projectname")
+    private String projectName;
+    @Column(name = "linename")
+    private String lineName;
+    @Column(name = "windturbinename")
+    private String windturbineName;
+    @Column(name = "alerttext")
+    private String alertText;
+    @Column(name = "modelid")
+    private String modelId;
+    @Column(name = "testingpointkey")
+    private String testingpointKey;
+
+    @Override
+    public FaultSnap toData() {
+
+        FaultSnap snap = new FaultSnap();
+        BeanUtils.copyProperties(this, snap);
+        return snap;
+
+    }
+
+    public FaultSnapEntity(FaultSnap snap) {
+
+        this.id = snap.getId();
+        this.stationId = snap.getStationId();
+        this.projectId = snap.getProjectId();
+        this.lineId = snap.getLineId();
+        this.windturbineId = snap.getWindturbineId();
+        this.alertValue = snap.getAlertValue();
+        this.cateGory1 = snap.getCateGory1();
+        this.cateGory2 = snap.getCateGory2();
+        this.cateGory3 = snap.getCateGory3();
+        this.rank = snap.getRank();
+        this.isOpened = snap.getIsOpened();
+        this.lastUpdateTime = snap.getLastUpdateTime();
+        this.lastUpdatePerson = snap.getLastUpdatePerson();
+        this.stationName = snap.getStationName();
+        this.projectName = snap.getProjectName();
+        this.lineName = snap.getLineName();
+        this.windturbineName = snap.getWindturbineName();
+        this.alertText = snap.getAlertText();
+        this.modelId = snap.getModelId();
+        this.testingpointKey = snap.getTestingpointKey();
+    }
+
+}

+ 0 - 20
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/IThingsPointDao.java

@@ -1,20 +0,0 @@
-package com.gyee.neic_service.dao.entity;
-
-import com.gyee.neic_service.tspoint.TsPoint;
-
-import java.util.List;
-
-public interface IThingsPointDao {
-
-    List<TsPoint> findTsPointByUnformCodes(String thingType, String thingId, String... uCodes);
-
-    List<TsPoint> findTsPointByThingType(String thingType);
-
-    List<TsPoint> findTsPointByIds(String... tagNames);
-
-    List<TsPoint> findTsPointByThingIds(String thingType, String uniformCode, String... thingIds);
-
-    TsPoint findTsPointById(String tagName);
-
-    List<TsPoint> findTsPointByThingTypeAndUniformCodes(String thingType, String... uCodes);
-}

+ 117 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/LineEntity.java

@@ -0,0 +1,117 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.control.calc.dao.sql.ModelConstants;
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * author:wangjw
+ */
+@Data
+@NoArgsConstructor
+@ToString
+@EqualsAndHashCode()
+@Entity
+@Table(name = ModelConstants.LINE_)
+public class LineEntity implements ToData<Line> {
+    /**
+     * 主键ID
+     */
+    @Id
+    /*@GeneratedValue(strategy = GenerationType.IDENTITY)*/
+    @Column(name = "ID")
+    private String id;
+    /**
+     * 编码
+     */
+    @Column(name = "CODE")
+    private String code;
+    /**
+     * 名称
+     */
+    @Column(name = "NAME")
+    private String name;
+    /**
+     * 地址
+     */
+    @Column(name = "ANAME")
+    private String aname;
+    /**
+     * 项目id
+     */
+    @Column(name = "PROJECTID")
+    private String projectId;
+    /**
+     * 顺序
+     */
+    @Column(name = "ORDERNUM")
+    private Integer orderNum;
+    /**
+     * 装机容量
+     */
+    @Column(name = "CAPACITY")
+    private Double capacity;
+    /*装机单位*/
+    @Column(name = "CAPACITYUNIT")
+    private String capacityUnit;
+    /*装机数量*/
+    @Column(name = "QUANTITY")
+    private Integer quantity;
+/*    @OneToMany(mappedBy=ModelConstants.ID_,cascade = {CascadeType.MERGE,CascadeType.REFRESH},fetch=FetchType.EAGER)
+    private List<WindturbineEntity> listwindturbines;
+    @ManyToOne(cascade = {CascadeType.MERGE,CascadeType.REFRESH},fetch=FetchType.EAGER)
+    @JoinColumn(name=ModelConstants.PROJECT_ID, referencedColumnName=ModelConstants.ID_,insertable=false, updatable=false)
+    private ProjectEntity project;*/
+
+    public LineEntity(Line line) {
+        this.id = line.getId();
+        this.code = line.getCode();
+        this.name = line.getName();
+        this.aname = line.getAname();
+        this.projectId = line.getProjectId();
+        this.orderNum = line.getOrderNum();
+        this.capacity = line.getCapacity();
+        this.capacityUnit = line.getCapacityUnit();
+        this.quantity = line.getQuantity();
+/*        List<WindturbineEntity> windturbinelist=new ArrayList<WindturbineEntity>();
+        for(windturbine windturbine:line.getListwindturbine()){
+            WindturbineEntity wind=  new WindturbineEntity(windturbine);
+            windturbinelist.add(wind);
+        }
+        listwindturbines=windturbinelist;
+        project=new ProjectEntity(line.getProject());*/
+    }
+
+
+    @Override
+    public Line toData() {
+        if (this != null) {
+            Line line = new Line();
+            line.setId(this.id);
+            line.setCode(this.code);
+            line.setName(this.name);
+            line.setAname(this.aname);
+            line.setProjectId(this.projectId);
+            line.setOrderNum(this.orderNum);
+            line.setCapacity(this.capacity);
+            line.setCapacityUnit(this.getCapacityUnit());
+            line.setQuantity(this.getQuantity());
+            return line;
+        } else {
+            return null;
+        }
+/*        line.setListwindturbine(DataUtil.convertDataList(this.listwindturbines));
+        line.setProject(this.getProject().toData());*/
+
+    }
+
+
+}

+ 89 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/WarningEntity.java

@@ -0,0 +1,89 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.model.alarm.Warning;
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.beans.BeanUtils;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+@Data
+@Entity
+@NoArgsConstructor
+@Table(name = "warning2")
+public class WarningEntity implements ToData<Warning>, Serializable {
+
+    private static final long serialVersionUID = -3888921205274103285L;
+    @Id
+    private String id;
+    @Column(name = "levelid")
+    private String levelId;
+    @Column(name = "manufacturercode")
+    private String manuFactureRcode;
+    @Column(name = "englishtext")
+    private String englishText;
+    @Column(name = "chinesetext")
+    private String chineseText;
+    @Column(name = "parentid")
+    private String parentId;
+    @Column(name = "isleaf")
+    private Integer isLeaf;
+    @Column(name = "sequencenumber")
+    private Integer sequenceNumber;
+    @Column(name = "characteristic")
+    private String characterIstic;
+    @Column(name = "modelid")
+    private String modelId;
+    @Column(name = "codename")
+    private String codeName;
+    @Column(name = "ednavalue")
+    private Integer ednaValue;
+    @Column(name = "display")
+    private Integer display;
+    @Column(name = "warningclassifyid")
+    private String warningClassifyId;
+    @Column(name = "standardtime")
+    private Double standardTime;
+    @Column(name = "isreset")
+    private Integer isReset;
+
+    @Column(name = "faultcode")
+    private String faultCode;
+//    @Column(name = "warningtypeid")
+//    private String warningTypeId;
+
+    @Override
+    public Warning toData() {
+        Warning warning = new Warning();
+        BeanUtils.copyProperties(this, warning);
+        return warning;
+    }
+
+
+    public WarningEntity(Warning warning) {
+        this.id = warning.getId();
+        this.levelId = warning.getLevelId();
+        this.manuFactureRcode = warning.getManuFactureRcode();
+        this.englishText = warning.getEnglishText();
+        this.chineseText = warning.getChineseText();
+        this.parentId = warning.getParentId();
+        this.isLeaf = warning.getIsLeaf();
+        this.sequenceNumber = warning.getSequenceNumber();
+        this.characterIstic = warning.getCharacterIstic();
+        this.modelId = warning.getModelId();
+        this.codeName = warning.getCodeName();
+        this.ednaValue = warning.getEdnaValue();
+        this.display = warning.getDisplay();
+        this.warningClassifyId = warning.getWarningClassifyId();
+        this.standardTime = warning.getStandardTime();
+        this.isReset = warning.getIsReset();
+//        this.warningTypeId = warning.getWarningTypeId();
+    }
+
+
+}

+ 152 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/entity/WindturbineEntity.java

@@ -0,0 +1,152 @@
+package com.gyee.neic_service.dao.entity;
+
+import com.gyee.neic_service.util.ToData;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.util.Date;
+
+
+@Data
+@NoArgsConstructor
+@ToString
+@EqualsAndHashCode()
+@Entity
+@Table(name = "WINDTURBINE")
+public class WindturbineEntity implements ToData<Windturbine> {
+
+//      `ID` varchar(50) NOT NULL,
+//  `CODE` varchar(50) DEFAULT NULL,
+//  `WINDPOWERSTATIONID` varchar(50) NOT NULL,
+//  `LONGITUDE` float(18,2) DEFAULT NULL,
+//  `LATITUDE` float(18,2) DEFAULT NULL,
+//  `MODELID` varchar(50) DEFAULT NULL,
+//  `STATUS` varchar(50) DEFAULT NULL,
+//  `PROJECTID` varchar(50) DEFAULT NULL,
+//  `LINEID` varchar(50) DEFAULT NULL,
+//  `FIRSTINTEGRATEDTIME` varchar(50) DEFAULT NULL,
+//  `PHOTO` varchar(50) DEFAULT NULL,
+//  `NAME` varchar(50) DEFAULT NULL,
+//  `STANDARDID` varchar(50) DEFAULT NULL,
+//  `GYCP_ID` int(11) DEFAULT NULL COMMENT '通信通道Id',
+
+    /**
+     * 主键ID
+     */
+    @Id
+    /*@GeneratedValue(strategy = GenerationType.IDENTITY)*/
+    @Column(name = "ID")
+    private String id;
+    /**
+     * 编码
+     */
+    @Column(name = "CODE")
+    private String code;
+    /**
+     * 风场id
+     */
+    @Column(name = "WINDPOWERSTATIONID")
+    private String windPowerStationId;
+    /**
+     * 经度
+     */
+    @Column(name = "LONGITUDE")
+    private Double longitude;
+    /**
+     * 纬度
+     */
+    @Column(name = "LATITUDE")
+    private Double latitude;
+    /**
+     * 模型id
+     */
+    @Column(name = "MODELID")
+    private String modelId;
+    /**
+     * 状态
+     */
+    @Column(name = "STATUS")
+    private String status;
+    /**
+     * 项目id
+     */
+    @Column(name = "PROJECTID")
+    private String projectId;
+    /**
+     * 线路id
+     */
+    @Column(name = "LINEID")
+    private String lineId;
+    /**
+     * 首次并网的时间
+     */
+    @Column(name = "FIRSTINTEGRATEDTIME")
+    private Date firstIntegratedTime;
+    /**
+     * app注册ID
+     */
+    @Column(name = "PHOTO")
+    private String photo;
+    /**
+     * app注册ID
+     */
+    @Column(name = "NAME")
+    private String name;
+    /**
+     * app注册ID
+     */
+    @Column(name = "STANDARDID")
+    private String standardId;
+
+
+    public WindturbineEntity(Windturbine win) {
+        this.id = win.getId();
+        this.code = win.getCode();
+        this.windPowerStationId = win.getWindPowerStationId();
+        this.longitude = win.getLongitude();
+        this.latitude = win.getLatitude();
+        this.modelId = win.getModelId();
+        this.status = win.getStatus();
+        this.projectId = win.getProjectId();
+        this.lineId = win.getLineId();
+        this.firstIntegratedTime = win.getFirstIntegratedTime();
+        this.photo = win.getPhoto();
+        this.name = win.getName();
+        this.standardId = win.getStandardId();
+/*        this.line=new LineEntity(win.getLine());
+        this.model=new ModelEntity(win.getModel());*/
+    }
+
+
+    @Override
+    public Windturbine toData() {
+        if (this != null) {
+            Windturbine win = new Windturbine();
+            win.setId(id);
+            win.setCode(code);
+            win.setWindPowerStationId(windPowerStationId);
+            win.setLongitude(longitude);
+            win.setLatitude(latitude);
+            win.setModelId(modelId);
+            win.setStatus(status);
+            win.setProjectId(projectId);
+            win.setLineId(lineId);
+            win.setFirstIntegratedTime(firstIntegratedTime);
+            win.setPhoto(photo);
+            win.setName(name);
+            win.setStandardId(standardId);
+
+            return win;
+        } else {
+            return null;
+        }
+    }
+
+
+}

+ 13 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/AlertRuleRepository.java

@@ -0,0 +1,13 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.AlertRuleEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+public interface AlertRuleRepository extends JpaRepository<AlertRuleEntity, String>, JpaSpecificationExecutor {
+    List<AlertRuleEntity> findByEnabled(boolean enabled);
+
+    List<AlertRuleEntity> findAlertRuleEntitiesByStationAndModelId(String station, String modelId);
+}

+ 29 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/AlertSnapRepository.java

@@ -0,0 +1,29 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.AlertSnapEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+
+@Repository
+public interface AlertSnapRepository extends JpaRepository<AlertSnapEntity, String>, JpaSpecificationExecutor<AlertSnapEntity> {
+    AlertSnapEntity findAllById(Long id);
+
+    AlertSnapEntity findByWindturbineIdAndAlertValue(String windturbineId, int alertValue);
+
+    AlertSnapEntity findByStationIdAndAlertValue(String stationId, int alertValue);
+
+    AlertSnapEntity findByTestingpointKey(String testingpointkey);
+
+    @Query(value = "select t1 from AlertSnapEntity t1   where  t1.lastUpdateTime>=?1 and t1.isOpened=1   order by t1.lastUpdateTime desc ")
+    List<AlertSnapEntity> searchLatest(Date startTime);
+
+    @Query(value = "select t1 from AlertSnapEntity t1   where  t1.lastUpdateTime>?1  and  t1.isOpened=1  and t1.cateGory1=?3  and ( t1.stationId=?2 or t1.projectId=?2 or t1.lineId=?2 or t1.windturbineId=?2 ) order by t1.lastUpdateTime desc ")
+    List<AlertSnapEntity> searchLatestByObjectId(Date startTime, String objectId, String cateGory1);
+
+}

+ 19 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/DeviceFaultRepository.java

@@ -0,0 +1,19 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.DeviceFaultEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-10-24
+ */
+@Repository
+public interface DeviceFaultRepository extends JpaRepository<DeviceFaultEntity, String>, JpaSpecificationExecutor {
+
+    List<DeviceFaultEntity> findAll();
+}

+ 17 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/FaultHistoryRepository.java

@@ -0,0 +1,17 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.FaultHistoryEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+
+@Repository
+public interface FaultHistoryRepository extends JpaRepository<FaultHistoryEntity, Long>, JpaSpecificationExecutor {
+
+    FaultHistoryEntity findFirstById(long id);
+
+//    @Modifying
+//    @Query("update faulthistory set confirmtype=1 where FAULTTIME > ?1")
+//    void OneKeyRemove(Date startTime);
+}

+ 28 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/FaultInfoRepository.java

@@ -0,0 +1,28 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.FaultInfoEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @descrition:
+ * @author:Wanghs
+ * @date:2019-10-10
+ */
+@Repository
+public interface FaultInfoRepository extends JpaRepository<FaultInfoEntity, Integer>, JpaSpecificationExecutor<FaultInfoEntity> {
+
+    @Query(value = "select t1 from FaultInfoEntity t1 where t1.confirmType=0 and t1.opened=1 and t1.messageType=1 and t1.faultTime>=?1  order by t1.faultTime desc ")
+    List<FaultInfoEntity> searchByFaultTime(Date startTime);
+
+    //原生sql
+    @Query(value = "select * from VIEW_FAULTHISTORY    where  rownum<=?1  order by faultTime desc ", nativeQuery = true)
+    List<FaultInfoEntity> searchLatestByCount(int count);
+
+
+}

+ 54 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/FaultSnapRepository.java

@@ -0,0 +1,54 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.FaultSnapEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.Date;
+import java.util.List;
+
+@Repository
+public interface FaultSnapRepository extends JpaRepository<FaultSnapEntity, Long>, JpaSpecificationExecutor {
+
+    FaultSnapEntity findByWindturbineIdAndAlertValue(String windturbineId, int alertValue);
+
+    FaultSnapEntity findByStationIdAndAlertValue(String stationId, int alertValue);
+
+    FaultSnapEntity findByTestingpointKey(String testingpointkey);
+
+    //获取故障风机编号
+    @Query(value = "select t1 from FaultSnapEntity t1   where t1.cateGory1='FJ' and t1.stationId like '%FDC%' and t1.stationId not like '%QS%' and t1.isOpened=1")
+    List<FaultSnapEntity> searchAllFaultWindturbineId();
+
+    //获取故障风机编号
+    @Query(value = "select t1 from FaultSnapEntity t1   where  t1.isOpened=1 and t1.lastUpdateTime>?1")
+    List<FaultSnapEntity> searchAllFaultWindturbine(Date startTime);
+
+    List<FaultSnapEntity> findAllByIdIn(List<Long> idList);
+
+
+    List<FaultSnapEntity> getFaultSnapEntitiesByIsOpenedAndLastUpdateTimeAfter(int isopend, Date startTime);
+
+//    @Modifying
+//    @Query("update faultsnap f set f.isopened=0")//("update faultsnap f set f.isopened=0 where  f.lastupdatetime > ?1 and f.category1='SYZ'")
+//    int OneKeyRemove(String startTime);
+
+
+//
+//    //List<FaultSnapEntity>  getFaultSnapEntityByIsOpenedandAndLastUpdateTime(boolean isopend,Date lastUpdateTime);
+//    // 一键移除升压站误报
+//    @Transactional
+//    @Query(value ="update faultsnap t1 set isopened=0  where t1.lastUpdateTime> ?1 and t1.isopened=1 ",nativeQuery = true)
+//    void oneKeyRemoveSYZFaultSnap(Date nowTime);
+//
+////
+////
+////    // select id from faultsnap where isopened=1 and category1='SYZ' and lastupdatetime > to_date('2019-11-22 16:55:00','yyyy-mm-dd hh24:mi:ss')
+//    @Transactional
+//    @Query(value ="select id from faultsnap where isopened=0 and lastupdatetime > ?1 ",nativeQuery = true)
+//    List<Long> getIdListFromFaultSnapBySYZ (Date nowTime);
+
+
+}

+ 1 - 1
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/IWindturbineDao.java

@@ -5,7 +5,7 @@ import com.gyee.neic_service.dao.entity.Windturbine;
 
 import java.util.List;
 
-public interface IWindturbineDao {
+public interface IWindturbineDao{
     void del(String id);
 
     void save(Windturbine win);

+ 16 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/LineRepository.java

@@ -0,0 +1,16 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.LineEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Repository
+public interface LineRepository extends JpaRepository<LineEntity, String>, JpaSpecificationExecutor {
+
+    List<LineEntity> findFirstByProjectId(String projectId);
+
+}

+ 20 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/WarningRepository.java

@@ -0,0 +1,20 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.WarningEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Repository
+public interface WarningRepository extends JpaRepository<WarningEntity, String>, JpaSpecificationExecutor {
+    WarningEntity findAllById(String id);
+
+    WarningEntity findByEdnaValue(Integer ednavalue);
+
+    List<WarningEntity> findByModelId(String modelid);
+
+    List<WarningEntity> findByIsReset(Integer isReset);
+}

+ 27 - 0
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/repsoitory/WindturbineRepository.java

@@ -0,0 +1,27 @@
+package com.gyee.neic_service.dao.repsoitory;
+
+import com.gyee.neic_service.dao.entity.WindturbineEntity;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+
+@Repository
+public interface WindturbineRepository extends JpaRepository<WindturbineEntity, String>, JpaSpecificationExecutor {
+
+    /*  ModelEntity findFirstByUserName(String userName);*/
+    List<WindturbineEntity> findByWindPowerStationId(String stationId);
+
+    List<WindturbineEntity> findByLineId(String lineId);
+
+    List<WindturbineEntity> findByProjectId(String projectId);
+
+    List<WindturbineEntity> findByModelId(String modelId);
+
+    List<WindturbineEntity> findByWindPowerStationIdAndModelId(String stationId, String modelId);
+
+    List<WindturbineEntity> findByWindPowerStationIdLike(String likeStation);
+
+}

+ 0 - 20
web/runeconomy-xk/src/main/java/com/gyee/neic_service/dao/windturbine/IPowerStationDao.java

@@ -1,20 +0,0 @@
-package com.gyee.neic_service.dao.windturbine;
-
-
-import com.gyee.neic_service.dao.entity.PowerStation;
-
-import java.util.List;
-
-public interface IPowerStationDao {
-    List<PowerStation> getAll();
-
-    List<PowerStation> getListByPage(int pageIndex, int pageSize);
-
-    PowerStation getStationById(String id);
-
-    void add(PowerStation newStation);
-
-    void delete(String id);
-
-    void update(PowerStation station);
-}

+ 1 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/config/GyeeConfig.java

@@ -11,8 +11,7 @@ import java.util.Arrays;
 import java.util.List;
 
 @Data
-@Component
-@ConfigurationProperties(prefix = "gyee")
+//@ConfigurationProperties(prefix = "gyee")
 public class GyeeConfig {
 
     public File jarF = null;