Commit 88bdbf51 authored by chenhao's avatar chenhao

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 5d2c1d2e 8baec012
...@@ -43,15 +43,18 @@ public class RoutePointRespone { ...@@ -43,15 +43,18 @@ public class RoutePointRespone {
private String equipmentName; private String equipmentName;
public String getAddress() { /**
return address; * 具体位置:buildName + address
} */
private String position;
public void setAddress(String address) { public String getPosition() {
this.address = address; return position;
} }
private String address; public void setPosition(String position) {
this.position = position;
}
private int orderNo; private int orderNo;
......
...@@ -23,6 +23,18 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -23,6 +23,18 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
* @param endDate * @param endDate
* @return * @return
*/ */
List<Map<String, Integer>> queryNearlyCount(@Param("beginDate") String beginDate,
@Param("endDate") String endDate,
@Param("orgCode") String orgCode,
@Param("recUserId") String recUserId
);
/**
* 接警情况统计
*
* @param beginDate
* @param endDate
* @return
*/
Map<String, Integer> queryAlertStatusCount(@Param("beginDate") String beginDate, Map<String, Integer> queryAlertStatusCount(@Param("beginDate") String beginDate,
@Param("endDate") String endDate, @Param("endDate") String endDate,
@Param("orgCode") String orgCode, @Param("orgCode") String orgCode,
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
SELECT SELECT
count( 1 ) calledCount, count( 1 ) calledCount,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount, sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN alarm_type_code = 'KRJY' THEN 1 ELSE 0 END ) sleepyIncidentCount, sum( CASE WHEN alarm_type_code = '960' THEN 1 ELSE 0 END ) sleepyIncidentCount,
sum( CASE WHEN alarm_type_code = 'GZWX' THEN 1 ELSE 0 END ) faultRescueCount, sum( CASE WHEN alarm_type_code = '961' THEN 1 ELSE 0 END ) faultRescueCount,
sum( CASE WHEN alarm_type_code = 'TSZX' THEN 1 ELSE 0 END ) suggestionsCount sum( CASE WHEN alarm_type_code = '962' THEN 1 ELSE 0 END ) suggestionsCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
...@@ -24,6 +24,127 @@ ...@@ -24,6 +24,127 @@
</if> </if>
</select> </select>
<select id="queryNearlyCount" resultType="java.util.Map">
SELECT
DATE_ADD(#{beginDate},INTERVAL -1 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -1 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -1 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -2 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -2 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -2 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -3 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -3 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -3 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -4 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -4 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -4 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -5 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -5 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -5 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -6 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -6 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -6 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -7 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
<if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -7 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -7 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
</select>
<select id="queryAlertListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto"> <select id="queryAlertListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto">
SELECT SELECT
a.work_order_number AS workOrderNumber, a.work_order_number AS workOrderNumber,
......
...@@ -26,9 +26,9 @@ public class PointDto { ...@@ -26,9 +26,9 @@ public class PointDto {
private String equipmentName; private String equipmentName;
/** /**
* 位置 * 具体位置:buildName + address
*/ */
private String address; private String position;
/** /**
......
...@@ -353,6 +353,9 @@ public class PointServiceImpl implements IPointService { ...@@ -353,6 +353,9 @@ public class PointServiceImpl implements IPointService {
PointVo pointVo = new PointVo(); PointVo pointVo = new PointVo();
BeanUtils.copyProperties(point, pointVo); BeanUtils.copyProperties(point, pointVo);
pointVo.setInputItemNum(pointInputItems.stream().filter(i -> i.getPointId() == point.getId()).count()); pointVo.setInputItemNum(pointInputItems.stream().filter(i -> i.getPointId() == point.getId()).count());
String buildingName = StringUtil.isNotEmpty(point.getBuildingName()) ? point.getBuildingName() : "";
String address = StringUtil.isNotEmpty(point.getAddress()) ? point.getAddress() : "";
pointVo.setPosition(buildingName + address);
pointVoList.add(pointVo); pointVoList.add(pointVo);
} }
Pageable pageable = new CommonPageable(pointPage.getNumber(), pointPage.getSize(), pointPage.getSort()); Pageable pageable = new CommonPageable(pointPage.getNumber(), pointPage.getSize(), pointPage.getSort());
...@@ -1157,6 +1160,9 @@ public class PointServiceImpl implements IPointService { ...@@ -1157,6 +1160,9 @@ public class PointServiceImpl implements IPointService {
PointDto pointDto = new PointDto(); PointDto pointDto = new PointDto();
BeanUtils.copyProperties(point, pointDto); BeanUtils.copyProperties(point, pointDto);
pointDto.setPointInputItems(pointInputItems.stream().filter(i -> i.getPointId() == point.getId()).collect(Collectors.toList())); pointDto.setPointInputItems(pointInputItems.stream().filter(i -> i.getPointId() == point.getId()).collect(Collectors.toList()));
String buildingName = StringUtil.isNotEmpty(point.getBuildingName()) ? point.getBuildingName() : "";
String address = StringUtil.isNotEmpty(point.getAddress()) ? point.getAddress() : "";
pointDto.setPosition(buildingName + address);
pointDtos.add(pointDto); pointDtos.add(pointDto);
} }
Pageable pageable = new CommonPageable(pointPage.getNumber(), pointPage.getSize(), pointPage.getSort()); Pageable pageable = new CommonPageable(pointPage.getNumber(), pointPage.getSize(), pointPage.getSort());
......
...@@ -22,6 +22,16 @@ public class PointVo { ...@@ -22,6 +22,16 @@ public class PointVo {
private Date createDate; private Date createDate;
private String originalId;
public String getOriginalId() {
return originalId;
}
public void setOriginalId(String originalId) {
this.originalId = originalId;
}
public Date getCreateDate() { public Date getCreateDate() {
return createDate; return createDate;
} }
...@@ -48,10 +58,36 @@ public class PointVo { ...@@ -48,10 +58,36 @@ public class PointVo {
private String equipmentName; private String equipmentName;
/** /**
* 建筑名称
*/
private String buildingName;
public String getBuildingName() {
return buildingName;
}
public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
/**
* 位置 * 位置
*/ */
private String address; private String address;
/**
* 具体位置:buildName + address
*/
private String position;
public String getAddress() { public String getAddress() {
return address; return address;
} }
......
package com.yeejoin.amos.boot.module.tzs.biz.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.SystemClock; import com.baomidou.mybatisplus.core.toolkit.SystemClock;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...@@ -20,12 +20,16 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; ...@@ -20,12 +20,16 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -50,6 +54,8 @@ import java.lang.reflect.Field; ...@@ -50,6 +54,8 @@ import java.lang.reflect.Field;
import java.text.ParseException; import java.text.ParseException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -147,7 +153,7 @@ public class AlertCalledController extends BaseController { ...@@ -147,7 +153,7 @@ public class AlertCalledController extends BaseController {
alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss ")); alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss "));
alertCallInfoDto.setWorkOrderNumber(workOrderNumber); alertCallInfoDto.setWorkOrderNumber(workOrderNumber);
alertCallInfoDto.setRecUserId(getUserInfo().getUserId()); alertCallInfoDto.setRecUserId(getUserInfo().getUserId());
alertCallInfoDto.setRecUserName(getUserInfo().getUserName()); alertCallInfoDto.setRecUserName(getUserInfo().getRealName());
return ResponseHelper.buildResponse(alertCallInfoDto); return ResponseHelper.buildResponse(alertCallInfoDto);
} }
...@@ -162,12 +168,13 @@ public class AlertCalledController extends BaseController { ...@@ -162,12 +168,13 @@ public class AlertCalledController extends BaseController {
String number = DateUtils.stampToDate(SystemClock.now(),"yyyy-MM-dd HH:mm:ss SSS"); String number = DateUtils.stampToDate(SystemClock.now(),"yyyy-MM-dd HH:mm:ss SSS");
String newNumber = number.replace("-","").replace(" ","").replace(":",""); String newNumber = number.replace("-","").replace(" ","").replace(":","");
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
// Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.dateFormat(new Date(),"")+" 00:00:00", AgencyUserModel user = reginParams.getUserModel();
// DateUtils.dateFormat(new Date(),"")+" 23:59:59",reginParams.getCompany().getOrgCode(), String orgCode = ValidationUtil.isEmpty(user.getCompanys()) ? null : user.getCompanys().get(0).getOrgCode();
// reginParams.getUserModel().getUserId());
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd")+" 00:00:00", Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),
DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd")+" 23:59:59",null, DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),orgCode,
null); user.getUserId());
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(newNumber); stringBuilder.append(newNumber);
String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1" : String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString() ; String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1" : String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString() ;
...@@ -182,7 +189,7 @@ public class AlertCalledController extends BaseController { ...@@ -182,7 +189,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/alertStatistics") @GetMapping(value = "/alertStatistics")
@ApiOperation(httpMethod = "GET",value = "警情统计", notes = "警情统计") @ApiOperation(httpMethod = "GET",value = "警情统计", notes = "警情统计")
public ResponseModel<AlarmStatisticsDto> alertStatistics() throws ParseException { public ResponseModel<AlarmStatisticsDto> alertStatistics() {
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
//我的待办数量 //我的待办数量
...@@ -202,8 +209,8 @@ public class AlertCalledController extends BaseController { ...@@ -202,8 +209,8 @@ public class AlertCalledController extends BaseController {
alarmStatisticsDto.setAllNum(iAlertCalledService.list(allNumQueryWrapper).size()); alarmStatisticsDto.setAllNum(iAlertCalledService.list(allNumQueryWrapper).size());
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd")+" 00:00:00", Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd")+" 23:59:59",null, DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN),null,
getUserInfo().getUserId()); getUserInfo().getUserId());
// 当天接警 // 当天接警
...@@ -217,13 +224,14 @@ public class AlertCalledController extends BaseController { ...@@ -217,13 +224,14 @@ public class AlertCalledController extends BaseController {
//困人救援数量 //困人救援数量
alarmStatisticsDto.setSleepyIncident(map.get("sleepyIncidentCount") == null ? 0 : Integer.valueOf(map.get("sleepyIncidentCount").toString())) ; alarmStatisticsDto.setSleepyIncident(map.get("sleepyIncidentCount") == null ? 0 : Integer.valueOf(map.get("sleepyIncidentCount").toString())) ;
Map<String,Integer> recordMap = Maps.newHashMap(); LinkedHashMap<String,Integer> recordMap = new LinkedHashMap<>();
// 近七天办理数量 // 近七天办理数量
for(int i = 1 ; i < 8; i++) { Map<String, Object> nearlySevenDaysMap = iAlertCalledService.getNearlyInfo(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
Map<String, Object> nearlySevenDaysMap = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), -i).getTime(),"yyyy-MM-dd")+" 00:00:00", DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN),null,
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), -i).getTime(),"yyyy-MM-dd")+" 23:59:59",null,
getUserInfo().getUserId()); getUserInfo().getUserId());
recordMap.put(DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), -i).getTime(),"yyyy-MM-dd"),nearlySevenDaysMap.get("calledCount") == null ? 0 : Integer.valueOf(nearlySevenDaysMap.get("calledCount").toString()));
for(int i = 0; i<nearlySevenDaysMap.size()/2;i++) {
recordMap.put(DateUtils.dateToString(nearlySevenDaysMap.get("dateTime"+i).toString()), Integer.parseInt(nearlySevenDaysMap.get("majorAlertCount"+i).toString()));
} }
alarmStatisticsDto.setNearlySevenDaysNum(recordMap); alarmStatisticsDto.setNearlySevenDaysNum(recordMap);
} }
...@@ -256,7 +264,7 @@ public class AlertCalledController extends BaseController { ...@@ -256,7 +264,7 @@ public class AlertCalledController extends BaseController {
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper); page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page); IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
calledVoIPage.getRecords().stream().forEach(e->{ calledVoIPage.getRecords().stream().forEach(e->{
e.setAlertAddress(e.getCity()+e.getDistrict()); getResponseLevel(e.getSequenceNbr(), e,null);
}); });
return ResponseHelper.buildResponse(calledVoIPage); return ResponseHelper.buildResponse(calledVoIPage);
} }
...@@ -316,6 +324,28 @@ public class AlertCalledController extends BaseController { ...@@ -316,6 +324,28 @@ public class AlertCalledController extends BaseController {
return queryWrapper; return queryWrapper;
} }
void getResponseLevel(Long alertId, AlertCalledDto alertCalledDto, ESAlertCalledDto esAlertCalledDto) {
LambdaQueryWrapper<DispatchPaper> dispatchPaperQueryWrapper = new LambdaQueryWrapper<>();
dispatchPaperQueryWrapper.eq(DispatchPaper::getAlertId,alertId);
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getOne(dispatchPaperQueryWrapper);
if(null != dispatchPaper) {
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, dispatchPaper.getSequenceNbr()).eq(AlertFormValue::getAlertTypeCode, DispatchPaperEnums.getEnumById(dispatchPaper.getAlertCode()).getDynamicCode());
// 派遣单动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
// map 存取数据
Map<String,String> dynamicParms = new HashMap<String,String>();
list.stream().forEach(paperFormValue -> {
dynamicParms.put(paperFormValue.getFieldCode(),paperFormValue.getFieldValue());
});
String responseLevel = dynamicParms.get("response_level");
if(null != alertCalledDto) {
alertCalledDto.setResponseLevel(responseLevel);
} else {
esAlertCalledDto.setResponseLevel(responseLevel);
}
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import java.util.ArrayList; import com.alibaba.fastjson.JSON;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
...@@ -34,6 +20,17 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper; ...@@ -34,6 +20,17 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService; import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/** /**
* 警情接警填报记录服务实现类 * 警情接警填报记录服务实现类
...@@ -263,4 +260,20 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -263,4 +260,20 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return result; return result;
} }
public Map<String, Object> getNearlyInfo(String beginDate, String endDate,String orgCode, String recUserId) {
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Integer>> statusCountMap = alertCalledMapper.queryNearlyCount(beginDate, endDate,orgCode,recUserId);
for(int i = 0; i<statusCountMap.size();i++) {
if(statusCountMap.get(i).size() > 1) {
result.put("dateTime"+i,statusCountMap.get(i).get("dateTime"));
result.put("majorAlertCount"+i,statusCountMap.get(i).get("majorAlertCount"));
} else {
result.put("dateTime"+i,statusCountMap.get(i).get("dateTime"));
result.put("majorAlertCount"+i,0);
}
}
return result;
}
} }
\ No newline at end of file
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
(SELECT GROUP_CONCAT(name SEPARATOR ';') FROM p_point_classify WHERE point_id = p.id GROUP BY point_id) classifyName, (SELECT GROUP_CONCAT(name SEPARATOR ';') FROM p_point_classify WHERE point_id = p.id GROUP BY point_id) classifyName,
p.belong_system_name, p.belong_system_name,
p.equipment_name, p.equipment_name,
p.address, concat_ws('',ifnull(p.building_name,''),ifnull(p.address,'')) as position,
(select count(1) from p_route_point_item rpi where rpi.route_point_id = rp.id) as routePointItemNum (select count(1) from p_route_point_item rpi where rpi.route_point_id = rp.id) as routePointItemNum
FROM FROM
p_route_point rp p_route_point rp
......
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