Browse Source

删除无用信息

bihuisong 1 year ago
parent
commit
b895001a4d
18 changed files with 0 additions and 1167 deletions
  1. 0 129
      src/main/java/com/sooka/sponest/dataexchange/hwMeeting/controller/HwMeetingController.java
  2. 0 34
      src/main/java/com/sooka/sponest/dataexchange/hwMeeting/service/HwMeetingService.java
  3. 0 46
      src/main/java/com/sooka/sponest/dataexchange/hwMeeting/service/impl/HwMeetingApi.java
  4. 0 178
      src/main/java/com/sooka/sponest/dataexchange/hwMeeting/service/impl/HwMeetingServiceImpl.java
  5. 0 44
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/chenganshengbang/controller/WaterPressureController.java
  6. 0 9
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/chenganshengbang/service/WaterPressureService.java
  7. 0 60
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/chenganshengbang/service/impl/WaterPressureServiceImpl.java
  8. 0 24
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/inserctpests/controller/PlantDiseasesAndInsectPestsController.java
  9. 0 10
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/inserctpests/service/PlantDiseasesAndInsectPestsService.java
  10. 0 161
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/inserctpests/service/impl/PlantDiseasesAndInsectPestsServiceImpl.java
  11. 0 12
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/api/API.java
  12. 0 28
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/controller/SennorController.java
  13. 0 14
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/service/SennorService.java
  14. 0 78
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/service/impl/SennorServiceImpl.java
  15. 0 114
      src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/shuicejia/TcpServer.java
  16. 0 65
      src/main/java/com/sooka/sponest/dataexchange/remoteapi/fallback/center/monitor/RemoteMonitorBaseServiceFallbackFactory.java
  17. 0 67
      src/main/java/com/sooka/sponest/dataexchange/remoteapi/service/center/monitor/RemoteMonitorService.java
  18. 0 94
      src/main/java/com/sooka/sponest/dataexchange/scheduleTask/StaticScheduleTask.java

+ 0 - 129
src/main/java/com/sooka/sponest/dataexchange/hwMeeting/controller/HwMeetingController.java

@@ -1,129 +0,0 @@
-package com.sooka.sponest.dataexchange.hwMeeting.controller;
-
-
-import com.dahuatech.hutool.json.JSONArray;
-import com.dahuatech.hutool.json.JSONObject;
-import com.dahuatech.hutool.json.JSONTokener;
-import com.dahuatech.hutool.json.JSONUtil;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.common.redis.service.RedisService;
-import com.sooka.sponest.dataexchange.hwMeeting.service.HwMeetingService;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import javax.annotation.Resource;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 华为云会议控制器
- */
-@Controller
-@RequestMapping("/hwMeeting")
-public class HwMeetingController {
-
-    @Resource
-    private HwMeetingService hwMeetingService;
-
-    @Resource
-    private RedisService redisService;
-
-    /**
-     * 创建或加入会议
-     */
-    @GetMapping("/joinConferences/{eventId}/{subject}/{nickName}")
-    @ResponseBody
-    public AjaxResult hasConferences(@PathVariable(name = "eventId") String eventId,
-                                     @PathVariable(name = "subject") String subject,
-                                     @PathVariable(name = "nickName") String nickName) {
-        Map<String,Object> map = new HashMap<>();
-        //查询在线会议
-        JSONObject hasConferences = JSONUtil.parseObj(hwMeetingService.hasConferences());
-        //有在线会议 返回来宾入会凭据
-        if (hasConferences.getInt("count") > 0) {
-            //取会议信息
-            JSONObject conferencesInfo = hasConferences.getJSONArray("data").getJSONObject(0);
-            //取密码数组 passwordEntry
-            JSONArray array = JSONUtil.parseArray(conferencesInfo.get("passwordEntry"));
-            for (Object o : array) {
-                JSONObject password = JSONUtil.parseObj(o);
-                JSONObject generalInfo = new JSONObject();
-                if (password.getStr("conferenceRole").equals("general")) {
-                    generalInfo.put("conferenceID", conferencesInfo.getStr("conferenceID"));
-                    generalInfo.put("password", password.getStr("password"));
-                    map.put("info",generalInfo);
-                }
-            }
-        }else{
-            //无在线会议 创建会议并返回主持人入会凭据
-            this.createConferences(eventId,subject,map);
-        }
-        map.put("nickName",nickName);
-        map.put("nonce",hwMeetingService.getNonce());
-        return AjaxResult.success(map);
-    }
-
-    /**
-     * 创建会议
-     */
-    public boolean createConferences(String eventId,String subject,Map map) {
-        String result = hwMeetingService.conferences(subject);
-        if (isSuccess(result)) {
-            //将结果转换为json数组,当处理成功时返回的格式为数组
-            Object ob = JSONUtil.parseArray(result).get(0);
-            //ob转换为JSONObject 取主持人入会信息返回
-            JSONObject object = JSONUtil.parseObj(ob);
-            //取密码数组 passwordEntry
-            JSONArray array = JSONUtil.parseArray(object.get("passwordEntry"));
-            for (Object o : array) {
-                JSONObject password = JSONUtil.parseObj(o);
-                JSONObject chairInfo = new JSONObject();
-                //返回主持人入会凭据
-                if (password.getStr("conferenceRole").equals("chair")) {
-                    chairInfo.put("conferenceID", object.getStr("conferenceID"));
-                    chairInfo.put("password", password.getStr("password"));
-                    map.put("info",chairInfo);
-                }
-            }
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * 获取加入会议URI
-     */
-    @ResponseBody
-    @GetMapping("/guestJoinUri/{eventId}")
-    public AjaxResult guestJoinUri(@PathVariable(name = "eventId") String eventId) {
-        //查询在线会议
-        JSONObject hasConferences = JSONUtil.parseObj(hwMeetingService.hasConferences());
-        if(hasConferences != null){
-            //取会议信息
-            JSONObject conferencesInfo = hasConferences.getJSONArray("data").getJSONObject(0);
-            //取入会链接
-            return AjaxResult.success(conferencesInfo.get("guestJoinUri"));
-        }
-        return AjaxResult.error("未查询到数据");
-    }
-
-    /**
-     * 判断返回数据是JSONArray还是JSONObject,
-     * 如果是Array 则表示成功
-     * 反之失败
-     * */
-    private boolean isSuccess(String result) {
-        Object object = new JSONTokener(result).nextValue();
-        if (object instanceof JSONObject) {
-            JSONObject jsonObject = (JSONObject) object;
-            String error_code = jsonObject.get("error_code").toString();
-            System.err.println(error_code);
-            return false;
-        }
-        return true;
-    }
-
-}

+ 0 - 34
src/main/java/com/sooka/sponest/dataexchange/hwMeeting/service/HwMeetingService.java

@@ -1,34 +0,0 @@
-package com.sooka.sponest.dataexchange.hwMeeting.service;
-
-public interface HwMeetingService {
-
-    /**
-     * appId鉴权方法 获取token
-     */
-    String appauth();
-
-    /**
-     * 获取页面免登陆跳转的nonce信息
-     */
-    String getNonce();
-
-    /**
-     * 构成Authorization
-     */
-    String getAuthorization(String appId, String userId, String nonce);
-
-    /**
-     * 绑定给当前创会帐号的VMR ID。通过查询云会议室及个人会议ID接口获取。
-     */
-    String vmrID(String token);
-
-    /**
-     * 查询在线会议列表
-     */
-    String hasConferences();
-
-    /**
-     * 创建会议
-     */
-    String conferences(String subject);
-}

+ 0 - 46
src/main/java/com/sooka/sponest/dataexchange/hwMeeting/service/impl/HwMeetingApi.java

@@ -1,46 +0,0 @@
-package com.sooka.sponest.dataexchange.hwMeeting.service.impl;
-
-import org.springframework.beans.factory.annotation.Value;
-
-/**
- * 华为接口类
- */
-public abstract class HwMeetingApi {
-
-    /**
-     * 请求地址
-     **/
-    public static final String url = "https://api.meeting.huaweicloud.com";
-
-    /**
-     * appId
-     **/
-    @Value("${HwM.appId}")
-    public static final String appId = "3f989ae3a9664bbd8e78dde9d29a5a22";
-
-    /**
-     * appKey 也是HmacSHA256加密秘钥
-     **/
-    @Value("${HwM.appKey}")
-    public static final String appKey = "a48cbf11d0172b1c9fd4e9017bd8cf4dca674aa3a40696bd59f2542e746552fa";
-
-    /**
-     * 第三方平台的userId
-     **/
-    public static final String userId = "1001";
-
-    /**
-     * 执行AppID鉴权
-     */
-    public static final String appauth = "/v2/usg/acs/auth/appauth";
-
-    /**
-     * 普通用户分页查询云会议室及个人会议ID
-     **/
-    public static final String vmr = "/v1/usg/dcs/member/vmr";
-
-    /**
-     * 创建会议
-     */
-    public static final String conferences = "/v1/mmc/management/conferences";
-}

+ 0 - 178
src/main/java/com/sooka/sponest/dataexchange/hwMeeting/service/impl/HwMeetingServiceImpl.java

@@ -1,178 +0,0 @@
-package com.sooka.sponest.dataexchange.hwMeeting.service.impl;
-
-import com.dahuatech.hutool.core.util.RandomUtil;
-import com.dahuatech.hutool.http.HttpRequest;
-import com.dahuatech.hutool.json.JSONArray;
-import com.dahuatech.hutool.json.JSONObject;
-import com.dahuatech.hutool.json.JSONUtil;
-import com.sooka.sponest.dataexchange.hwMeeting.service.HwMeetingService;
-import com.sooka.sponest.dataexchange.util.HmacSHA256;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-@Service
-public class HwMeetingServiceImpl implements HwMeetingService {
-
-    private static final Logger log = LoggerFactory.getLogger(HwMeetingServiceImpl.class);
-
-    /**服务器地址**/
-    @Value("${meeting.serverUrl:}")
-    public String serverUrl;
-
-    /**appId**/
-    @Value("${meeting.appId:}")
-    public String appId;
-
-    /**第三方平台userId**/
-    @Value("${meeting.userId:}")
-    public String userId;
-
-    /**执行AppID鉴权地址**/
-    @Value("${meeting.appAuth:}")
-    public String appAuth;
-
-    /**appKey**/
-    @Value("${meeting.appKey:}")
-    public String appKey;
-
-    /**vmr**/
-    @Value("${meeting.vmr:}")
-    public String vmr;
-
-    /**查询在线会议**/
-    @Value("${meeting.onlineConferences:}")
-    public String onlineConferences;
-
-    /**创建会议**/
-    @Value("${meeting.conferences:}")
-    public String conferences;
-
-    /**获取页面免登陆跳转的nonce信息**/
-    @Value("${meeting.getNonce:}")
-    public String getNonce;
-
-
-
-    /**
-     * appId鉴权方法 获取token
-     */
-    @Override
-    public String appauth() {
-        //64位随机字符串
-        String nonce = RandomUtil.randomString(64);
-        log.info("nonce:{}", nonce);
-        //鉴权信息
-        String authorization = getAuthorization(appId, userId, nonce);
-        log.info("authorization:{}", authorization);
-        //body
-        JSONObject json = new JSONObject();
-        json.put("appId", appId);
-        json.put("expireTime", 0);
-        json.put("nonce", nonce);
-//        json.put("userId", userId);
-        json.put("clientType", 72);
-        //请求结果
-        String result = HttpRequest.post(serverUrl + appAuth)
-                .header("Authorization", authorization)
-                .header("Content-Type", "application/json")
-                .body(json)
-                .execute().body();
-        //打印
-        log.info("result:{}", result);
-        return JSONUtil.parseObj(result).get("accessToken").toString();
-    }
-
-    /**
-     * 构成Authorization
-     */
-    @Override
-    public String getAuthorization(String appId, String userId, String nonce) {
-        String data = appId + ":" + userId + ":" + 0 + ":" + nonce;
-        String authorization = "HMAC-SHA256 signature=" + HmacSHA256.encode(data, appKey);
-        return authorization;
-    }
-
-    /**
-     * 绑定给当前创会帐号的VMR_ID。通过查询云会议室及个人会议ID接口获取。
-     */
-    @Override
-    public String vmrID(String token) {
-        //body
-        String result = HttpRequest.get(serverUrl + vmr)
-                .header("X-Access-Token", token)
-                .header("Content-Type", "application/json")
-                .execute().body();
-        log.info("vmr:{}", result);
-        JSONArray rooms = JSONUtil.parseArray(JSONUtil.parseObj(result).get("data"));
-        log.info("rooms.get(0):{}", rooms.get(0));
-        log.info("JSONUtil.parseObj(rooms.get(0)):{}", JSONUtil.parseObj(rooms.get(0)));
-        log.info("vmrID:{}", JSONUtil.parseObj(rooms.get(0)).get("vmrId"));
-        return JSONUtil.parseObj(rooms.get(0)).get("id").toString();
-    }
-
-    /**
-     * 查询在线会议列表
-     */
-    @Override
-    public String hasConferences(){
-        String token = appauth();
-        String result = HttpRequest.get(serverUrl + onlineConferences)
-                .header("X-Access-Token", token)
-                .header("Content-Type", "application/json")
-                .execute().body();
-        log.info("查询在线会议列表:{}", result);
-        return result;
-    }
-
-    /**
-     * 创建会议
-     */
-    @Override
-    public String conferences(String subject) {
-        String token = appauth();
-        String vmrID = vmrID(token);
-        //body
-        JSONObject json = new JSONObject();
-        /**会议的媒体类型。Voice:语音会议,HDVideo:视频会议**/
-        json.put("mediaTypes", "HDVideo");
-        /**
-         * 会议持续时长,单位分钟。默认30分钟。
-         * 最大1440分钟(24小时),最小15分钟。
-         * */
-        json.put("length", 15);
-        /**会议主题。最多128个字符。**/
-        json.put("subject", subject);
-        /**
-         * 是否使用云会议室或者个人会议ID召开预约会议。默认0。
-         * 0:不使用云会议室或者个人会议ID
-         * 1:使用云会议室或者个人会议ID
-         * */
-        json.put("vmrFlag", 1);
-        /**绑定给当前创会帐号的VMR ID。通过查询云会议室及个人会议ID接口获取。**/
-        json.put("vmrID", vmrID);
-        //请求
-        String result = HttpRequest.post(serverUrl + conferences)
-                .header("X-Access-Token", token)
-                .header("Content-Type", "application/json")
-                .body(json)
-                .execute().body();
-        log.info("创建会议:{}", result);
-        return result;
-    }
-
-    /**
-     * 获取页面免登陆跳转的nonce信息
-     */
-    public String getNonce(){
-        String result = HttpRequest.post(serverUrl + getNonce)
-                .header("X-Access-Token", appauth())
-                .header("Content-Type", "application/json")
-                .execute().body();
-        log.info("获取页面免登陆跳转的nonce信息:{}", result);
-        Object nonce = JSONUtil.parseObj(result).get("nonce");
-        return nonce !=null ? nonce.toString() : "";
-    }
-
-}

+ 0 - 44
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/chenganshengbang/controller/WaterPressureController.java

@@ -1,44 +0,0 @@
-//package com.sooka.sponest.dataexchange.monitoringEquipment.chenganshengbang.controller;
-//
-//import com.sooka.sponest.dataexchange.monitoringEquipment.chenganshengbang.service.WaterPressureService;
-//import org.springframework.web.bind.annotation.PostMapping;
-//import org.springframework.web.bind.annotation.RequestBody;
-//import org.springframework.web.bind.annotation.RequestMapping;
-//import org.springframework.web.bind.annotation.RestController;
-//
-//import javax.annotation.Resource;
-//
-//@RestController
-//@RequestMapping("/api/WaterPressure")
-//public class WaterPressureController {
-//
-//    @Resource
-//    private WaterPressureService waterPressureService;
-//
-//    /**
-//     * 水压传感器上报数据
-//     * */
-//    @PostMapping("/waterPressureMessageReceiver")
-//    public byte[] waterPressureMessageReceiver(@RequestBody String data){
-//        waterPressureService.waterPressureMessageReceiver(data);
-//        return responseData();
-//    }
-//
-//    /**
-//     * 水压传感器指令下发
-//     * */
-//    @PostMapping("/command")
-//    public String command(@RequestBody String data){
-//        return waterPressureService.command(data);
-//    }
-//
-//    public static byte[] responseData(){
-//        int xiangyingma = 200;
-//        byte[] xiangyingbytes = new byte[4];
-//        xiangyingbytes[3] = (byte) (xiangyingma & 0xff);
-//        xiangyingbytes[2] = (byte) (xiangyingma >> 8 & 0xff);
-//        xiangyingbytes[1] = (byte) (xiangyingma >> 16 & 0xff);
-//        xiangyingbytes[0] = (byte) (xiangyingma >> 24 & 0xff);
-//        return xiangyingbytes;
-//    }
-//}

+ 0 - 9
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/chenganshengbang/service/WaterPressureService.java

@@ -1,9 +0,0 @@
-//package com.sooka.sponest.dataexchange.monitoringEquipment.chenganshengbang.service;
-//
-//
-//public interface WaterPressureService {
-//
-//    void waterPressureMessageReceiver(String data);
-//
-//    String command(String data);
-//}

+ 0 - 60
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/chenganshengbang/service/impl/WaterPressureServiceImpl.java

@@ -1,60 +0,0 @@
-//package com.sooka.sponest.dataexchange.monitoringEquipment.chenganshengbang.service.impl;
-//
-//import cn.hutool.http.HttpRequest;
-//import com.alibaba.fastjson.JSONObject;
-//import com.ruoyi.common.core.web.domain.AjaxResult;
-//import com.sooka.sponest.dataexchange.monitoringEquipment.chenganshengbang.service.WaterPressureService;
-//import com.sooka.sponest.dataexchange.remoteapi.service.center.monitor.RemoteMonitorService;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.stereotype.Service;
-//
-//import javax.annotation.Resource;
-//
-//@Service
-//public class WaterPressureServiceImpl implements WaterPressureService {
-//
-//    private static final Logger log = LoggerFactory.getLogger(WaterPressureServiceImpl.class);
-//
-//    @Resource
-//    public RemoteMonitorService remoteMonitorService;
-//
-//    /**水压传感器指令地址**/
-//    @Value("${monitoringEquipment.waterPressure.commandURL:}")
-//    public String commandURL;
-//
-//
-//    public void waterPressureMessageReceiver(String data){
-//        log.info("WaterPressure 接到数据 ==>{}",data);
-//        JSONObject object;
-//        AjaxResult res;
-//        try {
-//            object = JSONObject.parseObject(data);
-//            res = remoteMonitorService.saveWaterPressureDeviceData(object);
-//            log.info("WaterPressure 数据推送成功! data ===> {} , result ===> {}",data, res);
-//        }catch(Exception e){
-//            e.printStackTrace();
-//            log.error("WaterPressure 数据推送失败! data ===> {} , result ===> {}",data, e.getMessage());
-//        }
-//    }
-//
-//    public String command(String data){
-//        log.info("WaterPressure-command 接到指令 ==>{}",data);
-//        JSONObject object;
-//        String res = null;
-//        try {
-//            object = JSONObject.parseObject(data);
-//            res = HttpRequest.post(commandURL)
-//                    .header("Content-Type", "application/json")
-//                    .body(object.toJSONString())
-//                    .execute().body();
-//            log.info("指令下发成功! data ===> {} , result ===> {}",data, res);
-//            return res;
-//        }catch(Exception e){
-//            e.printStackTrace();
-//            log.error("指令下发失败! data ===> {} , result ===> {}",data, e.getMessage());
-//            return res;
-//        }
-//    }
-//}

+ 0 - 24
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/inserctpests/controller/PlantDiseasesAndInsectPestsController.java

@@ -1,24 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.inserctpests.controller;
-
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.sooka.sponest.dataexchange.monitoringEquipment.inserctpests.service.PlantDiseasesAndInsectPestsService;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-
-@RestController
-@RequestMapping("/api/plantDiseasesAndInsectPestsMessageReceiver")
-public class PlantDiseasesAndInsectPestsController {
-
-    @Resource
-    private PlantDiseasesAndInsectPestsService plantDiseasesAndInsectPestsService;
-
-    /**
-     * 病虫害传感器上报数据
-     * */
-    @GetMapping("/plantDiseasesAndInsectPestsMessageReceiver/{deviceNumber}")
-    public AjaxResult plantDiseasesAndInsectPestsMessageReceiver(@PathVariable("deviceNumber") String deviceNumber){
-        return plantDiseasesAndInsectPestsService.plantDiseasesAndInsectPestsMessageReceiver(deviceNumber);
-    }
-
-}

+ 0 - 10
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/inserctpests/service/PlantDiseasesAndInsectPestsService.java

@@ -1,10 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.inserctpests.service;
-
-import com.ruoyi.common.core.web.domain.AjaxResult;
-
-public interface PlantDiseasesAndInsectPestsService {
-
-    AjaxResult plantDiseasesAndInsectPestsMessageReceiver(String deviceNumber);
-
-
-}

+ 0 - 161
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/inserctpests/service/impl/PlantDiseasesAndInsectPestsServiceImpl.java

@@ -1,161 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.inserctpests.service.impl;
-
-import cn.hutool.http.HttpRequest;
-import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.system.api.domain.SysFile;
-import com.sooka.sponest.dataexchange.monitoringEquipment.inserctpests.service.PlantDiseasesAndInsectPestsService;
-import com.sooka.sponest.dataexchange.monitoringEquipment.sennor.api.API;
-import com.sooka.sponest.dataexchange.remoteapi.service.center.monitor.RemoteMonitorService;
-import com.sooka.sponest.dataexchange.util.FileUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-@Service
-public class PlantDiseasesAndInsectPestsServiceImpl implements PlantDiseasesAndInsectPestsService {
-
-    private static final Logger log = LoggerFactory.getLogger(PlantDiseasesAndInsectPestsServiceImpl.class);
-
-    @Resource
-    public RemoteMonitorService remoteMonitorService;
-
-    /**病虫害token**/
-    @Value("${monitoringEquipment.insect.insectToken:}")
-    private String insectToken;
-
-    /**病虫害用户名**/
-    @Value("${monitoringEquipment.insect.insectName:}")
-    private String insectName;
-
-    /**精讯物联网病虫害服务地址**/
-    @Value("${monitoringEquipment.insect.sennorInsectURL:}")
-    private String sennorInsectURL;
-
-    /**病虫害传感器图片下载地址**/
-    @Value("${monitoringEquipment.insect.insectPestsUrl:}")
-    private String insectPestsUrl;
-
-    public AjaxResult plantDiseasesAndInsectPestsMessageReceiver(String deviceNumber) {
-        //先请求
-        StringBuffer URI = new StringBuffer(sennorInsectURL + API.getInsectNewCollectionResult);
-        URI.append("?token=").append(insectToken);
-        URI.append("&userName=").append(insectName);
-        URI.append("&deviceNumber=").append(deviceNumber);
-        String result = HttpRequest.post(URI.toString())
-                .header("Content-Type", "application/json")
-                .execute().body();
-        log.info("plantDiseasesAndInsectPestsMessageReceiver 收到数据 ==> {}", result);
-
-        //后推送
-//        String result = deviceNumber;
-        JSONObject object;
-        try {
-            object = JSONObject.parseObject(result);
-            JSONObject data = object.getJSONObject("data");
-            String oldTaggingImgUrl = object.getJSONObject("data").getString("oldTaggingImgUrl");
-            String taggingImgUrl = object.getJSONObject("data").getString("taggingImgUrl");
-            if (oldTaggingImgUrl != null) {
-                JSONObject img = img(oldTaggingImgUrl);
-                if (img != null && img.getJSONObject("data") != null) {
-                    String imgUrl = img.getJSONObject("data").getString("url");
-                    if (imgUrl != null) {
-                        data.put("oldTaggingImgUrl", imgUrl);
-                    }
-                }
-            }
-
-            if (taggingImgUrl != null) {
-                JSONObject img2 = img(taggingImgUrl);
-                if (img2 != null && img2.getJSONObject("data") != null) {
-                    String imgUrl2 = img2.getJSONObject("data").getString("url");
-                    if (imgUrl2 != null) {
-                        data.put("taggingImgUrl", imgUrl2);
-                    }
-                }
-            }
-
-//            JSONObject img = img(oldTaggingImgUrl);
-//            object.getJSONObject("data").put("oldTaggingImgUrl", img.getJSONObject("data").getString("url"));
-//            JSONObject img2 = img(taggingImgUrl);
-//            object.getJSONObject("data").put("taggingImgUrl", img2.getJSONObject("data").getString("url"));
-
-            System.out.println("--------------------------图片-----------------------------");
-            String updatedOldTaggingImgUrl = data.getString("oldTaggingImgUrl");
-            String updatedTaggingImgUrl = data.getString("taggingImgUrl");
-            System.out.println("oldTaggingImgUrl:" + updatedOldTaggingImgUrl);
-            System.out.println("taggingImgUrl:" + updatedTaggingImgUrl);
-            System.out.println("-------------------------------------------------------------");
-            if (object.get("state") != null && object.getString("state").equals("success")) {
-                AjaxResult ajaxResult = remoteMonitorService.saveInsectPestsDeviceData(object);
-                log.info("数据推送成功! data ===> {} , result ===> {}", result, ajaxResult);
-                return AjaxResult.success("数据推送成功!", ajaxResult);
-            }
-            return AjaxResult.error("数据推送失败!", result);
-        } catch (Exception e) {
-            e.printStackTrace();
-            log.error("数据推送失败! data ===> {} , result ===> {}", result, e.getMessage());
-            return AjaxResult.error("数据推送失败!", result);
-        }
-    }
-
-    private JSONObject img(String oldTggingImgUrl) {
-        try {
-            //定义一个URL对象
-            URL url = new URL(insectPestsUrl + oldTggingImgUrl);
-            //打开连接
-            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-            //设置请求方式为"GET"
-            conn.setRequestMethod("GET");
-            //超时响应时间为10秒
-            conn.setConnectTimeout(10 * 1000);
-            //通过输入流获取图片数据
-            InputStream inStream = conn.getInputStream();
-            //得到图片的二进制数据,以二进制封装得到数据,具有通用性
-            byte[] data = readInputStream(inStream);
-            //new一个文件对象用来保存图片,默认保存当前工程根目录
-            File imageFile = new File("InputStreamInfo.jpg");
-            //创建输出流
-            FileOutputStream outStream = new FileOutputStream(imageFile);
-            //写入数据
-            outStream.write(data);
-            //关闭输出流
-            outStream.close();
-            MultipartFile multipartFile = FileUtils.getMultipartFile(imageFile);
-            R<SysFile> r = remoteMonitorService.upload(multipartFile);
-            return JSONObject.parseObject(JSONObject.toJSONString(r));
-        } catch (Exception e) {
-            e.printStackTrace();
-            return new JSONObject();
-        }
-    }
-
-    private static byte[] readInputStream(InputStream inStream) throws Exception {
-        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-        //创建一个Buffer字符串
-        byte[] buffer = new byte[6024];
-        //每次读取的字符串长度,如果为-1,代表全部读取完毕
-        int len = 0;
-        //使用一个输入流从buffer里把数据读取出来
-        while ((len = inStream.read(buffer)) != -1) {
-            //用输出流往buffer里写入数据,中间参数代表从哪个位置开始读,len代表读取的长度
-            outStream.write(buffer, 0, len);
-        }
-        //关闭输入流
-        inStream.close();
-        //把outStream里的数据写入内存
-        return outStream.toByteArray();
-    }
-
-}

+ 0 - 12
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/api/API.java

@@ -1,12 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.sennor.api;
-
-public class API {
-
-    //获取设备信息
-    public static final String getDeviceInfo = "device/getDeviceInfo";
-    //查询设备节点数据接口
-    public static final String selSensorData = "device/selSensorData";
-
-    public static final String getInsectNewCollectionResult = "getInsectNewCollectionResult";
-
-}

+ 0 - 28
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/controller/SennorController.java

@@ -1,28 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.sennor.controller;
-
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.sooka.sponest.dataexchange.monitoringEquipment.sennor.service.SennorService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-
-@RestController
-@RequestMapping("/api/Sennor")
-public class SennorController {
-
-    @Resource
-    private SennorService sennorService;
-
-    /**
-     * 查询设备节点数据
-     * */
-    @GetMapping("/getDeviceInfo/{deviceNumber}")
-    public AjaxResult getDeviceInfo(@PathVariable("deviceNumber") String deviceNumber){
-        return sennorService.getDeviceInfo(deviceNumber);
-    }
-
-
-}

+ 0 - 14
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/service/SennorService.java

@@ -1,14 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.sennor.service;
-
-import cn.hutool.json.JSONArray;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-
-public interface SennorService {
-
-    /**
-     * 查询设备节点数据
-     * */
-    AjaxResult getDeviceInfo(String deviceNumber);
-
-    JSONArray getDevideCodeMapByTypes(String types);
-}

+ 0 - 78
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/sennor/service/impl/SennorServiceImpl.java

@@ -1,78 +0,0 @@
-package com.sooka.sponest.dataexchange.monitoringEquipment.sennor.service.impl;
-
-import cn.hutool.http.HttpRequest;
-import cn.hutool.json.JSONArray;
-import cn.hutool.json.JSONUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.constant.HttpStatus;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.sooka.sponest.dataexchange.monitoringEquipment.sennor.api.API;
-import com.sooka.sponest.dataexchange.monitoringEquipment.sennor.service.SennorService;
-import com.sooka.sponest.dataexchange.remoteapi.service.center.monitor.RemoteMonitorService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-@Service
-public class SennorServiceImpl implements SennorService {
-
-    private static final Logger log = LoggerFactory.getLogger(SennorServiceImpl.class);
-
-    /**精讯物联网秘钥**/
-    @Value("${monitoringEquipment.sennor.sennorSecretKey:}")
-    public String sennorSecretKey;
-
-    /**精讯物联网服务地址**/
-    @Value("${monitoringEquipment.sennor.sennorUrl:}")
-    public String sennorUrl;
-
-    @Resource
-    public RemoteMonitorService remoteMonitorService;
-
-
-
-    //这个方法应该用定时任务三分钟调用一次
-    @Override
-    public AjaxResult getDeviceInfo(String deviceNumber) {
-        //先请求
-        StringBuffer URI = new StringBuffer(sennorUrl + API.getDeviceInfo);
-        URI.append("?secretKey=").append(sennorSecretKey);
-        URI.append("&deviceNumber=").append(deviceNumber);
-        String result = HttpRequest.get(URI.toString())
-                .header("Content-Type", "application/json")
-                .execute().body();
-        log.info("Sennor 收到数据 ==> {}", result);
-        //后推送
-        JSONObject object;
-        String res;
-        try {
-            object = JSONObject.parseObject(result);
-            AjaxResult ajaxResult = remoteMonitorService.saveSennorDeviceData(object);
-            log.info("数据推送成功! data ===> {} , result ===> {}",result, ajaxResult);
-            return AjaxResult.success("数据推送成功!",ajaxResult);
-        }catch(Exception e){
-            e.printStackTrace();
-            log.error("数据推送失败! data ===> {} , result ===> {}",result, e.getMessage());
-            return AjaxResult.error("数据推送失败!",result);
-        }
-
-    }
-
-    @Override
-    public JSONArray getDevideCodeMapByTypes(String types) {
-        //先请求
-        AjaxResult ajaxResult = remoteMonitorService.getDevideCodeMapByTypes(types);
-        try {
-            if(ajaxResult.get("code").equals(HttpStatus.SUCCESS)){
-                return JSONUtil.parseArray(ajaxResult.get("data"));
-            }
-        }catch(Exception e){
-            e.printStackTrace();
-            log.error("服务端数据校验失败! data ===> {} , result ===> {}", JSONUtil.toJsonStr(ajaxResult.get("data")), e.getMessage());
-        }
-        return new JSONArray();
-    }
-}

+ 0 - 114
src/main/java/com/sooka/sponest/dataexchange/monitoringEquipment/shuicejia/TcpServer.java

@@ -1,114 +0,0 @@
-//package com.sooka.sponest.dataexchange.monitoringEquipment.shuicejia;
-//
-//import cn.hutool.core.io.BufferUtil;
-//import cn.hutool.core.io.IORuntimeException;
-//import cn.hutool.core.io.IoUtil;
-//import cn.hutool.core.util.StrUtil;
-//import cn.hutool.socket.nio.NioServer;
-//import com.alibaba.fastjson.JSONObject;
-//import com.ruoyi.common.core.web.domain.AjaxResult;
-//import com.sooka.sponest.dataexchange.remoteapi.service.center.monitor.RemoteMonitorService;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.beans.factory.annotation.Value;
-//import org.springframework.boot.CommandLineRunner;
-//import org.springframework.stereotype.Component;
-//
-//import javax.annotation.Resource;
-//import java.io.IOException;
-//import java.lang.reflect.Field;
-//import java.nio.ByteBuffer;
-//import java.nio.channels.SocketChannel;
-//import java.text.SimpleDateFormat;
-//import java.util.Date;
-//import java.util.HashMap;
-//import java.util.Map;
-//
-//@Component
-//public class TcpServer extends Thread implements CommandLineRunner {
-//
-//    private static final Logger log = LoggerFactory.getLogger(TcpServer.class);
-//    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//
-//    /**服务器地址**/
-//    @Value("${monitoringEquipment.tcp.port:}")
-//    public Integer port;
-//
-//    @Resource
-//    public RemoteMonitorService remoteMonitorService;
-//
-//
-//    @Override
-//    public void run(String... args){
-//        NioServer server = new NioServer(port);
-//        server.setChannelHandler((sc)->{
-//            ByteBuffer readBuffer = ByteBuffer.allocate(1024);
-//            try{
-//                int readBytes = sc.read(readBuffer);
-//                if (readBytes > 0) {
-//                    readBuffer.flip();
-//                    byte[] bytes = new byte[readBuffer.remaining()];
-//                    readBuffer.get(bytes);
-//                    String body = StrUtil.utf8Str(bytes);
-//                    readAndWrite(sc, body);
-//                } else if (readBytes < 0) {
-//                    IoUtil.close(sc);
-//                }
-//            } catch (IOException e){
-//                throw new IORuntimeException(e);
-//            }
-//        });
-//        server.listen();
-//    }
-//
-//    public void readAndWrite(SocketChannel channel, String response) throws IOException {
-//        JSONObject object;
-//        AjaxResult result;
-//        log.info("TCPServer 收到数据 ==> {}", response);
-//        try {
-//            object = JSONObject.parseObject(response);
-//            //推送数据到监控中心
-//            result = remoteMonitorService.saveWaterMonitoringData(object);
-//            log.info("TCPServer 数据推送成功! result ===> {}", result);
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//            log.info("TCPServer 数据推送失败! result ===> {}", e.getMessage());
-//            return;
-//        }
-//        //返回客户端数据
-//        String st = object.get("ST").toString();
-//        Integer serial = Integer.parseInt(object.get("SERIAL").toString());
-//        JSONObject res = new JSONObject();
-//        res.put("ST",st);
-//        res.put("SERIAL",serial);
-//        res.put("MARK",1);
-//        res.put("TM", sdf.format(new Date()));
-//        //将缓冲数据写入渠道,返回给客户端
-//        channel.write(BufferUtil.createUtf8(res.toJSONString()));
-//    }
-//
-//
-//    /**
-//     * 对象转Map
-//     * @param object
-//     * @return
-//     * @throws IllegalAccessException
-//     */
-//    public static Map beanToMap(Object object){
-//        Map<String, Object> map = new HashMap<>();
-//        Field[] fields = object.getClass().getDeclaredFields();
-//        for (Field field : fields) {
-//            field.setAccessible(true);
-//            try {
-//                map.put(field.getName(), field.get(object));
-//            } catch (IllegalAccessException e) {
-//                e.printStackTrace();
-//            }
-//        }
-//        return map;
-//    }
-//
-//
-//}
-//
-//

+ 0 - 65
src/main/java/com/sooka/sponest/dataexchange/remoteapi/fallback/center/monitor/RemoteMonitorBaseServiceFallbackFactory.java

@@ -1,65 +0,0 @@
-package com.sooka.sponest.dataexchange.remoteapi.fallback.center.monitor;
-
-import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.system.api.domain.SysFile;
-import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
-import com.sooka.sponest.dataexchange.remoteapi.service.center.monitor.RemoteMonitorService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.cloud.openfeign.FallbackFactory;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.multipart.MultipartFile;
-
-/**
- * @program: ruoyi
- * @description: yy
- * @author: yy
- * @create: 2022-06-16 11:05
- **/
-@Component
-public class RemoteMonitorBaseServiceFallbackFactory implements FallbackFactory<RemoteMonitorService> {
-
-    private static final Logger log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);
-
-    @Override
-    public RemoteMonitorService create(Throwable cause) {
-        log.error("监控中心-服务调用失败:{}", cause.getMessage());
-
-        return new RemoteMonitorService() {
-
-            @Override
-            public AjaxResult saveWaterMonitoringData(@RequestBody JSONObject json) {
-                return null;
-            }
-
-            @Override
-            public AjaxResult saveWaterPressureDeviceData(@RequestBody JSONObject json){
-                return null;
-            }
-
-            @Override
-            public AjaxResult saveSennorDeviceData(@RequestBody JSONObject json){
-                return null;
-            }
-
-            @Override
-            public AjaxResult getDevideCodeMapByTypes(@RequestBody String types){
-                return null;
-            }
-
-            @Override
-            public AjaxResult saveInsectPestsDeviceData(@RequestBody JSONObject json){
-                return null;
-            }
-
-            @Override
-            public R<SysFile> upload(MultipartFile file){
-                return null;
-            }
-
-        };
-    }
-}

+ 0 - 67
src/main/java/com/sooka/sponest/dataexchange/remoteapi/service/center/monitor/RemoteMonitorService.java

@@ -1,67 +0,0 @@
-package com.sooka.sponest.dataexchange.remoteapi.service.center.monitor;
-
-import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.common.core.web.domain.AjaxResult;
-import com.ruoyi.system.api.domain.SysFile;
-import com.sooka.sponest.dataexchange.remoteapi.fallback.center.monitor.RemoteMonitorBaseServiceFallbackFactory;
-import com.sooka.sponest.dataexchange.remoteapi.service.ModulesServiceNameContants;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.multipart.MultipartFile;
-
-@FeignClient(
-        contextId = "remoteMonitorService"
-        ,value = ModulesServiceNameContants.MONITOR_SERVICE
-        ,fallbackFactory = RemoteMonitorBaseServiceFallbackFactory.class
-        ,url = "${sooka.service.monitor}"
-)
-public interface RemoteMonitorService {
-    /**
-     * 【水流速推送】向监控中心推送水流速采集数据
-     * @param json
-     * @return AjaxResult
-     * @author limeng
-     * @date 2023/7/31 16:27
-     **/
-    @PostMapping("/device/saveWaterMonitoringData")
-    public AjaxResult saveWaterMonitoringData(@RequestBody JSONObject json);
-
-
-    /**
-     * 【水压】接收城安盛邦 水压传感器数据方法
-     * */
-    @PostMapping("/device/saveWaterPressureDeviceData")
-    public AjaxResult saveWaterPressureDeviceData(@RequestBody JSONObject json);
-
-    /**
-     * 【物联网】接收精讯传感器:大气、水质、土壤墒情数据通用方法
-     * */
-    @ApiOperation(value = "接收精讯传感器数据通用方法", notes = "接收精讯传感器数据通用方法")
-    @PostMapping("/device/saveSennorDeviceData")
-    public AjaxResult saveSennorDeviceData(@RequestBody JSONObject json);
-
-    /**
-     * 【水流速】根据设备类型查询监控设备Map
-     * */
-    @ApiOperation(value = "接收传感器水质数据", notes = "接收传感器水质数据")
-    @PostMapping("/device/getDevideCodeMapByTypes")
-    public AjaxResult getDevideCodeMapByTypes(@RequestBody String types);
-
-    /**
-     * 【病虫害】接收病虫害传感器数据方法
-     * */
-    @ApiOperation(value = "接收病虫害传感器数据", notes = "接收病虫害传感器数据")
-    @PostMapping("/device/saveInsectPestsDeviceData")
-    public AjaxResult saveInsectPestsDeviceData(@RequestBody JSONObject json);
-
-    /**
-     * 病虫害文件上传
-     */
-    @PostMapping (value = "/centerMonitorFeign/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
-    public R<SysFile> upload(MultipartFile file);
-
-}

+ 0 - 94
src/main/java/com/sooka/sponest/dataexchange/scheduleTask/StaticScheduleTask.java

@@ -1,94 +0,0 @@
-package com.sooka.sponest.dataexchange.scheduleTask;
-
-import cn.hutool.json.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.core.utils.DateUtils;
-import com.sooka.sponest.dataexchange.monitoringEquipment.inserctpests.service.PlantDiseasesAndInsectPestsService;
-import com.sooka.sponest.dataexchange.monitoringEquipment.sennor.service.SennorService;
-import org.apache.commons.lang3.time.FastDateFormat;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-
-import javax.annotation.Resource;
-import java.text.ParseException;
-import java.util.Calendar;
-
-/**
- * @author limeng
- * @date 2023年11月30日 8:50
- */
-@Configuration
-@EnableScheduling
-public class StaticScheduleTask {
-
-    protected static final Logger logger = LoggerFactory.getLogger(StaticScheduleTask.class);
-
-    private static FastDateFormat simpleDateFormat = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss");
-
-    @Resource
-    private SennorService sennorService;
-
-    @Resource
-    private PlantDiseasesAndInsectPestsService plantDiseasesAndInsectPestsService;
-
-    /**精讯物联网设备类型**/
-    @Value("${monitoringEquipment.sennor.sennorDeviceTypes:}")
-    public String sennorDeviceTypes;
-
-    /**精讯物联网病虫害设备类型**/
-    @Value("${monitoringEquipment.insect.sennorInsectDeviceType:}")
-    public String sennorInsectDeviceType;
-
-
-//    @Scheduled(cron = "0 0 0/2 * * ?")//添加定时任务 每2小时执行
-//    @Scheduled(cron = "0 */5 * * * ?")//添加定时任务 每1分钟执行
-    private void configureTasks() {
-        logger.info("执行物联网数据采集定时任务=>{}", DateUtils.dateTimeNow());
-        JSONArray jsonArray = sennorService.getDevideCodeMapByTypes(sennorDeviceTypes);
-        for (Object object : jsonArray){
-            JSONObject jsonObject = JSONObject.parseObject(object.toString());
-            sennorService.getDeviceInfo(jsonObject.getString("device_code"));
-        }
-    }
-
-
-//    @Scheduled(cron = "0 0 0/2 * * ?")//添加定时任务 每2小时执行
-//    @Scheduled(cron = "0 */5 * * * ?")//添加定时任务 每1分钟执行
-    private void configureTask() {
-        logger.info("执行虫情数据采集定时任务=>{}", DateUtils.dateTimeNow());
-        JSONArray jsonArray = sennorService.getDevideCodeMapByTypes(sennorInsectDeviceType);
-        for (Object object : jsonArray){
-            JSONObject jsonObject = JSONObject.parseObject(object.toString());
-            plantDiseasesAndInsectPestsService.plantDiseasesAndInsectPestsMessageReceiver(jsonObject.getString("device_code"));
-        }
-    }
-
-
-    /**
-     * 比较两个日期大小
-     **/
-    private boolean daysBefore(String time) {
-        boolean result = false;
-        try {
-            Calendar calendar = getCalendar(time);
-            Calendar now = Calendar.getInstance();
-            result = calendar.before(now);
-        } catch (ParseException e) {
-            logger.error(e.getMessage());
-        }
-        return result;
-    }
-
-    /**
-     * 将String时间转换为Calendar
-     **/
-    private static Calendar getCalendar(String time) throws ParseException {
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTime(simpleDateFormat.parse(time));
-        return calendar;
-    }
-}