tplink摄像头区域优化2
This commit is contained in:
parent
231d42c481
commit
22e8d7e92b
|
@ -164,6 +164,7 @@
|
||||||
project_name as projectName,
|
project_name as projectName,
|
||||||
institutional_id as institutionalId,
|
institutional_id as institutionalId,
|
||||||
create_time as createTime,
|
create_time as createTime,
|
||||||
|
DATE_FORMAT(FROM_UNIXTIME(create_time),'%Y-%m-%d %H:%i:%s') as createTimeStr,
|
||||||
device_num as deviceNum,
|
device_num as deviceNum,
|
||||||
message_num as messageNum,
|
message_num as messageNum,
|
||||||
sort as sort,
|
sort as sort,
|
||||||
|
@ -177,6 +178,7 @@
|
||||||
offline_vms_dev_num as offlineVmsDevNum,
|
offline_vms_dev_num as offlineVmsDevNum,
|
||||||
offline_nbs_dev_num as offlineNbsDevNum,
|
offline_nbs_dev_num as offlineNbsDevNum,
|
||||||
running_time as runningTime,
|
running_time as runningTime,
|
||||||
|
running_time DIV 86400 AS runningTimeStr,
|
||||||
status,
|
status,
|
||||||
iz_leaf as izLeaf
|
iz_leaf as izLeaf
|
||||||
from nu_iot_tplink_project
|
from nu_iot_tplink_project
|
||||||
|
|
|
@ -39,6 +39,20 @@ public class ProjectTreeModel implements Serializable{
|
||||||
|
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
private String institutionalId;
|
||||||
|
|
||||||
|
private String createTimeStr;
|
||||||
|
|
||||||
|
private Integer deviceNum;
|
||||||
|
|
||||||
|
private Integer offlineNum;
|
||||||
|
|
||||||
|
private Integer abnormalNum;
|
||||||
|
|
||||||
|
private String runningTimeStr;
|
||||||
|
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
private String order;
|
private String order;
|
||||||
|
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
@ -58,6 +72,13 @@ public class ProjectTreeModel implements Serializable{
|
||||||
this.id = "0";
|
this.id = "0";
|
||||||
this.projectId = projectInfo.getProjectId();
|
this.projectId = projectInfo.getProjectId();
|
||||||
this.projectName = projectInfo.getProjectName();
|
this.projectName = projectInfo.getProjectName();
|
||||||
|
this.institutionalId = projectInfo.getInstitutionalId();
|
||||||
|
this.createTimeStr = projectInfo.getCreateTimeStr();
|
||||||
|
this.deviceNum = projectInfo.getDeviceNum();
|
||||||
|
this.offlineNum = projectInfo.getOfflineNum();
|
||||||
|
this.abnormalNum = projectInfo.getAbnormalNum();
|
||||||
|
this.runningTimeStr = projectInfo.getRunningTimeStr();
|
||||||
|
this.status = projectInfo.getStatus();
|
||||||
this.order = projectInfo.getOrder();
|
this.order = projectInfo.getOrder();
|
||||||
this.sort = projectInfo.getSort();
|
this.sort = projectInfo.getSort();
|
||||||
if(0 == projectInfo.getIzLeaf()){
|
if(0 == projectInfo.getIzLeaf()){
|
||||||
|
@ -146,6 +167,62 @@ public class ProjectTreeModel implements Serializable{
|
||||||
this.projectName = projectName;
|
this.projectName = projectName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInstitutionalId() {
|
||||||
|
return institutionalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInstitutionalId(String institutionalId) {
|
||||||
|
this.institutionalId = institutionalId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTimeStr() {
|
||||||
|
return createTimeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTimeStr(String createTimeStr) {
|
||||||
|
this.createTimeStr = createTimeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDeviceNum() {
|
||||||
|
return deviceNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceNum(Integer deviceNum) {
|
||||||
|
this.deviceNum = deviceNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOfflineNum() {
|
||||||
|
return offlineNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOfflineNum(Integer offlineNum) {
|
||||||
|
this.offlineNum = offlineNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAbnormalNum() {
|
||||||
|
return abnormalNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAbnormalNum(Integer abnormalNum) {
|
||||||
|
this.abnormalNum = abnormalNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRunningTimeStr() {
|
||||||
|
return runningTimeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRunningTimeStr(String runningTimeStr) {
|
||||||
|
this.runningTimeStr = runningTimeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
public String getOrder() {
|
public String getOrder() {
|
||||||
return order;
|
return order;
|
||||||
}
|
}
|
||||||
|
@ -177,6 +254,13 @@ public class ProjectTreeModel implements Serializable{
|
||||||
return Objects.equals(id, model.id) &&
|
return Objects.equals(id, model.id) &&
|
||||||
Objects.equals(projectId, model.projectId) &&
|
Objects.equals(projectId, model.projectId) &&
|
||||||
Objects.equals(projectName, model.projectName) &&
|
Objects.equals(projectName, model.projectName) &&
|
||||||
|
Objects.equals(institutionalId, model.institutionalId) &&
|
||||||
|
Objects.equals(createTimeStr, model.createTimeStr) &&
|
||||||
|
Objects.equals(deviceNum, model.deviceNum) &&
|
||||||
|
Objects.equals(offlineNum, model.offlineNum) &&
|
||||||
|
Objects.equals(abnormalNum, model.abnormalNum) &&
|
||||||
|
Objects.equals(runningTimeStr, model.runningTimeStr) &&
|
||||||
|
Objects.equals(status, model.status) &&
|
||||||
Objects.equals(order, model.order) &&
|
Objects.equals(order, model.order) &&
|
||||||
Objects.equals(sort, model.sort) &&
|
Objects.equals(sort, model.sort) &&
|
||||||
Objects.equals(children, model.children);
|
Objects.equals(children, model.children);
|
||||||
|
@ -187,7 +271,7 @@ public class ProjectTreeModel implements Serializable{
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(id, projectId, projectName, order, sort, children);
|
return Objects.hash(id, projectId, projectName, institutionalId, createTimeStr, deviceNum ,offlineNum ,abnormalNum ,runningTimeStr ,status ,order, sort, children);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,16 @@ public class RegionInfoController extends JeecgController<RegionInfo, IRegionInf
|
||||||
return service.sync(regionInfo);
|
return service.sync(regionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步子区域信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/syncChildren")
|
||||||
|
public Result syncChildren(RegionInfo regionInfo)throws Exception{
|
||||||
|
return service.syncChildren(regionInfo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步查询区域list
|
* 异步查询区域list
|
||||||
* @param parentId 父节点 异步加载时传递
|
* @param parentId 父节点 异步加载时传递
|
||||||
|
|
|
@ -17,6 +17,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface IRegionInfoService extends IService<RegionInfo> {
|
public interface IRegionInfoService extends IService<RegionInfo> {
|
||||||
Result sync(RegionInfo regionInfo);
|
Result sync(RegionInfo regionInfo);
|
||||||
|
Result syncChildren(RegionInfo regionInfo);
|
||||||
void sync(String jsonResponse);
|
void sync(String jsonResponse);
|
||||||
List<RegionInfo> findList(RegionInfo regionInfo);
|
List<RegionInfo> findList(RegionInfo regionInfo);
|
||||||
IPage<RegionInfo> findPage(Page<RegionInfo> page, RegionInfo regionInfo);
|
IPage<RegionInfo> findPage(Page<RegionInfo> page, RegionInfo regionInfo);
|
||||||
|
|
|
@ -111,8 +111,8 @@ public class RegionInfoServiceImpl extends ServiceImpl<RegionInfoMapper, RegionI
|
||||||
* 接口返回数据同步子区域入库
|
* 接口返回数据同步子区域入库
|
||||||
* @param regionInfo
|
* @param regionInfo
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void syncChildren(RegionInfo regionInfo){
|
public Result syncChildren(RegionInfo regionInfo){
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append("{");
|
sb.append("{");
|
||||||
sb.append("\"regionId\"").append(":").append("\"").append(regionInfo.getRegionId()).append("\"");
|
sb.append("\"regionId\"").append(":").append("\"").append(regionInfo.getRegionId()).append("\"");
|
||||||
|
@ -150,6 +150,9 @@ public class RegionInfoServiceImpl extends ServiceImpl<RegionInfoMapper, RegionI
|
||||||
syncChildren(entity);
|
syncChildren(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return Result.OK("同步子区域成功!");
|
||||||
|
}else{
|
||||||
|
return Result.error(jsonObject.getStr("msg"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,8 +91,9 @@ public class TumsApi {
|
||||||
*/
|
*/
|
||||||
public String getAllProjectInfo(String jsonRequest){
|
public String getAllProjectInfo(String jsonRequest){
|
||||||
this.createTumsClient();
|
this.createTumsClient();
|
||||||
|
log.info("getAllProjectInfo:request:{}",jsonRequest);
|
||||||
String jsonResponse = tumsClient.request(jsonRequest, ApiEnum.GET_ALL_PROJECT_INFO.getValue());
|
String jsonResponse = tumsClient.request(jsonRequest, ApiEnum.GET_ALL_PROJECT_INFO.getValue());
|
||||||
// log.info("getAllProjectInfo:{}",jsonResponse);
|
log.info("getAllProjectInfo:response:{}",jsonResponse);
|
||||||
return jsonResponse;
|
return jsonResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue