Commit 51ead1dc authored by chenying's avatar chenying

2018.8.31

(1)修改网关接口
parent 563d88ca
...@@ -196,33 +196,32 @@ public class GatewayController { ...@@ -196,33 +196,32 @@ public class GatewayController {
fb.setMessage(i18n.getMessage(request,"existGateway")); fb.setMessage(i18n.getMessage(request,"existGateway"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if (StringUtils.isEmpty(updateGatewayVo.getModelName())){ updateGatewayVo.setUpdateTime(System.currentTimeMillis());
updateGatewayVo.setUpdateTime(System.currentTimeMillis()); int a=gatewayService.updateGateway(updateGatewayVo);
int a=gatewayService.updateGateway(updateGatewayVo); if (a>0){
if (a>0){ if (StringUtils.isEmpty(updateGatewayVo.getModelName())){
fb.setCode(1); fb.setCode(1);
fb.setMessage(i18n.getMessage(request,"updateGatewaySuccess")); fb.setMessage(i18n.getMessage(request,"updateGatewaySuccess"));
}else{ }else {
fb.setCode(0); Map<Object,Object> map=new HashMap<>();
fb.setMessage(i18n.getMessage(request,"updateGatewayFailure")); map.put("SN",updateGatewayVo.getSN());
} map.put("type",updateGatewayVo.getType());
}else { map.put("modelName",updateGatewayVo.getModelName());
Map<Object,Object> map=new HashMap<>(); gatewayService.deployGateway(map);
map.put("SN",updateGatewayVo.getSN()); Map<Object,Object> msg=new HashMap<>();
map.put("type",updateGatewayVo.getType()); msg.put("msg",map.get("msg"));
map.put("modelName",updateGatewayVo.getModelName()); if (msg.get("msg").equals("通过模板修改设备成功")){
gatewayService.deployGateway(map); fb.setCode(1);
Map<Object,Object> msg=new HashMap<>(); fb.setMessage(i18n.getMessage(request,"updateGatewayByModelSuccess"));
msg.put("msg",map.get("msg")); }else{
if (msg.get("msg").equals("通过模板修改设备成功")){ fb.setCode(0);
fb.setCode(1); fb.setMessage(msg.get("msg").toString());
fb.setMessage(i18n.getMessage(request,"updateGatewayByModelSuccess")); }
}else{
fb.setCode(0);
fb.setMessage(msg.get("msg").toString());
} }
}else{
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"updateGatewayFailure"));
} }
return gson.toJson(fb); return gson.toJson(fb);
} }
......
spring.datasource.url=jdbc:mysql://192.168.1.16:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.url=jdbc:mysql://47.97.184.225:3306/tdlcloud?useUnicode=true&characterEncoding=utf-8&useSSL=false
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=37774020 spring.datasource.password=37774020
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment