升降机的接口
This commit is contained in:
parent
41ccea4a87
commit
8fa50a4b08
@ -226,12 +226,4 @@ public class SystemUserController {
|
|||||||
return systemUserService.deleteZjwjUser(systemUser);
|
return systemUserService.deleteZjwjUser(systemUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "调外部接口,获取FMS监控⼤屏接⼊url", notes = "调外部接口,获取FMS监控⼤屏接⼊url", httpMethod = "GET")
|
|
||||||
@ApiImplicitParam(name = "account", value = "账号", paramType = "query", required = true, dataType = "String")
|
|
||||||
@GetMapping(value = "/getFmsMonitoringLargeScreenAccessUrl")
|
|
||||||
public Result<Map<String, Object>> getFmsMonitoringLargeScreenAccessUrl(@RequestParam Map<String, Object> map) {
|
|
||||||
HashMap<String, Object> rsMap = systemUserService.getFmsMonitoringLargeScreenAccessUrl(map);
|
|
||||||
return Result.success(rsMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,9 +118,6 @@ public class SystemUser implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String sjUnifiedAuthenticationOrgIds;
|
private String sjUnifiedAuthenticationOrgIds;
|
||||||
|
|
||||||
@ApiModelProperty(value = "fms监控大屏key")
|
|
||||||
private String fmsMonitoringScreenKey;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "角色ID")
|
@ApiModelProperty(value = "角色ID")
|
||||||
private java.lang.Long roleId;
|
private java.lang.Long roleId;
|
||||||
|
|||||||
@ -64,6 +64,4 @@ public interface ISystemUserService extends IService<SystemUser> {
|
|||||||
|
|
||||||
Result<List<SystemUser>> getZjwjUserList(SystemUser systemUser);
|
Result<List<SystemUser>> getZjwjUserList(SystemUser systemUser);
|
||||||
|
|
||||||
HashMap<String, Object> getFmsMonitoringLargeScreenAccessUrl(Map<String, Object> map);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,16 +93,6 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
private ProjectExternalSystemServiceMapper projectExternalSystemServiceMapper;
|
private ProjectExternalSystemServiceMapper projectExternalSystemServiceMapper;
|
||||||
@Value("${mqtt-scope}")
|
@Value("${mqtt-scope}")
|
||||||
private String scope;
|
private String scope;
|
||||||
/**
|
|
||||||
* 接⼝地址host
|
|
||||||
*/
|
|
||||||
@Value("${fmsMonitoringScreenRequestHost:}")
|
|
||||||
private String fmsMonitoringScreenRequestHost;
|
|
||||||
/**
|
|
||||||
* 施⼯监控⼤屏⻚⾯地址
|
|
||||||
*/
|
|
||||||
@Value("${fmsMonitoringScreenPageUrl:}")
|
|
||||||
private String fmsMonitoringScreenPageUrl;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getToken(Map<String, Object> map) {
|
public Map<String, Object> getToken(Map<String, Object> map) {
|
||||||
@ -949,61 +939,4 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
|||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HashMap<String, Object> getFmsMonitoringLargeScreenAccessUrl(Map<String, Object> map) {
|
|
||||||
//生成签名
|
|
||||||
/*
|
|
||||||
1.拼接签名字符串,由date与请求行拼接而成,以换行间隔,示例date: Thu, 22 Jun 2017 17:15:21 GMT\nGET /requests HTTP/1.1
|
|
||||||
2.对拼接的签名字符串,进行HMAC-SHA256签名,签名需要用到的key由FMS提供
|
|
||||||
3.对HMAC-SHA256的结果进行base64编码,得到signature值
|
|
||||||
签名注意事项:
|
|
||||||
请求参数需要分别进行url编码(UTF-8)
|
|
||||||
*/
|
|
||||||
String account = MapUtils.getString(map, "account");
|
|
||||||
if (StringUtils.isBlank(account)) {
|
|
||||||
throw new OpenAlertException("account不能为空");
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(fmsMonitoringScreenRequestHost)) {
|
|
||||||
throw new OpenAlertException("fmsMonitoringScreenHost未配置");
|
|
||||||
}
|
|
||||||
SystemUser systemUser = systemUserMapper.selectOne(new LambdaQueryWrapper<SystemUser>().eq(SystemUser::getAccount, account));
|
|
||||||
if (systemUser == null) {
|
|
||||||
throw new OpenAlertException("查询不到此用户");
|
|
||||||
}
|
|
||||||
|
|
||||||
String key = systemUser.getFmsMonitoringScreenKey();
|
|
||||||
|
|
||||||
Date now = new Date();
|
|
||||||
String gmtTime = com.zhgd.xmgl.util.DateUtil.getGMTTime(now);
|
|
||||||
String algorithm = "hmac-sha256";
|
|
||||||
String request_url = "/api-gateway/v2/system/getAccessToken";
|
|
||||||
String request_line = "GET " + request_url + " HTTP/1.1";
|
|
||||||
String content = "date: " + gmtTime + "\n" + request_line;
|
|
||||||
HMac mac = new HMac(HmacAlgorithm.HmacSHA256, key.getBytes());
|
|
||||||
String signature = com.zhgd.xmgl.util.Base64.encodeBase64(mac.digest(content));
|
|
||||||
|
|
||||||
//获取access_token
|
|
||||||
//hmac username="{用户名}", algorithm="hmac-sha256", headers="date request-line", signature="{签名}"
|
|
||||||
String authorization = "hmac username=\"" + account + "\", algorithm=\"" + algorithm + "\", headers=\"date request-line\", signature=\"" + signature + "\"";
|
|
||||||
String accessUrl = fmsMonitoringScreenRequestHost + "/api-gateway/v2/system/getAccessToken";
|
|
||||||
log.info("accessUrl:{},authorization:{},date:{}", accessUrl, authorization, gmtTime);
|
|
||||||
String rs = HttpRequest.get(accessUrl)
|
|
||||||
.header("authorization", authorization)
|
|
||||||
.header("date", gmtTime)
|
|
||||||
.execute().body();
|
|
||||||
log.info("rs(获取access_token):{}", rs);
|
|
||||||
JSONObject tokenJsonObject = com.alibaba.fastjson.JSON.parseObject(rs);
|
|
||||||
if (!tokenJsonObject.getBoolean("success")) {
|
|
||||||
throw new OpenAlertException(MessageUtil.get("thirdErr"));
|
|
||||||
}
|
|
||||||
JSONObject dataJSONObject = tokenJsonObject.getJSONObject("data");
|
|
||||||
String token = dataJSONObject.getString("token");
|
|
||||||
|
|
||||||
//返回url
|
|
||||||
String url = fmsMonitoringScreenPageUrl + token;
|
|
||||||
HashMap<String, Object> rsMap = new HashMap<>();
|
|
||||||
rsMap.put("url", url);
|
|
||||||
return rsMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.AlarmsDistinguishedNumberByAlarmType;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterAlarmService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterAlarmService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
||||||
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
||||||
@ -211,4 +212,16 @@ public class LifterAlarmController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询报警数量(按报警类型区分)", notes = "查询报警数量(按报警类型区分)", httpMethod = "POST")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "devSn", value = "设备sn", paramType = "query", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "queryStartTime", value = "查询开始时间,格式:2023-05-22 18:00:00", paramType = "query", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "queryEndTime", value = "查询结束时间,格式:2023-05-22 18:00:00", paramType = "query", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@PostMapping(value = "/queryAlarmsDistinguishedNumberByAlarmType")
|
||||||
|
public Result<AlarmsDistinguishedNumberByAlarmType> queryAlarmsDistinguishedNumberByAlarmType(@RequestBody Map<String, Object> map) {
|
||||||
|
return Result.success(lifterAlarmService.queryAlarmsDistinguishedNumberByAlarmType(map));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
import com.zhgd.xmgl.modules.basicdata.service.UploadFileService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.LifterViolationService;
|
import com.zhgd.xmgl.modules.bigdevice.service.LifterViolationService;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
@ -169,5 +170,12 @@ public class LifterViolationController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询升降机违章次数统计", notes = "查询升降机违章次数统计", httpMethod = "GET")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@GetMapping(value = "/queryStatisticsViolationNum")
|
||||||
|
public Result<StatisticsElevatorNumVo> queryStatisticsViolationNum(@RequestParam Map<String, Object> map) {
|
||||||
|
return Result.success(lifterViolationService.queryStatisticsViolationNum(map));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.zhgd.annotation.OperLog;
|
|||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterWorkCycleService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterWorkCycleService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@ -12,10 +13,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -78,5 +76,14 @@ public class LifterWorkCycleController {
|
|||||||
return Result.ok();
|
return Result.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询升降机运行次数统计", notes = "查询升降机运行次数统计", httpMethod = "GET")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||||
|
})
|
||||||
|
@GetMapping(value = "/queryStatisticsElevatorOperationsNum")
|
||||||
|
public Result<StatisticsElevatorNumVo> queryStatisticsElevatorOperationsNum(@RequestParam Map<String, Object> map) {
|
||||||
|
return Result.success(lifterWorkCycleService.queryStatisticsElevatorOperationsNum(map));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.zhgd.jeecg.common.api.vo.Result;
|
|||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.Tower;
|
import com.zhgd.xmgl.modules.bigdevice.entity.Tower;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerAndDataInfoVO;
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerAndDataInfoVO;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerCurrentCountVo;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerNumAndAlarmCount;
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerNumAndAlarmCount;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ITowerService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ITowerService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -159,7 +160,7 @@ public class TowerController {
|
|||||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/selectTowerCurrentCount")
|
@PostMapping(value = "/selectTowerCurrentCount")
|
||||||
public Result<List<Map<String, Object>>> selectTowerCurrentCount(@RequestBody Map<String, Object> map) {
|
public Result<List<TowerCurrentCountVo>> selectTowerCurrentCount(@RequestBody Map<String, Object> map) {
|
||||||
return Result.success(towerService.selectTowerCurrentCount(map));
|
return Result.success(towerService.selectTowerCurrentCount(map));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,6 @@ public class BigDeviceDriverRecord implements Serializable {
|
|||||||
* 劳务人员Id
|
* 劳务人员Id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "劳务人员Id", width = 15)
|
@Excel(name = "劳务人员Id", width = 15)
|
||||||
|
|
||||||
@ApiModelProperty(value = "劳务人员Id")
|
@ApiModelProperty(value = "劳务人员Id")
|
||||||
private java.lang.Long workerId;
|
private java.lang.Long workerId;
|
||||||
/**
|
/**
|
||||||
@ -85,4 +84,12 @@ public class BigDeviceDriverRecord implements Serializable {
|
|||||||
@Excel(name = "项目sn", width = 15)
|
@Excel(name = "项目sn", width = 15)
|
||||||
@ApiModelProperty(value = "项目sn")
|
@ApiModelProperty(value = "项目sn")
|
||||||
private java.lang.String projectSn;
|
private java.lang.String projectSn;
|
||||||
|
@ApiModelProperty(value = "性别,1男,2女")
|
||||||
|
private java.lang.Integer sex;
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
private java.lang.Integer age;
|
||||||
|
@ApiModelProperty(value = "工作年限")
|
||||||
|
private java.lang.Integer workYear;
|
||||||
|
@ApiModelProperty(value = "本次连续工作时长(分钟)")
|
||||||
|
private java.lang.Integer continuousWorkingTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ public class AlarmsDistinguishedNumberByAlarmType {
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class TypeNum {
|
public static class TypeNum {
|
||||||
@ApiModelProperty(value = "报警类型:momentAlarm>力矩报警 0: 正常 1:报警 2:预警\n" +
|
@ApiModelProperty(value = "1.塔吊>>>:报警类型:momentAlarm>力矩报警 0: 正常 1:报警 2:预警\n" +
|
||||||
"windSpeedAlarm>风速报警 0: 正常 1:报警 2:预警\n" +
|
"windSpeedAlarm>风速报警 0: 正常 1:报警 2:预警\n" +
|
||||||
"heightAlarm>高度上限位报警 0: 正常 1:报警 2:预警\n" +
|
"heightAlarm>高度上限位报警 0: 正常 1:报警 2:预警\n" +
|
||||||
"heightLowerAlarm>高度下限位报警 0: 正常 1:报警 2:预警\n" +
|
"heightLowerAlarm>高度下限位报警 0: 正常 1:报警 2:预警\n" +
|
||||||
@ -24,7 +24,21 @@ public class AlarmsDistinguishedNumberByAlarmType {
|
|||||||
"obliguityAlarm>倾角报警 0: 正常 1:报警 2:预警\n" +
|
"obliguityAlarm>倾角报警 0: 正常 1:报警 2:预警\n" +
|
||||||
"environmentAlarm>环境防撞报警 0: 正常 1:报警 2:预警\n" +
|
"environmentAlarm>环境防撞报警 0: 正常 1:报警 2:预警\n" +
|
||||||
"multiAlarm>多机防撞报警 0: 正常 1:报警 2:预警\n" +
|
"multiAlarm>多机防撞报警 0: 正常 1:报警 2:预警\n" +
|
||||||
"standardHighAlarm>塔机间竖向高度报警 0: 正常 1:报警 2:预警")
|
"standardHighAlarm>塔机间竖向高度报警 0: 正常 1:报警 2:预警\n" +
|
||||||
|
"" +
|
||||||
|
"2.升降机>>>:people_cnt_alarm>人数报警 0:正常 1:报警\n" +
|
||||||
|
"weightAlarm>载重报警 0:正常 1:报警\n" +
|
||||||
|
"speedAlarm>速度报警 0:正常 1:报警\n" +
|
||||||
|
"heightAlarm>高度报警 0:正常 1:报警\n" +
|
||||||
|
"obliguityXAlarm>倾角X报警 0:正常 1:报警\n" +
|
||||||
|
"obliguityYAlarm>倾角Y报警 0:正常 1:报警\n" +
|
||||||
|
"windSpeedAlarm>风速报警 0:正常 1:报警\n" +
|
||||||
|
"motor1Alarm>1号电机报警 0:正常 1:报警\n" +
|
||||||
|
"motor2Alarm>2号电机报警 0:正常 1:报警\n" +
|
||||||
|
"motor3Alarm>3号电机报警 0:正常 1:报警\n" +
|
||||||
|
"topAlarm>防冲顶报警 0:正常 1:报警\n" +
|
||||||
|
"fallAlarm>防坠器报警 0:正常 1:报警\n" +
|
||||||
|
"bottomAlarm>下限位报警 0:正常 1:报警")
|
||||||
private String type;
|
private String type;
|
||||||
@ApiModelProperty(value = "报警数量")
|
@ApiModelProperty(value = "报警数量")
|
||||||
private Integer num;
|
private Integer num;
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.zhgd.xmgl.modules.bigdevice.entity.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class StatisticsElevatorNumVo {
|
||||||
|
@ApiModelProperty(value = "今日运行次数")
|
||||||
|
private Integer todayRunNum;
|
||||||
|
@ApiModelProperty(value = "昨日运行次数(同一时段)")
|
||||||
|
private Integer yesterdayRunNum;
|
||||||
|
@ApiModelProperty(value = "过去30日运行次数")
|
||||||
|
private Integer last30DayRunNum;
|
||||||
|
@ApiModelProperty(value = "运行次数(相比昨日同一时段)")
|
||||||
|
private Integer todayRunNumCompareYesterday;
|
||||||
|
@ApiModelProperty(value = "运行次数(相比过去30日)")
|
||||||
|
private Integer todayRunNumCompareLast30Day;
|
||||||
|
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.TowerAlarm;
|
||||||
import org.apache.ibatis.annotations.MapKey;
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -40,4 +41,6 @@ public interface LifterAlarmMapper extends BaseMapper<LifterAlarm> {
|
|||||||
List<Map<String, Object>> selectLifterDevAlarmGroupCount(Map<String, Object> map);
|
List<Map<String, Object>> selectLifterDevAlarmGroupCount(Map<String, Object> map);
|
||||||
|
|
||||||
IPage<EntityMap> selectPageInfo(Page<EntityMap> page, @Param("map") Map<String, Object> map);
|
IPage<EntityMap> selectPageInfo(Page<EntityMap> page, @Param("map") Map<String, Object> map);
|
||||||
|
|
||||||
|
List<LifterAlarm> queryAlarmsByTime(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,8 @@ import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 邱平毅
|
* @author 邱平毅
|
||||||
* @ClassName LifterViolationMapper
|
* @ClassName LifterViolationMapper
|
||||||
@ -19,4 +21,6 @@ public interface LifterViolationMapper extends BaseMapper<LifterViolation> {
|
|||||||
IPage<LifterViolation> getListByPageInfo(@Param("pushPersonId") Long pushPersonId, @Param("devSn") String devSn, @Param("projectSn") String projectSn, @Param("violationDate") String violationDate, @Param("devName") String devName, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("status") Integer status, Page<?> page);
|
IPage<LifterViolation> getListByPageInfo(@Param("pushPersonId") Long pushPersonId, @Param("devSn") String devSn, @Param("projectSn") String projectSn, @Param("violationDate") String violationDate, @Param("devName") String devName, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("status") Integer status, Page<?> page);
|
||||||
|
|
||||||
LifterViolation getInfoById(@Param("id") Long id);
|
LifterViolation getInfoById(@Param("id") Long id);
|
||||||
|
|
||||||
|
Integer selectLifterViolationCount(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
@ -326,4 +326,12 @@
|
|||||||
</if>
|
</if>
|
||||||
order by l.update_date desc,l.add_time DESC
|
order by l.update_date desc,l.add_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryAlarmsByTime" resultType="com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm">
|
||||||
|
select la.*
|
||||||
|
from lifter_alarm la
|
||||||
|
where la.add_time >= #{queryStartTime}
|
||||||
|
and la.add_time <![CDATA[<=]]>
|
||||||
|
#{queryEndTime}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -156,7 +156,8 @@
|
|||||||
|
|
||||||
<resultMap id="lifterAndDriverInfo" type="com.zhgd.xmgl.modules.bigdevice.entity.Lifter" autoMapping="true">
|
<resultMap id="lifterAndDriverInfo" type="com.zhgd.xmgl.modules.bigdevice.entity.Lifter" autoMapping="true">
|
||||||
<id property="id" column="id"/>
|
<id property="id" column="id"/>
|
||||||
<collection property="driverList" ofType="com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceDriverRecord">
|
<collection property="driverList" ofType="com.zhgd.xmgl.modules.bigdevice.entity.BigDeviceDriverRecord"
|
||||||
|
autoMapping="true">
|
||||||
<id property="id" column="bId"/>
|
<id property="id" column="bId"/>
|
||||||
<result property="driverName" column="worker_name"/>
|
<result property="driverName" column="worker_name"/>
|
||||||
<result property="driverPhone" column="phone_number"/>
|
<result property="driverPhone" column="phone_number"/>
|
||||||
@ -179,10 +180,20 @@
|
|||||||
wi.worker_name,
|
wi.worker_name,
|
||||||
wi.phone_number,
|
wi.phone_number,
|
||||||
wi.special_certificate_number,
|
wi.special_certificate_number,
|
||||||
wi.field_acquisition_url
|
wi.field_acquisition_url,
|
||||||
|
wi.sex,
|
||||||
|
TIMESTAMPDIFF(YEAR, wi.birthday, CURDATE()) as age,
|
||||||
|
TIMESTAMPDIFF(YEAR, wi.enter_date, CURDATE()) as workYear,
|
||||||
|
t1.continuous_working_time,
|
||||||
|
wi.id_card
|
||||||
from lifter l
|
from lifter l
|
||||||
left join big_device_driver_record bddr on l.dev_sn = bddr.dev_sn and bddr.type = 2
|
left join big_device_driver_record bddr on l.dev_sn = bddr.dev_sn and bddr.type = 2
|
||||||
left join worker_info wi on wi.id = bddr.worker_id
|
left join worker_info wi on wi.id = bddr.worker_id
|
||||||
|
left join (select a.driver_id_card,
|
||||||
|
IFNULL(SUM(TIMESTAMPDIFF(MINUTE, a.start_time, a.end_time)), 0) continuous_working_time
|
||||||
|
from lifter_work_cycle a
|
||||||
|
where a.id in (select max(id) from lifter_work_cycle twc group by twc.driver_id_card)
|
||||||
|
) t1 on wi.id_card = t1.driver_id_card
|
||||||
where l.dev_sn = #{devSn}
|
where l.dev_sn = #{devSn}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -59,4 +59,17 @@
|
|||||||
left join system_user su on lv.rectification_person_id = su.user_id
|
left join system_user su on lv.rectification_person_id = su.user_id
|
||||||
where lv.id = #{id}
|
where lv.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectLifterViolationCount" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from lifter_violation lv
|
||||||
|
left join lifter l on lv.dev_sn = l.dev_sn
|
||||||
|
where l.project_sn=#{projectSn}
|
||||||
|
<if test="queryStartTime != null and queryStartTime != ''">
|
||||||
|
and l.add_time >= #{queryStartTime}
|
||||||
|
</if>
|
||||||
|
<if test="queryEndTime != null and queryEndTime != ''">
|
||||||
|
and l.add_time <![CDATA[<=]]> #{queryEndTime}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -26,6 +26,5 @@
|
|||||||
<if test="endTime!=null and endTime!=''">
|
<if test="endTime!=null and endTime!=''">
|
||||||
AND a.end_time <=CONCAT(DATE_FORMAT(#{endTime},'%Y-%m-%d'),' 23:59:59')
|
AND a.end_time <=CONCAT(DATE_FORMAT(#{endTime},'%Y-%m-%d'),' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -6,6 +6,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
|||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterCurrentData;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterCurrentData;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.AlarmsDistinguishedNumberByAlarmType;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -35,4 +36,6 @@ public interface ILifterAlarmService extends IService<LifterAlarm> {
|
|||||||
List<EntityMap> selectProjectNewestLifterAlarmList(Map<String, Object> map);
|
List<EntityMap> selectProjectNewestLifterAlarmList(Map<String, Object> map);
|
||||||
|
|
||||||
IPage<EntityMap> selectPageInfo(Map<String, Object> map);
|
IPage<EntityMap> selectPageInfo(Map<String, Object> map);
|
||||||
|
|
||||||
|
AlarmsDistinguishedNumberByAlarmType queryAlarmsDistinguishedNumberByAlarmType(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -21,4 +22,6 @@ public interface ILifterWorkCycleService extends IService<LifterWorkCycle> {
|
|||||||
List<EntityMap> selectLifterWorkCycleList(Map<String, Object> map);
|
List<EntityMap> selectLifterWorkCycleList(Map<String, Object> map);
|
||||||
|
|
||||||
void addLifterWorkCycle(LifterWorkCycle lifterWorkCycle);
|
void addLifterWorkCycle(LifterWorkCycle lifterWorkCycle);
|
||||||
|
|
||||||
|
StatisticsElevatorNumVo queryStatisticsElevatorOperationsNum(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.zhgd.jeecg.common.mybatis.EntityMap;
|
|||||||
import com.zhgd.xmgl.modules.bigdevice.entity.Tower;
|
import com.zhgd.xmgl.modules.bigdevice.entity.Tower;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.TowerAlarm;
|
import com.zhgd.xmgl.modules.bigdevice.entity.TowerAlarm;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerAndDataInfoVO;
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerAndDataInfoVO;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerCurrentCountVo;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerNumAndAlarmCount;
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerNumAndAlarmCount;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -41,7 +42,7 @@ public interface ITowerService extends IService<Tower> {
|
|||||||
|
|
||||||
TowerNumAndAlarmCount selectTowerNumAndAlarmCount(Map<String, Object> map);
|
TowerNumAndAlarmCount selectTowerNumAndAlarmCount(Map<String, Object> map);
|
||||||
|
|
||||||
List<Map<String, Object>> selectTowerCurrentCount(Map<String, Object> map);
|
List<TowerCurrentCountVo> selectTowerCurrentCount(Map<String, Object> map);
|
||||||
|
|
||||||
List<Map<String, Object>> selectTowerAlarmRankingList(Map<String, Object> map);
|
List<Map<String, Object>> selectTowerAlarmRankingList(Map<String, Object> map);
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,9 @@ package com.zhgd.xmgl.modules.bigdevice.service;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 邱平毅
|
* @author 邱平毅
|
||||||
@ -14,4 +17,6 @@ public interface LifterViolationService extends IService<LifterViolation> {
|
|||||||
IPage<LifterViolation> getListByPageInfo(Long pushPersonId, String devSn, String projectSn, String violationDate, String devName, String startDate, String endDate, Integer status, Integer pageNo, Integer pageSize);
|
IPage<LifterViolation> getListByPageInfo(Long pushPersonId, String devSn, String projectSn, String violationDate, String devName, String startDate, String endDate, Integer status, Integer pageNo, Integer pageSize);
|
||||||
|
|
||||||
LifterViolation getInfoById(Long id);
|
LifterViolation getInfoById(Long id);
|
||||||
|
|
||||||
|
StatisticsElevatorNumVo queryStatisticsViolationNum(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,12 +10,14 @@ import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
|||||||
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterAlarm;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterCurrentData;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterCurrentData;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.AlarmsDistinguishedNumberByAlarmType;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterAlarmMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterAlarmMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterAlarmService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterAlarmService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterService;
|
||||||
import com.zhgd.xmgl.util.DateUtil;
|
import com.zhgd.xmgl.util.DateUtil;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
|
import com.zhgd.xmgl.util.ReflectionUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -198,4 +200,99 @@ public class LifterAlarmServiceImpl extends ServiceImpl<LifterAlarmMapper, Lifte
|
|||||||
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
|
||||||
return lifterAlarmMapper.selectPageInfo(new Page<>(pageNo, pageSize), map);
|
return lifterAlarmMapper.selectPageInfo(new Page<>(pageNo, pageSize), map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AlarmsDistinguishedNumberByAlarmType queryAlarmsDistinguishedNumberByAlarmType(Map<String, Object> map) {
|
||||||
|
String queryEndTime = map.getOrDefault("queryEndTime", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")).toString();
|
||||||
|
String queryStartTime = map.getOrDefault("queryStartTime", DateUtil.offsetDay(new Date(), -7)).toString();
|
||||||
|
map.putIfAbsent("queryEndTime", queryEndTime);
|
||||||
|
map.putIfAbsent("queryStartTime", queryStartTime);
|
||||||
|
List<LifterAlarm> lifterAlarms = lifterAlarmMapper.queryAlarmsByTime(map);
|
||||||
|
Map<String, Integer> countTowerAlarmByTypeMap = countLifterAlarmByType(lifterAlarms);
|
||||||
|
List<AlarmsDistinguishedNumberByAlarmType.TypeNum> typeNums = new ArrayList<>();
|
||||||
|
for (Map.Entry<String, Integer> entry : countTowerAlarmByTypeMap.entrySet()) {
|
||||||
|
AlarmsDistinguishedNumberByAlarmType.TypeNum typeNum = new AlarmsDistinguishedNumberByAlarmType.TypeNum();
|
||||||
|
typeNum.setType(entry.getKey());
|
||||||
|
typeNum.setNum(entry.getValue());
|
||||||
|
}
|
||||||
|
Integer count = countTowerAlarmByTypeMap.size();
|
||||||
|
AlarmsDistinguishedNumberByAlarmType rt = new AlarmsDistinguishedNumberByAlarmType();
|
||||||
|
rt.setAlarmNum(count);
|
||||||
|
rt.setTypeNumList(typeNums);
|
||||||
|
return rt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按报警类型统计数量
|
||||||
|
*
|
||||||
|
* @param lifterAlarms
|
||||||
|
*/
|
||||||
|
private Map<String, Integer> countLifterAlarmByType(List<LifterAlarm> lifterAlarms) {
|
||||||
|
Map<String, Integer> typeNumMap = new HashMap<>();
|
||||||
|
for (LifterAlarm lifterAlarm : lifterAlarms) {
|
||||||
|
if (Objects.equals(lifterAlarm.getPeopleCntAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getPeopleCntAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getWeightAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWeightAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getSpeedAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getSpeedAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getHeightAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getHeightAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getObliguityXAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityXAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getObliguityYAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getObliguityYAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getWindSpeedAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getWindSpeedAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getMotor1Alarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor1Alarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getMotor2Alarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor2Alarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getMotor3Alarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getMotor3Alarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getTopAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getTopAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getFallAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getFallAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
if (Objects.equals(lifterAlarm.getBottomAlarm(), 1)) {
|
||||||
|
String fieldName = ReflectionUtil.getFieldName(LifterAlarm::getBottomAlarm);
|
||||||
|
addLifterAlarmCountByType(typeNumMap, fieldName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return typeNumMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addLifterAlarmCountByType(Map<String, Integer> typeNumMap, String fieldName) {
|
||||||
|
Integer integer = typeNumMap.get(fieldName);
|
||||||
|
if (integer != null) {
|
||||||
|
integer += 1;
|
||||||
|
} else {
|
||||||
|
integer = 1;
|
||||||
|
}
|
||||||
|
typeNumMap.put(fieldName, integer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,17 +132,6 @@ public class LifterCurrentDataServiceImpl extends ServiceImpl<LifterCurrentDataM
|
|||||||
data.put("field_acquisition_url", "");
|
data.put("field_acquisition_url", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if(data!=null){
|
|
||||||
QueryWrapper<LifterAlarm> queryWrapper=new QueryWrapper<>();
|
|
||||||
queryWrapper.lambda().eq(LifterAlarm::getProjectSn, MapUtils.getString(data,"projectSn"))
|
|
||||||
.eq(LifterAlarm::getLifterCurrentdataId,MapUtils.getString(data,"id"));
|
|
||||||
int count=lifterAlarmMapper.selectCount(queryWrapper);
|
|
||||||
if(count>0){
|
|
||||||
data.put("is_alarm",1);
|
|
||||||
}else{
|
|
||||||
data.put("is_alarm",0);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -324,6 +324,11 @@ public class LifterServiceImpl extends ServiceImpl<LifterMapper, Lifter> impleme
|
|||||||
log.info("getRelatedInfo升降机实时数据信息:{}", newData);
|
log.info("getRelatedInfo升降机实时数据信息:{}", newData);
|
||||||
List<DriverVO> driverList = lifter.getDriverList().stream().map(driver -> {
|
List<DriverVO> driverList = lifter.getDriverList().stream().map(driver -> {
|
||||||
DriverVO driverVO = new DriverVO();
|
DriverVO driverVO = new DriverVO();
|
||||||
|
driverVO.setSex(driver.getSex());
|
||||||
|
driverVO.setAge(driver.getAge());
|
||||||
|
driverVO.setWorkYear(driver.getWorkYear());
|
||||||
|
driverVO.setContinuousWorkingTime(driver.getContinuousWorkingTime());
|
||||||
|
driverVO.setIdCard(driver.getDriverIdCard());
|
||||||
driverVO.setWorkerName(driver.getDriverName());
|
driverVO.setWorkerName(driver.getDriverName());
|
||||||
driverVO.setPhoneNumber(driver.getDriverPhone());
|
driverVO.setPhoneNumber(driver.getDriverPhone());
|
||||||
driverVO.setSpecialCertificateNumber(driver.getCertificateNumber());
|
driverVO.setSpecialCertificateNumber(driver.getCertificateNumber());
|
||||||
|
|||||||
@ -2,16 +2,21 @@ package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterViolation;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterViolationMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterViolationMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.LifterViolationService;
|
import com.zhgd.xmgl.modules.bigdevice.service.LifterViolationService;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 邱平毅
|
* @author 邱平毅
|
||||||
@ -41,4 +46,25 @@ public class LifterViolationServiceImpl extends ServiceImpl<LifterViolationMappe
|
|||||||
public LifterViolation getInfoById(Long id) {
|
public LifterViolation getInfoById(Long id) {
|
||||||
return lifterViolationMapper.getInfoById(id);
|
return lifterViolationMapper.getInfoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StatisticsElevatorNumVo queryStatisticsViolationNum(Map<String, Object> map) {
|
||||||
|
Date date = new Date();
|
||||||
|
map.put("queryStartTime", DateUtil.today());
|
||||||
|
map.put("queryEndTime", null);
|
||||||
|
Integer todayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||||
|
map.put("queryStartTime", DateUtil.formatDate(DateUtil.offsetDay(date, -1)));
|
||||||
|
map.put("queryEndTime", DateUtil.formatDateTime(DateUtil.offsetDay(date, -1)));
|
||||||
|
Integer yesterdayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||||
|
map.put("queryStartTime", DateUtil.formatDateTime(DateUtil.offsetDay(date, -30)));
|
||||||
|
map.put("queryEndTime", null);
|
||||||
|
Integer last30DayRunNum = lifterViolationMapper.selectLifterViolationCount(map);
|
||||||
|
StatisticsElevatorNumVo vo = new StatisticsElevatorNumVo();
|
||||||
|
vo.setTodayRunNum(todayRunNum);
|
||||||
|
vo.setYesterdayRunNum(yesterdayRunNum);
|
||||||
|
vo.setLast30DayRunNum(last30DayRunNum);
|
||||||
|
vo.setTodayRunNumCompareYesterday(todayRunNum - yesterdayRunNum);
|
||||||
|
vo.setTodayRunNumCompareLast30Day(todayRunNum - last30DayRunNum);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,16 +2,21 @@ package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
import com.zhgd.xmgl.modules.bigdevice.entity.Lifter;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
import com.zhgd.xmgl.modules.bigdevice.entity.LifterWorkCycle;
|
||||||
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.StatisticsElevatorNumVo;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterWorkCycleMapper;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.LifterWorkCycleMapper;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ILifterWorkCycleService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ILifterWorkCycleService;
|
||||||
|
import com.zhgd.xmgl.util.DateUtil;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
|
import org.apache.commons.collections.MapUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -61,4 +66,34 @@ public class LifterWorkCycleServiceImpl extends ServiceImpl<LifterWorkCycleMappe
|
|||||||
lifterWorkCycle.setProjectSn(lifter.getProjectSn());
|
lifterWorkCycle.setProjectSn(lifter.getProjectSn());
|
||||||
lifterWorkCycleMapper.insert(lifterWorkCycle);
|
lifterWorkCycleMapper.insert(lifterWorkCycle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StatisticsElevatorNumVo queryStatisticsElevatorOperationsNum(Map<String, Object> map) {
|
||||||
|
Date date = new Date();
|
||||||
|
Integer todayRunNum = lifterWorkCycleMapper.selectCount(Wrappers.lambdaQuery(LifterWorkCycle.class)
|
||||||
|
.eq(LifterWorkCycle::getProjectSn, MapUtils.getString(map, "projectSn"))
|
||||||
|
.ge(LifterWorkCycle::getAddTime, DateUtil.today())
|
||||||
|
);
|
||||||
|
Integer yesterdayRunNum = lifterWorkCycleMapper.selectCount(Wrappers.lambdaQuery(LifterWorkCycle.class)
|
||||||
|
.eq(LifterWorkCycle::getProjectSn, MapUtils.getString(map, "projectSn"))
|
||||||
|
.ge(LifterWorkCycle::getAddTime, DateUtil.formatDate(DateUtil.offsetDay(date, -1)))
|
||||||
|
.le(LifterWorkCycle::getAddTime, DateUtil.offsetDay(date, -1))
|
||||||
|
);
|
||||||
|
Integer last30DayRunNum = lifterWorkCycleMapper.selectCount(Wrappers.lambdaQuery(LifterWorkCycle.class)
|
||||||
|
.eq(LifterWorkCycle::getProjectSn, MapUtils.getString(map, "projectSn"))
|
||||||
|
.ge(LifterWorkCycle::getAddTime, DateUtil.offsetDay(date, -30))
|
||||||
|
);
|
||||||
|
|
||||||
|
StatisticsElevatorNumVo vo = new StatisticsElevatorNumVo();
|
||||||
|
vo.setTodayRunNum(todayRunNum);
|
||||||
|
vo.setYesterdayRunNum(yesterdayRunNum);
|
||||||
|
vo.setLast30DayRunNum(last30DayRunNum);
|
||||||
|
vo.setTodayRunNumCompareYesterday(todayRunNum - yesterdayRunNum);
|
||||||
|
vo.setTodayRunNumCompareLast30Day(todayRunNum - last30DayRunNum);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(DateUtil.offsetDay(new Date(), -1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,10 +16,7 @@ import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
|||||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.*;
|
import com.zhgd.xmgl.modules.bigdevice.entity.*;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.dto.TowerDataInfoDTO;
|
import com.zhgd.xmgl.modules.bigdevice.entity.dto.TowerDataInfoDTO;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.DevWorkerVO;
|
import com.zhgd.xmgl.modules.bigdevice.entity.vo.*;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.DriverVO;
|
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerAndDataInfoVO;
|
|
||||||
import com.zhgd.xmgl.modules.bigdevice.entity.vo.TowerNumAndAlarmCount;
|
|
||||||
import com.zhgd.xmgl.modules.bigdevice.mapper.*;
|
import com.zhgd.xmgl.modules.bigdevice.mapper.*;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ITowerService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ITowerService;
|
||||||
import com.zhgd.xmgl.modules.bigdevice.service.ITowerVisualizeService;
|
import com.zhgd.xmgl.modules.bigdevice.service.ITowerVisualizeService;
|
||||||
@ -312,8 +309,10 @@ public class TowerServiceImpl extends ServiceImpl<TowerMapper, Tower> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> selectTowerCurrentCount(Map<String, Object> map) {
|
public List<TowerCurrentCountVo> selectTowerCurrentCount(Map<String, Object> map) {
|
||||||
return towerMapper.selectTowerCurrentCount(map);
|
List<Map<String, Object>> maps = towerMapper.selectTowerCurrentCount(map);
|
||||||
|
List<TowerCurrentCountVo> countVoList = maps.stream().map(e -> BeanUtil.toBeanIgnoreCase(e, TowerCurrentCountVo.class, true)).collect(Collectors.toList());
|
||||||
|
return countVoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -481,6 +480,11 @@ public class TowerServiceImpl extends ServiceImpl<TowerMapper, Tower> implements
|
|||||||
driverVO.setPhoneNumber(driver.getDriverPhone());
|
driverVO.setPhoneNumber(driver.getDriverPhone());
|
||||||
driverVO.setSpecialCertificateNumber(driver.getCertificateNumber());
|
driverVO.setSpecialCertificateNumber(driver.getCertificateNumber());
|
||||||
driverVO.setImageUrl(driver.getImageUrl());
|
driverVO.setImageUrl(driver.getImageUrl());
|
||||||
|
driverVO.setSex(driver.getSex());
|
||||||
|
driverVO.setAge(driver.getAge());
|
||||||
|
driverVO.setWorkYear(driver.getWorkYear());
|
||||||
|
driverVO.setContinuousWorkingTime(driver.getContinuousWorkingTime());
|
||||||
|
driverVO.setIdCard(driver.getDriverIdCard());
|
||||||
return driverVO;
|
return driverVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
DevWorkerVO devWorker = new DevWorkerVO(tower.getDevName(), tower.getDevSn(), tower.getRegistNo(), tower.getFactoryName(), null, driverList);
|
DevWorkerVO devWorker = new DevWorkerVO(tower.getDevName(), tower.getDevSn(), tower.getRegistNo(), tower.getFactoryName(), null, driverList);
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -405,4 +406,12 @@ public class ProjectController {
|
|||||||
return Result.success(Arrays.asList(SanjiangProgressProjectEnum.values()));
|
return Result.success(Arrays.asList(SanjiangProgressProjectEnum.values()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "调外部接口,获取FMS监控⼤屏接⼊url", notes = "调外部接口,获取FMS监控⼤屏接⼊url", httpMethod = "GET")
|
||||||
|
@ApiImplicitParam(name = "account", value = "账号", paramType = "query", required = true, dataType = "String")
|
||||||
|
@GetMapping(value = "/getFmsMonitoringLargeScreenAccessUrl")
|
||||||
|
public Result<Map<String, Object>> getFmsMonitoringLargeScreenAccessUrl(@RequestParam Map<String, Object> map) {
|
||||||
|
HashMap<String, Object> rsMap = projectService.getFmsMonitoringLargeScreenAccessUrl(map);
|
||||||
|
return Result.success(rsMap);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -251,4 +251,10 @@ public class Project implements Serializable {
|
|||||||
@ApiModelProperty(value = "三江重点工程类型多选")
|
@ApiModelProperty(value = "三江重点工程类型多选")
|
||||||
private String keyProjectType;
|
private String keyProjectType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "fms监控大屏username")
|
||||||
|
private String fmsMonitoringScreenUsername;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "fms监控大屏key")
|
||||||
|
private String fmsMonitoringScreenKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectProgressVo;
|
|||||||
import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectTypeVo;
|
import com.zhgd.xmgl.modules.project.entity.vo.GroupByProjectTypeVo;
|
||||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectDurationVO;
|
import com.zhgd.xmgl.modules.project.entity.vo.ProjectDurationVO;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -67,4 +68,6 @@ public interface IProjectService extends IService<Project> {
|
|||||||
List<GroupByProjectTypeVo> groupByProjectType(Map<String, Object> map);
|
List<GroupByProjectTypeVo> groupByProjectType(Map<String, Object> map);
|
||||||
|
|
||||||
List<GroupByProjectProgressVo> groupByProjectProgress();
|
List<GroupByProjectProgressVo> groupByProjectProgress();
|
||||||
|
|
||||||
|
HashMap<String, Object> getFmsMonitoringLargeScreenAccessUrl(Map<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
package com.zhgd.xmgl.modules.project.service.impl;
|
package com.zhgd.xmgl.modules.project.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.crypto.digest.HMac;
|
||||||
|
import cn.hutool.crypto.digest.HmacAlgorithm;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -55,6 +60,7 @@ import com.zhgd.xmgl.modules.worker.service.*;
|
|||||||
import com.zhgd.xmgl.util.AddressUtil;
|
import com.zhgd.xmgl.util.AddressUtil;
|
||||||
import com.zhgd.xmgl.util.MessageUtil;
|
import com.zhgd.xmgl.util.MessageUtil;
|
||||||
import com.zhgd.xmgl.util.ProfileJudgeUtil;
|
import com.zhgd.xmgl.util.ProfileJudgeUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -77,6 +83,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Slf4j
|
||||||
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements IProjectService {
|
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements IProjectService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private BimfaceConfigMapper bimfaceConfigMapper;
|
private BimfaceConfigMapper bimfaceConfigMapper;
|
||||||
@ -146,6 +153,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|||||||
@Resource
|
@Resource
|
||||||
private RedisRepository redisRepository;
|
private RedisRepository redisRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接⼝地址host
|
||||||
|
*/
|
||||||
|
@Value("${fmsMonitoringScreenRequestHost:}")
|
||||||
|
private String fmsMonitoringScreenRequestHost;
|
||||||
|
/**
|
||||||
|
* 施⼯监控⼤屏⻚⾯地址
|
||||||
|
*/
|
||||||
|
@Value("${fmsMonitoringScreenPageUrl:}")
|
||||||
|
private String fmsMonitoringScreenPageUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<EntityMap> selectProjectPage(Map<String, Object> map) {
|
public IPage<EntityMap> selectProjectPage(Map<String, Object> map) {
|
||||||
@ -587,4 +604,60 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|||||||
return projectProgressVos;
|
return projectProgressVos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> getFmsMonitoringLargeScreenAccessUrl(Map<String, Object> map) {
|
||||||
|
//生成签名
|
||||||
|
/*
|
||||||
|
1.拼接签名字符串,由date与请求行拼接而成,以换行间隔,示例date: Thu, 22 Jun 2017 17:15:21 GMT\nGET /requests HTTP/1.1
|
||||||
|
2.对拼接的签名字符串,进行HMAC-SHA256签名,签名需要用到的key由FMS提供
|
||||||
|
3.对HMAC-SHA256的结果进行base64编码,得到signature值
|
||||||
|
签名注意事项:
|
||||||
|
请求参数需要分别进行url编码(UTF-8)
|
||||||
|
*/
|
||||||
|
String account = MapUtils.getString(map, "account");
|
||||||
|
if (StringUtils.isBlank(account)) {
|
||||||
|
throw new OpenAlertException("account不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(fmsMonitoringScreenRequestHost)) {
|
||||||
|
throw new OpenAlertException("fmsMonitoringScreenHost未配置");
|
||||||
|
}
|
||||||
|
Project project = projectMapper.selectOne(new LambdaQueryWrapper<Project>().eq(Project::getFmsMonitoringScreenUsername, account));
|
||||||
|
if (project == null) {
|
||||||
|
throw new OpenAlertException("查询不到此用户,请检查配置");
|
||||||
|
}
|
||||||
|
|
||||||
|
String key = project.getFmsMonitoringScreenKey();
|
||||||
|
|
||||||
|
Date now = new Date();
|
||||||
|
String gmtTime = com.zhgd.xmgl.util.DateUtil.getGMTTime(now);
|
||||||
|
String algorithm = "hmac-sha256";
|
||||||
|
String request_url = "/api-gateway/v2/system/getAccessToken";
|
||||||
|
String request_line = "GET " + request_url + " HTTP/1.1";
|
||||||
|
String content = "date: " + gmtTime + "\n" + request_line;
|
||||||
|
HMac mac = new HMac(HmacAlgorithm.HmacSHA256, key.getBytes());
|
||||||
|
String signature = com.zhgd.xmgl.util.Base64.encodeBase64(mac.digest(content));
|
||||||
|
|
||||||
|
//获取access_token
|
||||||
|
//hmac username="{用户名}", algorithm="hmac-sha256", headers="date request-line", signature="{签名}"
|
||||||
|
String authorization = "hmac username=\"" + project.getFmsMonitoringScreenUsername() + "\", algorithm=\"" + algorithm + "\", headers=\"date request-line\", signature=\"" + signature + "\"";
|
||||||
|
String accessUrl = fmsMonitoringScreenRequestHost + "/api-gateway/v2/system/getAccessToken";
|
||||||
|
log.info("accessUrl:{},authorization:{},date:{}", accessUrl, authorization, gmtTime);
|
||||||
|
String rs = HttpRequest.get(accessUrl)
|
||||||
|
.header("authorization", authorization)
|
||||||
|
.header("date", gmtTime)
|
||||||
|
.execute().body();
|
||||||
|
log.info("rs(获取access_token):{}", rs);
|
||||||
|
JSONObject tokenJsonObject = com.alibaba.fastjson.JSON.parseObject(rs);
|
||||||
|
if (!tokenJsonObject.getBoolean("success")) {
|
||||||
|
throw new OpenAlertException(MessageUtil.get("thirdErr"));
|
||||||
|
}
|
||||||
|
JSONObject dataJSONObject = tokenJsonObject.getJSONObject("data");
|
||||||
|
String token = dataJSONObject.getString("token");
|
||||||
|
|
||||||
|
//返回url
|
||||||
|
String url = fmsMonitoringScreenPageUrl + token;
|
||||||
|
HashMap<String, Object> rsMap = new HashMap<>();
|
||||||
|
rsMap.put("url", url);
|
||||||
|
return rsMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
80
src/main/resources/application-shahu-gsx.properties
Normal file
80
src/main/resources/application-shahu-gsx.properties
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
#http.port=30250
|
||||||
|
http.port=38323
|
||||||
|
#spring.datasource.url=jdbc:mysql://124.71.178.44:3306/wisdomsite_lgdc?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||||
|
#spring.datasource.url=jdbc:mysql://183.60.227.61:20246/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&serverTimezone=UTC
|
||||||
|
#spring.datasource.url=jdbc:mysql://36.137.53.203:3306/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||||
|
#spring.datasource.url=jdbc:mysql://139.9.66.234:3386/wisdomsite_ty?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||||
|
#spring.datasource.url=jdbc:mysql://182.90.224.237:3306/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||||
|
#spring.datasource.url=jdbc:mysql://139.9.66.234:3306/wisdomsite?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true
|
||||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsite_shahu?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
|
||||||
|
spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
|
||||||
|
spring.datasource.password=ENC(LsKaVL2ycDu+uUNoPndYLA==)
|
||||||
|
server.port=30015
|
||||||
|
#server.port=30246
|
||||||
|
basePath=C:/jxj/prod/backEnd/itbgpImage/
|
||||||
|
server.tomcat.basedir=C:/jxj/prod/backEnd/tempImage/
|
||||||
|
#arcsoft.dllPath=D:/hz/wisdomSite/src/main/resources/dll
|
||||||
|
#basePath=F:/zhgd/itbgpImage/
|
||||||
|
#server.tomcat.basedir=F:/zhgd/tempImage/
|
||||||
|
#arcsoft.dllPath=F:/zhgd/dll
|
||||||
|
arcsoft.dllPath=C:/jxj/prod/backEnd/dll
|
||||||
|
security.enable=false
|
||||||
|
isGetStandardData=false
|
||||||
|
isGetEnvironmentData=false
|
||||||
|
isGetFaceFeatureDate=false
|
||||||
|
#\u6D77\u5EB7\u89C6\u9891\u62A5\u8B66\u56FE\u7247IP\u7AEF\u53E3\u66FF\u6362
|
||||||
|
video.alarm.newUrl=223.82.100.80:6040
|
||||||
|
wx-appid=
|
||||||
|
wx-AppSecret=
|
||||||
|
mqtt-scope=zjsjTopic
|
||||||
|
serverUrl=http://124.71.67.160:8088/
|
||||||
|
#serverUrl=http://182.90.224.237:7000
|
||||||
|
#serverUrl=http://127.0.0.1:6023
|
||||||
|
#\u89C6\u9891\u5206\u6790url
|
||||||
|
video-analysis-url=
|
||||||
|
server.ssl.enabled=false
|
||||||
|
#\u9ED8\u8BA4\u653F\u52A1\u521B\u5EFA\u9879\u76EE\u6240\u5C5E\u4F01\u4E1A
|
||||||
|
defaultZwComapnySn=
|
||||||
|
#\u6587\u4EF6\u5B58\u50A8\u914D\u7F6E
|
||||||
|
#\u9ED8\u8BA4\u4F7F\u7528\u7684\u5B58\u50A8\u5E73\u53F0
|
||||||
|
spring.file-storage.default-platform=local
|
||||||
|
#".min.jpg" #\u7F29\u7565\u56FE\u540E\u7F00\uFF0C\u4F8B\u5982\u3010.min.jpg\u3011\u3010.png\u3011
|
||||||
|
spring.file-storage.thumbnail-suffix=.jpg
|
||||||
|
# \u672C\u5730\u5B58\u50A8\uFF0C\u4E0D\u4F7F\u7528\u7684\u60C5\u51B5\u4E0B\u53EF\u4EE5\u4E0D\u5199
|
||||||
|
# \u5B58\u50A8\u5E73\u53F0\u6807\u8BC6
|
||||||
|
spring.file-storage.local[0].platform=local
|
||||||
|
#\u542F\u7528\u5B58\u50A8
|
||||||
|
spring.file-storage.local[0].enable-storage=true
|
||||||
|
#\u542F\u7528\u8BBF\u95EE\uFF08\u7EBF\u4E0A\u8BF7\u4F7F\u7528 Nginx \u914D\u7F6E\uFF0C\u6548\u7387\u66F4\u9AD8\uFF09
|
||||||
|
spring.file-storage.local[0].enable-access=false
|
||||||
|
# \u8BBF\u95EE\u57DF\u540D\uFF0C\u4F8B\u5982\uFF1A\u201Chttp://127.0.0.1:6023/image/\u201D\uFF0C\u6CE8\u610F\u540E\u9762\u8981\u548C path-patterns \u4FDD\u6301\u4E00\u81F4\uFF0C\u201C/\u201D\u7ED3\u5C3E\uFF0C\u672C\u5730\u5B58\u50A8\u5EFA\u8BAE\u4F7F\u7528\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u65B9\u4FBF\u540E\u671F\u66F4\u6362\u57DF\u540D
|
||||||
|
spring.file-storage.local[0].domain=
|
||||||
|
# \u5B58\u50A8\u5730\u5740
|
||||||
|
spring.file-storage.local[0].base-path=C:/jxj/prod/backEnd/itbgpImage/
|
||||||
|
# \u8BBF\u95EE\u8DEF\u5F84\uFF0C\u5F00\u542F enable-access \u540E\uFF0C\u901A\u8FC7\u6B64\u8DEF\u5F84\u53EF\u4EE5\u8BBF\u95EE\u5230\u4E0A\u4F20\u7684\u6587\u4EF6
|
||||||
|
spring.file-storage.local[0].path-patterns=
|
||||||
|
spring.file-storage.aliyun-oss[0].platform=aliyun-oss
|
||||||
|
spring.file-storage.aliyun-oss[0].enable-storage=false
|
||||||
|
spring.file-storage.aliyun-oss[0].access-key=
|
||||||
|
spring.file-storage.aliyun-oss[0].secret-key=
|
||||||
|
spring.file-storage.aliyun-oss[0].end-point=
|
||||||
|
spring.file-storage.aliyun-oss[0].bucket-name=
|
||||||
|
# \u8BBF\u95EE\u57DF\u540D\uFF0C\u6CE8\u610F\u201C/\u201D\u7ED3\u5C3E\uFF0C\u4F8B\u5982\uFF1Ahttps://abc.oss-cn-shanghai.aliyuncs.com/
|
||||||
|
spring.file-storage.aliyun-oss[0].domain=
|
||||||
|
spring.file-storage.aliyun-oss[0].base-path=
|
||||||
|
# admin\u4E2D\u5BF9\u5E94\u7684\u5730\u5740\u53CA\u5B9E\u4F8B\u540D
|
||||||
|
spring.boot.admin.client.instance.service-url=http://localhost:18070
|
||||||
|
spring.boot.admin.client.instance.name=zjsj
|
||||||
|
# \u6C34\u7535\u6570\u636E\u63A8\u9001\u5730\u5740
|
||||||
|
double-carbon.water-data-url=http://test.cesms.net
|
||||||
|
double-carbon.ammeter-data-url=http://test.cesms.net
|
||||||
|
license.licensePath=C:/jxj/prod/backEnd/license/license.lic
|
||||||
|
license.publicKeysStorePath=C:/jxj/prod/backEnd/license/publicCerts.keystore
|
||||||
|
#\u9AD8\u652F\u6A21\u7684tcp\u670D\u52A1\u7AEF\u7684\u7AEF\u53E3\u53F7
|
||||||
|
high_formwork.netty.port=15333
|
||||||
|
#同步bim进度管理的IP端口号
|
||||||
|
bimProgressIpPort=http://47.105.67.193:8086
|
||||||
|
#fms接⼝地址host
|
||||||
|
fmsMonitoringScreenRequestHost=http://gateway.sit.bzlrobot.com
|
||||||
|
#fms施⼯监控⼤屏⻚⾯地址
|
||||||
|
fmsMonitoringScreenPageUrl=https://fms.bzlrobot.com:8085/#/intelligenceMonitor/dataScreen?token=
|
||||||
Loading…
x
Reference in New Issue
Block a user