|
@@ -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 {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|