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