Commit 4dd08c29 authored by tangwei's avatar tangwei

解决冲突

parents 086639f3 cd2b8bb0
package com.yeejoin.amos.boot.biz.common.service; 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 com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import java.util.List; import java.util.List;
...@@ -18,4 +19,6 @@ public interface IDataDictionaryService { ...@@ -18,4 +19,6 @@ public interface IDataDictionaryService {
Object gwmcDataDictionary(String type) throws Exception; Object gwmcDataDictionary(String type) throws Exception;
List<MenuFrom> getGWMCDataDictionary(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; ...@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.dto.DataDictionaryDto; import com.yeejoin.amos.boot.biz.common.dto.DataDictionaryDto;
...@@ -106,4 +107,10 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da ...@@ -106,4 +107,10 @@ public class DataDictionaryServiceImpl extends BaseService<DataDictionaryDto, Da
return list; 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> { ...@@ -72,4 +72,60 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
@Param("beginDate") String beginDate, @Param("beginDate") String beginDate,
@Param("endDate") String endDate @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 { ...@@ -29,4 +29,5 @@ public interface IDutyCarService extends IDutyCommonService {
* @return * @return
*/ */
JSONObject isFireCarDriver(); JSONObject isFireCarDriver();
} }
...@@ -116,4 +116,6 @@ public interface IDutyCommonService { ...@@ -116,4 +116,6 @@ public interface IDutyCommonService {
* @param dutyShiftList * @param dutyShiftList
*/ */
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> 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 { ...@@ -17,4 +17,5 @@ public interface IDutyFireFightingService extends IDutyCommonService {
* @return List<DutyCarDto> * @return List<DutyCarDto>
*/ */
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto); 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; ...@@ -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 com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 消防队伍 服务类 * 消防队伍 服务类
...@@ -43,5 +44,7 @@ public interface IFireTeamService { ...@@ -43,5 +44,7 @@ public interface IFireTeamService {
* *
* **/ * **/
List<FireTeamZhDto> getFireTeamCountList(); List<FireTeamZhDto> getFireTeamCountList();
public List<FireTeam> getFirstAidForTypeCodeAndCompanyId(String dicCode,String typeCode,Long companyId);
} }
...@@ -239,4 +239,7 @@ public interface IOrgUsrService { ...@@ -239,4 +239,7 @@ public interface IOrgUsrService {
OrgUsr selectByAmosOrgId(Long id); OrgUsr selectByAmosOrgId(Long id);
public List<OrgUsr> getPersonListByParentIds(List<String> ids) ;
List<OrgUsrFormDto> getUnSyncOrgCompanyList(List<Long> companyIdList);
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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
<select id="calMaxPersonAndShiftNum" resultType="java.util.Map"> namespace="com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper">
select <select id="calMaxPersonAndShiftNum" resultType="java.util.Map">
(select select
IFNULL(max(num),0) (select
from IFNULL(max(num),0)
(SELECT from
ifnull(count(1),0) num (SELECT
FROM ifnull(count(1),0) num
cb_duty_person_shift s, FROM
cb_duty_shift ds, cb_duty_person_shift s,
cb_dynamic_form_instance i cb_duty_shift ds,
WHERE cb_dynamic_form_instance i
ds.sequence_nbr = s.shift_id WHERE
and s.instance_id = i.instance_id ds.sequence_nbr = s.shift_id
AND i.field_code = 'userId' and s.instance_id = i.instance_id
and s.duty_date >= #{beginDate} AND i.field_code = 'userId'
and s.duty_date <![CDATA[<=]]> #{endDate} and s.duty_date >= #{beginDate}
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14--> and s.duty_date <![CDATA[<=]]>
and s.app_Key = #{appKey} #{endDate}
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 --> AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。
) a) as maxDutyPersonNumDay, 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 -->
(select and s.app_Key = #{appKey}
IFNULL(max(num),0) GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
from ) a) as maxDutyPersonNumDay,
(SELECT (select
ifnull(count(DISTINCT(s.shift_id)),0) num IFNULL(max(num),0)
FROM from
cb_duty_person_shift s, (SELECT
cb_duty_shift ds, ifnull(count(DISTINCT(s.shift_id)),0) num
cb_dynamic_form_instance i FROM
WHERE cb_duty_person_shift s,
ds.sequence_nbr = s.shift_id cb_duty_shift ds,
and s.instance_id = i.instance_id cb_dynamic_form_instance i
AND i.field_code = 'userId' WHERE
and s.duty_date >= #{beginDate} ds.sequence_nbr = s.shift_id
and s.duty_date <![CDATA[<=]]> #{endDate} and s.instance_id = i.instance_id
and s.app_Key = #{appKey} AND i.field_code = 'userId'
GROUP BY s.duty_date) b) as maxShiftNumDay and s.duty_date >= #{beginDate}
</select> and s.duty_date <![CDATA[<=]]>
<select id="bankViewData" resultType="java.util.Map"> #{endDate}
SELECT and s.app_Key = #{appKey}
S1.*, GROUP BY s.duty_date) b) as maxShiftNumDay
S2.name as shiftName </select>
from <select id="bankViewData" resultType="java.util.Map">
(SELECT SELECT
s.shift_id as shiftId, S1.*,
GROUP_CONCAT(i.field_value) AS userName S2.name as shiftName
FROM from
cb_duty_person_shift s, (SELECT
cb_duty_shift ds, s.shift_id as shiftId,
cb_dynamic_form_instance i GROUP_CONCAT(i.field_value) AS userName
WHERE FROM
s.instance_id = i.instance_id cb_duty_person_shift s,
AND ds.sequence_nbr = s.shift_id cb_duty_shift ds,
AND i.field_code = 'userName' cb_dynamic_form_instance i
AND s.duty_date = #{dutyDate} WHERE
AND s.shift_id is not null s.instance_id = i.instance_id
AND s.app_key = #{appKey} AND ds.sequence_nbr = s.shift_id
and i.group_code =#{groupCode} AND i.field_code = 'userName'
GROUP BY AND s.duty_date = #{dutyDate}
s.shift_id AND s.shift_id is not null
) S1, AND s.app_key = #{appKey}
cb_duty_shift S2 and i.group_code =#{groupCode}
where GROUP BY
s1.shiftId = s2.sequence_nbr s.shift_id
</select> ) S1,
<select id="stationViewData" resultType="java.util.Map"> cb_duty_shift S2
select where
i.field_value as postTypeName, s1.shiftId = s2.sequence_nbr
count(1) as total </select>
from <select id="stationViewData" resultType="java.util.Map">
cb_duty_person_shift s, select
cb_dynamic_form_instance i i.field_value as postTypeName,
where count(1) as total
s.instance_id = i.instance_id from
and i.field_code = 'postTypeName' cb_duty_person_shift s,
AND s.duty_date = #{dutyDate} cb_dynamic_form_instance i
AND s.shift_id is not null where
AND s.app_key = #{appKey} s.instance_id = i.instance_id
and i.group_code =#{groupCode} and i.field_code = 'postTypeName'
GROUP BY i.field_value AND s.duty_date = #{dutyDate}
</select> AND s.shift_id is not null
<select id="genRangeDate" resultType="map"> AND s.app_key = #{appKey}
SELECT and i.group_code =#{groupCode}
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date, GROUP BY i.field_value
@s := @s + 1 AS `index` </select>
FROM <select id="genRangeDate" resultType="map">
mysql.help_topic, SELECT
( SELECT @s := 0 ) temp DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
WHERE @s := @s + 1 AS `index`
@s <![CDATA[<=]]> DATEDIFF(#{endDate},#{beginDate}) FROM
</select> mysql.help_topic,
( SELECT @s := 0 ) temp
WHERE
@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> </mapper>
...@@ -27,6 +27,7 @@ public enum ExcelEnums { ...@@ -27,6 +27,7 @@ public enum ExcelEnums {
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备") JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备")
XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备") XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB"),//("WXXFZB","微型消防站值班") 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","微型消防站值班") XFAQBG("消防安全报告", "消防安全报告", "com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportExcelDto","XFAQBG");//("XFAQBG","微型消防站值班")
private String fileName; private String fileName;
private String sheetName; private String sheetName;
......
...@@ -20,13 +20,17 @@ public enum LatentDangerProcessStateEnum { ...@@ -20,13 +20,17 @@ public enum LatentDangerProcessStateEnum {
*/ */
待整改("待整改", "2"), 待整改("待整改", "2"),
/** /**
* 待整改资料提交
*/
待整改资料提交("待整改资料提交", "3"),
/**
* 待复核 * 待复核
*/ */
待复核("待复核", "3"), 待复核("待复核", "4"),
/** /**
* 治理完毕 * 治理完毕
*/ */
治理完毕("治理完毕", "4"); 治理完毕("治理完毕", "5");
/** /**
* 名称,描述 * 名称,描述
......
...@@ -79,7 +79,7 @@ public interface LatentDangerState { ...@@ -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 { ...@@ -63,4 +63,7 @@ public class AlertPaperInfoDto {
@ApiModelProperty(value = "电梯设备编码") @ApiModelProperty(value = "电梯设备编码")
private String elevatorCode; private String elevatorCode;
@ApiModelProperty(value = "警情结束时间")
private Date finishTime;
} }
...@@ -33,4 +33,10 @@ public class WechatMyBusinessListDto { ...@@ -33,4 +33,10 @@ public class WechatMyBusinessListDto {
@ApiModelProperty(value = "业务状态") @ApiModelProperty(value = "业务状态")
private String bussinessStatus; private String bussinessStatus;
@ApiModelProperty(value = "上报时间")
private Date reportTime;
@ApiModelProperty(value = "完成时间")
private Date finishTime;
} }
...@@ -32,4 +32,10 @@ public class WechatMyTaskListDto { ...@@ -32,4 +32,10 @@ public class WechatMyTaskListDto {
@ApiModelProperty(value = "派遣时间") @ApiModelProperty(value = "派遣时间")
private Date dispatchTime; private Date dispatchTime;
@ApiModelProperty(value = "上报时间")
private Date reportTime;
@ApiModelProperty(value = "完成时间")
private Date finishTime;
} }
...@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.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.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto; 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.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import org.apache.ibatis.annotations.Param; 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.List;
import java.util.Map; import java.util.Map;
...@@ -78,4 +81,20 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -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); 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; ...@@ -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.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto; 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.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.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto; 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.WechatMyBussinessDto;
...@@ -76,4 +77,15 @@ public interface IAlertCalledService { ...@@ -76,4 +77,15 @@ public interface IAlertCalledService {
WechatMyBussinessDto getBussinessInfoById(Long alertId); WechatMyBussinessDto getBussinessInfoById(Long alertId);
List<WechatMyBusinessListDto> getBussinessListByPhonePager(String phone, String bussinessCode, Long current); 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 @@ ...@@ -188,7 +188,7 @@
a.device_id AS deviceId, a.device_id AS deviceId,
e.address AS e.address AS
elevatorAddress, elevatorAddress,
a.region_code AS address, a.address AS address,
a.alarm_type AS alertType, a.alarm_type AS alertType,
a.alert_source AS alertSource, a.alert_source AS alertSource,
a.alert_stage AS alertStage, a.alert_stage AS alertStage,
...@@ -227,8 +227,8 @@ ...@@ -227,8 +227,8 @@
#{emergencyTimeEnd} #{emergencyTimeEnd}
</if> </if>
<if test="workOrderNumber != null and workOrderNumber != ''"> <if test="workOrderNumber != null and workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> and a.work_order_number like
#{endDate} CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if> </if>
<if test="emergencyCall != null and emergencyCall != ''"> <if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like AND a.emergency_call like
...@@ -471,7 +471,9 @@ ...@@ -471,7 +471,9 @@
a.alert_status as taskStatus, a.alert_status as taskStatus,
e.address, e.address,
a.call_time as dispatchTime, 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 from tz_alert_called a
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id 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 LEFT JOIN tz_dispatch_paper p on p.alert_id = a.sequence_nbr
...@@ -482,6 +484,42 @@ ...@@ -482,6 +484,42 @@
ORDER BY a.rec_date desc ORDER BY a.rec_date desc
limit #{current},5 limit #{current},5
</select> </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> </mapper>
...@@ -78,7 +78,9 @@ ...@@ -78,7 +78,9 @@
a.alarm_type as taskType, a.alarm_type as taskType,
a.alert_status as taskStatus, a.alert_status as taskStatus,
e.address, 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 from tz_dispatch_task t
LEFT JOIN tz_alert_called a on a.sequence_nbr = t.alert_id 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 LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id
......
...@@ -152,7 +152,7 @@ public class DutyCarController extends BaseController { ...@@ -152,7 +152,7 @@ public class DutyCarController extends BaseController {
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @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{ ...@@ -155,6 +155,6 @@ public class DutyFireFightingController extends BaseController{
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay, public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId, @ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){ @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 { ...@@ -85,7 +85,12 @@ public class FireExpertsController extends BaseController {
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<FireExpertsDto> updateBySequenceNbrFireExperts(@RequestBody FireExpertsDto model, public ResponseModel<FireExpertsDto> updateBySequenceNbrFireExperts(@RequestBody FireExpertsDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) { @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
/*bug 3098 联动专家,编辑时领域选择子分类保存,领域数据未修改 chenzhao 2021-10-14 */
model.setSequenceNbr(sequenceNbr); 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)); return ResponseHelper.buildResponse(fireExpertsServiceImpl.updateWithModel(model));
} }
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; 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.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation; import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
...@@ -139,4 +140,18 @@ public class FireStationController extends BaseController { ...@@ -139,4 +140,18 @@ public class FireStationController extends BaseController {
public ResponseModel<List<FireStationDto>> selectForList() { public ResponseModel<List<FireStationDto>> selectForList() {
return ResponseHelper.buildResponse(fireStationServiceImpl.queryForFireStationList(false)); 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 { ...@@ -159,6 +159,13 @@ public class FirefightersPostController extends BaseController {
public ResponseModel<Object> updateByIdFirefightersPost(@RequestBody FirefightersDataDto firefightersDataDto) { public ResponseModel<Object> updateByIdFirefightersPost(@RequestBody FirefightersDataDto firefightersDataDto) {
try { try {
FirefightersPost firefightersPost = firefightersDataDto.getFirefightersPost(); 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); iFirefightersPostService.updateById(firefightersPost);
ifirefightersWorkexperienceService.updateById(firefightersDataDto.getFirefightersWorkexperience()); ifirefightersWorkexperienceService.updateById(firefightersDataDto.getFirefightersWorkexperience());
ifirefightersEducationService.updateById(firefightersDataDto.getFirefightersEducation()); ifirefightersEducationService.updateById(firefightersDataDto.getFirefightersEducation());
......
...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -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.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl; 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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -132,9 +133,11 @@ public class FirefightersThoughtController extends BaseController { ...@@ -132,9 +133,11 @@ public class FirefightersThoughtController extends BaseController {
if(redisUtils.hasKey(RedisKey.THOUGHT_ID+id)){ if(redisUtils.hasKey(RedisKey.THOUGHT_ID+id)){
Object obj= redisUtils.get(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)); 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); }else{ FirefightersThought firefightersThought= iFirefightersThoughtService.getById(id);
redisUtils.set(RedisKey.THOUGHT_ID+id, JSON.toJSON(firefightersThought),time); redisUtils.set(RedisKey.THOUGHT_ID+id, JSON.toJSON(firefightersThought),time);
Map<String, Object> mainMap = Bean.BeantoMap(firefightersThought); Map<String, Object> mainMap = Bean.BeantoMap(firefightersThought);
......
...@@ -30,12 +30,15 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -30,12 +30,15 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; 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.Autowired;
import org.springframework.beans.factory.annotation.Value; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -517,4 +520,16 @@ public class OrgUsrController extends BaseController { ...@@ -517,4 +520,16 @@ public class OrgUsrController extends BaseController {
public ResponseModel<AgencyUserModel> getAmosIdByOrgUserId(@PathVariable String orgUserId) throws Exception { public ResponseModel<AgencyUserModel> getAmosIdByOrgUserId(@PathVariable String orgUserId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getAmosIdByOrgUserId(orgUserId)); 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; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils; import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
...@@ -31,10 +32,12 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourcePoolSer ...@@ -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 com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; 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.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -50,9 +53,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -90,8 +91,14 @@ public class WaterResourceController extends BaseController { ...@@ -90,8 +91,14 @@ public class WaterResourceController extends BaseController {
String resourceType = model.getResourceType(); String resourceType = model.getResourceType();
Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class, Optional<WaterResourceTypeEnum> resourceTypeEnum = EnumsUtils.getEnumObject(WaterResourceTypeEnum.class,
e -> e.getCode().equals(resourceType)); 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.setResourceTypeName(resourceTypeEnum.get().getName());
model.setRealityImg(JSONArray.toJSONString(model.getRealityImgList())); model.setRealityImg(JSONArray.toJSONString(realityImgList));
model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList())); model.setOrientationImg(JSONArray.toJSONString(model.getOrientationImgList()));
/*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/ /*2021-09-08 前端表示前端传递的address参数已经切割过,后端无需再切割获取 陈召 屏蔽代码 97-102行*/
/* if(model.getAddress()!=null){ /* 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.ArrayList;
import java.util.Calendar; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -20,12 +19,11 @@ import com.alibaba.fastjson.JSONObject; ...@@ -20,12 +19,11 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; 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.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.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; 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.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper; import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
...@@ -35,110 +33,190 @@ import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService; ...@@ -35,110 +33,190 @@ import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
@Service @Service
public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCarService { public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCarService {
@Autowired @Autowired
DynamicFormInstanceServiceImpl dynamicFormInstanceService; DynamicFormInstanceServiceImpl dynamicFormInstanceService;
@Autowired @Autowired
FirefightersMapper firefightersMapper; FirefightersMapper firefightersMapper;
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
String driverPostTypeCode = "5"; String driverPostTypeCode = "5";
@Autowired @Autowired
EquipFeignClient equipFeign; EquipFeignClient equipFeign;
@Override @Autowired
public String getGroupCode() { DutyPersonShiftMapper dutyPersonShiftMapper;
return "dutyCar";
} @Override
public String getGroupCode() {
@Override return "dutyCar";
public DutyCarDto save(DutyCarDto dutyCarDto) { }
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据 @Override
if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) { public DutyCarDto save(DutyCarDto dutyCarDto) {
// 根据建筑id 查找建筑 // BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
ResponseModel<Map<String, Object>> response = null; // 1.保存行数据
try { if (StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
response = equipFeign.getFormInstanceById(Long.parseLong(dutyCarDto.getDutyAreaId())); // 根据建筑id 查找建筑
} catch (NumberFormatException e) { ResponseModel<Map<String, Object>> response = null;
throw new BadRequest("值班区域id异常!"); try {
} response = equipFeign.getFormInstanceById(Long.parseLong(dutyCarDto.getDutyAreaId()));
Map<String, Object> result = response.getResult(); } catch (NumberFormatException e) {
dutyCarDto.setDutyArea(result.get("name").toString()); throw new BadRequest("值班区域id异常!");
} }
Map<String, Object> map = Bean.BeantoMap(dutyCarDto); Map<String, Object> result = response.getResult();
dutyCarDto.setDutyArea(result.get("name").toString());
// 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28 }
Long instanceId =excuteDynamicFormInstance(dutyCarDto.getUserId(),map,this.getGroupCode()); Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
saveDutyPersonShiftDetail( instanceId ,dutyCarDto.getDutyShift() ,dutyCarDto.getStartTime()) ;
insertPersonShift(instanceId, dutyCarDto.getDutyShift()); // 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28
// 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28 Long instanceId = excuteDynamicFormInstance(dutyCarDto.getUserId(), map, this.getGroupCode());
//3.返回保存后的数据 saveDutyPersonShiftDetail(instanceId, dutyCarDto.getDutyShift(), dutyCarDto.getStartTime());
return dutyCarDto; insertPersonShift(instanceId, dutyCarDto.getDutyShift());
// 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28
} // 3.返回保存后的数据
return dutyCarDto;
@Override
public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) { }
//修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28 @Override
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dutyCarDto)); public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) {
//修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
//5.更新值班信息人日期数据 // 修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
insertPersonShift(instanceId, dutyCarDto.getDutyShift()); updateDynamicFormInstance(this.getGroupCode(), instanceId, Bean.BeantoMap(dutyCarDto));
return 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) { }
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
} private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column,
DynamicFormInstance formInstance) {
@Override fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
public JSONObject isFireCarDriver() { }
JSONObject result = new JSONObject();
result.put("isDriver", false); @Override
result.put("carStatus", ""); public JSONObject isFireCarDriver() {
result.put("carId", ""); JSONObject result = new JSONObject();
result.put("isDriver", false);
String loginUserId = RequestContext.getExeUserId(); result.put("carStatus", "");
// 根据登陆人id查询对应消防人员 result.put("carId", "");
Firefighters firefighters =
firefightersMapper.selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount, String loginUserId = RequestContext.getExeUserId();
loginUserId)); // 根据登陆人id查询对应消防人员
if (ValidationUtil.isEmpty(firefighters)) { Firefighters firefighters = firefightersMapper
return result; .selectOne(new LambdaQueryWrapper<Firefighters>().eq(Firefighters::getSystemAccount, loginUserId));
} if (ValidationUtil.isEmpty(firefighters)) {
// 消防人员id return result;
Long fighterId = firefighters.getSequenceNbr(); }
// 消防人员id
// 当前值班班次id Long fighterId = firefighters.getSequenceNbr();
List<Long> shiftIdList = getDutyShiftIdList();
if (ValidationUtil.isEmpty(shiftIdList)) { // 当前值班班次id
return result; List<Long> shiftIdList = getDutyShiftIdList();
} if (ValidationUtil.isEmpty(shiftIdList)) {
// 当前值班人员-车辆信息 return result;
List<Map<String, Object>> personList = dayDutyPersonList(DateUtils.getDateNowShortStr(), shiftIdList.get(0), }
driverPostTypeCode); // 当前值班人员-车辆信息
if (ValidationUtil.isEmpty(personList)) { List<Map<String, Object>> personList = dayDutyPersonList(DateUtils.getDateNowShortStr(), shiftIdList.get(0),
return result; driverPostTypeCode);
} if (ValidationUtil.isEmpty(personList)) {
return result;
personList = personList.stream().filter(m -> fighterId.equals(m.get("userId"))).collect(Collectors.toList()); }
if (ValidationUtil.isEmpty(personList)) {
return result; personList = personList.stream().filter(m -> fighterId.equals(m.get("userId"))).collect(Collectors.toList());
} if (ValidationUtil.isEmpty(personList)) {
return result;
result.put("isDriver", true); }
result.put("carId", personList.get(0).get("carId"));
result.put("isDriver", true);
ResponseModel<Map<String, Object>> resultModel = result.put("carId", personList.get(0).get("carId"));
equipFeignClient.queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
Map<String, Object> carInfo = resultModel.getResult(); ResponseModel<Map<String, Object>> resultModel = equipFeignClient
result.put("carStatus", carInfo.get("carStatus")); .queryCarSimpleInfoById((Long) personList.get(0).get("carId"));
return result; 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; ...@@ -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.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; 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.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.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
...@@ -299,6 +300,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -299,6 +300,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
list = jsonArray.toJavaList(DutyPersonDto.class); list = jsonArray.toJavaList(DutyPersonDto.class);
}else if("dutyFireFighting".equals(groupCode)){ }else if("dutyFireFighting".equals(groupCode)){
list = jsonArray.toJavaList(DutyFireFightingDto.class); list = jsonArray.toJavaList(DutyFireFightingDto.class);
}else if("dutyFirstAid".equals(groupCode)){
list = jsonArray.toJavaList(DutyFirstAidDto.class);
} }
return list; return list;
} }
...@@ -591,4 +594,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -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; 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 java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -9,13 +13,22 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -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.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto; 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; import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service @Service
public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService { public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService {
@Autowired @Autowired
FireStationServiceImpl fireStationServiceImpl; FireStationServiceImpl fireStationServiceImpl;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
public String getGroupCode() {
return "dutyFireFighting";
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public DutyFireFightingDto save(DutyFireFightingDto dto) { public DutyFireFightingDto save(DutyFireFightingDto dto) {
...@@ -32,13 +45,61 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement ...@@ -32,13 +45,61 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
@Override @Override
public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) { 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()); insertPersonShift(instanceId, dto.getDutyShift());
return dto; return dto;
} }
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType) {
public String getGroupCode() { List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(dutyDay,
return "dutyFireFighting"; 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(",");
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; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import java.util.ArrayList;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import java.util.Calendar;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import java.util.Date;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto; import java.util.HashMap;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; import java.util.LinkedHashMap;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import java.util.Set;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,13 +19,15 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -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.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import com.alibaba.fastjson.JSONArray;
import java.util.Calendar; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import java.util.Date; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import java.util.List; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.Map; import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import java.util.Set; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import java.util.stream.Collectors; 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 * @author DELL
...@@ -36,6 +37,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -36,6 +37,7 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired @Autowired
EquipFeignClient equipFeign; EquipFeignClient equipFeign;
@Override @Override
public String getGroupCode(){ public String getGroupCode(){
...@@ -234,4 +236,98 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -234,4 +236,98 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
}); });
return temp; 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; 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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; 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.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DutyShiftMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyShiftService; 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 ...@@ -35,4 +36,5 @@ public class DutyShiftServiceImpl extends BaseService<DutyShiftDto, DutyShift, D
public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) { public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) {
return this.queryForList("", false, isDelete); return this.queryForList("", false, isDelete);
} }
} }
...@@ -3,8 +3,12 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -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.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationzhDto; 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.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireStation; import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
...@@ -14,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireStationService; ...@@ -14,6 +18,7 @@ import com.yeejoin.amos.boot.module.common.api.service.IFireStationService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; 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.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -36,7 +41,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -36,7 +41,8 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
FireStationMapper fireStationMapper; FireStationMapper fireStationMapper;
@Autowired @Autowired
OrgUsrMapper orgUsrMapper; OrgUsrMapper orgUsrMapper;
@Autowired
OrgUsrServiceImpl orgUsrService;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -143,4 +149,28 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -143,4 +149,28 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
wrapper.select(FireStation::getSequenceNbr,FireStation::getName); wrapper.select(FireStation::getSequenceNbr,FireStation::getName);
return this.baseMapper.selectMaps(wrapper); 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; ...@@ -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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser; import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
...@@ -43,6 +44,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -43,6 +44,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -77,6 +80,8 @@ import java.util.stream.Collectors; ...@@ -77,6 +80,8 @@ import java.util.stream.Collectors;
@Service @Service
public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapper> implements IOrgUsrService { 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 TYPE = "PERSON,COMPANY";
private static final String CODE = "amosAccount"; private static final String CODE = "amosAccount";
...@@ -1527,6 +1532,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1527,6 +1532,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey()); wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper); 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 @Override
public List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId) { public List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId) {
...@@ -1696,4 +1714,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1696,4 +1714,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
return amosUser; 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 { ...@@ -148,16 +148,18 @@ public class AlertCalledController extends BaseController {
String alertSourceCode, String alertSourceCode,
String callTimeStart, String callTimeStart,
String callTimeEnd){ String callTimeEnd){
//Page<AlertCalled> pageBean; /* Page<AlertCalled> pageBean;
// IPage<AlertCalled> page; IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
/* page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper); page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page);*/ return ResponseHelper.buildResponse(page);
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort); setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort); */
/*分页存在问题 修改分页参数 陈召 2021-09-22 开始*/ /*分页存在问题 修改分页参数 陈召 2021-09-22 开始*/
Page<AlertCalled> page = new Page<>(); Page<AlertCalled> page = new Page<>();
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) { if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
page = new Page<>(0, Long.MAX_VALUE); page = new Page<>();
page.setCurrent(0L);
page.setSize(10L);
} else { } else {
page.setCurrent( (Long.parseLong(pageNum) - 1) * Long.parseLong(pageSize)); page.setCurrent( (Long.parseLong(pageNum) - 1) * Long.parseLong(pageSize));
page.setSize(Long.parseLong(pageSize)); page.setSize(Long.parseLong(pageSize));
...@@ -168,7 +170,7 @@ public class AlertCalledController extends BaseController { ...@@ -168,7 +170,7 @@ public class AlertCalledController extends BaseController {
/* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件 /* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件
alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code
陈召 2021-08-21 开始*/ 陈召 2021-08-21 开始*/
IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus,alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd,sort); IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus,alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd,sort);
/* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/ /* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/
alertCalledIPage.getRecords().stream().forEach(e->{ alertCalledIPage.getRecords().stream().forEach(e->{
if(e.getAlertStatus()) { if(e.getAlertStatus()) {
......
...@@ -243,4 +243,11 @@ public class FireTeamController extends BaseController { ...@@ -243,4 +243,11 @@ public class FireTeamController extends BaseController {
List<FirefightersDto> fighters = iFireTeamService.getFighterByTeamId(teamIdList); List<FirefightersDto> fighters = iFireTeamService.getFighterByTeamId(teamIdList);
return ResponseHelper.buildResponse(fighters); 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; ...@@ -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.entity.SpecialPositionStaff;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; 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.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.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService; import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService; import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
...@@ -185,6 +186,9 @@ public class ExcelServiceImpl { ...@@ -185,6 +186,9 @@ public class ExcelServiceImpl {
@Autowired @Autowired
OrgUsrSafeReportServiceImpl orgUsrSafeReportService; OrgUsrSafeReportServiceImpl orgUsrSafeReportService;
@Autowired
IDutyFirstAidService dutyFirstAidService;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException { public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl(); String url = excelDto.getClassUrl();
...@@ -1187,6 +1191,8 @@ public class ExcelServiceImpl { ...@@ -1187,6 +1191,8 @@ public class ExcelServiceImpl {
data = initDutyPersonTemplate(ids); data = initDutyPersonTemplate(ids);
} else if (ExcelEnums.WXXFZB.getType().equals(excelDto.getType())) { } else if (ExcelEnums.WXXFZB.getType().equals(excelDto.getType())) {
data = initDutyDutyFireFightingTemplate(ids); data = initDutyDutyFireFightingTemplate(ids);
} else if (ExcelEnums.JJZB.getType().equals(excelDto.getType())) {
//data = initDutyDutyFirstAidTemplate(ids);
} }
// 获取日期 // 获取日期
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate); List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
...@@ -1199,7 +1205,29 @@ public class ExcelServiceImpl { ...@@ -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) { private List<List<Object>> initDutyDutyFireFightingTemplate(String ids) {
List<List<Object>> data = new ArrayList<>(); List<List<Object>> data = new ArrayList<>();
// 根据id列表获取单位下的微型消防站集合 // 根据id列表获取单位下的微型消防站集合
......
...@@ -10,7 +10,7 @@ import java.util.stream.Collectors; ...@@ -10,7 +10,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -28,6 +28,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.constants.BizConstant; import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.Menu; import com.yeejoin.amos.boot.biz.common.utils.Menu;
...@@ -55,341 +56,352 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceService ...@@ -55,341 +56,352 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceService
* @date 2021-06-07 * @date 2021-06-07
*/ */
@Service @Service
public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, FireTeamMapper> implements IFireTeamService { public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, FireTeamMapper>
implements IFireTeamService {
@Resource
FireTeamMapper fireTeamMapper; @Resource
FireTeamMapper fireTeamMapper;
@Autowired
EquipFeignClient equipFeignClient; @Autowired
EquipFeignClient equipFeignClient;
@Autowired
OrgUsrServiceImpl orgUsrService; @Autowired
OrgUsrServiceImpl orgUsrService;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService; @Autowired
DataDictionaryServiceImpl iDataDictionaryService;
/**
* 获取监控大队列表 /**
* * 获取监控大队列表
* @return *
*/ * @return
public List<FireBrigadeResourceDto> listMonitorFireBrigade(String code) { */
return fireTeamMapper.listMonitorFireBrigade(code); public List<FireBrigadeResourceDto> listMonitorFireBrigade(String code) {
} return fireTeamMapper.listMonitorFireBrigade(code);
}
/**
* 消防队伍分页查询 /**
* * 消防队伍分页查询
* @param page 分页对象 *
* @param team 查询参数 * @param page 分页对象
* @return * @param team 查询参数
*/ * @return
public IPage<FireTeamCardDto> listFireTeamByPage(Page page, FireTeamListDto team) { */
// 获取消防车辆列表 public IPage<FireTeamCardDto> listFireTeamByPage(Page page, FireTeamListDto team) {
ResponseModel<Object> result = equipFeignClient.getFireCarListAll(); // 获取消防车辆列表
Map<Object, Long> teamCarCountMap = Maps.newConcurrentMap(); ResponseModel<Object> result = equipFeignClient.getFireCarListAll();
if (!ValidationUtil.isEmpty(result)) { Map<Object, Long> teamCarCountMap = Maps.newConcurrentMap();
List<Map<String, Object>> fireCarListMapList = (List<Map<String, Object>>) result.getResult(); if (!ValidationUtil.isEmpty(result)) {
if (!ValidationUtil.isEmpty(fireCarListMapList)) { List<Map<String, Object>> fireCarListMapList = (List<Map<String, Object>>) result.getResult();
teamCarCountMap = if (!ValidationUtil.isEmpty(fireCarListMapList)) {
fireCarListMapList.stream().filter(car -> !ValidationUtil.isEmpty(car.get("teamId"))).collect(Collectors.groupingBy(car -> car.get( teamCarCountMap = fireCarListMapList.stream().filter(car -> !ValidationUtil.isEmpty(car.get("teamId")))
"teamId"), Collectors.counting())); .collect(Collectors.groupingBy(car -> car.get("teamId"), Collectors.counting()));
} }
} }
// 查询单位 // 查询单位
if (Objects.equals("1", team.getNodeType())) { if (Objects.equals("1", team.getNodeType())) {
List<OrgUsr> companyDeptList = orgUsrService.listOrgUserById(team.getNodeId()); List<OrgUsr> companyDeptList = orgUsrService.listOrgUserById(team.getNodeId());
team.setNodeIds(companyDeptList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList())); team.setNodeIds(
} companyDeptList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList()));
// 查询队伍 }
if (Objects.equals("0", team.getNodeType())) { // 查询队伍
List<FireTeam> teamList = listFireTeamById(team.getNodeId()); if (Objects.equals("0", team.getNodeType())) {
team.setNodeIds(teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList())); List<FireTeam> teamList = listFireTeamById(team.getNodeId());
} team.setNodeIds(teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList()));
}
IPage<FireTeamCardDto> fireTeamListPage = this.baseMapper.getFireTeamForPage(page, team);
List<FireTeamCardDto> fireTeamList = fireTeamListPage.getRecords(); IPage<FireTeamCardDto> fireTeamListPage = this.baseMapper.getFireTeamForPage(page, team);
Map<Object, Long> finalTeamCarCountMap = teamCarCountMap; List<FireTeamCardDto> fireTeamList = fireTeamListPage.getRecords();
fireTeamList.forEach(t -> { Map<Object, Long> finalTeamCarCountMap = teamCarCountMap;
//递归返回teamId bug2684 bykongfm fireTeamList.forEach(t -> {
List<Long> teamIds = new ArrayList<Long>(); // 递归返回teamId bug2684 bykongfm
getAllTeamId(teamIds,t.getSequenceNbr()); List<Long> teamIds = new ArrayList<Long>();
int carNum = 0; getAllTeamId(teamIds, t.getSequenceNbr());
int fighterNum = 0; int carNum = 0;
for(Long tempId : teamIds ) { int fighterNum = 0;
if(finalTeamCarCountMap.get(tempId.toString()) != null) { for (Long tempId : teamIds) {
carNum += finalTeamCarCountMap.get(tempId.toString()).intValue(); if (finalTeamCarCountMap.get(tempId.toString()) != null) {
} carNum += finalTeamCarCountMap.get(tempId.toString()).intValue();
fighterNum += fireTeamMapper.getFighterNumByTeamId(tempId); }
} fighterNum += fireTeamMapper.getFighterNumByTeamId(tempId);
t.setCarNum(carNum); }
t.setFighterNum(fighterNum); t.setCarNum(carNum);
/*//递归查找全部战备人数 BUG2217 bykongfmfirefighters/1435850387868385282 t.setFighterNum(fighterNum);
t.setFighterNum(getFightNumByTeamId(t.getSequenceNbr()));*/ /*
}); * //递归查找全部战备人数 BUG2217 bykongfmfirefighters/1435850387868385282
fireTeamListPage.setRecords(fireTeamList); * t.setFighterNum(getFightNumByTeamId(t.getSequenceNbr()));
return fireTeamListPage; */
} });
fireTeamListPage.setRecords(fireTeamList);
public List<FireTeam> listFireTeamById(Long teamId) { return fireTeamListPage;
return this.baseMapper.listFireTeamById(teamId); }
}
public List<FireTeam> listFireTeamById(Long teamId) {
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete) { return this.baseMapper.listFireTeamById(teamId);
return fireTeamMapper.listFireTeamDto(isDelete); }
}
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete) {
/** return fireTeamMapper.listFireTeamDto(isDelete);
* 根据列表构造队伍树 }
*
* @param columnMap 查询列表条件 /**
* @return 队伍树 * 根据列表构造队伍树
* @throws Exception *
*/ * @param columnMap 查询列表条件
public List<Menu> getTeamTree(Map<String, Object> columnMap) throws Exception { * @return 队伍树
Collection<FireTeam> list = this.listByMap(columnMap); * @throws Exception
return TreeParser.getTree(null, list, FireTeam.class.getName(), "getSequenceNbr", 2, "getName", */
"getParent", null); public List<Menu> getTeamTree(Map<String, Object> columnMap) throws Exception {
} Collection<FireTeam> list = this.listByMap(columnMap);
return TreeParser.getTree(null, list, FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
/** null);
* 获取机场单位-队伍树 }
*
* @return /**
*/ * 获取机场单位-队伍树
public List<MenuFrom> getCompanyTeamTree() throws Exception { *
MenuFrom root = new MenuFrom("-1", "消防队伍", null, null); * @return
// 机场单位 */
//bug:2457需求要求不显示部门,因此更换方法 by 陈浩 2021-08-18 public List<MenuFrom> getCompanyTeamTree() throws Exception {
// List<OrgUsr> companyDeptList = orgUsrService.selectCompanyDepartmentMsg(); MenuFrom root = new MenuFrom("-1", "消防队伍", null, null);
List<OrgUsr> companyDeptList = orgUsrService.selectCompanyList(); // 机场单位
List<MenuFrom> companyDeptMenuList = Lists.newArrayList(); // bug:2457需求要求不显示部门,因此更换方法 by 陈浩 2021-08-18
companyDeptList.forEach(o -> { // List<OrgUsr> companyDeptList = orgUsrService.selectCompanyDepartmentMsg();
if (ValidationUtil.isEmpty(o.getParentId())) { List<OrgUsr> companyDeptList = orgUsrService.selectCompanyList();
o.setParentId("-1"); List<MenuFrom> companyDeptMenuList = Lists.newArrayList();
} companyDeptList.forEach(o -> {
companyDeptMenuList.add(new MenuFrom(o.getSequenceNbr().toString(), o.getBizOrgName(), o.getParentId(), if (ValidationUtil.isEmpty(o.getParentId())) {
"1")); o.setParentId("-1");
}); }
// 消防队伍 companyDeptMenuList
List<MenuFrom> teamMenuList = Lists.newArrayList(); .add(new MenuFrom(o.getSequenceNbr().toString(), o.getBizOrgName(), o.getParentId(), "1"));
List<FireTeamDto> teamList = this.queryFireTeamForList(false); });
teamList.forEach(team -> { // 消防队伍
if (ValidationUtil.isEmpty(team.getParent())) { List<MenuFrom> teamMenuList = Lists.newArrayList();
// 将单位下没有上级队伍的队伍直接挂在单位下(方便组成树结构) List<FireTeamDto> teamList = this.queryFireTeamForList(false);
team.setParent(team.getCompany()); teamList.forEach(team -> {
} if (ValidationUtil.isEmpty(team.getParent())) {
teamMenuList.add(new MenuFrom(team.getSequenceNbr().toString(), team.getName(), // 将单位下没有上级队伍的队伍直接挂在单位下(方便组成树结构)
team.getParent().toString(), "0")); team.setParent(team.getCompany());
}); }
companyDeptMenuList.addAll(teamMenuList); teamMenuList.add(
List<MenuFrom> menuList = TreeParser.getTreexin("-1", companyDeptMenuList, MenuFrom.class.getName(), "getKey", new MenuFrom(team.getSequenceNbr().toString(), team.getName(), team.getParent().toString(), "0"));
1, "getName", "getParentId", "getNodeType"); });
root.setChildren(menuList); companyDeptMenuList.addAll(teamMenuList);
return Lists.newArrayList(root); List<MenuFrom> menuList = TreeParser.getTreexin("-1", companyDeptMenuList, MenuFrom.class.getName(), "getKey",
} 1, "getName", "getParentId", "getNodeType");
root.setChildren(menuList);
/** return Lists.newArrayList(root);
* 根据队伍id查询队伍下人员列表 }
*
* @param teamIds /**
* @return * 根据队伍id查询队伍下人员列表
*/ *
public List<FirefightersDto> getFighterByTeamId(List<String> teamIds) { * @param teamIds
return this.baseMapper.queryFighterByTeamId(teamIds); * @return
} */
public List<FirefightersDto> getFighterByTeamId(List<String> teamIds) {
public FireTeam saveFireTeam(FireTeam fireTeam) { return this.baseMapper.queryFighterByTeamId(teamIds);
}
if(fireTeam.getAddress()!=null){ public FireTeam saveFireTeam(FireTeam fireTeam) {
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
fireTeam.setAddress(address.getString(BizConstant.ADDRESS)); if (fireTeam.getAddress() != null) {
fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE))); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE))); fireTeam.setAddress(address.getString(BizConstant.ADDRESS));
} fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
if (ValidationUtil.isEmpty(fireTeam.getParent())) { fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
fireTeam.setTreeCode(TreeParser.genTreeCode()); }
} else { if (ValidationUtil.isEmpty(fireTeam.getParent())) {
FireTeam parentTeam = getById(fireTeam.getParent()); fireTeam.setTreeCode(TreeParser.genTreeCode());
fireTeam.setTreeCode(parentTeam.getTreeCode() + TreeParser.genTreeCode()); } else {
} FireTeam parentTeam = getById(fireTeam.getParent());
fireTeam.setTreeCode(parentTeam.getTreeCode() + TreeParser.genTreeCode());
DataDictionary dataDictionary = iDataDictionaryService.getById(fireTeam.getTypeCode()); }
if (null != dataDictionary) {
fireTeam.setType(dataDictionary.getName()); DataDictionary dataDictionary = iDataDictionaryService.getById(fireTeam.getTypeCode());
} if (null != dataDictionary) {
if (ValidationUtil.isEmpty(fireTeam.getSequenceNbr())) { fireTeam.setType(dataDictionary.getName());
save(fireTeam); }
} else { if (ValidationUtil.isEmpty(fireTeam.getSequenceNbr())) {
updateById(fireTeam); save(fireTeam);
} } else {
return fireTeam; updateById(fireTeam);
} }
return fireTeam;
public static JSONObject getLongLatFromAddress(String address) { }
JSONObject result = new JSONObject();
result.put(BizConstant.ADDRESS, ""); public static JSONObject getLongLatFromAddress(String address) {
result.put(BizConstant.LONGITUDE, "0"); JSONObject result = new JSONObject();
result.put(BizConstant.LATITUDE, "0"); result.put(BizConstant.ADDRESS, "");
if (StringUtils.isNotEmpty(address)) { result.put(BizConstant.LONGITUDE, "0");
String[] addressData = address.split("@address@"); result.put(BizConstant.LATITUDE, "0");
if (addressData.length > 1) { if (StringUtils.isNotEmpty(address)) {
result.put(BizConstant.ADDRESS, addressData[0]); String[] addressData = address.split("@address@");
JSONObject langLatObj = JSON.parseObject(addressData[1]); if (addressData.length > 1) {
if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LONGITUDE))) { result.put(BizConstant.ADDRESS, addressData[0]);
result.put(BizConstant.LONGITUDE, langLatObj.getString(BizConstant.LONGITUDE)); JSONObject langLatObj = JSON.parseObject(addressData[1]);
} else { if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LONGITUDE))) {
result.put(BizConstant.LONGITUDE, "0"); result.put(BizConstant.LONGITUDE, langLatObj.getString(BizConstant.LONGITUDE));
} } else {
if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LATITUDE))) { result.put(BizConstant.LONGITUDE, "0");
result.put(BizConstant.LATITUDE, langLatObj.getString(BizConstant.LATITUDE)); }
} else { if (StringUtils.isNotEmpty(langLatObj.getString(BizConstant.LATITUDE))) {
result.put(BizConstant.LATITUDE, "0"); result.put(BizConstant.LATITUDE, langLatObj.getString(BizConstant.LATITUDE));
} } else {
} else { result.put(BizConstant.LATITUDE, "0");
result.put(BizConstant.ADDRESS, addressData[0]); }
} } else {
} result.put(BizConstant.ADDRESS, addressData[0]);
return result; }
} }
return result;
/** }
* 根据id删除队伍
* /**
* @param parent * 根据id删除队伍
*/ *
public void deleteById(Long parent) throws Exception { * @param parent
// 查询是否有下属队伍 */
// List<FireTeamDto> fireTeamList = queryForList(null, false, parent); public void deleteById(Long parent) throws Exception {
/*3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 start*/ // 查询是否有下属队伍
LambdaQueryWrapper<FireTeam> wrapper = new LambdaQueryWrapper<>(); // List<FireTeamDto> fireTeamList = queryForList(null, false, parent);
wrapper.eq(FireTeam::getParent,parent); /* 3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 start */
wrapper.eq(BaseEntity::getIsDelete,0); LambdaQueryWrapper<FireTeam> wrapper = new LambdaQueryWrapper<>();
List<FireTeam> fireTeams = baseMapper.selectList(wrapper); wrapper.eq(FireTeam::getParent, parent);
/*3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 end*/ wrapper.eq(BaseEntity::getIsDelete, 0);
if (!ValidationUtil.isEmpty(fireTeams) && fireTeams.size() > 0) { List<FireTeam> fireTeams = baseMapper.selectList(wrapper);
// 有下属队伍不能删除 /* 3026 【web】日常管理>机场单位,删除有级联数据的部门时,应无法直接删除 chenzhao 2021-09-28 end */
throw new BaseException("该队伍下有下级队伍,不能删除", null, "该队伍下有下级队伍,不能删除"); if (!ValidationUtil.isEmpty(fireTeams) && fireTeams.size() > 0) {
} // 有下属队伍不能删除
update(new UpdateWrapper<FireTeam>().eq("sequence_nbr", parent).set("is_delete", 1)); throw new BaseException("该队伍下有下级队伍,不能删除", null, "该队伍下有下级队伍,不能删除");
} }
update(new UpdateWrapper<FireTeam>().eq("sequence_nbr", parent).set("is_delete", 1));
@Override }
public List<FireTeamZhDto> getFireTeamList(Integer pageNum, Integer pageSize, RequestData par) {
@Override
public List<FireTeamZhDto> getFireTeamList(Integer pageNum, Integer pageSize, RequestData par) {
if (null == pageNum || null == pageSize) {
pageNum = 1; if (null == pageNum || null == pageSize) {
pageSize = Integer.MAX_VALUE; pageNum = 1;
} else { pageSize = Integer.MAX_VALUE;
pageNum = (pageNum - 1) * pageSize; } else {
} pageNum = (pageNum - 1) * pageSize;
}
List<FireTeamZhDto> list = fireTeamMapper.getFireTeamList(pageNum, pageSize, par);
List<FireTeamZhDto> list = fireTeamMapper.getFireTeamList(pageNum, pageSize, par);
// 获取消防车辆列表
ResponseModel<List<Map<String, Object>>> result = equipFeignClient.getFireCarListAllcount(); // 获取消防车辆列表
ResponseModel<List<Map<String, Object>>> result = equipFeignClient.getFireCarListAllcount();
List<Map<String, Object>> result1 = result.getResult();
List<Map<String, Object>> result1 = result.getResult();
list.forEach(fireTeamZhDto -> {
Long sequenceNbr = fireTeamZhDto.getSequenceNbr(); list.forEach(fireTeamZhDto -> {
result1.forEach(map -> { Long sequenceNbr = fireTeamZhDto.getSequenceNbr();
String mapId = String.valueOf(map.get("teamId")); result1.forEach(map -> {
if(String.valueOf(sequenceNbr).equals(mapId)){ String mapId = String.valueOf(map.get("teamId"));
Integer carNum = Integer.valueOf(map.get("carNum").toString()); if (String.valueOf(sequenceNbr).equals(mapId)) {
fireTeamZhDto.setCarNum(carNum); Integer carNum = Integer.valueOf(map.get("carNum").toString());
} fireTeamZhDto.setCarNum(carNum);
}); }
}); });
/* });
/*
if(result1!=null&&result1.size()>0){ *
Map<String, Object> combineResultMap = new HashMap<String, Object>(); * if(result1!=null&&result1.size()>0){ Map<String, Object> combineResultMap =
result1.stream().forEach(obj ->{ * new HashMap<String, Object>(); result1.stream().forEach(obj ->{
combineResultMap.put(obj.get("teamId").toString(),obj.get("carNum")); * combineResultMap.put(obj.get("teamId").toString(),obj.get("carNum")); });
}); * list.stream().forEach(obj ->{
list.stream().forEach(obj ->{ * if(combineResultMap.containsKey(obj.getSequenceNbr())){
if(combineResultMap.containsKey(obj.getSequenceNbr())){ * obj.setCarNum(Integer.valueOf(combineResultMap.get(obj.getSequenceNbr()).
obj.setCarNum(Integer.valueOf(combineResultMap.get(obj.getSequenceNbr()).toString())); * toString())); } }); }
} */
}); return list;
}*/ }
return list;
} @Override
public Integer getFireTeamListCount(RequestData par) {
@Override
public Integer getFireTeamListCount(RequestData par) { return fireTeamMapper.getFireTeamListCount(par);
}
return fireTeamMapper.getFireTeamListCount(par);
} @Override
public FireTeam getFireTeamBySequenceNbr(Long id) {
@Override return this.getById(id);
public FireTeam getFireTeamBySequenceNbr(Long id) { }
return this.getById(id);
} @Override
public List<FireTeamZhDto> getFireTeamCountList() {
@Override List<FireTeamZhDto> list = fireTeamMapper.getFireTeamCountList();
public List<FireTeamZhDto> getFireTeamCountList() {
List<FireTeamZhDto> list = fireTeamMapper.getFireTeamCountList(); // 获取消防车辆列表
ResponseModel<List<Map<String, Object>>> result = equipFeignClient.getFireCarListAllcount();
// 获取消防车辆列表 List<Map<String, Object>> result1 = result.getResult();
ResponseModel<List<Map<String, Object>>> result = equipFeignClient.getFireCarListAllcount(); if (result1 != null && result1.size() > 0) {
Map<String, Object> combineResultMap = new HashMap<String, Object>();
List<Map<String, Object>> result1 = result.getResult(); result1.stream().forEach(obj -> {
if (result1 != null && result1.size() > 0) { combineResultMap.put(obj.get("teamId").toString(), obj.get("carNum"));
Map<String, Object> combineResultMap = new HashMap<String, Object>(); });
result1.stream().forEach(obj -> { list.stream().forEach(obj -> {
combineResultMap.put(obj.get("teamId").toString(), obj.get("carNum")); if (combineResultMap.containsKey(obj.getSequenceNbr().toString())) {
}); obj.setCarNum(Integer.valueOf(combineResultMap.get(obj.getSequenceNbr().toString()).toString()));
list.stream().forEach(obj -> { }
if (combineResultMap.containsKey(obj.getSequenceNbr().toString())) { });
obj.setCarNum(Integer.valueOf(combineResultMap.get(obj.getSequenceNbr().toString()).toString())); }
}
}); return list;
}
}
return list; public Integer getFightNumByTeamId(Long teamId) {
Integer count = 0;
} // 获取自己的数据
count += fireTeamMapper.getFighterNumByTeamId(teamId);
public Integer getFightNumByTeamId(Long teamId) { // 获取下部分数据
Integer count = 0; LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<>();
// 获取自己的数据 queryWrapper.eq(FireTeam::getParent, teamId).eq(FireTeam::getIsDelete, false);
count += fireTeamMapper.getFighterNumByTeamId(teamId); List<FireTeam> fireTeamList = this.list(queryWrapper);
// 获取下部分数据 if (fireTeamList.size() == 0) {
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<>(); return count;
queryWrapper.eq(FireTeam::getParent, teamId).eq(FireTeam::getIsDelete, false); } else {
List<FireTeam> fireTeamList = this.list(queryWrapper); for (FireTeam t : fireTeamList) {
if (fireTeamList.size() == 0) { count += getFightNumByTeamId(t.getSequenceNbr());
return count; }
} else { }
for (FireTeam t : fireTeamList) { // 获取子集数据
count += getFightNumByTeamId(t.getSequenceNbr()); return count;
} }
}
// 获取子集数据 public void getAllTeamId(List<Long> teamIds, Long teamId) {
return count; teamIds.add(teamId);
} LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(FireTeam::getParent, teamId).eq(FireTeam::getIsDelete, false);
List<FireTeam> fireTeamList = this.list(queryWrapper);
public void getAllTeamId(List<Long> teamIds, Long teamId) { if (fireTeamList.size() == 0) {
teamIds.add(teamId); // 没有下级单位
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<>(); } else {
queryWrapper.eq(FireTeam::getParent, teamId).eq(FireTeam::getIsDelete, false); for (FireTeam t : fireTeamList) {
List<FireTeam> fireTeamList = this.list(queryWrapper); getAllTeamId(teamIds, t.getSequenceNbr());
if (fireTeamList.size() == 0) { }
// 没有下级单位 }
} else { }
for (FireTeam t : fireTeamList) {
getAllTeamId(teamIds, t.getSequenceNbr()); /**
} * 加载系统中本单位消防队伍中类型为【企(事)业单位医疗救援队(站)】的队伍 --->急救站
} * @param typeCode
} */
public List<FireTeam> getFirstAidForTypeCodeAndCompanyId(String dicCode,String typeCode,Long companyId) {
DataDictionary dataDictionary = iDataDictionaryService.getByCode(dicCode,typeCode);
if (ObjectUtils.isEmpty(dataDictionary)) {
return null;
}
String code = dataDictionary.getCode();
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>();
queryWrapper.eq(FireTeam::getTypeCode, code);
queryWrapper.eq(FireTeam::getIsDelete, false);
queryWrapper.eq(FireTeam::getCompany, companyId);
return this.baseMapper.selectList(queryWrapper);
}
} }
...@@ -147,7 +147,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -147,7 +147,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private WorkflowFeignService workflowFeignService; private WorkflowFeignService workflowFeignService;
// 有启动后执行现场确认的角色名称 // 有启动后执行现场确认的角色名称
private String onSiteConfirmRole = "Person_charge_unit_fire_protection_supervision_inspection"; @Value("${onSite.confirm.roleName}")
private String onSiteConfirmRole;
@Autowired @Autowired
JcsFeignClient jcsFeignClient; JcsFeignClient jcsFeignClient;
...@@ -1156,7 +1157,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -1156,7 +1157,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
RoleBo roleBo = reginParams.getRole(); RoleBo roleBo = reginParams.getRole();
if (!onSiteConfirmRole.equals(roleBo.getRoleName())) { if (!onSiteConfirmRole.equals(roleBo.getRoleName())) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("没有权限执行"); executeSubmitDto.setMsg("没有执行权限");
return executeSubmitDto; return executeSubmitDto;
} }
// 2、开启工作流 // 2、开启工作流
......
...@@ -823,4 +823,15 @@ public class PointController extends AbstractBaseController { ...@@ -823,4 +823,15 @@ public class PointController extends AbstractBaseController {
return ResponseHelper.buildResponse(iPointService.getPlanExecuteTeams()); 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 { ...@@ -171,4 +171,6 @@ public interface PointMapper extends BaseMapper {
* @return * @return
*/ */
List<Point> getPointByPlanId(String planId); List<Point> getPointByPlanId(String planId);
List<Long> queryAllPointList();
} }
...@@ -4,6 +4,9 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult; ...@@ -4,6 +4,9 @@ import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/** /**
* @author DELL * @author DELL
...@@ -18,4 +21,11 @@ public interface JCSFeignClient { ...@@ -18,4 +21,11 @@ public interface JCSFeignClient {
*/ */
@GetMapping(value = "jcs/org-usr/getLoginUserDetails/{userId}") @GetMapping(value = "jcs/org-usr/getLoginUserDetails/{userId}")
FeignClientResult getUserUnit(@PathVariable String 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; ...@@ -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.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient; import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.feign.EquipFeign; 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.param.*;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService; import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.DaoCriteria; import com.yeejoin.amos.supervision.business.util.DaoCriteria;
...@@ -47,12 +48,14 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -47,12 +48,14 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root; import javax.persistence.criteria.Root;
import java.beans.Beans;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -111,6 +114,9 @@ public class PointServiceImpl implements IPointService { ...@@ -111,6 +114,9 @@ public class PointServiceImpl implements IPointService {
@Autowired @Autowired
private DangerFeignClient dangerFeignClient; private DangerFeignClient dangerFeignClient;
@Autowired
private JCSFeignClient jcsFeignClient;
private final int HTTP_OK_STATUS = 200; private final int HTTP_OK_STATUS = 200;
@Override @Override
...@@ -1242,4 +1248,17 @@ public class PointServiceImpl implements IPointService { ...@@ -1242,4 +1248,17 @@ public class PointServiceImpl implements IPointService {
return pointMapper.getPlanExecuteTeams(); 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 { ...@@ -331,4 +331,10 @@ public interface IPointService {
List<Map<String, Object>> getPlanExecuteTeams(); List<Map<String, Object>> getPlanExecuteTeams();
/**
* 将所有机场单位数据同步到消防监督服务p_point表
*
* @return
*/
Boolean syncOrgCompany();
} }
...@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -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.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; 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.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl; 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; ...@@ -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.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto; 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.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.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator; 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.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
...@@ -193,7 +196,10 @@ public class AlertCalledController extends BaseController { ...@@ -193,7 +196,10 @@ public class AlertCalledController extends BaseController {
alertCalledDto.setUseStatus(elevator.getUseStatus()); alertCalledDto.setUseStatus(elevator.getUseStatus());
alertCalledDto.setUseSiteCategory(elevator.getUseSiteCategory()); alertCalledDto.setUseSiteCategory(elevator.getUseSiteCategory());
alertCalledDto.setAlarmType(AlertStageEnums.getEnumById(alertCalledDto.getAlarmTypeCode()).getValue()); 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); AlertCalledDto alertCalledDtoReturn = iAlertCalledService.createAlertCalled(alertCalledDto);
return ResponseHelper.buildResponse(alertCalledDtoReturn); return ResponseHelper.buildResponse(alertCalledDtoReturn);
} }
...@@ -230,6 +236,11 @@ public class AlertCalledController extends BaseController { ...@@ -230,6 +236,11 @@ public class AlertCalledController extends BaseController {
alertPaperInfoDto.setAlertStatus(alertCalled.getAlertStage()); alertPaperInfoDto.setAlertStatus(alertCalled.getAlertStage());
alertPaperInfoDto.setElevatorId(elevator.getSequenceNbr() +""); alertPaperInfoDto.setElevatorId(elevator.getSequenceNbr() +"");
alertPaperInfoDto.setElevatorCode(elevator.getRegisterCode()); 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); return ResponseHelper.buildResponse(alertPaperInfoDto);
} }
...@@ -410,7 +421,16 @@ public class AlertCalledController extends BaseController { ...@@ -410,7 +421,16 @@ public class AlertCalledController extends BaseController {
String sort) { String sort) {
queryWrapper.eq("is_delete", 0); queryWrapper.eq("is_delete", 0);
queryWrapper.orderByDesc("call_time"); 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.getIsAuxiliaryScreen())) {
if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart()) if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())
...@@ -469,7 +489,7 @@ public class AlertCalledController extends BaseController { ...@@ -469,7 +489,7 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录") @ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@GetMapping("/exportSelectRecord") @GetMapping("/exportSelectRecord")
public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) { public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
...@@ -492,6 +512,22 @@ public class AlertCalledController extends BaseController { ...@@ -492,6 +512,22 @@ public class AlertCalledController extends BaseController {
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list, AlertCalledQueryDto.class, null, false); 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; ...@@ -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.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto; 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.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.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
...@@ -300,14 +301,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -300,14 +301,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"}; String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"};
if(null != dispatchPaper) { if(null != dispatchPaper) {
map.put("adNotice",dispatchPaper.getDispatchTime());
map.put("aedArrive",dispatchPaper.getArriveTime());
map.put("afeComplete",dispatchPaper.getSaveTime());
for(String s:str) { for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto(); AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
if(null != dispatchTask &&dispatchTask.size() > 0 ) { if(null != dispatchTask &&dispatchTask.size() > 0 ) {
List<DispatchTask> taskList = dispatchTask.stream().filter(e->e.getOrgType().equals(s)).collect(Collectors.toList()); List<DispatchTask> taskList = dispatchTask.stream().filter(e->e.getOrgType().equals(s)).collect(Collectors.toList());
if(taskList.size() > 0) { 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,"", "","已派遣", dataInit(alertHandlerInfoDto,s,"", "","已派遣",
dispatchTask.get(0).getArriveTime() == null ? "" : "已到达" ,dispatchTask.get(0).getSaveTime() == null ? "" : "已完成", dispatchTask.get(0).getArriveTime() == null ? "" : "已到达" ,dispatchTask.get(0).getSaveTime() == null ? "" : "已完成",
dispatchPaper.getFeedbackTime() != null || dispatchPaper.getFeedbackFinishTime() != null ? "已回访" : ""); dispatchPaper.getFeedbackTime() != null || dispatchPaper.getFeedbackFinishTime() != null ? "已回访" : "");
...@@ -354,6 +355,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -354,6 +355,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return baseMapper.getBussinessListByPhonePager(phone, bussinessCode, current*5); 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) { private void dataInit(AlertHandlerInfoDto alertHandlerInfoDto, String process,String answerThePolice, String report, String notice, String arrive, String complete,String returnVisit) {
alertHandlerInfoDto.setAbProcess(process); alertHandlerInfoDto.setAbProcess(process);
alertHandlerInfoDto.setAcAnswerThePolice(answerThePolice); alertHandlerInfoDto.setAcAnswerThePolice(answerThePolice);
...@@ -380,7 +387,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -380,7 +387,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// 警情基本信息 // 警情基本信息
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledObjsDto.getAlertCalledDto(),AlertCalled.class); AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledObjsDto.getAlertCalledDto(),AlertCalled.class);
alertCalled.setEquipmentClassification("电梯");
alertCalled.setEquipmentClassificationCode("3000");
alertCalled.setCallTime(DateUtils.longStr2Date(alertCalled.getCallTimeStr())); alertCalled.setCallTime(DateUtils.longStr2Date(alertCalled.getCallTimeStr()));
// 判断是否归并警情 // 判断是否归并警情
...@@ -418,6 +426,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -418,6 +426,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
queryWrapper.eq(Elevator::getRescueCode,alertCalled.getDeviceId()); queryWrapper.eq(Elevator::getRescueCode,alertCalled.getDeviceId());
Elevator elevator = iElevatorService.getOne(queryWrapper); Elevator elevator = iElevatorService.getOne(queryWrapper);
alertCalled.setEquipmentId(elevator.getSequenceNbr()); alertCalled.setEquipmentId(elevator.getSequenceNbr());
alertCalled.setCity(elevator.getCity());
alertCalled.setDistrict(elevator.getDistrict());
this.save(alertCalled); this.save(alertCalled);
// 动态表单 // 动态表单
......
...@@ -116,6 +116,7 @@ public class ESAlertCalledService { ...@@ -116,6 +116,7 @@ public class ESAlertCalledService {
esAlertCalled.setAlertStatus(alertCalled.getAlertStatus()); esAlertCalled.setAlertStatus(alertCalled.getAlertStatus());
esAlertCalled.setEmergencyCall(alertCalled.getEmergencyCall()); esAlertCalled.setEmergencyCall(alertCalled.getEmergencyCall());
esAlertCalled.setDeviceId(alertCalled.getDeviceId()); esAlertCalled.setDeviceId(alertCalled.getDeviceId());
esAlertCalled.setUseUnit(alertCalled.getUseUnit());
if (alertCalled.getAlertStatus()) if (alertCalled.getAlertStatus())
{ {
esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode()); esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode());
...@@ -141,13 +142,11 @@ public class ESAlertCalledService { ...@@ -141,13 +142,11 @@ public class ESAlertCalledService {
public Page<ESAlertCalledDto> queryByKeys(ESAlertCalledRequestDto alertCalledVo, int current, int size) public Page<ESAlertCalledDto> queryByKeys(ESAlertCalledRequestDto alertCalledVo, int current, int size)
{ {
Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size); Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size);
String[] alertStatus = alertCalledVo.getAlertStatus(); String[] alertStatus = alertCalledVo.getAlertStatus();
if (ValidationUtil.isEmpty(alertStatus)) if (ValidationUtil.isEmpty(alertStatus))
{ {
return result; return result;
} }
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledVo.getAlertCalledDto(),AlertCalled.class); AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledVo.getAlertCalledDto(),AlertCalled.class);
if (ValidationUtil.isEmpty(alertCalled)) if (ValidationUtil.isEmpty(alertCalled))
{ {
...@@ -157,54 +156,92 @@ public class ESAlertCalledService { ...@@ -157,54 +156,92 @@ public class ESAlertCalledService {
* 通用匹配规则,条件构建 * 通用匹配规则,条件构建
*/ */
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//警情状态 //警情状态
BoolQueryBuilder qb0 = QueryBuilders.boolQuery(); BoolQueryBuilder qbstatus = QueryBuilders.boolQuery();
for (String status : alertStatus) for (String status : alertStatus)
{ {
AlertStatusEnum alertStatusEnum = AlertStatusEnum.getEnum(status); AlertStatusEnum alertStatusEnum = AlertStatusEnum.getEnum(status);
if (!ValidationUtil.isEmpty(alertStatusEnum)) 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);
//接警时间,距离当前时间不超过两个小时的 // 如果没有搜索条件不搜索
long currentTime = System.currentTimeMillis() ; boolean flag = true;
currentTime = currentTime - 120*60*1000; // ①事发地点一致,或相距不超过200米的;&& ②警情类别一致;&& ③报警时间:距离当前时间不超过两小时的
BoolQueryBuilder qb1 = QueryBuilders.boolQuery() if (!ValidationUtil.isEmpty(alertCalled.getAddress()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()))
.filter(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMust.must(qb1);
//报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getEmergencyCall()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone()))
{ {
BoolQueryBuilder qb2 = QueryBuilders.boolQuery() flag = false;
.should(QueryBuilders.termQuery("emergencyCall.keyword", alertCalled.getEmergencyCall())) BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
.should(QueryBuilders.termQuery("contactPhone.keyword", alertCalled.getContactPhone())); BoolQueryBuilder temp1 = QueryBuilders.boolQuery()
boolMust.must(qb2); .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 temp3 = QueryBuilders.boolQuery()
.filter(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
qb0.must(temp3);
boolMust.should(qb0);
} }
//事发地点一致,或相距不超过200米的 // 报警电话一致;
if (!ValidationUtil.isEmpty(alertCalled.getAddress())) if (!ValidationUtil.isEmpty(alertCalled.getEmergencyCall())) {
{ flag = false;
BoolQueryBuilder qb3 = QueryBuilders.boolQuery() BoolQueryBuilder tempQb = QueryBuilders.boolQuery();
.filter(QueryBuilders.matchQuery("address", alertCalled.getAddress())); BoolQueryBuilder tempQb1 = QueryBuilders.boolQuery()
boolMust.should(qb3); .filter(QueryBuilders.termQuery("emergencyCall.keyword", alertCalled.getEmergencyCall()));
tempQb.must(tempQb1);
boolMust.should(tempQb);
} }
//警情类型一致 // 使用单位名称一致;&& ②警情类别一致;&& ③报警时间:距离当前时间不超过两小时的
BoolQueryBuilder qb4 = QueryBuilders.boolQuery() if (!ValidationUtil.isEmpty(alertCalled.getUseUnit()) && !ValidationUtil.isEmpty(alertCalled.getAlarmTypeCode()) ) {
.filter(QueryBuilders.termQuery("alarmTypeCode", alertCalled.getAlarmTypeCode())); flag = false;
boolMust.must(qb4); BoolQueryBuilder qb0 = QueryBuilders.boolQuery();
//使用单位名称一致 BoolQueryBuilder temp1 = QueryBuilders.boolQuery()
if (!ValidationUtil.isEmpty(alertCalled.getUseUnit())) .filter(QueryBuilders.termQuery("useUnit.keyword", alertCalled.getUseUnit()));
{ qb0.must(temp1);
BoolQueryBuilder qb5 = QueryBuilders.boolQuery()
.filter(QueryBuilders.termQuery("useUnit.keyword", alertCalled.getUseUnit())); BoolQueryBuilder temp2 = QueryBuilders.boolQuery()
boolMust.must(qb5); .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())); .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; ...@@ -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.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RepairConsultDto; 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.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.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper; import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask; import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
...@@ -275,6 +276,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -275,6 +276,12 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
// 警情伤亡消息 矩阵 消息 // 警情伤亡消息 矩阵 消息
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("alertId",String.valueOf(alertCalledVo.getSequenceNbr())); 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 { try {
emqKeeper.getMqttClient().publish(alertHeartpushTopic, jsonObject.toString().getBytes("UTF-8"), 1, false); emqKeeper.getMqttClient().publish(alertHeartpushTopic, jsonObject.toString().getBytes("UTF-8"), 1, false);
emqKeeper.getMqttClient().publish(alertMatrixpushTopic, 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 ...@@ -224,7 +224,8 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
if(taskId == null) { if(taskId == null) {
throw new BadRequest("派遣任务单信息未找到"); throw new BadRequest("派遣任务单信息未找到");
} }
// 更新派遣到达时间
dispatchTaskServiceImpl.update(new LambdaUpdateWrapper<DispatchTask>().eq(DispatchTask::getSequenceNbr,taskId).set(DispatchTask::getArriveTime,rescueProcessDto.getArriveTime()));
repairConsultServiceImpl.saveRepairConsultByAlertIdType( rescueProcessDto.getAlertId(),"DD",taskId,sendUser); //保存接警日志 repairConsultServiceImpl.saveRepairConsultByAlertIdType( rescueProcessDto.getAlertId(),"DD",taskId,sendUser); //保存接警日志
} }
if(saveByUser) { // 手动救援 if(saveByUser) { // 手动救援
...@@ -243,6 +244,8 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu ...@@ -243,6 +244,8 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
DispatchPaper dispatchPaper = dispatchPaperDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperDto.getDispatchPaper();
dispatchPaper.setSaveTime(rescueProcessDto.getRescueTime()); dispatchPaper.setSaveTime(rescueProcessDto.getRescueTime());
// 更新派遣单 // 更新派遣单
// 更新派遣救援时间
dispatchTaskServiceImpl.update(new LambdaUpdateWrapper<DispatchTask>().eq(DispatchTask::getSequenceNbr,taskId).set(DispatchTask::getSaveTime,rescueProcessDto.getRescueTime()));
dispatchPaperServiceImpl.updateById(dispatchPaper); dispatchPaperServiceImpl.updateById(dispatchPaper);
repairConsultServiceImpl.saveRepairConsultByAlertIdType(rescueProcessDto.getAlertId(),"JC",taskId,sendUser); //保存接警日志 repairConsultServiceImpl.saveRepairConsultByAlertIdType(rescueProcessDto.getAlertId(),"JC",taskId,sendUser); //保存接警日志
} }
......
...@@ -1752,11 +1752,58 @@ ...@@ -1752,11 +1752,58 @@
</sql> </sql>
</changeSet> </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"> <changeSet author="tw" id="2021-10-15-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
...@@ -1780,4 +1827,5 @@ ...@@ -1780,4 +1827,5 @@
</databaseChangeLog> </databaseChangeLog>
...@@ -92,4 +92,6 @@ iot.fegin.name=AMOS-API-IOT ...@@ -92,4 +92,6 @@ iot.fegin.name=AMOS-API-IOT
control.fegin.name=JCS-API-CONTROL control.fegin.name=JCS-API-CONTROL
supervision.feign.name=AMOS-SUPERVISION-API supervision.feign.name=AMOS-SUPERVISION-API
jcs.fegin.name=JCS jcs.fegin.name=JCS
\ No newline at end of file
onSite.confirm.roleName="Person_charge_unit_fire_protection_supervision_inspection"
\ No newline at end of file
...@@ -1193,4 +1193,7 @@ ...@@ -1193,4 +1193,7 @@
and pl.id = #{planId} and pl.id = #{planId}
and po.id = rp.point_id) and po.id = rp.point_id)
</select> </select>
<select id="queryAllPointList" resultType="java.lang.Long">
select original_id from p_point where is_delete = 0;
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment