Commit 4dd08c29 authored by tangwei's avatar tangwei

解决冲突

parents 086639f3 cd2b8bb0
package com.yeejoin.amos.boot.biz.common.service;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import java.util.List;
......@@ -18,4 +19,6 @@ public interface IDataDictionaryService {
Object gwmcDataDictionary(String type) throws Exception;
List<MenuFrom> getGWMCDataDictionary(String type) throws Exception;
public List<DataDictionary> getByType(String type);
}
......@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.dto.DataDictionaryDto;
......@@ -106,4 +107,10 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return list;
}
public List<DataDictionary> getByType(String type) {
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<DataDictionary>();
wrapper.eq(DataDictionary::getIsDelete, false);
wrapper.eq(DataDictionary::getType, type);
return this.baseMapper.selectList(wrapper);
}
}
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "DutyFirstAidDto", description = "120急救站值班")
public class DutyFirstAidDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "单位ID")
private String teamId;
@ApiModelProperty(value = "单位名称")
private String teamName;
@ApiModelProperty(value = "岗位id")
private String postType;
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ApiModelProperty(value = "值班结束时间")
private String endTime;
@ApiModelProperty(value = "120急救站")
private String firstAid;
@ApiModelProperty(value = "120急救站Id")
private String firstAidId;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import java.util.List;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "DutyFirstAidExcleDto", description = "120急救站值班")
public class DutyFirstAidExcleDto implements Serializable{
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer number;
@ExcelIgnore
@ApiModelProperty(value = "单位ID")
private String teamId;
@ExcelProperty(value = "单位名称", index = 1)
@ApiModelProperty(value = "单位名称")
private String teamName;
@ExcelIgnore
@ApiModelProperty(value = "用户id")
private String userId;
@ExcelProperty(value = "用户名称", index = 2)
@ApiModelProperty(value = "用户名称")
private String userName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
private String postType;
@ExcelProperty(value = "岗位", index = 3)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ExcelProperty(value = "120急救站", index = 4)
@ApiModelProperty(value = "120急救站")
private String firstAid;
@ExcelIgnore
@ApiModelProperty(value = "120急救站Id")
private String firstAidId;
@ExcelIgnore
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ExcelIgnore
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ExcelIgnore
@ApiModelProperty(value = "值班结束时间")
private String endTime;
}
......@@ -72,4 +72,60 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("beginDate") String beginDate,
@Param("endDate") String endDate
);
/**
* 获取指定日期下的当前排班的人员列表
* eg : {"name":"夜班","value":"李某某、张作霖、张作相"}
* @param dutyDate
* @param groupCode
* @param targetFiled
* @return
*/
List<Map<String, Object>> getSpecifyDateList(String dutyDate,String groupCode,String[] instanceIds,String params);
/**
* 获取指定日期下的装备ID、eg:车辆、微型消防站
* @param dutyDate
* @param groupCode
* @param targetFiled
* @return
*/
List<Map<String, Object>> getEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String teamName,String groupByName);
/**
* 通过装备ID查询指定如期下的该装备所包含的InstanceId
* @param dutyDate
* @param groupCode
* @param targetId eg: carId
* @return
*/
Map<String, Object> getInstanceIdForSpecifyDateAndEquipment(String dutyDate,String groupCode,String targetId);
/**
* 获取指定日期装备的操作人员,例如车辆的驾驶员
* @param dutyDate
* @param groupCode
* @param instanceIds
* @param operator
* @return
*/
Map<String, Object> getEquipmentOperator(String dutyDate,String groupCode,String[] instanceIds,String operator,String duty);
/**
* 获取指定日期下的排班人员与岗位等信息
* @param dutyDate
* @param groupCode
* @param instanceIds
* @return
*/
List<Map<String, Object>> getPositionStaffDutyForSpecifyDate(String dutyDate,String groupCode,String[] instanceIds,String duty);
/**
* 获取指定日期下的班次信息
* @param duty
* @return
*/
List<Map<String, Object>> getDutyForSpecifyDate(String duty);
}
......@@ -29,4 +29,5 @@ public interface IDutyCarService extends IDutyCommonService {
* @return
*/
JSONObject isFireCarDriver();
}
......@@ -116,4 +116,6 @@ public interface IDutyCommonService {
* @param dutyShiftList
*/
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList);
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType);
}
......@@ -17,4 +17,5 @@ public interface IDutyFireFightingService extends IDutyCommonService {
* @return List<DutyCarDto>
*/
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto);
}
package com.yeejoin.amos.boot.module.common.api.service;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
public interface IDutyFirstAidService extends IDutyCommonService {
/**
* 值班信息保存
* @param DutyFireFightingDto 对象
* @return List<DutyCarDto>
*/
DutyFirstAidDto save(DutyFirstAidDto dto);
/**
* 更新
* @param instanceId 实例id
* @param DutyFireFightingDto 业务对象
* @return List<DutyCarDto>
*/
DutyFirstAidDto update(Long instanceId, DutyFirstAidDto dto);
public List< Map<String, Object>> getFirstAidExportData(List<String> ids) ;
}
......@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import java.util.List;
import java.util.Map;
/**
* 消防队伍 服务类
......@@ -44,4 +45,6 @@ public interface IFireTeamService {
* **/
List<FireTeamZhDto> getFireTeamCountList();
public List<FireTeam> getFirstAidForTypeCodeAndCompanyId(String dicCode,String typeCode,Long companyId);
}
......@@ -239,4 +239,7 @@ public interface IOrgUsrService {
OrgUsr selectByAmosOrgId(Long id);
public List<OrgUsr> getPersonListByParentIds(List<String> ids) ;
List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList);
}
<?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.amos.boot.module.common.api.mapper.DutyPersonShiftMapper">
<mapper
namespace="com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper">
<select id="calMaxPersonAndShiftNum" resultType="java.util.Map">
select
(select
......@@ -17,8 +18,10 @@
and s.instance_id = i.instance_id
AND i.field_code = 'userId'
and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate}
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14-->
and s.duty_date <![CDATA[<=]]>
#{endDate}
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。
同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 -->
and s.app_Key = #{appKey}
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay,
......@@ -36,7 +39,8 @@
and s.instance_id = i.instance_id
AND i.field_code = 'userId'
and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate}
and s.duty_date <![CDATA[<=]]>
#{endDate}
and s.app_Key = #{appKey}
GROUP BY s.duty_date) b) as maxShiftNumDay
</select>
......@@ -91,6 +95,217 @@
mysql.help_topic,
( SELECT @s := 0 ) temp
WHERE
@s <![CDATA[<=]]> DATEDIFF(#{endDate},#{beginDate})
@s <![CDATA[<=]]>
DATEDIFF(#{endDate},#{beginDate})
</select>
<select id='getSpecifyDateList' resultType='map'>
SELECT
GROUP_CONCAT(cd.field_value) AS
value
,
cds.name
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
) cds ON cd.instance_id = cds.instance_id
WHERE
cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0
AND cd.field_code = 'userName'
<if test="params != null and params!='' ">
and cd.field_value !='消防车驾驶员'
</if>
AND cd.instance_id IN
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId}
</foreach>
GROUP BY
cds.`name`
</select>
<select id='getEquipmentForSpecifyDate' resultType='map'>
select * from (
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentId} THEN
cd.FIELD_VALUE
END
) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN
cd.FIELD_VALUE
END
) AS #{equipmentName},
MAX(
CASE
WHEN cd.FIELD_CODE = #{teamName} THEN
cd.FIELD_VALUE
END
) AS #{teamName}
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate} and dp.is_delete=0
) cds ON cd.instance_id = cds.instance_id
where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0
group by cd.instance_id
) result group by ${groupByName}
</select>
<select id='getInstanceIdForSpecifyDateAndEquipment'
resultType='map'>
SELECT
GROUP_CONCAT(cd.instance_id) as instanceIds
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
) cds ON cd.instance_id = cds.instance_id
WHERE
cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0
AND cd.field_value = #{targetId}
</select>
<select id='getEquipmentOperator' resultType='map'>
SELECT
result.userName
FROM
(
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = 'postTypeName' THEN
cd.FIELD_VALUE
END
) AS 'postTypeName',
cds. NAME
FROM
cb_dynamic_form_instance cd
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
) cds ON cd.instance_id = cds.instance_id
WHERE
cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0
AND cd.instance_id IN
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId}
</foreach>
) result
WHERE
result.postTypeName = #{operator} and result.name =#{duty}
</select>
<select id ='getPositionStaffDutyForSpecifyDate' resultType="map">
SELECT
GROUP_CONCAT(ss.userName) AS userName,
ss.postTypeName
FROM
(
SELECT
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX(
CASE
WHEN cd.FIELD_CODE = 'postTypeName' THEN
cd.FIELD_VALUE
END
) AS 'postTypeName',
cd.instance_id
FROM
cb_dynamic_form_instance cd
WHERE
cd.instance_id in
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId}
</foreach>
AND cd.group_code = #{groupCode}
AND cd.is_delete = 0
GROUP BY
cd.instance_id
) ss
LEFT JOIN (
SELECT
dp.instance_id,
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
AND NAME IS NOT NULL
) cds ON ss.instance_id = cds.instance_id
WHERE
cds.NAME =#{duty}
GROUP BY
ss.postTypeName
</select>
<select id='getDutyForSpecifyDate' resultType="map">
SELECT
ds.`name`
FROM
cb_duty_person_shift dp
LEFT JOIN cb_duty_shift ds ON dp.shift_id = ds.sequence_nbr
WHERE
dp.duty_date = #{dutyDate}
AND dp.is_delete = 0
AND NAME IS NOT NULL
GROUP BY
NAME
</select>
</mapper>
......@@ -27,6 +27,7 @@ public enum ExcelEnums {
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备")
XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB"),//("WXXFZB","微型消防站值班")
JJZB("120急救站值班", "120急救站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidExcleDto","JJZB"),//("JJZB","120急救站值班")
XFAQBG("消防安全报告", "消防安全报告", "com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportExcelDto","XFAQBG");//("XFAQBG","微型消防站值班")
private String fileName;
private String sheetName;
......
......@@ -20,13 +20,17 @@ public enum LatentDangerProcessStateEnum {
*/
待整改("待整改", "2"),
/**
* 待整改资料提交
*/
待整改资料提交("待整改资料提交", "3"),
/**
* 待复核
*/
待复核("待复核", "3"),
待复核("待复核", "4"),
/**
* 治理完毕
*/
治理完毕("治理完毕", "4");
治理完毕("治理完毕", "5");
/**
* 名称,描述
......
......@@ -79,7 +79,7 @@ public interface LatentDangerState {
/**
* 整改完毕
*/
整改完毕("整改完毕", "endOfGovernance", "","", "4");
整改完毕("整改完毕", "endOfGovernance", "","", "5");
/**
* 名称,描述
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 接警记录导出
*/
@Data
@ApiModel(value="AlertCalledRecordDto", description="接警记录导出Dto类")
public class AlertCalledRecordDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "接警时间", index = 0)
@ApiModelProperty(value = "接警时间")
private Date callTime;
@ExcelProperty(value = "报警类型", index = 1)
@ApiModelProperty(value = "报警类型")
private String type;
@ExcelProperty(value = "警情来源", index = 2)
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ExcelProperty(value = "警情类型", index = 3)
@ApiModelProperty(value = "警情类型")
private String alarmType;
@ExcelProperty(value = "警情地址", index = 4)
@ApiModelProperty(value = "警情地址")
private String address;
@ExcelIgnore
@ApiModelProperty(value = "接警开始时间")
private Date callTimeStart;
@ExcelIgnore
@ApiModelProperty(value = "接警结束时间")
private Date callTimeEnd;
}
......@@ -63,4 +63,7 @@ public class AlertPaperInfoDto {
@ApiModelProperty(value = "电梯设备编码")
private String elevatorCode;
@ApiModelProperty(value = "警情结束时间")
private Date finishTime;
}
......@@ -33,4 +33,10 @@ public class WechatMyBusinessListDto {
@ApiModelProperty(value = "业务状态")
private String bussinessStatus;
@ApiModelProperty(value = "上报时间")
private Date reportTime;
@ApiModelProperty(value = "完成时间")
private Date finishTime;
}
......@@ -32,4 +32,10 @@ public class WechatMyTaskListDto {
@ApiModelProperty(value = "派遣时间")
private Date dispatchTime;
@ApiModelProperty(value = "上报时间")
private Date reportTime;
@ApiModelProperty(value = "完成时间")
private Date finishTime;
}
......@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import org.apache.ibatis.annotations.Param;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import java.util.List;
import java.util.Map;
......@@ -78,4 +81,20 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
List<WechatMyBusinessListDto> getBussinessListByPhonePager(@Param("phone") String phone, @Param("bussinessCode") String bussinessCode, @Param("current") Long current);
/**
* 根据条件返回接警记录信息
* @param callTimeStart
* @param callTimeEnd
* @param type
* @param alertSource
* @param alarmType
* @return
*/
List<AlertCalledRecordDto> queryAlertRecordListByQueryDto(
String callTimeStart,
String callTimeEnd,
String type,
String alertSource,
String alarmType);
}
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
......@@ -76,4 +77,15 @@ public interface IAlertCalledService {
WechatMyBussinessDto getBussinessInfoById(Long alertId);
List<WechatMyBusinessListDto> getBussinessListByPhonePager(String phone, String bussinessCode, Long current);
/**
* 根据条件筛选 接警记录
* @param callTimeStart
* @param callTimeEnd
* @param type
* @param alertSource
* @param alarmType
* @return
*/
List<AlertCalledRecordDto> queryAlertRecordListByQueryDto(String callTimeStart,String callTimeEnd, String type, String alertSource, String alarmType);
}
......@@ -188,7 +188,7 @@
a.device_id AS deviceId,
e.address AS
elevatorAddress,
a.region_code AS address,
a.address AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
......@@ -227,8 +227,8 @@
#{emergencyTimeEnd}
</if>
<if test="workOrderNumber != null and workOrderNumber != ''">
and call_time <![CDATA[ <= ]]>
#{endDate}
and a.work_order_number like
CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if>
<if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like
......@@ -471,7 +471,9 @@
a.alert_status as taskStatus,
e.address,
a.call_time as dispatchTime,
a.alert_stage as bussinessStatus
a.alert_stage as bussinessStatus,
a.call_time as reportTime,
p.feedback_finish_time as finishTime
from tz_alert_called a
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id
LEFT JOIN tz_dispatch_paper p on p.alert_id = a.sequence_nbr
......@@ -482,6 +484,42 @@
ORDER BY a.rec_date desc
limit #{current},5
</select>
<select id="queryAlertRecordListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto">
SELECT
a.call_time AS callTime,
a.type ,
a.alert_source AS alertSource,
a.alarm_type AS alarmType,
a.address
FROM
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.sequence_nbr = a.equipment_id
WHERE 1=1
<if test="callTimeStart != null ">
and #{callTimeStart} <![CDATA[ <= ]]>
a.call_time
</if>
<if test="callTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]>
#{callTimeEnd}
</if>
<if test="type != null and type != ''">
and a.type = #{type}
</if>
<if test="alertSource != null and alertSource != ''">
AND a.alert_source = #{alertSource}
</if>
<if test="alarmType != null and alarmType != ''">
AND a.alarm_type = #{alarmType}
</if>
</select>
</mapper>
......@@ -78,7 +78,9 @@
a.alarm_type as taskType,
a.alert_status as taskStatus,
e.address,
p.dispatch_time as dispatch_time
p.dispatch_time as dispatch_time,
a.call_time as reportTime,
p.feedback_finish_time as finishTime
from tz_dispatch_task t
LEFT JOIN tz_alert_called a on a.sequence_nbr = t.alert_id
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id
......
......@@ -152,7 +152,7 @@ public class DutyCarController extends BaseController {
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyCarService.dayDutyPersonList(dutyDay,shiftId,postType));
return ResponseHelper.buildResponse(iDutyCarService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
}
}
\ No newline at end of file
......@@ -155,6 +155,6 @@ public class DutyFireFightingController extends BaseController{
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyFireFightingService.dayDutyPersonList(dutyDay,shiftId,postType));
return ResponseHelper.buildResponse(iDutyFireFightingService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
}
}
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@Api(tags = "120急救站值班接口Api")
@RequestMapping(value = "/common/duty-FirstAid")
public class DutyFirstAidController extends BaseController{
@Autowired
IDutyFirstAidService iDutyFirstAidService;
/**
* 值班列表视图--分页
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page-list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-分页", notes = "值班列表视图-分页")
public ResponseModel<IPage<Map<String, Object>>> pageList(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页面大小", required = true) @RequestParam(value = "size") int size) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.pageList(current, size, beginDate, endDate));
}
/**
* 值班列表视图--不分页
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-不分页", notes = "值班列表视图-不分页")
public ResponseModel list(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.list(null,beginDate, endDate));
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/statistics-day")
@ApiOperation(httpMethod = "GET", value = "值班月视图", notes = "值班月视图")
public ResponseModel<List<Map<String, Object>>> dutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.statisticsDay(beginDate, endDate));
}
/**
* 调班
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping("/duty-adjust")
@ApiOperation(httpMethod = "POST", value = "调班保存", notes = "调班保存")
public ResponseModel dutyAdjustSave(@RequestBody DutyFirstAidDto dto) {
return ResponseHelper.buildResponse(iDutyFirstAidService.save(dto));
}
/**
* 调班
*
* @param instanceId 实例id
* @param dutyCarDto 业务对象
* @return DutyCarDto
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping("/duty-adjust")
@ApiOperation(httpMethod = "PUT", value = "调班更新", notes = "调班更新")
public ResponseModel dutyAdjustUpdate(
@RequestParam Long instanceId,
@RequestBody DutyFirstAidDto dto) {
return ResponseHelper.buildResponse(iDutyFirstAidService.update(instanceId, dto));
}
/**
* 微型消防站导出
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "120急救站导出", notes = "120急救站导出")
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFirstAidService.downloadList(beginDate, endDate));
}
/**
* 值班数据删除
*
* @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId)
|| ValidationUtil.isEmpty(startTime)
|| ValidationUtil.isEmpty(endTime)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(iDutyFirstAidService.deleteDutyData(instanceId, startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定日期值班人信息列表")
@GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyFirstAidService.getSchedulingDutyForSpecifyDate(dutyDay,shiftId,postType));
}
}
......@@ -85,7 +85,12 @@ public class FireExpertsController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<FireExpertsDto> updateBySequenceNbrFireExperts(@RequestBody FireExpertsDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
/*bug 3098 联动专家,编辑时领域选择子分类保存,领域数据未修改 chenzhao 2021-10-14 */
model.setSequenceNbr(sequenceNbr);
String expertCode = model.getExpertCode();
DataDictionary zjly = dataDictionaryService.getByCode(expertCode, "ZJLY");
model.setExpert(zjly.getName());
/*bug 3098 联动专家,编辑时领域选择子分类保存,领域数据未修改 chenzhao 2021-10-14 */
return ResponseHelper.buildResponse(fireExpertsServiceImpl.updateWithModel(model));
}
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
......@@ -139,4 +140,18 @@ public class FireStationController extends BaseController {
public ResponseModel<List<FireStationDto>> selectForList() {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false));
}
/**
* 查询机场单位
*
* @return
* @throws Exception
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/company/listTree", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "查询机场单位树", notes = "查询机场单位树")
public ResponseModel<List<MenuFrom>> listCompanyTree() throws Exception {
List<MenuFrom> menus = fireStationServiceImpl.getCompanyTeamTree();
return ResponseHelper.buildResponse(menus);
}
}
......@@ -159,6 +159,13 @@ public class FirefightersPostController extends BaseController {
public ResponseModel<Object> updateByIdFirefightersPost(@RequestBody FirefightersDataDto firefightersDataDto) {
try {
FirefightersPost firefightersPost = firefightersDataDto.getFirefightersPost();
/*bug3101 编辑页面专家领域选择子分类保存成功后,领域未修改 2021-10-15 chenzhao */
if (firefightersDataDto.getFirefightersPost().getAreasExpertiseCode() != null){
String areasExpertiseCode = firefightersDataDto.getFirefightersPost().getAreasExpertiseCode();
DataDictionary zjly = dataDictionaryService.getByCode(areasExpertiseCode, "ZJLY");
firefightersDataDto.getFirefightersPost().setAreasExpertise(zjly.getName());
}
/*bug3101 编辑页面专家领域选择子分类保存成功后,领域未修改 2021-10-15 chenzhao */
iFirefightersPostService.updateById(firefightersPost);
ifirefightersWorkexperienceService.updateById(firefightersDataDto.getFirefightersWorkexperience());
ifirefightersEducationService.updateById(firefightersDataDto.getFirefightersEducation());
......
......@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -132,9 +133,11 @@ public class FirefightersThoughtController extends BaseController {
if(redisUtils.hasKey(RedisKey.THOUGHT_ID+id)){
Object obj= redisUtils.get(RedisKey.THOUGHT_ID+id);
Map<String, Object> mainMap = Bean.BeantoMap(obj);
((Map<String,Object>) obj).put("attachments", sourceFileService.getAttachments(id));
/*Map<String, Object> mainMap = Bean.BeantoMap(obj);
mainMap.put("attachments", sourceFileService.getAttachments(id));
return ResponseHelper.buildResponse(mainMap);
return ResponseHelper.buildResponse(mainMap);*/
return ResponseHelper.buildResponse((Map<String,Object>) obj );
}else{ FirefightersThought firefightersThought= iFirefightersThoughtService.getById(id);
redisUtils.set(RedisKey.THOUGHT_ID+id, JSON.toJSON(firefightersThought),time);
Map<String, Object> mainMap = Bean.BeantoMap(firefightersThought);
......
......@@ -30,12 +30,15 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
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.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -517,4 +520,16 @@ public class OrgUsrController extends BaseController {
public ResponseModel<AgencyUserModel> getAmosIdByOrgUserId(@PathVariable String orgUserId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getAmosIdByOrgUserId(orgUserId));
}
/**
* 根据单位id列表或未同步的机场单位列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/unSync/orgCompany")
@ApiOperation(httpMethod = "GET", value = "将所有机场单位数据同步到消防监督服务p_point表", notes = "将所有机场单位数据同步到消防监督服务p_point表")
public ResponseModel getUnSyncOrgCompanyList(@RequestParam List<Long> companyIdList) {
return ResponseHelper.buildResponse(iOrgUsrService.getUnSyncOrgCompanyList(companyIdList));
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
......@@ -31,10 +32,12 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -50,9 +53,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;
......@@ -90,8 +91,14 @@ public class WaterResourceController extends BaseController {
String resourceType = model.getResourceType();
Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class,
e -> e.getCode().equals(resourceType));
/*bug 2913 截取名字防止传递文件名太长随机生成文件名保存 chenzhao 2021-09-30 start*/
List<Object> realityImgList = model.getRealityImgList();
realityImgList.forEach(i->{
((Map<String, Object>) i).put("name",QRCodeUtil.generateQRCode()+"."+i.toString().substring(i.toString().lastIndexOf(".") + 1).toLowerCase());
});
/*截取名字防止传递文件名太长随机生成文件名保存 chenzhao 2021-09-30 end*/
model.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList()));
model.setRealityImg(JSONArray.toJSONString(realityImgList));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
......@@ -20,12 +19,11 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
......@@ -49,6 +47,9 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Autowired
EquipFeignClient equipFeign;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Override
public String getGroupCode() {
return "dutyCar";
......@@ -57,8 +58,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override
public DutyCarDto save(DutyCarDto dutyCarDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据
if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
// 1.保存行数据
if (StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
// 根据建筑id 查找建筑
ResponseModel<Map<String, Object>> response = null;
try {
......@@ -72,11 +73,11 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
// 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28
Long instanceId =excuteDynamicFormInstance(dutyCarDto.getUserId(),map,this.getGroupCode());
saveDutyPersonShiftDetail( instanceId ,dutyCarDto.getDutyShift() ,dutyCarDto.getStartTime()) ;
Long instanceId = excuteDynamicFormInstance(dutyCarDto.getUserId(), map, this.getGroupCode());
saveDutyPersonShiftDetail(instanceId, dutyCarDto.getDutyShift(), dutyCarDto.getStartTime());
insertPersonShift(instanceId, dutyCarDto.getDutyShift());
// 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28
//3.返回保存后的数据
// 3.返回保存后的数据
return dutyCarDto;
}
......@@ -84,16 +85,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override
public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) {
//修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dutyCarDto));
//修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
//5.更新值班信息人日期数据
// 修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dutyCarDto));
// 修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
// 5.更新值班信息人日期数据
insertPersonShift(instanceId, dutyCarDto.getDutyShift());
return dutyCarDto;
}
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) {
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column,
DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
}
......@@ -106,9 +107,8 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
String loginUserId = RequestContext.getExeUserId();
// 根据登陆人id查询对应消防人员
Firefighters firefighters =
firefightersMapper.selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount,
loginUserId));
Firefighters firefighters = firefightersMapper
.selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount, loginUserId));
if (ValidationUtil.isEmpty(firefighters)) {
return result;
}
......@@ -135,10 +135,88 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
result.put("isDriver", true);
result.put("carId", personList.get(0).get("carId"));
ResponseModel<Map<String, Object>> resultModel =
equipFeignClient.queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
ResponseModel<Map<String, Object>> resultModel = equipFeignClient
.queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
Map<String, Object> carInfo = resultModel.getResult();
result.put("carStatus", carInfo.get("carStatus"));
return result;
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
LinkedHashMap<String, Object> titleMap_1 =new LinkedHashMap<String, Object>();
titleMap_1.put("消防车辆", map.get("carName").toString());
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 =new LinkedHashMap<String, Object>();
titleMap_2.put("单位/部门", map.get("teamName").toString());
resultList.add(titleMap_2);
String carId =map.get("carId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if(instanceMap==null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) {
continue;
}
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString());
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
// 获取当前装备ID下的排版数据
// List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getSpecifyDateList(dutyDay,
// this.getGroupCode(), instanceIds,null);
// for (Map<String, Object> specify : specifyDateList) {
//
// if(!specify.containsKey("name") || specify.get("name").toString()==null) {
// continue;
// }
// LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
// infoMap_1.put(specify.get("name").toString(), "");
// resultList.add(infoMap_1);
// Map<String, Object> equipmentOperatorMap = dutyPersonShiftMapper.getEquipmentOperator(dutyDay,
// this.getGroupCode(), instanceIds, "消防车驾驶员", specify.get("name").toString());
// String operator =null;
// if (equipmentOperatorMap!=null && equipmentOperatorMap.containsKey("userName")) {
// operator = equipmentOperatorMap.get("equipmentOperatorMap").toString();
// }
// LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
// infoMap_2.put("驾驶员", operator!=null?operator:"");
// resultList.add(infoMap_2);
// LinkedHashMap<String, Object> infoMap_3 =new LinkedHashMap<String, Object>();
// infoMap_3.put("战斗员",specify.get("value").toString());
// resultList.add(infoMap_3);
// }
}
detailList.add(resultList);
}
return detailList;
}
}
......@@ -36,6 +36,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
......@@ -299,6 +300,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
list = jsonArray.toJavaList(DutyPersonDto.class);
}else if("dutyFireFighting".equals(groupCode)){
list = jsonArray.toJavaList(DutyFireFightingDto.class);
}else if("dutyFirstAid".equals(groupCode)){
list = jsonArray.toJavaList(DutyFirstAidDto.class);
}
return list;
}
......@@ -591,4 +594,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
}
@Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
// TODO Auto-generated method stub
return null;
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -9,13 +13,22 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service
public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService {
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
public String getGroupCode() {
return "dutyFireFighting";
}
@Override
@Transactional(rollbackFor = Exception.class)
public DutyFireFightingDto save(DutyFireFightingDto dto) {
......@@ -32,13 +45,61 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
@Override
public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) {
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dto));
updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "fireFightingId", "fireFighting", "teamName","result.fireFightingId");
if(equipmentList==null || equipmentList.size()<1 || equipmentList.get(0)==null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
LinkedHashMap<String, Object> titleMap_1 =new LinkedHashMap<String, Object>();
titleMap_1.put("微型消防站", map.get("fireFighting").toString());
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 =new LinkedHashMap<String, Object>();
titleMap_2.put("单位/部门", map.get("teamName").toString());
resultList.add(titleMap_2);
String carId =map.get("fireFightingId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if(instanceMap==null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
public String getGroupCode() {
return "dutyFireFighting";
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if(dutyList!=null && dutyList.size()>0) {
for (Map<String, Object> dutyDetail : dutyList) {
if(!dutyDetail.containsKey("name")) {
continue;
}
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper.getPositionStaffDutyForSpecifyDate(dutyDay,
this.getGroupCode(), instanceIds,dutyDetail.get("name").toString());
if(specifyDateList==null || specifyDateList.size() < 1 || specifyDateList.get(0)==null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 =new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 =new LinkedHashMap<String, Object>();
infoMap_2.put(specify.get("postTypeName").toString(),specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
}
detailList.add(resultList);
}
return detailList;
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
@Service
public class DutyFirstAidServiceImpl extends DutyCommonServiceImpl implements IDutyFirstAidService {
@Autowired
IFireTeamService fireTeamService;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Autowired
OrgUsrServiceImpl orgUsrServiceImpl;
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
public String getGroupCode() {
return "dutyFirstAid";
}
@Override
public DutyFirstAidDto save(DutyFirstAidDto dto) {
FireTeam fireStationDtoResult = fireTeamService.getFireTeamBySequenceNbr(Long.parseLong(dto.getFirstAidId()));
dto.setFirstAid(fireStationDtoResult.getName());
Map<String, Object> map = Bean.BeantoMap(dto);
Long instanceId = excuteDynamicFormInstance(dto.getUserId(), map, this.getGroupCode());
saveDutyPersonShiftDetail(instanceId, dto.getDutyShift(), dto.getStartTime());
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
@Override
public DutyFirstAidDto update(Long instanceId, DutyFirstAidDto dto) {
updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
@Override
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "firstAidId", "firstAid", "teamName", "result.firstAidId");
if (equipmentList == null || equipmentList.size() < 1 || equipmentList.get(0) == null) {
return null;
}
List<Object> detailList = new ArrayList<Object>();
for (Map<String, Object> map : equipmentList) {
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
LinkedHashMap<String, Object> titleMap_1 = new LinkedHashMap<String, Object>();
titleMap_1.put("120急救站", map.get("firstAid").toString());
resultList.add(titleMap_1);
LinkedHashMap<String, Object> titleMap_2 = new LinkedHashMap<String, Object>();
titleMap_2.put("单位/部门", map.get("teamName").toString());
resultList.add(titleMap_2);
String carId = map.get("firstAidId").toString();
Map<String, Object> instanceMap = dutyPersonShiftMapper.getInstanceIdForSpecifyDateAndEquipment(dutyDay,
this.getGroupCode(), carId);
if (instanceMap == null) {
continue;
}
String instanceId = instanceMap.get("instanceIds").toString();
if (StringUtils.isNotBlank(instanceId)) {
String[] instanceIds = instanceId.split(",");
List<Map<String, Object>> dutyList = dutyPersonShiftMapper.getDutyForSpecifyDate(dutyDay);
if (dutyList != null && dutyList.size() > 0) {
for (Map<String, Object> dutyDetail : dutyList) {
if (!dutyDetail.containsKey("name")) {
continue;
}
// 获取当前装备ID下的排版数据
List<Map<String, Object>> specifyDateList = dutyPersonShiftMapper
.getPositionStaffDutyForSpecifyDate(dutyDay, this.getGroupCode(), instanceIds,
dutyDetail.get("name").toString());
if (specifyDateList == null || specifyDateList.size() < 1 || specifyDateList.get(0) == null) {
continue;
}
LinkedHashMap<String, Object> infoMap_1 = new LinkedHashMap<String, Object>();
infoMap_1.put(dutyDetail.get("name").toString(), "");
resultList.add(infoMap_1);
for (Map<String, Object> specify : specifyDateList) {
LinkedHashMap<String, Object> infoMap_2 = new LinkedHashMap<String, Object>();
infoMap_2.put(specify.get("postTypeName").toString(), specify.get("userName").toString());
resultList.add(infoMap_2);
}
}
}
}
detailList.add(resultList);
}
return detailList;
}
public List< Map<String, Object>> getFirstAidExportData(List<String> ids) {
List< Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
String dicCodeString = "830";
String typeString = "XFJGLX";
List<OrgUsr> personList = orgUsrServiceImpl.getPersonListByParentIds(ids);
personList.stream().forEach(i -> {
String userNameString =i.getBizOrgName()+ "@" +i.getSequenceNbr();
Map<String, Object> map = new HashMap<String, Object>();
List<FireTeam> list = fireTeamService.getFirstAidForTypeCodeAndCompanyId(dicCodeString, typeString,
Long.parseLong(i.getParentId()));
List<String> firstAidSimpleList = new ArrayList<String>();
List<String> companySimpleList = new ArrayList<String>();
list.stream().forEach(m -> {
String firstAidNameString = m.getName() + "@" + m.getSequenceNbr();
String companyNameString = m.getCompanyName() + "@" + m.getCompany();
firstAidSimpleList.add(firstAidNameString);
companySimpleList.add(companyNameString);
});
List<DataDictionary> dataDicList= dataDictionaryService.getByType(typeString);
List<String> dataDicSimpleList = new ArrayList<String>();
dataDicList.stream().forEach(l->{
String dataDic = l.getName() + "@" +l.getCode();
dataDicSimpleList.add(dataDic);
});
map.put("firstAidName", firstAidSimpleList);
map.put("companyName", companySimpleList);
map.put("userName", userNameString);
map.put("postTypeName",dataDicSimpleList);
resultList.add(map);
});
return resultList;
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -20,13 +19,15 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
/**
* @author DELL
......@@ -37,6 +38,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired
EquipFeignClient equipFeign;
@Override
public String getGroupCode(){
return "dutyPerson";
......@@ -234,4 +236,98 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
});
return temp;
}
public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType) {
List<Map<String, Object>> list = dayDutyPersonList(dutyDay, shiftId, postType);
list.stream().forEach(i->{
List<Object> fieldsList= new ArrayList<Object>();
List<Object>infoList= new ArrayList<Object>();
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
map.put("name", "微型消防站");
map.put("value",i.get("deptName").toString());
map.put("id","1");
fieldsList.add(map);
map.clear();
map.put("name", "微型消防站");
map.put("value",i.get("deptName").toString());
});
return postType;
}
public static void main(String[] args) {
String ssString="[{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1437585222345547778\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"\",\"dutyArea\":\"测试控制室\",\"dutyAreaId\":\"1382166994773610497\",\"postTypeName\":\"\",\"userName\":\"故障报修\",\"userId\":\"1428653787706347522\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"晚班\",\"instanceId\":\"1447490875843239937\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"},{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1432883228491972609\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"\",\"dutyArea\":\"消防小室-shg\",\"dutyAreaId\":\"1382530839199387650\",\"postTypeName\":\"\",\"userName\":\"78678676\",\"userId\":\"1435886728803000322\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"夜班\",\"instanceId\":\"1447490812534415361\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"},{\"teamName\":\"发士大夫大师傅\",\"shiftId\":\"1432883228491972609\",\"carName\":\"特种消防车(46586458)\",\"postType\":\"1\",\"dutyArea\":\"建构住-shg\",\"dutyAreaId\":\"1382157469081407490\",\"postTypeName\":\"指挥员\",\"userName\":\"张小四6\",\"userId\":\"1435072204550225922\",\"dutyDate\":\"2021-10-12 00:00:00\",\"carId\":\"1432590747256770562\",\"shiftName\":\"夜班\",\"instanceId\":\"1447490699435008001\",\"teamId\":\"1404995716634050561\",\"groupCode\":\"dutyCar\"}]\r\n"
+ "";
List<Map> jjList= JSONArray.parseArray(ssString, Map.class);
Map< String, String> map20 = new HashMap<String, String>();
jjList.forEach(i->{
List<Object> fieldsList= new ArrayList<Object>();
List<Object>infoList= new ArrayList<Object>();
Map<String, String> map = new HashMap<String, String>();
map.put("name", "微型消防站");
map.put("value",i.get("carName").toString());
map.put("id","1");
fieldsList.add(map);
Map<String, String> map1 = new HashMap<String, String>();
map1.put("name", "微型消防站");
map1.put("value",i.get("teamName").toString());
map1.put("id","2");
fieldsList.add(map1);
if(!map20.containsKey(i.get("shiftName").toString())) {
map20.put(ssString, ssString);
}
System.out.println("ssssssssss");
});
}
}
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.List;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyShiftService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 值班班次服务实现类
......@@ -35,4 +36,5 @@ public class DutyShiftServiceImpl extends BaseService<DutyShiftDto, DutyShift, D
public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) {
return this.queryForList("", false, isDelete);
}
}
......@@ -3,8 +3,12 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
......@@ -14,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -36,7 +41,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper fireStationMapper;
@Autowired
OrgUsrMapper orgUsrMapper;
@Autowired
OrgUsrServiceImpl orgUsrService;
/**
* 分页查询
*/
......@@ -143,4 +149,28 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
wrapper.select(FireStation::getSequenceNbr,FireStation::getName);
return this.baseMapper.selectMaps(wrapper);
}
/**
* 获取机场单位树
* chenzhao 2021-10-14
* @return
*/
public List<MenuFrom> getCompanyTeamTree() throws Exception {
MenuFrom root = new MenuFrom("-1", "微型消防站", null, null);
List<OrgUsr> companyDeptList = orgUsrService.selectCompanyList();
List<MenuFrom> companyDeptMenuList = Lists.newArrayList();
companyDeptList.forEach(o -> {
if (ValidationUtil.isEmpty(o.getParentId())) {
o.setParentId("-1");
}
companyDeptMenuList.add(new MenuFrom(o.getSequenceNbr().toString(), o.getBizOrgName(), o.getParentId(),
"1"));
});
List<MenuFrom> menuList = TreeParser.getTreexin("-1", companyDeptMenuList, MenuFrom.class.getName(), "getKey",
1, "getName", "getParentId", "getNodeType");
root.setChildren(menuList);
return Lists.newArrayList(root);
}
}
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
......@@ -43,6 +44,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -77,6 +80,8 @@ import java.util.stream.Collectors;
@Service
public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapper> implements IOrgUsrService {
private final Logger logger = LoggerFactory.getLogger(OrgUsrServiceImpl.class);
private static final String TYPE = "PERSON,COMPANY";
private static final String CODE = "amosAccount";
......@@ -1527,6 +1532,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper);
}
/**
* 查询组织机构下面的人员信息
*
* @param id
* @return
*/
public List<OrgUsr> getPersonListByParentIds(List<String> ids) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.in(OrgUsr::getParentId, ids);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper);
}
@Override
public List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId) {
......@@ -1696,4 +1714,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
return amosUser;
}
@Override
public List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList) {
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.notIn(OrgUsr::getSequenceNbr, companyIdList).eq(OrgUsr::getIsDelete, false).eq(OrgUsr::getBizOrgType, "COMPANY");
List<OrgUsr> unSyncCompanyList = this.baseMapper.selectList(queryWrapper);
List<OrgUsrFormDto> allUnSyncCompanyList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(unSyncCompanyList)) {
unSyncCompanyList.forEach(company -> {
try {
OrgUsrFormDto orgUsrFormDto = this.selectCompanyById(company.getSequenceNbr());
allUnSyncCompanyList.add(orgUsrFormDto);
} catch (Exception e) {
logger.info(e.getMessage());
}
});
}
return allUnSyncCompanyList;
}
}
......@@ -148,16 +148,18 @@ public class AlertCalledController extends BaseController {
String alertSourceCode,
String callTimeStart,
String callTimeEnd){
//Page<AlertCalled> pageBean;
// IPage<AlertCalled> page;
/* Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
/* page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page);*/
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort);
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<>(0, Long.MAX_VALUE);
page = new Page<>();
page.setCurrent(0L);
page.setSize(10L);
} else {
page.setCurrent( (Long.parseLong(pageNum) - 1) * Long.parseLong(pageSize));
page.setSize(Long.parseLong(pageSize));
......
......@@ -243,4 +243,11 @@ public class FireTeamController extends BaseController {
List<FirefightersDto> fighters = iFireTeamService.getFighterByTeamId(teamIdList);
return ResponseHelper.buildResponse(fighters);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/firstAid", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "急救站", notes = "急救站")
public Object getFirstAidForTypeCodeAndCompanyId(String code, String typeCode,Long companyId) {
return ResponseHelper.buildResponse(iFireTeamService.getFirstAidForTypeCodeAndCompanyId(code,typeCode,companyId));
}
}
\ No newline at end of file
......@@ -55,6 +55,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
......@@ -186,6 +187,9 @@ public class ExcelServiceImpl {
@Autowired
OrgUsrSafeReportServiceImpl orgUsrSafeReportService;
@Autowired
IDutyFirstAidService dutyFirstAidService;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url);
......@@ -1187,6 +1191,8 @@ public class ExcelServiceImpl {
data = initDutyPersonTemplate(ids);
} else if (ExcelEnums.WXXFZB.getType().equals(excelDto.getType())) {
data = initDutyDutyFireFightingTemplate(ids);
} else if (ExcelEnums.JJZB.getType().equals(excelDto.getType())) {
//data = initDutyDutyFirstAidTemplate(ids);
}
// 获取日期
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
......@@ -1199,7 +1205,29 @@ public class ExcelServiceImpl {
}
}
private List<List<Object>> initDutyDutyFirstAidTemplate(String ids) {
List<List<Object>> data = new ArrayList<>();
// 根据id列表获取单位下的微型消防站集合
List<String> companyIdList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(ids)) {
companyIdList = Lists.newArrayList(ids.split(","));
}
List<Map<String, Object>> personDetailList = dutyFirstAidService.getFirstAidExportData(companyIdList);
if (!personDetailList.isEmpty()) {
AtomicInteger row = new AtomicInteger(1);
personDetailList.forEach(o -> {
ArrayList<Object> list = new ArrayList<>();
list.add(row.getAndIncrement());
list.add(null);
list.add(null);
list.add(null);
list.add(o.get("fireStation"));
data.add(list);
});
}
return data;
}
private List<List<Object>> initDutyDutyFireFightingTemplate(String ids) {
List<List<Object>> data = new ArrayList<>();
// 根据id列表获取单位下的微型消防站集合
......
......@@ -147,7 +147,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private WorkflowFeignService workflowFeignService;
// 有启动后执行现场确认的角色名称
private String onSiteConfirmRole = "Person_charge_unit_fire_protection_supervision_inspection";
@Value("${onSite.confirm.roleName}")
private String onSiteConfirmRole;
@Autowired
JcsFeignClient jcsFeignClient;
......@@ -1156,7 +1157,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
RoleBo roleBo = reginParams.getRole();
if (!onSiteConfirmRole.equals(roleBo.getRoleName())) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("没有权限执行");
executeSubmitDto.setMsg("没有执行权限");
return executeSubmitDto;
}
// 2、开启工作流
......
......@@ -823,4 +823,15 @@ public class PointController extends AbstractBaseController {
return ResponseHelper.buildResponse(iPointService.getPlanExecuteTeams());
}
/**
* 修复历史数据(将所有机场单位数据同步到消防监督服务p_point表)
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "将所有机场单位数据同步到消防监督服务p_point表", notes = "将所有机场单位数据同步到消防监督服务p_point表")
@PutMapping(value = "/amos/temp/syncCompany")
public ResponseModel syncOrgCompany() {
return ResponseHelper.buildResponse(iPointService.syncOrgCompany());
}
}
......@@ -171,4 +171,6 @@ public interface PointMapper extends BaseMapper {
* @return
*/
List<Point> getPointByPlanId(String planId);
List<Long> queryAllPointList();
}
......@@ -4,6 +4,9 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author DELL
......@@ -18,4 +21,11 @@ public interface JCSFeignClient {
*/
@GetMapping(value = "jcs/org-usr/getLoginUserDetails/{userId}")
FeignClientResult getUserUnit(@PathVariable String userId);
/**
* 查询所有未同步的机场单位
* @return ResponseModel
*/
@GetMapping(value = "jcs/org-usr/unSync/orgCompany")
FeignClientResult getUnSyncOrgCompanyList(@RequestParam List<Long> companyIdList);
}
......@@ -20,6 +20,7 @@ import com.yeejoin.amos.supervision.business.dto.PointDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.business.param.*;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.DaoCriteria;
......@@ -47,12 +48,14 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.beans.Beans;
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
......@@ -111,6 +114,9 @@ public class PointServiceImpl implements IPointService {
@Autowired
private DangerFeignClient dangerFeignClient;
@Autowired
private JCSFeignClient jcsFeignClient;
private final int HTTP_OK_STATUS = 200;
@Override
......@@ -1242,4 +1248,17 @@ public class PointServiceImpl implements IPointService {
return pointMapper.getPlanExecuteTeams();
}
@Override
public Boolean syncOrgCompany() {
FeignClientResult result = jcsFeignClient.getUnSyncOrgCompanyList(pointMapper.queryAllPointList());
List<Object> list = (List<Object>) result.getResult();
if (!ValidationUtil.isEmpty(list)) {
list.forEach(company -> {
OrgUsrFormDto orgUsrFormDto = JSON.parseObject(JSON.toJSON(company).toString(), OrgUsrFormDto.class);
syncSavePoint(orgUsrFormDto);
});
return true;
}
return false;
}
}
......@@ -331,4 +331,10 @@ public interface IPointService {
List<Map<String, Object>> getPlanExecuteTeams();
/**
* 将所有机场单位数据同步到消防监督服务p_point表
*
* @return
*/
Boolean syncOrgCompany();
}
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
......@@ -18,10 +19,12 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
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.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
......@@ -193,7 +196,10 @@ public class AlertCalledController extends BaseController {
alertCalledDto.setUseStatus(elevator.getUseStatus());
alertCalledDto.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledDto.setAlarmType(AlertStageEnums.getEnumById(alertCalledDto.getAlarmTypeCode()).getValue());
alertCalledDto.setEquipmentClassification("电梯");
alertCalledDto.setEquipmentClassificationCode("3000");
alertCalledDto.setCity(elevator.getCity());
alertCalledDto.setDistrict(elevator.getDistrict());
AlertCalledDto alertCalledDtoReturn = iAlertCalledService.createAlertCalled(alertCalledDto);
return ResponseHelper.buildResponse(alertCalledDtoReturn);
}
......@@ -230,6 +236,11 @@ public class AlertCalledController extends BaseController {
alertPaperInfoDto.setAlertStatus(alertCalled.getAlertStage());
alertPaperInfoDto.setElevatorId(elevator.getSequenceNbr() +"");
alertPaperInfoDto.setElevatorCode(elevator.getRegisterCode());
DispatchPaper paper = dispatchPaperServiceImpl.getOne(new LambdaQueryWrapper<DispatchPaper>().eq(DispatchPaper::getIsDelete,false).eq(DispatchPaper::getAlertId,alertId));
if(paper != null) {
alertPaperInfoDto.setFinishTime(paper.getFeedbackFinishTime());
}
return ResponseHelper.buildResponse(alertPaperInfoDto);
}
......@@ -410,7 +421,16 @@ public class AlertCalledController extends BaseController {
String sort) {
queryWrapper.eq("is_delete", 0);
if(sort!=null) { // 排序失效
String[] date= sort.split(",");
if(date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
}else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
}
}else {
queryWrapper.orderByDesc("call_time");
}
if (!ValidationUtil.isEmpty(alertCalled.getIsAuxiliaryScreen())) {
if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())
......@@ -469,7 +489,7 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@GetMapping("/exportSelectRecord")
public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
......@@ -492,6 +512,22 @@ public class AlertCalledController extends BaseController {
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list, AlertCalledQueryDto.class, null, false);
}
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "导出接警记录信息", notes = "导出接警记录信息")
@GetMapping("/exportAlertRecord")
public void exportAlertRecord(AlertCalledRecordDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledRecordDto> list = iAlertCalledService.queryAlertRecordListByQueryDto(
alertCalledQueryDto.getCallTimeStart() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getCallTimeStart()),
alertCalledQueryDto.getCallTimeEnd() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getCallTimeEnd()),
alertCalledQueryDto.getType(),
alertCalledQueryDto.getAlertSource(),
alertCalledQueryDto.getAlarmType());
String fileName = "接警记录" + System.currentTimeMillis();
ExcelUtil.createTemplate(response, fileName, "接警记录", list, AlertCalledRecordDto.class, null, false);
}
/**
* 冻结工单-维修
*
......
......@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
......@@ -300,14 +301,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"};
if(null != dispatchPaper) {
map.put("adNotice",dispatchPaper.getDispatchTime());
map.put("aedArrive",dispatchPaper.getArriveTime());
map.put("afeComplete",dispatchPaper.getSaveTime());
for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
if(null != dispatchTask &&dispatchTask.size() > 0 ) {
List<DispatchTask> taskList = dispatchTask.stream().filter(e->e.getOrgType().equals(s)).collect(Collectors.toList());
if(taskList.size() > 0) {
map.put("adNotice",called.getRecDate());
map.put("aedArrive",dispatchTask.get(0).getArriveTime());
map.put("afeComplete",dispatchTask.get(0).getSaveTime());
dataInit(alertHandlerInfoDto,s,"", "","已派遣",
dispatchTask.get(0).getArriveTime() == null ? "" : "已到达" ,dispatchTask.get(0).getSaveTime() == null ? "" : "已完成",
dispatchPaper.getFeedbackTime() != null || dispatchPaper.getFeedbackFinishTime() != null ? "已回访" : "");
......@@ -354,6 +355,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return baseMapper.getBussinessListByPhonePager(phone, bussinessCode, current*5);
}
@Override
public List<AlertCalledRecordDto> queryAlertRecordListByQueryDto(String callTimeStart, String callTimeEnd, String type, String alertSource, String alarmType) {
List<AlertCalledRecordDto> list = alertCalledMapper.queryAlertRecordListByQueryDto(callTimeStart,callTimeEnd,type,alertSource,alarmType);
return list;
}
private void dataInit(AlertHandlerInfoDto alertHandlerInfoDto, String process,String answerThePolice, String report, String notice, String arrive, String complete,String returnVisit) {
alertHandlerInfoDto.setAbProcess(process);
alertHandlerInfoDto.setAcAnswerThePolice(answerThePolice);
......@@ -380,7 +387,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// 警情基本信息
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledObjsDto.getAlertCalledDto(),AlertCalled.class);
alertCalled.setEquipmentClassification("电梯");
alertCalled.setEquipmentClassificationCode("3000");
alertCalled.setCallTime(DateUtils.longStr2Date(alertCalled.getCallTimeStr()));
// 判断是否归并警情
......@@ -418,6 +426,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
queryWrapper.eq(Elevator::getRescueCode,alertCalled.getDeviceId());
Elevator elevator = iElevatorService.getOne(queryWrapper);
alertCalled.setEquipmentId(elevator.getSequenceNbr());
alertCalled.setCity(elevator.getCity());
alertCalled.setDistrict(elevator.getDistrict());
this.save(alertCalled);
// 动态表单
......
......@@ -116,6 +116,7 @@ public class ESAlertCalledService {
esAlertCalled.setAlertStatus(alertCalled.getAlertStatus());
esAlertCalled.setEmergencyCall(alertCalled.getEmergencyCall());
esAlertCalled.setDeviceId(alertCalled.getDeviceId());
esAlertCalled.setUseUnit(alertCalled.getUseUnit());
if (alertCalled.getAlertStatus())
{
esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode());
......@@ -141,13 +142,11 @@ public class ESAlertCalledService {
public Page<ESAlertCalledDto> queryByKeys(ESAlertCalledRequestDto alertCalledVo, int current, int size)
{
Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size);
String[] alertStatus = alertCalledVo.getAlertStatus();
if (ValidationUtil.isEmpty(alertStatus))
{
return result;
}
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledVo.getAlertCalledDto(),AlertCalled.class);
if (ValidationUtil.isEmpty(alertCalled))
{
......@@ -158,53 +157,91 @@ public class ESAlertCalledService {
*/
BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//警情状态
BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
BoolQueryBuilder qbstatus = QueryBuilders.boolQuery();
for (String status : alertStatus)
{
AlertStatusEnum alertStatusEnum = AlertStatusEnum.getEnum(status);
if (!ValidationUtil.isEmpty(alertStatusEnum))
{
qb0.should(QueryBuilders.termQuery("alertStatusStr.keyword", alertStatusEnum.getCode()));
qbstatus.should(QueryBuilders.termQuery("alertStatusStr.keyword", alertStatusEnum.getCode()));
}
}
boolMust.must(qb0);
boolMust.must(qbstatus);
// 如果没有搜索条件不搜索
boolean flag = true;
// ①事发地点一致,或相距不超过200米的;&& ②警情类别一致;&& ③报警时间:距离当前时间不超过两小时的
if (!ValidationUtil.isEmpty(alertCalled.getAddress()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()))
{
flag = false;
BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
BoolQueryBuilder temp1 = QueryBuilders.boolQuery()
.filter(QueryBuilders.matchQuery("address", alertCalled.getAddress()));
qb0.must(temp1);
BoolQueryBuilder temp2 = QueryBuilders.boolQuery()
.filter(QueryBuilders.matchQuery("alarmTypeCode", alertCalled.getAlarmTypeCode()));
qb0.must(temp2);
//接警时间,距离当前时间不超过两个小时的
long currentTime = System.currentTimeMillis() ;
currentTime = currentTime - 120*60*1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
BoolQueryBuilder temp3 = QueryBuilders.boolQuery()
.filter(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMust.must(qb1);
//报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getEmergencyCall()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone()))
{
BoolQueryBuilder qb2 = QueryBuilders.boolQuery()
.should(QueryBuilders.termQuery("emergencyCall.keyword", alertCalled.getEmergencyCall()))
.should(QueryBuilders.termQuery("contactPhone.keyword", alertCalled.getContactPhone()));
boolMust.must(qb2);
qb0.must(temp3);
boolMust.should(qb0);
}
//事发地点一致,或相距不超过200米的
if (!ValidationUtil.isEmpty(alertCalled.getAddress()))
{
BoolQueryBuilder qb3 = QueryBuilders.boolQuery()
.filter(QueryBuilders.matchQuery("address", alertCalled.getAddress()));
boolMust.should(qb3);
// 报警电话一致;
if (!ValidationUtil.isEmpty(alertCalled.getEmergencyCall())) {
flag = false;
BoolQueryBuilder tempQb = QueryBuilders.boolQuery();
BoolQueryBuilder tempQb1 = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("emergencyCall.keyword", alertCalled.getEmergencyCall()));
tempQb.must(tempQb1);
boolMust.should(tempQb);
}
//警情类型一致
BoolQueryBuilder qb4 = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("alarmTypeCode", alertCalled.getAlarmTypeCode()));
boolMust.must(qb4);
//使用单位名称一致
if (!ValidationUtil.isEmpty(alertCalled.getUseUnit()))
{
BoolQueryBuilder qb5 = QueryBuilders.boolQuery()
// 使用单位名称一致;&& ②警情类别一致;&& ③报警时间:距离当前时间不超过两小时的
if (!ValidationUtil.isEmpty(alertCalled.getUseUnit()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()) ) {
flag = false;
BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
BoolQueryBuilder temp1 = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("useUnit.keyword", alertCalled.getUseUnit()));
boolMust.must(qb5);
qb0.must(temp1);
BoolQueryBuilder temp2 = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("alarmTypeCode.keyword", alertCalled.getAlarmTypeCode()));
qb0.must(temp2);
//接警时间,距离当前时间不超过两个小时的
long currentTime = System.currentTimeMillis() ;
currentTime = currentTime - 120*60*1000;
BoolQueryBuilder temp3 = QueryBuilders.boolQuery()
.filter(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
qb0.must(temp3);
boolMust.should(qb0);
}
//电梯识别码一致
if(!ValidationUtil.isEmpty(alertCalled.getDeviceId())) {
BoolQueryBuilder qb6 = QueryBuilders.boolQuery()
// 电梯识别码一致;&& ③报警时间:距离当前时间不超过两小时的
if (!ValidationUtil.isEmpty(alertCalled.getDeviceId())) {
flag = false;
BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
BoolQueryBuilder temp = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("deviceId.keyword", alertCalled.getDeviceId()));
boolMust.must(qb6);
qb0.must(temp);
//接警时间,距离当前时间不超过两个小时的
long currentTime = System.currentTimeMillis() ;
currentTime = currentTime - 120*60*1000;
BoolQueryBuilder temp2 = QueryBuilders.boolQuery()
.filter(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
qb0.must(temp2);
boolMust.should(qb0);
}
boolMust.minimumShouldMatch(1);//至少满足一个
if(flag) { // 不搜素
return result;
}
/**
......
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RepairConsultDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto;
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.entity.DispatchTask;
......@@ -275,6 +276,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
// 警情伤亡消息 矩阵 消息
JSONObject jsonObject = new JSONObject();
jsonObject.put("alertId",String.valueOf(alertCalledVo.getSequenceNbr()));
// KRJY 的 repaired complainantBack 和 reportorBack 警情完成
if(CZHJ == DispatchPaperEnums.reportorBack || CZHJ == DispatchPaperEnums.complainantBack) {
jsonObject.put("finished",true);
} else if(CZHJ == DispatchPaperEnums.repaired && alertCalledVo.getAlarmTypeCode().equals(AlertStageEnums.KRJY.getId())) {
jsonObject.put("finished",true);
}
try {
emqKeeper.getMqttClient().publish(alertHeartpushTopic, jsonObject.toString().getBytes("UTF-8"), 1, false);
emqKeeper.getMqttClient().publish(alertMatrixpushTopic, jsonObject.toString().getBytes("UTF-8"), 1, false);
......
......@@ -224,7 +224,8 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
if(taskId == null) {
throw new BadRequest("派遣任务单信息未找到");
}
// 更新派遣到达时间
dispatchTaskServiceImpl.update(new LambdaUpdateWrapper<DispatchTask>().eq(DispatchTask::getSequenceNbr,taskId).set(DispatchTask::getArriveTime,rescueProcessDto.getArriveTime()));
repairConsultServiceImpl.saveRepairConsultByAlertIdType( rescueProcessDto.getAlertId(),"DD",taskId,sendUser); //保存接警日志
}
if(saveByUser) { // 手动救援
......@@ -243,6 +244,8 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
DispatchPaper dispatchPaper = dispatchPaperDto.getDispatchPaper();
dispatchPaper.setSaveTime(rescueProcessDto.getRescueTime());
// 更新派遣单
// 更新派遣救援时间
dispatchTaskServiceImpl.update(new LambdaUpdateWrapper<DispatchTask>().eq(DispatchTask::getSequenceNbr,taskId).set(DispatchTask::getSaveTime,rescueProcessDto.getRescueTime()));
dispatchPaperServiceImpl.updateById(dispatchPaper);
repairConsultServiceImpl.saveRepairConsultByAlertIdType(rescueProcessDto.getAlertId(),"JC",taskId,sendUser); //保存接警日志
}
......
......@@ -1752,11 +1752,58 @@
</sql>
</changeSet>
<changeSet id="2021-10-14-1" author="chenzhao">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>add data cb_data_dictionary</comment>
<sql>
INSERT INTO cb_data_dictionary (sequence_nbr, code, name, `type`) VALUES(1326, '1326', '消防物联系统', 'LYXT');
INSERT INTO cb_data_dictionary (sequence_nbr, code, name, `type`) VALUES(1327, '1327', '接处警手动上报', 'LYXT');
INSERT INTO cb_data_dictionary (sequence_nbr, code, name, `type`) VALUES(1328, '1328', '融合终端系统', 'LYXT');
</sql>
</changeSet>
<changeSet id="2021-10-14" author="chenhao-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_group" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_group"/>
</preConditions>
<comment>add data cb_dynamic_form_group</comment>
<sql>
INSERT INTO cb_dynamic_form_group (`sequence_nbr`, `group_name`, `group_code`, `parent_id`, `group_config`, `org_code`, `sort`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`) VALUES ('132828674816', '值班120急救站', 'dutyFirstAid', '0', NULL, '10', '1', NULL, NULL, '2021-10-14 16:48:41', '\0');
</sql>
</changeSet>
<changeSet id="2021-10-14" author="chenhao-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_column"/>
</preConditions>
<comment>add data cb_dynamic_form_column</comment>
<sql>
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812077', 'userId', '用户id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812078', 'userName', '用户名称', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812079', 'postType', '岗位id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812080', 'postTypeName', '岗位名称', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812081', 'firstAid', '120急救站', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812082', 'firstAidId', '120急救站Id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812083', 'teamId', '单位名称id', 'input', '132828674816', 'eq', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812084', 'teamName', '单位名称', 'input', '132828674816', 'like', '\0', '\0', 'dutyFirstAid', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
INSERT INTO cb_dynamic_form_column (`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES ('132828674812076', 'teamName', '单位名称', 'input', '132828674815', 'like', '\0', '\0', 'dutyFireFighting', NULL, NULL, NULL, '2021-09-28 10:34:05', '\0', NULL, NULL, NULL);
</sql>
</changeSet>
<changeSet id="2021-10-14" author="cz">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_org_usr_safe_report"/>
</preConditions>
<comment>删除责任人非空约束</comment>
<sql>
ALTER TABLE cb_org_usr_safe_report MODIFY COLUMN duty_person VARCHAR(30);
ALTER TABLE cb_org_usr_safe_report MODIFY COLUMN duty_person_id bigint(20);
</sql>
</changeSet>
<changeSet author="tw" id="2021-10-15-1">
<preConditions onFail="MARK_RAN">
......@@ -1781,3 +1828,4 @@
</databaseChangeLog>
......@@ -93,3 +93,5 @@ control.fegin.name=JCS-API-CONTROL
supervision.feign.name=AMOS-SUPERVISION-API
jcs.fegin.name=JCS
onSite.confirm.roleName="Person_charge_unit_fire_protection_supervision_inspection"
\ No newline at end of file
......@@ -1193,4 +1193,7 @@
and pl.id = #{planId}
and po.id = rp.point_id)
</select>
<select id="queryAllPointList" resultType="java.lang.Long">
select original_id from p_point where is_delete = 0;
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment