Commit da364e6d authored by tianbo's avatar tianbo

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

parents d46829d0 628b9f41
......@@ -709,6 +709,7 @@ public class DateUtils {
/**
* 根据两个日期返回相差的时分秒
*
* @param newTime 靠后时间
* @param oldTime 靠前时间
* @return
......@@ -718,7 +719,7 @@ public class DateUtils {
Long oldTimes = oldTime.getTime();
// 不改时间会多加八个小时
timeSdf.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
return timeSdf.format(newTimes-oldTimes);
return timeSdf.format(newTimes - oldTimes);
}
/**
......@@ -748,11 +749,12 @@ public class DateUtils {
/**
* 通过月份计算季度
*
* @param month
* @return
*/
public static int getQuarter(int month) {
if(month < 1 || month > 12) {
if (month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid.");
}
return (month - 1) / 3 + 1;
......@@ -760,11 +762,12 @@ public class DateUtils {
/**
* 通过月份计算季度
*
* @param month
* @return
*/
public static String getQuarterStr(int month) {
if(month < 1 || month > 12) {
if (month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid.");
}
return (month - 1) / 3 + 1 + "";
......@@ -772,6 +775,7 @@ public class DateUtils {
/**
* 获取指定时间所在周的第一天日期
*
* @param date
* @return
*/
......@@ -785,8 +789,25 @@ public class DateUtils {
return getDate(calendar.getTime());
}
public static Date beginDateOfWeek(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
return calendar.getTime();
}
public static Date endDateOfWeek(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
return calendar.getTime();
}
/**
* 获取指定时间所在周的最后一天日期
*
* @param date
* @return
*/
......@@ -802,18 +823,19 @@ public class DateUtils {
/**
* 将秒数转换为时分秒格式
*
* @param times
* @return
*/
public static String secondsToTimeStr(int times) {
if(times <= 0){
if (times <= 0) {
return "00:00:00";
}
int h = times/3600;
int m = (times-h*3600)/60;
int s = times - h*3600-m*60;
int h = times / 3600;
int m = (times - h * 3600) / 60;
int s = times - h * 3600 - m * 60;
String time = "%02d:%02d:%02d";
time = String.format(time,h,m,s);
time = String.format(time, h, m, s);
return time;
}
}
......@@ -61,7 +61,7 @@ public class MetaHandler implements MetaObjectHandler {
this.setFieldValByName("recUserId", agencyUserModel.getUserId(), metaObject);
}
if (isExistField("recUserName", entity)) {
this.setFieldValByName("recUserName", agencyUserModel.getUserName(), metaObject);
this.setFieldValByName("recUserName", agencyUserModel.getRealName(), metaObject);
}
if (isExistField("recDate", entity)) {
Date currentDate = new Date();
......
......@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 消防建筑表
*
......@@ -43,6 +45,9 @@ public class FireBuildingDto extends BaseDto {
@ApiModelProperty(value = "父级mrid")
private String parentMrid;
@ApiModelProperty(value = "树形mrids,包括自己,冗余用于树形查询")
private String treeMrids;
@ApiModelProperty(value = "类型(建筑、楼层、房间)")
private String type;
......@@ -54,4 +59,7 @@ public class FireBuildingDto extends BaseDto {
@ApiModelProperty(value = "纬度")
private String lat;
@ApiModelProperty(value = "子节点")
private List<FireBuildingDto> children;
}
package com.yeejoin.amos.boot.module.ccs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package com.yeejoin.amos.boot.module.ccs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
......@@ -20,13 +20,13 @@ public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ID_WORKER)
protected Long id;
protected String id;
/**
* 同步日期
*/
@TableField(value = "syn_date", fill = FieldFill.INSERT_UPDATE)
protected Date recDate;
protected Date synDate;
/**
* 业务创建日期
......
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.ccs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -68,6 +67,12 @@ public class FireBuilding extends BaseEntity {
@TableField("parent_mrid")
private String parentMrid;
/**
* 树形mrids,包括自己,冗余用于树形查询
*/
private String treeMrids;
/**
* 类型(建筑、楼层、房间)
*/
......
package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireAlarmDayStatistics;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireAlarmDayStatistics;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 换流站告警日统计 Mapper 接口
......@@ -11,4 +14,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface FireAlarmDayStatisticsMapper extends BaseMapper<FireAlarmDayStatistics> {
/**
* 告警次数-折线图使用
*
* @param stationCode 换流程code
* @param beginDate 开始日期
* @param endDate 结束日期
* @return List<String>
*/
List<String> queryAlarmTimesTrend(@Param("stationCode") String stationCode, @Param("beginDate") String beginDate, @Param("endDate") String endDate);
}
package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireDangerDayStatistics;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireDangerDayStatistics;
import java.util.List;
/**
* 换流站隐患日统计 Mapper 接口
......@@ -11,4 +13,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface FireDangerDayStatisticsMapper extends BaseMapper<FireDangerDayStatistics> {
/**
* 隐患增长趋势
*
* @param stationCode 换流站code
* @param beginDate 开始日期
* @param endDate 结束日期
* @return List<String>
*/
List<String> queryDangerTimesTrend(String stationCode, String beginDate, String endDate);
}
package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireLatentDanger;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 隐患信息 Mapper 接口
......@@ -16,10 +17,18 @@ import java.util.List;
public interface FireLatentDangerMapper extends BaseMapper<FireLatentDanger> {
/**
* 隐患列表倒序列表
* @param top 限制w
*
* @param top 限制w
* @param stationCode 站code
* @return List<FireLatentDangerDto>
*/
List<FireLatentDangerDto> queryDangerList(@Param("top") Long top, @Param("stationCode") String stationCode);
/**
* 隐患分组列表
*
* @param stationCode 换流站编号
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> dangerStateGroupMap(String stationCode);
}
package com.yeejoin.amos.boot.module.ccs.api.service;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireBuildingDto;
import java.util.List;
/**
* 消防建筑表接口类
*
......@@ -8,5 +12,4 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
* @date 2021-11-09
*/
public interface IFireBuildingService {
}
package com.yeejoin.amos.boot.module.ccs.api.service;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
public interface IStatisticsService {
/**
* 告警隐患统计
* @param stationCode 站编号
* @return Map<String, Object>
*/
Map<String, Object> alarmAndDangerNumCount(String stationCode) throws ParseException;
/**
* 告警和隐患趋势
* @param stationCode 换流站编号
* @param beginDate 开始日期
* @param endDate 结束日期
* @return Map<String, Object>
*/
Map<String, Object> alarmAndDangerTrend(String stationCode, String beginDate, String endDate);
}
......@@ -2,4 +2,28 @@
<!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.ccs.api.mapper.FireAlarmDayStatisticsMapper">
<select id="queryAlarmTimesTrend" resultType="java.lang.String">
select
(SELECT
IFNULL(sum(s.alarm_times),0)
FROM `asf_fire_alarm_day_statistics` s
<where>
<if test="stationCode != null and stationCode != ''">
s.station_code = #{stationCode}
</if>
s.collect_date = t.date
</where>
) as times
from
(SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 0 ) temp
WHERE
@s <![CDATA[<=]]>
DATEDIFF(#{endDate},#{beginDate})) t
GROUP BY t.date
</select>
</mapper>
......@@ -2,4 +2,28 @@
<!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.ccs.api.mapper.FireDangerDayStatisticsMapper">
<select id="queryDangerTimesTrend" resultType="java.lang.String">
select
(SELECT
IFNULL(sum(s.danger_times),0)
FROM `asf_fire_danger_day_statistics` s
<where>
<if test="stationCode != null and stationCode != ''">
s.station_code = #{stationCode}
</if>
s.collect_date = t.date
</where>
) as times
from
(SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 0 ) temp
WHERE
@s <![CDATA[<=]]>
DATEDIFF(#{endDate},#{beginDate})) t
GROUP BY t.date
</select>
</mapper>
......@@ -14,8 +14,16 @@
s.name as station_name,
a.station_code,
a.location,
a.lat,
a.lng,
<choose>
<when test="stationCode != null and stationCode != ''">
a.lat,
a.lng,
</when>
<otherwise>
s.lng,
s.lat,
</otherwise>
</choose>
s.lat as stationLat,
s.lng as stationLng
from
......
......@@ -4,19 +4,27 @@
<select id="queryDangerList" resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto">
select
d.id,
d.danger_name,
d.danger_state,
d.danger_state_name,
d.danger_level,
d.danger_level_name,
s.name as station_name,
d.station_code,
d.discovery_date,
d.lat,
d.lng,
s.lat as stationLat,
s.lng as stationLng
d.id,
d.danger_name,
d.danger_state,
d.danger_state_name,
d.danger_level,
d.danger_level_name,
s.name as station_name,
d.station_code,
d.discovery_date,
<choose>
<when test="stationCode != null and stationCode != ''">
d.lat,
d.lng,
</when>
<otherwise>
s.lng,
s.lat,
</otherwise>
</choose>
s.lng as stationLng,
s.lat as stationLat
from
asf_fire_latent_danger d,
asf_fire_station_info s
......@@ -27,7 +35,19 @@
</if>
order by d.discovery_date desc
<if test="top != null">
limit ${top}
limit ${top}
</if>
</select>
<select id="dangerStateGroupMap" resultType="java.util.Map">
SELECT
d.danger_state as dangerState,
count(1) as num
FROM `asf_fire_latent_danger` d
<where>
<if test="stationCode != null and stationCode != ''">
d.station_code = #{stationCode}
</if>
</where>
GROUP BY d.danger_state
</select>
</mapper>
package com.yeejoin.amos.boot.module.common.api.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO;
import com.yeejoin.amos.boot.module.common.api.dto.VideoDto;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -14,9 +12,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import com.yeejoin.amos.boot.module.common.api.dto.PerfQuotaIotDTO;
import com.yeejoin.amos.boot.module.common.api.dto.VideoDto;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
/**
* 装备服务feign
......@@ -315,4 +315,9 @@ public interface EquipFeignClient {
*/
@RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST)
ResponseModel<List<EquipmentIndexDto>> getEquipmentIndexDto(@RequestBody PerfQuotaIotDTO perfQuotaIotDTO);
@RequestMapping(value = "/car/{id}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> selectOneById( @PathVariable Long id);
}
......@@ -134,5 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company);
List<Map<String, Object>> queryByCompanyId(Long companyId);
List<Map<String, Object>> queryByCompanyId();
List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
}
......@@ -105,4 +105,14 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("stratTime") String stratTime,
@Param("endTime") String endTime
);
List<Map<String, Object>> getDutyPersonByTeamIdAndCarId(
String carIdName,
String teamIdName,
String userIdName,
String dutyDate,
String groupCode,
String carId,
String teamId);
}
......@@ -37,5 +37,5 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle);
List<FirefightersDto> queryById(Long teamId,String[] gw);
List<FirefightersDto> queryById(@Param("gw")String[] gw);
}
......@@ -92,5 +92,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
List<Map<String,Object>> queryCompanyId(Long id);
List<Map<String,Object>> queryCompanyId(String bizOrgName);
}
......@@ -34,5 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService {
*/
List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId);
List<Map<String, Object>> queryByCompanyId(Long companyId);
List<Map<String, Object>> queryByCompanyId();
List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
}
......@@ -342,25 +342,44 @@ AND cft.type_code = (
</select>
<select id='queryByCompanyId' resultType="map">
SELECT
e.field_code,
e.field_name,
e.field_value
FROM
cb_dynamic_form_instance e,
(SELECT
i.*
FROM
cb_dynamic_form_instance i
,
(SELECT * FROM `cb_duty_person_shift` where to_days(duty_date) = to_days(now())) b
WHERE
i.instance_id = b.instance_id
AND
i.field_code = 'deptId'
AND
i.field_value = #{companyId}) c
WHERE
e. instance_id = c.instance_id
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
i.instance_id where i.field_code = 'telephone') as d
where d.sequence_nbr in (
select userId from (
select cb.duty_date,a.deptId,c.userId from cb_duty_person_shift cb
left join (select i.instance_id id1 ,if(i.field_code = 'deptId',
i.field_value, null) as 'deptId' from cb_dynamic_form_instance i
where i.field_code = 'deptId' and i.field_value is not null) a
on cb.instance_id = a.id1
left join (select i.instance_id id3 ,if(i.field_code = 'userId',
i.field_value, null) as 'userId' from cb_dynamic_form_instance i
where i.field_code = 'userId' and i.field_value is not null) c
on cb.instance_id = c.id3
where to_days(cb.duty_date) = to_days(now()) and
a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援保障部' or
biz_org_name = '综合办公室' or biz_org_name = '消防支队' or biz_org_name = '应急指挥科' )) r )
</select>
<select id='queryByCompanyNew' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
i.instance_id where i.field_code = 'telephone') as d
where d.sequence_nbr in (
select userId from (
select cb.duty_date,a.deptId,c.userId from cb_duty_person_shift cb
left join (select i.instance_id id1 ,if(i.field_code = 'deptId',
i.field_value, null) as 'deptId' from cb_dynamic_form_instance i
where i.field_code = 'deptId' and i.field_value is not null) a
on cb.instance_id = a.id1
left join (select i.instance_id id3 ,if(i.field_code = 'userId',
i.field_value, null) as 'userId' from cb_dynamic_form_instance i
where i.field_code = 'userId' and i.field_value is not null) c
on cb.instance_id = c.id3
where to_days(cb.duty_date) = to_days(now()) and
a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})) r )
</select>
</mapper>
......@@ -259,5 +259,43 @@
</if>
order by instanceId desc
</select>
<select id="getDutyPersonByTeamIdAndCarId" resultType="java.util.Map">
SELECT
userId
FROM
(
SELECT
MAX(
CASE
WHEN cbd.field_code = #{carIdName} THEN
cbd.field_value
END
) AS #{carIdName},
MAX(
CASE
WHEN cbd.field_code = #{teamIdName} THEN
cbd.field_value
END
) AS #{teamIdName},
MAX(
CASE
WHEN cbd.field_code = #{userIdName} THEN
cbd.field_value
END
) AS #{userIdName},
cbd.instance_id
FROM
cb_dynamic_form_instance cbd
LEFT JOIN cb_duty_person_shift cps ON cbd.instance_id = cps.instance_id
WHERE
cps.duty_date = #{dutyDate}
AND cps.is_delete = FALSE
AND cbd.group_code = #{groupCode}
GROUP BY
cbd.instance_id
) ss
WHERE
ss.carId = #{carId}
AND ss.teamId = #{teamId}
</select>
</mapper>
......@@ -174,11 +174,14 @@
<select id="queryById" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto">
SELECT
*
firefighters.sequence_nbr sequenceNbr ,
firefighters.name,
mobile_phone as mobilePhone
FROM
cb_firefighters
cb_firefighters firefighters
WHERE
fire_team_id = #{teamId}
fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in (
select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援部') )
<if test="gw != null">
And job_title_code In
<foreach item="item" collection="gw" index="index" open="(" separator="," close=")">
......
......@@ -687,35 +687,16 @@ LEFT JOIN (
</select>
<select id="queryCompanyId" resultType="map">
SELECT
d.field_code ,
d.field_name ,
d.field_value ,
s.sequence_nbr,
s.biz_org_name,
s.parent_id
FROM
cb_dynamic_form_instance d ,
( SELECT
u.*
FROM
cb_org_usr u,
cb_dynamic_form_instance i
where
u.parent_id = #{id}
AND
u.is_delete = 0
AND
u.biz_org_type = 'PERSON'
AND
i.instance_id = u.sequence_nbr
AND
i.field_code = 'administrativePositionCode'
AND
i.field_value is not NULL ) s
WHERE
d.instance_id = s.sequence_nbr
AND
d.field_code = 'telephone'
select * from (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.fireManagementPostCode, b.telephone from cb_org_usr cou
left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
i.field_value_label, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
left join (select i.instance_id id2,if(i.field_code = 'telephone',
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
and i.field_value is not null) b on cou .sequence_nbr = b.id2
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
and (d.fireManagementPostCode = '消防安全管理人' or d.fireManagementPostCode = '消防安全责任人')
</select>
</mapper>
......@@ -18,7 +18,7 @@ import java.util.List;
* @version $Id: AlertCalledRo.java, v 0.1 2021年6月24日 下午3:31:14 gwb Exp $
*/
@Data
@RuleFact(value = "警情信息",project = "西咸机场119调派规则")
@RuleFact(value = "调派信息",project = "西咸机场119调派规则")
public class AlertCallePowerTransferRo implements Serializable{
......@@ -29,7 +29,7 @@ public class AlertCallePowerTransferRo implements Serializable{
*
* </pre>
*/
private static final long serialVersionUID = 7091835997817930383L;
private static final long serialVersionUID = 4735920511849348360L;
/**
* 通用属性
......@@ -85,17 +85,10 @@ public class AlertCallePowerTransferRo implements Serializable{
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "调派单位资源列表")
private List<CompanyRo> company;
@ApiModelProperty(value = "调派单位资源列表")
private List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList;
private List< PowerTransferCompanyDto> company;
@ApiModelProperty(value = "调派类型队伍")
private String powerTransType;
}
......@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{
*
* </pre>
*/
private static final long serialVersionUID = 7091835997817930383L;
private static final long serialVersionUID = 529623529216238088L;
/**
* 通用属性
......@@ -46,6 +46,12 @@ public class AlertCalledRo implements Serializable{
@Label(value = "发送单位")
private String companyName;
@Label(value = "联系人")
private String contactUser;
@Label(value = "联系电话")
private String contactPhone;
@Label(value = "被困人数")
private String trappedNum;
......@@ -57,6 +63,24 @@ public class AlertCalledRo implements Serializable{
@Label(value = "警情报送id")
private String alertSubmittedId;
@Label(value = "事发单位")
private String unitInvolved;
@Label(value = "模板替换内容")
private String replaceContent;
@Label(value = "警情报送类型(0,警情报送,1,警情续报,2,非警情确认,3,警情结案)")
private String alertWay;
@Label(value = "警情续报,非警情确认,警情结案,选择人员ids")
private String ids;
@Label(value = "警情续报自定义内容")
private String feedback;
/**
* 一般火灾
*/
......@@ -74,5 +98,77 @@ public class AlertCalledRo implements Serializable{
/**
* 航空器救援
*/
@Label(value = "航班号")
private String flightNumber;
@Label(value = "飞机型号")
private String aircraftModel;
@Label(value = "落地时间")
private String landingTime;
@Label(value = "灾害事故情况")
private String accidentSituationHkq;
@Label(value = "燃油量")
private String fuelQuantity;
@Label(value = "发展态势")
private String developmentTrend;
@Label(value = "载客量")
private String passengerCapacity;
@Label(value = "航空器故障部位")
private String damageLocation;
@Label(value = "迫降跑道")
private String forcedLandingTrack;
/**
* 突发事件救援
*/
@Label(value = "灾害事故情况")
private String accidentSituation;
/**
* 漏油现场安全保障
*/
@Label(value = "航班号")
private String flightNumberLy;
@Label(value = "机位")
private String seat;
@Label(value = "漏油面积")
private String oilLeakageArea;
/**
* 专机保障
*/
@Label(value = "保障等级")
private String securityLevel;
@Label(value = "机位")
private String seatBz;
/**
* 120急救
*/
@Label(value = "患者现状")
private String patientStatus;
@Label(value = "性别")
private String gender;
@Label(value = "年龄段")
private String ageGroup;
//
// /**
// * 其他
// */
// @Label(value = "灾害事故情况")
// private String accidentSituation;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -15,4 +17,7 @@ public class CompanyRo {
@ApiModelProperty(value = "调派单位名称")
private String powerCompanyName;
@ApiModelProperty(value = "调派单位资源列表")
private List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList;
}
......@@ -24,6 +24,7 @@ public enum AlertStageEnums {
LYXC("237", "漏油现场安全保障"),
ZJBZ("238", "转机保障"),
QTJQ("242", "其他"),
JJJQ("1214", "120急救"),
RG("226", "人工上报"),
DJ("228", "对讲呼入"),
......
......@@ -43,6 +43,9 @@ public interface IAlertCalledService {
Object selectAlertCalledByIdNoRedis(Long id);
Object selectAlertCalledByIdNoRedisNew(Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( Long id);
......
package com.yeejoin.amos.supervision.common.enums;
public enum ExecuteStateNameEnum {
通过("通过", 0),
不通过("不通过", 1);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
ExecuteStateNameEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static String getNameByCode(Integer code) {
for (ExecuteStateNameEnum e : ExecuteStateNameEnum.values()) {
if (code.equals(e.getCode())) {
return e.getName();
}
}
return null;
}
}
......@@ -8,8 +8,13 @@ package com.yeejoin.amos.supervision.common.enums;
public enum RuleTypeEnum {
GETCONTENT("维保项获取","getContent"),
CHECKRESULT("结果校验","checkResult" );
CHECKRESULT("结果校验","checkResult" ),
// 防火监督
计划提交("计划提交", "addPlan"),
计划审核("计划审核", "planAudit"),
计划生成("计划生成", "addPlanTask"),
计划完成("计划完成", "planCompleted");
/**
* 名称,描述
......
......@@ -31,77 +31,6 @@ public class FireAlarmDayStatisticsController extends BaseController {
FireAlarmDayStatisticsServiceImpl fireAlarmDayStatisticsServiceImpl;
/**
* 新增换流站告警日统计
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增换流站告警日统计", notes = "新增换流站告警日统计")
public ResponseModel<FireAlarmDayStatisticsDto> save(@RequestBody FireAlarmDayStatisticsDto model) {
model = fireAlarmDayStatisticsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新换流站告警日统计", notes = "根据sequenceNbr更新换流站告警日统计")
public ResponseModel<FireAlarmDayStatisticsDto> updateBySequenceNbrFireAlarmDayStatistics(@RequestBody FireAlarmDayStatisticsDto model, @PathVariable(value = "sequenceNbr") String sequenceNbr) {
model.setId(sequenceNbr);
return ResponseHelper.buildResponse(fireAlarmDayStatisticsServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除换流站告警日统计", notes = "根据sequenceNbr删除换流站告警日统计")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(fireAlarmDayStatisticsServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个换流站告警日统计", notes = "根据sequenceNbr查询单个换流站告警日统计")
public ResponseModel<FireAlarmDayStatisticsDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(fireAlarmDayStatisticsServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "换流站告警日统计分页查询", notes = "换流站告警日统计分页查询")
public ResponseModel<Page<FireAlarmDayStatisticsDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<FireAlarmDayStatisticsDto> page = new Page<FireAlarmDayStatisticsDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireAlarmDayStatisticsServiceImpl.queryForFireAlarmDayStatisticsPage(page));
}
/**
* 列表全部数据查询
*
* @return
......
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireBuildingDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireBuildingServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -36,16 +37,24 @@ public class FireBuildingController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page")
@GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防建筑表分页查询", notes = "消防建筑表分页查询")
public ResponseModel<Page<FireBuildingDto>> queryForPage(
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@PathVariable String stationCode) {
@ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireBuildingDto> page = new Page<FireBuildingDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireBuildingServiceImpl.queryForFireBuildingPage(page, name, stationCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{stationCode}/tree")
@ApiOperation(httpMethod = "GET", value = "指定换流站的消防建筑树", notes = "指定换流站的消防建筑树")
public ResponseModel buildingTree(
@ApiParam(value = "换流站code") @PathVariable String stationCode) {
return ResponseHelper.buildResponse(fireBuildingServiceImpl.buildingTree(stationCode));
}
}
package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireDangerDayStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireDangerDayStatisticsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
......@@ -31,63 +31,6 @@ public class FireDangerDayStatisticsController extends BaseController {
FireDangerDayStatisticsServiceImpl fireDangerDayStatisticsServiceImpl;
/**
* 新增换流站隐患日统计
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增换流站隐患日统计", notes = "新增换流站隐患日统计")
public ResponseModel<FireDangerDayStatisticsDto> save(@RequestBody FireDangerDayStatisticsDto model) {
model = fireDangerDayStatisticsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除换流站隐患日统计", notes = "根据sequenceNbr删除换流站隐患日统计")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(fireDangerDayStatisticsServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个换流站隐患日统计", notes = "根据sequenceNbr查询单个换流站隐患日统计")
public ResponseModel<FireDangerDayStatisticsDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(fireDangerDayStatisticsServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "换流站隐患日统计分页查询", notes = "换流站隐患日统计分页查询")
public ResponseModel<Page<FireDangerDayStatisticsDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<FireDangerDayStatisticsDto> page = new Page<FireDangerDayStatisticsDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireDangerDayStatisticsServiceImpl.queryForFireDangerDayStatisticsPage(page));
}
/**
* 列表全部数据查询
*
* @return
......
......@@ -45,4 +45,17 @@ public class FireLatentDangerController extends BaseController {
@ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) {
return ResponseHelper.buildResponse(fireLatentDangerServiceImpl.queryForFireLatentDangerList(top, stationCode));
}
/**
* 隐患分组列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "隐患分组", notes = "隐患分组")
@GetMapping(value = "/state/group")
public ResponseModel dangerStateGroupMap(
@ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) {
return ResponseHelper.buildResponse(fireLatentDangerServiceImpl.dangerStateGroupMap(stationCode));
}
}
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireVehicleDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireVehicleServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -35,13 +36,13 @@ public class FireVehicleController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page")
@GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防车辆信息分页查询", notes = "消防车辆信息分页查询")
public ResponseModel<Page<FireVehicleDto>> queryForPage(
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@PathVariable String stationCode) {
@ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireVehicleDto> page = new Page<FireVehicleDto>();
page.setCurrent(current);
page.setSize(size);
......
......@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireVideoDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireVideoServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -13,6 +15,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* 消防视频表
*
......@@ -36,17 +43,22 @@ public class FireVideoController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page")
@GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防视频表分页查询", notes = "消防视频表分页查询")
public ResponseModel<Page<FireVideoDto>> queryForPage(
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@PathVariable String stationCode) {
@ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode,
@ApiParam(value = "所在建筑,多个用逗号分隔") @RequestParam(value = "buildingMrids", required = false) String buildingMrids) {
List<String> buildingMridList = new ArrayList<>();
if(StringUtils.isNotBlank(buildingMrids)){
buildingMridList = Arrays.stream(buildingMrids.split(",")).collect(Collectors.toList());
}
Page<FireVideoDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireVideoServiceImpl.queryForFireVideoPage(page, name, stationCode));
return ResponseHelper.buildResponse(fireVideoServiceImpl.queryForFireVideoPage(page, name, stationCode,buildingMridList));
}
}
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireWaterDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireWaterServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -13,8 +14,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
/**
* 消防水源表
*
......@@ -37,28 +36,16 @@ public class FireWaterController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page")
@GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防水源表分页查询", notes = "消防水源表分页查询")
public ResponseModel<Page<FireWaterDto>> queryForPage(
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size,
@PathVariable String stationCode) {
@ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireWaterDto> page = new Page<FireWaterDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireWaterServiceImpl.queryForFireWaterPage(page, name, stationCode));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "消防水源表列表全部数据查询", notes = "消防水源表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FireWaterDto>> selectForList() {
return ResponseHelper.buildResponse(fireWaterServiceImpl.queryForFireWaterList());
}
}
package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.yeejoin.amos.boot.module.ccs.api.service.IStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
/**
* @author DELL
*/
@RestController
@Api(tags = "融合统计")
@RequestMapping(value = "/statistics")
public class StatisticsController {
@Autowired
IStatisticsService iStatisticsService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "告警隐患", notes = "告警隐患")
@GetMapping(value = "/alarmAndDangerNumCount")
public ResponseModel alarmAndDangerNumCount(
@ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) throws ParseException {
return ResponseHelper.buildResponse(iStatisticsService.alarmAndDangerNumCount(stationCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询指定区间的告警隐患趋势", notes = "查询指定区间的告警隐患趋势")
@GetMapping(value = "/alarmAndDangerTrend")
public ResponseModel alarmAndDangerTrend(
@ApiParam(value = "开始日期", required = true) @RequestParam(value = "beginDate") String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam(value = "endDate") String endDate,
@ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) {
return ResponseHelper.buildResponse(iStatisticsService.alarmAndDangerTrend(stationCode, beginDate, endDate));
}
}
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireAlarmDayStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireAlarmDayStatistics;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireAlarmDayStatisticsMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireAlarmDayStatisticsService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireAlarmDayStatisticsDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
......@@ -16,18 +18,25 @@ import java.util.List;
* @date 2021-11-09
*/
@Service
public class FireAlarmDayStatisticsServiceImpl extends BaseService<FireAlarmDayStatisticsDto,FireAlarmDayStatistics,FireAlarmDayStatisticsMapper> implements IFireAlarmDayStatisticsService {
/**
* 分页查询
*/
public Page<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsPage(Page<FireAlarmDayStatisticsDto> page) {
return this.queryForPage(page, null, false);
}
public class FireAlarmDayStatisticsServiceImpl extends BaseService<FireAlarmDayStatisticsDto, FireAlarmDayStatistics, FireAlarmDayStatisticsMapper> implements IFireAlarmDayStatisticsService {
/**
* 列表查询 示例
*/
public List<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsList() {
return this.queryForList("" , false);
public List<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsList() {
return this.queryForList("", false);
}
public int alarmTimesCount(String stationCode, String beginDate, String endDate) {
LambdaQueryWrapper<FireAlarmDayStatistics> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(stationCode), FireAlarmDayStatistics::getStationCode, stationCode);
wrapper.ge(FireAlarmDayStatistics::getCollectDate, beginDate);
wrapper.le(FireAlarmDayStatistics::getCollectDate, endDate);
List<FireAlarmDayStatistics> list = this.list(wrapper);
return list.stream().mapToInt(FireAlarmDayStatistics::getAlarmTimes).sum();
}
public List<String> alarmTimesTrend(String stationCode, String beginDate, String endDate) {
return this.baseMapper.queryAlarmTimesTrend(stationCode, beginDate, endDate);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ccs.api.dto.BaseDto;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireBuildingDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireBuilding;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireBuildingMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireBuildingService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* 消防建筑表服务实现类
......@@ -23,15 +27,17 @@ public class FireBuildingServiceImpl extends BaseService<FireBuildingDto, FireBu
/**
* 分页查询
*/
public Page<FireBuildingDto> queryForFireBuildingPage(Page<FireBuildingDto> page, @Condition(Operator.like) String name,@Condition String stationCode) {
return this.queryForPage(page, "createDate", false, name, stationCode);
public Page<FireBuildingDto> queryForFireBuildingPage(Page<FireBuildingDto> page, @Condition(Operator.like) String name, @Condition String stationCode) {
return this.queryForPage(page, "create_date", false, name, stationCode);
}
/**
* 列表查询 示例
*/
public List<FireBuildingDto> queryForFireBuildingList() {
return this.queryForList("", false);
public List<FireBuildingDto> buildingTree(String stationCode) {
List<FireBuildingDto> dtoList = this.queryForList("create_date", true, stationCode);
return dtoList.stream().filter(d -> StringUtils.isBlank(d.getParentMrid()) || "0".equals(d.getParentMrid()) || "-1".equals(d.getParentMrid())).peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList());
}
private List<FireBuildingDto> getChildren(String mrid, List<FireBuildingDto> dtoList) {
return dtoList.stream().filter(d -> StringUtils.isNotBlank(d.getParentMrid()) && d.getParentMrid().equals(mrid)).peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList());
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireDangerDayStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireDangerDayStatistics;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireDangerDayStatisticsMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireDangerDayStatisticsService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireDangerDayStatisticsDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
......@@ -16,18 +18,25 @@ import java.util.List;
* @date 2021-11-09
*/
@Service
public class FireDangerDayStatisticsServiceImpl extends BaseService<FireDangerDayStatisticsDto,FireDangerDayStatistics,FireDangerDayStatisticsMapper> implements IFireDangerDayStatisticsService {
/**
* 分页查询
*/
public Page<FireDangerDayStatisticsDto> queryForFireDangerDayStatisticsPage(Page<FireDangerDayStatisticsDto> page) {
return this.queryForPage(page, null, false);
}
public class FireDangerDayStatisticsServiceImpl extends BaseService<FireDangerDayStatisticsDto, FireDangerDayStatistics, FireDangerDayStatisticsMapper> implements IFireDangerDayStatisticsService {
/**
* 列表查询 示例
*/
public List<FireDangerDayStatisticsDto> queryForFireDangerDayStatisticsList() {
return this.queryForList("" , false);
public List<FireDangerDayStatisticsDto> queryForFireDangerDayStatisticsList() {
return this.queryForList("", false);
}
public int createDangerTimesCount(String stationCode, String beginDate, String endDate) {
LambdaQueryWrapper<FireDangerDayStatistics> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(stationCode),FireDangerDayStatistics::getStationCode, stationCode);
wrapper.ge(FireDangerDayStatistics::getCollectDate, beginDate);
wrapper.le(FireDangerDayStatistics::getCollectDate, endDate);
List<FireDangerDayStatistics> list = this.list(wrapper);
return list.stream().mapToInt(FireDangerDayStatistics::getDangerTimes).sum();
}
public List<String> dangerTimesTrend(String stationCode, String beginDate, String endDate) {
return this.baseMapper.queryDangerTimesTrend(stationCode,beginDate,endDate);
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.BaseDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.BaseEntity;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireLatentDanger;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireLatentDangerMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireLatentDangerService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -22,20 +20,30 @@ import java.util.stream.Collectors;
* @date 2021-11-09
*/
@Service
public class FireLatentDangerServiceImpl extends BaseService<FireLatentDangerDto,FireLatentDanger,FireLatentDangerMapper> implements IFireLatentDangerService {
public class FireLatentDangerServiceImpl extends BaseService<FireLatentDangerDto, FireLatentDanger, FireLatentDangerMapper> implements IFireLatentDangerService {
/**
* 分页查询
*/
public Page<FireLatentDangerDto> queryForFireLatentDangerPage(Page<FireLatentDangerDto> page) {
public Page<FireLatentDangerDto> queryForFireLatentDangerPage(Page<FireLatentDangerDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
* @param top 取值
*
* @param top 取值
* @param stationCode 站code
*/
public List<FireLatentDangerDto> queryForFireLatentDangerList(Long top, String stationCode ) {
return this.getBaseMapper().queryDangerList(top,stationCode);
public List<FireLatentDangerDto> queryForFireLatentDangerList(Long top, String stationCode) {
return this.baseMapper.queryDangerList(top, stationCode);
}
public Map<String, Object> dangerStateGroupMap(String stationCode) {
List<Map<String, Object>> list = this.baseMapper.dangerStateGroupMap(stationCode);
Map<String, Object> result = new LinkedHashMap<>();
list.forEach(m -> {
result.put(m.get("dangerState").toString(), m.get("num"));
});
return result;
}
}
\ No newline at end of file
......@@ -10,8 +10,6 @@ import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 消防车辆信息服务实现类
*
......@@ -24,13 +22,6 @@ public class FireVehicleServiceImpl extends BaseService<FireVehicleDto, FireVehi
* 分页查询
*/
public Page<FireVehicleDto> queryForFireVehiclePage(Page<FireVehicleDto> page, @Condition(Operator.like) String name, String stationCode) {
return this.queryForPage(page, "createDate", false, name, stationCode);
}
/**
* 列表查询 示例
*/
public List<FireVehicleDto> queryForFireVehicleList() {
return this.queryForList("", false);
return this.queryForPage(page, "create_date", false, name, stationCode);
}
}
\ No newline at end of file
......@@ -23,14 +23,8 @@ public class FireVideoServiceImpl extends BaseService<FireVideoDto, FireVideo, F
/**
* 分页查询
*/
public Page<FireVideoDto> queryForFireVideoPage(Page<FireVideoDto> page, @Condition(Operator.like) String name, String stationCode) {
return this.queryForPage(page, "createDate", false, name, stationCode);
public Page<FireVideoDto> queryForFireVideoPage(Page<FireVideoDto> page, @Condition(Operator.like) String name, String stationCode, @Condition(Operator.in) List<String> buildingMrid) {
return this.queryForPage(page, "create_date", false, name, stationCode, buildingMrid);
}
/**
* 列表查询 示例
*/
public List<FireVideoDto> queryForFireVideoList() {
return this.queryForList("", false);
}
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ public class FireWaterServiceImpl extends BaseService<FireWaterDto, FireWater, F
* 分页查询
*/
public Page<FireWaterDto> queryForFireWaterPage(Page<FireWaterDto> page, @Condition(Operator.like) String name, String stationCode) {
return this.queryForPage(page, "createDate", false, name, stationCode);
return this.queryForPage(page, "create_date", false, name, stationCode);
}
/**
......
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.ccs.api.service.IStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
@Service
public class StatisticsServiceImpl implements IStatisticsService {
@Autowired
FireAlarmDayStatisticsServiceImpl fireAlarmDayStatisticsService;
@Autowired
FireDangerDayStatisticsServiceImpl fireDangerDayStatisticsService;
@Override
public Map<String, Object> alarmAndDangerNumCount(String stationCode) throws ParseException {
//本周开始日期
Date weekBegin = DateUtils.beginDateOfWeek(new Date());
//今日告警
Integer todayAddAlarm = fireAlarmDayStatisticsService.alarmTimesCount(stationCode, DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN), DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN));
//本周告警数量
Integer weekAddAlarm = fireAlarmDayStatisticsService.alarmTimesCount(stationCode, DateUtils.dateFormat(weekBegin, DateUtils.DATE_PATTERN), DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN));
//今日新增隐患
Integer todayAddDanger = fireDangerDayStatisticsService.createDangerTimesCount(stationCode, DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN), DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN));
//本周新增隐患
Integer weekAddDanger = fireDangerDayStatisticsService.createDangerTimesCount(stationCode, DateUtils.dateFormat(weekBegin, DateUtils.DATE_PATTERN), DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN));
Map<String, Object> result = new HashMap<>();
result.put("todayAddAlarm", todayAddAlarm);
result.put("weekAddAlarm", weekAddAlarm);
result.put("todayAddDanger", todayAddDanger);
result.put("weekAddDanger", weekAddDanger);
return result;
}
@Override
public Map<String, Object> alarmAndDangerTrend(String stationCode, String beginDate, String endDate) {
//告警增长趋势
List<String> alarmTrend = fireAlarmDayStatisticsService.alarmTimesTrend(stationCode, beginDate, endDate);
//隐患增加趋势
List<String> dangerTrend = fireDangerDayStatisticsService.dangerTimesTrend(stationCode, beginDate, endDate);
Map<String, Object> result = new HashMap<>();
result.put("alarmTrend", alarmTrend);
result.put("dangerTrend", dangerTrend);
return result;
}
}
......@@ -1366,7 +1366,7 @@ public class CommandController extends BaseController {
public ResponseModel<Object> adduserCar(@PathVariable String type, @RequestBody UserCar userCar ) {
AgencyUserModel agencyUserModel= getUserInfo();
userCar.setAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
userCar.setAmosUserName(agencyUserModel.getUserName());
userCar.setAmosUserName(agencyUserModel.getRealName());
if("1".equals(type)){
userCarService.add(userCar);
}else{
......
......@@ -191,18 +191,18 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId));
}
/**
*
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/companyId/{companyId}")
@ApiOperation(httpMethod = "GET", value = "查询当日值班人员", notes = "查询当日值班人员")
public ResponseModel<List<Map<String, Object>>> queryByCompanyId(
@PathVariable Long companyId) throws Exception {
return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId));
}
// /**
// *
// *
// * @return ResponseModel
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// @GetMapping(value = "/companyId/{companyId}")
// @ApiOperation(httpMethod = "GET", value = "查询当日值班人员", notes = "查询当日值班人员")
// public ResponseModel<List<Map<String, Object>>> queryByCompanyId(
// @PathVariable Long companyId) throws Exception {
// return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId));
// }
}
......@@ -268,17 +268,17 @@ public class OrgPersonController {
}
}
/**
* 机场单位下 各单位下人员岗位不为空的人员
*
* @param id
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyId/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员岗位不为空的人员详情", notes = "获取人员岗位不为空的人员详情")
public ResponseModel<Object> queryCompanyId(HttpServletRequest request,
@PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.queryCompanyId(id));
}
// /**
// * 机场单位下 各单位下人员岗位不为空的人员
// *
// * @param id
// * @return
// */
// @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
// @RequestMapping(value = "/companyId/{id}", method = RequestMethod.GET)
// @ApiOperation(httpMethod = "GET", value = "获取人员岗位不为空的人员详情", notes = "获取人员岗位不为空的人员详情")
// public ResponseModel<Object> queryCompanyId(HttpServletRequest request,
// @PathVariable Long id) throws Exception {
// return ResponseHelper.buildResponse(iOrgUsrService.queryCompanyId(id));
// }
}
......@@ -224,7 +224,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
this.getGroupCode(), "carId", "carName", "teamName","result.carId");
int count =0;
for (Map<String, Object> map : equipmentList) {
if(map.containsKey("carId") && map.get("carId").equals(carId)) {
if(map.containsKey("carId") && map.get("carId").equals(Long.toString(carId))) {
count++;
}
}
......
......@@ -303,17 +303,14 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
}
@Override
public List<Map<String, Object>> queryByCompanyId(){
return dutyPersonShiftMapper.queryByCompanyId();
}
public List<Map<String, Object>> queryByCompanyId(Long companyId){
return dutyPersonShiftMapper.queryByCompanyId(companyId);
@Override
public List<Map<String, Object>> queryByCompanyNew(String bizOrgName){
return dutyPersonShiftMapper.queryByCompanyNew(bizOrgName);
}
......
......@@ -143,7 +143,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
if (!result) {
return false;
}
failureMaintainDto.setMaintainMan(userInfo.getUserModel().getUserName());
failureMaintainDto.setMaintainMan(userInfo.getUserModel().getRealName());
failureMaintainDto.setMaintainTime(new Date());
String parentId = iOrgUsrService.getParentId(userInfo.getUserModel().getUserId());
OrgUsr orgUsr = iOrgUsrService.getById(parentId);
......
......@@ -97,7 +97,7 @@ public class FirefightersContractServiceImpl extends BaseService<FirefightersCon
detail.setIsDelete(false);
detail.setRecDate(new Date());
detail.setRecUserId(userInfo.getUserId());
detail.setRecUserName(userInfo.getUserName());
detail.setRecUserName(userInfo.getRealName());
this.baseMapper.updateById(detail);
Map<String, List<AttachmentDto>> map = firefightersContract.getAttachments();
if (ObjectUtils.isNotEmpty(map)) {
......
......@@ -133,9 +133,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
return firefightersMapper.getFirefightersName();
}
public List<FirefightersDto> queryById(Long teamId,String[] gw){
public List<FirefightersDto> queryById(String[] gw){
return firefightersMapper.queryById(teamId,gw);
return firefightersMapper.queryById(gw);
}
/**
* 获取指定岗位名称下的队伍人员电话号码信息
......
......@@ -171,7 +171,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
entity.setIsDelete(false);
entity.setRecDate(new Date());
entity.setRecUserId(userInfo.getUserId());
entity.setRecUserName(userInfo.getUserName());
entity.setRecUserName(userInfo.getRealName());
int num = keySiteMapper.updateById(entity);
Map<String, List<AttachmentDto>> map = keySite.getAttachments();
if (ObjectUtils.isNotEmpty(map)) {
......
......@@ -1860,9 +1860,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultMap;
}
public List<Map<String,Object>> queryCompanyId(Long id) {
public List<Map<String,Object>> queryCompanyId(String bizOrgName) {
return orgUsrMapper.queryCompanyId(id);
return orgUsrMapper.queryCompanyId(bizOrgName);
}
}
......@@ -333,21 +333,7 @@ public class FirefightersController extends BaseController {
return ResponseHelper.buildResponse(menus);
}
/**
*查询
*
* @param
* @return
* @throws Exception
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gw/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<Object> queryById( @PathVariable Long teamId) throws Exception {
//规则提供岗位名称
String[] gw =new String[]{"1202","1203","1204","1205","1206","1207","1209","1208","1210","1211"};
return ResponseHelper.buildResponse(iFirefightersService.queryById(teamId,gw));
}
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays;
import java.util.List;
/**
* 力量调派
......@@ -177,7 +176,7 @@ public class PowerTransferController extends BaseController {
public ResponseModel<Boolean> createPowerTransfer(@RequestBody PowerTransferDto powerTransferDto) {
AgencyUserModel userInfo = getUserInfo();
powerTransferDto.setTaskSenderId(Long.parseLong(userInfo.getUserId()));
powerTransferDto.setTaskSenderName(userInfo.getUserName());
powerTransferDto.setTaskSenderName(userInfo.getRealName());
String companyName = getSelectedOrgInfo().getCompany().getCompanyName();
powerTransferDto.setCompanyName(companyName);
......@@ -202,6 +201,5 @@ public class PowerTransferController extends BaseController {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferList(beginDate, endDate));
}
}
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.Logger;
......@@ -64,14 +66,13 @@ public class AlertCalledAction {
*
* @param smsCode 短信模板code
* @param sendType 发送类型
* @param sendIds 人员id
* @param object 模板内容对象
* @throws Exception 异常
*/
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则")
public void sendcmd(String smsCode, String sendType, String sendIds, Object object) throws Exception {
public void sendcmd(String smsCode, String sendType, List<Map<String,Object>> submittedList, Object object) throws Exception {
alertSubmittedService.ruleCallbackAction(smsCode, sendIds, object);
alertSubmittedService.ruleCallbackAction(smsCode, submittedList, object);
}
......
package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl;
import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.HashMap;
import java.util.Set;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl;
import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod;
/**
* <pre>
......@@ -27,7 +24,11 @@ import java.util.Set;
@RuleActionBean(beanLabel = "调派报送")
public class PowerTransferAction {
public static final Logger log = LoggerFactory.getLogger(PowerTransferAction.class);
/**
*
*/
public static final Logger log = LoggerFactory.getLogger(PowerTransferAction.class);
@Autowired
private AlertSubmittedServiceImpl alertSubmittedService;
......@@ -44,9 +45,10 @@ public class PowerTransferAction {
* @throws Exception 异常
*/
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则")
public void sendcmd(String smsCode, String sendType, String sendIds, Object object) throws Exception {
public void sendcmd(String smsCode, String sendType, List sendIds, Object object) throws Exception {
alertSubmittedService.ruleCallbackAction(smsCode, sendIds, object);
// alertSubmittedService.ruleCallbackAction(smsCode, sendIds, object);
System.out.println("8796w39879873298798");
}
......
......@@ -3,13 +3,13 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -67,8 +67,6 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.TemplateMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import ch.qos.logback.core.joran.conditional.IfAction;
/**
* 警情接警记录 服务实现类
*
......@@ -272,6 +270,25 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/**
* 根据灾情id 查询灾情详情
**/
@Override
public Object selectAlertCalledByIdNoRedisNew(Long id) {
// 警情基本信息
AlertCalled alertCalled = this.getById(id);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
List<FormValue> formValue = new ArrayList<FormValue>();
//
AlertCalledObjsDto alertCalledFormVo = new AlertCalledObjsDto();
alertCalledFormVo.setAlertCalled(alertCalled);
alertCalledFormVo.setAlertFormValue(list);
return alertCalledFormVo;
}
/**
* <pre>
* 保存警情信息
* </pre>
......@@ -351,8 +368,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
// 警情报送
// 调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto);
// 调用规则 警情初报
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(), null);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
/**
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
......@@ -21,7 +45,12 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompany;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertFeedbackStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
......@@ -29,24 +58,6 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.*;
import java.util.stream.Collectors;
/**
* 力量调派 服务实现类
......@@ -93,6 +104,15 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Autowired
private DutyCarServiceImpl dutyCarService;
@Autowired
FireTeamServiceImpl iFireTeamService;
@Autowired
DynamicFormInstanceMapper dynamicFormInstanceMapper;
@Autowired
RuleAlertCalledService ruleAlertCalledService;
@Override
public PowerTransferSimpleDto getPowerTransferList(Long alertCalledId) {
List<PowerTransferCompanyResourcesDto> powerTransferList =
......@@ -134,8 +154,16 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
initDefinitions(definitions, alertCalled, powerTransferDto);
// 创建力量调派单位
createPowerTransferCompany(powerTransferDto, powerTransferSequenceNbr, definitions, content);
createPowerTransferCompany(powerTransferDto, powerTransferSequenceNbr, definitions, content);
//封装调派任务的集合,以便于实现任务规则校验
try {
//packagePowerTransferDetail(powerTransferDto);
} catch (Exception e) {
log.error("调用规则失败:PowerTransferServiceImpl。createPowerTransfer()");
}
//发送调派通知
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
......@@ -145,8 +173,29 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
return true;
}
private void packagePowerTransferDetail(PowerTransferDto powerTransferDto) throws Exception {
List<PowerTransferCompanyDto> powerTransferCompanyDtoList = powerTransferDto.getPowerTransferCompanyDotList();
Set<PowerTransferCompanyDto> fullTimeList = new HashSet<PowerTransferCompanyDto>();
Set<PowerTransferCompanyDto> medicalTeamList = new HashSet<PowerTransferCompanyDto>();
Set<PowerTransferCompanyDto> monitorTeamList = new HashSet<PowerTransferCompanyDto>();
for (PowerTransferCompanyDto powerTransferCompanyDto : powerTransferCompanyDtoList) {
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(powerTransferCompanyDto.getPowerTransType())) {
fullTimeList.add(powerTransferCompanyDto);
} else if (FireBrigadeTypeEnum.医疗救援队.getKey().equals(powerTransferCompanyDto.getPowerTransType())) {
medicalTeamList.add(powerTransferCompanyDto);
} else if (FireBrigadeTypeEnum.监控大队.getKey().equals(powerTransferCompanyDto.getPowerTransType())) {
monitorTeamList.add(powerTransferCompanyDto);
}
}
//ruleAlertCalledService.powerTransferCalledRule(fullTimeList,powerTransferDto.getAlertCalledId(),FireBrigadeTypeEnum.专职消防队.getKey());
//ruleAlertCalledService.powerTransferCalledRule(medicalTeamList,powerTransferDto.getAlertCalledId(),FireBrigadeTypeEnum.医疗救援队.getKey());
ruleAlertCalledService.powerTransferCalledRule(monitorTeamList,powerTransferDto.getAlertCalledId(),FireBrigadeTypeEnum.监控大队.getKey());
}
@Override
@Override
public List<FireBrigadeResourceDto> getPowerTree(String type) {
List<FireBrigadeResourceDto> fireBrigadeResourceList = Lists.newArrayList();
......
package com.yeejoin.amos.maintenance.business.feign;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* @author DELL
*/ //装备
......@@ -53,5 +59,6 @@ public interface EquipFeignClient {
*/
@GetMapping(value = PREFIX+"/maintenanceResourceData/getFireFacilityList")
ResponseModel<List<Map<String, Object>>> overTimeMaintenanceFacility(@RequestParam String type, @RequestParam String id);
}
......@@ -188,7 +188,7 @@ public class MessageServiceImpl implements IMessageService {
emailUser.forEach(s -> {
for(AgencyUserModel agencyUserModel:agencyUserModelList){
if(s.getUserId().equals(agencyUserModel.getUserId())){
s.setUsername(agencyUserModel.getUserName());
s.setUsername(agencyUserModel.getRealName());
s.setEmail(agencyUserModel.getEmail());
}
}
......
......@@ -559,7 +559,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
JSONObject respBody;
Date startDate = new Date();
if (latentDangerListParam.getIsHandle()) {
respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType());
respBody = remoteWorkFlowService.completedPageTask(user.getRealName(),latentDangerListParam.getBelongType());
} else {
respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType());
}
......
......@@ -199,7 +199,7 @@ public class MessageServiceImpl implements IMessageService {
emailUser.forEach(s -> {
for(AgencyUserModel agencyUserModel:agencyUserModelList){
if(s.getUserId().equals(agencyUserModel.getUserId())){
s.setUsername(agencyUserModel.getUserName());
s.setUsername(agencyUserModel.getRealName());
s.setEmail(agencyUserModel.getEmail());
}
}
......
package com.yeejoin.amos.supervision.business.dto;
import com.yeejoin.amos.component.rule.Label;
import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author: xl
* @Description: 计划规则触发对象
* @Date: 2021/11/10 10:01
*/
@Data
@RuleFact(value = "巡检计划",project = "消息规则")
public class PlanRo implements Serializable {
private static final long serialVersionUID = 3847767788621939352L;
@Label("计划名称")
private String name;
@Label(value = "检查类型名称")
private String checkTypeName;
@Label(value = "执行方法")
private String ruleType;
@Label(value = "执行状态")
private String excuteStateName;
@Label(value = "推送时间")
private String sendTime;
@Label(value = "接收人")
private List<String> recivers;
@Label(value = "发送到web标识")
private Boolean isSendWeb;
@Label(value = "发送到app标识")
private Boolean isSendApp;
@Label("关联id")
private String relationId;
@Label("消息类型")
private String msgType;
@Label(value = "终端标识")
private String terminal;
}
package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner;
......@@ -9,7 +8,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
......@@ -31,7 +29,6 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.*;
......@@ -50,13 +47,10 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -106,7 +100,7 @@ public class CheckServiceImpl implements ICheckService {
private IPlanService planService;
@Autowired
private AsyncTask asyncTask;
private RulePlanService rulePlanService;
@Autowired
DangerFeignClient DangerFeignClient;
......@@ -1578,9 +1572,9 @@ public class CheckServiceImpl implements ICheckService {
recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus);
Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,送消息
// 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan);
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成.getCode());
}
// p_plan_task_detail更新隐患个数
......
......@@ -73,7 +73,7 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
planAuditLog.setFlowJson(condition);
planAuditLog.setRoleName(roleName);
planAuditLogDao.save(planAuditLog);
planService.getUserIdsByWorkflow(plan, instanceId);
planService.getUserIdsByWorkflow(plan, instanceId, status, planAuditLog.getExcuteState());
return Boolean.TRUE;
}
}
......
......@@ -15,10 +15,7 @@ import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.common.enums.CheckTypeSuEnum;
import com.yeejoin.amos.supervision.common.enums.DangerCheckTypeLevelEnum;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.common.enums.WorkFlowBranchEnum;
import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
......@@ -36,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
......@@ -83,6 +81,9 @@ public class PlanServiceImpl implements IPlanService {
private AsyncTask asyncTask;
@Autowired
private RulePlanService rulePlanService;
@Autowired
WorkflowFeignService workflowFeignService;
@Autowired
......@@ -183,7 +184,7 @@ public class PlanServiceImpl implements IPlanService {
//更新时间
audit.setUpdateDate(new Date());
planAuditDao.save(audit);
this.getUserIdsByWorkflow(plan, processInstanceId);
this.getUserIdsByWorkflow(plan, processInstanceId, null, null);
//记录执行流水-启动节点
insertAuditLog(reginParams, plan, personIdentity, audit);
} else {
......@@ -198,7 +199,7 @@ public class PlanServiceImpl implements IPlanService {
planAuditDao.save(audit);
//记录执行流水-启动节点
insertAuditLog(reginParams, plan, personIdentity, audit);
this.getUserIdsByWorkflow(plan, processInstanceId);
this.getUserIdsByWorkflow(plan, processInstanceId,null, null);
}
} catch (Exception e) {
log.error("=============防火监督,计划提交,工作流启动失败!!!=============");
......@@ -208,10 +209,10 @@ public class PlanServiceImpl implements IPlanService {
}
/**
* 根据工作流获取下一审核人角色下的所有用户ID
* 根据工作流获取下一审核人角色下的所有用户ID =》规则推送消息
* @return
*/
protected List<String> getUserIdsByWorkflow (Plan plan, String processInstanceId){
protected List<String> getUserIdsByWorkflow (Plan plan, String processInstanceId, Integer status, Integer excuteState){
List<String> userIds = new ArrayList<>();
JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
......@@ -223,9 +224,15 @@ public class PlanServiceImpl implements IPlanService {
JSONObject jsonItem = (JSONObject) item;
return jsonItem.getString("userId");
}).collect(Collectors.toList());
asyncTask.sendAddPlanMsg(RequestContext.cloneRequestContext(), plan, userIds, true, false);
} else {
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan);
}
try {
if (ValidationUtil.isEmpty(status)){
rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交.getCode()); // 计划提交
} else {
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核.getCode(), ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核
}
} catch (Exception e) {
log.info("规则调用失败");
}
}
return userIds;
......
......@@ -12,11 +12,6 @@ import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dao.repository.ICheckDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanTaskDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanTaskDetailDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.supervision.business.feign.Business;
......@@ -34,19 +29,21 @@ import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.common.enums.RuleTypeEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.dao.entity.Check;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -56,7 +53,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException;
......@@ -106,7 +102,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private RoutePointItemMapper routePointItemMapper;
@Autowired
private AsyncTask asyncTask;
private RulePlanService rulePlanService;
@Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
......@@ -531,8 +527,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance);
// 推送消息
asyncTask.sendPlanMsg(RequestContext.cloneRequestContext(), plan);
// 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成.getCode());
}
// 定时任务监控
jobService.planTaskAddJob(planTask);
......
package com.yeejoin.amos.supervision.business.service.impl;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.supervision.business.dto.PlanRo;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
import com.yeejoin.amos.supervision.business.util.DateUtil;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date;
import java.util.List;
/**
* @Author: xl
* @Description: 巡检计划触发规则
* @Date: 2021/11/10 9:50
*/
@Service
public class RulePlanService {
private final String packageId = "消息/addPlanRule";
private final String msgType = "supervision";
private final String APP = "APP";
private final String WEB = "WEB";
private final String APP_WEB = "APP/WEB";
@Autowired
private RuleTrigger ruleTrigger;
@Autowired
private JCSFeignClient jcsFeignClient;
public Boolean addPlanRule(Plan plan, List<String> userIds, String ruleType) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType);
//触发规则
ruleTrigger.publish(planRo, packageId, new String[0]);
return true;
}
public Boolean addPlanAuditRule(Plan plan, List<String> userIds, String ruleType, String excuteStateName) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType);
planRo.setExcuteStateName(excuteStateName);
//触发规则
ruleTrigger.publish(planRo, packageId, new String[0]);
return true;
}
private PlanRo buildPlanRo (Plan plan, List<String> userIds, String ruleType){
PlanRo planRo = new PlanRo();
BeanUtils.copyProperties(plan, planRo);
planRo.setMsgType(msgType);
planRo.setRuleType(ruleType);
planRo.setRelationId(String.valueOf(plan.getId()));
if (ValidationUtil.isEmpty(userIds)){
String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){
leadPeopleIds += "," + plan.getUserId();
}
userIds = (List<String>)jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
planRo.setIsSendApp(true);
planRo.setTerminal(WEB);
} else {
planRo.setIsSendWeb(true);
planRo.setIsSendApp(false);
planRo.setTerminal(APP_WEB);
}
planRo.setSendTime(DateUtil.date2LongStr(new Date()));
planRo.setRecivers(userIds);
return planRo;
}
}
package com.yeejoin.amos.supervision.business.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.supervision.business.param.MsgInfoPageParam;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
......@@ -40,4 +44,11 @@ public class MsgParamUtils {
return value.toString();
}
}
public static String instedParams(String content, Object msgObj) {
Map<String, Object> strengthMap = JSON.parseObject(JSON.toJSONString(msgObj), Map.class);
for (String key : strengthMap.keySet())
content = content.replaceAll("\\$\\{" + key + "}", String.valueOf(strengthMap.get(key)));
return content;
}
}
......@@ -306,89 +306,6 @@ public class AsyncTask {
}
}
/**
* 提交计划任务消息
* @param requestContextModel
* @param plan
* @param userIds 发送用户id集合
* @param isSendWeb 发送web标识
* @param isSendApp 发送app标识
*/
@Async
public void sendAddPlanMsg(RequestContextModel requestContextModel, Plan plan, List<String> userIds, boolean isSendWeb, boolean isSendApp){
MessageModel model = new MessageModel();
model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
try {
model.setIsSendWeb(isSendWeb);
model.setIsSendApp(isSendApp);
model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(userIds);
remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 发送消息至检查组长
* @param plan
*/
@Async
public void sendPlanMsgToLeadPeople(RequestContextModel requestContextModel, Plan plan){
MessageModel model = new MessageModel();
model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){
leadPeopleIds += "," + plan.getUserId();
}
try {
List<String> recivers = remoteSecurityService.getAmosIdListByUserIds(requestContextModel, leadPeopleIds);
model.setIsSendWeb(true);
model.setIsSendApp(true);
model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(recivers);
remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 发送消息至检查组员
* @param plan
*/
@Async
public void sendPlanMsg(RequestContextModel requestContextModel, Plan plan){
MessageModel model = new MessageModel();
model.setTitle(plan.getName());
String body = String.format("计划名称:%s;检查类型:%s;推送时间:%s",
plan.getName(), plan.getCheckTypeName(), DateUtil.date2LongStr(new Date()));
model.setBody(body);
String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){
leadPeopleIds += "," + plan.getUserId();
}
try {
List<String> recivers = remoteSecurityService.getAmosIdListByUserIds(requestContextModel, leadPeopleIds);
model.setIsSendApp(true);
model.setIsSendWeb(true);
model.setMsgType(msgType);
model.setRelationId(String.valueOf(plan.getId()));
model.setRecivers(recivers);
remoteSecurityService.addMessage(requestContextModel, model);
} catch (Exception e) {
e.printStackTrace();
}
}
private Set<String> userIdFilter(Set<String> sendUserIds, String msgType) {
Set<String> afterFilterUserIds = Sets.newHashSet();
if (CollectionUtils.isEmpty(sendUserIds)) {
......
......@@ -752,36 +752,6 @@ public class RemoteSecurityService {
return handleArray(feignClientResult, DepartmentModel.class);
}
/**
* 平台消息-添加
*/
public void addMessage(RequestContextModel requestContextModel, MessageModel model){
RequestContext.setToken(requestContextModel.getToken());
RequestContext.setProduct(requestContextModel.getProduct());
RequestContext.setAppKey(requestContextModel.getAppKey());
try {
FeignClientResult<MessageModel> messageModelFeignClientResult = Systemctl.messageClient.create(model);
} catch (InnerInvokException e) {
e.printStackTrace();
}
}
/**
* 机场用户id批量获取平台用户id
*/
public List<String> getAmosIdListByUserIds(RequestContextModel requestContextModel, String orgUserIds){
RequestContext.setToken(requestContextModel.getToken());
RequestContext.setProduct(requestContextModel.getProduct());
RequestContext.setAppKey(requestContextModel.getAppKey());
List<String> userNames = new ArrayList<>();
try {
userNames = (List<String>)jcsFeignClient.getAmosIdListByUserIds(orgUserIds).getResult();
} catch (InnerInvokException e) {
e.printStackTrace();
}
return userNames;
}
private <T> List<T> handleArray(FeignClientResult feignClientResult, Class<T> t) {
List<T> list = new ArrayList<>();
if (feignClientResult != null && feignClientResult.getStatus() == 200) {
......
package com.yeejoin.amos.supervision.rule.action;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.supervision.business.util.MsgParamUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
/**
* @Author: xl
* @Description: 消息规则动作
* @Date: 2021/11/10 11:49
*/
@Component
@RuleActionBean(beanLabel = "消息发送")
public class MessageAction {
public static final Logger log = LoggerFactory.getLogger(MessageAction.class);
@RuleMethod(methodLabel = "消息发送", project = "消息")
public void sendMessage(Object msgObj, String title, String content) {
MessageModel messageModel = JSON.parseObject(JSON.toJSONString(msgObj), MessageModel.class);
messageModel.setTitle(title);
messageModel.setBody(MsgParamUtils.instedParams(content, msgObj));
if (!ValidationUtil.isEmpty(messageModel)) {
try {
Systemctl.messageClient.create(messageModel);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
spring.application.name=AMOS-BIZ-API-CCS
spring.application.name=AMOS-BIZ-CCS-API
server.servlet.context-path=/ccs
server.port=8807
spring.profiles.active=dev
......
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