Commit 66506027 authored by chenzhao's avatar chenzhao

120接口迁移开发

parent fa8ac5ae
......@@ -36,6 +36,14 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("params") Map<String, String> params
);
List<Map<String, Object>> listOnDutyPersonByAid(
@Param("dutyDate") String dutyDay,
@Param("shiftId") String shiftIds,
@Param("fieldCodes") Map<String, Object> fieldCodes,
@Param("groupCode") String groupCode);
/**
* 分页查询
*
......
......@@ -88,6 +88,10 @@ public interface IDutyCommonService {
*/
List<Map<String, Object>> listOnDutyPerson();
//120系统迁移接口 sql固定查询急救科下值班人员
List<Map<String, Object>> listOnDutyPersonByAid();
/**
* 根据当前时间获取值班班次id列表
*
......
......@@ -20,6 +20,49 @@
LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id
WHERE v.instance_id = #{id}
</select>
<select id="listOnDutyPersonByAid" resultType="java.util.Map">
select
d.*,
ps.shift_id as shiftId,
ps.duty_date as dutyDate,
ds.name as shiftName,
'在岗' state
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldCodes" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
</foreach>
from
cb_dynamic_form_instance i
where i.GROUP_CODE = #{groupCode}
GROUP by
i.INSTANCE_ID ) d,
cb_duty_person_shift ps,
cb_duty_shift ds
where
d.instanceId = ps.instance_id
and d.deptId in (SELECT
`cb_org_usr`.`sequence_nbr`
FROM
`cb_org_usr`
WHERE
(
( `cb_org_usr`.`biz_org_code` LIKE concat( ( SELECT `cb_org_usr`.`biz_org_code` FROM `cb_org_usr` WHERE ( `cb_org_usr`.`sequence_nbr` = 1435847345328660481 ) ), '%' ) )
AND ( `cb_org_usr`.`biz_org_type` = 'DEPARTMENT' )
))
and ps.shift_id = ds.sequence_nbr
and ps.duty_date = #{dutyDate}
<if test="shiftId != null and shiftId != ''">
and ps.shift_id in (#{shiftId})
</if>
order by instanceId desc
</select>
<select id="listAll" resultType="java.util.Map">
select
d.*
......
......@@ -43,4 +43,6 @@ public class ShiftChangeInfoDto extends ShiftChangeDto {
private String dutyPersonLeader;
@ApiModelProperty("接班员经理")
private String succeedPersonLeader;
@ApiModelProperty("所属系统")
private String systemType;
}
......@@ -49,4 +49,11 @@ public class ShiftChange extends BaseEntity {
*/
@TableField("duty_work")
private String dutyWork;
/**
* 所属系统 无值为119系统记录
*/
@TableField("system_type")
private String systemType;
}
......@@ -33,6 +33,30 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
int alertCalledListByAlertStatusCount(@Param("par")RequestData par);
List<AlertCalled> selectAidPage(Long current, Long size,
Integer alertStatus,
String alertTypeCode ,
String alertSourceCode,
String startTime,
String endTime,
String data,
String lift,
String isFatherAlert,String systemSourceCode);
int selectAidCount(Integer alertStatus,
String alertTypeCode ,
String alertSourceCode,
String startTime,
String endTime,
String isFatherAlert,String systemSourceCode);
List<AlertCalledZhDto> alertCalledListByAlertStatusByAid(@Param("pageNum")Integer pageNum, @Param("pageSize")Integer pageSize,@Param("par")RequestData par);
int alertCalledListByAlertStatusCountByAid(@Param("par")RequestData par);
Integer AlertCalledcountTime(@Param("type")int type);
List<AlertCalledTodyDto> getTodayAlertCalled();
......
......@@ -32,7 +32,12 @@ public interface IAlertCalledService {
List<AlertCalledZhDto> alertCalledListByAlertStatus(Integer pageNum, Integer pageSize,RequestData par);
int alertCalledListByAlertStatusCount(RequestData par);
List<AlertCalledZhDto> alertCalledListByAlertStatusByAid(Integer pageNum, Integer pageSize, RequestData par);
int alertCalledListByAlertStatusCount(RequestData par);
int alertCalledListByAlertStatusCountByAid(RequestData par);
/**
*
......
......@@ -25,6 +25,8 @@ public interface IShiftChangeService {
*/
Map<String, Object> createFormAndEntry(Map<String, Object> model);
IPage<Map<String, Object>> queryForShiftChangePageByAid(int current, int size);
/**
* 删除完整信息
*
......
......@@ -81,12 +81,192 @@
</if>
</select>
<select id="alertCalledListByAlertStatusByAid" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto">
SELECT
a.sequence_nbr sequenceNbr,
a.alert_stage alertStage,
a.call_time callTime,
a.update_time updateTime,
a.rescue_grid rescueGrid,
CONCAT(a.alert_type,' ',IFNULL(a.remark,"")) alertType,
a.alert_type_code alarmTypeCode,
a.unit_involved unitInvolved,
a.trapped_num trappedNum,
a.casualties_num casualtiesNum,
a.address ,
a.coordinate_x longitude,
a.coordinate_y latitude,
a.record_url,
a.alert_status,
CASE a.response_level_code
WHEN '1164' THEN '紧急出动'
WHEN '1165' THEN '集结待命'
WHEN '1166' THEN '原地待命'
ELSE '' END responseLevelCode
FROM jc_alert_called a
where a.is_delete=0 and a.alert_type_code = '1214'
<!--AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL-->
<if test='par.status==0'>
and a.alert_status =0
</if>
<if test='par.status==1'>
and a.alert_status =1
</if>
<if test='par.address!=null and par.address!="" '>
and a.address like CONCAT('%',#{par.address},'%') || a.alert_type like CONCAT('%',#{par.address},'%')
</if>
<if test='par.alertId!=null'>
and a.sequence_nbr =#{par.alertId}
</if>
<if test='par.whether24!=false'>
and a.call_time &gt;= (NOW() - interval 24 hour)
</if>
<if test='par.orderTime=="1"'>
ORDER BY a.call_time DESC
</if>
<if test='par.orderTime=="2"'>
ORDER BY a.call_time
</if>
<if test='par.orderTime==null'>
ORDER BY a.call_time DESC
</if>
<if test='pageNum!=null and pageSize !=null'>
limit #{pageNum},#{pageSize}
</if>
</select>
<select id="alertCalledListByAlertStatusCountByAid" resultType="Integer">
SELECT
COUNT(*)
FROM jc_alert_called a
where a.is_delete=0
AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL and a.alert_type_code = '1214'
<if test='par.status==0'>
and a.alert_status =0
</if>
<if test='par.status==1'>
and a.alert_status =1
</if>
<if test='par.address!=null and par.address!="" '>
and a.address like CONCAT('%',#{par.address},'%')
</if>
<if test='par.whether24!=false'>
and a.call_time &gt;= (NOW() - interval 24 hour)
</if>
</select>
<select id="selectAidPage" resultType="com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled">
SELECT
a.sequence_nbr,
a.alert_status,
a.type,
a.alert_stage,
a.alarm_type,
a.alarm_type_code,
a.call_record_id,
a.father_alert,
a.response_level_code,
a.contact_user,
a.contact_phone,
a.call_time,
a.call_time_num,
a.alert_source,
a.alert_source_code,
a.alert_type,
a.alert_type_code,
a.unit_involved,
a.trapped_num,
a.casualties_num,
a.address,
a.rescue_grid,
a.coordinate_x,
a.coordinate_y,
a.response_level,
a.system_source,
a.system_source_code
FROM
jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
, jc_power_transfer j
</if>
<where>
a.is_delete = 0 and a.alert_type_code = #{alertTypeCode}
<if test="alertStatus!= null ">
and a.alert_status = #{alertStatus}
</if>
<if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.call_time between #{startTime} and #{endTime}
</if>
<if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alert_type_code = #{alertTypeCode}
</if>
<if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode}
</if>
<if test="systemSourceCode!= null ">
and a.system_source_code in (${systemSourceCode})
</if>
<if test="isFatherAlert != null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr
</if>
<if test="data == 'address' and data != null and lift != null ">
order by CONVERT(address USING 'gbk') ${lift} limit #{current},#{size}
</if>
<if test="data != null and data != 'address' and lift != null ">
order by ${data} ${lift} limit #{current},#{size}
</if>
<if test="data == null ">
order by a.call_time DESC limit #{current},#{size}
</if>
</where>
</select>
<select id="selectAidCount" resultType="int">
SELECT
count(b.num)
FROM
(SELECT
a.sequence_nbr as num
FROM
jc_alert_called a
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
,jc_power_transfer j
</if>
<where>a.is_delete = 0
<if test="alertStatus!= null ">
and a.alert_status = #{alertStatus}
</if>
<if test="startTime!= null and endTime != null and startTime!= '' and endTime != ''">
and a.call_time between #{startTime} and #{endTime}
</if>
<if test="alertTypeCode!= null and alertTypeCode!= '' ">
and a.alert_type_code = #{alertTypeCode}
</if>
<if test="alertSourceCode!= null ">
and a.alert_source_code = #{alertSourceCode}
</if>
<if test="systemSourceCode!= null ">
and a.system_source_code in (${systemSourceCode})
</if>
<if test="isFatherAlert!= null and isFatherAlert == 'true' ">
and j.alert_called_id = a.sequence_nbr
GROUP BY a.sequence_nbr
</if>
</where>) b
</select>
<select id="alertCalledListByAlertStatusCount" resultType="Integer">
<select id="alertCalledListByAlertStatusCount" resultType="Integer">
SELECT
COUNT(*)
FROM jc_alert_called a
where a.is_delete=0
where a.is_delete=0 and a.alert_type_code <![CDATA[ <> ]]> 1214
AND a.coordinate_x IS NOT NULL
AND a.coordinate_y IS NOT NULL
<if test='par.status==0'>
......
......@@ -248,6 +248,71 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(pageBean);
}
/**
* 120警情列表
*
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "JQ/listBy120")
@ApiOperation(httpMethod = "GET", value = "警情列表查询", notes = "警情列表查询")
public ResponseModel<Object> listPageByAid(RequestData par) {
par.setStatus(0);
List<AlertCalledZhDto> list = iAlertCalledService.alertCalledListByAlertStatusByAid(null, null, par);
return ResponseHelper.buildResponse(list);
}
/**
* 分页警情列表
*
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "history/listByAid")
@ApiOperation(httpMethod = "GET", value = "警情列表查询", notes = "警情列表查询")
public ResponseModel<Page<AlertCalledZhDto>> listhistoryPageByAid(Integer pageNum, Integer pageSize, RequestData par) {
if (par.getStatus() != null && par.getStatus() == -1) {
AgencyUserModel agencyUserModel = getUserInfo();
Long id = null;
//获取用户已绑定车辆id、
UserCar userCar = userCarService.selectByAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
//获取正在进行的灾情null
if (userCar != null) {
AlertCalled alertCalled = powerTransferCompanyResourcesService.getByPowerTransferCompanyResourId(userCar.getCarId());
if (alertCalled != null) {
par.setAlertId(alertCalled.getSequenceNbr());
par.setStatus(null);
} else {
return ResponseHelper.buildResponse(null);
}
} else {
return ResponseHelper.buildResponse(null);
}
} else {
if (par.getStatus() == null) {
par.setStatus(1);
}
}
if (null == pageNum || null == pageSize) {
pageNum = 1;
pageSize = Integer.MAX_VALUE;
} else {
pageNum = (pageNum - 1) * pageSize;
}
List<AlertCalledZhDto> list = iAlertCalledService.alertCalledListByAlertStatusByAid(pageNum, pageSize, par);
Page<AlertCalledZhDto> pageBean = new Page<>(pageNum, pageSize);
Integer num = iAlertCalledService.alertCalledListByAlertStatusCountByAid(par);
pageBean.setRecords(list);
pageBean.setTotal(num);
return ResponseHelper.buildResponse(pageBean);
}
/**
* 保卫目标分页查询
......
......@@ -211,6 +211,13 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("急救科当天值班人信息列表")
@GetMapping("/person/on_duty/listBy120")
public ResponseModel listOnDutyPersonByAid() {
return ResponseHelper.buildResponse(iDutyPersonService.listOnDutyPersonByAid());
}
// /**
// *
// *
......
......@@ -97,6 +97,74 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return iPage;
}
//120系统迁移接口 sql固定查询急救科下值班人员
@Override
public List<Map<String, Object>> listOnDutyPersonByAid() {
String groupCode = this.getGroupCode();
// 获取当前班次列表
DateTime now = new DateTime();
List<Long> shiftIdList = getOnDuty(now);
String shiftIds = StringUtils.join(shiftIdList.toArray(), ",");
String dutyDay = now.toString("yyyy-MM-dd");
// 获取当前值班人员
List<DynamicFormColumn> columns = dynamicFormColumnService
.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPersonByAid(dutyDay, shiftIds,
fieldCodes, groupCode);
// 获取人员照片和电话
List<Long> ids = new ArrayList<>();
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId")))));
try {
List<Map<String, Object>> orgUsrList = orgUsrService.selectForShowByListId(ids);
maps.forEach(item -> {
String userId = String.valueOf(item.get("userId"));
//此处是用来给119日常值班首页值班岗位排序用
String sort = "";
switch ( item.get("postType").toString() ){
case "826" :
sort = "4";
break;
case "824" :
sort = "3";
break;
case "825" :
sort = "2";
break;
case "827" :
sort = "1";
break;
}
item.put("postSort",sort);
for (Map<String, Object> usr : orgUsrList) {
if (userId.equals(String.valueOf(usr.get("sequenceNbr")))) {
item.put("personImg", usr.get("personImg"));
item.put("telephone", usr.get("telephone"));
item.put("companyId", usr.get("companyId"));
item.put("bizOrgType", usr.get("bizOrgType"));
item.put("parentId", usr.get("parentId"));
break;
}
}
});
maps= maps.stream().sorted((map1,map2)->{
if (map1.get("companyId").toString().equals(map2.get("companyId").toString())){
if (map1.get("deptId").toString().equals(map2.get("deptId").toString())){
return map2.get("postSort").toString().compareTo(map1.get("postSort").toString());
}else {
return map1.get("deptId").toString().compareTo(map2.get("deptId").toString());
}
}else {
return map1.get("companyId").toString().compareTo(map2.get("companyId").toString());
}
}).collect(Collectors.toList());
} catch (Exception e) {
e.printStackTrace();
}
return maps;
}
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
// 获取值班的实例id
String instanceId = m.get("instanceId").toString();
......
......@@ -425,6 +425,21 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.getAlertInfoList(beginDate, endDate));
}
/**
* 查询120系统指定日期内警情列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/dateRange/listBy120")
@ApiOperation(httpMethod = "GET", value = "查询120系统指定日期内警情列表", notes = "查询120系统指定日期内警情列表")
public ResponseModel<Map<String, Object>> listByDateRangeAid
(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam("endDate") String endDate) {
return ResponseHelper.buildResponse(iAlertCalledService.getAlertAidInfoList(beginDate, endDate));
}
/**
* <pre>
* 设备联动紧急响应
......@@ -593,4 +608,67 @@ public class AlertCalledController extends BaseController {
public ResponseModel<Object> toCompletePoliceSituationMatch() throws MqttException {
return ResponseHelper.buildResponse(iAlertCalledService.selectFlightNumber());
}
/**
*
* 以下均为120接口
*
* */
/**
* 列表分页查询
*
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/listBy120")
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
public ResponseModel<IPage<AlertCalled>> listPageBy120(String pageNum, String pageSize, String sort, AlertCalled alertCalled, Integer alertStatus,
String alertTypeCode,
String alertSourceCode,
String callTimeEnd,
String callTimeStart,
String systemSourceCode,
@RequestParam(value ="isFatherAlert",required = false) String isFatherAlert) {
/* Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page);
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort); */
/*分页存在问题 修改分页参数 陈召 2021-09-22 开始*/
Page<AlertCalled> page = new Page<>();
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
page = new Page<>();
page.setCurrent(0L);
page.setSize(Long.MAX_VALUE);
} else {
page.setCurrent((Long.parseLong(pageNum) - 1) * Long.parseLong(pageSize));
page.setSize(Long.parseLong(pageSize));
}
/*分页存在问题 修改分页参数 陈召 2021-09-22 结束*/
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/
/* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件
alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code
陈召 2021-08-21 开始*/
IPage<AlertCalled> alertCalledIPage = null;
//此接口为120系统自用 所以这里参数固定为120code值
alertCalledIPage = iAlertCalledService.queryForCalledListByAid(page, alertStatus, alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd, sort,isFatherAlert,systemSourceCode);
/* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/
alertCalledIPage.getRecords().stream().forEach(e -> {
if (e.getAlertStatus()) {
e.setAlertStatusStr(AlertStatusEnum.CLOSED.getName());
} else {
e.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getName());
}
});
/* bug 2406 接警记录,列表缺少警情状态字段 by litw end*/
return ResponseHelper.buildResponse(alertCalledIPage);
/* bug2408 筛选参数解析异常 修改筛选条件方法 陈召 2021-08-21 结束*/
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束*/
}
}
\ No newline at end of file
......@@ -83,6 +83,22 @@ public class ShiftChangeController extends BaseController {
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/pageBy120")
@ApiOperation(httpMethod = "GET", value = "交接班记录分页查询", notes = "交接班记录分页查询")
public ResponseModel queryForPageByAid(
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
return ResponseHelper.buildResponse(iShiftChangeService.queryForShiftChangePageByAid(current, size));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "交接班记录分页查询", notes = "交接班记录分页查询")
public ResponseModel queryForPage(
......
......@@ -193,6 +193,127 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return alertCalledMapper.alertCalledListByAlertStatusCount(par);
}
/**
* 指挥系统 未结束的120警情列表
**/
@Override
public List<AlertCalledZhDto> alertCalledListByAlertStatusByAid(Integer pageNum, Integer pageSize, RequestData par) {
List<AlertCalledZhDto> list = alertCalledMapper.alertCalledListByAlertStatusByAid(pageNum, pageSize, par);
return list;
}
@Override
public int alertCalledListByAlertStatusCountByAid(RequestData par) {
return alertCalledMapper.alertCalledListByAlertStatusCountByAid(par);
}
public IPage<AlertCalled> queryForCalledListByAid(Page pageBean, Integer alertStatus, String alertTypeCode,
String alertSourceCode, String startTime, String endTime, String sort, String isFatherAlert, String systemSourceCode) {
String[] split = sort != null ? sort.split(",") : null;
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 start */
if (split != null) {
if (split[0] != null) {
if (split[0].equals("alertType") || split[0].equals("alertSource") || split[0].equals("alarmType")) {
split[0] = split[0] + "Code";
}
if (split[0].equals("alertStatusStr")) {
split[0] = "alertStatus";
}
}
if (split[1] != null) {
if (split[1].equals("ascend")) {
split[1] = "ASC";
}
if (split[1].equals("descend")) {
split[1] = "DESC";
}
}
}
String data = split != null ? RedisKey.humpToLine(split[0]) : null;
/* 2407 【web】日常值班>警情记录>接警记录,表头排序功能失效 chenzhao 09-28 end */
String lift = split != null ? split[1] : null;
alertTypeCode = "1214";
List<AlertCalled> list = alertCalledMapper.selectAidPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus,
alertTypeCode, alertSourceCode, startTime, endTime, data, lift, isFatherAlert,systemSourceCode);
IPage<AlertCalled> iPage = new Page<>();
iPage.setRecords(list);
iPage.setTotal(alertCalledMapper.selectAidCount(alertStatus, alertTypeCode, alertSourceCode, startTime, endTime,
isFatherAlert,systemSourceCode));
// iPage.setSize(pageBean.getSize());
return iPage;
/* bug2407 表头筛选失效 补充条件方法 XML中添加了排序条件判断 data代表排序条件 lift 升降序 陈召 2021-09-03 结束 */
}
public List<Map<String, Object>> listByDateRangeAid(String beginDate, String endDate) {
// 查询指定日期内的警情列表
List<AlertCalled> alertCalledList = this.list(new LambdaQueryWrapper<AlertCalled>()
.apply(!ValidationUtil.isEmpty(beginDate), "call_time >= '" + beginDate + "'")
.le(true, AlertCalled::getCallTime, endDate).eq(AlertCalled::getAlertTypeCode,"1214"));
Map<String, String> queryParams = Maps.newHashMap();
queryParams.put("beginDate", beginDate);
queryParams.put("endDate", endDate);
List<Map<String, Object>> allList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(alertCalledList)) {
Map<String, List<AlertCalled>> alertCalledMap = alertCalledList.stream()
.collect(Collectors.groupingBy(AlertCalled::getAlertTypeCode));
Map<Long, AlertCalled> calledMap = alertCalledList.stream()
.collect(Collectors.toMap(AlertCalled::getSequenceNbr, Function.identity()));
alertCalledMap.forEach((alertTypeCode, list) -> {
allList.addAll(iAlertFormValueService.listAll(alertTypeCode, queryParams));
});
allList.forEach(i -> {
// 增加非空判断 cz 2021-10-08
if (calledMap.get(Long.parseLong(i.get("instanceId").toString())) != null) {
AlertCalled alertCalled = calledMap.get(Long.parseLong(i.get("instanceId").toString()));
i.putAll(Bean.BeantoMap(alertCalled));
}
});
}
// 按接警时间正序排序
allList.sort((e, o) -> comparingByGroupVal(e, o, "recDate"));
return allList;
}
public Map<String, Object> getAlertAidInfoList(String beginDate, String endDate) {
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> list = listByDateRangeAid(beginDate, endDate);
// 获取接警情况模板
List<Template> templateList = templateMapper.selectList(new LambdaQueryWrapper<Template>()
.eq(Template::getFormat, false).like(Template::getTypeCode, DutyInfoEnum.接警情况.getKey() + "-"));
Map<String, Template> templateMap = templateList.stream()
.collect(Collectors.toMap(Template::getTypeCode, Function.identity()));
List<String> contentList = Lists.newArrayList();
// 增加非空判断 cz 2021-10-08
list.forEach(i -> {
if (i.get("alertTypeCode") != null) {
String tempContent = templateMap.get(DutyInfoEnum.接警情况.getKey() + "-" + i.get("alertTypeCode"))
.getContent();
contentList.add(replaceTemplate(tempContent, i));
}
});
Map<String, Integer> statusCountMap = alertCalledMapper.queryAlertStatusCount(beginDate, endDate);
Integer unFinishedCount = this
.count(new LambdaQueryWrapper<AlertCalled>().eq(AlertCalled::getAlertStatus, false));// bug2532
// 未结案警情统计错误
// bykongfm
result.put("alertInfoList", contentList);
result.putAll(statusCountMap);
result.put("unFinishedCount", unFinishedCount);
return result;
}
/**
* 接警记录 列表分页查询
**/ /*
......
......@@ -13,6 +13,7 @@ import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -68,6 +69,7 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
shiftChange.setInstanceId(instanceId);
shiftChange.setDutyJson(shiftChange.getDutyJson() == null ? new JSONObject() : shiftChange.getDutyJson());
shiftChange.setPowerJson(shiftChange.getPowerJson() == null ? new JSONObject() : shiftChange.getPowerJson());
shiftChange.setSystemType(shiftChange.getSystemType() == null ?null : shiftChange.getSystemType());
this.save(shiftChange);
return model;
}
......@@ -97,7 +99,26 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override
public IPage<Map<String, Object>> queryForShiftChangePage(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
List<ShiftChange> shiftChanges = this.list();
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.isNull(ShiftChange::getSystemType);
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
return page;
}
@Override
public IPage<Map<String, Object>> queryForShiftChangePageByAid(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ShiftChange::getSystemType,"120");
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
......
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