Commit 16ef8398 authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 23a7b027 7476bc50
...@@ -137,4 +137,8 @@ public class Video extends BaseEntity { ...@@ -137,4 +137,8 @@ public class Video extends BaseEntity {
@ApiModelProperty(value = "机构/部门名称") @ApiModelProperty(value = "机构/部门名称")
@TableField(value = "biz_org_name", updateStrategy = FieldStrategy.IGNORED) @TableField(value = "biz_org_name", updateStrategy = FieldStrategy.IGNORED)
private String bizOrgName; private String bizOrgName;
@ApiModelProperty(value = "视频格式")
@TableField(value = "video_type")
private String videoType;
} }
...@@ -25,6 +25,8 @@ public class AlamVideoVO { ...@@ -25,6 +25,8 @@ public class AlamVideoVO {
private String vedioFormat; private String vedioFormat;
private String videoType;
/** /**
* 是否绑定设备 * 是否绑定设备
*/ */
......
...@@ -45,4 +45,7 @@ public class BuildingVideoVO { ...@@ -45,4 +45,7 @@ public class BuildingVideoVO {
@ApiModelProperty("视频转码") @ApiModelProperty("视频转码")
private String vedioFormat; private String vedioFormat;
@ApiModelProperty("视频类型")
private String videoType;
} }
package com.yeejoin.equipmanage.common.enums;
/**
* 一天内不同时段个数
*/
public enum DayHourEnum {
hour("小时", 24),
hafHour("半小时个数", 48),
twoHour("两小时个数", 12),
fourHour("四小时个数", 6);
private String name;
private int number;
DayHourEnum(String name, int number ){
this.name = name;
this.number = number;
}
public String getName() {
return name;
}
public int getNumber() {
return number;
}
}
...@@ -473,9 +473,10 @@ public class DateUtils { ...@@ -473,9 +473,10 @@ public class DateUtils {
* @throws ParseException * @throws ParseException
*/ */
public static int dateBetweenNew(Date startDate, Date endDate) throws ParseException { public static int dateBetweenNew(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN); Date dateStart = dateParse(dateFormat(startDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN); Date dateEnd = dateParse(dateFormat(endDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 60); double ceil = Math.ceil((dateEnd.getTime() - dateStart.getTime()) * 1.0 / 1000 / 60 / 60);
return new Double(ceil).intValue() ;
} }
/** /**
...@@ -487,9 +488,10 @@ public class DateUtils { ...@@ -487,9 +488,10 @@ public class DateUtils {
* @throws ParseException * @throws ParseException
*/ */
public static int dateBetweenNew1(Date startDate, Date endDate) throws ParseException { public static int dateBetweenNew1(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN); Date dateStart = dateParse(dateFormat(startDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN); Date dateEnd = dateParse(dateFormat(endDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 30); double ceil = Math.ceil((dateEnd.getTime() - dateStart.getTime()) * 1.0 / 1000 / 60 / 30);
return new Double(ceil).intValue() ;
} }
/** /**
...@@ -501,9 +503,10 @@ public class DateUtils { ...@@ -501,9 +503,10 @@ public class DateUtils {
* @throws ParseException * @throws ParseException
*/ */
public static int dateBetweenNew2(Date startDate, Date endDate) throws ParseException { public static int dateBetweenNew2(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN); Date dateStart = dateParse(dateFormat(startDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN); Date dateEnd = dateParse(dateFormat(endDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 120); double ceil = Math.ceil((dateEnd.getTime() - dateStart.getTime()) * 1.0 / 1000 / 60 / 120);
return new Double(ceil).intValue() ;
} }
/** /**
...@@ -515,9 +518,10 @@ public class DateUtils { ...@@ -515,9 +518,10 @@ public class DateUtils {
* @throws ParseException * @throws ParseException
*/ */
public static int dateBetweenNew3(Date startDate, Date endDate) throws ParseException { public static int dateBetweenNew3(Date startDate, Date endDate) throws ParseException {
Date dateStart = dateParse(dateFormat(startDate, DATE_PATTERN), DATE_PATTERN); Date dateStart = dateParse(dateFormat(startDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
Date dateEnd = dateParse(dateFormat(endDate, DATE_PATTERN), DATE_PATTERN); Date dateEnd = dateParse(dateFormat(endDate, DATE_TIME_PATTERN), DATE_TIME_PATTERN);
return (int) ((dateEnd.getTime() - dateStart.getTime()) / 1000 / 60 / 240); double ceil = Math.ceil((dateEnd.getTime() - dateStart.getTime()) * 1.0 / 1000 / 60 / 240);
return new Double(ceil).intValue() ;
} }
/** /**
......
...@@ -135,6 +135,7 @@ public class Check extends BasicEntity { ...@@ -135,6 +135,7 @@ public class Check extends BasicEntity {
@Column(name="route_name") @Column(name="route_name")
private String routeName; private String routeName;
/** /**
* 评分 * 评分
*/ */
...@@ -412,4 +413,38 @@ public class Check extends BasicEntity { ...@@ -412,4 +413,38 @@ public class Check extends BasicEntity {
this.routeName = routeName; this.routeName = routeName;
} }
@Override
public String toString() {
return "Check{" +
"address='" + address + '\'' +
", checkMode='" + checkMode + '\'' +
", checkTime=" + checkTime +
", deviceId='" + deviceId + '\'' +
", error='" + error + '\'' +
", isOk='" + isOk + '\'' +
", latitude='" + latitude + '\'' +
", longitude='" + longitude + '\'' +
", orgCode='" + orgCode + '\'' +
", planId=" + planId +
", planName='" + planName + '\'' +
", planTaskId=" + planTaskId +
", planTaskDetailId=" + planTaskDetailId +
", pointId=" + pointId +
", pointName='" + pointName + '\'' +
", remark='" + remark + '\'' +
", routeId=" + routeId +
", routeName='" + routeName + '\'' +
", score=" + score +
", shotNumber=" + shotNumber +
", uploadTime=" + uploadTime +
", userId='" + userId + '\'' +
", userName='" + userName + '\'' +
", depId='" + depId + '\'' +
", depName='" + depName + '\'' +
", errorClassify='" + errorClassify + '\'' +
", checkInput=" + checkInput +
", checkShot=" + checkShot +
'}';
}
} }
\ No newline at end of file
...@@ -577,7 +577,7 @@ public class EmergencyController extends AbstractBaseController { ...@@ -577,7 +577,7 @@ public class EmergencyController extends AbstractBaseController {
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPressurePumpStatusChart") @GetMapping(value = "/getPressurePumpStatusChart")
@ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵启停状态图", notes = "四横八纵-稳压泵启停状态图") @ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵启停状态图", notes = "四横八纵-稳压泵启停状态图,取舍补点")
public ResponseModel getPressurePumpStatusChart(@RequestParam String startTime, @RequestParam String endTime, public ResponseModel getPressurePumpStatusChart(@RequestParam String startTime, @RequestParam String endTime,
@RequestParam(required = false) String bizOrgCode) { @RequestParam(required = false) String bizOrgCode) {
if(StringUtils.isEmpty(bizOrgCode)) { if(StringUtils.isEmpty(bizOrgCode)) {
...@@ -595,6 +595,25 @@ public class EmergencyController extends AbstractBaseController { ...@@ -595,6 +595,25 @@ public class EmergencyController extends AbstractBaseController {
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPressurePumpStatusDetailChart")
@ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵启停状态图", notes = "四横八纵-稳压泵启停状态图,分钟级补点")
public ResponseModel getPressurePumpStatusDetailChart(@RequestParam String startTime, @RequestParam String endTime,
@RequestParam(required = false) String bizOrgCode) {
if(StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(Collections.EMPTY_MAP);
}
}
}
return CommonResponseUtil.success(iEmergencyService.getPressurePumpStatusDetailChart(startTime, endTime, bizOrgCode));
}
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getPressurePumpDiagnosticAnalysis") @GetMapping(value = "/getPressurePumpDiagnosticAnalysis")
@ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵诊断分析", notes = "四横八纵-稳压泵诊断分析") @ApiOperation(httpMethod = "GET", value = "四横八纵-稳压泵诊断分析", notes = "四横八纵-稳压泵诊断分析")
public ResponseModel getPressurePumpDiagnosticAnalysis(@RequestParam(required = false) String bizOrgCode) { public ResponseModel getPressurePumpDiagnosticAnalysis(@RequestParam(required = false) String bizOrgCode) {
......
...@@ -57,6 +57,8 @@ public interface IEmergencyService { ...@@ -57,6 +57,8 @@ public interface IEmergencyService {
Map<String, Object> getPressurePumpStatusChart(String startTime, String endTime, String bizOrgCode); Map<String, Object> getPressurePumpStatusChart(String startTime, String endTime, String bizOrgCode);
Map<String, Object> getPressurePumpStatusDetailChart(String startTime, String endTime, String bizOrgCode);
List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode); List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String bizOrgCode);
Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus); Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus);
......
...@@ -178,4 +178,11 @@ public interface IPressurePumpService { ...@@ -178,4 +178,11 @@ public interface IPressurePumpService {
* @return * @return
*/ */
List<OrgUsrDto> getOrgUsrDtoInfo(Map<String, String> map); List<OrgUsrDto> getOrgUsrDtoInfo(Map<String, String> map);
/**
* 获取公司顶级bizOrgCode
* @param bizOrgCode
* @return
*/
String getCompanyBizOrgCode(String bizOrgCode);
} }
...@@ -770,7 +770,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -770,7 +770,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x.setLocation(x.getAddress()); x.setLocation(x.getAddress());
} }
} }
x.setVedioFormat(vedioFormat); x.setVedioFormat(x.getVideoType());
x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode())); x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
}); });
return pages; return pages;
...@@ -1032,7 +1032,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i ...@@ -1032,7 +1032,7 @@ public class BuildingServiceImpl extends ServiceImpl<BuildingMapper, Building> i
x.setLocation(x.getAddress()); x.setLocation(x.getAddress());
} }
} }
x.setVedioFormat(vedioFormat); x.setVedioFormat(x.getVideoType());
x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode())); x.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
}); });
return pages; return pages;
......
...@@ -139,7 +139,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -139,7 +139,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
if (videoType.equals(type)) { if (videoType.equals(type)) {
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(Long.valueOf(equipId)); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(Long.valueOf(equipId));
video.forEach(action -> { video.forEach(action -> {
action.setVedioFormat(vedioFormat); action.setVedioFormat(action.getVideoType());
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("video", video); res.put("video", video);
...@@ -159,7 +159,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -159,7 +159,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
} }
videoBySpeId.forEach(action -> { videoBySpeId.forEach(action -> {
action.setVedioFormat(vedioFormat); action.setVedioFormat(action.getVideoType());
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("data", specificAlarm); res.put("data", specificAlarm);
...@@ -353,7 +353,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ ...@@ -353,7 +353,7 @@ public class ConfirmAlarmServiceImpl extends ServiceImpl<ConfirmAlarmMapper, Equ
// 设备关联的摄像头 // 设备关联的摄像头
List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipmentSpecificId); List<AlamVideoVO> video = videoMapper.getVideoBySpeId(equipmentSpecificId);
video.forEach(action -> { video.forEach(action -> {
action.setVedioFormat(vedioFormat); action.setVedioFormat(action.getVideoType());
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
res.put("video", video); res.put("video", video);
......
...@@ -383,12 +383,13 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -383,12 +383,13 @@ public class EmergencyServiceImpl implements IEmergencyService {
dataList.add(xMap); dataList.add(xMap);
}); });
dataListMap.put(iotCode.toString(), dataList); dataListMap.put(iotCode.toString(), dataList);
} else {
List<Map<String, String>> dataList = getDataList(startTime, endTime, iotCode);
dataListMap.put(iotCode.toString(), dataList);
} }
} else if (iotCode.toString().length() > 8) { } else if (iotCode.toString().length() > 8) {
// iot获取数据 // iot获取数据
String prefix = iotCode.toString().substring(0, 8); List<Map<String, String>> dataList = getDataList(startTime, endTime, iotCode);
String suffix = iotCode.toString().substring(8);
List<Map<String, String>> dataList = pressurePumpService.getIotCommonListData(startTime, endTime, prefix, suffix, null, pressurePumpStart);
dataList.forEach(z -> timeSet.add(z.get(PressurePumpRelateEnum.CREATED_TIME.getValue()))); dataList.forEach(z -> timeSet.add(z.get(PressurePumpRelateEnum.CREATED_TIME.getValue())));
dataListMap.put(iotCode.toString(), dataList); dataListMap.put(iotCode.toString(), dataList);
} }
...@@ -438,9 +439,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -438,9 +439,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} else { } else {
timeList.forEach(t -> { timeList.forEach(t -> yList.add(Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
yList.add(Integer.parseInt(PressurePumpRelateEnum.STOP.getValue()));
});
} }
yMap.put("data", yList); yMap.put("data", yList);
yData.add(yMap); yData.add(yMap);
...@@ -456,6 +455,111 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -456,6 +455,111 @@ public class EmergencyServiceImpl implements IEmergencyService {
return map; return map;
} }
@Override
public Map<String, Object> getPressurePumpStatusDetailChart(String startTime, String endTime, String bizOrgCode) {
Map<String, Object> map = new LinkedHashMap<>();
try {
// 从 json 配置文件获取配置信息
List<Map> infoList = pressurePumpService.getNameKeyInfoList(PressurePumpRelateEnum.PRESSURE_PUMP.getValue());
if (!CollectionUtils.isEmpty(infoList)) {
Date dateNow = DateUtils.getDateNow();
Map infoMap = infoList.get(0);
String equipmentCode = infoMap.get("equipmentCode").toString();
// 获取稳压泵
List<Map<String, Object>> list = equipmentSpecificSerivce.getListByEquipmentCode(equipmentCode, bizOrgCode);
// 获取各稳压泵数据,及时间戳
if (!CollectionUtils.isEmpty(list)) {
// 获取查询时间范围内的时间戳
List<String> timeHourList = DateUtils.getTimeStrListByStartAndEnd(startTime, endTime, DateUtils.MONTH_DAY_HOUR_MINUTE_PATTERN);
List<Map<String, Object>> yData = new ArrayList<>();
LinkedHashMap<String, List<Map<String, String>>> dataListMap = new LinkedHashMap<>();
for (Map<String, Object> x : list) {
Object iotCode = x.get("iotCode");
if (iotCode != null) {
// 判断开始时间,是否在redis缓存有效期之内,是,redis获取数据,否则,iot获取数据
int expire = Integer.parseInt(infoMap.get("expire").toString()) * -1;
Date beforeDate = DateUtils.dateAddSeconds(dateNow, expire);
Date startDate = DateUtils.convertStrToDate(startTime, DateUtils.DATE_TIME_PATTERN);
Date endDate = DateUtils.convertStrToDate(endTime, DateUtils.DATE_TIME_PATTERN);
if (DateUtils.dateCompare(startDate, beforeDate) >= 0) {
// 获取redis稳压泵缓存数据,默认JSON配置最近4小时
List<IotDataVO> redisDataList = pressurePumpService.getDataToRedisByDateBetween(PressurePumpRelateEnum.PRESSURE_PUMP.getValue(), pressurePumpStart, iotCode.toString(), startDate, endDate, bizOrgCode);
if (!CollectionUtils.isEmpty(redisDataList)) {
List<Map<String, String>> dataList = new ArrayList<>();
redisDataList.forEach(y -> {
Map<String, String> xMap = new HashMap<>();
xMap.put(pressurePumpStart, y.getValue().toString());
xMap.put(PressurePumpRelateEnum.CREATED_TIME.getValue(), y.getCreatedTime());
dataList.add(xMap);
});
dataListMap.put(iotCode.toString(), dataList);
} else {
List<Map<String, String>> dataList = getDataList(startTime, endTime, iotCode);
dataListMap.put(iotCode.toString(), dataList);
}
} else if (iotCode.toString().length() > 8) {
// iot获取数据
List<Map<String, String>> dataList = getDataList(startTime, endTime, iotCode);
dataListMap.put(iotCode.toString(), dataList);
}
}
}
// 遍历稳压泵,dataListMap获取各稳压泵数据,没有数据的进行补0
list.forEach(x -> {
Map<String, Object> yMap = new HashMap<>();
List<Integer> yList = new ArrayList<>();
String name = x.get("name").toString();
yMap.put("name", name);
Object iotCode = x.get("iotCode");
if (!ObjectUtils.isEmpty(iotCode)) {
List<Map<String, String>> dataList = dataListMap.get(iotCode.toString());
// 获取最新稳压泵启动指标值,作为后续稳压泵启停参考值
String flag = null;
if (!CollectionUtils.isEmpty(dataList)) {
Collections.reverse(dataList);
Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey(PressurePumpRelateEnum.CREATED_TIME.getValue())).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16)));
List<Map<String, String>> yDataList = null;
for (String t : timeHourList) {
List<Map<String, String>> data = dataMap.get(t);
if (!CollectionUtils.isEmpty(data)) {
yDataList = data.stream().filter(o -> PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue().equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
flag = data.get(data.size() - 1).get(pressurePumpStart);
yList.add(!CollectionUtils.isEmpty(yDataList) ? Integer.parseInt(PressurePumpRelateEnum.START.getValue()) : PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue().equalsIgnoreCase(flag) ? Integer.parseInt(PressurePumpRelateEnum.START.getValue()) : Integer.parseInt(PressurePumpRelateEnum.STOP.getValue()));
} else {
yList.add(StringUtils.isNotBlank(flag) && PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue().equalsIgnoreCase(flag) ? Integer.parseInt(PressurePumpRelateEnum.START.getValue()) : Integer.parseInt(PressurePumpRelateEnum.STOP.getValue()));
}
}
} else {
String prefix = iotCode.toString().substring(0, 8);
String suffix = iotCode.toString().substring(8);
List<Map<String, String>> iotDataList = pressurePumpService.getIotTopSingleField("1", prefix, suffix, PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue(), pressurePumpStart);
if (!CollectionUtils.isEmpty(iotDataList)) {
flag = iotDataList.get(0).get(pressurePumpStart);
}
String finalFlag = flag;
timeHourList.forEach(t -> yList.add(StringUtils.isNotBlank(finalFlag) && PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue().equalsIgnoreCase(finalFlag) ? Integer.parseInt(PressurePumpRelateEnum.START.getValue()) : Integer.parseInt(PressurePumpRelateEnum.STOP.getValue())));
}
yMap.put("data", yList);
yData.add(yMap);
}
});
map.put("xData", timeHourList);
map.put("yData", yData);
}
}
} catch (Exception e) {
log.error("getPressurePumpStatusChart-->获取稳压泵启停状态图失败:{}", e.getMessage());
}
return map;
}
private List<Map<String, String>> getDataList(String startTime, String endTime, Object iotCode) {
String prefix = iotCode.toString().substring(0, 8);
String suffix = iotCode.toString().substring(8);
List<Map<String, String>> dataList = pressurePumpService.getIotCommonListData(startTime, endTime, prefix, suffix, null, pressurePumpStart);
return dataList;
}
@Override @Override
public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page, String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus) { public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page, String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus, Integer handleStatus) {
...@@ -487,7 +591,6 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -487,7 +591,6 @@ public class EmergencyServiceImpl implements IEmergencyService {
long countExpire = Long.parseLong(infoMap.get("countExpire").toString()); long countExpire = Long.parseLong(infoMap.get("countExpire").toString());
List<Map<String, Object>> pumpInfoList = equipmentSpecificSerivce.getFirePumpInfoEQ(equipmentCode, null); List<Map<String, Object>> pumpInfoList = equipmentSpecificSerivce.getFirePumpInfoEQ(equipmentCode, null);
if (!CollectionUtils.isEmpty(pumpInfoList)){ if (!CollectionUtils.isEmpty(pumpInfoList)){
Map<String, String> params = new HashMap<>();
for (Map<String, Object> map : pumpInfoList) { for (Map<String, Object> map : pumpInfoList) {
// iot获取数据,返回并存储redis // iot获取数据,返回并存储redis
Object iotCode = map.get("iotCode"); Object iotCode = map.get("iotCode");
...@@ -495,12 +598,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -495,12 +598,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
String bizOrgCode = ObjectUtils.isEmpty(orgCode) ? "" : orgCode.toString(); String bizOrgCode = ObjectUtils.isEmpty(orgCode) ? "" : orgCode.toString();
if (!ObjectUtils.isEmpty(iotCode) && !ObjectUtils.isEmpty(bizOrgCode)) { if (!ObjectUtils.isEmpty(iotCode) && !ObjectUtils.isEmpty(bizOrgCode)) {
// 获取公司顶级bizOrgCode // 获取公司顶级bizOrgCode
params.put("bizOrgType", PressurePumpRelateEnum.BIZ_ORG_TYPE_COMPANY.getValue()); bizOrgCode = pressurePumpService.getCompanyBizOrgCode(bizOrgCode);
params.put("bizOrgCode", bizOrgCode);
List<OrgUsrDto> orgUsrDtoList = pressurePumpService.getOrgUsrDtoInfo(params);
if (!CollectionUtils.isEmpty(orgUsrDtoList)) {
bizOrgCode = orgUsrDtoList.get(0).getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) {
String iotCodeStr = iotCode.toString(); String iotCodeStr = iotCode.toString();
String prefix = ObjectUtils.isEmpty(iotCode) ? "" : iotCodeStr.substring(0, 8); String prefix = ObjectUtils.isEmpty(iotCode) ? "" : iotCodeStr.substring(0, 8);
String suffix = ObjectUtils.isEmpty(iotCode) ? "" : iotCodeStr.substring(8); String suffix = ObjectUtils.isEmpty(iotCode) ? "" : iotCodeStr.substring(8);
...@@ -509,8 +607,6 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -509,8 +607,6 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} }
}
}
} catch (ParseException e) { } catch (ParseException e) {
log.error("redis存稳压泵昨天启动次数失败:{}", e.getMessage()); log.error("redis存稳压泵昨天启动次数失败:{}", e.getMessage());
} }
......
...@@ -341,7 +341,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -341,7 +341,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
video.setName(x.getName()); video.setName(x.getName());
video.setTokens(x.getToken()); video.setTokens(x.getToken());
video.setUrl(x.getUrl()); video.setUrl(x.getUrl());
video.setVedioFormat(vedioFormat); video.setVedioFormat(x.getVideoType());
video.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode())); video.setUrl(videoService.getVideoUrl(x.getName(), x.getPresetPosition(), x.getUrl(), x.getCode()));
video.setIp(x.getIp()); video.setIp(x.getIp());
video.setPort(x.getPort()); video.setPort(x.getPort());
...@@ -812,20 +812,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -812,20 +812,13 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
// 计算平均每小时打压频率 // 计算平均每小时打压频率
try { try {
int hour = DateUtils.dateBetweenNew(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null)); int hour = DateUtils.dateBetweenNew(DateUtils.dateParse(startTime, DateUtils.DATE_TIME_PATTERN),DateUtils.dateParse(endTime, DateUtils.DATE_TIME_PATTERN));
int hafHour = DateUtils.dateBetweenNew1(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null)); int hafHour = DateUtils.dateBetweenNew1(DateUtils.dateParse(startTime, DateUtils.DATE_TIME_PATTERN),DateUtils.dateParse(endTime, DateUtils.DATE_TIME_PATTERN));
int twoHour = DateUtils.dateBetweenNew2(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null)); int twoHour = DateUtils.dateBetweenNew2(DateUtils.dateParse(startTime, DateUtils.DATE_TIME_PATTERN),DateUtils.dateParse(endTime, DateUtils.DATE_TIME_PATTERN));
int fourHour = DateUtils.dateBetweenNew3(DateUtils.dateParse(startTime, null),DateUtils.dateParse(endTime, null)); int fourHour = DateUtils.dateBetweenNew3(DateUtils.dateParse(startTime, DateUtils.DATE_TIME_PATTERN),DateUtils.dateParse(endTime, DateUtils.DATE_TIME_PATTERN));
// 开始时间与结束时间为同一天时 给默认值
if (hour == 0){
hour = DayHourEnum.hour.getNumber();
hafHour = DayHourEnum.hafHour.getNumber();
twoHour = DayHourEnum.twoHour.getNumber();
fourHour = DayHourEnum.fourHour.getNumber();
}
if(allNum/hour > 15) { if(allNum/hour > 15) {
retMap.put("status","异常"); retMap.put("status","异常");
} else { } else {
......
...@@ -1065,7 +1065,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1065,7 +1065,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
if (!ObjectUtils.isEmpty(video)) { if (!ObjectUtils.isEmpty(video)) {
video.setUrl(videoService.getVideoUrl(video.getName(), video.getPresetPosition(), video.getUrl(), video.getCode())); video.setUrl(videoService.getVideoUrl(video.getName(), video.getPresetPosition(), video.getUrl(), video.getCode()));
video.setId(id); video.setId(id);
video.setVedioFormat(vedioFormat); video.setVedioFormat(video.getVideoType());
} }
return video; return video;
} else { } else {
......
...@@ -58,12 +58,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -58,12 +58,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
@Async @Async
public void saveDataToRedis(List<IotDataVO> iotDatalist, String iotCode, String bizOrgCode) { public void saveDataToRedis(List<IotDataVO> iotDatalist, String iotCode, String bizOrgCode) {
// 获取公司顶级bizOrgCode // 获取公司顶级bizOrgCode
Map<String, String> params = new HashMap<>(); bizOrgCode = getCompanyBizOrgCode(bizOrgCode);
params.put("bizOrgType", PressurePumpRelateEnum.BIZ_ORG_TYPE_COMPANY.getValue());
params.put("bizOrgCode", bizOrgCode);
List<OrgUsrDto> orgUsrDtoList = getOrgUsrDtoInfo(params);
if (CollectionUtils.isNotEmpty(orgUsrDtoList)) {
bizOrgCode = orgUsrDtoList.get(0).getBizOrgCode();
if (StringUtils.isNotBlank(bizOrgCode)) { if (StringUtils.isNotBlank(bizOrgCode)) {
String pressurePumpValue = PressurePumpRelateEnum.PRESSURE_PUMP.getValue(); String pressurePumpValue = PressurePumpRelateEnum.PRESSURE_PUMP.getValue();
// 获取配置JSON信息集合 // 获取配置JSON信息集合
...@@ -84,6 +79,17 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -84,6 +79,17 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
} }
} }
} }
@Override
public String getCompanyBizOrgCode(String bizOrgCode) {
Map<String, String> params = new HashMap<>();
params.put("bizOrgType", PressurePumpRelateEnum.BIZ_ORG_TYPE_COMPANY.getValue());
params.put("bizOrgCode", bizOrgCode);
List<OrgUsrDto> orgUsrDtoList = getOrgUsrDtoInfo(params);
if (CollectionUtils.isNotEmpty(orgUsrDtoList)) {
bizOrgCode = orgUsrDtoList.get(orgUsrDtoList.size() - 1).getBizOrgCode();
}
return bizOrgCode;
} }
@Override @Override
...@@ -303,6 +309,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -303,6 +309,8 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
PressurePumpCountVo countVo = new PressurePumpCountVo(); PressurePumpCountVo countVo = new PressurePumpCountVo();
countVo.setTime(time); countVo.setTime(time);
countVo.setValue(dataMap.get(time).size()); countVo.setValue(dataMap.get(time).size());
// 获取公司顶级bizOrgCode
bizOrgCode = getCompanyBizOrgCode(bizOrgCode);
// 获取的数据存储到redis // 获取的数据存储到redis
String topic = String.join(":", infoCode, bizOrgCode, countRedisKey, fieldKey, iotCode, time); String topic = String.join(":", infoCode, bizOrgCode, countRedisKey, fieldKey, iotCode, time);
countVo.setIotCode(topic); countVo.setIotCode(topic);
......
...@@ -58,7 +58,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap ...@@ -58,7 +58,7 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
public List<AlamVideoVO> queryVideoList(String bizOrgCode) { public List<AlamVideoVO> queryVideoList(String bizOrgCode) {
List<AlamVideoVO> list = supervisionVideoMapper.getVideoByCompany(bizOrgCode); List<AlamVideoVO> list = supervisionVideoMapper.getVideoByCompany(bizOrgCode);
list.forEach(action -> { list.forEach(action -> {
action.setVedioFormat(vedioFormat); action.setVedioFormat(action.getVideoType());
action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode())); action.setUrl(videoService.getVideoUrl(action.getName(), action.getPresetPosition(), action.getUrl(), action.getCode()));
}); });
return list; return list;
......
...@@ -163,19 +163,6 @@ public class CheckController extends AbstractBaseController { ...@@ -163,19 +163,6 @@ public class CheckController extends AbstractBaseController {
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存巡检记录<font color='blue'>手机app</font>", notes = "保存巡检记录<font color='blue'>手机app</font>") @ApiOperation(value = "保存巡检记录<font color='blue'>手机app</font>", notes = "保存巡检记录<font color='blue'>手机app</font>")
@RequestMapping(value = "/saveRecordNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/saveRecordNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
...@@ -188,6 +175,10 @@ public class CheckController extends AbstractBaseController { ...@@ -188,6 +175,10 @@ public class CheckController extends AbstractBaseController {
int statu = -1; int statu = -1;
PlanTask planTask =null; PlanTask planTask =null;
if(requestParam.getPlanTaskId()!=null && requestParam.getPlanTaskId() !=0){ if(requestParam.getPlanTaskId()!=null && requestParam.getPlanTaskId() !=0){
Map<String, Object> map = checkService.selectCheckById(requestParam.getPlanTaskId());
if (!ObjectUtils.isEmpty(map)) {
checkService.delCheckByTaskId(requestParam.getPlanTaskId(), Long.valueOf((String) map.get("id")));
}
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId()); planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
} }
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
......
...@@ -4,6 +4,7 @@ import java.util.HashMap; ...@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.patrol.dao.entity.Check;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.patrol.business.entity.mybatis.CheckDetailBo; import com.yeejoin.amos.patrol.business.entity.mybatis.CheckDetailBo;
...@@ -282,4 +283,10 @@ public interface CheckMapper extends BaseMapper { ...@@ -282,4 +283,10 @@ public interface CheckMapper extends BaseMapper {
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds); //Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
int delCheckByTaskId(@Param(value = "taskId") Long taskId);
int delCheckInputByCheckId(@Param(value = "checkId") Long checkId);
Map<String, Object> selectCheckById(@Param(value = "taskId") Long taskId);
} }
...@@ -27,6 +27,8 @@ import com.yeejoin.amos.patrol.dao.entity.Plan; ...@@ -27,6 +27,8 @@ import com.yeejoin.amos.patrol.dao.entity.Plan;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.assertj.core.util.Sets; import org.assertj.core.util.Sets;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.cglib.beans.BeanMap; import org.springframework.cglib.beans.BeanMap;
...@@ -155,6 +157,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -155,6 +157,8 @@ public class CheckServiceImpl implements ICheckService {
@Autowired @Autowired
private CheckInputMapper checkInputMapper; private CheckInputMapper checkInputMapper;
public static final Logger log = LoggerFactory.getLogger(CheckServiceImpl.class);
@Override @Override
public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) { public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) {
long total = checkMapper.getCheckInfoCount(param); long total = checkMapper.getCheckInfoCount(param);
...@@ -606,6 +610,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -606,6 +610,7 @@ public class CheckServiceImpl implements ICheckService {
} }
// check = checkDao.save(check); // check = checkDao.save(check);
try { try {
log.error("手机app保存巡检记录++++++++++++++++++++++" + check.toString() + "<Over><Over><Over><Over>");
check = checkDao.save(check); check = checkDao.save(check);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -733,6 +738,17 @@ public class CheckServiceImpl implements ICheckService { ...@@ -733,6 +738,17 @@ public class CheckServiceImpl implements ICheckService {
checkDao.deleteBatch(list); checkDao.deleteBatch(list);
} }
@Override
public Map<String, Object> selectCheckById(Long id) {
return checkMapper.selectCheckById(id);
}
@Override
public void delCheckByTaskId(Long id, Long checkId) {
checkMapper.delCheckByTaskId(id);
checkMapper.delCheckInputByCheckId(checkId);
}
private CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) { private CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
JSONObject jsonObject = JSONObject.parseObject(json); JSONObject jsonObject = JSONObject.parseObject(json);
String checkType = jsonObject.getString("CheckType"); String checkType = jsonObject.getString("CheckType");
......
...@@ -52,8 +52,13 @@ public interface ICheckService { ...@@ -52,8 +52,13 @@ public interface ICheckService {
* @param ids * @param ids
*/ */
@Transactional(rollbackFor = {YeeException.class, Exception.class}) @Transactional(rollbackFor = {YeeException.class, Exception.class})
void delCheckById(List<Long> ids); void delCheckById(List<Long> ids);
void delCheckByTaskId(Long id, Long checkId);
Map<String, Object> selectCheckById(Long id);
/** /**
* 获取检查结果中所有不合格检查项 * 获取检查结果中所有不合格检查项
* *
......
...@@ -741,4 +741,16 @@ ...@@ -741,4 +741,16 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="litengwei" id="20230303-12322-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_video" columnName="video_type"/>
</not>
</preConditions>
<comment>新增属性字段 video_type</comment>
<sql>
alter table `wl_video` add column `video_type` varchar(100) DEFAULT 'flv' COMMENT '视频格式: 1.flv,2.rtsp,3.hls,4.other';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
<select id="selectOilDrainage" resultType="java.util.Map"> <select id="selectOilDrainage" resultType="java.util.Map">
SELECT SELECT
wes.id, wes.id,
'1' as type , '1' as type,
(SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id (SELECT wei.emergency_level FROM wl_equipment_index wei LEFT JOIN wl_equipment_specific_index wesi on wei.id = wesi.equipment_index_id
WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level, WHERE wesi.equipment_specific_id = wes.id AND wesi.equipment_index_key = wes.realtime_iot_index_key) as level,
wes.equipment_code as code , wes.equipment_code as code ,
......
...@@ -168,6 +168,7 @@ ...@@ -168,6 +168,7 @@
`name`, `name`,
token, token,
`code`, `code`,
video_type as videoType,
preset_position preset_position
FROM wl_video wlv FROM wl_video wlv
LEFT JOIN wl_video_equipment_specific wlves ON wlv.id = wlves.video_id LEFT JOIN wl_video_equipment_specific wlves ON wlv.id = wlves.video_id
......
...@@ -64,8 +64,9 @@ ...@@ -64,8 +64,9 @@
biz_org_type = #{bizOrgType} biz_org_type = #{bizOrgType}
</if> </if>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND locate( #{bizOrgCode}, biz_org_code ) > 0 AND locate( biz_org_code, #{bizOrgCode} ) > 0
</if> </if>
</where> </where>
ORDER BY sequence_nbr
</select> </select>
</mapper> </mapper>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
wv.name as name, wv.name as name,
wv.url, wv.url,
wv.code, wv.code,
wv.video_type as videoType,
wv.preset_position as presetPosition wv.preset_position as presetPosition
from wl_supervision_video wsv left join wl_video wv on wsv.camera_id = wv.id from wl_supervision_video wsv left join wl_video wv on wsv.camera_id = wv.id
where wsv.biz_org_code like concat(#{bizOrgCode},'%'); where wsv.biz_org_code like concat(#{bizOrgCode},'%');
......
...@@ -99,6 +99,7 @@ ...@@ -99,6 +99,7 @@
v.name AS name, v.name AS name,
v.token AS token, v.token AS token,
v.url AS url, v.url AS url,
v.video_type as videoType,
v.code AS code, v.code AS code,
v.address, v.address,
v.preset_position as presetPosition v.preset_position as presetPosition
...@@ -175,6 +176,7 @@ ...@@ -175,6 +176,7 @@
vid.name as name, vid.name as name,
vid.url, vid.url,
vid.code, vid.code,
vid.video_type as videoType,
vid.preset_position as presetPosition, vid.preset_position as presetPosition,
vid.name vid.name
from wl_video_equipment_specific as ves from wl_video_equipment_specific as ves
...@@ -187,6 +189,7 @@ ...@@ -187,6 +189,7 @@
v.`code`, v.`code`,
v.url, v.url,
v.token, v.token,
v.video_type as videoType,
CONCAT_WS(' ', ws.full_name, v.address) AS address, CONCAT_WS(' ', ws.full_name, v.address) AS address,
v.img, v.img,
v.preset_position as presetPosition, v.preset_position as presetPosition,
...@@ -367,6 +370,7 @@ ...@@ -367,6 +370,7 @@
v.name AS name, v.name AS name,
v.token AS token, v.token AS token,
v.url AS url, v.url AS url,
v.video_type AS videoType,
v.code AS code, v.code AS code,
v.address, v.address,
v.preset_position as presetPosition v.preset_position as presetPosition
...@@ -418,6 +422,7 @@ ...@@ -418,6 +422,7 @@
v.id AS id, v.id AS id,
v.name AS name, v.name AS name,
v.token AS token, v.token AS token,
v.video_type AS videoType,
v.url AS url, v.url AS url,
v.code AS code, v.code AS code,
v.address, v.address,
......
...@@ -17,6 +17,7 @@ import org.springframework.context.ConfigurableApplicationContext; ...@@ -17,6 +17,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
...@@ -53,9 +54,8 @@ public class AmosJcsApplication { ...@@ -53,9 +54,8 @@ public class AmosJcsApplication {
String port = env.getProperty("server.port"); String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path")); String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
GlobalExceptionHandler.setAlwaysOk(true); GlobalExceptionHandler.setAlwaysOk(true);
logger.info("\n----------------------------------------------------------\n\t" String logs=String.format("%n----------------------------------------------------------%n Application Amos-Biz-Boot is running! Access URLs:%n Swagger文档: http:// %c : %c %c /doc.html%n----------------------------------------------------------",ip,port,path);
+ "Application Amos-Biz-Boot is running! Access URLs:\n\t" + "Swagger文档: \thttp://" + ip + ":" + port logger.info( logs);
+ path + "/doc.html\n" + "----------------------------------------------------------");
} }
/** /**
...@@ -71,13 +71,19 @@ public class AmosJcsApplication { ...@@ -71,13 +71,19 @@ public class AmosJcsApplication {
RedisTemplate redisTemplate = context.getBean("redisTemplate", RedisTemplate.class); RedisTemplate redisTemplate = context.getBean("redisTemplate", RedisTemplate.class);
RedisConnection redisConnection = null; RedisConnection redisConnection = null;
try { try {
redisConnection = redisTemplate.getConnectionFactory().getConnection(); RedisConnectionFactory redisConnectionFactory=redisTemplate.getConnectionFactory();
if(redisConnectionFactory!=null){
redisConnection = redisConnectionFactory.getConnection();
redisConnection.flushAll(); redisConnection.flushAll();
}
} catch (Exception e) { } catch (Exception e) {
logger.info("删除redis 缓存的key 失败"); logger.info("删除redis 缓存的key 失败");
} finally { } finally {
if(redisConnection!=null){
redisConnection.close(); redisConnection.close();
} }
}
} }
} }
......
...@@ -2159,4 +2159,23 @@ ...@@ -2159,4 +2159,23 @@
d.date d.date
</select> </select>
<select id="delCheckByTaskId" resultType="int">
DELETE FROM
p_check pc
WHERE pc.plan_task_id = #{taskId}
</select>
<select id="delCheckInputByCheckId" resultType="int">
DELETE FROM
p_check_input pci
WHERE pci.check_id = #{checkId}
</select>
<select id="selectCheckById" resultType="java.util.HashMap">
SELECT *
FROM
p_check pc
WHERE pc.plan_task_id = #{taskId}
</select>
</mapper> </mapper>
\ No newline at end of file
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