Commit cf4edc86 authored by Carit Zhu's avatar Carit Zhu 🎱

Version 1.0.1-release:

1. Add tdlname for binding() interface in EquipmentBindingController.
2. Add gatewayName for addGateway() interface in WarehouseController.
3. Modify the Stored Procedure of pro_warehouseAddGateway and pro_addTDLGatewayLog to modify the name of gateway and tdl.
parent 7fed2fc7
Pipeline #480 passed with stage
in 0 seconds
...@@ -15,7 +15,7 @@ apply plugin: 'idea' ...@@ -15,7 +15,7 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot' apply plugin: 'org.springframework.boot'
group = 'com.example' group = 'com.example'
version = '0.0.1-SNAPSHOT' version = '1.0.1-release'
sourceCompatibility = 1.8 sourceCompatibility = 1.8
repositories { repositories {
......
...@@ -4,7 +4,9 @@ public class AddWarehouseGatewayVo { ...@@ -4,7 +4,9 @@ public class AddWarehouseGatewayVo {
private String warehouseNo; private String warehouseNo;
private String gSN; private String gSN;
private String gatewayName;
public String getWarehouseNo() { public String getWarehouseNo() {
return warehouseNo; return warehouseNo;
...@@ -21,4 +23,12 @@ public class AddWarehouseGatewayVo { ...@@ -21,4 +23,12 @@ public class AddWarehouseGatewayVo {
public void setgSN(String gSN) { public void setgSN(String gSN) {
this.gSN = gSN; this.gSN = gSN;
} }
public String getGatewayName() {
return gatewayName;
}
public void setGatewayName(String gatewayName) {
this.gatewayName = gatewayName;
}
} }
...@@ -8,7 +8,9 @@ public class BindingVo { ...@@ -8,7 +8,9 @@ public class BindingVo {
private Integer mode; private Integer mode;
private String TDLSN; private String TDLSN;
private String TDLName;
private String transportationNo; private String transportationNo;
...@@ -48,6 +50,14 @@ public class BindingVo { ...@@ -48,6 +50,14 @@ public class BindingVo {
this.TDLSN = TDLSN; this.TDLSN = TDLSN;
} }
public String getTDLName() {
return TDLName;
}
public void setTDLName(String TDLName) {
this.TDLName = TDLName;
}
public String getTransportationNo() { public String getTransportationNo() {
return transportationNo; return transportationNo;
} }
......
...@@ -6,7 +6,6 @@ public class UpdateTDLDeviceVo { ...@@ -6,7 +6,6 @@ public class UpdateTDLDeviceVo {
private String TDLSN; private String TDLSN;
public String getTDLName() { public String getTDLName() {
return TDLName; return TDLName;
} }
......
...@@ -105,15 +105,26 @@ public class AlarmRule { ...@@ -105,15 +105,26 @@ public class AlarmRule {
try { try {
String hashKey = "TDL-" + TDLSN + "_" + alias; String hashKey = "TDL-" + TDLSN + "_" + alias;
/* Get alarm rule from redis */ /* Get alarm rule from redis */
List<AlarmRuleVo> alarmRuleList;
Object hashValueObject = alarmRedisService.getHash(topic, hashKey); Object hashValueObject = alarmRedisService.getHash(topic, hashKey);
List<AlarmRuleVo> alarmRuleList = gson.fromJson(hashValueObject.toString(), if (hashValueObject != null) {
new TypeToken<ArrayList<AlarmRuleVo>>() {}.getType()); alarmRuleList = gson.fromJson(hashValueObject.toString(),
/* Update offset */ new TypeToken<ArrayList<AlarmRuleVo>>() {
if (alarmRuleList != null && alarmRuleList.size() > 0) { }.getType());
alarmRuleList.get(0).setOffset(offset); /* Update offset */
/* Write back to redis */ if (alarmRuleList != null && alarmRuleList.size() > 0) {
alarmRedisService.hmSet(topic, hashKey, gson.toJson(alarmRuleList)); alarmRuleList.get(0).setOffset(offset);
}
} else {
alarmRuleList = new ArrayList<>();
AlarmRuleVo alarmRuleVo = new AlarmRuleVo();
alarmRuleVo.setOffset(offset);
alarmRuleList.add(alarmRuleVo);
} }
/* Write back to redis */
alarmRedisService.hmSet(topic, hashKey, gson.toJson(alarmRuleList));
} catch (JsonSyntaxException e) { } catch (JsonSyntaxException e) {
logger.error("Update offset(" + alias + ") JsonSyntaxException: " + e.getMessage()); logger.error("Update offset(" + alias + ") JsonSyntaxException: " + e.getMessage());
} }
......
...@@ -85,7 +85,8 @@ public class EquipmentBindingController { ...@@ -85,7 +85,8 @@ public class EquipmentBindingController {
" SN:gateWay编号," + " SN:gateWay编号," +
" type:gateWay类型," + " type:gateWay类型," +
" mode:1--运输/2--仓库," + " mode:1--运输/2--仓库," +
" TDLSN:tdl编号," + " tdlsn:tdl编号," +
" tdlname: tdl名称" +
" transportationNo:运输编号," + " transportationNo:运输编号," +
" warehouseNo:仓库编号," + " warehouseNo:仓库编号," +
" alarmType:预警类型" ) " alarmType:预警类型" )
...@@ -223,6 +224,7 @@ public class EquipmentBindingController { ...@@ -223,6 +224,7 @@ public class EquipmentBindingController {
map.put("state",1); map.put("state",1);
map.put("untie",false); map.put("untie",false);
map.put("TDLSN",bindingVo.getTDLSN()); map.put("TDLSN",bindingVo.getTDLSN());
map.put("TDLName",bindingVo.getTDLName());
map.put("createTime",System.currentTimeMillis()); map.put("createTime",System.currentTimeMillis());
configService.addConfig(map); configService.addConfig(map);
Map<Object,Object> msg=new HashMap<>(); Map<Object,Object> msg=new HashMap<>();
......
...@@ -267,6 +267,7 @@ public class WarehouseController { ...@@ -267,6 +267,7 @@ public class WarehouseController {
" gatewayOnLineVos: [" + " gatewayOnLineVos: [" +
" {" + " {" +
" type: 网关类型," + " type: 网关类型," +
" name: 网关名称," +
" state: 在线状态(6离线,7在线)," + " state: 在线状态(6离线,7在线)," +
" battery: 电量," + " battery: 电量," +
" tdlDeviceDetailVos: [" + " tdlDeviceDetailVos: [" +
...@@ -276,6 +277,7 @@ public class WarehouseController { ...@@ -276,6 +277,7 @@ public class WarehouseController {
" humidity: 湿度," + " humidity: 湿度," +
" time: 时间," + " time: 时间," +
" tdlsn: TDL编号" + " tdlsn: TDL编号" +
" tdlname: TDL名称" +
" gatewaySN:网关编号" + " gatewaySN:网关编号" +
" offsetJson: 校准JSON(若为空则视为全零)" + " offsetJson: 校准JSON(若为空则视为全零)" +
" }" + " }" +
...@@ -856,7 +858,8 @@ public class WarehouseController { ...@@ -856,7 +858,8 @@ public class WarehouseController {
@ApiOperation(value="添加网关",notes = "添加网关,传值:" + @ApiOperation(value="添加网关",notes = "添加网关,传值:" +
"warehouseNo:仓库编号" + "warehouseNo:仓库编号" +
"SN:网关编号" + "SN:网关编号" +
"type:网关类型") "gatewayName:网关名称"
)
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"), @ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
}) })
...@@ -891,6 +894,7 @@ public class WarehouseController { ...@@ -891,6 +894,7 @@ public class WarehouseController {
map.put("warehouseNo",addWarehouseGatewayVo.getWarehouseNo()); map.put("warehouseNo",addWarehouseGatewayVo.getWarehouseNo());
map.put("gSN",addWarehouseGatewayVo.getgSN()); map.put("gSN",addWarehouseGatewayVo.getgSN());
map.put("gType",type); map.put("gType",type);
map.put("gName",addWarehouseGatewayVo.getGatewayName());
map.put("startTime",System.currentTimeMillis()); map.put("startTime",System.currentTimeMillis());
warehouseService.addGateway(map); warehouseService.addGateway(map);
Map<Object,Object> msg=new HashMap<>(); Map<Object,Object> msg=new HashMap<>();
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#{state,mode=IN,jdbcType=INTEGER}, #{state,mode=IN,jdbcType=INTEGER},
#{untie,mode=IN,jdbcType=INTEGER}, #{untie,mode=IN,jdbcType=INTEGER},
#{TDLSN,mode=IN,jdbcType=VARCHAR}, #{TDLSN,mode=IN,jdbcType=VARCHAR},
#{TDLName,mode=IN,jdbcType=VARCHAR},
#{createTime,mode=IN,jdbcType=BIGINT}, #{createTime,mode=IN,jdbcType=BIGINT},
#{msg,mode=OUT,jdbcType=VARCHAR} #{msg,mode=OUT,jdbcType=VARCHAR}
) )
......
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
#{warehouseNo,mode=IN,jdbcType=VARCHAR}, #{warehouseNo,mode=IN,jdbcType=VARCHAR},
#{gSN,mode=IN,jdbcType=VARCHAR}, #{gSN,mode=IN,jdbcType=VARCHAR},
#{gType,mode=IN,jdbcType=VARCHAR}, #{gType,mode=IN,jdbcType=VARCHAR},
#{gName,mode=IN,jdbcType=VARCHAR},
#{startTime,mode=IN,jdbcType=BIGINT}, #{startTime,mode=IN,jdbcType=BIGINT},
#{msg,mode=OUT,jdbcType=VARCHAR} #{msg,mode=OUT,jdbcType=VARCHAR}
) )
......
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