Commit 0b84614b authored by maoying's avatar maoying

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

parents b9aa8008 c928122e
......@@ -99,7 +99,7 @@
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.0.3</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
......
......@@ -24,6 +24,9 @@ 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月";
public static final String CHN_DATE_PATTERN = "yyyy年MM月dd日";
/**
* 获取 当前年、半年、季度、月、日、小时 开始结束时间
......@@ -604,6 +607,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 +616,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 +734,73 @@ 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());
}
/**
* 将秒数转换为时分秒格式
* @param times
* @return
......@@ -738,6 +816,4 @@ public class DateUtils {
time = String.format(time,h,m,s);
return time;
}
}
......@@ -51,6 +51,9 @@ public class OrgPersonDto extends BaseDto {
@ApiModelProperty(value = "归属机构/部门/人员")
private String parentId;
@ApiModelProperty(value = "归属机构/部门/人员名称")
private String parentName;
@ApiModelProperty(value = "扩展属性1")
private String orgExpandAttr1;
......
......@@ -36,6 +36,9 @@ public class FireTeam extends BaseEntity {
@ApiModelProperty(value = "父级")
private Long parent;
@ApiModelProperty(value = "父级队伍名称")
private String parentName;
@ApiModelProperty(value = "所属机构")
private Long company;
......
......@@ -42,6 +42,9 @@ public class Firefighters extends BaseEntity {
@ApiModelProperty(value = "队伍id")
private Long fireTeamId;
@ApiModelProperty(value = "消防队伍名称")
private String fireTeamName;
@ApiModelProperty(value = "姓名")
private String name;
......
......@@ -48,6 +48,12 @@ public class MaintenanceCompany extends BaseEntity {
*/
@TableField("parent_id")
private Long parentId;
/**
* 上级单位名称
*/
@TableField("parent_name")
private String parentName;
/**
* 业务编码
......
......@@ -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);
}
......@@ -14,7 +14,7 @@
FROM
(
SELECT
MD5(RAND() * 10000) sequence_nbr,
CONCAT('1',CEILING(RAND()*9000000000+1000000000)) sequence_nbr,
a.dispatch_type,
a.rec_date,
a.address,
......
<?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;
}
......@@ -17,7 +17,8 @@ public enum WorkFlowUriEnum {
终止流程("终止流程", "/wf/processes/{processInstanceId}?deleteReason={deleteReason}", "processInstanceId,deleteReason"),
当前子节点("当前子节点", "/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}", "processInstanceId,taskDefinitionKey"),
工作流流水("工作流流水","/wf/processes/{processInstanceId}/tasks", "processInstanceId"),
子节点信息("子节点信息","/workflow/task/list/all/{instanceId}", "instanceId");
子节点信息("子节点信息","/workflow/task/list/all/{instanceId}", "instanceId"),
当前任务("当前任务","/workflow/task/{processInstanceId}", "processInstanceId");
private String desc;
......
......@@ -22,6 +22,12 @@
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.0.3</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
......
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 remainingDangerCount;
@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;
@ApiModelProperty(value = "计划执行频次")
String planCheckFrequencyType;
@ApiModelProperty(value = "报告时期")
String reportDate;
@ApiModelProperty(value = "当前日期")
String nowDate;
}
package com.yeejoin.amos.supervision.core.common.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
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 = "检查开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
Date startCheckTime;
@ApiModelProperty(value = "检查结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
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;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 特种设备搜索DTO
*/
@Data
@ApiModel(value="EsSpecialEquipmentDto", description="特种设备搜索DTO")
public class EsSpecialEquipmentDto {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 左上经度
*/
@ApiModelProperty(value = "左上经度")
private Double startLongitude;
/**
* 左上纬度
*/
@ApiModelProperty(value = "左上纬度")
private Double startLatitude;
/**
* 右下经度
*/
@ApiModelProperty(value = "右下经度")
private Double endLongitude;
/**
* 右下纬度
*/
@ApiModelProperty(value = "右下纬度")
private Double endLatitude;
/**
* 搜索关键字
*/
@ApiModelProperty(value = "搜索关键字")
private String keyword;
/**
* 所属区域代码
*/
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
/**
* 设备类别编码
*/
@ApiModelProperty(value = "设备类别编码")
private String categoryCode;
@ApiModelProperty(value = "聚合精确度1-12")
private Integer precision;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 特种设备搜索列表DTO
*/
@Data
@ApiModel(value="EsSpecialEquipmentListDto", description="特种设备搜索列表DTO")
public class EsSpecialEquipmentListDto {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 所属区域代码
*/
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
/**
* 设备类别编码
*/
@ApiModelProperty(value = "设备类别编码")
private String categoryCode;
/**
* 搜索数量
*/
@ApiModelProperty(value = "搜索数量")
private Integer equipmentNumber;
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 特种设备DTO
*/
@Data
@ApiModel(value="SpecialEquipmentDto", description="特种设备DTO")
public class SpecialEquipmentDto {
/**
*
*/
private static final long serialVersionUID = 1L;
@ExcelIgnore
@ApiModelProperty(value = "主键ID")
protected Long sequenceNbr;
@ApiModelProperty(value = "电梯应急救援识别码")
private Integer rescueCode;
@ApiModelProperty(value = "设备注册代码")
private String registerCode;
@ApiModelProperty(value = "所属省")
private String province;
@ApiModelProperty(value = "所属地市")
private String city;
@ApiModelProperty(value = "所属区县")
private String district;
@ApiModelProperty(value = "所属区域代码")
private String regionCode;
@ApiModelProperty(value = "安装地址")
private String address;
@ApiModelProperty(value = "经度")
private Double longitude;
@ApiModelProperty(value = "纬度")
private Double latitude;
@ApiModelProperty(value = "设备类别编码")
private String categoryCode;
}
......@@ -2,10 +2,12 @@ package com.yeejoin.amos.boot.module.tzs.api.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.elasticsearch.common.geo.GeoPoint;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.GeoPointField;
/**
* @author litw
......@@ -55,19 +57,25 @@ public class EsElevator {
* 电梯识别码
*/
@Field(type = FieldType.Text)
private Integer rescueCode;
private String rescueCode;
/**
* 电梯经度
*/
@Field(type = FieldType.Text)
private String longitude;
@Field(type = FieldType.Double)
private Double longitude;
/**
* 电梯纬度
*/
@Field(type = FieldType.Text)
private String latitude;
@Field(type = FieldType.Double)
private Double latitude;
/**
* 经纬度字段
*/
@GeoPointField
private GeoPoint location;
/**
* 地址
......
......@@ -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>
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenanceCompanyDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.MyException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -28,9 +20,19 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.MyException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 维保单位
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSON;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.PostMapping;
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.springframework.web.multipart.MultipartFile;
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.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgPersonFormDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author fengwang
......
......@@ -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
......@@ -201,7 +201,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
Map<Long, OrgMenuDto> map = new HashMap<>(menuList.size());
menuList.forEach(e -> map.put(e.getKey(), e));
Set<? extends Map.Entry<Long, ? extends OrgMenuDto>> entries = map.entrySet();
entries.parallelStream().forEach(entry -> {
entries.stream().forEach(entry -> {
OrgMenuDto value = entry.getValue();
if (value != null) {
OrgMenuDto treeDto = map.get(value.getParentId());
......
......@@ -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;
}
}
......@@ -168,7 +168,7 @@ public class AlertCalledController extends BaseController {
* @return
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{id}")
@GetMapping(value = "/find/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<Object> selectById(@PathVariable Long id) {
......
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);
}
......@@ -5,18 +5,26 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.yeejoin.amos.latentdanger.exception.YeeException;
import org.apache.commons.io.FileUtils;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.usermodel.DVConstraint;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbookFactory;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
......@@ -28,18 +36,35 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.FileChannel;
import java.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.TreeSet;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
......@@ -62,33 +87,33 @@ public class FileHelper {
* @param file
* @return
*/
public static boolean isExcel2003(File file) {
InputStream is = null;
Workbook wb = null;
try {
is = new FileInputStream(file);
wb = WorkbookFactory.create(is);
if (wb instanceof XSSFWorkbook) {
return false;
} else if (wb instanceof HSSFWorkbook) {
return true;
}
} catch (Exception e) {
return false;
} finally {
try {
if (null != is) {
is.close();
}
if (null != wb) {
wb.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
// public static boolean isExcel2003(File file) {
// InputStream is = null;
// Workbook wb = null;
// try {
// is = new FileInputStream(file);
// wb = XSSFWorkbookFactory.createWorkbook(is);
// if (wb instanceof XSSFWorkbook) {
// return false;
// } else if (wb instanceof HSSFWorkbook) {
// return true;
// }
// } catch (Exception e) {
// return false;
// } finally {
// try {
// if (null != is) {
// is.close();
// }
// if (null != wb) {
// wb.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// return true;
// }
/**
*
......
......@@ -15,6 +15,12 @@
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-maintenance-api</artifactId>
<version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>easypoi-base</artifactId>
<groupId>cn.afterturn</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.yeejoin</groupId>
......@@ -71,6 +77,12 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.15</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
......@@ -87,6 +99,12 @@
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>1.13</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......
......@@ -139,28 +139,28 @@ public class FileHelper {
* @param file
* @return
*/
public static boolean isPPT2003(File file) {
InputStream is = null;
HSLFSlideShow ppt = null;
try {
is = new FileInputStream(file);
ppt = new HSLFSlideShow(is);
} catch (Exception e) {
return false;
} finally {
try {
if (null != is) {
is.close();
}
if (null != ppt) {
ppt.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
// public static boolean isPPT2003(File file) {
// InputStream is = null;
// HSLFSlideShow ppt = null;
// try {
// is = new FileInputStream(file);
// ppt = new HSLFSlideShow(is);
// } catch (Exception e) {
// return false;
// } finally {
// try {
// if (null != is) {
// is.close();
// }
// if (null != ppt) {
// ppt.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// return true;
// }
/**
*
......@@ -1109,12 +1109,13 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
//表头样式
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
// style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式poi 4.0.0+
//字体样式
HSSFFont fontStyle = wb.createFont();
fontStyle.setFontName("微软雅黑");
fontStyle.setFontHeightInPoints((short)12);
fontStyle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
// fontStyle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
style.setFont(fontStyle);
//新建sheet
......
......@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
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;
......@@ -311,4 +312,20 @@ public class LatentDangerController extends AbstractBaseController {
return CommonResponseUtil.failure(e.getMessage());
}
}
@ApiOperation(value = "隐患当前任务", notes = "隐患当前任务")
@GetMapping(value = "/detail/task/{processInstanceId}")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse detail(@PathVariable String processInstanceId) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
return CommonResponseUtil.success(iLatentDangerService.queryTaskByInstanceId(processInstanceId));
} catch (Exception e) {
logger.error("获取隐患任务出错", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
}
......@@ -90,6 +90,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.net.InetAddress;
import java.util.ArrayList;
......@@ -748,6 +749,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
LatentDangerDetailVo detailVo = new LatentDangerDetailVo();
if (latentDangerBo != null) {
detailVo.setDangerId(latentDangerBo.getId());
detailVo.setDangerIdWeb(String.valueOf(latentDangerBo.getId()));
detailVo.setDangerType(latentDangerBo.getDangerType());
// if(position.size()>0){
// detailVo.setPosition(position.get(latentDangerBo.getStructureId()).toString());
......@@ -799,6 +801,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// }
// }
detailVo.setCurrentFlowRecordId(latentDangerBo.getCurrentFlowRecordId());
detailVo.setCurrentFlowRecordIdWeb(String.valueOf(latentDangerBo.getCurrentFlowRecordId()));
if (!StringUtils.isEmpty(latentDangerBo.getReformJson())) {
detailVo.setReformJson(JSONObject.parseObject(latentDangerBo.getReformJson()));
}
......@@ -1657,4 +1660,18 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
}
return informerList;
}
@Override
public String queryTaskByInstanceId(String processInstanceId) {
String taskId = null;
JSONObject taskJson = remoteWorkFlowService.queryTask(processInstanceId);
if (null != taskJson) {
if (ValidationUtil.isEmpty(taskJson.get("data"))) {
return null;
}
JSONObject dataJson = (JSONObject) taskJson.get("data");
taskId = (String) dataJson.get("id");
}
return taskId;
}
}
......@@ -81,4 +81,6 @@ public interface ILatentDangerService {
List<DangerListResponse> export(PageParam pageParam);
List<DangerTimeAxisVo> queryExecuteLog(Integer dateTime);
String queryTaskByInstanceId(String processInstanceId);
}
......@@ -18,6 +18,7 @@ import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbookFactory;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
......@@ -63,33 +64,33 @@ public class FileHelper {
* @param file
* @return
*/
public static boolean isExcel2003(File file) {
InputStream is = null;
Workbook wb = null;
try {
is = new FileInputStream(file);
wb = WorkbookFactory.create(is);
if (wb instanceof XSSFWorkbook) {
return false;
} else if (wb instanceof HSSFWorkbook) {
return true;
}
} catch (Exception e) {
return false;
} finally {
try {
if (null != is) {
is.close();
}
if (null != wb) {
wb.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
// public static boolean isExcel2003(File file) {
// InputStream is = null;
// Workbook wb = null;
// try {
// is = new FileInputStream(file);
// wb = XSSFWorkbookFactory.createWorkbook(is);
// if (wb instanceof XSSFWorkbook) {
// return false;
// } else if (wb instanceof HSSFWorkbook) {
// return true;
// }
// } catch (Exception e) {
// return false;
// } finally {
// try {
// if (null != is) {
// is.close();
// }
// if (null != wb) {
// wb.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// return true;
// }
/**
*
......
......@@ -11,6 +11,8 @@ public class LatentDangerDetailVo {
private Long dangerId;
private String dangerIdWeb;
private String dangerName;
private String level;
......@@ -29,6 +31,8 @@ public class LatentDangerDetailVo {
private Long currentFlowRecordId;
private String currentFlowRecordIdWeb;
private String dangerState;
private String dangerType;
......
......@@ -68,6 +68,12 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.15</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
......@@ -78,7 +84,17 @@
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>1.13</version>
</dependency>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
......@@ -96,6 +112,56 @@
<artifactId>amos-boot-module-supervision-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.6.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
<exclusions>
<exclusion>
<artifactId>poi</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
</dependencies>
</project>
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.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.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
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 = "分页查询检查报告")
@GetMapping(value = "/page")
public ResponseModel queryPage(@RequestParam int current, @RequestParam int size,
@RequestParam(required = false) String name,
@RequestParam(required = false) String planName,
@RequestParam(required = false) String planCheckType,
@RequestParam(required = false) String checkLevel,
@RequestParam(required = false) String startCheckTime,
@RequestParam(required = false) String endCheckTime,
@RequestParam(required = false) String checkUser) throws ParseException {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
if (loginOrgCode.contains("-")) {
loginOrgCode = loginOrgCode.substring(0, loginOrgCode.indexOf("-"));
}
CheckReportParamDto queryParam = new CheckReportParamDto();
queryParam.setName(name);
queryParam.setPlanName(planName);
queryParam.setPlanCheckType(planCheckType);
queryParam.setCheckLevel(checkLevel);
if (!ValidationUtil.isEmpty(startCheckTime)) {
queryParam.setStartCheckTime(DateUtils.dateParse(startCheckTime, DateUtils.DATE_TIME_PATTERN));
}
if (!ValidationUtil.isEmpty(endCheckTime)) {
queryParam.setEndCheckTime(DateUtils.dateParse(endCheckTime, DateUtils.DATE_TIME_PATTERN));
}
queryParam.setCheckUser(checkUser);
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));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取检查报告文档", notes = "获取检查报告文档")
@GetMapping(value = "/docx/{id}")
public ResponseModel getCheckReportDocx(HttpServletResponse response, @PathVariable(name = "id") String reportId) throws Exception {
return ResponseHelper.buildResponse(iCheckReportService.getCheckReportDocx(response, reportId));
}
}
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 javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
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);
/**
* 生成指定报告的word文档
*
* @param response
* @param reportId
* @return
*/
Object getCheckReportDocx(HttpServletResponse response, String reportId) throws Exception;
}
......@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.alibaba.excel.metadata.Sheet;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
......@@ -139,28 +140,28 @@ public class FileHelper {
* @param file
* @return
*/
public static boolean isPPT2003(File file) {
InputStream is = null;
HSLFSlideShow ppt = null;
try {
is = new FileInputStream(file);
ppt = new HSLFSlideShow(is);
} catch (Exception e) {
return false;
} finally {
try {
if (null != is) {
is.close();
}
if (null != ppt) {
ppt.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return true;
}
// public static boolean isPPT2003(File file) {
// InputStream is = null;
// HSLFSlideShow ppt = null;
// try {
// is = new FileInputStream(file);
// ppt = new HSLFSlideShow(is);
// } catch (Exception e) {
// return false;
// } finally {
// try {
// if (null != is) {
// is.close();
// }
// if (null != ppt) {
// ppt.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// return true;
// }
/**
*
......@@ -1109,12 +1110,14 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
//表头样式
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
style.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式
//字体样式
HSSFFont fontStyle = wb.createFont();
fontStyle.setFontName("微软雅黑");
fontStyle.setFontHeightInPoints((short)12);
fontStyle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
fontStyle.setBold(true);
style.setFont(fontStyle);
//新建sheet
......@@ -1225,8 +1228,7 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
* @return DataValidation
* @throws
*/
private static DataValidation setDataValidation(Sheet sheet, String[] textList, int firstRow, int endRow, int firstCol, int endCol) {
private static DataValidation setDataValidation(HSSFSheet sheet, String[] textList, int firstRow, int endRow, int firstCol, int endCol) {
DataValidationHelper helper = sheet.getDataValidationHelper();
//加载下拉列表内容
DataValidationConstraint constraint = helper.createExplicitListConstraint(textList);
......
......@@ -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,41 @@ 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);
String provinceCode = tempCode.substring(2,6);
if("0000".equals(provinceCode)) {// 为省则默认使用用户现有权限查询数据
regionCodes = useRegionCode;
} else {
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 +717,66 @@ 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);
String provinceCode = tempCode.substring(2,6);
if("0000".equals(provinceCode)) {// 为省则默认使用用户现有权限查询数据
regionCodes = useRegionCode;
} else {
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<>();
......
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.feign.AmosFeignService;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorBaseInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorMaintenanceInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorNewDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorTestInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorWlInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EsElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EsSpecialEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.EsSpecialEquipmentListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.SpecialEquipmentDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintainInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.TestInfo;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorRelationService;
import com.yeejoin.amos.boot.module.tzs.api.service.IElevatorService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.MaintainInfoServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TestInfoServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 特种设备API
*/
@RestController
@Api(tags = "特种设备API")
@RequestMapping(value = "/special-equipment")
public class SpecialEquipmentController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(SpecialEquipmentController.class);
@Autowired
IElevatorService iElevatorService;
@Autowired
ElevatorServiceImpl elevatorService;
@Autowired
private AmosFeignService amosFeignService;
@Autowired
private MaintainInfoServiceImpl maintainInfoService;
@Autowired
private EquipFeignClient equipFeignClient;
@Autowired
private TestInfoServiceImpl testInfoService;
@Autowired
ESElevatorServiceImpl esElevatorService;
@Autowired
private EmqKeeper emqKeeper;
@Value("${mqtt.topic.elevator.push}")
private String elevatorpushTopic;
@Autowired
private IElevatorRelationService elevatorRelationService;
/**
* ES查询特种设备信息 带分页 加经纬度过滤 keyword 搜索
*
* @return 查询结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/querySpecialEquipmentListPage", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "ES查询特种设备信息带分页 ", notes = "ES查询特种设备信息带分页")
public ResponseModel<Page<SpecialEquipmentDto>> querySpecialEquipmentListPage(@RequestBody EsSpecialEquipmentDto esSpecialEquipmentDto
, @RequestParam(value = "current") int current, @RequestParam(value = "size") int size){
Page<SpecialEquipmentDto> result = null;
if (ValidationUtil.isEmpty(esSpecialEquipmentDto.getCategoryCode())) {
throw new BadRequest("参数校验失败.");
}
if(StringUtils.isNotBlank(esSpecialEquipmentDto.getCategoryCode())) { // 查找特定设备
if("3000".equals(esSpecialEquipmentDto.getCategoryCode())) {
result = esElevatorService.queryPageByDto(esSpecialEquipmentDto, current, size);
}
}
return ResponseHelper.buildResponse(result);
}
/**
* ES查询特种设备信息 不带分页 加经纬度过滤 keyword 搜索
*
* @return 查询结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/querySpecialEquipmentList", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "ES查询特种设备信息不带分页", notes = "ES查询特种设备信息不带分页")
public ResponseModel<List<SpecialEquipmentDto>> querySpecialEquipmentList(@RequestBody EsSpecialEquipmentDto esSpecialEquipmentDto){
List<SpecialEquipmentDto> result = new ArrayList<>();
if (ValidationUtil.isEmpty(esSpecialEquipmentDto.getCategoryCode())) {
throw new BadRequest("参数校验失败.");
}
if(StringUtils.isNotBlank(esSpecialEquipmentDto.getCategoryCode())) { // 查找特定设备
if("3000".equals(esSpecialEquipmentDto.getCategoryCode())) {
result = esElevatorService.queryByDto(esSpecialEquipmentDto);
}
}
return ResponseHelper.buildResponse(result);
}
/**
* ES查询特种设备聚合信息
*
* @return 查询结果
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/queryTogetherByDto", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "ES查询聚合信息", notes = "ES查询聚合信息")
public ResponseModel<List<Map<String, String>>> queryTogetherByDto(@RequestBody EsSpecialEquipmentDto esSpecialEquipmentDto){
List<Map<String, String>> result = new ArrayList<>();
if (ValidationUtil.isEmpty(esSpecialEquipmentDto.getCategoryCode()) ||
ValidationUtil.isEmpty(esSpecialEquipmentDto.getPrecision()) ||
ValidationUtil.isEmpty(esSpecialEquipmentDto.getStartLatitude()) ||
ValidationUtil.isEmpty(esSpecialEquipmentDto.getStartLongitude()) ||
ValidationUtil.isEmpty(esSpecialEquipmentDto.getEndLatitude()) ||
ValidationUtil.isEmpty(esSpecialEquipmentDto.getEndLongitude())) {
throw new BadRequest("参数校验失败.");
}
if(StringUtils.isNotBlank(esSpecialEquipmentDto.getCategoryCode())) { // 查找特定设备
if("3000".equals(esSpecialEquipmentDto.getCategoryCode())) {
result = esElevatorService.queryTogetherByDto(esSpecialEquipmentDto);
}
}
return ResponseHelper.buildResponse(result);
}
/***
* keyword 区域 查询八大类总数
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/queryEquipNum", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "查询八大类总数", notes = "查询八大类总数")
public ResponseModel<Map<String, Long>> queryEquipNum(@RequestBody EsSpecialEquipmentDto esSpecialEquipmentDto){
Map<String, Long> result = new HashMap<>();
// 锅炉
Long boiler = 0l;
result.put("1000",boiler);
// 压力容器
Long vessel = 0l;
result.put("2000",vessel);
// 电梯
Long elevator = esElevatorService.queryNumberByDto(esSpecialEquipmentDto);
result.put("3000",elevator);
// 起重机械
Long crane = 0l;
result.put("4000",crane);
// 大型游乐设施
Long facility = 0l;
result.put("6000",facility);
// 大型游乐设施
return ResponseHelper.buildResponse(result);
}
}
......@@ -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
......@@ -18,6 +18,12 @@
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
......
......@@ -2093,6 +2093,42 @@
) COMMENT = '消防水源物联参数' ;
</sql>
</changeSet>
<changeSet author="chenhao" id="2021-11-05-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="cb_maintenance_company" columnName="parent_name"/>
</not>
</preConditions>
<comment>update data cb_fire_team</comment>
<sql>
ALTER TABLE cb_maintenance_company ADD parent_name varchar(100) NULL COMMENT '所属单位/部门名称';
</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
......
......@@ -14,6 +14,24 @@
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-supervision-biz</artifactId>
<version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<artifactId>easypoi-base</artifactId>
<groupId>cn.afterturn</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-ooxml-schemas</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
<exclusion>
<artifactId>poi-scratchpad</artifactId>
<groupId>org.apache.poi</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
......
<?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 cr.start_check_date <![CDATA[>=]]> #{queryParam.startCheckTime}
</if>
<if test="queryParam != null and queryParam.endCheckTime != null">
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,
p.plan_type planCheckFrequencyType
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,
......
......@@ -16,6 +16,10 @@
<artifactId>amos-boot-module-tzs-biz</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
</dependencies>
<build>
......
spring.application.name=TZS
spring.application.name=TZS-kfm
server.servlet.context-path=/tzs
server.port=11000
spring.profiles.active=dev
......@@ -8,6 +8,10 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
##liquibase
spring.liquibase.change-log = classpath:/db/changelog/changelog-master.xml
spring.liquibase.enabled= true
## DB properties:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
......
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<include file="tzs-1.0.0.0.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
liqiubase 有新改动,提交测试,需查看是否执行成功,以免造成执行失败,数据不能同步,造成数据不统一
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">
<changeSet author="kongfm" id="2021-11-09">
<preConditions onFail="MARK_RAN">
<tableExists tableName="tz_template_export"/>
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="tz_template_export"/>
</not>
</preConditions>
<comment>insert record export temp</comment>
<sql>
INSERT INTO tz_template_export (
`sequence_nbr`,
`template_name`,
`template_content`,
`template_type`,
`is_standard`,
`rec_user_name`,
`rec_user_id`,
`rec_date`,
`is_delete`
)
VALUES
(
'7',
'标准模板',
'[{\"key\":\"tel\",\"value\":\"电话号码\"},{\"key\":\"telStartTime\",\"value\":\"通话开始时间\"},{\"key\":\"telEndTime\",\"value\":\"通话结束时间\"},{\"key\":\"telTime\",\"value\":\"通话时长\"},{\"key\":\"fileType\",\"value\":\"通话类型\"},{\"key\":\"workNum\",\"value\":\"关联工单编号\"}]',
'VOICE_RECORD',
true,
NULL,
NULL,
NULL,
'\0'
);
</sql>
</changeSet>
</databaseChangeLog>
This diff is collapsed.
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