Commit 51ead1dc authored by chenying's avatar chenying

2018.8.31

(1)修改网关接口
parent 563d88ca
......@@ -196,33 +196,32 @@ public class GatewayController {
fb.setMessage(i18n.getMessage(request,"existGateway"));
return gson.toJson(fb);
}
if (StringUtils.isEmpty(updateGatewayVo.getModelName())){
updateGatewayVo.setUpdateTime(System.currentTimeMillis());
int a=gatewayService.updateGateway(updateGatewayVo);
if (a>0){
updateGatewayVo.setUpdateTime(System.currentTimeMillis());
int a=gatewayService.updateGateway(updateGatewayVo);
if (a>0){
if (StringUtils.isEmpty(updateGatewayVo.getModelName())){
fb.setCode(1);
fb.setMessage(i18n.getMessage(request,"updateGatewaySuccess"));
}else{
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"updateGatewayFailure"));
}
}else {
Map<Object,Object> map=new HashMap<>();
map.put("SN",updateGatewayVo.getSN());
map.put("type",updateGatewayVo.getType());
map.put("modelName",updateGatewayVo.getModelName());
gatewayService.deployGateway(map);
Map<Object,Object> msg=new HashMap<>();
msg.put("msg",map.get("msg"));
if (msg.get("msg").equals("通过模板修改设备成功")){
fb.setCode(1);
fb.setMessage(i18n.getMessage(request,"updateGatewayByModelSuccess"));
}else{
fb.setCode(0);
fb.setMessage(msg.get("msg").toString());
}else {
Map<Object,Object> map=new HashMap<>();
map.put("SN",updateGatewayVo.getSN());
map.put("type",updateGatewayVo.getType());
map.put("modelName",updateGatewayVo.getModelName());
gatewayService.deployGateway(map);
Map<Object,Object> msg=new HashMap<>();
msg.put("msg",map.get("msg"));
if (msg.get("msg").equals("通过模板修改设备成功")){
fb.setCode(1);
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);
}
......
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.password=37774020
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