فهرست منبع

视频直播间接口以及报警设备接口
2022年8月18日18时51分

纪新园 3 سال پیش
والد
کامیت
cb5530aa88
25فایلهای تغییر یافته به همراه1863 افزوده شده و 155 حذف شده
  1. 6 0
      ruoyi-admin/pom.xml
  2. 294 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/liveBroadcast/controller/LiveBroadcastController.java
  3. 0 141
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/MonitoringAlarmsController.java
  4. 109 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/controller/MonitoringAlarmsController.java
  5. 115 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/main/OpenApi.java
  6. 44 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/req/BaseBean.java
  7. 97 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/req/QueryAlarmInfoListBean.java
  8. 27 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/req/QueryTokenBean.java
  9. 42 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/QueryTimerResp.java
  10. 41 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/QueryTokenResp.java
  11. 23 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/TimerData.java
  12. 24 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/TokenData.java
  13. 133 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/Cipher.java
  14. 372 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/HttpUtil.java
  15. 90 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/RequestUtils.java
  16. 286 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/TextUtils.java
  17. 44 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/VerifyCodeUtils.java
  18. 13 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/appHold/AppWarehouseController.java
  19. 10 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/quotation/TSeapriceController.java
  20. 32 0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/LiveBroadcast.java
  21. 1 1
      ruoyi-warehouse/src/main/java/com/ruoyi/quotation/service/ITSeapriceService.java
  22. 5 2
      ruoyi-warehouse/src/main/java/com/ruoyi/quotation/service/impl/TSeapriceServiceImpl.java
  23. 40 4
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java
  24. 2 0
      ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsitemsElabelServiceImpl.java
  25. 13 3
      ruoyi-warehouse/src/main/resources/mapper/quotation/TSeapriceMapper.xml

+ 6 - 0
ruoyi-admin/pom.xml

@@ -17,6 +17,12 @@
 
     <dependencies>
 
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.5</version>
+        </dependency>
+
         <!-- spring-boot-devtools -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 294 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/liveBroadcast/controller/LiveBroadcastController.java

@@ -0,0 +1,294 @@
+package com.ruoyi.web.controller.liveBroadcast.controller;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.constant.LiveBroadcast;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.JsonUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+@Api("直播间相关接口")
+@RestController
+@RequestMapping("/api/LiveBroadcast")
+public class LiveBroadcastController {
+
+    /**
+     * 获取access_token
+     */
+    @ApiOperation("获取access_token")
+    @PostMapping(value = "/getAccessToken")
+    public AjaxResult getAccessToken() throws Exception {
+        String body = "client_id=" + LiveBroadcast.APP_KEY + "&client_secret=" + LiveBroadcast.SECRET_KEY + "";
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("User-Agent", "Apipost client Runtime/+https://www.apipost.cn/")
+                .addHeader("Content-Type", "application/x-www-form-urlencoded")
+                .url(LiveBroadcast.GET_ACCESS_TOKEN)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/x-www-form-urlencoded"), body))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/x-www-form-urlencoded"), body))
+                .build();
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+
+    /**
+     * 获取全局token
+     */
+    @ApiOperation("获取全局token")
+    @PostMapping(value = "/getToken")
+    public AjaxResult getToken(@RequestParam(value = "productCode") String productCode,
+                               @RequestParam(value = "token") String token) throws Exception {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("productCode", productCode);
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("access_token", token)
+                .url(LiveBroadcast.TOKEN_JWT)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 获取挑战码接口
+     */
+//    @ApiOperation("获取挑战码接口")
+    @PostMapping(value = "/challengeCode")
+    public AjaxResult challengeCode(@RequestParam(value = "name") String name,
+                                    @RequestParam(value = "productCode", required = false) String productCode,
+                                    @RequestParam(value = "type") String type) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("name", name);
+        rsp.put("productCode", productCode);
+        rsp.put("type", type);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .url(LiveBroadcast.CHALLENGE_CODE)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 登录
+     */
+//    @ApiOperation("登录")
+    @PostMapping(value = "/login")
+    public AjaxResult login(@RequestParam(value = "name") String name,
+                            @RequestParam(value = "password") String password,
+                            @RequestParam(value = "productCode", required = false) String productCode,
+                            @RequestParam(value = "type") String type,
+                            @RequestParam(value = "verifyCodeId", required = false) String verifyCodeId,
+                            @RequestParam(value = "expired", required = false) String expired,
+                            @RequestParam(value = "codeId") String codeId
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("name", name);
+        rsp.put("password", password);
+        rsp.put("productCode", productCode);
+        rsp.put("type", type);
+        rsp.put("verifyCodeId", verifyCodeId);
+        rsp.put("expired", expired);
+        rsp.put("codeId", codeId);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .url(LiveBroadcast.LOGIN)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+
+    /**
+     * 根据监控点编号查询直播间信息
+     */
+    @ApiOperation("根据监控点编号查询直播间信息")
+    @PostMapping(value = "/cameraCode")
+    public AjaxResult cameraCode(@RequestParam(value = "cameraCode", required = false) String cameraCode,
+                            @RequestParam(value = "streamType", required = false) String streamType,
+                            @RequestParam(value = "projectId") String projectId,
+                                 @RequestParam(value = "Authorization") String Authorization,
+                             @RequestParam(value = "token") String token
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("cameraCode", cameraCode);
+        rsp.put("streamType", streamType);
+        rsp.put("projectId", projectId);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("access_token",token)
+                .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.CAMERA_CODE)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 开通直播间
+     */
+    @ApiOperation("开通直播间")
+    @PostMapping(value = "/create")
+    public AjaxResult create(@RequestParam(value = "title") String title,
+                             @RequestParam(value = "desc") String desc,
+                             @RequestParam(value = "projectId") String projectId,
+                             @RequestParam(value = "canWatch", required = false) String canWatch,
+                             @RequestParam(value = "autoVod", required = false) String autoVod,
+                             @RequestParam(value = "Authorization") String Authorization,
+                             @RequestParam(value = "token") String token
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("title", title);
+        rsp.put("desc", desc);
+        rsp.put("projectId", projectId);
+        rsp.put("canWatch", canWatch);
+        rsp.put("autoVod", autoVod);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("Authorization",Authorization)
+                .addHeader("access_token",token)
+                .url(LiveBroadcast.CREATE)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 删除直播间
+     */
+    @ApiOperation("删除直播间")
+    @PostMapping(value = "/delete")
+    public AjaxResult delete(@RequestParam(value = "id") String id,
+                             @RequestParam(value = "projectId") String projectId,
+                             @RequestParam(value = "Authorization") String Authorization,
+                             @RequestParam(value = "token") String token
+    ) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("id", id);
+        rsp.put("projectId", projectId);
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .addHeader("access_token",token)
+                .addHeader("Authorization",Authorization)
+                .url(LiveBroadcast.DELETE)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+}

+ 0 - 141
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/MonitoringAlarmsController.java

@@ -1,141 +0,0 @@
-package com.ruoyi.web.controller.monitoringAlarms;
-
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.ruoyi.common.constant.MonitoringAlarms;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.utils.JsonUtil;
-import com.ruoyi.common.utils.sign.Md5Utils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.RequestBody;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.springframework.transaction.interceptor.TransactionAspectSupport;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.*;
-
-@Api("报警设备相关接口")
-@RestController
-@RequestMapping("/api")
-public class MonitoringAlarmsController {
-
-
-    /**
-     * 获取接口调用凭证
-     */
-    @ApiOperation("获取接口调用凭证")
-    @PostMapping(value = "/getAccessToken")
-    public AjaxResult getAccessToken(@RequestParam(value = "appId") String appId,
-                                     @RequestParam(value = "appSecret") String appSecret) {
-
-        Map<String, Object> rsp = new HashMap<>();
-
-        rsp.put("appId", appId);
-        rsp.put("appSecret", appSecret);
-
-        OkHttpClient okHttpClient = new OkHttpClient();
-        Request request = new Request.Builder()
-                .url(MonitoringAlarms.API_PREFIX_DEV + MonitoringAlarms.GET_ACCESS_TOKEN)
-                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
-                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
-                .build();
-
-        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
-        String s;
-        try {
-            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
-        } catch (IOException e) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("请求反馈异常," + e.getMessage());
-        }
-        System.out.println(s);
-        JSONObject result = JSON.parseObject(s);
-        return AjaxResult.success(result);
-    }
-
-    /**
-     * 告警列表查询
-     */
-    @ApiOperation("告警列表查询")
-    @PostMapping(value = "/queryAlarmList")
-    public AjaxResult queryAlarmList(@RequestParam(value = "pageNum") int pageNum,
-                                     @RequestParam(value = "pageSize") int pageSize,
-                                     @RequestParam(value = "token") String token) {
-
-        Calendar.getInstance().getTimeInMillis();
-
-        long time = Calendar.getInstance().getTimeInMillis();
-
-        TreeMap<String, Object> rsp = new TreeMap<>();
-        rsp.put("aiDevList", new String[]{"sn_xxx1", "sn_xxx2"});
-        rsp.put("alarmState", 1);
-        rsp.put("alarmType", 2);
-        rsp.put("devList", new String[]{"sn_C_1", "sn_C_2"});
-        rsp.put("endTime", "1580918600000");
-        rsp.put("keyword", "test");
-        rsp.put("nonce", "786738");
-        rsp.put("pageNum", pageNum);
-        rsp.put("pageSize", pageSize);
-        rsp.put("projectId", 1);
-        rsp.put("r", time);
-        rsp.put("startTime", "1580745600000");
-        rsp.put("token", token);
-        // 签名内容
-        String str = "aiDevList=" + Arrays.toString(new String[]{"sn_xxx1", "sn_xxx2"}) + "&"
-                + "alarmState=" + 1 + "&"
-                + "alarmType=" + 2 + "&"
-                + "alarmState=" + 1 + "&"
-                + "devList=" + Arrays.toString(new String[]{"sn_C_1", "sn_C_2"}) + "&"
-                + "endTime=" + "1580918600000" + "&"
-                + "keyword=" + "test" + "&"
-                + "nonce=" + "786738" + "&"
-                + "pageNum=" + pageNum + "&"
-                + "pageSize=" + pageSize + "&"
-                + "projectId=" + 1 + "&"
-                + "r=" + time + "&"
-                + "startTime=" + "1580918600000" + "&"
-                + "token=" + token;
-
-//        String str = "aiDevList,alarmState,alarmType,alarmState,devList,endTime=1580918600000&,keyword,nonce,pageNum,pageSize,projectId,r,startTime,token";
-
-//        String sign = Md5Utils.hash(JsonUtil.toJson(rsp));
-        String sign = DigestUtils.md5Hex(JsonUtil.toJson(rsp).getBytes());
-
-        rsp.put("sign", sign);
-        System.out.println("请求数据=" + JsonUtil.toJson(rsp));
-
-        System.out.println("签名加密=" + sign);
-
-        /* .addHeader("token",token)
-                .addHeader("sign",sign)
-                .addHeader("r",time+"")
-                .addHeader("nonce","786738")*/
-
-        OkHttpClient okHttpClient = new OkHttpClient();
-        Request request = new Request.Builder()
-                .url(MonitoringAlarms.API_PREFIX_DEV + MonitoringAlarms.QUERY_ALARM_LIST)
-                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
-                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
-                .build();
-        String s;
-        try {
-            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
-        } catch (IOException e) {
-            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-            return AjaxResult.error("请求反馈异常," + e.getMessage());
-        }
-        System.out.println(s);
-        JSONObject result = JSON.parseObject(s);
-        return AjaxResult.success(result);
-    }
-
-}

+ 109 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/controller/MonitoringAlarmsController.java

@@ -0,0 +1,109 @@
+package com.ruoyi.web.controller.monitoringAlarms.controller;
+
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.constant.MonitoringAlarms;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.JsonUtil;
+import com.ruoyi.common.utils.sign.Md5Utils;
+import com.ruoyi.web.controller.monitoringAlarms.main.OpenApi;
+import com.ruoyi.web.controller.monitoringAlarms.req.QueryAlarmInfoListBean;
+import com.ruoyi.web.controller.monitoringAlarms.utils.HttpUtil;
+import com.ruoyi.web.controller.monitoringAlarms.utils.RequestUtils;
+import com.ruoyi.web.controller.monitoringAlarms.utils.VerifyCodeUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.*;
+
+@Api("报警设备相关接口")
+@RestController
+@RequestMapping("/api")
+public class MonitoringAlarmsController {
+
+
+    /**
+     * 获取接口调用凭证
+     */
+    @ApiOperation("获取接口调用凭证")
+    @PostMapping(value = "/getAccessToken")
+    public AjaxResult getAccessToken(/*@RequestParam(value = "appId") String appId,
+                                     @RequestParam(value = "appSecret") String appSecret*/) {
+
+        Map<String, Object> rsp = new HashMap<>();
+
+        rsp.put("appId", "26GgM5hQYPPOa6GW");
+        rsp.put("appSecret", "fa6370788e207c06a9dcbfb01b46ddff9c396124");
+
+        OkHttpClient okHttpClient = new OkHttpClient();
+        Request request = new Request.Builder()
+                .url(MonitoringAlarms.API_PREFIX_DEV + MonitoringAlarms.GET_ACCESS_TOKEN)
+                .method("post", RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .post(RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), JsonUtil.toJson(rsp)))
+                .build();
+
+        System.out.println("请求数据=   " + JsonUtil.toJson(rsp));
+        String s;
+        try {
+            s = Objects.requireNonNull(okHttpClient.newCall(request).execute().body()).string();
+        } catch (IOException e) {
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return AjaxResult.error("请求反馈异常," + e.getMessage());
+        }
+        System.out.println(s);
+        JSONObject result = JSON.parseObject(s);
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 告警列表查询
+     */
+    @ApiOperation("告警列表查询")
+    @PostMapping(value = "/queryAlarmList")
+    public AjaxResult queryAlarmList(@RequestParam(value = "pageNum") int pageNum,
+                                     @RequestParam(value = "pageSize") int pageSize,
+                                     @RequestParam(value = "token") String token) {
+
+        String interfaceUrl = MonitoringAlarms.API_PREFIX_DEV + MonitoringAlarms.QUERY_ALARM_LIST;
+
+        QueryAlarmInfoListBean queryAlarmInfoListBean = new QueryAlarmInfoListBean();
+//        long r = System.currentTimeMillis();
+        long r = OpenApi.getSystemTimer(MonitoringAlarms.API_PREFIX_DEV);
+        queryAlarmInfoListBean.setR(r);
+        queryAlarmInfoListBean.setNonce(VerifyCodeUtils.generateVerifyCode(6));
+        queryAlarmInfoListBean.setToken(token);
+         queryAlarmInfoListBean.setAlarmType(2);
+        queryAlarmInfoListBean.setEndTime(0);
+        queryAlarmInfoListBean.setEndTime(0);
+        queryAlarmInfoListBean.setPageSize(pageSize);
+        queryAlarmInfoListBean.setPageNum(pageNum);
+        queryAlarmInfoListBean.setProjectId(234);
+
+        String sign = RequestUtils.getParameterSignature(queryAlarmInfoListBean);
+        queryAlarmInfoListBean.setSign(sign);
+        String jsonString =  JsonUtil.toJson(queryAlarmInfoListBean);
+        String retStr = null;
+        try {
+            retStr =  HttpUtil.post(interfaceUrl,jsonString,"application/json","utf-8",10000,30000,null);
+            System.out.println(retStr);
+
+        }catch (Exception ex){
+            System.out.println(ex);
+        }
+        JSONObject result = JSON.parseObject(retStr);
+        return AjaxResult.success(result);
+    }
+
+}

+ 115 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/main/OpenApi.java

@@ -0,0 +1,115 @@
+package com.ruoyi.web.controller.monitoringAlarms.main;
+
+
+import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.utils.JsonUtil;
+import com.ruoyi.web.controller.monitoringAlarms.req.QueryAlarmInfoListBean;
+import com.ruoyi.web.controller.monitoringAlarms.req.QueryTokenBean;
+import com.ruoyi.web.controller.monitoringAlarms.resp.QueryTimerResp;
+import com.ruoyi.web.controller.monitoringAlarms.resp.QueryTokenResp;
+import com.ruoyi.web.controller.monitoringAlarms.utils.HttpUtil;
+import com.ruoyi.web.controller.monitoringAlarms.utils.RequestUtils;
+import com.ruoyi.web.controller.monitoringAlarms.utils.VerifyCodeUtils;
+import springfox.documentation.spring.web.json.Json;
+
+public class OpenApi {
+
+
+    public static void main(String[] args) {
+        try {
+            // 获取token
+            String appId = "";
+            String appSecret = "";
+            String url = "https://aim.360os.com/";
+            String token =  getToken(url,appId,appSecret);
+
+            queryAlarmList(url,token);
+
+            System.out.println(token);
+        }catch (Exception ex){
+
+        }
+    }
+
+    public static  long getSystemTimer(String url){
+
+        String interfaceUrl = url+"/api/platformMgr/getSysTime";
+        QueryTimerResp queryTimerResp = null;
+        try {
+            String strRet = HttpUtil.get(interfaceUrl);
+
+            queryTimerResp = JSON.parseObject(strRet,QueryTimerResp.class);
+        }catch (Exception ex){
+        }
+        return queryTimerResp.getData().getSysTime();
+    }
+
+    /**
+     *  获取token
+     * @param appId
+     * @param appSecret
+     * @return
+     */
+    public static  String getToken(String url,String appId,String appSecret){
+
+        String interfaceUrl = url+"/user-mgr/user/getAccessToken";
+
+        QueryTokenBean queryTokenBean = new QueryTokenBean();
+        queryTokenBean.setAppId(appId);
+        queryTokenBean.setAppSecret(appSecret);
+
+        String jsonString = JsonUtil.toJson(queryTokenBean);
+        String retStr = null;
+        QueryTokenResp queryTokenResp = null;
+        try {
+            retStr =  HttpUtil.post(interfaceUrl,jsonString,"application/json","utf-8",10000,10000,null);
+            System.out.println(retStr);
+
+            queryTokenResp = JSON.parseObject(retStr,QueryTokenResp.class);
+
+        }catch (Exception ex){
+            System.out.println(ex);
+        }
+        return queryTokenResp.getData().getAccess_token();
+    }
+
+    /**
+     *  查询告警列表
+     * @param url
+     * @param token
+     * @return
+     */
+    public static  String queryAlarmList(String url,String token){
+
+        String interfaceUrl = url+"/openapi/alarm/queryAlarmList";
+
+        QueryAlarmInfoListBean queryAlarmInfoListBean = new QueryAlarmInfoListBean();
+        //long r = System.currentTimeMillis();
+        long r = getSystemTimer(url);
+        queryAlarmInfoListBean.setR(r);
+        queryAlarmInfoListBean.setNonce(VerifyCodeUtils.generateVerifyCode(6));
+        queryAlarmInfoListBean.setToken(token);
+       // queryAlarmInfoListBean.setAlarmType(2);
+        queryAlarmInfoListBean.setEndTime(0);
+        queryAlarmInfoListBean.setEndTime(0);
+        queryAlarmInfoListBean.setPageSize(20);
+        queryAlarmInfoListBean.setPageNum(1);
+        queryAlarmInfoListBean.setProjectId(234);
+
+        String sign = RequestUtils.getParameterSignature(queryAlarmInfoListBean);
+        queryAlarmInfoListBean.setSign(sign);
+        String jsonString =  JsonUtil.toJson(queryAlarmInfoListBean);
+        String retStr = null;
+        try {
+            retStr =  HttpUtil.post(interfaceUrl,jsonString,"application/json","utf-8",10000,30000,null);
+            System.out.println(retStr);
+
+        }catch (Exception ex){
+            System.out.println(ex);
+        }
+        return retStr;
+    }
+
+
+}

+ 44 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/req/BaseBean.java

@@ -0,0 +1,44 @@
+package com.ruoyi.web.controller.monitoringAlarms.req;
+
+public class BaseBean {
+
+  private   Long r;
+
+  private   String nonce;
+
+  private   String sign;
+
+  private   String token;
+
+    public Long getR() {
+        return r;
+    }
+
+    public void setR(Long r) {
+        this.r = r;
+    }
+
+    public String getNonce() {
+        return nonce;
+    }
+
+    public void setNonce(String nonce) {
+        this.nonce = nonce;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+}

+ 97 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/req/QueryAlarmInfoListBean.java

@@ -0,0 +1,97 @@
+package com.ruoyi.web.controller.monitoringAlarms.req;
+
+import java.util.List;
+
+public class QueryAlarmInfoListBean extends BaseBean{
+
+    private int pageNum;
+    private int pageSize;
+    private long startTime;
+    private long endTime;
+    private int alarmState;
+    private int alarmType;
+    private long projectId;
+    private String keyword;
+    private List<String> devIds;
+    private List<String> aiDevList;
+
+    public int getPageNum() {
+        return pageNum;
+    }
+
+    public void setPageNum(int pageNum) {
+        this.pageNum = pageNum;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public long getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(long startTime) {
+        this.startTime = startTime;
+    }
+
+    public long getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(long endTime) {
+        this.endTime = endTime;
+    }
+
+    public int getAlarmState() {
+        return alarmState;
+    }
+
+    public void setAlarmState(int alarmState) {
+        this.alarmState = alarmState;
+    }
+
+    public int getAlarmType() {
+        return alarmType;
+    }
+
+    public void setAlarmType(int alarmType) {
+        this.alarmType = alarmType;
+    }
+
+    public long getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(long projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getKeyword() {
+        return keyword;
+    }
+
+    public void setKeyword(String keyword) {
+        this.keyword = keyword;
+    }
+
+    public List<String> getDevIds() {
+        return devIds;
+    }
+
+    public void setDevIds(List<String> devIds) {
+        this.devIds = devIds;
+    }
+
+    public List<String> getAiDevList() {
+        return aiDevList;
+    }
+
+    public void setAiDevList(List<String> aiDevList) {
+        this.aiDevList = aiDevList;
+    }
+}

+ 27 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/req/QueryTokenBean.java

@@ -0,0 +1,27 @@
+package com.ruoyi.web.controller.monitoringAlarms.req;
+
+/**
+ *  获取token bean
+ */
+public class QueryTokenBean {
+
+    String appId;
+
+    String appSecret;
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getAppSecret() {
+        return appSecret;
+    }
+
+    public void setAppSecret(String appSecret) {
+        this.appSecret = appSecret;
+    }
+}

+ 42 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/QueryTimerResp.java

@@ -0,0 +1,42 @@
+package com.ruoyi.web.controller.monitoringAlarms.resp;
+
+public class QueryTimerResp {
+
+    private int rcode;
+    private String rmsg;
+    private TimerData data;
+    private int total;
+
+
+    public int getRcode() {
+        return rcode;
+    }
+
+    public void setRcode(int rcode) {
+        this.rcode = rcode;
+    }
+
+    public String getRmsg() {
+        return rmsg;
+    }
+
+    public void setRmsg(String rmsg) {
+        this.rmsg = rmsg;
+    }
+
+    public TimerData getData() {
+        return data;
+    }
+
+    public void setData(TimerData data) {
+        this.data = data;
+    }
+
+    public int getTotal() {
+        return total;
+    }
+
+    public void setTotal(int total) {
+        this.total = total;
+    }
+}

+ 41 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/QueryTokenResp.java

@@ -0,0 +1,41 @@
+package com.ruoyi.web.controller.monitoringAlarms.resp;
+
+public class QueryTokenResp {
+
+    private int rcode;
+    private String rmsg;
+    private TokenData data;
+    private int total;
+
+    public void setRcode(int rcode) {
+        this.rcode = rcode;
+    }
+
+    public int getRcode() {
+        return rcode;
+    }
+
+    public void setRmsg(String rmsg) {
+        this.rmsg = rmsg;
+    }
+
+    public String getRmsg() {
+        return rmsg;
+    }
+
+    public void setData(TokenData data) {
+        this.data = data;
+    }
+
+    public TokenData getData() {
+        return data;
+    }
+
+    public void setTotal(int total) {
+        this.total = total;
+    }
+
+    public int getTotal() {
+        return total;
+    }
+}

+ 23 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/TimerData.java

@@ -0,0 +1,23 @@
+package com.ruoyi.web.controller.monitoringAlarms.resp;
+
+public class TimerData {
+
+    private long sysTime;
+    private String sysTimeStr;
+
+    public long getSysTime() {
+        return sysTime;
+    }
+
+    public void setSysTime(long sysTime) {
+        this.sysTime = sysTime;
+    }
+
+    public String getSysTimeStr() {
+        return sysTimeStr;
+    }
+
+    public void setSysTimeStr(String sysTimeStr) {
+        this.sysTimeStr = sysTimeStr;
+    }
+}

+ 24 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/resp/TokenData.java

@@ -0,0 +1,24 @@
+package com.ruoyi.web.controller.monitoringAlarms.resp;
+
+public class TokenData {
+
+    private String access_token;
+
+    private int expires_in;
+
+    public void setAccess_token(String access_token) {
+        this.access_token = access_token;
+    }
+
+    public String getAccess_token() {
+        return access_token;
+    }
+
+    public void setExpires_in(int expires_in) {
+        this.expires_in = expires_in;
+    }
+
+    public int getExpires_in() {
+        return expires_in;
+    }
+}

+ 133 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/Cipher.java

@@ -0,0 +1,133 @@
+package com.ruoyi.web.controller.monitoringAlarms.utils;
+
+import java.io.ByteArrayOutputStream;
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.util.Locale;
+
+
+/**
+ * 获取MD5码
+ * 
+ */
+public class Cipher {
+	public final static String MD5 = "MD5";
+	public final static String SHA256 = "SHA-256";
+
+	public static String strMD5(String s) {
+		return str(MD5, s);
+	}
+
+	public static String strSHA256(String s) {
+		return str(SHA256, s);
+	}
+
+	public static String str(String algorithm, String s) {
+		try {
+			return getString(algorithm, s.getBytes(StandardCharsets.UTF_8));
+		} catch (Exception e) {
+			return "";
+		}
+	}
+
+	/**
+	 * 获取指定文件内容对应的MD5码
+	 * @param file 文件
+	 * @return 文件内容对应的MD5码
+	 * @throws Exception 异常定义
+	 */
+	public static String getString(String algorithm, File file)
+			throws Exception {
+		return getString(algorithm, loadFromFile(file));
+	}
+
+	/**
+	 * 获取指定文本内容对应的MD5码
+	 * @param plain 文本内容
+	 * @return 文本内容对应的MD5码
+	 * @throws Exception 异常定义
+	 */
+	public static String getString(String algorithm, String plain) throws Exception {
+		return getString(algorithm, plain.getBytes(StandardCharsets.UTF_8));
+	}
+
+	/**
+     * 获取指定文本内容对应的MD5码
+     * @param plain 文本内容
+     * @return 文本内容对应的MD5码
+	 * @throws Exception 异常定义
+     */
+    public static String getString(String algorithm, byte[] plain) throws Exception {
+    	MessageDigest digest = MessageDigest.getInstance(algorithm);
+		digest.update(plain);
+		byte[] buffer = digest.digest();
+		return toHexByteArray(buffer, 0, buffer.length);
+	}
+
+	/**
+	 * 关闭对象
+	 * @param args 需要关闭的对象
+	 */
+	private static void close(Closeable... args) {
+    	if (null != args) {
+    		for (Closeable arg: args) {
+    			if (null != arg) {
+    				try { arg.close(); } catch (Throwable t) { }
+				}
+			}
+		}
+	}
+
+	/**
+	 * 从指定文件中读取文件内容
+	 * @param file 文件对象
+	 * @return 文件内容
+	 * @throws Exception 异常定义
+	 */
+	private static byte[] loadFromFile(File file) throws Exception {
+		FileInputStream fis = null;
+
+		try {
+			fis = new FileInputStream(file);
+
+			ByteArrayOutputStream output = new ByteArrayOutputStream();
+			int length = 0;
+			byte[] buffer = new byte[64 * 1024];
+
+			while (-1 != (length = fis.read(buffer))) {
+				if (length > 0) {
+					output.write(buffer, 0, length);
+				}
+			}
+
+			return output.toByteArray();
+		} finally {
+			close(fis);
+		}
+	}
+
+	/**
+	 * 将数组转换成十六进制字符串
+	 * @param b 数组
+	 * @param m 起始位置
+	 * @param n 个数
+	 * @return 转化后的十六进制字符串
+	 */
+	private static String toHexByteArray(byte[] b, int m, int n) {
+		String md5 = "";
+		int k = m + n;
+		
+		if (k > b.length) {
+			k = b.length;
+		}
+		
+		for (int i = m; i < k; i++) {
+			md5 += Integer.toHexString((b[i] & 0x000000FF) | 0xFFFFFF00).substring(6);
+		}
+
+		return md5.toLowerCase(Locale.getDefault());
+	}
+}

+ 372 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/HttpUtil.java

@@ -0,0 +1,372 @@
+package com.ruoyi.web.controller.monitoringAlarms.utils;
+
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.*;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.config.RequestConfig.Builder;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.config.Registry;
+import org.apache.http.config.RegistryBuilder;
+import org.apache.http.config.SocketConfig;
+import org.apache.http.conn.ConnectTimeoutException;
+import org.apache.http.conn.socket.ConnectionSocketFactory;
+import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
+import org.apache.http.conn.socket.PlainConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.conn.ssl.TrustStrategy;
+import org.apache.http.conn.ssl.X509HostnameVerifier;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
+import org.apache.http.message.BasicNameValuePair;
+
+import javax.net.ssl.*;
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.net.SocketTimeoutException;
+import java.net.UnknownHostException;
+import java.security.GeneralSecurityException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * 2020-4-3  by houxainyong 添加http 连接池,兼容 http 和Https
+ */
+public class HttpUtil {
+
+
+    public static final int connTimeout = 10000;
+    public static final int readTimeout = 10000;
+
+    public static final String charset = "UTF-8";
+    private static final int CONNECT_TIMEOUT = 5000;//设置超时毫秒数
+
+    private static final int SOCKET_TIMEOUT = 10000;//设置传输毫秒数
+
+    private static final int REQUESTCONNECT_TIMEOUT = 3000;//获取请求超时毫秒数
+
+    private static final int CONNECT_TOTAL = 400;//最大连接数
+
+    private static final int CONNECT_ROUTE = 120;//设置每个路由的基础连接数
+
+    private static final int VALIDATE_TIME = 30000;//设置重用连接时间
+
+    private static final String RESPONSE_CONTENT = "通信失败";
+
+    private static PoolingHttpClientConnectionManager manager = null;
+
+    private static CloseableHttpClient client = null;
+
+    static {
+        ConnectionSocketFactory csf = PlainConnectionSocketFactory.getSocketFactory();
+        LayeredConnectionSocketFactory lsf = createSSLConnSocketFactory();
+        Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
+                .register("http", csf).register("https", lsf).build();
+        manager = new PoolingHttpClientConnectionManager(registry);
+        manager.setMaxTotal(CONNECT_TOTAL);
+        manager.setDefaultMaxPerRoute(CONNECT_ROUTE);
+        manager.setValidateAfterInactivity(VALIDATE_TIME);
+        SocketConfig config = SocketConfig.custom().setSoTimeout(SOCKET_TIMEOUT).build();
+        manager.setDefaultSocketConfig(config);
+        RequestConfig requestConf = RequestConfig.custom().setConnectTimeout(CONNECT_TIMEOUT)
+                .setConnectionRequestTimeout(REQUESTCONNECT_TIMEOUT).setSocketTimeout(SOCKET_TIMEOUT).build();
+        client = HttpClients.custom().setConnectionManager(manager).setDefaultRequestConfig(requestConf).setRetryHandler(
+                //实现了HttpRequestRetryHandler接口的
+                (exception, executionCount, context) -> {
+                    if (executionCount >= 2)
+                        return false;
+                    if (exception instanceof NoHttpResponseException)//如果服务器断掉了连接那么重试
+                        return true;
+                    if (exception instanceof SSLHandshakeException)//不重试握手异常
+                        return false;
+                    if (exception instanceof InterruptedIOException)//IO传输中断重试
+                        return true;
+                    if (exception instanceof UnknownHostException)//未知服务器
+                        return false;
+                    if (exception instanceof ConnectTimeoutException)//超时就重试
+                        return true;
+                    if (exception instanceof SSLException)
+                        return false;
+
+                    HttpClientContext cliContext = HttpClientContext.adapt(context);
+                    HttpRequest request = cliContext.getRequest();
+                    if (!(request instanceof HttpEntityEnclosingRequest))
+                        return true;
+                    return false;
+                }).build();
+        if (manager != null && manager.getTotalStats() != null) {
+            System.out.println("连接池池状态:" + manager.getTotalStats().toString());
+            //LOG.info("连接池池状态:" + manager.getTotalStats().toString());
+        }
+    }
+
+     static SSLConnectionSocketFactory createSSLConnSocketFactory() {
+
+        SSLConnectionSocketFactory sslsf = null;
+         try {
+             SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() {
+                 public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException {
+                     return true;
+                 }
+             }).build();
+
+              sslsf = new SSLConnectionSocketFactory(sslContext, new X509HostnameVerifier() {
+                 @Override
+                 public boolean verify(String arg0, SSLSession arg1) {
+                     return true;
+                 }
+
+                 @Override
+                 public void verify(String host, SSLSocket ssl)
+                         throws IOException {
+                 }
+
+                 @Override
+                 public void verify(String host, X509Certificate cert)
+                         throws SSLException {
+                 }
+
+                 @Override
+                 public void verify(String host, String[] cns,
+                                    String[] subjectAlts) throws SSLException {
+                 }
+             });
+
+             return sslsf;
+
+         } catch (GeneralSecurityException e) {
+             System.out.println(e);
+             //LOG.error(e.getMessage());
+         }
+         return null;
+    }
+
+    public static String postParameters(String url, String parameterStr, Map<String, String> headers) throws Exception {
+        return post(url, parameterStr, "application/json", charset, connTimeout, readTimeout, headers);
+    }
+
+    public static String postParameters(String url, String parameterStr) throws ConnectTimeoutException, SocketTimeoutException, Exception {
+        return post(url, parameterStr, "application/json", charset, connTimeout, readTimeout, null);
+    }
+
+    public static String postParameters(String url, String parameterStr, String charset, Integer connTimeout, Integer readTimeout) throws ConnectTimeoutException, SocketTimeoutException, Exception {
+        return post(url, parameterStr, "application/json", charset, connTimeout, readTimeout, null);
+    }
+
+    public static String postParameters(String url, Map<String, String> params) throws ConnectTimeoutException,
+            SocketTimeoutException, Exception {
+        return postForm(url, params, null, connTimeout, readTimeout);
+    }
+
+    public static String postParameters(String url, Map<String, String> params, Integer connTimeout, Integer readTimeout) throws ConnectTimeoutException,
+            SocketTimeoutException, Exception {
+        return postForm(url, params, null, connTimeout, readTimeout);
+    }
+
+    public static String postFormParameters(String url, Map<String, String> headers, Map<String, String> params) throws ConnectTimeoutException,
+            SocketTimeoutException, Exception {
+        return postForm(url, params, headers, connTimeout, readTimeout);
+    }
+
+    public static String get(String url) throws Exception {
+        return get(url, charset, null, null);
+    }
+
+    public static String get(String url, String charset) throws Exception {
+        return get(url, charset, connTimeout, readTimeout);
+    }
+
+    /**
+     * 发送一个 Post 请求, 使用指定的字符集编码.
+     *
+     * @param url
+     * @param body        RequestBody
+     * @param mimeType    例如 application/xml "application/x-www-form-urlencoded" a=1&b=2&c=3
+     * @param charset     编码
+     * @param connTimeout 建立链接超时时间,毫秒.
+     * @param readTimeout 响应超时时间,毫秒.
+     * @return ResponseBody, 使用指定的字符集编码.
+     * @throws ConnectTimeoutException 建立链接超时异常
+     * @throws SocketTimeoutException  响应超时
+     * @throws Exception
+     */
+    public static String post(String url, String body, String mimeType, String charset, Integer connTimeout, Integer readTimeout, Map<String, String> headers)
+            throws ConnectTimeoutException, SocketTimeoutException, Exception {
+
+        HttpPost post = new HttpPost(url);
+        if (headers != null) {
+            for (Map.Entry<String, String> item : headers.entrySet()) {
+                post.setHeader(item.getKey(), item.getValue());
+            }
+        }
+        String result = "";
+        try {
+            if (StringUtils.isNotBlank(body)) {
+                HttpEntity entity = new StringEntity(body, ContentType.create(mimeType, charset));
+                post.setEntity(entity);
+            }
+            // 设置参数
+            Builder customReqConf = RequestConfig.custom();
+            if (connTimeout != null) {
+                customReqConf.setConnectTimeout(connTimeout);
+            }
+            if (readTimeout != null) {
+                customReqConf.setSocketTimeout(readTimeout);
+            }
+            post.setConfig(customReqConf.build());
+
+            HttpResponse res =  client.execute(post);
+
+            result = IOUtils.toString(res.getEntity().getContent(), charset);
+        } finally {
+            if(post!=null){
+                post.releaseConnection();
+            }
+        }
+        return result;
+    }
+
+
+    /**
+     * 提交form表单
+     *
+     * @param url
+     * @param params
+     * @param connTimeout
+     * @param readTimeout
+     * @return
+     * @throws ConnectTimeoutException
+     * @throws SocketTimeoutException
+     * @throws Exception
+     */
+    public static String postForm(String url, Map<String, String> params, Map<String, String> headers, Integer connTimeout, Integer readTimeout) throws ConnectTimeoutException,
+            SocketTimeoutException, Exception {
+
+        HttpPost post = new HttpPost(url);
+        try {
+            if (params != null && !params.isEmpty()) {
+                List<NameValuePair> formParams = new ArrayList<NameValuePair>();
+                Set<Map.Entry<String, String>> entrySet = params.entrySet();
+                for (Map.Entry<String, String> entry : entrySet) {
+                    formParams.add(new BasicNameValuePair(entry.getKey(), entry.getValue()));
+                }
+                UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formParams, Consts.UTF_8);
+                post.setEntity(entity);
+            }
+
+            if (headers != null && !headers.isEmpty()) {
+                for (Map.Entry<String, String> entry : headers.entrySet()) {
+                    post.addHeader(entry.getKey(), entry.getValue());
+                }
+            }
+            // 设置参数
+            Builder customReqConf = RequestConfig.custom();
+            if (connTimeout != null) {
+                customReqConf.setConnectTimeout(connTimeout);
+            }
+            if (readTimeout != null) {
+                customReqConf.setSocketTimeout(readTimeout);
+            }
+            post.setConfig(customReqConf.build());
+            HttpResponse res = client.execute(post);
+
+            return IOUtils.toString(res.getEntity().getContent(), "UTF-8");
+        } finally {
+            if(post!=null){
+                post.releaseConnection();
+            }
+        }
+    }
+    public  static  String encryptBASE64(String username,String password) {
+        byte[] key = (username+":"+password).getBytes();
+        return  new String(Base64.encodeBase64(key));
+    }
+
+
+    /**
+     * 发送一个 GET 请求
+     *
+     * @param url
+     * @param charset
+     * @param connTimeout 建立链接超时时间,毫秒.
+     * @param readTimeout 响应超时时间,毫秒.
+     * @return
+     * @throws ConnectTimeoutException 建立链接超时
+     * @throws SocketTimeoutException  响应超时
+     * @throws Exception
+     */
+    public static String get(String url, String charset, Integer connTimeout, Integer readTimeout)
+            throws ConnectTimeoutException, SocketTimeoutException, Exception {
+
+        String authorization = "Basic "+encryptBASE64("nginx","1q2w3e4r5t@");
+
+        HttpGet get = new HttpGet(url);
+        //get.addHeader("Authorization",authorization);
+        String result = "";
+        try {
+            // 设置参数
+            Builder customReqConf = RequestConfig.custom();
+            if (connTimeout != null) {
+                customReqConf.setConnectTimeout(connTimeout);
+            }
+            if (readTimeout != null) {
+                customReqConf.setSocketTimeout(readTimeout);
+            }
+            get.setConfig(customReqConf.build());
+
+            HttpResponse res = client.execute(get);
+
+
+            result = IOUtils.toString(res.getEntity().getContent(), charset);
+        } finally {
+            if(get!=null){
+                get.releaseConnection();
+            }
+        }
+        return result;
+    }
+
+
+
+
+    /**
+     * 从 response 里获取 charset
+     *
+     * @param ressponse
+     * @return
+     */
+    @SuppressWarnings("unused")
+    private static String getCharsetFromResponse(HttpResponse ressponse) {
+        // Content-Type:text/html; charset=GBK
+        if (ressponse.getEntity() != null && ressponse.getEntity().getContentType() != null && ressponse.getEntity().getContentType().getValue() != null) {
+            String contentType = ressponse.getEntity().getContentType().getValue();
+            if (contentType.contains("charset=")) {
+                return contentType.substring(contentType.indexOf("charset=") + 8);
+            }
+        }
+        return null;
+    }
+
+    public static void main(String[] args) {
+        try {
+            String str = HttpUtil.get("http://10.100.12.246:4040/8414eab8894541c5afdcb2d606c6f50b.jpg");
+            System.out.println(str);
+        }catch (Exception ex){
+
+        }
+
+    }
+}

+ 90 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/RequestUtils.java

@@ -0,0 +1,90 @@
+package com.ruoyi.web.controller.monitoringAlarms.utils;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.reflect.TypeToken;
+import com.ruoyi.common.utils.JsonUtil;
+import com.ruoyi.web.controller.monitoringAlarms.req.BaseBean;
+import org.apache.commons.codec.digest.DigestUtils;
+
+import java.lang.reflect.Type;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * 网络请求工具类,因为sping boot 依赖,所以放这里。
+ */
+public class RequestUtils {
+
+
+    public final static String KEY_R = "r";
+    //随机数
+    public final static String KEY_NONCE = "nonce";
+    //签名书
+    public final static String KEY_SIGNA = "sign";
+    // token
+    public final static String KEY_TOKEN = "token";
+    // 用户id
+    public final static String KEY_UID = "uid";
+
+    private static Type typeToken = new TypeToken<TreeMap<String, Object>>() {
+    }.getType();
+
+    /*static Gson gson = new GsonBuilder()
+            .registerTypeAdapter(
+                    new TypeToken<TreeMap<String, Object>>(){}.getType(),
+                    new JsonDeserializer<TreeMap<String, Object>>() {
+                        @Override
+                        public TreeMap<String, Object> deserialize(
+                                JsonElement json, Type typeOfT,
+                                JsonDeserializationContext context) throws JsonParseException {
+
+                            TreeMap<String, Object> treeMap = new TreeMap<>();
+                            JsonObject jsonObject = json.getAsJsonObject();
+                            Set<Map.Entry<String, JsonElement>> entrySet = jsonObject.entrySet();
+                            for (Map.Entry<String, JsonElement> entry : entrySet) {
+                                Object ot = entry.getValue();
+                                if(ot instanceof JsonPrimitive){
+                                    treeMap.put(entry.getKey(), ((JsonPrimitive) ot).getAsString());
+                                }else{
+                                    treeMap.put(entry.getKey(), ot);
+                                }
+                            }
+                            return treeMap;
+                        }
+                    }).create();*/
+
+
+    /**
+     * 对公共参数进行签名
+     *
+     * @param baseBean
+     * @return
+     */
+    public static String getParameterSignature(BaseBean baseBean) {
+
+        String serverSign = "";
+        try {
+
+            SortedMap<String, Object> map = JSON.parseObject(JsonUtil.toJson(baseBean), typeToken);
+            String paramsJsonStr = JsonUtil.toJson(map);
+            serverSign = getSignature(paramsJsonStr);
+
+        } catch (Exception ex) {
+            System.out.println(ex.getMessage());
+        }
+        return serverSign;
+    }
+
+    /**
+     * 获取签名信息
+     *
+     * @param parameters
+     * @return
+     */
+    private static String getSignature(String parameters) {
+
+        return DigestUtils.md5Hex(parameters.getBytes());
+    }
+
+
+}

+ 286 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/TextUtils.java

@@ -0,0 +1,286 @@
+/**************************************************************************
+*                                                                         
+* Copyright (c) 2015-2017  QIKU Company                                
+*                 奇酷互联网络科技(深圳)有限公司  版权所有 2015-2017          
+*                                                                         
+* PROPRIETARY RIGHTS of QIKU Company are involved in the             
+* subject matter of this material.  All manufacturing, reproduction, use, 
+* and sales rights pertaining to this subject matter are governed by the  
+* license agreement.  The recipient of this software implicitly accepts   
+* the terms of the license.                                               
+* 本软件文档资料是奇酷公司的资产,任何人士阅读和使用本资料必须获得                     
+* 相应的书面授权,承担保密责任和接受相应的法律约束.                                 
+*                                                                         
+**************************************************************************/
+package com.ruoyi.web.controller.monitoringAlarms.utils;
+
+
+
+import java.text.DecimalFormat;
+import java.util.Locale;
+import java.util.Random;
+
+/**
+ * 文本字符串基本操作
+ *
+ *
+ */
+public class TextUtils {
+	/**
+	 * 判断字符串是否为空
+	 * @param source 字符串
+	 * @return true 字符串为空;false 不为空
+	 */
+	public static boolean empty(String source) {
+		return ((null == source) || (source.length() <= 0));
+	}
+
+	public static boolean empty(byte[] a) {
+		return ((null == a) || (a.length <= 0));
+	}
+
+	public static <T> boolean empty(T[] bytes) {
+		return ((null == bytes) || (bytes.length <= 0));
+	}
+	
+	/**
+	 * 字符串不能为空,否则抛出异常
+	 * @param s 字符串
+	 * @param e 抛出的异常定义
+	 */
+	public static void alertEmpty(String s, Exception e)
+	        throws Exception{
+		if (empty(s)) {
+			throw e;
+		}
+	}
+	
+	/**
+	 * 字符串为数字,否则抛出异常
+	 * @param s 字符串
+	 * @param e 抛出的异常定义
+	 */
+	public static void alertNumeric(String s, Exception e)
+	        throws Exception{
+		if (!s.matches("[0-9]*")) {
+			throw e;
+		}
+	}
+	
+	/**
+	 * 比较两个字符串,如果二者都为null,属于相等,相等于s1.compareTo(s2)
+	 * @param s1 字符串1
+	 * @param s2 字符串2
+	 * @return 意义和String类型的compareTo返回值相同
+	 */
+	public static int compare(String s1, String s2) {
+		if ((null == s1) && (null == s2)) {
+			return 0;
+		} else if ((null != s1) && (null == s2)) {
+			return 1;
+		} else if ((null == s1) && (null != s2)) {
+			return -1;
+		} else {
+			return s1.compareTo(s2);
+		}
+	}
+	
+	/**
+	 * 比较两个字符串,以其对应的Double值的方式
+	 * @param s1 字符串1
+	 * @param s2 字符串2
+	 * @return 两个字符串对应值的差值
+	 */
+	public static double compareAsDouble(String s1, String s2) {
+		double d1 = 0;
+		double d2 = 0;
+		
+		try {
+			d1 = (empty(s1) ? 0 : Double.parseDouble(s1));
+		} catch (NumberFormatException e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			d2 = (empty(s2) ? 0 : Double.parseDouble(s2));
+		} catch (NumberFormatException e) {
+			e.printStackTrace();
+		}
+		
+		return (d1 - d2);
+	}
+	
+	/**
+	 * 是否包含字符串,忽略大小写
+	 * @param s 字符串
+	 * @param sub 字符串
+	 * @return true 包含;false 不包含
+	 */
+	public static boolean containsIgnoreCase(String s, String sub) {
+		try {
+			String l = s.toLowerCase(Locale.getDefault());
+			String subl = sub.toLowerCase(Locale.getDefault());
+			return l.contains(subl);	
+		} catch (Exception e) {
+			return false;
+		}
+	}
+	
+	/**
+	 * 判断字符串是否相等,忽略大小写
+	 * @param str1 字符串1
+	 * @param str2 字符串2
+	 * @return true 是;false 不是
+	 */
+	public static boolean equalsIgnoreCase(String str1, String str2) {
+	    if ((null == str1) && (null == str2)) {
+	    	return true;
+	    } else if ((null != str1) && (null == str2)) {
+	    	return false;
+	    } else if ((null == str1) && (null != str2)) {
+	    	return false;
+	    } else {
+	    	return str1.equalsIgnoreCase(str2);
+	    }
+	}
+	
+	/**
+	 * 将文本数组序列化为字符串
+	 * @param array 文本数组
+	 * @return 序列化后字符串
+	 */
+	public static String toText(String[] array) {
+		if ((null == array) || (array.length <= 0)) {
+			return "";
+		} else {
+			boolean first = true;
+			StringBuffer buffer = new StringBuffer();
+			
+			for (String element : array) {
+				if (first) {
+					first = false;
+				} else {
+					buffer.append(";");
+				}
+				
+				buffer.append(element);
+			}
+			
+			return buffer.toString();
+		}
+	}
+
+	public static String toText(long[] array) {
+		if ((null == array) || (array.length <= 0)) {
+			return "";
+		} else {
+			boolean first = true;
+			StringBuilder builder = new StringBuilder();
+
+			for (long element : array) {
+				if (first) {
+					first = false;
+				} else {
+					builder.append(";");
+				}
+
+				builder.append("" + element);
+			}
+
+			return builder.toString();
+		}
+	}
+
+	/**
+	 * 判断字符串s是否包含字符串sub
+	 * @param s 字符串s
+	 * @param sub 字符串sub
+	 * @return true 包含;false 不包含
+	 */
+	public static boolean contains(String s, String sub) {
+		if (!empty(s)) {
+			return s.contains(sub);
+		} else {
+			return false;
+		}
+	}
+	
+	/**
+	 * 判断两个字符串是否相等
+	 * @param s1 字符串1
+	 * @param s2 字符串2
+	 * @return true 相等;false 不相等
+	 */
+	public static boolean equals(String s1, String s2) {
+		return ((s1 == s2) || ((null != s1) && (null != s2) && s1.equals(s2)));
+	}
+	
+	/**
+	 * 将数组序列化,需要特别指出的是,这里数组元素类型支持序列化
+	 * @param objects 需要序列化的数组,其元素支持序列化
+	 * @return 序列化后的字符串
+	 */
+	public static String marshall(Object[] objects) {
+		StringBuilder buffer = new StringBuilder();
+		boolean first = true;
+		
+		for (Object object : objects) {
+			if (first) {
+				first = false;
+			} else {
+				buffer.append(";");
+			}
+			buffer.append(object);
+		}
+		
+		return buffer.toString();
+	}
+
+	public static String frontOf(String s, int len) {
+		if (null != s) {
+			if (s.length() > len) {
+				return s.substring(0, len);
+			}
+		}
+		return s;
+	}
+
+	public String notNull(String s) {
+		return notNull(s, "");
+	}
+
+	public String notNull(String s, String defaultValue) {
+		return ((null != s) ? s : defaultValue);
+	}
+
+	/**
+	 * 将一个数字处理为以万为单位的字符串,保留两位小数
+	 * @param num
+	 * @return
+	 */
+	public static String getTenThousandOfANumber(long num) {
+		if (num < 10000) {
+			return String.valueOf(num);
+		}
+		String numStr = new DecimalFormat("#.00").format(num / 10000d);
+		String[] ss = numStr.split("\\.");
+		if ("00".equals(ss[1])) {
+			return ss[0] + "万";
+		} else if ('0' == (ss[1].charAt(1))) {
+			return ss[0] + "." + ss[1].charAt(0) + "万";
+		} else {
+			return numStr + "万";
+		}
+	}
+
+	/**
+	 * 获取随机数
+	 * @param min 最小值
+	 * @param max 最大值
+	 * @return
+	 */
+	public static int getRandom(int min, int max){
+		Random random = new Random();
+		return random.nextInt(max-min+1) + min;
+	}
+}

+ 44 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/monitoringAlarms/utils/VerifyCodeUtils.java

@@ -0,0 +1,44 @@
+/**
+ * qiku.com Inc.
+ * copyright (c) 2015-2016 All Rights Reserved.
+ */
+
+package com.ruoyi.web.controller.monitoringAlarms.utils;
+
+import java.util.Random;
+
+
+public class VerifyCodeUtils {
+
+    //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
+    public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
+    private static Random random = new Random();
+
+
+    /**
+     * 使用系统默认字符源生成验证码
+     * @param verifySize	验证码长度
+     * @return
+     */
+    public static String generateVerifyCode(int verifySize){
+        return generateVerifyCode(verifySize, VERIFY_CODES);
+    }
+    /**
+     * 使用指定源生成验证码
+     * @param verifySize	验证码长度
+     * @param sources	验证码字符源
+     * @return
+     */
+    public static String generateVerifyCode(int verifySize, String sources){
+        if(sources == null || sources.length() == 0){
+            sources = VERIFY_CODES;
+        }
+        int codesLen = sources.length();
+        Random rand = new Random(System.currentTimeMillis());
+        StringBuilder verifyCode = new StringBuilder(verifySize);
+        for(int i = 0; i < verifySize; i++){
+            verifyCode.append(sources.charAt(rand.nextInt(codesLen-1)));
+        }
+        return verifyCode.toString();
+    }
+}

+ 13 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/appHold/AppWarehouseController.java

@@ -194,6 +194,17 @@ public class AppWarehouseController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 删除标签
+     */
+    @GetMapping(value = "/labelDelete")
+    public AjaxResult labelDelete(@RequestParam(value = "labelId", required = false) Long labelId) {
+        if (ObjectUtil.isNull(labelId)) {
+            return AjaxResult.error("请选择标签");
+        }
+        return AjaxResult.success(labelService.deleteById(labelId));
+    }
+
 
     /**
      * 出库标签判断
@@ -219,7 +230,7 @@ public class AppWarehouseController extends BaseController {
         List<Map<String, Long>> wareMap = itWarehouseBillsService.selectWareIdAndItemId(map);
         if (ObjectUtil.isNotNull(wareMap)) {
             String[] arrs = fContent.split(",");
-            for (Map<String, Long> map1:wareMap) {
+            for (Map<String, Long> map1 : wareMap) {
                 for (String arr : arrs) {
                     TWarehousebillsitemsElabel tWarehousebillsitemsElabel = new TWarehousebillsitemsElabel();
                     tWarehousebillsitemsElabel.setfPid(Long.valueOf(String.valueOf(map1.get("itemId"))));
@@ -228,7 +239,7 @@ public class AppWarehouseController extends BaseController {
                     tWarehousebillsitemsElabel.setfStatus(0);
                     tWarehousebillsitemsElabel.setfContent(arr);
                     List<TWarehousebillsitemsElabel> tWarehousebillsitemsElabelList = labelService.selectItemsElabelList(tWarehousebillsitemsElabel);
-                    if (ObjectUtil.isNull(tWarehousebillsitemsElabelList)) {
+                    if (tWarehousebillsitemsElabelList.size() == 0) {
                         return AjaxResult.error("标签号:" + fContent + "不在改单号里,请重新录入");
                     }
                 }

+ 10 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warehouse/quotation/TSeapriceController.java

@@ -1,7 +1,9 @@
 package com.ruoyi.web.controller.warehouse.quotation;
 
+import com.github.pagehelper.PageInfo;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.constant.HttpStatus;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -65,8 +67,14 @@ public class TSeapriceController extends BaseController
     public TableDataInfo queryItem(TSeaprice tSeaprice)
     {
         startPage();
-        List<Map<String, Object>> list = tSeapriceService.selectTSeapriceMapList(tSeaprice);
-        return getDataTable(list);
+        Map<String, List<Map<String, Object>>> map = tSeapriceService.selectTSeapriceMapList(tSeaprice);
+
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setMsg("查询成功");
+        rspData.setRows(map.get("list2"));
+        rspData.setTotal(new PageInfo(map.get("list1")).getTotal());
+        return rspData;
     }
 
     /**

+ 32 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/LiveBroadcast.java

@@ -0,0 +1,32 @@
+package com.ruoyi.common.constant;
+
+public class LiveBroadcast {
+
+    //AppKey
+    public static final String APP_KEY = "16400485963408782";
+
+    //SecretKey
+    public static final String SECRET_KEY = "mCRWptOImJrehsvfjwkw";
+
+    //获取全局token
+    public static final String TOKEN_JWT = "https://open.hikyun.com/artemis/api/eits/v1/global/jwt";
+
+    //获取access_token
+    public static final String GET_ACCESS_TOKEN = "https://open.hikyun.com/artemis/oauth/token";
+
+    //登录接口
+    public static final String LOGIN = "https://open.hikyun.com/artemis/api/eits/v1/login";
+
+    //获取挑战码
+    public static final String CHALLENGE_CODE = "https://open.hikyun.com/artemis/api/eits/v1/challengeCode";
+
+    //根据监控点编号查询直播间信息
+    public static final String CAMERA_CODE = "https://open.hikyun.com/artemis/api/eits/v1/global/camera/live/get/by/cameracode";
+
+    //开通直播间
+    public static final String CREATE = "https://open.hikyun.com/artemis/api/eits/v2/global/saas/live/create";
+
+    //删除直播间
+    public static final String DELETE = "https://open.hikyun.com/artemis/api/eits/v2/global/saas/live/delete";
+
+}

+ 1 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/quotation/service/ITSeapriceService.java

@@ -75,7 +75,7 @@ public interface ITSeapriceService
      * @param tSeaprice 条件
      * @return  结果
      */
-    public List<Map<String, Object>> selectTSeapriceMapList(TSeaprice tSeaprice);
+    public Map<String, List<Map<String, Object>>> selectTSeapriceMapList(TSeaprice tSeaprice);
 
     /**
      *  查询海运报价列表信息

+ 5 - 2
ruoyi-warehouse/src/main/java/com/ruoyi/quotation/service/impl/TSeapriceServiceImpl.java

@@ -50,7 +50,8 @@ public class TSeapriceServiceImpl implements ITSeapriceService
      * @return  结果
      */
     @Override
-    public List<Map<String, Object>> selectTSeapriceMapList(TSeaprice tSeaprice) {
+    public Map<String, List<Map<String, Object>>> selectTSeapriceMapList(TSeaprice tSeaprice) {
+        Map<String, List<Map<String, Object>>> map = new HashMap<>();
         List<Map<String, Object>> list =tSeapriceMapper.selectTSeapriceMapList(tSeaprice);
         List<Map<String, Object>> result = new ArrayList<>();
         //新增主表内带item逻辑
@@ -67,7 +68,9 @@ public class TSeapriceServiceImpl implements ITSeapriceService
             m.put("seapriceFees", tSeapriceitemMapper.selectTSeapriceitemList(tSeapriceitem));
             result.add(m);
         }
-        return result;
+        map.put("list1",list);
+        map.put("list2",result);
+        return map;
     }
 
     /**

+ 40 - 4
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -240,6 +240,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
     @Autowired
     private TCorpsMapper corpMapper;
 
+    @Autowired
+    private TWarehousebillsitemsElabelMapper elabelMapper;
+
     private static final Logger log = LoggerFactory.getLogger(AddressUtils.class);
 
     /**
@@ -9709,7 +9712,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
      * @return
      */
     @Override
-    public AjaxResult warehouseOperationConfirmationHold(Long fId, Long itemId, int fType, String storekeeper,String fContent) {
+    public AjaxResult warehouseOperationConfirmationHold(Long fId, Long itemId, int fType, String storekeeper, String fContent) {
 
         if (StringUtils.isNull(itemId) || StringUtils.isNull(fId)) {
             return AjaxResult.error("未找到仓库明细id,或未找到上级id,请确认");
@@ -9722,6 +9725,18 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         if (StringUtils.isNull(warehouseBills.getfCorpid())) {
             return AjaxResult.error("库存明细请检查客户信息,操作终止");
         }
+        if ("SJRK".equals(warehouseBills.getfBilltype())) {
+            if (warehouseBills.getfItemsStatus() == 4) {
+                return AjaxResult.error("该入库账单已入库,禁止重复操作");
+            }
+        } else if ("SJCK".equals(warehouseBills.getfBilltype())) {
+            if (warehouseBills.getfItemsStatus() == 4) {
+                return AjaxResult.error("该出库账单已入库,禁止重复操作");
+            }
+        } else {
+            return AjaxResult.error("该账单信息有误,请重新维护后再操作");
+        }
+
         warehouseBills.setUpdateTime(new Date());
         warehouseBills.setUpdateBy(storekeeper);
         Long timestamp = DateUtils.getTimestamp(new Date());
@@ -9764,6 +9779,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
             warehousebillsitems.setfOriginalbilldate(warehousebillsitems.getfBsdate());//入库时间
             warehousebillsitems.setfChargedate(warehousebillsitems.getfBsdate());
 
+            TWarehousebillsitemsElabel tWarehousebillsitemsElabel = new TWarehousebillsitemsElabel();
+            tWarehousebillsitemsElabel.setfPid(itemId);
+            tWarehousebillsitemsElabel.setfGPid(fId);
+            tWarehousebillsitemsElabel.setfType(1);
+            tWarehousebillsitemsElabel.setfStatus(2);
+            List<TWarehousebillsitemsElabel> tWarehousebillsitemsElabelList = elabelMapper.selectList(tWarehousebillsitemsElabel);
+            if (warehousebillsitems.getfQty() != tWarehousebillsitemsElabelList.size()){
+                return AjaxResult.error("入库件数:"+warehousebillsitems.getfQty()+"与标签码数量:"+tWarehousebillsitemsElabelList.size()+"不一致,不允许入库");
+            }
+
             // 查询库容量  是否可入库
             int m = calculation(warehouseBills.getfWarehouseid(), warehousebillsitems.getfGrossweight());
             if (m == 0) {
@@ -9815,6 +9840,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
                 }
             }
 
+            TWarehousebillsitemsElabel tWarehousebillsitemsElabel = new TWarehousebillsitemsElabel();
+            tWarehousebillsitemsElabel.setfPid(itemId);
+            tWarehousebillsitemsElabel.setfGPid(fId);
+            tWarehousebillsitemsElabel.setfType(2);
+            tWarehousebillsitemsElabel.setfStatus(2);
+            List<TWarehousebillsitemsElabel> tWarehousebillsitemsElabelList = elabelMapper.selectList(tWarehousebillsitemsElabel);
+            if (warehousebillsitems.getfQty() != tWarehousebillsitemsElabelList.size()){
+                return AjaxResult.error("出库件数:"+warehousebillsitems.getfQty()+"与标签码数量:"+tWarehousebillsitemsElabelList.size()+"不一致,不允许出库");
+            }
+
             // 跟新库存总账
             updateTWhgenlegData(warehousebillsitems, tWhgenle.getfId(), billsType);
             warehousebillsitems.setfBillstatus(40L);
@@ -9858,9 +9893,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         String[] arrs = fContent.split(",");
         for (String arr : arrs) {
             TWarehousebillsitemsElabel tWarehousebillsitemsElabel = new TWarehousebillsitemsElabel();
-            if (fType == 1){
+            if (fType == 1) {
                 tWarehousebillsitemsElabel.setfStatus(0);
-            }else{
+            } else {
                 tWarehousebillsitemsElabel.setfStatus(1);
             }
             tWarehousebillsitemsElabel.setfType(fType);
@@ -9872,11 +9907,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
 
     /**
      * app手持查看是否再库
+     *
      * @param map
      * @return
      */
     @Override
-    public  List<Map<String, Long>> selectWareIdAndItemId(Map<String, Object> map) {
+    public List<Map<String, Long>> selectWareIdAndItemId(Map<String, Object> map) {
         return tWarehouseBillsMapper.selectWareIdAndItemId(map);
     }
 

+ 2 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehousebillsitemsElabelServiceImpl.java

@@ -35,8 +35,10 @@ public class TWarehousebillsitemsElabelServiceImpl implements ITWarehousebillsit
         elabelList.forEach(elabel -> {
             if (ObjectUtil.isNull(elabel.getfId())) {
                 elabel.setCreateTime(new Date());
+                elabel.setfStatus(2);
                 elabelMapper.insert(elabel);
             } else {
+                elabel.setfStatus(2);
                 elabel.setUpdateTime(new Date());
                 elabelMapper.updateById(elabel);
             }

+ 13 - 3
ruoyi-warehouse/src/main/resources/mapper/quotation/TSeapriceMapper.xml

@@ -118,8 +118,8 @@
         WHEN s.f_billstatus = '1' THEN
         '停用'
         END AS fBillstatus,
-        pol.f_name polId,
-        pod.f_name podId,
+        pol.f_name polName,
+        pod.f_name podName,
         transit.f_name fTransitPortId,
         s.f_sailing_schedule fSailingSchedule,
         s.f_voyage fVoyage,
@@ -129,7 +129,9 @@
         s.f_lineid fLineid,
         s.f_bookagentid fBookagentid,
         j.f_name fLineName,
-        q.f_name fBookagentName
+        q.f_name fBookagentName,
+        s.pol_id polId,
+        s.pod_id podId
         FROM
         t_seaprice s
         LEFT JOIN sys_dict_data t ON t.dict_value = s.f_billtype AND t.dict_type = 'data_billType'
@@ -180,6 +182,10 @@
         WHERE t.f_billtype = #{fBilltype}
           AND t.f_corpid = #{fCorpid}
           AND t.f_validdate &gt;= #{fValiddate}
+          AND t.pol_id = #{polId}
+          AND t.pod_id = #{podId}
+          AND t.f_lineid = #{fLineid}
+          AND t.f_bookagentid = #{fBookagentid}
           AND t.f_billstatus = 0
           AND t.del_flag = '0'
           AND s.f_type = #{fType}
@@ -193,6 +199,10 @@
         WHERE t.f_billtype = #{fBilltype}
           AND t.f_corpid = #{fCorpid}
           AND t.f_validdate &gt;= #{fValiddate}
+          AND t.pol_id = #{polId}
+          AND t.pod_id = #{podId}
+          AND t.f_lineid = #{fLineid}
+          AND t.f_bookagentid = #{fBookagentid}
           AND t.f_billstatus = 0
           AND t.del_flag = '0'
           AND f.f_name != '海运费'