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 { ...@@ -709,6 +709,7 @@ public class DateUtils {
/** /**
* 根据两个日期返回相差的时分秒 * 根据两个日期返回相差的时分秒
*
* @param newTime 靠后时间 * @param newTime 靠后时间
* @param oldTime 靠前时间 * @param oldTime 靠前时间
* @return * @return
...@@ -718,7 +719,7 @@ public class DateUtils { ...@@ -718,7 +719,7 @@ public class DateUtils {
Long oldTimes = oldTime.getTime(); Long oldTimes = oldTime.getTime();
// 不改时间会多加八个小时 // 不改时间会多加八个小时
timeSdf.setTimeZone(TimeZone.getTimeZone("GMT+00:00")); timeSdf.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
return timeSdf.format(newTimes-oldTimes); return timeSdf.format(newTimes - oldTimes);
} }
/** /**
...@@ -748,11 +749,12 @@ public class DateUtils { ...@@ -748,11 +749,12 @@ public class DateUtils {
/** /**
* 通过月份计算季度 * 通过月份计算季度
*
* @param month * @param month
* @return * @return
*/ */
public static int getQuarter(int month) { public static int getQuarter(int month) {
if(month < 1 || month > 12) { if (month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid."); throw new IllegalArgumentException("month is invalid.");
} }
return (month - 1) / 3 + 1; return (month - 1) / 3 + 1;
...@@ -760,11 +762,12 @@ public class DateUtils { ...@@ -760,11 +762,12 @@ public class DateUtils {
/** /**
* 通过月份计算季度 * 通过月份计算季度
*
* @param month * @param month
* @return * @return
*/ */
public static String getQuarterStr(int month) { public static String getQuarterStr(int month) {
if(month < 1 || month > 12) { if (month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid."); throw new IllegalArgumentException("month is invalid.");
} }
return (month - 1) / 3 + 1 + ""; return (month - 1) / 3 + 1 + "";
...@@ -772,6 +775,7 @@ public class DateUtils { ...@@ -772,6 +775,7 @@ public class DateUtils {
/** /**
* 获取指定时间所在周的第一天日期 * 获取指定时间所在周的第一天日期
*
* @param date * @param date
* @return * @return
*/ */
...@@ -785,8 +789,25 @@ public class DateUtils { ...@@ -785,8 +789,25 @@ public class DateUtils {
return getDate(calendar.getTime()); 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 * @param date
* @return * @return
*/ */
...@@ -802,18 +823,19 @@ public class DateUtils { ...@@ -802,18 +823,19 @@ public class DateUtils {
/** /**
* 将秒数转换为时分秒格式 * 将秒数转换为时分秒格式
*
* @param times * @param times
* @return * @return
*/ */
public static String secondsToTimeStr(int times) { public static String secondsToTimeStr(int times) {
if(times <= 0){ if (times <= 0) {
return "00:00:00"; return "00:00:00";
} }
int h = times/3600; int h = times / 3600;
int m = (times-h*3600)/60; int m = (times - h * 3600) / 60;
int s = times - h*3600-m*60; int s = times - h * 3600 - m * 60;
String time = "%02d:%02d:%02d"; String time = "%02d:%02d:%02d";
time = String.format(time,h,m,s); time = String.format(time, h, m, s);
return time; return time;
} }
} }
...@@ -61,7 +61,7 @@ public class MetaHandler implements MetaObjectHandler { ...@@ -61,7 +61,7 @@ public class MetaHandler implements MetaObjectHandler {
this.setFieldValByName("recUserId", agencyUserModel.getUserId(), metaObject); this.setFieldValByName("recUserId", agencyUserModel.getUserId(), metaObject);
} }
if (isExistField("recUserName", entity)) { if (isExistField("recUserName", entity)) {
this.setFieldValByName("recUserName", agencyUserModel.getUserName(), metaObject); this.setFieldValByName("recUserName", agencyUserModel.getRealName(), metaObject);
} }
if (isExistField("recDate", entity)) { if (isExistField("recDate", entity)) {
Date currentDate = new Date(); Date currentDate = new Date();
......
...@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* 消防建筑表 * 消防建筑表
* *
...@@ -43,6 +45,9 @@ public class FireBuildingDto extends BaseDto { ...@@ -43,6 +45,9 @@ public class FireBuildingDto extends BaseDto {
@ApiModelProperty(value = "父级mrid") @ApiModelProperty(value = "父级mrid")
private String parentMrid; private String parentMrid;
@ApiModelProperty(value = "树形mrids,包括自己,冗余用于树形查询")
private String treeMrids;
@ApiModelProperty(value = "类型(建筑、楼层、房间)") @ApiModelProperty(value = "类型(建筑、楼层、房间)")
private String type; private String type;
...@@ -54,4 +59,7 @@ public class FireBuildingDto extends BaseDto { ...@@ -54,4 +59,7 @@ public class FireBuildingDto extends BaseDto {
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private String lat; private String lat;
@ApiModelProperty(value = "子节点")
private List<FireBuildingDto> children;
} }
package com.yeejoin.amos.boot.module.ccs.api.dto; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
package com.yeejoin.amos.boot.module.ccs.api.dto; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
......
...@@ -20,13 +20,13 @@ public class BaseEntity implements Serializable { ...@@ -20,13 +20,13 @@ public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.ID_WORKER) @TableId(value = "id", type = IdType.ID_WORKER)
protected Long id; protected String id;
/** /**
* 同步日期 * 同步日期
*/ */
@TableField(value = "syn_date", fill = FieldFill.INSERT_UPDATE) @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; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.ccs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -68,6 +67,12 @@ public class FireBuilding extends BaseEntity { ...@@ -68,6 +67,12 @@ public class FireBuilding extends BaseEntity {
@TableField("parent_mrid") @TableField("parent_mrid")
private String parentMrid; private String parentMrid;
/**
* 树形mrids,包括自己,冗余用于树形查询
*/
private String treeMrids;
/** /**
* 类型(建筑、楼层、房间) * 类型(建筑、楼层、房间)
*/ */
......
package com.yeejoin.amos.boot.module.ccs.api.mapper; 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.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 接口 * 换流站告警日统计 Mapper 接口
...@@ -11,4 +14,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +14,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface FireAlarmDayStatisticsMapper extends BaseMapper<FireAlarmDayStatistics> { 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; 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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireDangerDayStatistics;
import java.util.List;
/** /**
* 换流站隐患日统计 Mapper 接口 * 换流站隐患日统计 Mapper 接口
...@@ -11,4 +13,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +13,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface FireDangerDayStatisticsMapper extends BaseMapper<FireDangerDayStatistics> { 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; 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.dto.FireLatentDangerDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireLatentDanger; import com.yeejoin.amos.boot.module.ccs.api.entity.FireLatentDanger;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 隐患信息 Mapper 接口 * 隐患信息 Mapper 接口
...@@ -16,10 +17,18 @@ import java.util.List; ...@@ -16,10 +17,18 @@ import java.util.List;
public interface FireLatentDangerMapper extends BaseMapper<FireLatentDanger> { public interface FireLatentDangerMapper extends BaseMapper<FireLatentDanger> {
/** /**
* 隐患列表倒序列表 * 隐患列表倒序列表
* @param top 限制w *
* @param top 限制w
* @param stationCode 站code * @param stationCode 站code
* @return List<FireLatentDangerDto> * @return List<FireLatentDangerDto>
*/ */
List<FireLatentDangerDto> queryDangerList(@Param("top") Long top, @Param("stationCode") String stationCode); 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; 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; ...@@ -8,5 +12,4 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
* @date 2021-11-09 * @date 2021-11-09
*/ */
public interface IFireBuildingService { 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 @@ ...@@ -2,4 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireAlarmDayStatisticsMapper"> <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> </mapper>
...@@ -2,4 +2,28 @@ ...@@ -2,4 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireDangerDayStatisticsMapper"> <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> </mapper>
...@@ -14,8 +14,16 @@ ...@@ -14,8 +14,16 @@
s.name as station_name, s.name as station_name,
a.station_code, a.station_code,
a.location, a.location,
a.lat, <choose>
a.lng, <when test="stationCode != null and stationCode != ''">
a.lat,
a.lng,
</when>
<otherwise>
s.lng,
s.lat,
</otherwise>
</choose>
s.lat as stationLat, s.lat as stationLat,
s.lng as stationLng s.lng as stationLng
from from
......
...@@ -4,19 +4,27 @@ ...@@ -4,19 +4,27 @@
<select id="queryDangerList" resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto"> <select id="queryDangerList" resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto">
select select
d.id, d.id,
d.danger_name, d.danger_name,
d.danger_state, d.danger_state,
d.danger_state_name, d.danger_state_name,
d.danger_level, d.danger_level,
d.danger_level_name, d.danger_level_name,
s.name as station_name, s.name as station_name,
d.station_code, d.station_code,
d.discovery_date, d.discovery_date,
d.lat, <choose>
d.lng, <when test="stationCode != null and stationCode != ''">
s.lat as stationLat, d.lat,
s.lng as stationLng d.lng,
</when>
<otherwise>
s.lng,
s.lat,
</otherwise>
</choose>
s.lng as stationLng,
s.lat as stationLat
from from
asf_fire_latent_danger d, asf_fire_latent_danger d,
asf_fire_station_info s asf_fire_station_info s
...@@ -27,7 +35,19 @@ ...@@ -27,7 +35,19 @@
</if> </if>
order by d.discovery_date desc order by d.discovery_date desc
<if test="top != null"> <if test="top != null">
limit ${top} limit ${top}
</if> </if>
</select> </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> </mapper>
package com.yeejoin.amos.boot.module.common.api.feign; package com.yeejoin.amos.boot.module.common.api.feign;
import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.LinkedHashMap;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto; import java.util.Map;
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 org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -14,9 +12,11 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -14,9 +12,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List; import com.yeejoin.amos.boot.module.common.api.dto.EquipmentIndexDto;
import java.util.Map; 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 * 装备服务feign
...@@ -315,4 +315,9 @@ public interface EquipFeignClient { ...@@ -315,4 +315,9 @@ public interface EquipFeignClient {
*/ */
@RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST) @RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST)
ResponseModel<List<EquipmentIndexDto>> getEquipmentIndexDto(@RequestBody PerfQuotaIotDTO perfQuotaIotDTO); 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> { ...@@ -134,5 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company); 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 ...@@ -105,4 +105,14 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("stratTime") String stratTime, @Param("stratTime") String stratTime,
@Param("endTime") String endTime @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> { ...@@ -37,5 +37,5 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId, List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle); 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> { ...@@ -92,5 +92,5 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList); 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 { ...@@ -34,5 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService {
*/ */
List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId); 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 = ( ...@@ -342,25 +342,44 @@ AND cft.type_code = (
</select> </select>
<select id='queryByCompanyId' resultType="map"> <select id='queryByCompanyId' resultType="map">
SELECT select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone from (
e.field_code, select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr
e.field_name, from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
e.field_value i.instance_id where i.field_code = 'telephone') as d
FROM where d.sequence_nbr in (
cb_dynamic_form_instance e, select userId from (
(SELECT select cb.duty_date,a.deptId,c.userId from cb_duty_person_shift cb
i.* left join (select i.instance_id id1 ,if(i.field_code = 'deptId',
FROM i.field_value, null) as 'deptId' from cb_dynamic_form_instance i
cb_dynamic_form_instance i where i.field_code = 'deptId' and i.field_value is not null) a
, on cb.instance_id = a.id1
(SELECT * FROM `cb_duty_person_shift` where to_days(duty_date) = to_days(now())) b left join (select i.instance_id id3 ,if(i.field_code = 'userId',
WHERE i.field_value, null) as 'userId' from cb_dynamic_form_instance i
i.instance_id = b.instance_id where i.field_code = 'userId' and i.field_value is not null) c
AND on cb.instance_id = c.id3
i.field_code = 'deptId' where to_days(cb.duty_date) = to_days(now()) and
AND a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援保障部' or
i.field_value = #{companyId}) c biz_org_name = '综合办公室' or biz_org_name = '消防支队' or biz_org_name = '应急指挥科' )) r )
WHERE </select>
e. instance_id = c.instance_id
<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> </select>
</mapper> </mapper>
...@@ -259,5 +259,43 @@ ...@@ -259,5 +259,43 @@
</if> </if>
order by instanceId desc order by instanceId desc
</select> </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> </mapper>
...@@ -174,11 +174,14 @@ ...@@ -174,11 +174,14 @@
<select id="queryById" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto"> <select id="queryById" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto">
SELECT SELECT
* firefighters.sequence_nbr sequenceNbr ,
firefighters.name,
mobile_phone as mobilePhone
FROM FROM
cb_firefighters cb_firefighters firefighters
WHERE 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"> <if test="gw != null">
And job_title_code In And job_title_code In
<foreach item="item" collection="gw" index="index" open="(" separator="," close=")"> <foreach item="item" collection="gw" index="index" open="(" separator="," close=")">
......
...@@ -687,35 +687,16 @@ LEFT JOIN ( ...@@ -687,35 +687,16 @@ LEFT JOIN (
</select> </select>
<select id="queryCompanyId" resultType="map"> <select id="queryCompanyId" resultType="map">
SELECT select * from (
d.field_code , select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
d.field_name , a.fireManagementPostCode, b.telephone from cb_org_usr cou
d.field_value , left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
s.sequence_nbr, i.field_value_label, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
s.biz_org_name, and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
s.parent_id left join (select i.instance_id id2,if(i.field_code = 'telephone',
FROM i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
cb_dynamic_form_instance d , and i.field_value is not null) b on cou .sequence_nbr = b.id2
( SELECT ) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
u.* and (d.fireManagementPostCode = '消防安全管理人' or d.fireManagementPostCode = '消防安全责任人')
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> </select>
</mapper> </mapper>
...@@ -18,7 +18,7 @@ import java.util.List; ...@@ -18,7 +18,7 @@ import java.util.List;
* @version $Id: AlertCalledRo.java, v 0.1 2021年6月24日 下午3:31:14 gwb Exp $ * @version $Id: AlertCalledRo.java, v 0.1 2021年6月24日 下午3:31:14 gwb Exp $
*/ */
@Data @Data
@RuleFact(value = "警情信息",project = "西咸机场119调派规则") @RuleFact(value = "调派信息",project = "西咸机场119调派规则")
public class AlertCallePowerTransferRo implements Serializable{ public class AlertCallePowerTransferRo implements Serializable{
...@@ -29,7 +29,7 @@ public class AlertCallePowerTransferRo implements Serializable{ ...@@ -29,7 +29,7 @@ public class AlertCallePowerTransferRo implements Serializable{
* *
* </pre> * </pre>
*/ */
private static final long serialVersionUID = 7091835997817930383L; private static final long serialVersionUID = 4735920511849348360L;
/** /**
* 通用属性 * 通用属性
...@@ -85,17 +85,10 @@ public class AlertCallePowerTransferRo implements Serializable{ ...@@ -85,17 +85,10 @@ public class AlertCallePowerTransferRo implements Serializable{
@ApiModelProperty(value = "联系人电话") @ApiModelProperty(value = "联系人电话")
private String contactPhone; private String contactPhone;
@ApiModelProperty(value = "调派单位资源列表")
private List<CompanyRo> company;
@ApiModelProperty(value = "调派单位资源列表") @ApiModelProperty(value = "调派单位资源列表")
private List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList; private List< PowerTransferCompanyDto> company;
@ApiModelProperty(value = "调派类型队伍") @ApiModelProperty(value = "调派类型队伍")
private String powerTransType; private String powerTransType;
} }
...@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{ ...@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{
* *
* </pre> * </pre>
*/ */
private static final long serialVersionUID = 7091835997817930383L; private static final long serialVersionUID = 529623529216238088L;
/** /**
* 通用属性 * 通用属性
...@@ -46,6 +46,12 @@ public class AlertCalledRo implements Serializable{ ...@@ -46,6 +46,12 @@ public class AlertCalledRo implements Serializable{
@Label(value = "发送单位") @Label(value = "发送单位")
private String companyName; private String companyName;
@Label(value = "联系人")
private String contactUser;
@Label(value = "联系电话")
private String contactPhone;
@Label(value = "被困人数") @Label(value = "被困人数")
private String trappedNum; private String trappedNum;
...@@ -57,6 +63,24 @@ public class AlertCalledRo implements Serializable{ ...@@ -57,6 +63,24 @@ public class AlertCalledRo implements Serializable{
@Label(value = "警情报送id") @Label(value = "警情报送id")
private String alertSubmittedId; 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{ ...@@ -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; package com.yeejoin.amos.boot.module.jcs.api.dto;
import java.util.List;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -15,4 +17,7 @@ public class CompanyRo { ...@@ -15,4 +17,7 @@ public class CompanyRo {
@ApiModelProperty(value = "调派单位名称") @ApiModelProperty(value = "调派单位名称")
private String powerCompanyName; private String powerCompanyName;
@ApiModelProperty(value = "调派单位资源列表")
private List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList;
} }
...@@ -24,6 +24,7 @@ public enum AlertStageEnums { ...@@ -24,6 +24,7 @@ public enum AlertStageEnums {
LYXC("237", "漏油现场安全保障"), LYXC("237", "漏油现场安全保障"),
ZJBZ("238", "转机保障"), ZJBZ("238", "转机保障"),
QTJQ("242", "其他"), QTJQ("242", "其他"),
JJJQ("1214", "120急救"),
RG("226", "人工上报"), RG("226", "人工上报"),
DJ("228", "对讲呼入"), DJ("228", "对讲呼入"),
......
...@@ -43,6 +43,9 @@ public interface IAlertCalledService { ...@@ -43,6 +43,9 @@ public interface IAlertCalledService {
Object selectAlertCalledByIdNoRedis(Long id); Object selectAlertCalledByIdNoRedis(Long id);
Object selectAlertCalledByIdNoRedisNew(Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( 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; ...@@ -8,8 +8,13 @@ package com.yeejoin.amos.supervision.common.enums;
public enum RuleTypeEnum { public enum RuleTypeEnum {
GETCONTENT("维保项获取","getContent"), GETCONTENT("维保项获取","getContent"),
CHECKRESULT("结果校验","checkResult" ); CHECKRESULT("结果校验","checkResult" ),
// 防火监督
计划提交("计划提交", "addPlan"),
计划审核("计划审核", "planAudit"),
计划生成("计划生成", "addPlanTask"),
计划完成("计划完成", "planCompleted");
/** /**
* 名称,描述 * 名称,描述
......
...@@ -31,77 +31,6 @@ public class FireAlarmDayStatisticsController extends BaseController { ...@@ -31,77 +31,6 @@ public class FireAlarmDayStatisticsController extends BaseController {
FireAlarmDayStatisticsServiceImpl fireAlarmDayStatisticsServiceImpl; 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 * @return
......
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireBuildingDto; ...@@ -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 com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireBuildingServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -36,16 +37,24 @@ public class FireBuildingController extends BaseController { ...@@ -36,16 +37,24 @@ public class FireBuildingController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page") @GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防建筑表分页查询", notes = "消防建筑表分页查询") @ApiOperation(httpMethod = "GET", value = "消防建筑表分页查询", notes = "消防建筑表分页查询")
public ResponseModel<Page<FireBuildingDto>> queryForPage( public ResponseModel<Page<FireBuildingDto>> queryForPage(
@RequestParam(value = "name", required = false) String name, @ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current, @ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@PathVariable String stationCode) { @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireBuildingDto> page = new Page<FireBuildingDto>(); Page<FireBuildingDto> page = new Page<FireBuildingDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(fireBuildingServiceImpl.queryForFireBuildingPage(page, name, stationCode)); 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; 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.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireDangerDayStatisticsDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireDangerDayStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireDangerDayStatisticsServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireDangerDayStatisticsServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; 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.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
...@@ -31,63 +31,6 @@ public class FireDangerDayStatisticsController extends BaseController { ...@@ -31,63 +31,6 @@ public class FireDangerDayStatisticsController extends BaseController {
FireDangerDayStatisticsServiceImpl fireDangerDayStatisticsServiceImpl; 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 * @return
......
...@@ -45,4 +45,17 @@ public class FireLatentDangerController extends BaseController { ...@@ -45,4 +45,17 @@ public class FireLatentDangerController extends BaseController {
@ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) { @ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) {
return ResponseHelper.buildResponse(fireLatentDangerServiceImpl.queryForFireLatentDangerList(top, 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; ...@@ -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 com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireVehicleServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -35,13 +36,13 @@ public class FireVehicleController extends BaseController { ...@@ -35,13 +36,13 @@ public class FireVehicleController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page") @GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防车辆信息分页查询", notes = "消防车辆信息分页查询") @ApiOperation(httpMethod = "GET", value = "消防车辆信息分页查询", notes = "消防车辆信息分页查询")
public ResponseModel<Page<FireVehicleDto>> queryForPage( public ResponseModel<Page<FireVehicleDto>> queryForPage(
@RequestParam(value = "name", required = false) String name, @ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current, @ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@PathVariable String stationCode) { @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireVehicleDto> page = new Page<FireVehicleDto>(); Page<FireVehicleDto> page = new Page<FireVehicleDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
......
...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.ccs.api.dto.FireVideoDto; ...@@ -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 com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireVideoServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -13,6 +15,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; 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 { ...@@ -36,17 +43,22 @@ public class FireVideoController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page") @GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防视频表分页查询", notes = "消防视频表分页查询") @ApiOperation(httpMethod = "GET", value = "消防视频表分页查询", notes = "消防视频表分页查询")
public ResponseModel<Page<FireVideoDto>> queryForPage( public ResponseModel<Page<FireVideoDto>> queryForPage(
@RequestParam(value = "name", required = false) String name, @ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current, @ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@PathVariable String stationCode) { @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<FireVideoDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); 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; ...@@ -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 com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireWaterServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -13,8 +14,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
/** /**
* 消防水源表 * 消防水源表
* *
...@@ -37,28 +36,16 @@ public class FireWaterController extends BaseController { ...@@ -37,28 +36,16 @@ public class FireWaterController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "{stationCode}/page") @GetMapping(value = "/{stationCode}/page")
@ApiOperation(httpMethod = "GET", value = "消防水源表分页查询", notes = "消防水源表分页查询") @ApiOperation(httpMethod = "GET", value = "消防水源表分页查询", notes = "消防水源表分页查询")
public ResponseModel<Page<FireWaterDto>> queryForPage( public ResponseModel<Page<FireWaterDto>> queryForPage(
@RequestParam(value = "name", required = false) String name, @ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@RequestParam(value = "current") int current, @ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, @ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@PathVariable String stationCode) { @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireWaterDto> page = new Page<FireWaterDto>(); Page<FireWaterDto> page = new Page<FireWaterDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(fireWaterServiceImpl.queryForFireWaterPage(page, name, stationCode)); 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; 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.entity.FireAlarmDayStatistics;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireAlarmDayStatisticsMapper; 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.service.IFireAlarmDayStatisticsService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireAlarmDayStatisticsDto; import org.apache.commons.lang3.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; 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; import java.util.List;
/** /**
...@@ -16,18 +18,25 @@ import java.util.List; ...@@ -16,18 +18,25 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireAlarmDayStatisticsServiceImpl extends BaseService<FireAlarmDayStatisticsDto,FireAlarmDayStatistics,FireAlarmDayStatisticsMapper> implements IFireAlarmDayStatisticsService { public class FireAlarmDayStatisticsServiceImpl extends BaseService<FireAlarmDayStatisticsDto, FireAlarmDayStatistics, FireAlarmDayStatisticsMapper> implements IFireAlarmDayStatisticsService {
/**
* 分页查询
*/
public Page<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsPage(Page<FireAlarmDayStatisticsDto> page) {
return this.queryForPage(page, null, false);
}
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsList() { public List<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsList() {
return this.queryForList("" , false); 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; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.dto.FireBuildingDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireBuilding; 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.mapper.FireBuildingMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireBuildingService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireBuildingService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 消防建筑表服务实现类 * 消防建筑表服务实现类
...@@ -23,15 +27,17 @@ public class FireBuildingServiceImpl extends BaseService<FireBuildingDto, FireBu ...@@ -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) { public Page<FireBuildingDto> queryForFireBuildingPage(Page<FireBuildingDto> page, @Condition(Operator.like) String name, @Condition String stationCode) {
return this.queryForPage(page, "createDate", false, name, stationCode); return this.queryForPage(page, "create_date", false, name, stationCode);
} }
/** 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());
public List<FireBuildingDto> queryForFireBuildingList() { }
return this.queryForList("", false);
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; 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.entity.FireDangerDayStatistics;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireDangerDayStatisticsMapper; 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.service.IFireDangerDayStatisticsService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireDangerDayStatisticsDto; import org.apache.commons.lang3.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; 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; import java.util.List;
/** /**
...@@ -16,18 +18,25 @@ import java.util.List; ...@@ -16,18 +18,25 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireDangerDayStatisticsServiceImpl extends BaseService<FireDangerDayStatisticsDto,FireDangerDayStatistics,FireDangerDayStatisticsMapper> implements IFireDangerDayStatisticsService { public class FireDangerDayStatisticsServiceImpl extends BaseService<FireDangerDayStatisticsDto, FireDangerDayStatistics, FireDangerDayStatisticsMapper> implements IFireDangerDayStatisticsService {
/**
* 分页查询
*/
public Page<FireDangerDayStatisticsDto> queryForFireDangerDayStatisticsPage(Page<FireDangerDayStatisticsDto> page) {
return this.queryForPage(page, null, false);
}
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<FireDangerDayStatisticsDto> queryForFireDangerDayStatisticsList() { public List<FireDangerDayStatisticsDto> queryForFireDangerDayStatisticsList() {
return this.queryForList("" , false); 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; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.yeejoin.amos.boot.module.ccs.api.dto.FireLatentDangerDto;
import com.yeejoin.amos.boot.module.ccs.api.dto.BaseDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.BaseEntity;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireLatentDanger; 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.mapper.FireLatentDangerMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireLatentDangerService; 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 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.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -22,20 +20,30 @@ import java.util.stream.Collectors; ...@@ -22,20 +20,30 @@ import java.util.stream.Collectors;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @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); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
* @param top 取值 *
* @param top 取值
* @param stationCode 站code * @param stationCode 站code
*/ */
public List<FireLatentDangerDto> queryForFireLatentDangerList(Long top, String stationCode ) { public List<FireLatentDangerDto> queryForFireLatentDangerList(Long top, String stationCode) {
return this.getBaseMapper().queryDangerList(top,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; ...@@ -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.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/** /**
* 消防车辆信息服务实现类 * 消防车辆信息服务实现类
* *
...@@ -24,13 +22,6 @@ public class FireVehicleServiceImpl extends BaseService<FireVehicleDto, FireVehi ...@@ -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) { public Page<FireVehicleDto> queryForFireVehiclePage(Page<FireVehicleDto> 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);
}
/**
* 列表查询 示例
*/
public List<FireVehicleDto> queryForFireVehicleList() {
return this.queryForList("", false);
} }
} }
\ No newline at end of file
...@@ -23,14 +23,8 @@ public class FireVideoServiceImpl extends BaseService<FireVideoDto, FireVideo, F ...@@ -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) { public Page<FireVideoDto> queryForFireVideoPage(Page<FireVideoDto> page, @Condition(Operator.like) String name, String stationCode, @Condition(Operator.in) List<String> buildingMrid) {
return this.queryForPage(page, "createDate", false, name, stationCode); 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 ...@@ -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) { 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 { ...@@ -1366,7 +1366,7 @@ public class CommandController extends BaseController {
public ResponseModel<Object> adduserCar(@PathVariable String type, @RequestBody UserCar userCar ) { public ResponseModel<Object> adduserCar(@PathVariable String type, @RequestBody UserCar userCar ) {
AgencyUserModel agencyUserModel= getUserInfo(); AgencyUserModel agencyUserModel= getUserInfo();
userCar.setAmosUserId(Long.valueOf(agencyUserModel.getUserId())); userCar.setAmosUserId(Long.valueOf(agencyUserModel.getUserId()));
userCar.setAmosUserName(agencyUserModel.getUserName()); userCar.setAmosUserName(agencyUserModel.getRealName());
if("1".equals(type)){ if("1".equals(type)){
userCarService.add(userCar); userCarService.add(userCar);
}else{ }else{
......
...@@ -191,18 +191,18 @@ public class DutyPersonController extends BaseController { ...@@ -191,18 +191,18 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId)); return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId));
} }
/** // /**
* // *
* // *
* @return ResponseModel // * @return ResponseModel
*/ // */
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) // @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/companyId/{companyId}") // @GetMapping(value = "/companyId/{companyId}")
@ApiOperation(httpMethod = "GET", value = "查询当日值班人员", notes = "查询当日值班人员") // @ApiOperation(httpMethod = "GET", value = "查询当日值班人员", notes = "查询当日值班人员")
public ResponseModel<List<Map<String, Object>>> queryByCompanyId( // public ResponseModel<List<Map<String, Object>>> queryByCompanyId(
@PathVariable Long companyId) throws Exception { // @PathVariable Long companyId) throws Exception {
return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId)); // return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId));
} // }
} }
...@@ -268,17 +268,17 @@ public class OrgPersonController { ...@@ -268,17 +268,17 @@ public class OrgPersonController {
} }
} }
/** // /**
* 机场单位下 各单位下人员岗位不为空的人员 // * 机场单位下 各单位下人员岗位不为空的人员
* // *
* @param id // * @param id
* @return // * @return
*/ // */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) // @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyId/{id}", method = RequestMethod.GET) // @RequestMapping(value = "/companyId/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员岗位不为空的人员详情", notes = "获取人员岗位不为空的人员详情") // @ApiOperation(httpMethod = "GET", value = "获取人员岗位不为空的人员详情", notes = "获取人员岗位不为空的人员详情")
public ResponseModel<Object> queryCompanyId(HttpServletRequest request, // public ResponseModel<Object> queryCompanyId(HttpServletRequest request,
@PathVariable Long id) throws Exception { // @PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.queryCompanyId(id)); // return ResponseHelper.buildResponse(iOrgUsrService.queryCompanyId(id));
} // }
} }
...@@ -224,7 +224,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -224,7 +224,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
this.getGroupCode(), "carId", "carName", "teamName","result.carId"); this.getGroupCode(), "carId", "carName", "teamName","result.carId");
int count =0; int count =0;
for (Map<String, Object> map : equipmentList) { 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++; count++;
} }
} }
......
...@@ -303,17 +303,14 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -303,17 +303,14 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
} }
@Override
public List<Map<String, Object>> queryByCompanyId(){
return dutyPersonShiftMapper.queryByCompanyId();
}
@Override
public List<Map<String, Object>> queryByCompanyNew(String bizOrgName){
return dutyPersonShiftMapper.queryByCompanyNew(bizOrgName);
public List<Map<String, Object>> queryByCompanyId(Long companyId){
return dutyPersonShiftMapper.queryByCompanyId(companyId);
} }
......
...@@ -143,7 +143,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto, ...@@ -143,7 +143,7 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
if (!result) { if (!result) {
return false; return false;
} }
failureMaintainDto.setMaintainMan(userInfo.getUserModel().getUserName()); failureMaintainDto.setMaintainMan(userInfo.getUserModel().getRealName());
failureMaintainDto.setMaintainTime(new Date()); failureMaintainDto.setMaintainTime(new Date());
String parentId = iOrgUsrService.getParentId(userInfo.getUserModel().getUserId()); String parentId = iOrgUsrService.getParentId(userInfo.getUserModel().getUserId());
OrgUsr orgUsr = iOrgUsrService.getById(parentId); OrgUsr orgUsr = iOrgUsrService.getById(parentId);
......
...@@ -97,7 +97,7 @@ public class FirefightersContractServiceImpl extends BaseService<FirefightersCon ...@@ -97,7 +97,7 @@ public class FirefightersContractServiceImpl extends BaseService<FirefightersCon
detail.setIsDelete(false); detail.setIsDelete(false);
detail.setRecDate(new Date()); detail.setRecDate(new Date());
detail.setRecUserId(userInfo.getUserId()); detail.setRecUserId(userInfo.getUserId());
detail.setRecUserName(userInfo.getUserName()); detail.setRecUserName(userInfo.getRealName());
this.baseMapper.updateById(detail); this.baseMapper.updateById(detail);
Map<String, List<AttachmentDto>> map = firefightersContract.getAttachments(); Map<String, List<AttachmentDto>> map = firefightersContract.getAttachments();
if (ObjectUtils.isNotEmpty(map)) { if (ObjectUtils.isNotEmpty(map)) {
......
...@@ -133,9 +133,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -133,9 +133,10 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
return firefightersMapper.getFirefightersName(); 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 ...@@ -171,7 +171,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
entity.setIsDelete(false); entity.setIsDelete(false);
entity.setRecDate(new Date()); entity.setRecDate(new Date());
entity.setRecUserId(userInfo.getUserId()); entity.setRecUserId(userInfo.getUserId());
entity.setRecUserName(userInfo.getUserName()); entity.setRecUserName(userInfo.getRealName());
int num = keySiteMapper.updateById(entity); int num = keySiteMapper.updateById(entity);
Map<String, List<AttachmentDto>> map = keySite.getAttachments(); Map<String, List<AttachmentDto>> map = keySite.getAttachments();
if (ObjectUtils.isNotEmpty(map)) { if (ObjectUtils.isNotEmpty(map)) {
......
...@@ -1860,9 +1860,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1860,9 +1860,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultMap; 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 { ...@@ -333,21 +333,7 @@ public class FirefightersController extends BaseController {
return ResponseHelper.buildResponse(menus); 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; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; 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.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; 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.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; 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.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
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 { ...@@ -177,7 +176,7 @@ public class PowerTransferController extends BaseController {
public ResponseModel<Boolean> createPowerTransfer(@RequestBody PowerTransferDto powerTransferDto) { public ResponseModel<Boolean> createPowerTransfer(@RequestBody PowerTransferDto powerTransferDto) {
AgencyUserModel userInfo = getUserInfo(); AgencyUserModel userInfo = getUserInfo();
powerTransferDto.setTaskSenderId(Long.parseLong(userInfo.getUserId())); powerTransferDto.setTaskSenderId(Long.parseLong(userInfo.getUserId()));
powerTransferDto.setTaskSenderName(userInfo.getUserName()); powerTransferDto.setTaskSenderName(userInfo.getRealName());
String companyName = getSelectedOrgInfo().getCompany().getCompanyName(); String companyName = getSelectedOrgInfo().getCompany().getCompanyName();
powerTransferDto.setCompanyName(companyName); powerTransferDto.setCompanyName(companyName);
...@@ -202,6 +201,5 @@ public class PowerTransferController extends BaseController { ...@@ -202,6 +201,5 @@ public class PowerTransferController extends BaseController {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferList(beginDate, endDate)); return ResponseHelper.buildResponse(powerTransferService.getPowerTransferList(beginDate, endDate));
} }
} }
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.rule.action; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -64,14 +66,13 @@ public class AlertCalledAction { ...@@ -64,14 +66,13 @@ public class AlertCalledAction {
* *
* @param smsCode 短信模板code * @param smsCode 短信模板code
* @param sendType 发送类型 * @param sendType 发送类型
* @param sendIds 人员id
* @param object 模板内容对象 * @param object 模板内容对象
* @throws Exception 异常 * @throws Exception 异常
*/ */
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则") @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; package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo; import java.util.List;
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 org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.HashMap; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl;
import java.util.Set; import com.yeejoin.amos.component.rule.RuleActionBean;
import com.yeejoin.amos.component.rule.RuleMethod;
/** /**
* <pre> * <pre>
...@@ -27,7 +24,11 @@ import java.util.Set; ...@@ -27,7 +24,11 @@ import java.util.Set;
@RuleActionBean(beanLabel = "调派报送") @RuleActionBean(beanLabel = "调派报送")
public class PowerTransferAction { public class PowerTransferAction {
public static final Logger log = LoggerFactory.getLogger(PowerTransferAction.class); /**
*
*/
public static final Logger log = LoggerFactory.getLogger(PowerTransferAction.class);
@Autowired @Autowired
private AlertSubmittedServiceImpl alertSubmittedService; private AlertSubmittedServiceImpl alertSubmittedService;
...@@ -44,9 +45,10 @@ public class PowerTransferAction { ...@@ -44,9 +45,10 @@ public class PowerTransferAction {
* @throws Exception 异常 * @throws Exception 异常
*/ */
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则") @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; ...@@ -3,13 +3,13 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -67,8 +67,6 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.TemplateMapper; ...@@ -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.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.component.rule.config.RuleConfig; 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 ...@@ -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>
* 保存警情信息 * 保存警情信息
* </pre> * </pre>
...@@ -351,8 +368,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -351,8 +368,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto.setAlertCalled(alertCalled); alertCalledObjsDto.setAlertCalled(alertCalled);
alertCalledObjsDto.setAlertFormValue(alertFormValuelist); alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
// 警情报送 // 警情报送
// 调用规则 // 调用规则 警情初报
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto); ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(), null);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 // 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
/** /**
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.ObjectUtils;
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.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils; import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
...@@ -36,6 +62,7 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject; ...@@ -36,6 +62,7 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template; import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
...@@ -45,9 +72,8 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService ...@@ -45,9 +72,8 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction; import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction;
import com.yeejoin.amos.component.rule.config.RuleConfig; import com.yeejoin.amos.component.rule.config.RuleConfig;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.checkerframework.checker.units.qual.A; import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -55,18 +81,18 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -55,18 +81,18 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
...@@ -102,6 +128,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -102,6 +128,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired
private FirefightersServiceImpl firefightersService;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
IDutyPersonService iDutyPersonService;
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
...@@ -171,20 +204,14 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -171,20 +204,14 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Override @Override
public Boolean save(AlertSubmittedDto alertSubmittedDto, String userName) throws Exception { public Boolean save(AlertSubmittedDto alertSubmittedDto, String userName) throws Exception {
try { try {
Long alertSubmittedId = saveAlertSubmitted(alertSubmittedDto, userName); Map<String,String> map = saveAlertSubmitted(alertSubmittedDto, userName);
// 组装规则入参 // 组装规则入参
AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId()); AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId());
AlertCalledObjsDto alertCalledVo = new AlertCalledObjsDto(); AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
alertCalledVo.setAlertCalled(alertCalled); alertCalledVo.setAlertCalled(alertCalled);
List<AlertFormValue> alertFormValue = new ArrayList<>();
AlertFormValue formValue = new AlertFormValue();
formValue.setFieldCode("alertSubmittedId");
formValue.setFieldValue(alertSubmittedId.toString());
alertFormValue.add(formValue);
alertCalledVo.setAlertFormValue(alertFormValue);
// 调用规则 // 调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo); ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"),map.get("mobiles"));
//通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 //通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
} catch (MqttException e) { } catch (MqttException e) {
...@@ -196,29 +223,119 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -196,29 +223,119 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
/** /**
* 规则回调 * 规则回调
*/ */
public void ruleCallbackAction(String smsCode, String sendIds, Object object) throws Exception { public void ruleCallbackAction(String smsCode, List<Map<String,Object>> sendIds, Object object) throws Exception {
// 获取报送对象列表 // 获取报送对象列表
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null; String alertCalledId = null;
// 根据id列表查询所有人员信息
List<Long> ids = StringUtil.String2LongList(sendIds); List<Map<String, Object>> orgUsers = new LinkedList<>();
String sCode = "";
String alertWay = "";
if (object instanceof AlertCalledRo) { if (object instanceof AlertCalledRo) {
AlertCalledRo calledRo = (AlertCalledRo) object; AlertCalledRo calledRo = (AlertCalledRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr(); alertCalledId = calledRo.getSequenceNbr();
// 警情初报 String alertTypeCode = calledRo.getAlertTypeCode();
if (alertSubmittedId == null) { alertWay = calledRo.getAlertWay();
String unitInvolved = calledRo.getUnitInvolved();
// 警情续报 警情结案,非警情确认选择人员电话号码
String ids = calledRo.getIds();
if(!ValidationUtil.isEmpty(ids)) {
List<String> ls = Arrays.asList(ids.split(","));
ls.stream().forEach(e->mobiles.add(e));
}
// 获取报送规则
sendIds.stream().forEach(e->{
// 一般火灾 // 航空器救援
if(alertTypeCode.equals(AlertStageEnums.YBHZ.getCode()) || alertTypeCode.equals(AlertStageEnums.HKJY.getCode())) {
if(e.containsKey("onDuty")) {
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyId();
orgUsers.addAll(mapList);
}
if(e.containsKey("fireBrigade")) {
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List<FirefightersDto> fireBrigade = firefightersService.queryById(e.get("fireBrigade").toString().split(","));
fireBrigade.stream().forEach(f->{
HashMap<String,Object> map = new HashMap<>();
map.put("telephone",f.getMobilePhone());
map.put("sequenceNbr",f.getSequenceNbr());
map.put("bizOrgName",f.getName());
orgUsers.add(map);
});
}
if(e.containsKey("airportUnit")) {
// 根据人员职务:干部&领导 机场单位 模块 消防急救保障部中,“人员职务”不为空的人员
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId("消防救援部");
orgUsers.addAll(mapList);
}
// 安运部
if(e.get("type").toString().equals("AY")) {
if(e.containsKey("airportPost")) {
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId("安运部");
orgUsers.addAll(mapList);
}
}
// 事发单位
if(e.get("type").toString().equals("SF")) {
if(e.containsKey("airportPost")) {
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(unitInvolved);
orgUsers.addAll(mapList);
}
}
}
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if(alertTypeCode.equals(AlertStageEnums.HKJY.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode())
|| alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) {
if(e.containsKey("onDuty")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew("消防支队");
orgUsers.addAll(mapList);
}
}
// 120急救
if(alertTypeCode.equals(AlertStageEnums.JJJQ.getCode())) {
if (e.containsKey("onDuty")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew("急救科");
orgUsers.addAll(mapList);
}
if (e.containsKey("airportUnit")) {
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId("急救科");
orgUsers.addAll(mapList);
}
}
});
// 警情初报 续报 结案
// 1.保存警情记录主表 // 1.保存警情记录主表
AlertSubmitted alertSubmitted = new AlertSubmitted(); AlertSubmitted alertSubmitted = new AlertSubmitted();
alertSubmitted.setAlertCalledId(Long.valueOf(calledRo.getSequenceNbr())); alertSubmitted.setAlertCalledId(Long.valueOf(calledRo.getSequenceNbr()));
// 保存初报细分类型(一般火灾、航空器救援等) // 保存初报细分类型(一般火灾、航空器救援等)
alertSubmitted.setBusinessTypeCode(calledRo.getAlertTypeCode()); alertSubmitted.setBusinessTypeCode(calledRo.getAlertTypeCode());
// 名称统一为警情初报 // 警情初报 --- 续报 结案
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情初报.getName()); if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情初报.getName());
} else if(alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情续报.getName());
sCode = "SMS_JCS_XB";
} else if(alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情结案.getName());
sCode = "SMS_JCS_JA";
} else {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.非警情确认.getName());
sCode = "SMS_JCS_QR";
}
Optional<SubmissionMethodEnum> submissionMethodEnum = Optional.of(SubmissionMethodEnum.SMS); Optional<SubmissionMethodEnum> submissionMethodEnum = Optional.of(SubmissionMethodEnum.SMS);
alertSubmitted.setSubmissionMethodCode(submissionMethodEnum.get().getCode()); alertSubmitted.setSubmissionMethodCode(submissionMethodEnum.get().getCode());
alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName()); alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName());
...@@ -240,22 +357,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -240,22 +357,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class, EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
e -> e.getCode().equals(calledRo.getAlertTypeCode())); e -> e.getCode().equals(calledRo.getAlertTypeCode()));
smsCode = alertBusinessTypeEnum.get().getSms_code(); smsCode = alertBusinessTypeEnum.get().getSms_code();
}
// 组装人员信息 // 组装人员信息
List<Map<String, Object>> orgUsers = orgUsrService.selectForShowByListIdUser(ids);
for (Map<String, Object> orgUser : orgUsers) { for (Map<String, Object> orgUser : orgUsers) {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(Long.valueOf((String) orgUser.get("parentId"))); // alertSubmittedObject.setCompanyId(Long.valueOf((String) orgUser.get("parentId")));
alertSubmittedObject.setCompanyName((String) orgUser.get("parenName")); // alertSubmittedObject.setCompanyName((String) orgUser.get("parenName"));
alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr")))); alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr"))));
alertSubmittedObject.setUserName((String) orgUser.get("bizOrgName")); alertSubmittedObject.setUserName((String) orgUser.get("bizOrgName"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) { if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone")); mobiles.add((String) orgUser.get("telephone"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
...@@ -269,14 +384,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -269,14 +384,23 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives()); smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put("companyName", calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("replaceContent", calledRo.getReplaceContent());
smsParams.put("alertType", calledRo.getAlertType());
smsParams.put("feedback", calledRo.getFeedback());
} }
// 短信报送对象 // 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
if(alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
} else {
alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams);
}
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
...@@ -287,9 +411,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -287,9 +411,10 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
* @param userName 用户名 * @param userName 用户名
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) { public Map<String,String> saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) {
Long alertSubmittedId = alertSubmittedDto.getSequenceNbr(); Long alertSubmittedId = alertSubmittedDto.getSequenceNbr();
String smsCode = ""; String alertWay = "";
Map<String,String> map = new HashMap<>();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
if (alertSubmittedId == null) { if (alertSubmittedId == null) {
...@@ -337,7 +462,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -337,7 +462,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
this.baseMapper.insert(alertSubmitted); this.baseMapper.insert(alertSubmitted);
alertSubmittedId = alertSubmitted.getSequenceNbr(); alertSubmittedId = alertSubmitted.getSequenceNbr();
smsCode = businessTypeEnum.get().getSms_code();
} }
// 2.保存任务表 // 2.保存任务表
...@@ -381,6 +505,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -381,6 +505,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
alertCalledService.updateAlertCalled(alertSubmittedDto.getAlertCalledId(), alertCalledService.updateAlertCalled(alertSubmittedDto.getAlertCalledId(),
alertSubmittedDto.getBusinessTypeCode()); alertSubmittedDto.getBusinessTypeCode());
// 警情续报
if(AlertBusinessTypeEnum.警情续报.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
alertWay = AlertBusinessTypeEnum.警情续报.getCode();
}
if(AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
alertWay =AlertBusinessTypeEnum.警情结案.getCode();
}
if(AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
alertWay = AlertBusinessTypeEnum.非警情确认.getCode();
}
if (AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode()) if (AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())
|| AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) { || AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
// 查询本次警情调派的车辆 // 查询本次警情调派的车辆
...@@ -396,7 +534,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -396,7 +534,6 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
}); });
} }
//修改调派车辆任务 //修改调派车辆任务
powerTransferCompanyResourcesService.updateByAlertCalledId(alertSubmittedDto.getAlertCalledId()); powerTransferCompanyResourcesService.updateByAlertCalledId(alertSubmittedDto.getAlertCalledId());
...@@ -408,17 +545,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -408,17 +545,20 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 4.发送任务消息 // 4.发送任务消息
// 4.1组织短信内容 // 4.1组织短信内容
HashMap<String, String> smsParams = new HashMap<>(); // HashMap<String, String> smsParams = new HashMap<>();
JSONObject submitContent = alertSubmittedDto.getSubmitContent(); // JSONObject submitContent = alertSubmittedDto.getSubmitContent();
if(!"316".equals(alertSubmittedDto.getBusinessTypeCode())) { // if(!"316".equals(alertSubmittedDto.getBusinessTypeCode())) {
smsParams.put("alertType", submitContent.get("alertType").toString()); // smsParams.put("alertType", submitContent.get("alertType").toString());
smsParams.put("trappedNum", submitContent.get("trappedNum").toString()); // smsParams.put("trappedNum", submitContent.get("trappedNum").toString());
smsParams.put("companyName", submitContent.get("companyName").toString()); // smsParams.put("companyName", submitContent.get("companyName").toString());
} // }
// 4.2调用短信发送接口 // 4.2调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); // alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
return finalAlertSubmittedId;
map.put("alertWay",alertWay);
map.put("mobiles", StringUtils.join(mobiles,","));
return map;
} }
/** /**
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; 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.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -21,7 +45,12 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; ...@@ -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.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto; 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.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.AlertFeedbackStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
...@@ -29,24 +58,6 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; ...@@ -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.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.component.rule.config.RuleConfig; 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 ...@@ -93,6 +104,15 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
@Autowired @Autowired
private DutyCarServiceImpl dutyCarService; private DutyCarServiceImpl dutyCarService;
@Autowired
FireTeamServiceImpl iFireTeamService;
@Autowired
DynamicFormInstanceMapper dynamicFormInstanceMapper;
@Autowired
RuleAlertCalledService ruleAlertCalledService;
@Override @Override
public PowerTransferSimpleDto getPowerTransferList(Long alertCalledId) { public PowerTransferSimpleDto getPowerTransferList(Long alertCalledId) {
List<PowerTransferCompanyResourcesDto> powerTransferList = List<PowerTransferCompanyResourcesDto> powerTransferList =
...@@ -134,8 +154,16 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -134,8 +154,16 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
initDefinitions(definitions, alertCalled, powerTransferDto); 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 警情状态变化 //通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
...@@ -145,8 +173,29 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -145,8 +173,29 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
return true; 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) { public List<FireBrigadeResourceDto> getPowerTree(String type) {
List<FireBrigadeResourceDto> fireBrigadeResourceList = Lists.newArrayList(); List<FireBrigadeResourceDto> fireBrigadeResourceList = Lists.newArrayList();
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; 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.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
/** /**
...@@ -20,7 +30,8 @@ import com.yeejoin.amos.component.rule.RuleTrigger; ...@@ -20,7 +30,8 @@ import com.yeejoin.amos.component.rule.RuleTrigger;
* </pre> * </pre>
* *
* @author gwb * @author gwb
* @version $Id: RuleAlertCalledService.java, v 0.1 2021年6月24日 下午6:30:44 gwb Exp $ * @version $Id: RuleAlertCalledService.java, v 0.1 2021年6月24日 下午6:30:44 gwb Exp
* $
*/ */
@Service @Service
public class RuleAlertCalledService { public class RuleAlertCalledService {
...@@ -28,30 +39,35 @@ public class RuleAlertCalledService { ...@@ -28,30 +39,35 @@ public class RuleAlertCalledService {
@Autowired @Autowired
private RuleTrigger ruleTrigger; private RuleTrigger ruleTrigger;
/** @Autowired
* AlertCalledServiceImpl alertCalledServiceImpl;
* <pre>
* 触发警情报送规则 /**
* </pre> *
* * <pre>
* @param alertCalled * 触发警情报送规则
* @return * </pre>
* @throws Exception *
*/ * @return
public Boolean fireAlertCalledRule(AlertCalledObjsDto alertCalledVo) throws Exception * @throws Exception
{ */
AlertCalled alertCalled = alertCalledVo.getAlertCalled(); public Boolean fireAlertCalledRule(AlertCalledObjsDto alertCalledVo,String alertWay, String mobiles) throws Exception {
if (ValidationUtil.isEmpty(alertCalled)) AlertCalled alertCalled = alertCalledVo.getAlertCalled();
{ if (ValidationUtil.isEmpty(alertCalled)) {
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
} }
/** /**
* 构建警情报送规则对象 * 构建警情报送规则对象
*/ */
AlertCalledRo alertCalledRo = new AlertCalledRo(); AlertCalledRo alertCalledRo = new AlertCalledRo();
//通用属性 //通用属性
alertCalledRo.setSequenceNbr(String.valueOf(alertCalled.getSequenceNbr())); alertCalledRo.setSequenceNbr(String.valueOf(alertCalled.getSequenceNbr()));
alertCalledRo.setAddress(alertCalled.getAddress()); alertCalledRo.setAddress(alertCalled.getAddress());
alertCalledRo.setUnitInvolved(alertCalled.getUnitInvolved());
alertCalledRo.setContactUser(alertCalled.getContactUser());
alertCalledRo.setContactPhone(alertCalled.getContactPhone());
alertCalledRo.setAlertType(alertCalled.getAlertType()); alertCalledRo.setAlertType(alertCalled.getAlertType());
alertCalledRo.setAlertTypeCode(alertCalled.getAlertTypeCode()); alertCalledRo.setAlertTypeCode(alertCalled.getAlertTypeCode());
alertCalledRo.setCasualtiesNum(alertCalled.getCasualtiesNum() != null ? String.valueOf(alertCalled.getCasualtiesNum()) : "无"); alertCalledRo.setCasualtiesNum(alertCalled.getCasualtiesNum() != null ? String.valueOf(alertCalled.getCasualtiesNum()) : "无");
...@@ -59,50 +75,255 @@ public class RuleAlertCalledService { ...@@ -59,50 +75,255 @@ public class RuleAlertCalledService {
alertCalledRo.setCompanyName(alertCalled.getCompanyName()); alertCalledRo.setCompanyName(alertCalled.getCompanyName());
List<AlertFormValue> alertFormValues = alertCalledVo.getAlertFormValue(); List<AlertFormValue> alertFormValues = alertCalledVo.getAlertFormValue();
if (!ValidationUtil.isEmpty(alertFormValues))
{ if (!ValidationUtil.isEmpty(alertFormValues))
for (AlertFormValue alertFormValue : alertFormValues) {
{ for (AlertFormValue alertFormValue : alertFormValues)
if (alertFormValue.getFieldCode().equals("alertSubmittedId"))
{
alertCalledRo.setAlertSubmittedId(alertFormValue.getFieldValue());
}
//一般火灾
if (alertFormValue.getFieldCode().equals("fireLocation"))
{
alertCalledRo.setFireLocation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("burningMaterial"))
{
alertCalledRo.setBurningMaterial(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fireSituation"))
{
alertCalledRo.setFireSituation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("dangerousExplosives"))
{
alertCalledRo.setDangerousExplosives(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fireTime"))
{ {
alertCalledRo.setCallTimeStr(alertFormValue.getFieldValue()); if (alertFormValue.getFieldCode().equals("alertSubmittedId"))
{
alertCalledRo.setAlertSubmittedId(alertFormValue.getFieldValue());
}
//一般火灾
if (alertFormValue.getFieldCode().equals("fireLocation"))
{
alertCalledRo.setFireLocation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("burningMaterial"))
{
alertCalledRo.setBurningMaterial(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fireSituation"))
{
alertCalledRo.setFireSituation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("dangerousExplosives"))
{
alertCalledRo.setDangerousExplosives(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fireTime"))
{
alertCalledRo.setCallTimeStr(alertFormValue.getFieldValue());
}
//航空器救援
if (alertFormValue.getFieldCode().equals("flightNumber")) {
alertCalledRo.setFlightNumber(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("aircraftModel")) {
alertCalledRo.setAircraftModel(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("landingTime")) {
alertCalledRo.setLandingTime(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("developmentTrend")) {
alertCalledRo.setDevelopmentTrend(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("fuelQuantity")) {
alertCalledRo.setFuelQuantity(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("passengerCapacity")) {
alertCalledRo.setPassengerCapacity(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("damageLocation")) {
alertCalledRo.setDamageLocation(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("forcedLandingTrack")) {
alertCalledRo.setForcedLandingTrack(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("accidentSituation")) {
alertCalledRo.setAccidentSituationHkq(alertFormValue.getFieldValue());
}
//突发事件救援
if (alertFormValue.getFieldCode().equals("accidentSituation")) {
alertCalledRo.setAccidentSituation(alertFormValue.getFieldValue());
}
//漏油现场安全保障
if (alertFormValue.getFieldCode().equals("flightNumber")) {
alertCalledRo.setFlightNumberLy(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("seat")) {
alertCalledRo.setSeat(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("oilLeakageArea")) {
alertCalledRo.setOilLeakageArea(alertFormValue.getFieldValue());
}
//专机保障
if (alertFormValue.getFieldCode().equals("securityLevel")) {
alertCalledRo.setSecurityLevel(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("seat")) {
alertCalledRo.setSeatBz(alertFormValue.getFieldValue());
}
//120 急救
if (alertFormValue.getFieldCode().equals("patientStatus")) {
alertCalledRo.setPatientStatus(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("gender")) {
alertCalledRo.setGender(alertFormValue.getFieldValue());
}
if (alertFormValue.getFieldCode().equals("ageGroup")) {
alertCalledRo.setAgeGroup(alertFormValue.getFieldValue());
}
} }
//航空器救援 }
//突发事件救援 // 警情初报模板替换规则
String replaceContent = "";
//漏油现场安全保障 if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.YBHZ.getCode())) {
replaceContent = "失火位置:".concat(ValidationUtil.isEmpty(alertCalled.getAddress()) ? "无": alertCalled.getAddress()).concat(
//专机保障 ";燃烧物质:").concat(ValidationUtil.isEmpty(alertCalledRo.getFireLocation() )? "无": alertCalledRo.getFireLocation()).concat(
";火势情况:").concat(ValidationUtil.isEmpty(alertCalledRo.getFireLocation() ) ? "无" : alertCalledRo.getFireSituation());
}
} }
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.HKJY.getCode())) {
replaceContent = "航班号:".concat(ValidationUtil.isEmpty(alertCalledRo.getFlightNumber()) ? "无": alertCalledRo.getFlightNumber()).concat(
";飞机型号:").concat(ValidationUtil.isEmpty(alertCalledRo.getAircraftModel() )? "无": alertCalledRo.getAircraftModel()).concat(
";落地时间:").concat(ValidationUtil.isEmpty(alertCalledRo.getLandingTime() ) ? "无" : alertCalledRo.getLandingTime()).concat(
"发生".concat(ValidationUtil.isEmpty(alertCalledRo.getAccidentSituationHkq()) ? "无": alertCalledRo.getAccidentSituationHkq()).concat(
";飞机受损位置:").concat(ValidationUtil.isEmpty(alertCalledRo.getDamageLocation() )? "无": alertCalledRo.getDamageLocation()).concat(
";燃油量:").concat(ValidationUtil.isEmpty(alertCalledRo.getFuelQuantity() ) ? "无" : alertCalledRo.getFuelQuantity()).concat(
"载客量:".concat(ValidationUtil.isEmpty(alertCalledRo.getPassengerCapacity()) ? "无": alertCalledRo.getPassengerCapacity()).concat(
";迫降跑道:").concat(ValidationUtil.isEmpty(alertCalledRo.getForcedLandingTrack() )? "无": alertCalledRo.getForcedLandingTrack()).concat(
";发展态势:").concat(ValidationUtil.isEmpty(alertCalledRo.getDevelopmentTrend() ) ? "无" : alertCalledRo.getDevelopmentTrend())
));
}
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.TFSJ.getCode())) {
replaceContent = "发生:".concat(ValidationUtil.isEmpty(alertCalledRo.getAccidentSituation()) ? "无": alertCalledRo.getAccidentSituation().concat("事件"));
}
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.LYXC.getCode())) {
replaceContent = "航班号:".concat(ValidationUtil.isEmpty(alertCalledRo.getFlightNumberLy()) ? "无": alertCalledRo.getFlightNumberLy()).concat(
";机位:").concat(ValidationUtil.isEmpty(alertCalledRo.getSeat() )? "无": alertCalledRo.getSeat()).concat(
";漏油面积:").concat(ValidationUtil.isEmpty(alertCalledRo.getOilLeakageArea() ) ? "无" : alertCalledRo.getOilLeakageArea());
}
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.ZJBZ.getCode())) {
replaceContent = "保障等级:".concat(ValidationUtil.isEmpty(alertCalledRo.getSecurityLevel()) ? "无": alertCalledRo.getSecurityLevel()).concat(
";机位:").concat(ValidationUtil.isEmpty(alertCalledRo.getSeatBz() )? "无": alertCalledRo.getSeatBz());
}
if(alertCalled.getAlertTypeCode().equals(AlertStageEnums.JJJQ.getCode())) {
replaceContent = "患者现状:".concat(ValidationUtil.isEmpty(alertCalledRo.getPatientStatus()) ? "无": alertCalledRo.getPatientStatus()).concat(
";性别:").concat(ValidationUtil.isEmpty(alertCalledRo.getGender() )? "无": alertCalledRo.getGender()).concat(
";年龄段:").concat(ValidationUtil.isEmpty(alertCalledRo.getAgeGroup() ) ? "无" : alertCalledRo.getAgeGroup());
}
// 警情 报送类型
alertCalledRo.setAlertWay(alertWay);
alertCalledRo.setReplaceContent(replaceContent);
if(!ValidationUtil.isEmpty(mobiles)) {
alertCalledRo.setIds(mobiles);
}
//触发规则 //触发规则
ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]); ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]);
return true; return true;
} }
public boolean powerTransferCalledRule(Set<PowerTransferCompanyDto> i, Long alertCalledId, String type) throws Exception {
if (ValidationUtil.isEmpty(alertCalledId)) {
throw new BadRequest("参数校验失败.");
}
AlertCallePowerTransferRo alertCallePowerTransferRo = new AlertCallePowerTransferRo();
AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto) alertCalledServiceImpl
.selectAlertCalledByIdNoRedis(alertCalledId);
if (alertCalledFormDto == null) {
return false;
}
AlertCalled alertCalled = alertCalledFormDto.getAlertCalled();
alertCallePowerTransferRo
.setCallTimeStr(DateUtils.convertDateToString(alertCalled.getCallTime(), DateUtils.DATE_TIME_PATTERN));
alertCallePowerTransferRo.setAddress(alertCalled.getAddress());
alertCallePowerTransferRo.setAlertType(alertCalled.getAlertType());
alertCallePowerTransferRo.setAlertTypeCode(alertCalled.getAlertTypeCode());
alertCallePowerTransferRo.setCompanyName(alertCalled.getCompanyName());
alertCallePowerTransferRo.setTrappedNum(Integer.toString(alertCalled.getTrappedNum()));
alertCallePowerTransferRo.setCasualtiesNum(Integer.toString(alertCalled.getCasualtiesNum()));
alertCallePowerTransferRo.setContactPhone(alertCalled.getContactPhone());
alertCallePowerTransferRo.setContactUser(alertCalled.getContactUser());
String presentSituation =null;//性别
String gender =null;//年龄段(岁)
String ageGroup =null;//患者现状说明
String dangerousExplosives=null;//危险爆炸品
List<FormValue> alertFormValues = alertCalledFormDto.getDynamicFormAlert();
if (!ValidationUtil.isEmpty(alertFormValues)) {
for (FormValue alertFormValue : alertFormValues) {
if (alertFormValue.getKey().equals("alertSubmittedId")) {
alertCallePowerTransferRo.setAlertSubmittedId(alertFormValue.getValue());
}
// 一般火灾
if (alertFormValue.getKey().equals("fireLocation")) {
alertCallePowerTransferRo.setFireLocation(alertFormValue.getValue());
}
if (alertFormValue.getKey().equals("burningSubstancesDescription")) {
alertCallePowerTransferRo.setBurningMaterial(alertFormValue.getValue());
}
if (alertFormValue.getKey().equals("fireSituation")) {
alertCallePowerTransferRo.setFireSituation(alertFormValue.getValue());
}
if (alertFormValue.getKey().equals("dangerousExplosives")) {
alertCallePowerTransferRo.setDangerousExplosives(alertFormValue.getValue());
}
if (alertFormValue.getKey().equals("fireTime")) {
alertCallePowerTransferRo.setCallTimeStr(alertFormValue.getValue());
}
if (alertFormValue.getKey().equals("presentSituation")) {
presentSituation = alertFormValue.getValue();
}
if (alertFormValue.getKey().equals("gender")) {
gender = alertFormValue.getValue();
}
if (alertFormValue.getKey().equals("ageGroup")) {
ageGroup = alertFormValue.getValue();
}
if (alertFormValue.getKey().equals("dangerousExplosives")) {
dangerousExplosives = alertFormValue.getValue();
}
}
}
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(type)) {
alertCallePowerTransferRo.setCompany(new ArrayList<>(i));
alertCallePowerTransferRo.setPowerTransType(type);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(" 失火位置:"+alertCallePowerTransferRo.getFireLocation());
stringBuffer.append(" 燃烧物质:"+alertCallePowerTransferRo.getBurningMaterial());
stringBuffer.append(" 火势情况:"+alertCallePowerTransferRo.getFireSituation());
stringBuffer.append(" 有无危险爆炸品:"+dangerousExplosives);
alertCallePowerTransferRo.setContent(stringBuffer.toString());
} else if (FireBrigadeTypeEnum.监控大队.getKey().equals(type)) {
alertCallePowerTransferRo.setCompany(new ArrayList<>(i));
alertCallePowerTransferRo.setPowerTransType(type);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(" 失火位置:"+alertCallePowerTransferRo.getFireLocation());
stringBuffer.append(" 燃烧物质:"+alertCallePowerTransferRo.getBurningMaterial());
stringBuffer.append(" 火势情况:"+alertCallePowerTransferRo.getFireSituation());
stringBuffer.append(" 有无危险爆炸品:"+dangerousExplosives);
alertCallePowerTransferRo.setContent(stringBuffer.toString());
} else if (FireBrigadeTypeEnum.医疗救援队.getKey().equals(type)) {
alertCallePowerTransferRo.setCompany(new ArrayList<>(i));
alertCallePowerTransferRo.setPowerTransType(type);
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append(" 患者现状:"+ageGroup==null?"无":ageGroup);
stringBuffer.append(" 性别:"+presentSituation==null?"无":presentSituation);
stringBuffer.append(" 年龄段:"+gender==null?"无":gender);
alertCallePowerTransferRo.setContent(stringBuffer.toString());
}
// 触发规则
ruleTrigger.publish(alertCallePowerTransferRo, "西咸机场119接处警规则/powerTransferCalledRule", new String[0]);
return true;
}
} }
package com.yeejoin.amos.maintenance.business.feign; 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.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; 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 * @author DELL
*/ //装备 */ //装备
...@@ -53,5 +59,6 @@ public interface EquipFeignClient { ...@@ -53,5 +59,6 @@ public interface EquipFeignClient {
*/ */
@GetMapping(value = PREFIX+"/maintenanceResourceData/getFireFacilityList") @GetMapping(value = PREFIX+"/maintenanceResourceData/getFireFacilityList")
ResponseModel<List<Map<String, Object>>> overTimeMaintenanceFacility(@RequestParam String type, @RequestParam String id); ResponseModel<List<Map<String, Object>>> overTimeMaintenanceFacility(@RequestParam String type, @RequestParam String id);
} }
...@@ -188,7 +188,7 @@ public class MessageServiceImpl implements IMessageService { ...@@ -188,7 +188,7 @@ public class MessageServiceImpl implements IMessageService {
emailUser.forEach(s -> { emailUser.forEach(s -> {
for(AgencyUserModel agencyUserModel:agencyUserModelList){ for(AgencyUserModel agencyUserModel:agencyUserModelList){
if(s.getUserId().equals(agencyUserModel.getUserId())){ if(s.getUserId().equals(agencyUserModel.getUserId())){
s.setUsername(agencyUserModel.getUserName()); s.setUsername(agencyUserModel.getRealName());
s.setEmail(agencyUserModel.getEmail()); s.setEmail(agencyUserModel.getEmail());
} }
} }
......
...@@ -559,7 +559,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -559,7 +559,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
JSONObject respBody; JSONObject respBody;
Date startDate = new Date(); Date startDate = new Date();
if (latentDangerListParam.getIsHandle()) { if (latentDangerListParam.getIsHandle()) {
respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType()); respBody = remoteWorkFlowService.completedPageTask(user.getRealName(),latentDangerListParam.getBelongType());
} else { } else {
respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType()); respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType());
} }
......
...@@ -199,7 +199,7 @@ public class MessageServiceImpl implements IMessageService { ...@@ -199,7 +199,7 @@ public class MessageServiceImpl implements IMessageService {
emailUser.forEach(s -> { emailUser.forEach(s -> {
for(AgencyUserModel agencyUserModel:agencyUserModelList){ for(AgencyUserModel agencyUserModel:agencyUserModelList){
if(s.getUserId().equals(agencyUserModel.getUserId())){ if(s.getUserId().equals(agencyUserModel.getUserId())){
s.setUsername(agencyUserModel.getUserName()); s.setUsername(agencyUserModel.getRealName());
s.setEmail(agencyUserModel.getEmail()); 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; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -9,7 +8,6 @@ import com.google.common.collect.Lists; ...@@ -9,7 +8,6 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo; 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.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
...@@ -31,7 +29,6 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; ...@@ -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.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo; import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*; 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.dto.DangerDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.*; import com.yeejoin.amos.supervision.core.common.response.*;
...@@ -50,13 +47,10 @@ import org.springframework.data.domain.Page; ...@@ -50,13 +47,10 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; 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.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -106,7 +100,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -106,7 +100,7 @@ public class CheckServiceImpl implements ICheckService {
private IPlanService planService; private IPlanService planService;
@Autowired @Autowired
private AsyncTask asyncTask; private RulePlanService rulePlanService;
@Autowired @Autowired
DangerFeignClient DangerFeignClient; DangerFeignClient DangerFeignClient;
...@@ -1578,9 +1572,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1578,9 +1572,9 @@ public class CheckServiceImpl implements ICheckService {
recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus); recordParam.getPlanTaskId(), mtUserSeq, userName, size, planTaskStatus);
Plan plan = planService.queryPlanById(planTask.getPlanId()); Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,送消息 // 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){ if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成.getCode());
} }
// p_plan_task_detail更新隐患个数 // p_plan_task_detail更新隐患个数
......
...@@ -73,7 +73,7 @@ public class PlanAuditServiceImpl implements IPlanAuditService { ...@@ -73,7 +73,7 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
planAuditLog.setFlowJson(condition); planAuditLog.setFlowJson(condition);
planAuditLog.setRoleName(roleName); planAuditLog.setRoleName(roleName);
planAuditLogDao.save(planAuditLog); planAuditLogDao.save(planAuditLog);
planService.getUserIdsByWorkflow(plan, instanceId); planService.getUserIdsByWorkflow(plan, instanceId, status, planAuditLog.getExcuteState());
return Boolean.TRUE; return Boolean.TRUE;
} }
} }
......
...@@ -15,10 +15,7 @@ import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper; ...@@ -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.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam; import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.common.enums.CheckTypeSuEnum; import com.yeejoin.amos.supervision.common.enums.*;
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.core.async.AsyncTask; import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest; import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone; import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
...@@ -36,6 +33,7 @@ import org.springframework.stereotype.Service; ...@@ -36,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalAccessor;
...@@ -83,6 +81,9 @@ public class PlanServiceImpl implements IPlanService { ...@@ -83,6 +81,9 @@ public class PlanServiceImpl implements IPlanService {
private AsyncTask asyncTask; private AsyncTask asyncTask;
@Autowired @Autowired
private RulePlanService rulePlanService;
@Autowired
WorkflowFeignService workflowFeignService; WorkflowFeignService workflowFeignService;
@Autowired @Autowired
...@@ -183,7 +184,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -183,7 +184,7 @@ public class PlanServiceImpl implements IPlanService {
//更新时间 //更新时间
audit.setUpdateDate(new Date()); audit.setUpdateDate(new Date());
planAuditDao.save(audit); planAuditDao.save(audit);
this.getUserIdsByWorkflow(plan, processInstanceId); this.getUserIdsByWorkflow(plan, processInstanceId, null, null);
//记录执行流水-启动节点 //记录执行流水-启动节点
insertAuditLog(reginParams, plan, personIdentity, audit); insertAuditLog(reginParams, plan, personIdentity, audit);
} else { } else {
...@@ -198,7 +199,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -198,7 +199,7 @@ public class PlanServiceImpl implements IPlanService {
planAuditDao.save(audit); planAuditDao.save(audit);
//记录执行流水-启动节点 //记录执行流水-启动节点
insertAuditLog(reginParams, plan, personIdentity, audit); insertAuditLog(reginParams, plan, personIdentity, audit);
this.getUserIdsByWorkflow(plan, processInstanceId); this.getUserIdsByWorkflow(plan, processInstanceId,null, null);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("=============防火监督,计划提交,工作流启动失败!!!============="); log.error("=============防火监督,计划提交,工作流启动失败!!!=============");
...@@ -208,10 +209,10 @@ public class PlanServiceImpl implements IPlanService { ...@@ -208,10 +209,10 @@ public class PlanServiceImpl implements IPlanService {
} }
/** /**
* 根据工作流获取下一审核人角色下的所有用户ID * 根据工作流获取下一审核人角色下的所有用户ID =》规则推送消息
* @return * @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<>(); List<String> userIds = new ArrayList<>();
JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId); JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode()); JSONArray taskDetailArray = teskObject.getJSONArray(WorkFlowEnum.DATA.getCode());
...@@ -223,9 +224,15 @@ public class PlanServiceImpl implements IPlanService { ...@@ -223,9 +224,15 @@ public class PlanServiceImpl implements IPlanService {
JSONObject jsonItem = (JSONObject) item; JSONObject jsonItem = (JSONObject) item;
return jsonItem.getString("userId"); return jsonItem.getString("userId");
}).collect(Collectors.toList()); }).collect(Collectors.toList());
asyncTask.sendAddPlanMsg(RequestContext.cloneRequestContext(), plan, userIds, true, false); }
} else { try {
asyncTask.sendPlanMsgToLeadPeople(RequestContext.cloneRequestContext(), plan); 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; return userIds;
......
...@@ -12,11 +12,6 @@ import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper; ...@@ -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.PlanTaskMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper; 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.*;
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.CheckChkExListBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo; import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.supervision.business.feign.Business; import com.yeejoin.amos.supervision.business.feign.Business;
...@@ -34,19 +29,21 @@ import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; ...@@ -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.PlanStatusEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailIsFinishEnum; import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum; 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.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone; import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil; 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.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.quartz.IJobService; import com.yeejoin.amos.supervision.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -56,7 +53,6 @@ import org.springframework.stereotype.Service; ...@@ -56,7 +53,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException; import java.text.ParseException;
...@@ -106,7 +102,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -106,7 +102,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
private RoutePointItemMapper routePointItemMapper; private RoutePointItemMapper routePointItemMapper;
@Autowired @Autowired
private AsyncTask asyncTask; private RulePlanService rulePlanService;
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) { public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
...@@ -531,8 +527,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -531,8 +527,8 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
// 推送消息 // 规则推送消息
asyncTask.sendPlanMsg(RequestContext.cloneRequestContext(), plan); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成.getCode());
} }
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); 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; package com.yeejoin.amos.supervision.business.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; 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.business.param.MsgInfoPageParam;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest; import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
...@@ -40,4 +44,11 @@ public class MsgParamUtils { ...@@ -40,4 +44,11 @@ public class MsgParamUtils {
return value.toString(); 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 { ...@@ -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) { private Set<String> userIdFilter(Set<String> sendUserIds, String msgType) {
Set<String> afterFilterUserIds = Sets.newHashSet(); Set<String> afterFilterUserIds = Sets.newHashSet();
if (CollectionUtils.isEmpty(sendUserIds)) { if (CollectionUtils.isEmpty(sendUserIds)) {
......
...@@ -752,36 +752,6 @@ public class RemoteSecurityService { ...@@ -752,36 +752,6 @@ public class RemoteSecurityService {
return handleArray(feignClientResult, DepartmentModel.class); 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) { private <T> List<T> handleArray(FeignClientResult feignClientResult, Class<T> t) {
List<T> list = new ArrayList<>(); List<T> list = new ArrayList<>();
if (feignClientResult != null && feignClientResult.getStatus() == 200) { 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.servlet.context-path=/ccs
server.port=8807 server.port=8807
spring.profiles.active=dev spring.profiles.active=dev
......
...@@ -10,7 +10,7 @@ Target Server Type : MYSQL ...@@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 80018 Target Server Version : 80018
File Encoding : 65001 File Encoding : 65001
Date: 2021-11-09 18:01:08 Date: 2021-11-12 11:20:29
*/ */
SET FOREIGN_KEY_CHECKS=0; SET FOREIGN_KEY_CHECKS=0;
...@@ -26,7 +26,7 @@ CREATE TABLE `asf_fire_alarm_day_statistics` ( ...@@ -26,7 +26,7 @@ CREATE TABLE `asf_fire_alarm_day_statistics` (
`collect_date` date DEFAULT NULL COMMENT '统计日期', `collect_date` date DEFAULT NULL COMMENT '统计日期',
`equipment_definition_mrid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '装备定义mrid', `equipment_definition_mrid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '装备定义mrid',
`equipment_definition_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '装备定义名称', `equipment_definition_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '装备定义名称',
`alarm_times` int(11) DEFAULT '0' COMMENT '报警次数', `alarm_times` int(11) DEFAULT '1' COMMENT '报警次数',
`alarm_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '告警类型', `alarm_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '告警类型',
`alarm_type_name` varchar(255) DEFAULT NULL COMMENT '告警类型名称', `alarm_type_name` varchar(255) DEFAULT NULL COMMENT '告警类型名称',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期', `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
...@@ -36,6 +36,12 @@ CREATE TABLE `asf_fire_alarm_day_statistics` ( ...@@ -36,6 +36,12 @@ CREATE TABLE `asf_fire_alarm_day_statistics` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='换流站告警日统计'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='换流站告警日统计';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_alarm_day_statistics
-- ----------------------------
INSERT INTO `asf_fire_alarm_day_statistics` VALUES ('1', '101', '复龙换流站', '2021-11-11', '1', null, '2', null, null, '2021-11-10 11:59:25', '2021-11-11 16:22:28');
INSERT INTO `asf_fire_alarm_day_statistics` VALUES ('2', '102', '金华换流站', '2021-11-11', '1', null, '1', null, null, '2021-11-10 11:59:25', '2021-11-11 15:44:31');
-- ----------------------------
-- Table structure for asf_fire_danger_day_statistics -- Table structure for asf_fire_danger_day_statistics
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_danger_day_statistics`; DROP TABLE IF EXISTS `asf_fire_danger_day_statistics`;
...@@ -44,7 +50,7 @@ CREATE TABLE `asf_fire_danger_day_statistics` ( ...@@ -44,7 +50,7 @@ CREATE TABLE `asf_fire_danger_day_statistics` (
`station_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '站点编码', `station_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '站点编码',
`station_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '站点名称', `station_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '站点名称',
`collect_date` date NOT NULL COMMENT '统计日期', `collect_date` date NOT NULL COMMENT '统计日期',
`danger_times` int(11) DEFAULT '0' COMMENT '报警次数', `danger_times` int(11) DEFAULT '1' COMMENT '报警次数',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期', `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
`syn_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '同步日期', `syn_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '同步日期',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
...@@ -52,6 +58,11 @@ CREATE TABLE `asf_fire_danger_day_statistics` ( ...@@ -52,6 +58,11 @@ CREATE TABLE `asf_fire_danger_day_statistics` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='换流站隐患日统计'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='换流站隐患日统计';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_danger_day_statistics
-- ----------------------------
INSERT INTO `asf_fire_danger_day_statistics` VALUES ('1', '101', '复龙换流站', '2021-11-11', '2', '2021-11-11 17:06:27', '2021-11-11 17:06:27');
-- ----------------------------
-- Table structure for asf_fire_equipment_alarm -- Table structure for asf_fire_equipment_alarm
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_equipment_alarm`; DROP TABLE IF EXISTS `asf_fire_equipment_alarm`;
...@@ -90,6 +101,10 @@ CREATE TABLE `asf_fire_equipment_alarm` ( ...@@ -90,6 +101,10 @@ CREATE TABLE `asf_fire_equipment_alarm` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='设备报警信息表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='设备报警信息表';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_equipment_alarm
-- ----------------------------
-- ----------------------------
-- Table structure for asf_fire_equipment_alarm_log -- Table structure for asf_fire_equipment_alarm_log
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_equipment_alarm_log`; DROP TABLE IF EXISTS `asf_fire_equipment_alarm_log`;
...@@ -103,11 +118,13 @@ CREATE TABLE `asf_fire_equipment_alarm_log` ( ...@@ -103,11 +118,13 @@ CREATE TABLE `asf_fire_equipment_alarm_log` (
`fire_equipment_index_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '指标编码', `fire_equipment_index_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '指标编码',
`fire_equipment_index_value` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报警值', `fire_equipment_index_value` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报警值',
`fire_building_mrid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '建筑id(冗余字段)', `fire_building_mrid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '建筑id(冗余字段)',
`type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)', `alarm_type` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)',
`alarm_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '告警类型名称',
`confirm_type` varchar(100) DEFAULT NULL COMMENT '确认类型', `confirm_type` varchar(100) DEFAULT NULL COMMENT '确认类型',
`confirm_type_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '确认类型名称', `confirm_type_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '确认类型名称',
`alarm_reason` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报警原因', `alarm_reason` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '报警原因',
`resolve_result` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '处理情况', `resolve_result` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '处理情况',
`confirm_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '确认状态: 0-未确认 1-已确认',
`confirm_user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '确警人员姓名', `confirm_user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '确警人员姓名',
`confirm_date` datetime DEFAULT NULL COMMENT '确警时间', `confirm_date` datetime DEFAULT NULL COMMENT '确警时间',
`system_mrids` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '装备所属消防系统code(冗余字段)', `system_mrids` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '装备所属消防系统code(冗余字段)',
...@@ -124,6 +141,14 @@ CREATE TABLE `asf_fire_equipment_alarm_log` ( ...@@ -124,6 +141,14 @@ CREATE TABLE `asf_fire_equipment_alarm_log` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报警信息日志表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='设备报警信息日志表';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_equipment_alarm_log
-- ----------------------------
INSERT INTO `asf_fire_equipment_alarm_log` VALUES ('1', '换流站1', '101', '101', '感温', '故障', 'FAS_SmokeAlarm_Fault', 'true', '101', 'FIREALARM', '故障告警', null, null, null, null, '0', null, null, null, null, null, '2021-11-09 11:40:28', '极Ⅰ辅控楼-极1辅控楼二层-火灾报警装置_极1辅控楼二层走道N002L01D011烟感火警状态', null, null, '2021-11-10 15:42:21');
INSERT INTO `asf_fire_equipment_alarm_log` VALUES ('2', '换流站1', '101', '101', '感温', '故障', 'FAS_SmokeAlarm_Fault', 'true', '101', 'FIREALARM', '故障告警', null, null, null, null, '1', null, null, null, null, null, '2021-11-10 11:40:28', '极Ⅰ辅控楼-极1辅控楼二层-火灾报警装置_极1辅控楼二层走道N002L01D011烟感火警状态', null, null, '2021-11-10 15:42:21');
INSERT INTO `asf_fire_equipment_alarm_log` VALUES ('3', '换流站1', '101', '101', '感温', '故障', 'FAS_SmokeAlarm_Fault', 'true', '101', 'FIREALARM', '故障告警', null, null, null, null, '0', null, null, null, null, null, '2021-11-10 11:40:28', '极Ⅰ辅控楼-极1辅控楼二层-火灾报警装置_极1辅控楼二层走道N002L01D011烟感火警状态', null, null, '2021-11-10 15:42:21');
INSERT INTO `asf_fire_equipment_alarm_log` VALUES ('4', '换流站1', '101', '101', '感温', '故障', 'FAS_SmokeAlarm_Fault', 'true', '101', 'FIREALARM', '故障告警', null, null, null, null, '0', null, null, null, null, null, '2021-11-10 11:40:28', '主控楼-主控楼一层-火灾报警装置_极2低端阀组辅助设备室N001L01D001烟感火警状态', null, null, '2021-11-10 15:42:22');
-- ----------------------------
-- Table structure for asf_fire_fmea_statistics -- Table structure for asf_fire_fmea_statistics
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_fmea_statistics`; DROP TABLE IF EXISTS `asf_fire_fmea_statistics`;
...@@ -142,6 +167,10 @@ CREATE TABLE `asf_fire_fmea_statistics` ( ...@@ -142,6 +167,10 @@ CREATE TABLE `asf_fire_fmea_statistics` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='发生率/严重度矩阵统计表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='发生率/严重度矩阵统计表';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_fmea_statistics
-- ----------------------------
-- ----------------------------
-- Table structure for asf_fire_latent_danger -- Table structure for asf_fire_latent_danger
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_latent_danger`; DROP TABLE IF EXISTS `asf_fire_latent_danger`;
...@@ -151,11 +180,12 @@ CREATE TABLE `asf_fire_latent_danger` ( ...@@ -151,11 +180,12 @@ CREATE TABLE `asf_fire_latent_danger` (
`station_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '站点名称', `station_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '站点名称',
`danger_mrid` varchar(32) NOT NULL COMMENT '风险点id', `danger_mrid` varchar(32) NOT NULL COMMENT '风险点id',
`danger_name` varchar(255) DEFAULT NULL COMMENT '风险点名称', `danger_name` varchar(255) DEFAULT NULL COMMENT '风险点名称',
`danger_state_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '隐患状态:隐患状态(1:待评审;2:待治理;3:安措计划中;4:待验证;5:治理完毕;6:已撤销;7:延期治理中;8:延期治理待车间部门审核;9:延期治理待公司审核''', `danger_state` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '隐患状态:隐患状态(1:待评审;2:待治理;3:安措计划中;4:待验证;5:治理完毕;6:已撤销;7:延期治理中;8:延期治理待车间部门审核;9:延期治理待公司审核''',
`danger_state_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '隐患状态名称', `danger_state_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '隐患状态名称',
`danger_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '隐患类型枚举(1:无码无计划隐患;2:巡检隐患;3:有码无计划隐患;4:随手拍)', `danger_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT '' COMMENT '隐患类型枚举(1:无码无计划隐患;2:巡检隐患;3:有码无计划隐患;4:随手拍)',
`danger_type_name` varchar(255) DEFAULT NULL COMMENT '隐患类型名称', `danger_type_name` varchar(255) DEFAULT NULL COMMENT '隐患类型名称',
`danger_level` varchar(20) DEFAULT NULL COMMENT '隐患等级(1:一般隐患;2:重大隐患) ', `danger_level` varchar(20) DEFAULT NULL COMMENT '隐患等级(1:一般隐患;2:重大隐患) ',
`danger_level_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '隐患等级名称',
`discovery_date` datetime DEFAULT NULL COMMENT '隐患提交时间', `discovery_date` datetime DEFAULT NULL COMMENT '隐患提交时间',
`deal_state` tinyint(4) NOT NULL COMMENT '处理状态:1-未完成;2-已完成', `deal_state` tinyint(4) NOT NULL COMMENT '处理状态:1-未完成;2-已完成',
`deal_date` datetime DEFAULT NULL COMMENT '治理日期', `deal_date` datetime DEFAULT NULL COMMENT '治理日期',
...@@ -168,6 +198,21 @@ CREATE TABLE `asf_fire_latent_danger` ( ...@@ -168,6 +198,21 @@ CREATE TABLE `asf_fire_latent_danger` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='隐患信息'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='隐患信息';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_latent_danger
-- ----------------------------
INSERT INTO `asf_fire_latent_danger` VALUES ('101', '101', '换流站1', '10101', '隐患1', '1', '待评审', '2', '巡检隐患', '1', '一般隐患', '2021-11-10 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 10:08:26');
INSERT INTO `asf_fire_latent_danger` VALUES ('102', '102', '换流站2', '10102', '隐患1', '2', '待治理', '2', '巡检隐患', '1', '一般隐患', '2021-11-09 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 17:29:26');
INSERT INTO `asf_fire_latent_danger` VALUES ('103', '101', '换流站1', '10103', '隐患1', '4', '待验证', '2', '巡检隐患', '1', '一般隐患', '2021-11-04 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 17:31:36');
INSERT INTO `asf_fire_latent_danger` VALUES ('104', '101', '换流站1', '10104', '隐患1', '5', '治理完毕', '2', '巡检隐患', '1', '一般隐患', '2021-11-09 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 17:31:44');
INSERT INTO `asf_fire_latent_danger` VALUES ('105', '101', '换流站1', '10105', '隐患1', '6', '已撤销', '2', '巡检隐患', '1', '一般隐患', '2021-11-08 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 17:32:00');
INSERT INTO `asf_fire_latent_danger` VALUES ('106', '101', '换流站1', '10106', '隐患1', '7', '延期治理中', '2', '巡检隐患', '1', '一般隐患', '2021-11-07 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 17:32:14');
INSERT INTO `asf_fire_latent_danger` VALUES ('107', '101', '换流站1', '10107', '隐患1', '2', '待治理', '2', '巡检隐患', '1', '一般隐患', '2021-11-06 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 17:33:30');
INSERT INTO `asf_fire_latent_danger` VALUES ('108', '101', '换流站1', '10108', '隐患1', '1', '待评审', '2', '巡检隐患', '1', '一般隐患', '2021-11-04 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 10:08:53');
INSERT INTO `asf_fire_latent_danger` VALUES ('109', '101', '换流站1', '10109', '隐患1', '1', '待评审', '2', '巡检隐患', '1', '一般隐患', '2021-11-02 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 10:08:55');
INSERT INTO `asf_fire_latent_danger` VALUES ('110', '101', '换流站1', '10110', '隐患1', '1', '待评审', '2', '巡检隐患', '1', '一般隐患', '2021-11-01 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 10:08:57');
INSERT INTO `asf_fire_latent_danger` VALUES ('111', '101', '换流站1', '10111', '隐患1', '1', '待评审', '2', '巡检隐患', '1', '一般隐患', '2021-11-05 11:06:42', '1', null, '2021-11-10 11:06:47', null, null, '2021-11-11 10:09:01');
-- ----------------------------
-- Table structure for asf_fire_risk_source -- Table structure for asf_fire_risk_source
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_risk_source`; DROP TABLE IF EXISTS `asf_fire_risk_source`;
...@@ -193,6 +238,10 @@ CREATE TABLE `asf_fire_risk_source` ( ...@@ -193,6 +238,10 @@ CREATE TABLE `asf_fire_risk_source` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='风险点表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='风险点表';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_risk_source
-- ----------------------------
-- ----------------------------
-- Table structure for asf_fire_rpn_change_log -- Table structure for asf_fire_rpn_change_log
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_rpn_change_log`; DROP TABLE IF EXISTS `asf_fire_rpn_change_log`;
...@@ -213,6 +262,10 @@ CREATE TABLE `asf_fire_rpn_change_log` ( ...@@ -213,6 +262,10 @@ CREATE TABLE `asf_fire_rpn_change_log` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='风险点变化流水'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='风险点变化流水';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_rpn_change_log
-- ----------------------------
-- ----------------------------
-- Table structure for asf_fire_station_info -- Table structure for asf_fire_station_info
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `asf_fire_station_info`; DROP TABLE IF EXISTS `asf_fire_station_info`;
...@@ -224,6 +277,7 @@ CREATE TABLE `asf_fire_station_info` ( ...@@ -224,6 +277,7 @@ CREATE TABLE `asf_fire_station_info` (
`use_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用途类型', `use_type_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '用途类型',
`safety_index` decimal(4,1) DEFAULT NULL COMMENT '安全指数', `safety_index` decimal(4,1) DEFAULT NULL COMMENT '安全指数',
`safety_status` tinyint(4) DEFAULT NULL COMMENT '安全状态:1-重大风险、2-较大风险、3-一般风险、4-低风险', `safety_status` tinyint(4) DEFAULT NULL COMMENT '安全状态:1-重大风险、2-较大风险、3-一般风险、4-低风险',
`safety_status_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '安全状态名称',
`safety_status_color` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '状态对应颜色', `safety_status_color` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '状态对应颜色',
`status` bit(1) NOT NULL DEFAULT b'0' COMMENT '0-启用;1-停用', `status` bit(1) NOT NULL DEFAULT b'0' COMMENT '0-启用;1-停用',
`position` varchar(255) DEFAULT NULL COMMENT '位置描述', `position` varchar(255) DEFAULT NULL COMMENT '位置描述',
...@@ -235,13 +289,29 @@ CREATE TABLE `asf_fire_station_info` ( ...@@ -235,13 +289,29 @@ CREATE TABLE `asf_fire_station_info` (
`safety_person_phone` varchar(20) DEFAULT NULL COMMENT '安全负责人联系电话', `safety_person_phone` varchar(20) DEFAULT NULL COMMENT '安全负责人联系电话',
`create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期', `create_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建日期',
`syn_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '同步日期', `syn_date` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '同步日期',
`fire_captain_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '驻站消防队队长电话',
`fire_captain_person` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '驻站消防队队长名称', `fire_captain_person` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '驻站消防队队长名称',
`fire_captain_phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '驻站消防队队长电话',
PRIMARY KEY (`id`) USING BTREE, PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uniq_code` (`code`) USING BTREE UNIQUE KEY `uniq_code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='站端信息表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='站端信息表';
-- ---------------------------- -- ----------------------------
-- Records of asf_fire_station_info
-- ----------------------------
INSERT INTO `asf_fire_station_info` VALUES ('1', '复龙换流站', '101', '输电', '公用换流变电站', '90.1', '3', '一般风险', 'yellow', '\0', null, '104.414832500', '28.5443453333', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 16:15:46', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('10', '中州换流站', '110', '输电', '公用换流变电站', '92.8', '3', '一般风险', 'blue', '\0', null, '113.625351', '34.746303', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:36:49', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('11', '龙泉换流站', '111', '输电', '公用换流变电站', '90.1', '3', '一般风险', 'yellow', '\0', null, '119.14126', '28.074916', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:37:42', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('12', '政平换流站', '112', '输电', '公用换流变电站', '90.1', '3', '一般风险', 'yellow', '\0', null, '117.419823', '25.290481', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:38:14', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('2', '金华换流站', '102', '输电', '公用换流变电站', '30.0', '1', '重大风险', 'red', '\0', null, '119.647265', '29.079195', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:38:39', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('3', '锦屏换流站', '103', '输电', '公用换流变电站', '85.0', '2', '较大风险', 'orange', '\0', null, '116.042546', '39.878325', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:39:09', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('4', '苏州换流站', '104', '输电', '公用换流变电站', '96.0', '4', '较低风险', 'blue', '\0', null, '120.585294', '31.299758', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:39:31', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('5', '灵州换流站', '105', '输电', '公用换流变电站', '90.1', '3', '一般风险', 'blue', '\0', null, '114.990321', '38.516746', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:39:52', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('6', '绍兴换流站', '106', '输电', '公用换流变电站', '92.3', '3', '一般风险', 'blue', '\0', null, '120.22120', '29.94020', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-12 09:40:44', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('7', '祁连换流站', '107', '输电', '公用换流变电站', '91.6', '3', '一般风险', 'blue', '\0', null, '121.614786', '38.913962', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:40:35', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('8', '韶山换流站', '108', '输电', '公用换流变电站', '92.8', '3', '一般风险', 'blue', '\0', null, '112.525364', '27.914796', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:58:02', '队长', '177936945612');
INSERT INTO `asf_fire_station_info` VALUES ('9', '天山换流站', '109', '输电', '公用换流变电站', '92.8', '3', '一般风险', 'blue', '\0', null, '116.111818', '40.003718', '张三风', '17792961611', '姚明', '17792961621', '2021-11-10 10:37:18', '2021-11-10 15:41:25', '队长', '177936945612');
-- ----------------------------
-- Table structure for ast_fire_building -- Table structure for ast_fire_building
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_building`; DROP TABLE IF EXISTS `ast_fire_building`;
...@@ -253,7 +323,9 @@ CREATE TABLE `ast_fire_building` ( ...@@ -253,7 +323,9 @@ CREATE TABLE `ast_fire_building` (
`name` varchar(255) DEFAULT NULL COMMENT '名称', `name` varchar(255) DEFAULT NULL COMMENT '名称',
`classify` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '建筑类别', `classify` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '建筑类别',
`floor_number` varchar(32) DEFAULT NULL COMMENT '楼层数量', `floor_number` varchar(32) DEFAULT NULL COMMENT '楼层数量',
`equipment_number` int(11) DEFAULT NULL COMMENT '包含装备数量',
`parent_mrid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级mrid', `parent_mrid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '父级mrid',
`tree_mrids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci COMMENT '树形mrids,包括自己,冗余用于树形查询',
`type` varchar(20) DEFAULT NULL COMMENT '类型(建筑、楼层、房间)', `type` varchar(20) DEFAULT NULL COMMENT '类型(建筑、楼层、房间)',
`photo_url` text COMMENT '建筑图片', `photo_url` text COMMENT '建筑图片',
`lng` varchar(20) DEFAULT NULL COMMENT '经度', `lng` varchar(20) DEFAULT NULL COMMENT '经度',
...@@ -265,6 +337,21 @@ CREATE TABLE `ast_fire_building` ( ...@@ -265,6 +337,21 @@ CREATE TABLE `ast_fire_building` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防建筑表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防建筑表';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_building
-- ----------------------------
INSERT INTO `ast_fire_building` VALUES ('12101', '101', '复龙换流站', '1301', '建筑1', '高层厂房', '5', '1805', '0', '1301', 'building', null, '104.414832500', '28.5443453333', '2021-11-08 10:34:03', '2021-11-11 14:58:25');
INSERT INTO `ast_fire_building` VALUES ('12102', '101', '复龙换流站', '1302', '建筑2', '高层厂房', '6', '1806', '0', '1302', 'building', null, '113.625351', '34.746303', '2021-11-10 10:34:03', '2021-11-11 14:58:29');
INSERT INTO `ast_fire_building` VALUES ('12103', '101', '复龙换流站', '1303', '建筑3', '高层厂房', '7', '1807', '0', '1303', 'building', null, '119.14126', '28.074916', '2021-11-10 10:34:03', '2021-11-11 14:58:33');
INSERT INTO `ast_fire_building` VALUES ('12104', '101', '复龙换流站', '130101', '楼层1', '高层厂房', '0', '1800', '1301', '1301,130101', 'floor', null, '117.419823', '25.290481', '2021-11-05 10:34:03', '2021-11-11 11:14:55');
INSERT INTO `ast_fire_building` VALUES ('12105', '101', '复龙换流站', '130102', '楼层2', '高层厂房', '0', '1800', '1301', '1301,130102', 'floor', null, '119.647265', '29.079195', '2021-11-09 10:34:03', '2021-11-11 11:14:58');
INSERT INTO `ast_fire_building` VALUES ('12106', '101', '复龙换流站', '13010101', '房间1', '高层厂房', '0', '1800', '130101', '1301,130101,13010101', 'room', null, '116.042546', '39.878325', '2021-11-05 10:34:03', '2021-11-11 11:15:01');
INSERT INTO `ast_fire_building` VALUES ('12107', '101', '复龙换流站', '13010201', '房间1', '高层厂房', '0', '1800', '130102', '1301,130102,13010201', 'room', null, '120.585294', '31.299758', '2021-11-01 10:34:03', '2021-11-11 11:15:06');
INSERT INTO `ast_fire_building` VALUES ('12108', '101', '复龙换流站', '130201', '房间1', '高层厂房', '0', '1800', '1302', '1302,130201', 'room', null, '114.990321', '38.516746', '2021-11-04 10:34:03', '2021-11-11 11:15:11');
INSERT INTO `ast_fire_building` VALUES ('12109', '101', '复龙换流站', '130301', '楼层1', '高层厂房', '0', '1800', '1303', '1303,130301', 'floor', null, '120.582886', '30.051549', '2021-11-05 10:34:03', '2021-11-11 11:15:16');
INSERT INTO `ast_fire_building` VALUES ('12110', '101', '复龙换流站', '13030101', '房间1', '高层厂房', '0', '1800', '130301', '1303,130301,13030101', 'room', null, '121.614786', '38.913962', '2021-11-05 10:34:03', '2021-11-11 11:15:19');
INSERT INTO `ast_fire_building` VALUES ('12111', '101', '复龙换流站', '13030102', '房间2', '高层厂房', '0', '1800', '130301', '1303,130301,13030102', 'room', null, '112.525364', '27.914796', '2021-10-28 10:34:03', '2021-11-11 11:15:25');
-- ----------------------------
-- Table structure for ast_fire_equipment -- Table structure for ast_fire_equipment
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_equipment`; DROP TABLE IF EXISTS `ast_fire_equipment`;
...@@ -299,6 +386,10 @@ CREATE TABLE `ast_fire_equipment` ( ...@@ -299,6 +386,10 @@ CREATE TABLE `ast_fire_equipment` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防设备资产'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防设备资产';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_equipment
-- ----------------------------
-- ----------------------------
-- Table structure for ast_fire_equipment_info -- Table structure for ast_fire_equipment_info
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_equipment_info`; DROP TABLE IF EXISTS `ast_fire_equipment_info`;
...@@ -320,6 +411,10 @@ CREATE TABLE `ast_fire_equipment_info` ( ...@@ -320,6 +411,10 @@ CREATE TABLE `ast_fire_equipment_info` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防资产参数信息'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防资产参数信息';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_equipment_info
-- ----------------------------
-- ----------------------------
-- Table structure for ast_fire_fighting_system -- Table structure for ast_fire_fighting_system
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_fighting_system`; DROP TABLE IF EXISTS `ast_fire_fighting_system`;
...@@ -347,6 +442,10 @@ CREATE TABLE `ast_fire_fighting_system` ( ...@@ -347,6 +442,10 @@ CREATE TABLE `ast_fire_fighting_system` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防系统信息'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防系统信息';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_fighting_system
-- ----------------------------
-- ----------------------------
-- Table structure for ast_fire_vehicle -- Table structure for ast_fire_vehicle
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_vehicle`; DROP TABLE IF EXISTS `ast_fire_vehicle`;
...@@ -382,6 +481,21 @@ CREATE TABLE `ast_fire_vehicle` ( ...@@ -382,6 +481,21 @@ CREATE TABLE `ast_fire_vehicle` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防车辆信息'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防车辆信息';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_vehicle
-- ----------------------------
INSERT INTO `ast_fire_vehicle` VALUES ('108', '10801', '复龙换流站', '101', '车辆1', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:39:56', null, null, '2021-11-11 11:39:56');
INSERT INTO `ast_fire_vehicle` VALUES ('10801', '10802', '复龙换流站', '101', '车辆2', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:42:44', null, null, '2021-11-11 11:42:44');
INSERT INTO `ast_fire_vehicle` VALUES ('10803', '10803', '复龙换流站', '101', '车辆3', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:42:47', null, null, '2021-11-11 11:42:47');
INSERT INTO `ast_fire_vehicle` VALUES ('10804', '10804', '复龙换流站', '101', '车辆4', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:42:49', null, null, '2021-11-11 11:42:49');
INSERT INTO `ast_fire_vehicle` VALUES ('10805', '10805', '复龙换流站', '101', '车辆5', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:42:51', null, null, '2021-11-11 11:42:51');
INSERT INTO `ast_fire_vehicle` VALUES ('10806', '10806', '复龙换流站', '101', '车辆6', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:42:53', null, null, '2021-11-11 11:42:53');
INSERT INTO `ast_fire_vehicle` VALUES ('10807', '10807', '复龙换流站', '101', '车辆7', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:42:57', null, null, '2021-11-11 11:42:57');
INSERT INTO `ast_fire_vehicle` VALUES ('10808', '10808', '复龙换流站', '101', '车辆8', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:43:01', null, null, '2021-11-11 11:43:01');
INSERT INTO `ast_fire_vehicle` VALUES ('10809', '10809', '复龙换流站', '101', '车辆9', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:43:04', null, null, '2021-11-11 11:43:04');
INSERT INTO `ast_fire_vehicle` VALUES ('10810', '10810', '复龙换流站', '101', '车辆10', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:43:08', null, null, '2021-11-11 11:43:08');
INSERT INTO `ast_fire_vehicle` VALUES ('10811', '10811', '复龙换流站', '101', '车辆1', '陕99999', '泡沫消防车', null, null, null, null, null, null, null, '', '启动', '2021-11-11 11:39:48', null, null, null, null, null, '2021-11-11 11:39:56', null, null, '2021-11-11 11:39:56');
-- ----------------------------
-- Table structure for ast_fire_vehicle_info -- Table structure for ast_fire_vehicle_info
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_vehicle_info`; DROP TABLE IF EXISTS `ast_fire_vehicle_info`;
...@@ -403,6 +517,10 @@ CREATE TABLE `ast_fire_vehicle_info` ( ...@@ -403,6 +517,10 @@ CREATE TABLE `ast_fire_vehicle_info` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防资产参数信息'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防资产参数信息';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_vehicle_info
-- ----------------------------
-- ----------------------------
-- Table structure for ast_fire_video -- Table structure for ast_fire_video
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_video`; DROP TABLE IF EXISTS `ast_fire_video`;
...@@ -427,6 +545,21 @@ CREATE TABLE `ast_fire_video` ( ...@@ -427,6 +545,21 @@ CREATE TABLE `ast_fire_video` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防视频表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防视频表';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_video
-- ----------------------------
INSERT INTO `ast_fire_video` VALUES ('10901', '101', '复龙换流站', '10901', '摄像头1', '枪机', '墙角', null, '1301', '建筑1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:37');
INSERT INTO `ast_fire_video` VALUES ('10902', '101', '复龙换流站', '10902', '摄像头2', '枪机', '墙角', null, '1302', '建筑2', null, null, null, '2021-11-12 11:50:13', '2021-11-11 14:44:22');
INSERT INTO `ast_fire_video` VALUES ('10903', '101', '复龙换流站', '10903', '摄像头3', '枪机', '墙角', null, '1303', '建筑3', null, null, null, '2021-11-13 11:50:13', '2021-11-11 14:44:26');
INSERT INTO `ast_fire_video` VALUES ('10904', '101', '复龙换流站', '10904', '摄像头4', '枪机', '墙角', null, '130101', '楼层1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 11:52:26');
INSERT INTO `ast_fire_video` VALUES ('10905', '101', '复龙换流站', '10905', '摄像头5', '枪机', '墙角', null, '130102', '楼层2', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:37');
INSERT INTO `ast_fire_video` VALUES ('10906', '101', '复龙换流站', '10906', '摄像头6', '枪机', '墙角', null, '13010101', '房间1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:37');
INSERT INTO `ast_fire_video` VALUES ('10907', '101', '复龙换流站', '10907', '摄像头7', '枪机', '墙角', null, '13010201', '房间1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:37');
INSERT INTO `ast_fire_video` VALUES ('10908', '101', '复龙换流站', '10908', '摄像头8', '枪机', '墙角', null, '130201', '房间1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:37');
INSERT INTO `ast_fire_video` VALUES ('10909', '101', '复龙换流站', '10909', '摄像头9', '枪机', '墙角', null, '130301', '楼层1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:20');
INSERT INTO `ast_fire_video` VALUES ('10910', '101', '复龙换流站', '10910', '摄像头10', '枪机', '墙角', null, '13030101', '房间1', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:37');
INSERT INTO `ast_fire_video` VALUES ('10911', '101', '复龙换流站', '10911', '摄像头11', '枪机', '墙角', null, '13030102', '房间2', null, null, null, '2021-11-11 11:50:13', '2021-11-11 13:43:38');
-- ----------------------------
-- Table structure for ast_fire_water -- Table structure for ast_fire_water
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `ast_fire_water`; DROP TABLE IF EXISTS `ast_fire_water`;
...@@ -451,6 +584,21 @@ CREATE TABLE `ast_fire_water` ( ...@@ -451,6 +584,21 @@ CREATE TABLE `ast_fire_water` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防水源表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='消防水源表';
-- ---------------------------- -- ----------------------------
-- Records of ast_fire_water
-- ----------------------------
INSERT INTO `ast_fire_water` VALUES ('101', '101', '复龙换流站', '10701', '消防水池1', '高层厂房', '消防水池', '10.2', '苏慧光', '17792961611', null, '104.414832500', '28.5443453333', '2021-11-11 11:26:10', '2021-11-11 11:29:25');
INSERT INTO `ast_fire_water` VALUES ('102', '101', '复龙换流站', '10702', '消防栓1', '高层厂房', '消防栓', '10.2', '苏慧光', '17792961611', null, '113.625351', '34.746303', '2021-11-11 11:26:10', '2021-11-11 11:29:30');
INSERT INTO `ast_fire_water` VALUES ('103', '101', '复龙换流站', '10703', '消防栓2', '高层厂房', '消防栓', '10.2', '苏慧光', '17792961611', null, '119.14126', '28.074916', '2021-11-11 11:26:10', '2021-11-11 11:29:30');
INSERT INTO `ast_fire_water` VALUES ('104', '101', '复龙换流站', '10704', '消防栓3', '高层厂房', '消防栓', '10.2', '苏慧光', '17792961611', null, '117.419823', '25.290481', '2021-11-11 11:26:10', '2021-11-11 11:29:30');
INSERT INTO `ast_fire_water` VALUES ('105', '101', '复龙换流站', '10705', '消防水鹤1', '高层厂房', '消防水鹤', '10.2', '苏慧光', '17792961611', null, '119.647265', '29.079195', '2021-11-11 11:26:10', '2021-11-11 11:29:30');
INSERT INTO `ast_fire_water` VALUES ('106', '101', '复龙换流站', '10706', '消防水鹤2', '高层厂房', '消防水鹤', '10.2', '苏慧光', '17792961611', null, '116.042546', '39.878325', '2021-11-11 11:26:10', '2021-11-11 11:29:31');
INSERT INTO `ast_fire_water` VALUES ('107', '101', '复龙换流站', '10707', '消防水鹤3', '高层厂房', '消防水鹤', '10.2', '苏慧光', '17792961611', null, '120.585294', '31.299758', '2021-11-11 11:26:10', '2021-11-11 11:29:31');
INSERT INTO `ast_fire_water` VALUES ('108', '101', '复龙换流站', '10708', '天然水源1', '高层厂房', '天然水源', '10.2', '苏慧光', '17792961611', null, '114.990321', '38.516746', '2021-11-11 11:26:10', '2021-11-11 11:29:31');
INSERT INTO `ast_fire_water` VALUES ('109', '101', '复龙换流站', '10709', '天然水源2', '高层厂房', '天然水源', '10.2', '苏慧光', '17792961611', null, '120.582886', '30.051549', '2021-11-11 11:26:10', '2021-11-11 11:29:31');
INSERT INTO `ast_fire_water` VALUES ('110', '101', '复龙换流站', '10710', '天然水源3', '高层厂房', '天然水源', '10.2', '苏慧光', '17792961611', null, '121.614786', '38.913962', '2021-11-11 11:26:10', '2021-11-11 11:29:31');
INSERT INTO `ast_fire_water` VALUES ('111', '101', '复龙换流站', '10711', '天然水源4', '高层厂房', '天然水源', '10.2', '苏慧光', '17792961611', null, '112.525364', '27.914796', '2021-11-11 11:26:10', '2021-11-11 11:29:31');
-- ----------------------------
-- Table structure for DATABASECHANGELOG -- Table structure for DATABASECHANGELOG
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `DATABASECHANGELOG`; DROP TABLE IF EXISTS `DATABASECHANGELOG`;
...@@ -472,6 +620,10 @@ CREATE TABLE `DATABASECHANGELOG` ( ...@@ -472,6 +620,10 @@ CREATE TABLE `DATABASECHANGELOG` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- ---------------------------- -- ----------------------------
-- Records of DATABASECHANGELOG
-- ----------------------------
-- ----------------------------
-- Table structure for DATABASECHANGELOGLOCK -- Table structure for DATABASECHANGELOGLOCK
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `DATABASECHANGELOGLOCK`; DROP TABLE IF EXISTS `DATABASECHANGELOGLOCK`;
...@@ -482,4 +634,9 @@ CREATE TABLE `DATABASECHANGELOGLOCK` ( ...@@ -482,4 +634,9 @@ CREATE TABLE `DATABASECHANGELOGLOCK` (
`LOCKEDBY` varchar(255) DEFAULT NULL, `LOCKEDBY` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`) PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
SET FOREIGN_KEY_CHECKS=1;
\ No newline at end of file -- ----------------------------
-- Records of DATABASECHANGELOGLOCK
-- ----------------------------
INSERT INTO `DATABASECHANGELOGLOCK` VALUES ('1', '\0', null, null);
SET FOREIGN_KEY_CHECKS=1;
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