Commit 91d4d096 authored by maoying's avatar maoying

解决冲突

parents 10206aec 336b6fbc
...@@ -29,7 +29,8 @@ WHERE ...@@ -29,7 +29,8 @@ WHERE
biz_org_type, biz_org_type,
build_name, build_name,
build_id, build_id,
parent_id parent_id,
code
FROM FROM
cb_org_usr cb_org_usr
WHERE WHERE
......
...@@ -125,5 +125,13 @@ public class MaintenanceResourceDataDto { ...@@ -125,5 +125,13 @@ public class MaintenanceResourceDataDto {
* 位置 * 位置
*/ */
private String location; private String location;
/**
* 图片
* */
private String img;
/**
* 消防装备编码
* */
private String code;
} }
\ No newline at end of file
package com.yeejoin.equipmanage.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.common.vo
* @ClassName: VideoImportantEquipmentVo
* @Author: Jianqiang Gao
* @Description: VideoImportantEquipmentVo
* @Date: 2022/6/16 10:36
* @Version: 1.0
*/
@Data
@ApiModel(value = "VideoImportantEquipmentVo对象", description = "")
public class VideoImportantEquipmentVo {
@ApiModelProperty(value = "视频id")
private Long videoId;
@ApiModelProperty(value = "f_equipment表id(重点设备id)")
private Long importantEquipmentId;
@ApiModelProperty(value = "摄像机编号")
private String code;
@ApiModelProperty(value = "类型编码")
private String typeCode;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "访问url")
private String url;
@ApiModelProperty(value = "摄像机名称")
private String name;
@ApiModelProperty(value = "图片")
private String img;
@ApiModelProperty(value = "详细地址")
private String address;
}
\ No newline at end of file
...@@ -3,9 +3,13 @@ ...@@ -3,9 +3,13 @@
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper"> <mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper">
<select id="getPowerTransferList" <select id="getPowerTransferList"
resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto"> resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto">
select sequence_nbr, company_name, type, resources_num select sequence_nbr, company_name, type, resources_num,`status`
from ( from (
select ptcr.sequence_nbr, ptc.company_name, ptcr.type, ptcr.resources_num, ptcr.rec_date select ptcr.sequence_nbr, ptc.company_name, ptcr.type, ptcr.resources_num, ptcr.rec_date,
case ptcr.status
when 'executing' THEN '未完成'
when 'finished' THEN '已完成'
END AS status
from jc_power_transfer_company ptc from jc_power_transfer_company ptc
left join jc_power_transfer pt on ptc.power_transfer_id = pt.sequence_nbr left join jc_power_transfer pt on ptc.power_transfer_id = pt.sequence_nbr
right join jc_power_transfer_company_resources ptcr right join jc_power_transfer_company_resources ptcr
...@@ -13,7 +17,7 @@ ...@@ -13,7 +17,7 @@
where pt.alert_called_id = #{alertCalledId} where pt.alert_called_id = #{alertCalledId}
and ptc.is_distribution_agencies = 0 and ptc.is_distribution_agencies = 0
union all union all
select ptc.sequence_nbr, ptc.company_name, "" type, "" resources_num, ptc.rec_date select ptc.sequence_nbr, ptc.company_name, "" type, "" resources_num, ptc.rec_date,'' `status`
from jc_power_transfer_company ptc from jc_power_transfer_company ptc
left join jc_power_transfer pt on ptc.power_transfer_id = pt.sequence_nbr left join jc_power_transfer pt on ptc.power_transfer_id = pt.sequence_nbr
where pt.alert_called_id = #{alertCalledId} where pt.alert_called_id = #{alertCalledId}
......
...@@ -21,17 +21,17 @@ ...@@ -21,17 +21,17 @@
<dependency> <dependency>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId> <artifactId>easypoi-base</artifactId>
<version>3.0.3</version> <version>4.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId> <artifactId>easypoi-web</artifactId>
<version>3.0.3</version> <version>4.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId> <artifactId>easypoi-annotation</artifactId>
<version>3.0.3</version> <version>4.0.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jsoup</groupId> <groupId>org.jsoup</groupId>
......
...@@ -5,6 +5,7 @@ package com.yeejoin.amos.supervision.common.enums; ...@@ -5,6 +5,7 @@ package com.yeejoin.amos.supervision.common.enums;
*/ */
public enum PlanFrequencyEnum { public enum PlanFrequencyEnum {
NUM("次", "0", "次检查报告"),
WEEK("周", "2", "周检查报告"), WEEK("周", "2", "周检查报告"),
MONTH("月", "3", "月检查报告"), MONTH("月", "3", "月检查报告"),
QUARTER("季度", "4", "季度检查报告"); QUARTER("季度", "4", "季度检查报告");
......
...@@ -283,7 +283,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -283,7 +283,12 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public boolean saveExcel(List<KeySiteExcleDto> excelDtoList) { public boolean saveExcel(List<KeySiteExcleDto> excelDtoList) {
Map<String, String> maps = getAllBuildingIdForParentBuilingIds(excelDtoList); Map<String, String> maps = getAllBuildingIdForParentBuilingIds(excelDtoList);
List<KeySite> excelList = new ArrayList<KeySite>(); List<KeySite> excelList = new ArrayList<KeySite>();
List<OrgUsr> comDeptList = orgUsrMapper.companyTreeByUserAndType(null);
Map<String, Object> param = new HashMap<>();
param.put("bizOrgCode", null);
param.put("type", null);
List<OrgUsr> comDeptList = orgUsrMapper.companyTreeByUserAndType(param);
Map<Long, OrgUsr> comDeptMap = comDeptList.stream() Map<Long, OrgUsr> comDeptMap = comDeptList.stream()
.collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity())); .collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity()));
for (KeySiteExcleDto keySiteExcleDto : excelDtoList) { for (KeySiteExcleDto keySiteExcleDto : excelDtoList) {
......
...@@ -42,6 +42,8 @@ import java.util.*; ...@@ -42,6 +42,8 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.utils.DateTimeUtil.ISO8601_DATE_HOUR_MIN_SEC;
/** /**
* <p> * <p>
* 前端控制器 * 前端控制器
...@@ -771,18 +773,21 @@ public class TopographyController extends AbstractBaseController { ...@@ -771,18 +773,21 @@ public class TopographyController extends AbstractBaseController {
} }
List<IotDataVO> timeList = iotDatalist.stream().filter(x -> "time".equals(x.getKey())).collect(Collectors.toList()); List<IotDataVO> timeList = iotDatalist.stream().filter(x -> "time".equals(x.getKey())).collect(Collectors.toList());
List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCode(iotCode); List<EquipmentSpecificIndex> indexes = equipmentSpecificIndexMapper.getEquipmentSpeIndexByIotCode(iotCode);
if (0 <indexes.size()) { if (0 <indexes.size()) {
int j = 0; int j = 0;
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
for (int i=0; i<iotDatalist.size(); i++) {
for (int i=0; i<timeList.size(); i++) {
TopographyIotVo iotVo = new TopographyIotVo(); TopographyIotVo iotVo = new TopographyIotVo();
List<TopographyIotDataVO> lists = new ArrayList<>(); List<TopographyIotDataVO> lists = new ArrayList<>();
if (i == 0) { // if (i == 0) {
map.put(iotDatalist.get(i).getKey(), iotDatalist.get(i).getValue()); // map.put(iotDatalist.get(i).getKey(), iotDatalist.get(i).getValue());
} // }
if (map.containsKey(iotDatalist.get(i).getKey())) { // if (map.containsKey(iotDatalist.get(i).getKey())) {
j++; // j++;
} // }
for (EquipmentSpecificIndex x : indexes) { for (EquipmentSpecificIndex x : indexes) {
if (x.getNameKey().equals(iotDatalist.get(i).getKey())) { if (x.getNameKey().equals(iotDatalist.get(i).getKey())) {
TopographyIotDataVO dataVO = new TopographyIotDataVO(); TopographyIotDataVO dataVO = new TopographyIotDataVO();
...@@ -795,10 +800,12 @@ public class TopographyController extends AbstractBaseController { ...@@ -795,10 +800,12 @@ public class TopographyController extends AbstractBaseController {
try { try {
//Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN); //Date date = DateUtils.dateParse(String.valueOf(timeList.get(j-1).getValue()), DateUtils.DATE_TIME_T_PATTERN);
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_T_PATTERN); String value = String.valueOf(timeList.get(i).getValue());
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date1=sdf.parse(String.valueOf(timeList.get(j-1).getValue())); Date date1=sdf.parse(strDate);
String time= DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC); String time= DateTimeUtil.format(date1, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
iotVo.setTime(sdf1.parse(time)); iotVo.setTime(sdf1.parse(time));
...@@ -874,11 +881,13 @@ public class TopographyController extends AbstractBaseController { ...@@ -874,11 +881,13 @@ public class TopographyController extends AbstractBaseController {
List<IotDataVO> timeList = vos.stream().filter(x -> x.getKey().equals("time")).collect(Collectors.toList()); List<IotDataVO> timeList = vos.stream().filter(x -> x.getKey().equals("time")).collect(Collectors.toList());
List<Date> dates = new ArrayList<>(); List<Date> dates = new ArrayList<>();
for (IotDataVO vo : timeList) { for (IotDataVO vo : timeList) {
SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.DATE_TIME_T_PATTERN); String value = String.valueOf(vo.getValue());
String strDate = value.substring(0, 19);
SimpleDateFormat sdf = new SimpleDateFormat(ISO8601_DATE_HOUR_MIN_SEC);
SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); SimpleDateFormat sdf1 = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
logger.info("返回时间===================================(" + vo.getValue() + ") ======================================="); logger.info("返回时间===================================(" + vo.getValue() + ") =======================================");
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date=sdf.parse(String.valueOf(vo.getValue())); Date date=sdf.parse(strDate);
// String time= sdf.format(date); // String time= sdf.format(date);
String time= DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC); String time= DateTimeUtil.format(date, DateTimeUtil.ISO_DATE_HOUR24_MIN_SEC);
......
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @ProjectName: amos-biz-boot
* @Package: com.yeejoin.equipmanage.controller
* @ClassName: VideoImportantEquipmentController
* @Author: Jianqiang Gao
* @Description: VideoImportantEquipmentController
* @Date: 2022/6/16 10:24
* @Version: 1.0
*/
@RestController
@Api(tags = "视屏监控关联重点设备Api")
@Slf4j
@RequestMapping(value = "/videoImportantEquipment", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class VideoImportantEquipmentController {
@Autowired
private IVideoImportantEquipmentService videoImportantEquipmentService;
@RequestMapping(value = "/getVideoImportantEquipmentList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取视屏监控关联重点设备集合", notes = "获取视屏监控关联重点设备集合")
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(@RequestParam(required = false) Long importantEquipmentId) {
Map<String, Object> map = null;
if (importantEquipmentId != null) {
map = new HashMap<>();
map.put("importantEquipmentId", importantEquipmentId);
}
return videoImportantEquipmentService.getVideoImportantEquipmentList(map);
}
}
\ No newline at end of file
...@@ -2,8 +2,12 @@ package com.yeejoin.equipmanage.mapper; ...@@ -2,8 +2,12 @@ package com.yeejoin.equipmanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/25 15:48 * @date 2020/11/25 15:48
...@@ -11,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -11,4 +15,5 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> { public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
} }
...@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.service; ...@@ -2,6 +2,10 @@ package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import java.util.List;
import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -9,4 +13,5 @@ import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; ...@@ -9,4 +13,5 @@ import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
* @since v2.0 * @since v2.0
*/ */
public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> { public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
} }
...@@ -342,7 +342,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou ...@@ -342,7 +342,7 @@ public class MaintenanceResourceServiceImpl extends ServiceImpl<MaintenanceResou
resourceDataVo.setMaintenanceCompanyId(x.getMaintenanceUnitId()); resourceDataVo.setMaintenanceCompanyId(x.getMaintenanceUnitId());
resourceDataVo.setMaintenanceCompanyName(x.getMaintenanceUnit()); resourceDataVo.setMaintenanceCompanyName(x.getMaintenanceUnit());
resourceDataVo.setCreateDate(x.getRecDate()); resourceDataVo.setCreateDate(x.getRecDate());
resourceDataVo.setLocation(x.getBelongBuilding()); // resourceDataVo.setLocation(x.getBelongBuilding()); //覆盖了正确的值
resourceDataVo.setFireFacilityCode(x.getEquipCode()); resourceDataVo.setFireFacilityCode(x.getEquipCode());
resourceDataVoList.add(resourceDataVo); resourceDataVoList.add(resourceDataVo);
keyList.add(String.join("-", String.valueOf(sequenceNbr), resourceType)); keyList.add(String.join("-", String.valueOf(sequenceNbr), resourceType));
......
...@@ -2,10 +2,15 @@ package com.yeejoin.equipmanage.service.impl; ...@@ -2,10 +2,15 @@ package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment; import com.yeejoin.equipmanage.common.entity.VideoImportantEquipment;
import com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo;
import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper; import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/** /**
* @author ZeHua Li * @author ZeHua Li
* @date 2020/11/25 15:49 * @date 2020/11/25 15:49
...@@ -13,4 +18,12 @@ import org.springframework.stereotype.Service; ...@@ -13,4 +18,12 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImportantEquipmentMapper,VideoImportantEquipment> implements IVideoImportantEquipmentService { public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImportantEquipmentMapper,VideoImportantEquipment> implements IVideoImportantEquipmentService {
@Autowired
private VideoImportantEquipmentMapper videoImportantEquipmentMapper;
@Override
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map) {
return videoImportantEquipmentMapper.getVideoImportantEquipmentList(map);
}
} }
...@@ -127,9 +127,9 @@ public class AlertCalledController extends BaseController { ...@@ -127,9 +127,9 @@ public class AlertCalledController extends BaseController {
List<AlertFormValue> alertFormValue = alertCalledObjsDto.getAlertFormValue(); List<AlertFormValue> alertFormValue = alertCalledObjsDto.getAlertFormValue();
alertFormValue.forEach(e -> { alertFormValue.forEach(e -> {
if (e.getFieldCode().equals(ALETR_TYPE_AID_STATUS)) { if (e.getFieldCode().equals(ALETR_TYPE_AID_STATUS)) {
if (e.getFieldValueCode() != null) { if (e.getFieldValue() != null) {
if (e.getFieldValueCode().contains(",")) { if (e.getFieldValue().contains(",")) {
String[] split = e.getFieldValueCode().split(","); String[] split = e.getFieldValue().split(",");
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < split.length; i++) { for (int i = 0; i < split.length; i++) {
DataDictionary hzxz = dataDictionaryService.getByCode(split[i], "HZXZ"); DataDictionary hzxz = dataDictionaryService.getByCode(split[i], "HZXZ");
...@@ -137,7 +137,7 @@ public class AlertCalledController extends BaseController { ...@@ -137,7 +137,7 @@ public class AlertCalledController extends BaseController {
e.setFieldValue(stringBuilder.toString()); e.setFieldValue(stringBuilder.toString());
} }
} else { } else {
DataDictionary hzxz = dataDictionaryService.getByCode(e.getFieldValueCode(), "HZXZ"); DataDictionary hzxz = dataDictionaryService.getByCode(e.getFieldValue(), "HZXZ");
e.setFieldValue(hzxz.getName()); e.setFieldValue(hzxz.getName());
} }
} }
......
...@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonSer ...@@ -35,6 +35,7 @@ import com.yeejoin.amos.boot.module.command.biz.service.impl.FrontlineLiaisonSer
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService; import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.jcs.api.entity.*; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.UserCarMapper;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xwpf.usermodel.XWPFTable; import org.apache.poi.xwpf.usermodel.XWPFTable;
...@@ -216,6 +217,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -216,6 +217,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired @Autowired
JcSituationDetailMapper jcSituationDetailMapper; JcSituationDetailMapper jcSituationDetailMapper;
@Autowired
UserCarMapper userCarMapper;
@Value("${mqtt.topic.command.alert.noticeJa}") @Value("${mqtt.topic.command.alert.noticeJa}")
private String topicJa; private String topicJa;
...@@ -577,21 +581,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -577,21 +581,21 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) { if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN)); besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情初报.getCode(),besidesMap,smsParams,usIds, null);
} else { } else {
if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) { if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN)); besidesMap.put("sendTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情续报.getCode(),besidesMap,smsParams,usIds, null);
} }
if(alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) { if(alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) {
besidesMap.put("startTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN)); besidesMap.put("startTime", DateUtils.dateFormat(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
besidesMap.put("endTime", DateUtils.dateFormat(alertCalled.getRecDate(), DateUtils.DATE_TIME_PATTERN)); besidesMap.put("endTime", DateUtils.dateFormat(alertCalled.getRecDate(), DateUtils.DATE_TIME_PATTERN));
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情结案.getCode(),besidesMap,smsParams,usIds); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.警情结案.getCode(),besidesMap,smsParams,usIds, null);
} }
if(alertWay.equals(AlertBusinessTypeEnum.非警情确认.getCode())) { if(alertWay.equals(AlertBusinessTypeEnum.非警情确认.getCode())) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.非警情确认.getCode(),besidesMap,smsParams,usIds); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.非警情确认.getCode(),besidesMap,smsParams,usIds, null);
} }
alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams);
...@@ -1446,6 +1450,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1446,6 +1450,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
instructionsZHDto.setSequenceNbr(item.getSequenceNbr()); instructionsZHDto.setSequenceNbr(item.getSequenceNbr());
instructionsZHDto.setType(item.getInfoType()); instructionsZHDto.setType(item.getInfoType());
instructionsZHDto.setContent(item.getInfo()); instructionsZHDto.setContent(item.getInfo());
if ("车辆反馈".equals(item.getInfoType())) {
instructionsZHDto.setCompany("现场反馈");
}
instructionsZHDto.setSubmissionTime(item.getRecDate()); instructionsZHDto.setSubmissionTime(item.getRecDate());
listInstructionsZHDto.add(instructionsZHDto); listInstructionsZHDto.add(instructionsZHDto);
}); });
...@@ -1623,6 +1630,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1623,6 +1630,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
List<PowerTransferCompanyResourcesDto> list = powerDto List<PowerTransferCompanyResourcesDto> list = powerDto
.getPowerTransferCompanyResourcesDtoList(); .getPowerTransferCompanyResourcesDtoList();
// 查询已绑定车辆人员id
List<UserCar> userCars = userCarMapper.selectList(new QueryWrapper<UserCar>().lambda().eq(UserCar::getIsDelete, false));
List<Long> userIds = userCars.stream().map(UserCar::getAmosUserId).collect(Collectors.toList());
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (PowerTransferCompanyResourcesDto i : list) { for (PowerTransferCompanyResourcesDto i : list) {
String carName = i.getResourcesName(); String carName = i.getResourcesName();
...@@ -1660,9 +1670,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1660,9 +1670,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
}; };
userList=new ArrayList<String>(); userList=new ArrayList<String>();
// 车辆绑定人发送的是待办任务
if(!ValidationUtil.isEmpty(map.get("amosId"))) { if(!ValidationUtil.isEmpty(map.get("amosId"))) {
if (!CollectionUtils.isEmpty(userIds)){
if (userIds.contains(Long.valueOf(map.get("amosId").toString()))){
Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString);
besidesMap.put("alterId", alertCalledId);
ArrayList<String> strings = new ArrayList<>();
strings.add(map.get("amosId").toString());
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,strings, RuleConstant.TASK);
}else {
userList.add(map.get("amosId").toString()); userList.add(map.get("amosId").toString());
} }
}else {
userList.add(map.get("amosId").toString());
}
}
alertSubmittedObjectSub.setUserPhone(map.get("mobilePhone").toString()); alertSubmittedObjectSub.setUserPhone(map.get("mobilePhone").toString());
} }
alertSubmittedObjectListSub.add(alertSubmittedObjectSub); alertSubmittedObjectListSub.add(alertSubmittedObjectSub);
...@@ -1673,7 +1697,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1673,7 +1697,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
besidesMap.put("responseLevelString", responseLevelString); besidesMap.put("responseLevelString", responseLevelString);
besidesMap.put("alterId", alertCalledId); besidesMap.put("alterId", alertCalledId);
if(userList.size()>0) { if(userList.size()>0) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS,
...@@ -1683,14 +1707,31 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1683,14 +1707,31 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} }
String resourcesNumStr = resourcesNum.toString(); String resourcesNumStr = resourcesNum.toString();
List<String> userList= new ArrayList<String>(); List<String> userList= new ArrayList<String>();
ArrayList<String> taskUserIds = new ArrayList<>();
sendUserIds.stream().forEach(i -> { sendUserIds.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey("mobilePhone")) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get("mobilePhone").toString());
} }
if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) { if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) {
if (!CollectionUtils.isEmpty(userIds)){
if (userIds.contains(Long.valueOf(i.get("amosId").toString()))){
taskUserIds.add(i.get("amosId").toString());
}else {
userList.add(i.get("amosId").toString());
}
}else {
userList.add(i.get("amosId").toString()); userList.add(i.get("amosId").toString());
} }
}
}); });
// 车辆绑定人发送的是待办任务
if (!CollectionUtils.isEmpty(taskUserIds)){
Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("responseLevelString", responseLevelString);//响应级别
besidesMap.put("alterId", alertCalledId);
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds, RuleConstant.TASK);
}
smsParams.put("resourcesNum", resourcesNumStr); smsParams.put("resourcesNum", resourcesNumStr);
// 短信报送对象 // 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); // alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
...@@ -1705,7 +1746,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1705,7 +1746,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
besidesMap.put("responseLevelString", responseLevelString);//响应级别 besidesMap.put("responseLevelString", responseLevelString);//响应级别
besidesMap.put("alterId", alertCalledId); besidesMap.put("alterId", alertCalledId);
if(userList.size()>0) { if(userList.size()>0) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
...@@ -1717,7 +1758,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1717,7 +1758,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
public void ruleCallbackActionForPowerTransferForSurvBrigade(String smsCode, List sendIds, Object object, List<String> pList) throws MqttPersistenceException, MqttException { public void ruleCallbackActionForPowerTransferForSurvBrigade(String smsCode, List sendIds, Object object, List<String> pList) throws MqttPersistenceException, MqttException {
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
// 查询已绑定车辆人员id
List<UserCar> userCars = userCarMapper.selectList(new QueryWrapper<UserCar>().lambda().eq(UserCar::getIsDelete, false));
List<Long> userCarIds = userCars.stream().map(UserCar::getAmosUserId).collect(Collectors.toList());
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null; String alertCalledId = null;
...@@ -1796,14 +1839,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1796,14 +1839,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
List<String> userList= new ArrayList<String>(); List<String> userList= new ArrayList<String>();
ArrayList<String> taskUserIds = new ArrayList<>();
sendUserIds.stream().forEach(i -> { sendUserIds.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey("mobilePhone")) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get("mobilePhone").toString());
} }
if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) { if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) {
if (!CollectionUtils.isEmpty(userCarIds)){
if (userCarIds.contains(Long.valueOf(i.get("amosId").toString()))){
taskUserIds.add(i.get("amosId").toString());
}else {
userList.add(i.get("amosId").toString());
}
}else {
userList.add(i.get("amosId").toString()); userList.add(i.get("amosId").toString());
} }
}
}); });
// 绑定车辆人员发送的是待办消息
if (!CollectionUtils.isEmpty(taskUserIds)){
Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId);
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds,RuleConstant.TASK);
}
smsParams.put("resourcesNum", companyName); smsParams.put("resourcesNum", companyName);
// 短信报送对象 // 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); // alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
...@@ -1818,7 +1877,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1818,7 +1877,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId); besidesMap.put("alterId", alertCalledId);
if(userList.size()>0) { if(userList.size()>0) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList,null);
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
...@@ -1830,7 +1889,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1830,7 +1889,9 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
public void ruleCallbackActionForPowerTransferForAid(String smsCode, List sendIds, Object object, List<String> pList) throws MqttPersistenceException, MqttException { public void ruleCallbackActionForPowerTransferForAid(String smsCode, List sendIds, Object object, List<String> pList) throws MqttPersistenceException, MqttException {
// 查询已绑定车辆人员id
List<UserCar> userCars = userCarMapper.selectList(new QueryWrapper<UserCar>().lambda().eq(UserCar::getIsDelete, false));
List<Long> userCarIds = userCars.stream().map(UserCar::getAmosUserId).collect(Collectors.toList());
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
...@@ -1916,14 +1977,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1916,14 +1977,30 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
List<String> userList= new ArrayList<String>(); List<String> userList= new ArrayList<String>();
List<String> taskUserIds= new ArrayList<String>();
sendUserIds.stream().forEach(i -> { sendUserIds.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey("mobilePhone")) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get("mobilePhone").toString());
} }
if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) { if (i.containsKey("amosId")&& !ValidationUtil.isEmpty(i.get("amosId"))) {
if (!CollectionUtils.isEmpty(userCarIds)){
if (userCarIds.contains(Long.valueOf(i.get("amosId").toString()))){
taskUserIds.add(i.get("amosId").toString());
}else {
userList.add(i.get("amosId").toString()); userList.add(i.get("amosId").toString());
} }
}else {
userList.add(i.get("amosId").toString());
}
}
}); });
// 绑定车辆人员发送的是待办消息
if (CollectionUtils.isEmpty(taskUserIds)){
Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId);
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,taskUserIds, RuleConstant.TASK);
}
smsParams.put("resourcesNum", companyName); smsParams.put("resourcesNum", companyName);
// 短信报送对象 // 短信报送对象
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); // alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
...@@ -1938,7 +2015,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1938,7 +2015,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Map<String, String> besidesMap = new HashMap<String, String>(); Map<String, String> besidesMap = new HashMap<String, String>();
besidesMap.put("alterId", alertCalledId); besidesMap.put("alterId", alertCalledId);
if(userList.size()>0) { if(userList.size()>0) {
pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList); pushPowerTransferToAppAndWeb(AlertBusinessTypeEnum.力量调派.getCode(),besidesMap,smsParams,userList, null);
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
...@@ -1952,13 +2029,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1952,13 +2029,17 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* @throws MqttPersistenceException * @throws MqttPersistenceException
* @throws MqttException * @throws MqttException
*/ */
public void pushPowerTransferToAppAndWeb(String type,Map<String, String> besidesMap, HashMap<String, String> smsParams, List<String> userList){ public void pushPowerTransferToAppAndWeb(String type,Map<String, String> besidesMap, HashMap<String, String> smsParams, List<String> userList, Integer messageType){
PushMessageWebAndAppRo pushMessageWebAndAppRo = new PushMessageWebAndAppRo(); PushMessageWebAndAppRo pushMessageWebAndAppRo = new PushMessageWebAndAppRo();
pushMessageWebAndAppRo.setRelationId(besidesMap.get("alterId")); pushMessageWebAndAppRo.setRelationId(besidesMap.get("alterId"));
pushMessageWebAndAppRo.setRecivers(userList); pushMessageWebAndAppRo.setRecivers(userList);
// pushMessageWebAndAppRo.setCategory(RuleConstant.NOTIFY); // 默认发送消息通知,力量调派车辆绑定人发送待办任务。
if (null != messageType){
pushMessageWebAndAppRo.setCategory(RuleConstant.TASK); pushMessageWebAndAppRo.setCategory(RuleConstant.TASK);
}else {
pushMessageWebAndAppRo.setCategory(RuleConstant.NOTIFY);
}
pushMessageWebAndAppRo.setIsSendApp(true); pushMessageWebAndAppRo.setIsSendApp(true);
pushMessageWebAndAppRo.setIsSendWeb(true); pushMessageWebAndAppRo.setIsSendWeb(true);
pushMessageWebAndAppRo.setRuleType(type); pushMessageWebAndAppRo.setRuleType(type);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.core.util.StrUtil;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto; import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.JcSituationDetail;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.UserCar;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.JcSituationDetailMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResourcesMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyResourcesService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyResourcesService;
import com.yeejoin.amos.boot.module.jcs.api.service.IUserCarService;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -19,6 +29,7 @@ import java.text.SimpleDateFormat; ...@@ -19,6 +29,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
/** /**
* 调派单位资源 服务实现类 * 调派单位资源 服务实现类
...@@ -33,6 +44,21 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -33,6 +44,21 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
@Autowired
JcSituationDetailMapper jcSituationDetailMapper;
@Autowired
private EmqKeeper emqKeeper;
@Autowired
private IUserCarService userCarService;
@Autowired
private IFireTeamService fireTeamService;
@Value("${mqtt.topic.command.power.deployment}")
private String topic;
@Override @Override
public AlertCalled getByPowerTransferCompanyResourId(Long id) { public AlertCalled getByPowerTransferCompanyResourId(Long id) {
...@@ -63,6 +89,8 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -63,6 +89,8 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
public void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks) { public void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks) {
PowerTransferCompanyResources powerTransferCompanyResources = powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId, carId); PowerTransferCompanyResources powerTransferCompanyResources = powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId, carId);
UserCar userCar = userCarService.selectByCarId(carId);
FireTeam fireTeam = fireTeamService.getFireTeamBySequenceNbr(Long.valueOf(userCar.getTeamId()));
try { try {
if (type == 2) { if (type == 2) {
...@@ -86,6 +114,17 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -86,6 +114,17 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
powerTransferCompanyResources.setRemarks(remarks); powerTransferCompanyResources.setRemarks(remarks);
powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources); powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources);
} }
String carInfo = "车辆信息(" + fireTeam.getName() + " + " + powerTransferCompanyResources.getResourcesName() + " + " + powerTransferCompanyResources.getResourcesNum() + "):";
String info = "";
info = StrUtil.isNotBlank(remarks) ? carInfo + remarks + " + " + Objects.requireNonNull(FireCarStatusEnum.getEnum(code)).getName() : carInfo + Objects.requireNonNull(FireCarStatusEnum.getEnum(code)).getName();
JcSituationDetail jcSituationDetail = new JcSituationDetail();
jcSituationDetail.setAlertCalledId(alertCalledId);
jcSituationDetail.setInfoType("车辆反馈");
jcSituationDetail.setInfo(info);
jcSituationDetailMapper.insert(jcSituationDetail);
// 车辆状态更改消息推送
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, false);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("修改失败!"); throw new RuntimeException("修改失败!");
} }
......
...@@ -276,12 +276,14 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -276,12 +276,14 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName()); fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName());
} else { } else {
if (appleMap != null) { if (appleMap != null) {
String state = appleMap.containsKey(car.get("id")) ? appleMap.get(car.get("id")) : null; //bug: 6268
String state = appleMap.containsKey(car.get("id")) ? appleMap.get(car.get("id")) : FireCarStatusEnum.执勤.getCode();
fireCarDto.setCarState(state); fireCarDto.setCarState(state);
fireCarDto.setCarStateDesc(state != null ? FireCarStatusEnum.getEnum(state).getName() : null); fireCarDto.setCarStateDesc(state != null ? FireCarStatusEnum.getEnum(state).getName() : null);
} else { } else {
fireCarDto.setCarState(null); //bug: 6268
fireCarDto.setCarStateDesc(null); fireCarDto.setCarState(FireCarStatusEnum.执勤.getCode());
fireCarDto.setCarStateDesc(FireCarStatusEnum.执勤.getName());
} }
} }
......
...@@ -370,6 +370,13 @@ public class LatentDangerController extends BaseController { ...@@ -370,6 +370,13 @@ public class LatentDangerController extends BaseController {
return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerLevel())); return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerLevel()));
} }
@ApiOperation(value = "获取所有隐患等级名称", notes = "获取所有隐患等级名称")
@GetMapping(value = "/all/dangerLevelName")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getAllDangerLevelName() {
return ResponseHelper.buildResponse((iLatentDangerService.getAllDangerLevelName()));
}
@ApiOperation(value = "获取所有隐患整改方式", notes = "获取所有隐患整改方式") @ApiOperation(value = "获取所有隐患整改方式", notes = "获取所有隐患整改方式")
@GetMapping(value = "/all/dangerGovernance") @GetMapping(value = "/all/dangerGovernance")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.latentdanger.business.service.impl; package com.yeejoin.amos.latentdanger.business.service.impl;
import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo; import static com.yeejoin.amos.latentdanger.business.util.RandomUtil.buildOrderNo;
import static com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum.patrolDangerLevelEnumMap;
import static com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum.supervisionDangerLevelEnumMap;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct; import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -1893,7 +1885,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1893,7 +1885,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
}); });
} }
if (bizTypeSet.contains("patrol")) { if (bizTypeSet.contains("patrol")) {
LatentDangerLevelEnum.patrolDangerLevelEnumMap.forEach((code, e) -> { patrolDangerLevelEnumMap.forEach((code, e) -> {
Map<String, String> l = Maps.newHashMap(); Map<String, String> l = Maps.newHashMap();
l.put("code", code); l.put("code", code);
l.put("name", e.getName()); l.put("name", e.getName());
...@@ -1904,6 +1896,23 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1904,6 +1896,23 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
} }
@Override @Override
public Set<String> getAllDangerLevelName() {
Set<String> levelList = new HashSet<>();
Set<String> bizTypeSet = getBizTypeSet();
if (bizTypeSet.contains("supervision")) {
LatentDangerLevelEnum.supervisionDangerLevelEnumMap.forEach((code, e) -> {
levelList.add(e.getName());
});
}
if (bizTypeSet.contains("patrol")) {
patrolDangerLevelEnumMap.forEach((code, e) -> {
levelList.add(e.getName());
});
}
return levelList;
}
@Override
public List<Map<String, String>> getAllDangerGovernance() { public List<Map<String, String>> getAllDangerGovernance() {
List<Map<String, String>> governanceList = Lists.newArrayList(); List<Map<String, String>> governanceList = Lists.newArrayList();
Set<String> bizTypeSet = getBizTypeSet(); Set<String> bizTypeSet = getBizTypeSet();
...@@ -2049,6 +2058,22 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2049,6 +2058,22 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
@Override @Override
public IPage<LatentDanger> pageListDanger(PageParam pageParam, String userId) throws Exception { public IPage<LatentDanger> pageListDanger(PageParam pageParam, String userId) throws Exception {
if (pageParam.containsKey("dangerLevelName")) {
List<String> dangerLevelList = new ArrayList<>();
Collection<LatentDangerLevelEnum> values1 = patrolDangerLevelEnumMap.values();
values1.stream().forEach(item -> {
if (item.getName().equals(pageParam.get("dangerLevelName"))) {
dangerLevelList.add(item.getCode());
}
});
Collection<LatentDangerLevelEnum> values = supervisionDangerLevelEnumMap.values();
values.stream().forEach(item -> {
if (item.getName().equals(pageParam.get("dangerLevelName"))) {
dangerLevelList.add(item.getCode());
}
});
pageParam.put("dangerLevelList", dangerLevelList);
}
List allTaskList; List allTaskList;
String idsStr = (String) pageParam.get("dangerIds"); String idsStr = (String) pageParam.get("dangerIds");
List<String> dangerIdList = Lists.newArrayList(); List<String> dangerIdList = Lists.newArrayList();
......
...@@ -157,6 +157,13 @@ public interface ILatentDangerService { ...@@ -157,6 +157,13 @@ public interface ILatentDangerService {
List<Map<String, String>> getAllDangerLevel(); List<Map<String, String>> getAllDangerLevel();
/** /**
* 获取多个业务的隐患等级名称
*
* @return
*/
Set<String> getAllDangerLevelName();
/**
* 获取多个业务的隐患治理方式 * 获取多个业务的隐患治理方式
* *
* @return * @return
......
...@@ -498,12 +498,20 @@ public class CheckController extends AbstractBaseController { ...@@ -498,12 +498,20 @@ public class CheckController extends AbstractBaseController {
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId, @ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "设施Id") @RequestParam(value = "equipId", required = false) String equipId, @ApiParam(value = "设施Id") @RequestParam(value = "equipId", required = false) String equipId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber, @ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception { @ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize,
@ApiParam(value = "qrCode") @RequestParam(value = "qrCode", required = false) String qrCode) throws Exception {
HashMap<String, Object> params = new HashMap<>(); HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity()); Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
params.putAll(authMap); params.putAll(authMap);
params.put("person", person);
if (StringUtil.isNotEmpty(person)) {
ResponseModel<String> idByAmosOrgId = jcsFeignClient.getIdByAmosOrgId(person);
if (StringUtil.isNotEmpty(idByAmosOrgId.getResult())) {
params.put("person", idByAmosOrgId.getResult());
}
}
params.put("userId", userId); params.put("userId", userId);
if (StringUtil.isNotEmpty(userId)) { if (StringUtil.isNotEmpty(userId)) {
ResponseModel<String> idByAmosOrgId = jcsFeignClient.getIdByAmosOrgId(userId); ResponseModel<String> idByAmosOrgId = jcsFeignClient.getIdByAmosOrgId(userId);
...@@ -518,10 +526,10 @@ public class CheckController extends AbstractBaseController { ...@@ -518,10 +526,10 @@ public class CheckController extends AbstractBaseController {
} }
params.put("beginTime", beginTime); params.put("beginTime", beginTime);
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("person", person);
params.put("companyId", companyId); params.put("companyId", companyId);
params.put("equipId", equipId); params.put("equipId", equipId);
params.put("orgCode", loginOrgCode); params.put("orgCode", loginOrgCode);
params.put("qrCode", qrCode);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize); CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(checkService.getCheckPage(params, pageable)); return CommonResponseUtil.success(checkService.getCheckPage(params, pageable));
} }
......
...@@ -361,7 +361,7 @@ public class InputItemController extends AbstractBaseController { ...@@ -361,7 +361,7 @@ public class InputItemController extends AbstractBaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/downTemplate") @GetMapping(value = "/downTemplate")
@ApiOperation(httpMethod = "POST", value = "下载模板", notes = "下载模板") @ApiOperation(httpMethod = "GET", value = "下载模板", notes = "下载模板")
public void downTemplate(HttpServletResponse response) { public void downTemplate(HttpServletResponse response) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
List<InputItemTemplateVo> inputItemTemplateVoList = new ArrayList<>(); List<InputItemTemplateVo> inputItemTemplateVoList = new ArrayList<>();
......
...@@ -182,6 +182,24 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -182,6 +182,24 @@ public class PlanTaskController extends AbstractBaseController {
} }
/** /**
* 模拟发送维保待办任务消息定时任务
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "模拟发送维保待办任务消息定时任务", notes = "模拟发送维保待办任务消息定时任务")
@RequestMapping(value = "/taskMessage", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse taskMessage(@ApiParam(value = "跑批日期格式yyyyMMdd", required = false) @RequestParam(required = false) String runDate) {
try {
planTaskService.taskMessage(runDate);
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure();
}
}
/**
* 查询任务列表 * 查询任务列表
* *
* @param * @param
......
...@@ -181,7 +181,7 @@ public class RouteController extends AbstractBaseController { ...@@ -181,7 +181,7 @@ public class RouteController extends AbstractBaseController {
//2.查询 //2.查询
List<Route> routeList; List<Route> routeList;
if (null != orgCode && 0 == orgCode) { if (null != orgCode && 0 == orgCode) {
routeList = routeService.queryRouteList(ownerId, null); routeList = routeService.queryRouteList(ownerId, org);
} else { } else {
routeList = routeService.queryRouteList(ownerId, org); routeList = routeService.queryRouteList(ownerId, org);
} }
......
package com.yeejoin.amos.maintenance.business.dao.mapper; package com.yeejoin.amos.maintenance.business.dao.mapper;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.maintenance.dao.entity.Plan;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo; import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
...@@ -186,4 +188,7 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -186,4 +188,7 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> statisticsTaskWithAuth(Map<String, Object> param); List<Map<String, Object>> statisticsTaskWithAuth(Map<String, Object> param);
List<Plan> getPlanIdsByDate(Date date);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum; import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
...@@ -32,6 +33,7 @@ import com.yeejoin.amos.maintenance.exception.YeeException; ...@@ -32,6 +33,7 @@ import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService; import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import com.yeejoin.amos.maintenance.quartz.IJobService; import com.yeejoin.amos.maintenance.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.tomcat.jni.Time;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -86,6 +88,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -86,6 +88,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
JCSFeignClient jcsFeignClient; JCSFeignClient jcsFeignClient;
@Autowired
RedisUtils redisUtils;
private final String MAINTENANCE_PLAN_TASK_KEY = "MAINTENANCE_PLAN_ID:";
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) { public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
long total = planTaskMapper.countPlanTask(params); long total = planTaskMapper.countPlanTask(params);
...@@ -254,6 +261,32 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -254,6 +261,32 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
return bigDecimal.compareTo(bigDecimal1) <= 0 && bigDecimal.compareTo(new BigDecimal(0)) >= 0; return bigDecimal.compareTo(bigDecimal1) <= 0 && bigDecimal.compareTo(new BigDecimal(0)) >= 0;
} }
//bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
@Override
@Transactional
public void taskMessage(String runDate) {
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
//1.扫描plan表查询,需要生成执行数据的任务信息,无则return
Date now = new Date();//今天
String format = df.format(now);
if (runDate != null) {//上送则已上送的为准
runDate = runDate + " " + format;
now = DateUtil.str2Date(runDate, "yyyyMMdd HH:mm:ss");
}
List<Plan> planIdsByDate = planTaskMapper.getPlanIdsByDate(now);
for (Plan plan : planIdsByDate) {
if (!redisUtils.hasKey(MAINTENANCE_PLAN_TASK_KEY + plan.getId())) {
try {
sendMessage(plan);
} catch (Exception e) {
e.printStackTrace();
}
redisUtils.set(MAINTENANCE_PLAN_TASK_KEY + plan.getId(), 1, (long) plan.getDuration() * 60);
}
}
}
/** /**
* 自动任务执行 * 自动任务执行
*/ */
...@@ -273,23 +306,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -273,23 +306,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
log.info(strDate + " " + " 暂无待生成执行数据的计划"); log.info(strDate + " " + " 暂无待生成执行数据的计划");
return; return;
} }
// //bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
// List<Plan> planListTwo = new ArrayList<>();
// //将日期格式化
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
// LocalTime nowTime = LocalTime.parse(simpleDateFormat.format(new Date()));
// for (Plan plan : planList) {
// LocalTime dayTime = LocalTime.parse(plan.getDayTime());
//// LocalTime plusHoursTime = dayTime.plusHours(1);
// if (getTimeDifference(nowTime, dayTime)) {
// planListTwo.add(plan);
// }
// }
// if (planListTwo == null || planListTwo.size() <= 0) {
// log.info(strDate + " " + " 暂无待生成执行数据的计划 (更改后,只执行进行中的数据)");
// return;
// }
// planList = planListTwo;
//2.循环遍历执行 //2.循环遍历执行
HashMap<String, Object> paramMap = new HashMap<String, Object>(); HashMap<String, Object> paramMap = new HashMap<String, Object>();
for (Plan plan : planList) { for (Plan plan : planList) {
...@@ -478,7 +494,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -478,7 +494,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
} }
sendMessage(plan); //bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
//(重写定时任务去发送消息)
// sendMessage(plan);
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); jobService.planTaskAddJob(planTask);
} }
......
...@@ -37,6 +37,13 @@ public interface IPlanTaskService { ...@@ -37,6 +37,13 @@ public interface IPlanTaskService {
List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam params); List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam params);
/** /**
* 定时任务发送消息执行中的消息
*
* @param runDate
*/
void taskMessage(String runDate);
/**
* 自动任务执行 * 自动任务执行
* *
* @param runDate * @param runDate
......
...@@ -24,4 +24,12 @@ public class PlanTaskJob { ...@@ -24,4 +24,12 @@ public class PlanTaskJob {
public void scheduleJob() { public void scheduleJob() {
planTaskService.taskExecution(null); planTaskService.taskExecution(null);
} }
/**
* 定时任务推送维保待办任务消息
*/
@Scheduled(cron = "${jobs.cron}")
public void taskMessage() {
planTaskService.taskMessage(null);
}
} }
...@@ -220,6 +220,32 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -220,6 +220,32 @@ public class PlanTaskController extends AbstractBaseController {
} }
/** /**
* 定时任务推送巡检待办任务消息
*/
@Scheduled(cron = "${jobs.cron}")
public void taskMessage() {
planTaskService.taskMessage(null);
}
/**
* 模拟发送巡检待办任务消息定时任务
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "模拟发送巡检待办任务消息定时任务", notes = "模拟发送巡检待办任务消息定时任务")
@RequestMapping(value = "/taskMessage", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse taskMessage(@ApiParam(value = "跑批日期格式yyyyMMdd", required = false) @RequestParam(required = false) String runDate) {
try {
planTaskService.taskMessage(runDate);
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure();
}
}
/**
* 模拟定时任务调起服务 * 模拟定时任务调起服务
* *
* @return * @return
......
package com.yeejoin.amos.patrol.business.dao.mapper; package com.yeejoin.amos.patrol.business.dao.mapper;
import java.util.Date;
import java.util.HashMap; 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.Plan;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.patrol.business.entity.mybatis.CheckChkExListBo; import com.yeejoin.amos.patrol.business.entity.mybatis.CheckChkExListBo;
...@@ -185,5 +187,7 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -185,5 +187,7 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> queryTimeAxis(HashMap<String, Object> params); List<Map<String, Object>> queryTimeAxis(HashMap<String, Object> params);
List<Plan> getPlanIdsByDate(@Param("date") Date date);
List<PlanTask> getPlanTaskList(@Param("date") Date date);
} }
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.constants.RuleConstant; import com.yeejoin.amos.boot.biz.common.constants.RuleConstant;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
...@@ -116,6 +117,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -116,6 +117,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
private RuleTrigger ruleTrigger; private RuleTrigger ruleTrigger;
@Autowired
RedisUtils redisUtils;
private final String PATROL_PLAN_TASK_KEY = "PATROL_PLAN_ID:";
private final String packageId = "消息/addCheckRule"; private final String packageId = "消息/addCheckRule";
private final String msgType = "patrolSystem"; private final String msgType = "patrolSystem";
private final String APP = "APP"; private final String APP = "APP";
...@@ -713,8 +719,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -713,8 +719,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTask.setEndTime(endTime); planTask.setEndTime(endTime);
// 1.保存执行数据主表 // 1.保存执行数据主表
iplanTaskDao.saveAndFlush(planTask); iplanTaskDao.saveAndFlush(planTask);
// 发送APP待办消息 // 发送APP待办消息 (20220617 改为定时任务发送消息)
sendMessage(plan, planTask); // sendMessage(plan, planTask);
String executorId = planTask.getUserId(); String executorId = planTask.getUserId();
long planId = planTask.getId(); long planId = planTask.getId();
for (int i1 = 0; i1 < pointIdList.size(); i1++) { for (int i1 = 0; i1 < pointIdList.size(); i1++) {
...@@ -765,6 +771,35 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -765,6 +771,35 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
//bug 5980 待办任务消息应只触发执行中的任务,漏检的任务和未开始的任务不需要触发待办任务消息.
@Override
@Transactional
public void taskMessage(String runDate) {
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
//1.扫描plan表查询,需要生成执行数据的任务信息,无则return
Date now = new Date();//今天
String format = df.format(now);
if (runDate != null) {//上送则已上送的为准
runDate = runDate + " " + format;
now = DateUtil.str2Date(runDate, "yyyyMMdd HH:mm:ss");
}
List<Plan> planIdsByDate = planTaskMapper.getPlanIdsByDate(now);
List<PlanTask> planTaskList = planTaskMapper.getPlanTaskList(now);
Map<Long, Plan> collect = planIdsByDate.stream().collect(Collectors.toMap(Plan::getId, t -> t));
for (PlanTask planTask : planTaskList) {
if (!redisUtils.hasKey(PATROL_PLAN_TASK_KEY + planTask.getId())) {
try {
sendMessage(collect.get(planTask.getPlanId()), planTask);
} catch (Exception e) {
e.printStackTrace();
}
redisUtils.set(PATROL_PLAN_TASK_KEY + planTask.getId(), 1, (long) collect.get(planTask.getPlanId()).getDuration() * 60);
}
}
}
public void sendMessage(Plan plan, PlanTask planTask) throws Exception { public void sendMessage(Plan plan, PlanTask planTask) throws Exception {
MsgRo msgRo = new MsgRo(); MsgRo msgRo = new MsgRo();
// 标题 // 标题
......
...@@ -46,6 +46,13 @@ public interface IPlanTaskService { ...@@ -46,6 +46,13 @@ public interface IPlanTaskService {
void taskExecution(String runDate); void taskExecution(String runDate);
/** /**
* 定时任务发送消息执行中的消息
*
* @param runDate
*/
void taskMessage(String runDate);
/**
* 根据路线id获取关联的所有计划任务 * 根据路线id获取关联的所有计划任务
* *
* @param routeId * @param routeId
......
...@@ -493,12 +493,14 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -493,12 +493,14 @@ public class PlanTaskController extends AbstractBaseController {
@ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId, @ApiParam(value = "检查人员") @RequestParam(value = "executorId", required = false) Long executorId,
@ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType, @ApiParam(value = "任务类型") @RequestParam(value = "taskType", required = false) String taskType,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber, @ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception { @ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize,
@ApiParam(value = "1-排除外部计划 0-或空-正常查询") @RequestParam(value = "outsideType", required = false) Integer outsideType) throws Exception {
HashMap<String, Object> params = new HashMap<String, Object>(); HashMap<String, Object> params = new HashMap<String, Object>();
// ReginParams reginParams = getSelectedOrgInfo(); // ReginParams reginParams = getSelectedOrgInfo();
// String loginOrgCode = getOrgCode(reginParams); // String loginOrgCode = getOrgCode(reginParams);
// Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity()); // Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
// params.putAll(authMap); // params.putAll(authMap);
params.put("outsideType", outsideType);
params.put("userId", userId); params.put("userId", userId);
params.put("companyId", companyId); params.put("companyId", companyId);
params.put("orgCode", loginOrgCode); params.put("orgCode", loginOrgCode);
......
...@@ -223,5 +223,15 @@ public interface PlanTaskMapper extends BaseMapper<PlanTask>, com.yeejoin.amos.s ...@@ -223,5 +223,15 @@ public interface PlanTaskMapper extends BaseMapper<PlanTask>, com.yeejoin.amos.s
List<Map<String, Object>> queryTimeAxis(HashMap<String, Object> params); List<Map<String, Object>> queryTimeAxis(HashMap<String, Object> params);
/**
* 修改计划下任务状态
* @param planId
*/
void updateTaskStatusByPlanId(@Param("planId") Long planId);
/**
* 修改计划下任务详情状态
* @param planId
*/
void updateTaskDetailStatusByPlanId(@Param("planId") Long planId);
} }
...@@ -200,6 +200,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -200,6 +200,8 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
routePoints.forEach(item -> { routePoints.forEach(item -> {
CheckReportCompanyDto checkReportCompanyDto = new CheckReportCompanyDto(); CheckReportCompanyDto checkReportCompanyDto = new CheckReportCompanyDto();
checkReportCompanyDto.setCheckResult("正常"); checkReportCompanyDto.setCheckResult("正常");
//TODO 外部消防单位报错 -- p_point表数据丢失(后面问唐伟)
if (collect.containsKey(item.getPointId())) {
checkReportCompanyDto.setId(collect.get(item.getPointId()).getPointNo()); checkReportCompanyDto.setId(collect.get(item.getPointId()).getPointNo());
checkReportCompanyDto.setName(collect.get(item.getPointId()).getName()); checkReportCompanyDto.setName(collect.get(item.getPointId()).getName());
if (map.containsKey(item.getPointId())) { if (map.containsKey(item.getPointId())) {
...@@ -207,6 +209,7 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -207,6 +209,7 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
} }
checkReportCompanyDto.setDeptCount(companyDeptCountMap.get(checkReportCompanyDto.getId())); checkReportCompanyDto.setDeptCount(companyDeptCountMap.get(checkReportCompanyDto.getId()));
companyDtoList.add(checkReportCompanyDto); companyDtoList.add(checkReportCompanyDto);
}
}); });
checkReportDto.setCheckCompanyList(companyDtoList); checkReportDto.setCheckCompanyList(companyDtoList);
} }
...@@ -263,6 +266,11 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -263,6 +266,11 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
return month + weekDateStr + "日"; return month + weekDateStr + "日";
} }
public static String getNumDate(Date date) throws ParseException {
String monthDayStr = DateUtils.dateFormat(date, "MM月dd日");
return monthDayStr;
}
public static String getMonthDate(Date date) { public static String getMonthDate(Date date) {
return DateUtils.getMonth(date) + "月份"; return DateUtils.getMonth(date) + "月份";
} }
...@@ -400,6 +408,9 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep ...@@ -400,6 +408,9 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
PlanFrequencyEnum frequencyEnum = PlanFrequencyEnum.getEnumByCode(checkReportDto.getPlanCheckFrequencyType()); PlanFrequencyEnum frequencyEnum = PlanFrequencyEnum.getEnumByCode(checkReportDto.getPlanCheckFrequencyType());
String reportDate; String reportDate;
switch (frequencyEnum) { switch (frequencyEnum) {
case NUM:
reportDate = getNumDate(checkReportDto.getStartPlanTaskDate());
break;
case WEEK: case WEEK:
reportDate = getWeekDate(checkReportDto.getStartPlanTaskDate()); reportDate = getWeekDate(checkReportDto.getStartPlanTaskDate());
break; break;
......
...@@ -65,6 +65,7 @@ import org.springframework.util.StringUtils; ...@@ -65,6 +65,7 @@ import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.sql.Time;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -396,6 +397,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -396,6 +397,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
CalDateVo vo = PlanTaskUtil.reGenPlanTaskData(plan, tomorrow, tomorrow); CalDateVo vo = PlanTaskUtil.reGenPlanTaskData(plan, tomorrow, tomorrow);
// 计划已过期,则更新status = 7,已完成 // 计划已过期,则更新status = 7,已完成
if (!vo.getIsGenData()) { if (!vo.getIsGenData()) {
// 当前时间在计划结束时间之前,则计划还未超时
Date date = new Date();
Time time = new Time(date.getTime());
String planEndTime = plan.getPlanEnd() + " " + plan.getDayEnd().toString();
try {
Date parse = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(planEndTime);
if (time.before(new Time(parse.getTime()))){
continue;
}
} catch (ParseException e) {
e.printStackTrace();
}
int num = 0; int num = 0;
//根据计划id查询关联的任务 //根据计划id查询关联的任务
List<PlanTask> planTaskByRouteId = planTaskMapper.getPlanTaskByRouteId(plan.getId()); List<PlanTask> planTaskByRouteId = planTaskMapper.getPlanTaskByRouteId(plan.getId());
...@@ -416,9 +431,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -416,9 +431,20 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if (plan.getIsFixedDate().equals("2")){ if (plan.getIsFixedDate().equals("2")){
paramMap.put("status", PlanStatusEnum.OUT_TIME.getValue()); paramMap.put("status", PlanStatusEnum.OUT_TIME.getValue());
planMapper.updPlanStatusOrGenDate(paramMap); planMapper.updPlanStatusOrGenDate(paramMap);
// 计划超时,修改计划下任务状态
planTaskMapper.updateTaskStatusByPlanId(plan.getId());
// 计划超时,修改计划下任务详情状态
planTaskMapper.updateTaskDetailStatusByPlanId(plan.getId());
continue; continue;
} }
planMapper.updPlanStatusOrGenDate(paramMap); planMapper.updPlanStatusOrGenDate(paramMap);
if (!ObjectUtils.isEmpty(paramMap.get("status")) && paramMap.get("status").equals(PlanStatusEnum.OUT_TIME.getValue())){
// 计划超时,修改计划下任务状态
planTaskMapper.updateTaskStatusByPlanId(plan.getId());
// 计划超时,修改计划下任务详情状态
planTaskMapper.updateTaskDetailStatusByPlanId(plan.getId());
}
continue; continue;
} }
// 2.1计划数据合法性校验 // 2.1计划数据合法性校验
......
...@@ -248,9 +248,14 @@ ...@@ -248,9 +248,14 @@
m.classify_type, m.classify_type,
m.classify_code, m.classify_code,
COUNT( 1 ) AS amount, COUNT( 1 ) AS amount,
SUM(IF(m.maintenance_expiration_time &lt;= CURRENT_DATE,1,0)) AS expirationAmount SUM(IF(m.maintenance_expiration_time &lt;= CURRENT_DATE,1,0)) AS expirationAmount,
we.img,
wes.code
FROM FROM
`mt_maintenance_resource_data` m `mt_maintenance_resource_data` m
LEFT JOIN wl_equipment_specific wes on m.fire_facility_id = wes.id
LEFT JOIN wl_equipment_detail wed on wes.equipment_detail_id = wed.id
LEFT JOIN wl_equipment we on we.id = wed.equipment_id
<where> <where>
<if test="maintenanceCompanyId != null"> <if test="maintenanceCompanyId != null">
m.maintenance_company_id = #{maintenanceCompanyId} m.maintenance_company_id = #{maintenanceCompanyId}
...@@ -284,10 +289,15 @@ ...@@ -284,10 +289,15 @@
m.maintenance_time, m.maintenance_time,
m.maintenance_cycle, m.maintenance_cycle,
m.`status`, m.`status`,
we.img,
wes.code,
IF(m.maintenance_expiration_time IS NOT NULL , IF(m.maintenance_expiration_time &lt;= CURRENT_DATE,'已到期','正常'), '') AS `statusText`, IF(m.maintenance_expiration_time IS NOT NULL , IF(m.maintenance_expiration_time &lt;= CURRENT_DATE,'已到期','正常'), '') AS `statusText`,
m.location m.location
FROM FROM
`mt_maintenance_resource_data` m `mt_maintenance_resource_data` m
LEFT JOIN wl_equipment_specific wes on m.fire_facility_id = wes.id
LEFT JOIN wl_equipment_detail wed on wes.equipment_detail_id = wed.id
LEFT JOIN wl_equipment we on we.id = wed.equipment_id
<where> <where>
<if test="maintenanceCompanyId != null"> <if test="maintenanceCompanyId != null">
m.maintenance_company_id = #{maintenanceCompanyId} m.maintenance_company_id = #{maintenanceCompanyId}
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper">
<select id="getVideoImportantEquipmentList"
resultType="com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo" parameterType="java.util.Map">
SELECT
v.id AS videoId,
v.`name`,
v.`code`,
v.type_code,
v.type,
v.url,
v.img,
v.address,
vie.important_equipment_id
FROM
wl_video v
LEFT JOIN wl_video_important_equipment vie ON v.id = vie.video_id
<where>
<if test="importantEquipmentId != null">
vie.important_equipment_id = #{importantEquipmentId}
</if>
</where>
</select>
</mapper>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
GROUP BY id GROUP BY id
order by v.create_date order by v.create_date
</when> </when>
<when test="dto.buildingId == null and dto.buildingId ==''"> <when test="dto.buildingId == null || dto.buildingId ==''">
<where> <where>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''"> <if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%') v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
select select
vid.id, vid.id,
vid.token, vid.token,
vid.name, vid.remark,
vid.url, vid.url,
vid.code, vid.code,
vid.preset_position as presetPosition vid.preset_position as presetPosition
......
...@@ -3194,5 +3194,34 @@ ...@@ -3194,5 +3194,34 @@
<column name="biz_org_code"/> <column name="biz_org_code"/>
</createIndex> </createIndex>
</changeSet> </changeSet>
<changeSet author="cz" id="2022-06-13-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_powerr_transfer_log"/>
</preConditions>
<comment>修改字段长度</comment>
<sql>
ALTER TABLE jc_powerr_transfer_log MODIFY COLUMN receive_name varchar(5000) DEFAULT NULL COMMENT '接收人' ;
</sql>
</changeSet>
<changeSet author="cz" id="2022-06-13-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_submitted"/>
</preConditions>
<comment>修改字段长度</comment>
<sql>
ALTER TABLE jc_alert_submitted MODIFY COLUMN submission_content varchar(5000) DEFAULT NULL COMMENT '报送内容';
</sql>
</changeSet>
<changeSet author="chenzhao" id="2022-06-15-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
</preConditions>
<comment>update data cb_data_dictionary</comment>
<sql>
REPLACE INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1165, '1165', '集结待命', 'XYJBR', NULL, NULL, NULL, NULL, NULL, b'0', 1);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -1002,6 +1002,12 @@ ...@@ -1002,6 +1002,12 @@
<if test="key == 'dangerLevel' and value != null and value != ''"> <if test="key == 'dangerLevel' and value != null and value != ''">
and a.danger_level = #{value} and a.danger_level = #{value}
</if> </if>
<if test="key == 'dangerLevelList' and value != null and value.size() > 0">
and a.danger_level in
<foreach collection="value" item="dangerLevel" open="(" separator="," close=")">
#{dangerLevel}
</foreach>
</if>
<if test="key == 'startTime' and value != null and value != ''"> <if test="key == 'startTime' and value != null and value != ''">
and a.create_date <![CDATA[ >= ]]> #{value} and a.create_date <![CDATA[ >= ]]> #{value}
</if> </if>
...@@ -1095,6 +1101,7 @@ WHERE ...@@ -1095,6 +1101,7 @@ WHERE
( (
discoverer_user_id = #{userId} AND danger_state = 'draft' discoverer_user_id = #{userId} AND danger_state = 'draft'
AND biz_info LIKE concat('%',#{planId},'%') AND biz_info LIKE concat('%',#{planId},'%')
AND deleted = 0
) )
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -1906,6 +1906,7 @@ ...@@ -1906,6 +1906,7 @@
) checkDate, ) checkDate,
pp.id pointId, pp.id pointId,
pp.equipment_id equipmentId, pp.equipment_id equipmentId,
pp.point_no as qrCode,
pp.equipment_name equipmentName, pp.equipment_name equipmentName,
pp.name equipmentDetailName, pp.name equipmentDetailName,
pp.belong_system_id systemId, pp.belong_system_id systemId,
...@@ -1916,6 +1917,10 @@ ...@@ -1916,6 +1917,10 @@
pc.org_code AS orgCode pc.org_code AS orgCode
FROM p_check pc FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id LEFT JOIN p_point pp ON pp.id = pc.point_id
<if test="person != null and person != ''">
LEFT JOIN p_plan_task_detail ptd on ptd.id = pc.plan_task_detail_id
where ptd.executor_id = #{person}
</if>
) a ) a
<include refid="mobile-check-record-where" /> <include refid="mobile-check-record-where" />
<if test="orderRule == null or orderRule == ''"> order by checkDate </if> <if test="orderRule == null or orderRule == ''"> order by checkDate </if>
...@@ -1945,6 +1950,8 @@ ...@@ -1945,6 +1950,8 @@
</if> </if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if> <if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="equipId != null and equipId != '' "> and a.equipId = #{equipId}</if> <if test="equipId != null and equipId != '' "> and a.equipId = #{equipId}</if>
<if test="qrCode != null and qrCode != ''"> and a.qrCode = #{qrCode}</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != '' "> <if test="beginTime != null and beginTime != '' and endTime != null and endTime != '' ">
AND ( AND (
( (
...@@ -2013,6 +2020,7 @@ ...@@ -2013,6 +2020,7 @@
) checkDate, ) checkDate,
pp.id pointId, pp.id pointId,
pp.equipment_id equipmentId, pp.equipment_id equipmentId,
pp.point_no as qrCode,
pp.equipment_name equipmentName, pp.equipment_name equipmentName,
pp.belong_system_id systemId, pp.belong_system_id systemId,
pp.belong_system_name systemName, pp.belong_system_name systemName,
...@@ -2021,6 +2029,10 @@ ...@@ -2021,6 +2029,10 @@
pc.org_code AS orgCode pc.org_code AS orgCode
FROM p_check pc FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id LEFT JOIN p_point pp ON pp.id = pc.point_id
<if test="person != null and person != ''">
LEFT JOIN p_plan_task_detail ptd on ptd.id = pc.plan_task_detail_id
where ptd.executor_id = #{person}
</if>
) a ) a
<include refid="mobile-check-record-where" /> <include refid="mobile-check-record-where" />
</select> </select>
......
...@@ -206,6 +206,7 @@ ...@@ -206,6 +206,7 @@
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
where pt.status = 0 where pt.status = 0
and p.is_delete = 0
) a ) a
<include refid="mobile-plan-task-where" /> <include refid="mobile-plan-task-where" />
<if test="orderBy != null and orderBy != ''"> order by ${orderBy}</if> <if test="orderBy != null and orderBy != ''"> order by ${orderBy}</if>
...@@ -265,6 +266,7 @@ ...@@ -265,6 +266,7 @@
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
where pt.status = 0 where pt.status = 0
and p.is_delete = 0
) a ) a
<include refid="mobile-plan-task-where" /> <include refid="mobile-plan-task-where" />
</select> </select>
...@@ -877,4 +879,19 @@ ...@@ -877,4 +879,19 @@
</choose> </choose>
GROUP BY td.is_finish GROUP BY td.is_finish
</select> </select>
<select id="getPlanIdsByDate" resultType="com.yeejoin.amos.maintenance.dao.entity.Plan">
select *
from p_plan
where id in (
select plan_id
from p_plan_task
where
begin_time &lt;= #{date,jdbcType=TIMESTAMP}
and end_time &gt; #{date,jdbcType=TIMESTAMP}
and finish_status in (0, 1)
and status = 0
group by plan_id
)
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -974,4 +974,29 @@ ...@@ -974,4 +974,29 @@
ORDER BY ORDER BY
ppk.begin_time DESC LIMIT 60 ppk.begin_time DESC LIMIT 60
</select> </select>
<select id="getPlanIdsByDate" resultType="com.yeejoin.amos.patrol.dao.entity.Plan">
select *
from p_plan
where id in (
select plan_id
from p_plan_task
where
begin_time &lt;= #{date,jdbcType=TIMESTAMP}
and end_time &gt; #{date,jdbcType=TIMESTAMP}
and finish_status in (0, 1)
and status = 0
group by plan_id
)
</select>
<select id="getPlanTaskList" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTask">
select *
from p_plan_task
where
begin_time &lt;= #{date,jdbcType=TIMESTAMP}
and end_time &gt; #{date,jdbcType=TIMESTAMP}
and finish_status in (0, 1)
and status = 0
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -210,6 +210,10 @@ ...@@ -210,6 +210,10 @@
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
<if test="outsideType != null and outsideType == 1 ">
where
p.check_level != 3
</if>
) a ) a
<include refid="mobile-plan-task-where"/> <include refid="mobile-plan-task-where"/>
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
...@@ -273,6 +277,10 @@ ...@@ -273,6 +277,10 @@
p_plan_task pt p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id INNER JOIN p_route r on r.id = pt.route_id
<if test="outsideType != null and outsideType == 1 ">
where
p.check_level != 3
</if>
) a ) a
<include refid="mobile-plan-task-where"/> <include refid="mobile-plan-task-where"/>
</select> </select>
...@@ -401,6 +409,9 @@ ...@@ -401,6 +409,9 @@
<if test="offset != null and pageSize != null"> <if test="offset != null and pageSize != null">
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</if> </if>
<if test="pointId != null and pointId != ''">
and ppn.id = #{planId}
</if>
</select> </select>
<select id="getPlanTaskPointsCount" resultType="long"> <select id="getPlanTaskPointsCount" resultType="long">
...@@ -1012,4 +1023,15 @@ ...@@ -1012,4 +1023,15 @@
#{userId}, user_id) #{userId}, user_id)
AND finish_status = 1 AND finish_status = 1
</select> </select>
<update id="updateTaskStatusByPlanId">
update p_plan_task
set finish_status = 3
WHERE plan_id = #{planId} and finish_status != 2
</update>
<update id="updateTaskDetailStatusByPlanId">
update p_plan_task_detail
set is_finish = 3
WHERE task_no in(SELECT id FROM p_plan_task WHERE plan_id = #{planId}) and is_finish != 2
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -120,7 +120,7 @@ public class UnitInfoController extends BaseController { ...@@ -120,7 +120,7 @@ public class UnitInfoController extends BaseController {
Iterator<CompanyModel> it = result.iterator(); Iterator<CompanyModel> it = result.iterator();
while(it.hasNext()) { while(it.hasNext()) {
CompanyModel temp = it.next(); CompanyModel temp = it.next();
if(temp.getLevel().equals("emergencyCenter") || temp.getLevel().equals("company")) { if("emergencyCenter".equals(temp.getLevel()) || "company".equals(temp.getLevel())) {
it.remove(); it.remove();
} else { } else {
this.dealCompanyTree(temp); this.dealCompanyTree(temp);
...@@ -617,35 +617,35 @@ public class UnitInfoController extends BaseController { ...@@ -617,35 +617,35 @@ public class UnitInfoController extends BaseController {
private void dealCompanyTree(CompanyModel company) { private void dealCompanyTree(CompanyModel company) {
if(!company.getLevel().equals("emergencyCenter") && !company.getLevel().equals("company")) { if(!"emergencyCenter".equals(company.getLevel()) && !"company".equals(company.getLevel())) {
// 判断子节点是否是headquarter // 判断子节点是否是headquarter
Collection children = company.getChildren(); Collection children = company.getChildren();
if (!ValidationUtil.isEmpty(children)) {
Iterator<Map> it = children.iterator(); Iterator<Map> it = children.iterator();
while(it.hasNext()) { while(it.hasNext()) {
Map temp = it.next(); Map temp = it.next();
if(company.getLevel().equals("emergencyCenter") || company.getLevel().equals("company")) { if("emergencyCenter".equals(company.getLevel()) || "company".equals(company.getLevel())) {
it.remove(); it.remove();
} else { } else {
this.dealCompanyTree(temp); this.dealCompanyTree(temp);
} }
} }
} else { }
return;
} }
} }
private void dealCompanyTree(Map company) { private void dealCompanyTree(Map company) {
// 判断子节点是否是headquarter // 判断子节点是否是headquarter
Collection children = (Collection) company.get("children"); Collection children = (Collection) company.get("children");
if (!ValidationUtil.isEmpty(children)) {
Iterator<Map> it = children.iterator(); Iterator<Map> it = children.iterator();
while(it.hasNext()) { while(it.hasNext()) {
Map temp = it.next(); Map temp = it.next();
if(temp.get("level").equals("emergencyCenter") || temp.get("level").equals("company")) { if("emergencyCenter".equals(temp.get("level")) || "company".equals(temp.get("level"))) {
it.remove(); it.remove();
} else { } else {
this.dealCompanyTree(temp); this.dealCompanyTree(temp);
} }
} }
} }
}
} }
...@@ -43,17 +43,17 @@ public class TaskServiceImpl extends BaseService<TaskDto, Task, TaskMapper> impl ...@@ -43,17 +43,17 @@ public class TaskServiceImpl extends BaseService<TaskDto, Task, TaskMapper> impl
recDate[0] = DateUtils.getCurrentDayStartTime(now); recDate[0] = DateUtils.getCurrentDayStartTime(now);
recDate[1] = DateUtils.getCurrentDayEndTime(now); recDate[1] = DateUtils.getCurrentDayEndTime(now);
// 我的任务 // 我的待办
Integer myTaskCount = this.queryForCount(userId, null, null); Integer myTaskCount = this.queryForCount(userId, null, null);
// 今日 // 今日
List<Integer> statusList = getStatus("uncomplete"); List<Integer> statusList = getStatus("complete");
Integer todyUnCompletedTaskCount = this.queryForCount(userId, recDate, statusList); Integer todyCompletedTaskCount = this.queryForCount(userId, recDate, statusList);
// 未完结业务 // 未完结业务
Integer unCompletedTaskCount = this.queryForCount(userId, null, statusList); Integer unCompletedTaskCount = this.queryForCount(userId, null, statusList);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("myTask", myTaskCount); jsonObject.put("myTask", myTaskCount);
jsonObject.put("todyUnCompletedTask", todyUnCompletedTaskCount); jsonObject.put("todyCompletedTask", todyCompletedTaskCount);
jsonObject.put("unCompletedTask", unCompletedTaskCount); jsonObject.put("unCompletedTask", unCompletedTaskCount);
return jsonObject; return jsonObject;
} }
......
package com.yeejoin.amos.speech; package com.yeejoin.amos.speech;
import com.alibaba.nls.client.protocol.InputFormatEnum; import com.alibaba.nls.client.protocol.InputFormatEnum;
import com.alibaba.nls.client.protocol.NlsClient;
import com.alibaba.nls.client.protocol.SampleRateEnum; import com.alibaba.nls.client.protocol.SampleRateEnum;
import com.alibaba.nls.client.protocol.asr.SpeechTranscriber; import com.alibaba.nls.client.protocol.asr.SpeechTranscriber;
import com.alibaba.nls.client.protocol.asr.SpeechTranscriberListener; import com.alibaba.nls.client.protocol.asr.SpeechTranscriberListener;
import com.alibaba.nls.client.protocol.asr.SpeechTranscriberResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -29,6 +31,7 @@ public class AppSpeechTranscriber { ...@@ -29,6 +31,7 @@ public class AppSpeechTranscriber {
private final TimerTask timerTask; private final TimerTask timerTask;
private final String localIpAddress; private final String localIpAddress;
private int idleTime = 0; private int idleTime = 0;
private NlsClient client;
public AppSpeechTranscriber(SpeechTranscriberListener listener, DatagramSocket serverSocket, String localIpAddress) { public AppSpeechTranscriber(SpeechTranscriberListener listener, DatagramSocket serverSocket, String localIpAddress) {
this.localIpAddress = localIpAddress; this.localIpAddress = localIpAddress;
...@@ -73,7 +76,7 @@ public class AppSpeechTranscriber { ...@@ -73,7 +76,7 @@ public class AppSpeechTranscriber {
} }
idleTime = 0; idleTime = 0;
logger.warn("收到数据包:" + b.length); logger.warn("收到数据包:" + b.length);
//去掉前12个字节的rtp包头,后面的332字节为语音数据 //去掉前12个字节的rtp包头,后面的320字节为语音数据
//4秒未再次调用此方法,阿里云会抛出超时异常 //4秒未再次调用此方法,阿里云会抛出超时异常
transcriber.send(Arrays.copyOfRange(b, 12, b.length)); transcriber.send(Arrays.copyOfRange(b, 12, b.length));
} }
...@@ -112,14 +115,15 @@ public class AppSpeechTranscriber { ...@@ -112,14 +115,15 @@ public class AppSpeechTranscriber {
transcriber.setEnablePunctuation(false); transcriber.setEnablePunctuation(false);
//是否将返回结果规整化,比如将一百返回为100。 //是否将返回结果规整化,比如将一百返回为100。
transcriber.setEnableITN(true); transcriber.setEnableITN(true);
//设置vad断句参数。默认值:800ms,有效值:200ms~2000ms。 //设置vad断句参数。默认值:800ms,有效值:200ms~2000ms。
transcriber.addCustomedParam("max_sentence_silence", 800); //transcriber.addCustomedParam("max_sentence_silence", 600);
//设置是否语义断句。 //设置是否语义断句。
//transcriber.addCustomedParam("enable_semantic_sentence_detection",false); //transcriber.addCustomedParam("enable_semantic_sentence_detection",false);
//设置是否开启顺滑。 //设置是否开启顺滑。
//transcriber.addCustomedParam("disfluency",true); //transcriber.addCustomedParam("disfluency",true);
//设置是否开启词模式。 //设置是否开启词模式。
transcriber.addCustomedParam("enable_words", true); //transcriber.addCustomedParam("enable_words",true);
//设置vad噪音阈值参数,参数取值为-1~+1,如-0.9、-0.8、0.2、0.9。 //设置vad噪音阈值参数,参数取值为-1~+1,如-0.9、-0.8、0.2、0.9。
//取值越趋于-1,判定为语音的概率越大,亦即有可能更多噪声被当成语音被误识别。 //取值越趋于-1,判定为语音的概率越大,亦即有可能更多噪声被当成语音被误识别。
//取值越趋于+1,判定为噪音的越多,亦即有可能更多语音段被当成噪音被拒绝识别。 //取值越趋于+1,判定为噪音的越多,亦即有可能更多语音段被当成噪音被拒绝识别。
...@@ -130,9 +134,10 @@ public class AppSpeechTranscriber { ...@@ -130,9 +134,10 @@ public class AppSpeechTranscriber {
//设置训练后的定制热词id。 //设置训练后的定制热词id。
//transcriber.addCustomedParam("vocabulary_id","你的定制热词id"); //transcriber.addCustomedParam("vocabulary_id","你的定制热词id");
//设置是否忽略单句超时。 //设置是否忽略单句超时。
transcriber.addCustomedParam("enable_ignore_sentence_timeout", false); transcriber.addCustomedParam("enable_ignore_sentence_timeout",false);
//vad断句开启后处理。 //vad断句开启后处理。
//transcriber.addCustomedParam("enable_vad_unify_post",false); //transcriber.addCustomedParam("enable_vad_unify_post",false);
//此方法将以上参数设置序列化为JSON发送给服务端,并等待服务端确认。 //此方法将以上参数设置序列化为JSON发送给服务端,并等待服务端确认。
} }
} }
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