Commit fc236903 authored by chenhao's avatar chenhao

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

parents a1915903 abec41b1
......@@ -24,6 +24,8 @@ public class DateUtils {
public static final String MINUTE_ONLY_PATTERN = "mm";
public static final String HOUR_ONLY_PATTERN = "HH";
public static final String DATE_PATTERN_NUM = "yyyyMMdd";
public static final String CHN_DATE_PATTERN_YEAR = "yyyy年";
public static final String CHN_DATE_PATTERN_MONTH = "MM月";
/**
* 获取 当前年、半年、季度、月、日、小时 开始结束时间
......@@ -604,6 +606,7 @@ public class DateUtils {
System.out.println(dateTimeToDateStringIfTimeEndZero(dateTimeToDate(new Date())));*/
//System.out.println(dateBetween(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
//System.out.println(dateBetweenIncludeToday(dateParse("2017-01-30", null), dateParse("2017-02-01", null)));
// System.out.println(getDate(dateParse("2017-01-17", null)));
//System.out.println(getDate(dateParse("2017-01-17", null)));
/*
System.out.println(getDaysOfMonth(dateParse("2017-02-01", null)));
......@@ -612,6 +615,13 @@ public class DateUtils {
// .MONTH_PATTERN));
/*System.out.println(dateFormat(maxDateOfMonth(dateParse("2016-02", "yyyy-MM")), null));
System.out.println(dateFormat(minDateOfMonth(dateParse("2016-03-31", null)), null));*/
// System.out.println(dateFormat(new Date(), CHN_DATE_PATTERN_YEAR));
// System.out.println(dateFormat(new Date(), CHN_DATE_PATTERN_MONTH));
// System.out.println(getWeekOfYear(new Date()));
// System.out.println(getQuarterStr(getMonth(dateParse("2021-5-11", null))));
// System.out.println(getWeekBeginDate(dateParse("2021-10-11", null)));
// System.out.println(getWeekEndDate(dateParse("2021-10-11", null)));
System.out.println(secondsToTimeStr(3600));
}
......@@ -723,6 +733,79 @@ public class DateUtils {
}
/**
* 获取一年的第几周
*
* @param date
* @return
*/
public static int getWeekOfYear(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
int week_of_year = c.get(Calendar.WEEK_OF_YEAR);
return week_of_year;
}
/**
* 通过月份计算季度
* @param month
* @return
*/
public static int getQuarter(int month) {
if(month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid.");
}
return (month - 1) / 3 + 1;
}
/**
* 通过月份计算季度
* @param month
* @return
*/
public static String getQuarterStr(int month) {
if(month < 1 || month > 12) {
throw new IllegalArgumentException("month is invalid.");
}
return (month - 1) / 3 + 1 + "";
}
/**
* 获取指定时间所在周的第一天日期
* @param date
* @return
*/
public static int getWeekBeginDate(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
System.out.println(calendar.getTime());
return getDate(calendar.getTime());
}
/**
* 获取指定时间所在周的最后一天日期
* @param date
* @return
*/
public static int getWeekEndDate(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
System.out.println(calendar.getTime());
return getDate(calendar.getTime());
}
public static String getWeekDate(Date date) throws ParseException {
String month = dateFormat(date, CHN_DATE_PATTERN_MONTH);
String weekDateStr = getWeekBeginDate(date) + "-" + getWeekEndDate(date);
return month + weekDateStr + "日";
}
/**
* 将秒数转换为时分秒格式
* @param times
* @return
......@@ -738,6 +821,4 @@ public class DateUtils {
time = String.format(time,h,m,s);
return time;
}
}
......@@ -394,26 +394,13 @@ public class ExcelUtil {
* @param fileName 下载的文件名,
* @param sheetName sheet名
* @param data 导出的数据
* @param model 导出的头
* @param flag true模板填充下拉 false 不填充
*/
public static void createTemplateWithHeaders(HttpServletResponse response, String fileName, String sheetName,
List<? extends Object> data, Class<?> model, DataSources dataDictionaryMapper, boolean flag, List<List<String>> heads, List<String> headstr, String fileType) {
List<? extends Object> data, List<List<String>> heads, List<String> headstr, String fileType) {
HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle();
try {
// 下拉列表集合
Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
if (flag) {
// 循环获取对应列得下拉列表信息
Field[] declaredFields = model.getDeclaredFields();
for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i];
// 解析注解信息
ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class);
resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper);
}
}
List<List<Object>> listData = Lists.newArrayList();
for (Object t : data) {
List<Object> rowLine = new ArrayList<>();
......@@ -438,7 +425,6 @@ public class ExcelUtil {
EasyExcel.write(getOutputStream(fileName, response, typeEnum))
.excelType(typeEnum).sheet(sheetName)
.registerWriteHandler(new TemplateCellWriteHandlerDate(explicitListConstraintMap))
.registerWriteHandler(new TemplateCellWriteHandler())
.registerWriteHandler(horizontalCellStyleStrategy)
.head(heads).doWrite(listData);
......
......@@ -58,7 +58,7 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
* @return
*/
Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName,
String linkageUnitType, String linkageUnitTypeCode, String emergencyLinkageUnitCode);
String linkageUnitType, String linkageUnitTypeCode, String emergencyLinkageUnitCode,String inAgreement);
List<LinkageUnitDto> exportToExcel(String unitName,String linkageUnitTypeCode,String emergencyLinkageUnitCode);
......
......@@ -89,4 +89,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
void updatelistByParentId(String codex, String code);
List< Map<String,String>> getPersonSimpleDetail();
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
}
......@@ -203,9 +203,22 @@
FROM
cb_linkage_unit clu
WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat('%',#{unitName}, '%')
</if>
<if test="inAgreement != null and inAgreement != ''">
<if test='inAgreement != "是"'>
AND now() &lt; clu.agreement_start_date or now() &gt; clu.agreement_end_date
</if>
<if test='inAgreement != "否"'>
AND now() between clu.agreement_start_date and clu.agreement_end_date
</if>
</if>
<if
test="linkageUnitType != null and linkageUnitType != ''">
AND clu.linkage_unit_type =#{linkageUnitType}
......
......@@ -669,4 +669,20 @@ LEFT JOIN (
AND field_code = 'telephone'
) cdf ON person.sequence_nbr = cdf.instance_id
</select>
<select id="countDeptByCompanyId" resultType="java.util.Map">
SELECT (SELECT count(1)
FROM cb_org_usr
WHERE biz_org_code LIKE
concat((SELECT biz_org_code FROM `cb_org_usr` WHERE sequence_nbr = t1.sequence_nbr),
'%'
)
AND biz_org_type = 'DEPARTMENT'
AND parent_id = t1.sequence_nbr) count,
sequence_nbr
FROM cb_org_usr t1
WHERE sequence_nbr IN
<foreach collection ='companyIdList' item='companyId' index='index' open="(" close= ")" separator=",">
#{companyId}
</foreach>
</select>
</mapper>
......@@ -23,7 +23,7 @@ public class AlertSubmittedZHDto {
@ApiModelProperty(value = "主键ID")
protected Long sequenceNbr;
@ApiModelProperty(value = "业务类型(警情续报、非警情确认、警情结案)")
@ApiModelProperty(value = "业务类型(警情续报、非警情确认、警情结案,警情归并)")
private String businessType;
@ApiModelProperty(value = "报送时间")
......@@ -38,4 +38,7 @@ public class AlertSubmittedZHDto {
@ApiModelProperty(value = "人员名称")
private String userName;
@ApiModelProperty(value = "警情信息")
private AlertCalledFormDto alertCalledFormDto;
}
......@@ -31,15 +31,20 @@ public class InstructionsZHDto {
@ApiModelProperty(value = "发送单位")
private String company="119值班中心";
@ApiModelProperty(value = "警情信息")
private AlertCalledFormDto alertCalledFormDto;
public InstructionsZHDto(Long sequenceNbr, String type, Date submissionTime, String content) {
public InstructionsZHDto(Long sequenceNbr, String type, Date submissionTime, String content, AlertCalledFormDto alertCalledFormDto) {
this.sequenceNbr = sequenceNbr;
this.type = type;
this.submissionTime = submissionTime;
this.content = content;
this.alertCalledFormDto = alertCalledFormDto;
}
public InstructionsZHDto() {
}
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 力量调派发送信息记录表
*
* @author litw
* @date 2021-11-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="PowerrTransferLogDto", description="力量调派发送信息记录表")
public class PowerrTransferLogDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "队伍id")
private Long teamId;
@ApiModelProperty(value = "资源id(目前只有车辆)")
private Long resourceId;
@ApiModelProperty(value = "接收人")
private String receiveName;
@ApiModelProperty(value = "发送时间")
private String sendTime;
@ApiModelProperty(value = "发送内容")
private String sendContent;
@ApiModelProperty(value = "调派类型(0,队伍,1,资源)")
private String type;
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 力量调派发送信息记录表
*
* @author litw
* @date 2021-11-05
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_powerr_transfer_log")
public class PowerrTransferLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 队伍id
*/
@TableField("team_id")
private Long teamId;
/**
* 资源id(目前只有车辆)
*/
@TableField("resource_id")
private Long resourceId;
/**
* 接收人
*/
@TableField("receive_name")
private String receiveName;
/**
* 发送时间
*/
@TableField("send_time")
private String sendTime;
/**
* 发送内容
*/
@TableField("send_content")
private String sendContent;
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerrTransferLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 力量调派发送信息记录表 Mapper 接口
*
* @author litw
* @date 2021-11-05
*/
public interface PowerrTransferLogMapper extends BaseMapper<PowerrTransferLog> {
}
......@@ -41,6 +41,8 @@ public interface IAlertCalledService {
* **/
Object selectAlertCalledById( Long id);
Object selectAlertCalledByIdNoRedis(Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( Long id);
......
package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerrTransferLogDto;
/**
* 力量调派发送信息记录表接口类
*
* @author litw
* @date 2021-11-05
*/
public interface IPowerrTransferLogService {
PowerrTransferLogDto selectOneDetails(Long id,String type);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.PowerrTransferLogMapper">
</mapper>
......@@ -220,4 +220,16 @@ public class LatentDanger extends BasicEntity {
*/
@TableField(exist = false)
private String processStateName;
/**
* 隐患创建人名称
*/
@TableField(exist = false)
private String checkUserName;
/**
* 复查执行人名称
*/
@TableField(exist = false)
private String executeUserName;
}
package com.yeejoin.amos.supervision.common.enums;
/**
* 计划频次类型枚举
*/
public enum PlanFrequencyEnum {
WEEK("周", "2", "周检查报告"),
MONTH("月", "3", "月检查报告"),
QUARTER("季度", "4", "季度检查报告");
String name;
String code;
String reportName;
PlanFrequencyEnum(String name, String code, String reportName) {
this.name = name;
this.code = code;
this.reportName = reportName;
}
public static PlanFrequencyEnum getEnumByCode(String code) {
for (PlanFrequencyEnum c : PlanFrequencyEnum.values()) {
if (c.getCode().equals(code)) {
return c;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getExtraInfo() {
return reportName;
}
public void setExtraInfo(String reportName) {
this.reportName = reportName;
}
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class CheckReportCompanyDto implements Serializable {
@ApiModelProperty(value = "单位id")
String id;
@ApiModelProperty(value = "单位名称")
String name;
@ApiModelProperty(value = "点位数量")
Integer deptCount;
@ApiModelProperty(value = "检查陪同人员")
String escortUser;
@ApiModelProperty(value = "检查结果")
String checkResult;
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CheckReportDangerDto implements Serializable {
@ApiModelProperty(value = "单位id")
String companyId;
@ApiModelProperty(value = "单位名称")
String companyName;
@ApiModelProperty(value = "隐患id")
String dangerId;
@ApiModelProperty(value = "存在问题")
String dangerName;
@ApiModelProperty(value = "隐患状态")
String dangerStateName;
@ApiModelProperty(value = "检查时间")
Date createDate;
@ApiModelProperty(value = "检查人员")
String checkUserName;
@ApiModelProperty(value = "复查人员")
String reviewUser;
@ApiModelProperty(value = "备注")
String remark;
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class CheckReportDto implements Serializable {
@ApiModelProperty(value = "检查报告id")
Long id;
@ApiModelProperty(value = "报告名称")
String name;
@ApiModelProperty(value = "所属计划名称")
String planName;
@ApiModelProperty(value = "计划检查类型")
String planCheckType;
@ApiModelProperty(value = "检查级别")
String planCheckLevel;
@ApiModelProperty(value = "计划开始时间")
Date startPlanTaskDate;
@ApiModelProperty(value = "计划结束时间")
Date endPlanTaskDate;
@ApiModelProperty(value = "执行人")
String checkUser;
@ApiModelProperty(value = "计划任务id")
Long planTaskId;
@ApiModelProperty(value = "实际开始时间")
Date startCheckDate;
@ApiModelProperty(value = "实际结束时间")
Date endCheckDate;
@ApiModelProperty(value = "检查单位数量")
Integer companyCount;
@ApiModelProperty(value = "存在问题单位数量")
Integer problemCompanyCount;
@ApiModelProperty(value = "是否有重大隐患(1有,0无)")
Boolean hasMajorDanger;
@ApiModelProperty(value = "存在安全隐患数量")
Integer dangerCount;
@ApiModelProperty(value = "现场已整改隐患数量")
Integer onsiteReformCount;
@ApiModelProperty(value = "复查隐患数量")
Integer reviewDangerCount;
@ApiModelProperty(value = "复查已整改隐患数量")
Integer reviewReformedCount;
@ApiModelProperty(value = "复查整改中隐患数量")
Integer reviewReformingCount;
@ApiModelProperty(value = "剩余隐患数量")
Integer remainderDangerCount;
@ApiModelProperty(value = "机构代码")
String orgCode;
@ApiModelProperty(value = "创建时间")
Date createDate;
@ApiModelProperty(value = "检查单位列表")
List<CheckReportCompanyDto> checkCompanyList;
@ApiModelProperty(value = "本次检查隐患列表")
List<CheckReportDangerDto> checkDangerList;
@ApiModelProperty(value = "本次隐患复查列表")
List<CheckReportDangerDto> reviewDangerList;
@ApiModelProperty(value = "本次隐患id")
String dangerIds;
@ApiModelProperty(value = "本次复查隐患id")
String reviewDangerIds;
}
package com.yeejoin.amos.supervision.core.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class CheckReportParamDto implements Serializable {
@ApiModelProperty(value = "报告名称")
String name;
@ApiModelProperty(value = "计划名称")
String planName;
@ApiModelProperty(value = "计划检查类型")
String planCheckType;
@ApiModelProperty(value = "检查级别")
String checkLevel;
@ApiModelProperty(value = "检查开始时间")
Date startCheckTime;
@ApiModelProperty(value = "检查结束时间")
Date endCheckTime;
@ApiModelProperty(value = "检查执行人")
String checkUser;
@ApiModelProperty(value = "组织机构代码")
String orgCode;
}
......@@ -20,6 +20,11 @@ public class DangerDto implements Serializable {
private Long id;
/**
* 隐患id
*/
private Long dangerId;
/**
* 隐患名称
*/
private String dangerName;
......@@ -156,4 +161,13 @@ public class DangerDto implements Serializable {
*/
private Map bizInfo;
/**
* 复核人员名称
*/
private String executeUserName;
/**
* 创建时间
*/
private Date createDate;
}
package com.yeejoin.amos.supervision.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@TableName("p_check_report")
public class CheckReport extends BasicEntity {
@ApiModelProperty(value = "报告名称")
String name;
@ApiModelProperty(value = "计划类型(0单位级,1公司级)")
int planType;
@ApiModelProperty(value = "计划任务id")
Long planTaskId;
@ApiModelProperty(value = "任务执行人")
String checkUser;
@ApiModelProperty(value = "实际开始时间")
Date startCheckDate;
@ApiModelProperty(value = "实际结束时间")
Date endCheckDate;
@ApiModelProperty(value = "检查单位数量")
Integer companyCount;
@ApiModelProperty(value = "存在问题单位数量")
Integer problemCompanyCount;
@ApiModelProperty(value = "是否有重大隐患(1有,0无)")
Boolean hasMajorDanger;
@ApiModelProperty(value = "存在安全隐患id(逗号分割)")
String dangerIds;
@ApiModelProperty(value = "存在安全隐患数量")
Integer dangerCount;
@ApiModelProperty(value = "复查隐患id(逗号分割)")
String reviewDangerIds;
@ApiModelProperty(value = "现场已整改隐患数量")
Integer onsiteReformCount;
@ApiModelProperty(value = "复查隐患数量")
Integer reviewDangerCount;
@ApiModelProperty(value = "复查已整改隐患数量")
Integer reviewReformedCount;
@ApiModelProperty(value = "复查整改中隐患数量")
Integer reviewReformingCount;
@ApiModelProperty(value = "剩余隐患数量")
Integer remainingDangerCount;
@ApiModelProperty(value = "机构代码")
String orgCode;
}
......@@ -102,5 +102,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
String alertSource,
String alarmType);
List<AlertPaperInfoDto> getAlertPaperInfoList(@Param("regionCodes") List<String> regionCodes,@Param("isHistory") Boolean isHistory);
List<AlertPaperInfoDto> getAlertPaperInfoList(@Param("regionCodes") List<String> regionCodes,@Param("isHistory") Boolean isHistory);
List<AlertPaperInfoDto> getEquipmentHistory(@Param("regionCodes") List<String> regionCodes,@Param("equipmentClassCode") String equipmentClassCode,@Param("current") Integer current, @Param("equipmentCode") String equipmentCode);
}
......@@ -24,4 +24,8 @@ public interface VoiceRecordFileMapper extends BaseMapper<VoiceRecordFile> {
@Param("workNum") String workNum,
@Param("sortParam") String sortParam,
@Param("sortRule") String sortRule);
VoiceRecordFileDto getRecordById(@Param("sequenceNbr") Long sequenceNbr);
List<VoiceRecordFileDto> selectExportData(@Param("ids") List<String> ids);
}
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutySeatDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
......@@ -99,4 +100,6 @@ public interface IAlertCalledService {
* @return
*/
List<DutySeatDto> getSeatInfos();
List<AlertPaperInfoDto> getEquipmentHistory(List<String> useRegionCode, String equipmentClassCode, Integer pageNum, String equipmentCode);
}
......@@ -4,6 +4,8 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import java.util.List;
/**
* 通话记录附件接口类
*
......@@ -15,4 +17,8 @@ public interface IVoiceRecordFileService {
void publishRecord(VoiceRecordFileDto model);
Page<VoiceRecordFileDto> queryRecordListByQueryDto(Page<VoiceRecordFileDto> page, String telEndTimeStr, String telEndTimeStr1, String fileType, String tel, String workNum, String sortParam, String sortRule);
VoiceRecordFileDto getRecordById(Long sequenceNbr);
List<VoiceRecordFileDto> selectExportData(String exportId);
}
......@@ -544,16 +544,63 @@
DATE_SUB(CURDATE(), INTERVAL 7 DAY) <![CDATA[ <= ]]> date(a.call_time)
</when>
<otherwise>
<if test="regionCodes != null">
AND a.alert_status = 0
AND
<foreach collection="regionCodes" index="index" item="item" open="(" separator=" OR " close=")">
a.region_code LIKE CONCAT('%', #{item}, '%')
</foreach>
</if>
AND a.alert_status = 0
</otherwise>
</choose>
<if test="regionCodes != null">
AND
<foreach collection="regionCodes" index="index" item="item" open="(" separator=" OR " close=")">
a.region_code LIKE CONCAT('%', #{item}, '%')
</foreach>
</if>
</select>
<select id="getEquipmentHistory" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto">
SELECT
a.sequence_nbr AS alertId,
a.region_code AS regionCode,
e.rescue_code AS rescueCode,
a.alarm_type_code AS alarmTypeCode,
a.alarm_type AS alarmType,
CONCAT(e.province ,e.city ,e.district) AS area,
a.address AS address,
a.call_time AS callTime,
e.longitude AS longitude,
e.latitude AS latitude,
a.alert_stage AS alertStatus,
e.sequence_nbr AS elevatorId,
e.register_code AS elevatorCode,
p.feedback_finish_time AS finishTime
FROM tz_alert_called a
<choose>
<when test="equipmentClassCode == '3000'">
LEFT JOIN tcb_elevator e ON e.sequence_nbr = a.equipment_id and a.equipment_classification_code = #{equipmentClassCode}
LEFT JOIN tz_dispatch_paper p ON p.alert_id = a.sequence_nbr
where a.is_delete = 0 AND a.alert_status = 1 AND e.rescue_code = #{equipmentCode}
</when>
<otherwise>
AND a.alert_status = 0
</otherwise>
</choose>
<if test="regionCodes != null">
AND
<foreach collection="regionCodes" index="index" item="item" open="(" separator=" OR " close=")">
a.region_code LIKE CONCAT('%', #{item}, '%')
</foreach>
</if>
order by a.call_time desc
<choose>
<when test="current == null ">
limit 0,3
</when>
<otherwise>
limit #{current},5
</otherwise>
</choose>
</select>
</mapper>
......
......@@ -39,9 +39,63 @@
<if test="fileType != null and fileType != ''">
AND r.file_type = #{fileType}
</if>
<if test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</if>
<choose>
<when test="sortParam != null and sortParam != '' and sortRule != null and sortRule != '' ">
ORDER BY ${sortParam} ${sortRule}
</when>
<otherwise>
ORDER BY r.tel_start_time desc
</otherwise>
</choose>
</select>
<select id="getRecordById" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto">
SELECT
r.sequence_nbr AS sequenceNbr,
r.file_path AS filePath,
r.file_type AS fileType,
r.tel AS tel,
r.tel_start_time AS telStartTime,
r.tel_end_time AS telEndTime,
r.alert_id AS alertId,
r.alert_stage AS alertStage,
r.alert_stage_code AS alertStageCode,
r.tel_time AS telTime,
a.work_order_number AS workNum
FROM
tz_voice_record_file r
LEFT JOIN tz_alert_called a ON a.sequence_nbr =
r.alert_id
WHERE r.sequence_nbr = #{sequenceNbr}
</select>
<select id="selectExportData" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto">
select
r.sequence_nbr AS sequenceNbr,
r.file_path AS filePath,
r.file_type AS fileType,
r.tel AS tel,
r.tel_start_time AS telStartTime,
r.tel_end_time AS telEndTime,
r.alert_id AS alertId,
r.alert_stage AS alertStage,
r.alert_stage_code AS alertStageCode,
r.tel_time AS telTime,
a.work_order_number AS workNum
FROM
tz_voice_record_file r
LEFT JOIN tz_alert_called a ON a.sequence_nbr = r.alert_id
where r.is_delete = 0
<if test="ids != null and ids.size() > 0">
and r.sequence_nbr in
<foreach item="item" collection="ids" separator="," open="(" close=")" index=""> #{item}
</foreach>
</if>
</select>
</mapper>
......@@ -141,9 +141,8 @@ public class OrgUsrController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
@ApiOperation(httpMethod = "PUT", value = "更新单位数据", notes = "更新单位数据")
public ResponseModel<?> updateByIdOrgUsr(HttpServletRequest request, @RequestBody OrgUsrDto OrgUsrVo, @PathVariable Long id) throws Exception {
OrgUsrVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
// iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id);
return ResponseHelper.buildResponse( iOrgUsrService.updateByIdOrgUsr(OrgUsrVo, id));
}
......@@ -545,4 +544,17 @@ public class OrgUsrController extends BaseController {
public ResponseModel getUnSyncOrgCompanyList(@RequestParam List<Long> companyIdList) {
return ResponseHelper.buildResponse(iOrgUsrService.getUnSyncOrgCompanyList(companyIdList));
}
/**
* 根据机场单位id获取各单位下部门数量
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据机场单位id获取各单位下部门数量", notes = "根据机场单位id获取各单位下部门数量")
@GetMapping(value = "/amos/companyIds")
public ResponseModel<Map<String, Integer>> getDeptCountByCompanyIds(@RequestParam List<String> companyIdList) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getDeptCountByCompanyIds(companyIdList));
}
}
\ No newline at end of file
......@@ -72,11 +72,13 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
*/
@Override
public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page,
Boolean isDelete, String unitName,
String linkageUnitTypeCode,
String linkageUnitType, String emergencyLinkageUnitCode,
String inAgreement) {
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType,linkageUnitTypeCode, emergencyLinkageUnitCode);
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType,linkageUnitTypeCode, emergencyLinkageUnitCode,inAgreement);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode());
......@@ -88,6 +90,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
}
});
});
List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitListMap),
LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
......@@ -98,9 +101,8 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(item.getSequenceNbr());
item.setImage(sourceFiles);
return item;
}).filter(item -> StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement()))
.collect(Collectors.toList());
}).collect(Collectors.toList());
//.filter(item -> StringUtils.isEmpty(inAgreement) || inAgreement.equals(item.getInAgreement()))
Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>();
page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize());
......
......@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.google.common.collect.Maps;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -750,7 +751,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (parent != null) {
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
}
// orgUsr.setSequenceNbr(id);
orgUsr.setSequenceNbr(id);
// 查询机构下的所有部门单位人员数据,进行bizOrgCode的统一修改 BUG 2880 by litw start 2021年9月16日
// String oriOrgCode = oriOrgUsr.getBizOrgCode();
// Map<String, Object> columnMap = new HashMap<>();
......@@ -1844,4 +1845,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrMapper.getPersonSimpleDetail();
}
public Map<String, Integer> getDeptCountByCompanyIds(List<String> companyIdList) {
Map<String, Integer> resultMap = Maps.newHashMap();
List<Map<String, Long>> companyDeptCountMapList;
if (!ValidationUtil.isEmpty(companyIdList)) {
companyDeptCountMapList = this.baseMapper.countDeptByCompanyId(companyIdList);
if (!ValidationUtil.isEmpty(companyDeptCountMapList)) {
companyDeptCountMapList.forEach(c -> {
resultMap.put(c.get("sequence_nbr").toString(), Integer.valueOf(c.get("count").intValue()));
});
}
}
return resultMap;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerrTransferLogServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerrTransferLogDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 力量调派发送信息记录表
*
* @author litw
* @date 2021-11-05
*/
@RestController
@Api(tags = "力量调派发送信息记录表Api")
@RequestMapping(value = "/powerr-transfer-log")
public class PowerrTransferLogController extends BaseController {
@Autowired
PowerrTransferLogServiceImpl powerrTransferLogServiceImpl;
/**
* 新增力量调派发送信息记录表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增力量调派发送信息记录表", notes = "新增力量调派发送信息记录表")
public ResponseModel<PowerrTransferLogDto> save(@RequestBody PowerrTransferLogDto model) {
model = powerrTransferLogServiceImpl.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<PowerrTransferLogDto> updateBySequenceNbrPowerrTransferLog(@RequestBody PowerrTransferLogDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(powerrTransferLogServiceImpl.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(powerrTransferLogServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个力量调派发送信息记录表", notes = "根据sequenceNbr查询单个力量调派发送信息记录表")
public ResponseModel<PowerrTransferLogDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(powerrTransferLogServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 根据id,type查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectOneDetails")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个力量调派发送信息记录表", notes = "根据sequenceNbr查询单个力量调派发送信息记录表")
public ResponseModel<PowerrTransferLogDto> selectOneDetails(Long id, String type) {
return ResponseHelper.buildResponse(powerrTransferLogServiceImpl.selectOneDetails(id,type));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "力量调派发送信息记录表分页查询", notes = "力量调派发送信息记录表分页查询")
public ResponseModel<Page<PowerrTransferLogDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<PowerrTransferLogDto> page = new Page<PowerrTransferLogDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(powerrTransferLogServiceImpl.queryForPowerrTransferLogPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "力量调派发送信息记录表列表全部数据查询", notes = "力量调派发送信息记录表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<PowerrTransferLogDto>> selectForList() {
return ResponseHelper.buildResponse(powerrTransferLogServiceImpl.queryForPowerrTransferLogList());
}
}
......@@ -117,6 +117,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private String topic;
@Value("${redis.cache.failure.time}")
private long time;
@Value("${mqtt.topic.command.power.deployment}")
private String topic1;
@Autowired
private OrgUsrServiceImpl iOrgUsrService;
......@@ -247,6 +249,29 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
}
/**
* 根据灾情id 查询灾情详情
**/
@Override
public Object selectAlertCalledByIdNoRedis(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>();
if (list != null && list.size() > 0) {
for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(),
"text", alertFormValue.getFieldValue(), alertFormValue.getBlock());
formValue.add(value);
}
}
AlertCalledFormDto alertCalledFormVo = new AlertCalledFormDto(alertCalled, formValue);
return alertCalledFormVo;
}
/**
* <pre>
* 保存警情信息
* </pre>
......@@ -304,6 +329,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
emqKeeper.getMqttClient().publish(topic1, "1".getBytes(), RuleConfig.DEFAULT_QOS, true);
} else {
// 警情报送
// ****************************************************待确认开发
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -14,6 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
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.biz.service.impl.OrgUsrServiceImpl;
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.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
......@@ -43,7 +45,9 @@ 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.biz.rule.action.AlertCalledAction;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.ObjectUtils;
import org.checkerframework.checker.units.qual.A;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -490,7 +494,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
} else {
content = "调派" + PowerTransferCompanyZHDto.getCompanyName() + PowerTransferCompanyZHDto.getSubmissionContent() + "前往" + PowerTransferCompanyZHDto.getAddress();
}
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(), PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content);
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(), PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content, null);
listInstructionsZHDto.add(instruct);
});
......@@ -527,12 +531,28 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
break;
}
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(), AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content);
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(), AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content,null);
listInstructionsZHDto.add(instruct);
});
// 获取归并得警情信息
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(AlertCalled::getFatherAlert,id);
List<AlertCalled> alertCalleds = alertCalledService.getBaseMapper().selectList(queryWrapper);
alertCalleds.stream().forEach(e->{
AlertSubmittedZHDto alertSubmittedZHDto = new AlertSubmittedZHDto();
AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto) alertCalledService.selectAlertCalledByIdNoRedis(e.getSequenceNbr());
alertSubmittedZHDto.setAlertCalledFormDto(alertCalledFormDto);
alertSubmittedZHDto.setSequenceNbr(e.getSequenceNbr());
alertSubmittedZHDto.setBusinessType("警情归并");
alertSubmittedZHDto.setSubmissionTime(alertCalledFormDto.getAlertCalled().getCallTime());
alertSubmittedZHDto.setCompanyName(alertCalledFormDto.getAlertCalled().getCompanyName());
alertSubmittedZHDto.setUserName(alertCalledFormDto.getAlertCalled().getRecUserName());
InstructionsZHDto instruct = new InstructionsZHDto(alertSubmittedZHDto.getSequenceNbr(), alertSubmittedZHDto.getBusinessType(), alertSubmittedZHDto.getSubmissionTime(), null, alertSubmittedZHDto.getAlertCalledFormDto());
listInstructionsZHDto.add(instruct);
});
//排序时间倒序
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始*/
Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() {
......
......@@ -435,7 +435,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>();
queryWrapper.eq(FireTeam::getTypeCode, code);
queryWrapper.eq(FireTeam::getIsDelete, false);
queryWrapper.eq(FireTeam::getCompany, companyId);
// queryWrapper.eq(FireTeam::getCompany, companyId);
return this.baseMapper.selectList(queryWrapper);
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerrTransferLog;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerrTransferLogMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerrTransferLogService;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerrTransferLogDto;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 力量调派发送信息记录表服务实现类
*
* @author litw
* @date 2021-11-05
*/
@Service
public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogDto,PowerrTransferLog,PowerrTransferLogMapper> implements IPowerrTransferLogService {
/**
* 分页查询
*/
public Page<PowerrTransferLogDto> queryForPowerrTransferLogPage(Page<PowerrTransferLogDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<PowerrTransferLogDto> queryForPowerrTransferLogList() {
return this.queryForList("" , false);
}
@Override
public PowerrTransferLogDto selectOneDetails(Long id, String type) {
// 队伍
if("0".equals(type)) {
LambdaQueryWrapper<PowerrTransferLog> queryWrapper = new LambdaQueryWrapper<>();
PowerrTransferLogDto dto = new PowerrTransferLogDto();
queryWrapper.eq(PowerrTransferLog::getTeamId,id);
List<PowerrTransferLog> list = this.list(queryWrapper);
list.stream().forEach(e->{
dto.setReceiveName(dto.getRecUserName() == null ? "".concat(e.getReceiveName()) : dto.getReceiveName().concat("/").concat(e.getReceiveName()) );
dto.setSendTime(e.getSendTime());
dto.setSendContent(e.getSendContent());
dto.setRecUserName(e.getReceiveName());
});
return dto;
}
// 资源
if("1".equals(type)) {
LambdaQueryWrapper<PowerrTransferLog> queryWrapper = new LambdaQueryWrapper<>();
PowerrTransferLogDto dto = new PowerrTransferLogDto();
queryWrapper.eq(PowerrTransferLog::getTeamId,id);
PowerrTransferLog powerrTransferLog = this.getOne(queryWrapper);
Bean.toPo(powerrTransferLog,dto);
return dto;
}
return new PowerrTransferLogDto();
}
}
\ No newline at end of file
......@@ -264,6 +264,11 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
table1.addCell(PdfUtils.createCell("移\n交\n事\n宜", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,1,1));
table1.addCell(PdfUtils.createCell(shiftChange.getRemark(), cellContent,Element.ALIGN_LEFT,7,1,120,1,1,1,0));
/*bug3413 交接班,下载的交接班记录表中缺少日常工作项 陈召 2021-11-08*/
// 日常工作
table1.addCell(PdfUtils.createCell("日\n常\n工\n作", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,1,1));
table1.addCell(PdfUtils.createCell(shiftChange.getDutyWork(), cellContent,Element.ALIGN_LEFT,7,1,120,1,1,1,0));
/*bug3413 交接班,下载的交接班记录表中缺少日常工作项 陈召 2021-11-08*/
try{
document.add(docTitle);
document.add(table1);;
......
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.latentdanger.business.dto.DangerExecuteSubmitDto;
import com.yeejoin.amos.latentdanger.business.dto.ExecuteSubmitDto;
......@@ -376,4 +377,13 @@ public class LatentDangerController extends BaseController {
public ResponseModel getUnFinishedDangerCount() {
return ResponseHelper.buildResponse((iLatentDangerService.getUnFinishedDangerCount()));
}
@ApiOperation(value = "获取隐患复查信息", notes = "获取隐患复查信息")
@GetMapping(value = "/supervision/reviewInfo")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel getSupervisionReviewInfo(@RequestParam String orgCode, @RequestParam String t1,
@RequestParam String t2) {
return ResponseHelper.buildResponse(iLatentDangerService.getSupervisionReviewInfo(orgCode,
DateUtils.longStr2Date(t1), DateUtils.longStr2Date(t2)));
}
}
......@@ -13,5 +13,5 @@ public class LatentDangerFlowRecordBoExtend {
private Integer dangerOvertimeState;
private Integer dangerState;
private String dangerState;
}
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.latentdanger.business.param;
import com.yeejoin.amos.latentdanger.core.common.request.CommonPageable;
import lombok.Data;
import java.util.Date;
/**
* @author keyong
* @title: LatentDangerListParam
......@@ -41,4 +43,14 @@ public class LatentDangerListParam extends CommonPageable {
private String dangerIds;
private String orgCode;
/**
* 隐患开始时间
*/
private Date startTime;
/**
* 隐患结束时间
*/
private Date endTime;
}
......@@ -19,6 +19,7 @@ import com.yeejoin.amos.latentdanger.core.common.response.DangerListResponse;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -173,4 +174,14 @@ public interface ILatentDangerService {
* @return
*/
Integer getUnFinishedDangerCount();
/**
* 获取消防监督复查隐患信息
*
* @param orgCode
* @param t1
* @param t2
* @return
*/
Object getSupervisionReviewInfo(String orgCode, Date t1, Date t2);
}
package com.yeejoin.amos.supervision.business.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckReportService;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Date;
@RestController
@RequestMapping(value = "/check/report")
@Api(tags = "消防监督检查报告api")
public class CheckReportController extends BaseController {
@Autowired
ICheckReportService iCheckReportService;
@Autowired
DangerFeignClient dangerFeignClient;
/**
* 分页查询
*
* @param queryParam
* @param current
* @param size
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询检查报告", notes = "分页查询检查报告")
@PostMapping(value = "/page")
public ResponseModel queryPage(@RequestParam(value = "当前页") int current, @RequestParam(value = "分页大小") int size, @RequestBody(required = false) CheckReportParamDto queryParam) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
if (loginOrgCode.contains("-")) {
loginOrgCode = loginOrgCode.substring(0, loginOrgCode.indexOf("-"));
}
queryParam.setOrgCode(loginOrgCode);
Page page = new Page<>(current, size);
return ResponseHelper.buildResponse(iCheckReportService.pageList(page, queryParam));
}
/**
* 分页查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询检查报告详情", notes = "查询检查报告详情")
@GetMapping(value = "/detail/{id}")
public ResponseModel getDetailById(@PathVariable(value = "id") String id) {
return ResponseHelper.buildResponse(iCheckReportService.getDetailById(id));
}
}
package com.yeejoin.amos.supervision.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.supervision.business.dto.CheckReportMapperDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportCompanyDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import com.yeejoin.amos.supervision.dao.entity.CheckReport;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface CheckReportMapper extends BaseMapper<CheckReport> {
/**
* 根据计划任务ID获取相关数据
* @param id
*/
CheckReportMapperDto queryByPlanTaskId(long id);
IPage<CheckReportDto> selectPageList(Page page, @Param("queryParam") CheckReportParamDto queryParam);
CheckReportDto selectDetailById(@Param("checkReportId") Long id);
List<CheckReportCompanyDto> getCheckReportCompanyList(Long planTaskId);
}
package com.yeejoin.amos.supervision.business.dao.mapper;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import org.apache.ibatis.annotations.Param;
public interface PlanTaskDetailMapper extends BaseMapper {
......@@ -10,7 +12,7 @@ public interface PlanTaskDetailMapper extends BaseMapper {
Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
int findPlanTaskDetailByTaskId( @Param(value="planTaskId") long planTaskId);
List<PlanTaskDetail> findPlanTaskDetailByTaskId(@Param(value="planTaskId") long planTaskId);
/**
* 更新隐患信息
......
package com.yeejoin.amos.supervision.business.dao.repository;
import com.yeejoin.amos.supervision.dao.entity.CheckReport;
import org.springframework.stereotype.Repository;
@Repository("iCheckReportDao")
public interface ICheckReportDao extends BaseDao<CheckReport, Long> {
}
package com.yeejoin.amos.supervision.business.dto;
import lombok.Data;
import java.util.Date;
@Data
public class CheckReportMapperDto {
Integer companyCount;
Long planTaskId;
String checkUser;
String checkTime;
Date planBeginDate;
Date planEndDate;
String latentDangerId;
String problemPointId;
Boolean hasMajorDanger;
}
......@@ -5,19 +5,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDangerDto;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import org.apache.ibatis.annotations.Delete;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
@FeignClient(value = "AMOS-LATENT-DANGER", path = "latentDanger/api/latent/danger", configuration = {FeignConfiguration.class,FeignClientErrorDecoder.class})
@FeignClient(value = "AMOS-LATENT-DANGER", path = "latentDanger/api/latent/danger", configuration =
{FeignConfiguration.class,FeignClientErrorDecoder.class})
public interface DangerFeignClient {
/**
......@@ -79,4 +82,17 @@ public interface DangerFeignClient {
*/
@DeleteMapping("/delete")
FeignClientResult<Boolean> deleteDangerBatch(@RequestParam String ids);
/**
* 根据参数获取隐患复查信息
*
* @param orgCode
* @param t1
* @param t2
* @return
*/
@GetMapping(value = "/supervision/reviewInfo")
FeignClientResult<Map<String, List<CheckReportDangerDto>>> getReviewInfoList(@RequestParam String orgCode,
@RequestParam String t1,
@RequestParam String t2);
}
......@@ -5,6 +5,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author DELL
......@@ -35,4 +36,13 @@ public interface JCSFeignClient {
*/
@RequestMapping(value = "jcs/org-usr/amos/orgUserIds", method = RequestMethod.GET)
FeignClientResult getAmosIdListByUserIds(@RequestParam String orgUserIds);
/**
* 根据机场单位id批量获取各单位下的部门数量
*
* @param companyIdList 机场单位人员id
* @return
*/
@RequestMapping(value = "jcs/org-usr/amos/companyIds", method = RequestMethod.GET)
FeignClientResult<Map<String, Integer>> getDeptCountByCompanyIds(@RequestParam("companyIdList") List<String> companyIdList);
}
......@@ -9,6 +9,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
......@@ -55,6 +56,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -115,6 +117,12 @@ public class CheckServiceImpl implements ICheckService {
@Autowired
IHiddenDangerDao hiddenDangerDao;
@Autowired
IPlanService iPlanService;
@Autowired
ICheckReportService iCheckReportService;
private final int HTTP_OK_STATUS = 200;
@Value("${file.url}")
......@@ -1583,6 +1591,9 @@ public class CheckServiceImpl implements ICheckService {
saveDanger(allDanger, planTask, check, recordParam);
}
// 任务完成后生成检查报告
iCheckReportService.genCheckReport(planTask);
return checkInputItemDtoList;
} catch (Exception e) {
throw new Exception(e.getMessage(), e);
......
package com.yeejoin.amos.supervision.business.service.intfc;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportDto;
import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import java.text.ParseException;
public interface ICheckReportService {
void genCheckReport(PlanTask planTask) throws ParseException;
/**
* 分页查询检查报告列表
*
* @param page
* @param queryParam
*/
IPage<CheckReportDto> pageList(Page page, CheckReportParamDto queryParam);
/**
* 根据报告id获取报告详情
*
* @param id
* @return
*/
CheckReportDto getDetailById(String id);
}
......@@ -76,6 +76,7 @@ import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -673,12 +674,36 @@ public class AlertCalledController extends BaseController {
* 根据regionCode 获取区域内实时警情
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getActualAlert")
@ApiOperation(httpMethod = "POST", value = "根据regionCode 获取区域内实时警情", notes = "根据regionCode 获取区域内实时警情")
@GetMapping(value = "/getActualAlert")
@ApiOperation(httpMethod = "GET", value = "根据regionCode 获取区域内实时警情", notes = "根据regionCode 获取区域内实时警情")
public ResponseModel<List<AlertPaperInfoDto>> getActualAlert(@RequestParam(name = "regionCodes", required = false) List<String> regionCodes) {
// 警情id 警情地址 警情状态 警情类型 警情发生时间
List<String> useRegionCode = tzsAuthService.getUserRegionCode();
if(regionCodes == null) {
regionCodes = tzsAuthService.getUserRegionCode();
regionCodes = useRegionCode;
} else {
// 判断传入regionCodes 是否越权
List<String> tempList = new ArrayList<>();
Iterator<String> regionIt = regionCodes.iterator();
while(regionIt.hasNext()) {
String tempCode = regionIt.next();
String districtCode = tempCode.substring(4,6);
if("00".equals(districtCode)) { // 为市
if(!useRegionCode.contains(tempCode)) { // 不包含该市权限 需要移除市搜索条件 添加 该市下区搜索条件
for(String tempUsercode : useRegionCode) {
if(tempUsercode.indexOf(tempCode.substring(0,4)) != -1) {
tempList.add(tempUsercode);
}
}
regionIt.remove();
}
} else { // 为区 不会出现越权情况
}
}
for (String t : tempList) {
regionCodes.add(t);
}
}
return ResponseHelper.buildResponse(iAlertCalledService.getAlertPaperInfoList(regionCodes,false));
}
......@@ -687,17 +712,61 @@ public class AlertCalledController extends BaseController {
* 根据regionCode 获取区域内历史警情 七日内
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getHistoryAlert")
@ApiOperation(httpMethod = "POST", value = "根据regionCode 获取区域内七日内历史警情", notes = "根据regionCode 获取区域内七日内历史警情")
@GetMapping(value = "/getHistoryAlert")
@ApiOperation(httpMethod = "GET", value = "根据regionCode 获取区域内七日内历史警情", notes = "根据regionCode 获取区域内七日内历史警情")
public ResponseModel<List<AlertPaperInfoDto>> getHistoryAlert(@RequestParam(name = "regionCodes", required = false) List<String> regionCodes) {
// 警情id 警情地址 警情状态 警情类型 警情发生时间
// 获取自己的regionCode
List<String> useRegionCode = tzsAuthService.getUserRegionCode();
if(regionCodes == null) {
regionCodes = tzsAuthService.getUserRegionCode();
regionCodes = useRegionCode;
} else {
// 判断传入regionCodes 是否越权
List<String> tempList = new ArrayList<>();
Iterator<String> regionIt = regionCodes.iterator();
while(regionIt.hasNext()) {
String tempCode = regionIt.next();
String districtCode = tempCode.substring(4,6);
if("00".equals(districtCode)) { // 为市
if(!useRegionCode.contains(tempCode)) { // 不包含该市权限 需要移除市搜索条件 添加 该市下区搜索条件
for(String tempUsercode : useRegionCode) {
if(tempUsercode.indexOf(tempCode.substring(0,4)) != -1) {
tempList.add(tempUsercode);
}
}
regionIt.remove();
}
} else { // 为区 不会出现越权情况
}
}
for (String t : tempList) {
regionCodes.add(t);
}
}
return ResponseHelper.buildResponse(iAlertCalledService.getAlertPaperInfoList(regionCodes,true));
}
/**
* 获取电梯历史事件
* 字段:事件类型、设备地址、报送时间。倒序排列,默认加载3条,向下翻动时每次可再加载5条。点击事件主屏打开该事件详情
* @param equipmentCode
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getElevatorHistory/{equipmentCode}")
@ApiOperation(httpMethod = "GET", value = "获取电梯历史事件", notes = "获取电梯历史事件")
public ResponseModel<List<AlertPaperInfoDto>> getEquipmentHistory(@PathVariable String equipmentCode, @RequestParam(value = "pageNum", required = false) Integer pageNum) {
// 警情id 警情地址 警情状态 警情类型 警情发生时间
// 获取自己的regionCode
String equipmentClassCode = "3000";
List<String> useRegionCode = tzsAuthService.getUserRegionCode();
return ResponseHelper.buildResponse(iAlertCalledService.getEquipmentHistory(useRegionCode,equipmentClassCode,pageNum,equipmentCode));
}
}
......@@ -259,8 +259,7 @@ public class ElevatorController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/query_elevator_list", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页查询电梯信息", notes = "分页查询电梯信息")
public ResponseModel<IPage<ElevatorDto>> queryElevatorList(String pageNum, String pageSize,
com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto elevatorDto) {
public ResponseModel<IPage<ElevatorDto>> queryElevatorList(String pageNum, String pageSize,com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto elevatorDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorDto, Elevator.class);
Page<Elevator> pageBean;
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
......
......@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
......@@ -66,6 +67,9 @@ public class TemplateExportController extends BaseController {
@Autowired
IRescueStationService iRescueStationService;
@Autowired
VoiceRecordFileServiceImpl voiceRecordFileServiceImpl;
/**
* 新增模板表
*
......@@ -162,6 +166,8 @@ public class TemplateExportController extends BaseController {
fileName = "使用单位";
} else if("RESCUE_STATION".equals(type)) { // 查询救援站数据
fileName = "救援站";
} else if("VOICE_RECORD".equals(type)) { // 查询通话录音数据
fileName = "通话录音";
}
fileName += DateUtils.getDateNowShortNumber();
result.put("fileName",fileName);
......@@ -213,8 +219,11 @@ public class TemplateExportController extends BaseController {
} else if("RESCUE_STATION".equals(exportDto.getExportType())) { // 查询救援站数据
sheetName = "救援站";
list = iRescueStationService.selectExportData(exportDto.getExportId());
} else if("VOICE_RECORD".equals(exportDto.getExportType())) { // 查询救援站数据
sheetName = "通话录音";
list = voiceRecordFileServiceImpl.selectExportData(exportDto.getExportId());
}
ExcelUtil.createTemplateWithHeaders(response, fileName, sheetName, list, ElevatorDto.class, null, false, heads, headstr, exportDto.getFileType());
ExcelUtil.createTemplateWithHeaders(response, fileName, sheetName, list, heads, headstr, exportDto.getFileType());
}
}
......@@ -4,6 +4,8 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,7 +18,13 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 特种设备权限controller
......@@ -53,12 +61,88 @@ public class TzsAuthController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserRegincode")
@ApiOperation(httpMethod = "GET", value = "获取用户regionCode", notes = "获取用户regionCode")
public ResponseModel<List<String>> getHistoryAlert() {
List<String> regionList = new ArrayList<>();
public ResponseModel<List<String>> getUserRegincode() {
List<String> regionList = tzsAuthService.getUserRegionCode();
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
regionList.add("610100");
regionList.add("610300");
return ResponseHelper.buildResponse(regionList);
}
/**
* 获取用户组织机构树
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUserReginTree")
@ApiOperation(httpMethod = "GET", value = "获取用户组织机构树", notes = "获取用户组织机构树")
public ResponseModel<Collection<RegionModel>> getUserReginTree() {
List<String> regionList = tzsAuthService.getUserRegionCode();
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
List<RegionModel> tree = (List<RegionModel>) Systemctl.regionClient.queryForTree(null).getResult();
// 循环list 将List 封装为 省市区 SET
Set<String> city = new HashSet<>();
Set<String> district = new HashSet<>();
for(String regionCode : regionList) {
// 判断是否是某个县
String districtCode = regionCode.substring(4,6);
if("00".equals(districtCode)) { // 为市
city.add(regionCode);
} else { // 为区
district.add(regionCode);
}
}
// 判断市区是否存在区域码的市,如果存在则移除区
Iterator<String> disIt = district.iterator();
while(disIt.hasNext()) {
String regionCode = disIt.next();
String tempCity = regionCode.substring(0,4) + "00";
if(city.contains(tempCity)) {
disIt.remove();
}
}
// 将tree 转换为K-V形式便于处理
Map<Integer, RegionModel> tempMap = new HashMap<Integer, RegionModel>();
RegionModel start = tree.get(0); // 省
setMap(tempMap,start);
List<RegionModel> newTree = new ArrayList<RegionModel>();
List<RegionModel> newCity = new ArrayList<RegionModel>();
// 如果管理市 取得整个市的数据 如果管理某个县 取得某市某县数据
Map<String, RegionModel> tempCityMap = new HashMap<String, RegionModel>();
for(String regionCode : district) {
// 先拿市 再封装新的城市
String cityCode = regionCode.substring(0,4) + "00";
RegionModel tempCity = tempCityMap.get(cityCode);
if(tempCity == null) {
List<RegionModel> tempDisList = new ArrayList<RegionModel>();
tempDisList.add(tempMap.get(Integer.parseInt(regionCode)));
tempCity = tempMap.get(Integer.parseInt(cityCode));
tempCity.setChildren(tempDisList);
tempCityMap.put(cityCode,tempCity);
} else {
List<RegionModel> tempDisList = (List<RegionModel>) tempCity.getChildren();
tempDisList.add(tempMap.get(Integer.parseInt(regionCode)));
}
}
for(String regionCode : city) {// 获取城市
newCity.add(tempMap.get(Integer.parseInt(regionCode)));
}
// 拼接城市
for(Map.Entry<String, RegionModel> entries : tempCityMap.entrySet()) {
newCity.add(entries.getValue());
}
start.setChildren(newCity);
newTree.add(start);
return ResponseHelper.buildResponse(newTree);
}
private void setMap(Map<Integer, RegionModel> tempMap, RegionModel start) {
tempMap.put(start.getRegionCode(),start);
if(start.getChildren() != null) {
List<RegionModel> children = (List<RegionModel>) start.getChildren();
for (RegionModel temp : children) {
setMap(tempMap,temp);
}
}
}
}
......@@ -58,36 +58,6 @@ public class VoiceRecordFileController extends BaseController {
@Autowired
AlertCalledServiceImpl iAlertCalledService;
/**
* 新增通话记录附件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增通话记录附件", notes = "新增通话记录附件")
public ResponseModel<VoiceRecordFileDto> save(@RequestBody VoiceRecordFileDto model) {
if (ValidationUtil.isEmpty(model.getAlertId())
|| ValidationUtil.isEmpty(model.getTel())){
throw new BadRequest("参数校验失败.");
}
Calendar startTime = Calendar.getInstance();
Calendar endTime = Calendar.getInstance();
endTime.add(Calendar.MINUTE, 6);
model.setTelStartTime(startTime.getTime());
model.setTelEndTime(endTime.getTime());
model.setFilePath(UUID.randomUUID().toString().replace("-",""));
model.setFileType("");
model.setSourceId(-1l);
AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
if(alertDto == null || alertDto.getAlertCalledDto() == null) {
throw new BadRequest("未找到相关警情");
}
model.setAlertStage(alertDto.getAlertCalledDto().getAlertStage());
model.setAlertStageCode(alertDto.getAlertCalledDto().getAlertStageCode());
model = voiceRecordFileServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据警情id 查找通话记录信息
......@@ -112,6 +82,20 @@ public class VoiceRecordFileController extends BaseController {
return ResponseHelper.buildResponse(dtoList);
}
/**
* 根据警情id 查找通话记录信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "根据id获取通话记录信息", notes = "根据id获取通话记录信息")
@GetMapping(value = "/{sequenceNbr}")
public ResponseModel<VoiceRecordFileDto> getRecordById(@PathVariable Long sequenceNbr) {
VoiceRecordFileDto record = voiceRecordFileServiceImpl.getRecordById(sequenceNbr);
return ResponseHelper.buildResponse(record);
}
/**
* 新增-通话记录
......
......@@ -682,4 +682,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
});
return temp;
}
@Override
public List<AlertPaperInfoDto> getEquipmentHistory(List<String> regionCodes, String equipmentClassCode, Integer pageNum, String equipmentCode) {
Integer current = null;
if(pageNum != null) {
current = 3+(5*pageNum);
}
List<AlertPaperInfoDto> temp = baseMapper.getEquipmentHistory(regionCodes, equipmentClassCode,current,equipmentCode);
return temp;
}
}
\ No newline at end of file
......@@ -71,6 +71,9 @@ public class TzsAuthServiceImpl implements TzsAuthService {
List<String> regionList = new ArrayList<>();
AgencyUserModel me = Privilege.agencyUserClient.getme().getResult();
regionList.add("610100");
regionList.add("610300");
regionList.add("610725");
regionList.add("610822");
return regionList;
}
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordFileMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.boot.module.tzs.api.service.IVoiceRecordFileService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.eclipse.paho.client.mqttv3.MqttException;
......@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -145,4 +147,20 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V
page1.setRecords(resultDtoList);
return page1;
}
@Override
public VoiceRecordFileDto getRecordById(Long sequenceNbr) {
VoiceRecordFileDto record = baseMapper.getRecordById(sequenceNbr);
return record;
}
@Override
public List<VoiceRecordFileDto> selectExportData(String exportId) {
List<String> ids = null;
if(StringUtils.isNotEmpty(exportId)) {
String[] idStr = exportId.split(",");
ids = Arrays.asList(idStr);
}
return baseMapper.selectExportData(ids);
}
}
\ No newline at end of file
......@@ -2106,5 +2106,29 @@
</sql>
</changeSet>
<changeSet author="litw" id="2021-11-05-01">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_powerr_transfer_log"/>
</not>
</preConditions>
<comment>create table jc_powerr_transfer_log</comment>
<sql>
CREATE TABLE `jc_powerr_transfer_log` (
`sequence_nbr` bigint(20) NOT NULL,
`team_id` bigint(20) NULL COMMENT '队伍id',
`resource_id` bigint(20) NULL COMMENT '资源id(目前只有车辆)',
`receive_name` varchar(50) NULL COMMENT '接收人',
`send_time` varchar(50) null COMMENT '发送时间',
`send_content` varchar(4000) NULL DEFAULT NULL COMMENT '发送内容',
`rec_user_id` bigint(20) NOT NULL COMMENT '更新人id',
`rec_user_name` varchar(30) NOT NULL COMMENT '更新人名称',
`rec_date` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) COMMENT = '力量调派发送信息记录表' ;
</sql>
</changeSet>
</databaseChangeLog>
......@@ -17,7 +17,7 @@ ribbon.MaxAutoRetriesNextServer = 2
ribbon.MaxAutoRetries = 1
#DB properties:
spring.datasource.url = jdbc:mysql://172.16.10.66:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.url = jdbc:mysql://172.16.6.60:3306/safety-business-3.0.1?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
spring.datasource.driver-class-name = com.mysql.jdbc.Driver
......
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.CheckReportMapper">
<select id="queryByPlanTaskId" resultType="com.yeejoin.amos.supervision.business.dto.CheckReportMapperDto">
SELECT
count( DISTINCT ptd.id ) companyCount,
ptd.task_no planTaskId,
GROUP_CONCAT( DISTINCT executor_name ) checkUser,
GROUP_CONCAT( DISTINCT c.check_time ) checkTime,
pt.begin_time planBeginDate,
pt.end_time planEndDate,
GROUP_CONCAT( DISTINCT hd.latent_danger_id ) latentDangerId,
GROUP_CONCAT( DISTINCT hd.point_id ) problemPointId,
IF
( count( DISTINCT ptd.major_danger_num ) > 0, 1, 0 ) hasMajorDanger
FROM
`p_plan_task_detail` ptd
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_hidden_danger hd ON hd.check_id = c.id
<where>
<if test="planTaskId !=null and planTaskId != ''">ptd.task_no = #{planTaskId}</if>
</where>
</select>
<select id="selectPageList" resultType="com.yeejoin.amos.supervision.core.common.dto.CheckReportDto">
select cr.*,
p.name planName,
p.check_type_name planCheckType,
p.check_level planCheckLevel
from p_check_report cr
LEFT JOIN p_plan_task pt ON pt.id = cr.plan_task_id
LEFT JOIN p_plan p ON p.id = pt.plan_id
<where>
1=1
<if test="queryParam != null and queryParam.name != null and queryParam.name != ''">
and cr.name like concat('%', #{queryParam.name}, '%')
</if>
<if test="queryParam != null and queryParam.planName != null and queryParam.planName != ''">
and p.name like concat('%', #{queryParam.planName}, '%')
</if>
<if test="queryParam != null and queryParam.planCheckType != null and queryParam.planCheckType != ''">
and p.check_type_id = #{queryParam.planCheckType}
</if>
<if test="queryParam != null and queryParam.checkLevel != null and queryParam.checkLevel != ''">
and p.check_level = #{queryParam.checkLevel}
</if>
<if test="queryParam != null and queryParam.startCheckTime != null and queryParam.startCheckTime != ''">
and cr.start_check_date <![CDATA[>=]]> #{queryParam.startCheckTime}
</if>
<if test="queryParam != null and queryParam.endCheckTime != null and queryParam.endCheckTime != ''">
and cr.end_check_date <![CDATA[<=]]> #{queryParam.endCheckTime}
</if>
<if test="queryParam != null and queryParam.checkUser != null and queryParam.checkUser != ''">
and cr.check_user like concat('%', #{queryParam.checkUser}, '%')
</if>
<if test="queryParam != null and queryParam.orgCode != null and queryParam.orgCode != ''">
and cr.org_code like concat(#{queryParam.orgCode}, '%')
</if>
</where>
order by cr.create_date desc
</select>
<select id="selectDetailById" resultType="com.yeejoin.amos.supervision.core.common.dto.CheckReportDto">
select cr.*,
p.name planName,
p.check_type_name planCheckType,
p.check_level planCheckLevel,
DATE_FORMAT(pt.begin_time, '%Y-%m-%d') startPlanTaskDate,
DATE_FORMAT(pt.end_time, '%Y-%m-%d') endPlanTaskDate
from p_check_report cr
LEFT JOIN p_plan_task pt on pt.id = cr.plan_task_id
left join p_plan p on p.id = pt.plan_id
where 1 = 1
and cr.id = #{checkReportId}
</select>
<select id="getCheckReportCompanyList"
resultType="com.yeejoin.amos.supervision.core.common.dto.CheckReportCompanyDto">
SELECT c.point_name name,
p.original_id id,
GROUP_CONCAT(DISTINCT ci.user_name) escortUser,
CASE
WHEN ci.safety_danger_num > 0 THEN
'存在隐患'
WHEN ci.is_ok = '1' THEN
'正常'
ELSE '异常'
END checkResult
FROM p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_point p ON p.id = c.point_id
WHERE c.plan_task_id = #{planTaskId}
GROUP BY c.id
</select>
</mapper>
\ No newline at end of file
......@@ -18,6 +18,9 @@
where pp.id = #{pointId}
and pt.id = #{planTaskId}
</select>
<select id="findPlanTaskDetailByTaskId" resultType="com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail">
select * from p_plan_task_detail where task_no = #{planTaskId}
</select>
<update id="updateDanger">
UPDATE p_plan_task_detail pptd,
......
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