Browse Source

维修车辆管理

yang 3 years ago
parent
commit
2ebafc364b

+ 21 - 18
huimv-farm-video/src/main/java/com/huimv/video/dhicc/controller/ClientController/ClientCarManageController.java

@@ -53,7 +53,7 @@ public class ClientCarManageController {
    //添加基础车辆
     @RequestMapping("/addCarBase")
     public GeneralResponse addCarBase (HttpServletRequest request ,@RequestParam(name = "farmId") Integer farmId,
-                                      @RequestParam(name = "carCode") String carCode,//车辆编号
+                                     // @RequestParam(name = "carCode") String carCode,//车辆编号
                                       @RequestParam(name = "carNum")  String carNum //车牌号
     ) throws ClientException {
         if(farmId!=1){
@@ -65,7 +65,7 @@ public class ClientCarManageController {
         GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
         System.out.println("开始执行");
         Map<String, Object> value = new HashMap<>();
-        value.put("carCode",carCode);
+        value.put("carCode", (int)((Math.random()*9+1)*10000));
         value.put("carNum",carNum);
         value.put("carNumColor",0);
         value.put("carType",1);
@@ -148,17 +148,20 @@ public class ClientCarManageController {
         if(farmId!=1){
             return null ;
         }
+
         String URL = "/evo-apigw/ipms/carBlackList/update";  //获取事件URL    post请求
         IClient iClient = new DefaultClient();
         GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
-        System.out.println("开始执行");
+        System.out.println("开始执行"+carId);
+        List<Object> a  = new ArrayList<>();
         Map<String, Object> value = new HashMap<>();
         value.put("carId",carId);
-        value.put("validStartDay","2021-12-21");
-        value.put("validEndDay","2036-12-21");
+        value.put("validStartDay","2021-12-22");
+        value.put("validEndDay","2036-12-22");
         value.put("deviceCodes","1002931,1002928");
-        generalRequest.body(JSON.toJSONString(value));
-        System.out.println(JSON.toJSONString(value));
+        a.add(value);
+        generalRequest.body(JSON.toJSONString(a));
+        System.out.println(JSON.toJSONString(a));
         //这种已经在配置文件里面安排了账号ip以及密码
         generalRequest.header("Content-Type", " application/json");
         //发起请求处理应答
@@ -166,7 +169,9 @@ public class ClientCarManageController {
         return generalResponse ;
     }
 
-
+    public static void main(String[] args) {
+        System.out.println((int)((Math.random()*9+1)*10000));
+    }
 
 
     //添加车辆进白名单列表
@@ -177,20 +182,21 @@ public class ClientCarManageController {
         if(farmId!=1){
             return null ;
         }
-
         String URL = "/evo-apigw/ipms/carWhiteList/update";  //获取事件URL    post请求
         IClient iClient = new DefaultClient();
         GeneralRequest generalRequest = new GeneralRequest(URL, Method.POST);
-        System.out.println("开始执行");
+        System.out.println("开始执行"+carId);
+         List<Object> a  = new ArrayList<>();
         Map<String, Object> value = new HashMap<>();
         value.put("carId",carId);
-        value.put("validStartDay","2021-12-21");
-        value.put("validEndDay","2036-12-21");
+        value.put("validStartDay","2021-12-22");
+        value.put("validEndDay","2036-12-22");
         value.put("deviceCodes","1002931,1002928");
-        generalRequest.body(JSON.toJSONString(value));
-        System.out.println(JSON.toJSONString(value));
+        a.add(value);
+        generalRequest.body(JSON.toJSONString(a));
+        System.out.println(JSON.toJSONString(a));
         //这种已经在配置文件里面安排了账号ip以及密码
-        generalRequest.header("Content-Type", " application/json");
+        generalRequest.header("Content-Type", "application/json;charset=UTF-8");
         //发起请求处理应答
         GeneralResponse generalResponse = iClient.doAction(generalRequest, generalRequest.getResponseClass());
         return generalResponse ;
@@ -319,7 +325,4 @@ public class ClientCarManageController {
         }
 
 
-
-
-
 }

+ 2 - 2
huimv-farm-video/src/main/java/com/huimv/video/dhicc/timmer/SysTelcomEnentTimmer.java

@@ -27,8 +27,8 @@ public class SysTelcomEnentTimmer {
     private ISysTelecomEventService sysTelecomEventService;
 
        //每小时执行一次
-      // @Scheduled(cron = " 0 */59 * * * ? ")
-       //@Scheduled(cron = " 0/5 * * * * ? ")
+       //@Scheduled(cron = " 0 */59 * * * ? ")
+       // @Scheduled(cron = " 0/5 * * * * ? ")
        //@Scheduled(cron = " 0/50 * * * * ? ")
        private void updateBox() {
            //获得设备列表 查找烘干数据

+ 2 - 2
huimv-farm-video/src/main/resources/application-prod.yml

@@ -5,9 +5,9 @@ spring:
     name: pigfarm-local-device
   #------DataSource-----
   datasource:
-    url: jdbc:mysql://47.96.4.54:10052/huimv-farm-center?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://192.168.1.75:3309/huimv-farm-center?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai
     username: root
-    password: hm123456789
+    password: root
     driver-class-name: com.mysql.cj.jdbc.Driver
   jpa:
     hibernate: