Commit 258a08e1 authored by chenhao's avatar chenhao

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

parents 13284bdc b5bdce97
package com.yeejoin.amos.boot.biz.common.constants;
/**
* @Author: xl
* @Description: 终端标识
* @Date: 2021/11/17 11:40
*/
public class TerminalConstant {
public final static String APP = "APP";
public final static String WEB = "WEB";
public final static String APP_WEB = "APP/WEB";
}
...@@ -349,4 +349,29 @@ public class DataDictionaryController extends BaseController { ...@@ -349,4 +349,29 @@ public class DataDictionaryController extends BaseController {
return ResponseHelper.buildResponse(type); return ResponseHelper.buildResponse(type);
} }
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionaryNotoken/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典不验证token", notes = "根据字典类型查询字典不验证token")
public ResponseModel<Object> gwmcDataDictionaryNotoken(@PathVariable String type) throws Exception {
// 数据字典生成树方法 原先通过getCode做主键 现修改为 getSequenceNbr 后期数据字典parent字段保存id 而不要保存code by
// kongfm 2021-09-08
// 数据字典还原 by kongfm 2021-09-09
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type);
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName",
"getParent", null);
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
} }
package com.yeejoin.amos.boot.biz.common.enums;
import com.yeejoin.amos.boot.biz.common.constants.TerminalConstant;
/**
* 规则请求枚举
* @author xl
*
*/
public enum RuleTypeEnum {
// 防火监督
计划提交("计划提交", "addPlan","auditPage", TerminalConstant.WEB),
计划审核("计划审核", "planAudit", "auditPage", TerminalConstant.APP_WEB),
计划审核完成("计划审核完成", "planAuditAll", "formulatePage", TerminalConstant.APP_WEB),
计划生成("计划生成", "addPlanTask", null, TerminalConstant.APP),
计划完成("计划完成", "planCompleted", null, TerminalConstant.APP_WEB),
// 隐患
隐患第一次提交("隐患提交", "addLatentDanger", null, null),
隐患审核("隐患审核", "dangerAudit", null, null);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 跳转地址
*/
private String url;
/**
* 终端标识
*/
private String terminal;
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 getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getTerminal() {
return terminal;
}
public void setTerminal(String terminal) {
this.terminal = terminal;
}
RuleTypeEnum(String name, String code, String url, String terminal) {
this.name = name;
this.code = code;
this.url = url;
this.terminal = terminal;
}
public static RuleTypeEnum getEnumByCode(String field){
for (RuleTypeEnum constants : values()) {
if (constants.getCode().equals(field)) {
return constants;
}
}
return null;
}
}
package com.yeejoin.amos.supervision.rule.action; package com.yeejoin.amos.boot.biz.common.rule.action;//package com.yeejoin.amos.latentdanger.business.rule.action;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.component.rule.RuleActionBean; import com.yeejoin.amos.boot.biz.common.utils.RuleUtils;
import com.yeejoin.amos.component.rule.RuleMethod;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
import com.yeejoin.amos.supervision.business.util.MsgParamUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -17,16 +15,14 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -17,16 +15,14 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
* @Date: 2021/11/10 11:49 * @Date: 2021/11/10 11:49
*/ */
@Component @Component
@RuleActionBean(beanLabel = "消息发送")
public class MessageAction { public class MessageAction {
public static final Logger log = LoggerFactory.getLogger(MessageAction.class); public static final Logger log = LoggerFactory.getLogger(MessageAction.class);
@RuleMethod(methodLabel = "消息发送", project = "消息")
public void sendMessage(Object msgObj, String title, String content) { public void sendMessage(Object msgObj, String title, String content) {
MessageModel messageModel = JSON.parseObject(JSON.toJSONString(msgObj), MessageModel.class); MessageModel messageModel = JSON.parseObject(JSON.toJSONString(msgObj), MessageModel.class);
messageModel.setTitle(title); messageModel.setTitle(title);
messageModel.setBody(MsgParamUtils.instedParams(content, msgObj)); messageModel.setBody(RuleUtils.instedParams(content, msgObj));
if (!ValidationUtil.isEmpty(messageModel)) { if (!ValidationUtil.isEmpty(messageModel)) {
try { try {
Systemctl.messageClient.create(messageModel); Systemctl.messageClient.create(messageModel);
......
...@@ -821,6 +821,13 @@ public class DateUtils { ...@@ -821,6 +821,13 @@ public class DateUtils {
return getDate(calendar.getTime()); return getDate(calendar.getTime());
} }
public static Date getBeginDateOfMonth(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH));
return calendar.getTime();
}
/** /**
* 将秒数转换为时分秒格式 * 将秒数转换为时分秒格式
* *
......
...@@ -40,6 +40,9 @@ public class RedisKey { ...@@ -40,6 +40,9 @@ public class RedisKey {
/**联通CTIuser token */ /**联通CTIuser token */
public static final String CTI_USER_TOKEN = "cti_user_token"; public static final String CTI_USER_TOKEN = "cti_user_token";
/** 企业用户注册前缀 */
public static final String FLC_USER_TEL = "flc_tel_";
/** 驼峰转下划线(简单写法,效率低于 ) */ /** 驼峰转下划线(简单写法,效率低于 ) */
public static String humpToLine(String str) { public static String humpToLine(String str) {
return str.replaceAll("[A-Z]", "_$0").toLowerCase(); return str.replaceAll("[A-Z]", "_$0").toLowerCase();
......
package com.yeejoin.amos.boot.biz.common.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Map;
/**
* @Author: xl
* @Description:
* @Date: 2021/11/12 18:37
*/
public class RuleUtils {
public static String instedParams(String content, Object msgObj) {
Map<String, Object> strengthMap = JSON.parseObject(JSON.toJSONString(msgObj, SerializerFeature.WriteMapNullValue), Map.class);
for (String key : strengthMap.keySet())
content = content.replaceAll("\\$\\{" + key + "}", String.valueOf(ValidationUtil.isEmpty(strengthMap.get(key)) ? "" : strengthMap.get(key)));
return content;
}
}
...@@ -60,6 +60,9 @@ public class FireBuildingDto extends BaseDto { ...@@ -60,6 +60,9 @@ public class FireBuildingDto extends BaseDto {
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private String lat; private String lat;
@ApiModelProperty(value = "位置")
private String position;
@ApiModelProperty(value = "子节点") @ApiModelProperty(value = "子节点")
private List<FireBuildingDto> children; private List<FireBuildingDto> children;
} }
...@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
/** /**
...@@ -14,8 +15,8 @@ import java.util.Date; ...@@ -14,8 +15,8 @@ import java.util.Date;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value="FireEquipmentAlarmDto", description="设备报警信息表") @ApiModel(value = "FireEquipmentSignalDto", description = "设备报警信息表")
public class FireEquipmentAlarmDto extends BaseDto { public class FireEquipmentSignalDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -58,24 +59,6 @@ public class FireEquipmentAlarmDto extends BaseDto { ...@@ -58,24 +59,6 @@ public class FireEquipmentAlarmDto extends BaseDto {
@ApiModelProperty(value = "告警恢复时间") @ApiModelProperty(value = "告警恢复时间")
private Date recoveryDate; private Date recoveryDate;
@ApiModelProperty(value = "确认类型")
private String confirmType;
@ApiModelProperty(value = "报警原因")
private String alamReason;
@ApiModelProperty(value = "处理情况")
private String resolveResult;
@ApiModelProperty(value = "确警人员")
private String confirmUser;
@ApiModelProperty(value = "确警人员姓名")
private String confirmUserName;
@ApiModelProperty(value = "确警时间")
private Date confirmDate;
@ApiModelProperty(value = "装备所属消防系统code") @ApiModelProperty(value = "装备所属消防系统code")
private String systemMrids; private String systemMrids;
......
...@@ -15,8 +15,8 @@ import java.util.Date; ...@@ -15,8 +15,8 @@ import java.util.Date;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value = "FireEquipmentAlarmLogDto", description = "设备报警信息日志表") @ApiModel(value = "FireEquipmentSignalLogDto", description = "设备报警信息日志表")
public class FireEquipmentAlarmLogDto extends BaseDto { public class FireEquipmentSignalLogDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -45,10 +45,10 @@ public class FireEquipmentAlarmLogDto extends BaseDto { ...@@ -45,10 +45,10 @@ public class FireEquipmentAlarmLogDto extends BaseDto {
private String fireBuildingMrid; private String fireBuildingMrid;
@ApiModelProperty(value = "报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)") @ApiModelProperty(value = "报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)")
private String alarmType; private String signalType;
@ApiModelProperty(value = "报警类型名称") @ApiModelProperty(value = "报警类型名称")
private String alarmTypeName; private String signalTypeName;
@ApiModelProperty(value = "确认状态:0-未确认 1-已确认") @ApiModelProperty(value = "确认状态:0-未确认 1-已确认")
private String confirmState; private String confirmState;
...@@ -94,4 +94,10 @@ public class FireEquipmentAlarmLogDto extends BaseDto { ...@@ -94,4 +94,10 @@ public class FireEquipmentAlarmLogDto extends BaseDto {
@ApiModelProperty(value = "换流站纬度") @ApiModelProperty(value = "换流站纬度")
private String stationLat; private String stationLat;
@ApiModelProperty(value = "告警日期(冗余查询,为create_date的日期部分,如:2021-11-15")
private String signalReportDate;
@ApiModelProperty(value = "是否为告警信号数据")
private Boolean isAlarm;
} }
...@@ -16,7 +16,7 @@ import java.util.Date; ...@@ -16,7 +16,7 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ApiModel(value = "FireAlarmDayStatisticsDto", description = "换流站告警日统计") @ApiModel(value = "FireAlarmDayStatisticsDto", description = "换流站告警日统计")
public class FireAlarmDayStatisticsDto extends BaseDto { public class FireSignalDayStatisticsDto extends BaseDto {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -30,19 +30,17 @@ public class FireAlarmDayStatisticsDto extends BaseDto { ...@@ -30,19 +30,17 @@ public class FireAlarmDayStatisticsDto extends BaseDto {
@ApiModelProperty(value = "统计日期") @ApiModelProperty(value = "统计日期")
private Date collectDate; private Date collectDate;
@ApiModelProperty(value = "装备定义mrid") @ApiModelProperty(value = "上报次数")
private String equipmentDefinitionMrid; private Integer reportTimes;
@ApiModelProperty(value = "装备定义名称") @ApiModelProperty(value = "信号类型")
private String equipmentDefinitionName; private String signalType;
@ApiModelProperty(value = "报警次数") @ApiModelProperty(value = "信号类型名称")
private Integer alarmTimes; private String signalTypeName;
@ApiModelProperty(value = "告警类型") @ApiModelProperty(value = "是否为告警信号数据")
private String alarmType; private Boolean isAlarm;
@ApiModelProperty(value = "告警类型名称")
private String alarmTypeName;
} }
...@@ -54,4 +54,7 @@ public class FireWaterDto extends BaseDto { ...@@ -54,4 +54,7 @@ public class FireWaterDto extends BaseDto {
@ApiModelProperty(value = "纬度") @ApiModelProperty(value = "纬度")
private String lat; private String lat;
@ApiModelProperty(value = "安装位置")
private String position;
} }
...@@ -97,4 +97,9 @@ public class FireBuilding extends BaseEntity { ...@@ -97,4 +97,9 @@ public class FireBuilding extends BaseEntity {
@TableField("lat") @TableField("lat")
private String lat; private String lat;
/**
* 详情位置
*/
private String position;
} }
...@@ -17,8 +17,8 @@ import java.util.Date; ...@@ -17,8 +17,8 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("asf_fire_equipment_alarm") @TableName("asf_fire_equipment_signal")
public class FireEquipmentAlarm extends BaseEntity { public class FireEquipmentSignal extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -101,42 +101,6 @@ public class FireEquipmentAlarm extends BaseEntity { ...@@ -101,42 +101,6 @@ public class FireEquipmentAlarm extends BaseEntity {
private Date recoveryDate; private Date recoveryDate;
/** /**
* 确认类型
*/
@TableField("confirm_type")
private String confirmType;
/**
* 报警原因
*/
@TableField("alam_reason")
private String alamReason;
/**
* 处理情况
*/
@TableField("resolve_result")
private String resolveResult;
/**
* 确警人员
*/
@TableField("confirm_user")
private String confirmUser;
/**
* 确警人员姓名
*/
@TableField("confirm_user_name")
private String confirmUserName;
/**
* 确警时间
*/
@TableField("confirm_date")
private Date confirmDate;
/**
* 装备所属消防系统code * 装备所属消防系统code
*/ */
@TableField("system_mrids") @TableField("system_mrids")
......
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.ccs.api.entity; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.ccs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -18,8 +17,8 @@ import java.util.Date; ...@@ -18,8 +17,8 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("asf_fire_equipment_alarm_log") @TableName("asf_fire_equipment_signal_log")
public class FireEquipmentAlarmLog extends BaseEntity { public class FireEquipmentSignalLog extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -72,15 +71,15 @@ public class FireEquipmentAlarmLog extends BaseEntity { ...@@ -72,15 +71,15 @@ public class FireEquipmentAlarmLog extends BaseEntity {
private String fireBuildingMrid; private String fireBuildingMrid;
/** /**
* 报警类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警) * 信号类型:alarm_type_fire(火灾报警)/alarm_type_trouble(故障告警)
*/ */
@TableField("alarm_type") @TableField("signal_type")
private String alarmType; private String signalType;
/** /**
* 报警类型名称 * 信号类型名称
*/ */
private String alarmTypeName; private String signalTypeName;
/** /**
* 确认状态:0-未确认 1-已确认 * 确认状态:0-未确认 1-已确认
...@@ -160,4 +159,14 @@ public class FireEquipmentAlarmLog extends BaseEntity { ...@@ -160,4 +159,14 @@ public class FireEquipmentAlarmLog extends BaseEntity {
@TableField("lat") @TableField("lat")
private String lat; private String lat;
/**
* 告警日期(冗余查询,为create_date的日期部分,如:2021-11-15)
*/
private String signalReportDate;
/**
* 是否为告警信号数据
*/
private Boolean isAlarm;
} }
...@@ -9,7 +9,7 @@ import lombok.experimental.Accessors; ...@@ -9,7 +9,7 @@ import lombok.experimental.Accessors;
import java.util.Date; import java.util.Date;
/** /**
* 换流站告警日统计 * 设备信号类型上报次数日统计
* *
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
...@@ -17,8 +17,8 @@ import java.util.Date; ...@@ -17,8 +17,8 @@ import java.util.Date;
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Accessors(chain = true) @Accessors(chain = true)
@TableName("asf_fire_alarm_day_statistics") @TableName("asf_fire_signal_day_statistics")
public class FireAlarmDayStatistics extends BaseEntity { public class FireSignalDayStatistics extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,33 +41,27 @@ public class FireAlarmDayStatistics extends BaseEntity { ...@@ -41,33 +41,27 @@ public class FireAlarmDayStatistics extends BaseEntity {
private Date collectDate; private Date collectDate;
/** /**
* 装备定义mrid * 报警次数
*/ */
@TableField("equipment_definition_mrid") @TableField("report_times")
private String equipmentDefinitionMrid; private Integer reportTimes;
/** /**
* 装备定义名称 * 信号类型
*/ */
@TableField("equipment_definition_name") @TableField("signal_type")
private String equipmentDefinitionName; private String signalType;
/** /**
* 报警次数 * 信号类型名称
*/ */
@TableField("alarm_times") @TableField("signal_type_name")
private Integer alarmTimes; private String signalTypeName;
/** /**
* 告警类型 * 是否为告警信号数据
*/ */
@TableField("alarm_type") private Boolean isAlarm;
private String alarmType;
/**
* 告警类型名称
*/
@TableField("alarm_type_name")
private String alarmTypeName;
} }
...@@ -92,4 +92,9 @@ public class FireWater extends BaseEntity { ...@@ -92,4 +92,9 @@ public class FireWater extends BaseEntity {
@TableField("lat") @TableField("lat")
private String lat; private String lat;
/**
* 安装位置
*/
@TableField("position")
private String position;
} }
package com.yeejoin.amos.boot.module.ccs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import javax.ws.rs.GET;
/**
* @author DELL
*/
@AllArgsConstructor
@Getter
public enum SignalTypeOfAlarm {
/**
* 特殊统计信号类型枚举
*/
FAULT_ALARM("faultAlarm","故障告警"),
FIRE_ALARM("fireAlarm","火灾告警"),
SHIELD_ALARM("shieldAlarm","屏蔽"),
OIL_LEAK_ALARM("oilLeakAlarm","漏油"),
ALARM("alarm","告警");
private String code;
private String name;
}
package com.yeejoin.amos.boot.module.ccs.api.mapper; package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentAlarmLogDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentSignalLogDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentAlarmLog; import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -14,7 +15,7 @@ import java.util.Map; ...@@ -14,7 +15,7 @@ import java.util.Map;
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
*/ */
public interface FireEquipmentAlarmLogMapper extends BaseMapper<FireEquipmentAlarmLog> { public interface FireEquipmentSignalLogMapper extends BaseMapper<FireEquipmentSignalLog> {
/** /**
* 告警日志 * 告警日志
...@@ -22,5 +23,13 @@ public interface FireEquipmentAlarmLogMapper extends BaseMapper<FireEquipmentAla ...@@ -22,5 +23,13 @@ public interface FireEquipmentAlarmLogMapper extends BaseMapper<FireEquipmentAla
* @param params 查询参数 * @param params 查询参数
* @return List<FireEquipmentAlarmLogDto> * @return List<FireEquipmentAlarmLogDto>
*/ */
List<FireEquipmentAlarmLogDto> queryAlarmLogList(Map<String, Object> params); List<FireEquipmentSignalLogDto> queryAlarmLogList(Map<String, Object> params);
/**
* 查询指定日期的告警设备(去重)
* @param stationCode 换流站编号
* @param alarmDate 告警日期
* @return List<FireEquipmentDto>
*/
List<FireEquipmentDto> distinctByEquipmentId(@Param("stationCode") String stationCode, @Param("alarmDate") String alarmDate);
} }
package com.yeejoin.amos.boot.module.ccs.api.mapper; package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentAlarm; import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 设备报警信息表 Mapper 接口 * 设备报警信息表 Mapper 接口
...@@ -9,6 +14,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,6 +14,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
*/ */
public interface FireEquipmentAlarmMapper extends BaseMapper<FireEquipmentAlarm> { public interface FireEquipmentSignalMapper extends BaseMapper<FireEquipmentSignal> {
/**
* 装备定义告警数量统计
* @param top 限制条数
* @param date 日期
* @return List<Map<String, Object>>
*/
List<Map<String, Object>> faultEquipTopCount(@Param("top") Long top, @Param("currentDate") Date date);
} }
package com.yeejoin.amos.boot.module.ccs.api.mapper; package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRiskSourceDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireRiskSource; import com.yeejoin.amos.boot.module.ccs.api.entity.FireRiskSource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 风险点表 Mapper 接口 * 风险点表 Mapper 接口
...@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface FireRiskSourceMapper extends BaseMapper<FireRiskSource> { public interface FireRiskSourceMapper extends BaseMapper<FireRiskSource> {
List<FireRiskSourceDto> queryForRpnDescList(@Param("stationCode") String stationCode, @Param("top") String top);
} }
package com.yeejoin.amos.boot.module.ccs.api.mapper; package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireRpnChangeLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireRpnChangeLog;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.Map;
/** /**
* 风险点变化流水 Mapper 接口 * 风险点变化流水 Mapper 接口
...@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface FireRpnChangeLogMapper extends BaseMapper<FireRpnChangeLog> { public interface FireRpnChangeLogMapper extends BaseMapper<FireRpnChangeLog> {
Map<String, Object> queryForRiseUp(@Param("stationCode") String stationCode, @Param("type") String type);
} }
package com.yeejoin.amos.boot.module.ccs.api.mapper; package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireAlarmDayStatistics; import com.yeejoin.amos.boot.module.ccs.api.entity.FireSignalDayStatistics;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
*/ */
public interface FireAlarmDayStatisticsMapper extends BaseMapper<FireAlarmDayStatistics> { public interface FireSignalDayStatisticsMapper extends BaseMapper<FireSignalDayStatistics> {
/** /**
* 告警次数-折线图使用 * 告警次数-折线图使用
...@@ -22,5 +22,5 @@ public interface FireAlarmDayStatisticsMapper extends BaseMapper<FireAlarmDaySta ...@@ -22,5 +22,5 @@ public interface FireAlarmDayStatisticsMapper extends BaseMapper<FireAlarmDaySta
* @param endDate 结束日期 * @param endDate 结束日期
* @return List<String> * @return List<String>
*/ */
List<String> queryAlarmTimesTrend(@Param("stationCode") String stationCode, @Param("beginDate") String beginDate, @Param("endDate") String endDate); List<String> queryAlarmTimesTrend(@Param("stationCode") String stationCode, @Param("beginDate") String beginDate, @Param("endDate") String endDate,@Param("signalType") String signalType);
} }
...@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper; ...@@ -3,8 +3,10 @@ package com.yeejoin.amos.boot.module.ccs.api.mapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo; import com.yeejoin.amos.boot.module.ccs.api.entity.FireStationInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 站端信息表 Mapper 接口 * 站端信息表 Mapper 接口
...@@ -20,4 +22,14 @@ public interface FireStationInfoMapper extends BaseMapper<FireStationInfo> { ...@@ -20,4 +22,14 @@ public interface FireStationInfoMapper extends BaseMapper<FireStationInfo> {
* @param orderBy * @param orderBy
*/ */
List<FireStationInfoDto> queryStationListWithStatistics(String orderBy); List<FireStationInfoDto> queryStationListWithStatistics(String orderBy);
/**
* 换流站装备信息
* @param stationCode
* @param stationName
* @return
*/
List<Map<String, Object>> queryStationEquipInfo(@Param("stationCode") String stationCode, @Param("stationName") String stationName);
List<Map<String, Object>> lastYearAlarmCount();
} }
package com.yeejoin.amos.boot.module.ccs.api.service;
/**
* 设备报警信息日志表接口类
*
* @author system_generator
* @date 2021-11-09
*/
public interface IFireEquipmentAlarmLogService {
}
package com.yeejoin.amos.boot.module.ccs.api.service; package com.yeejoin.amos.boot.module.ccs.api.service;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
/** /**
* 消防设备资产接口类 * 消防设备资产接口类
* *
...@@ -9,4 +13,28 @@ package com.yeejoin.amos.boot.module.ccs.api.service; ...@@ -9,4 +13,28 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
*/ */
public interface IFireEquipmentService { public interface IFireEquipmentService {
/**
* 物联接入汇总
*
* @param stationCode 换流站编号
* @return Map<String, Object>
*/
Map<String, Object> selectForMonitorCount(String stationCode) throws ParseException;
/**
* 站端物联设备
*
* @param stationCode 换流站code
* @param stationName
* @return List<FireStationInfoDto>
*/
List<Map<String, Object>> stationEquipmentInfo(String stationCode, String stationName);
/**
* 故障设备汇总
*
* @param top 上限数量
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> faultEquipTopCount(Long top);
} }
...@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.ccs.api.service; ...@@ -2,11 +2,11 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
/** /**
* 换流站告警日统计接口 * 设备信号信息日志表
* *
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
*/ */
public interface IFireAlarmDayStatisticsService { public interface IFireEquipmentSignalLogService {
} }
...@@ -7,6 +7,6 @@ package com.yeejoin.amos.boot.module.ccs.api.service; ...@@ -7,6 +7,6 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
*/ */
public interface IFireEquipmentAlarmService { public interface IFireEquipmentSignalService {
} }
package com.yeejoin.amos.boot.module.ccs.api.service; package com.yeejoin.amos.boot.module.ccs.api.service;
import java.util.Map;
/** /**
* 风险点变化流水接口类 * 风险点变化流水接口类
* *
...@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.ccs.api.service; ...@@ -9,4 +11,5 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
*/ */
public interface IFireRpnChangeLogService { public interface IFireRpnChangeLogService {
Map<String,Object> queryForRiseUp(String stationCode);
} }
package com.yeejoin.amos.boot.module.ccs.api.service;
import java.text.ParseException;
import java.util.Map;
/**
* 换流站告警日统计接口类
*
* @author system_generator
* @date 2021-11-09
*/
public interface IFireSignalDayStatisticsService {
/**
* 警情信息
*
* @return Map<String, Object>
*/
Map<String, Object> selectForAlarmCount() throws ParseException;
/**
* 警情变化趋势
*
* @param beginData 开始日期
* @param endData 接受日期
* @return Map<String, Object>
*/
Map<String, Object> selectForAlarmTrend(String beginData, String endData);
/**
* 警情类型占比
* @param beginData 开始日期
* @param endData 结束日期
* @return Map<String, Object>
*/
Map<String, Object> todayAlarmPercent(String beginData, String endData);
}
package com.yeejoin.amos.boot.module.ccs.api.service; package com.yeejoin.amos.boot.module.ccs.api.service;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto;
/** /**
* 站端信息表接口类 * 站端信息表接口类
* *
...@@ -9,4 +11,10 @@ package com.yeejoin.amos.boot.module.ccs.api.service; ...@@ -9,4 +11,10 @@ package com.yeejoin.amos.boot.module.ccs.api.service;
*/ */
public interface IFireStationInfoService { public interface IFireStationInfoService {
/**
* 详情
* @param stationCode
* @return
*/
FireStationInfoDto getOneByCode(String stationCode);
} }
...@@ -23,4 +23,10 @@ public interface IStatisticsService { ...@@ -23,4 +23,10 @@ public interface IStatisticsService {
* @return Map<String, Object> * @return Map<String, Object>
*/ */
Map<String, Object> alarmAndDangerTrend(String stationCode, String beginDate, String endDate); Map<String, Object> alarmAndDangerTrend(String stationCode, String beginDate, String endDate);
/**
* 近一年警情统计
* @return List<Map<String, Object>>
*/
List<Map<String, Object>> lastYearAlarmCount();
} }
<?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.ccs.api.mapper.FireEquipmentAlarmMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentAlarmLogMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalLogMapper">
<select id="queryAlarmLogList" <select id="queryAlarmLogList"
resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentAlarmLogDto"> resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentSignalLogDto">
select select
a.id, a.id,
a.fire_equipment_name, a.fire_equipment_name,
a.fire_equipment_index_name, a.fire_equipment_index_name,
a.alarm_type, a.signal_type,
a.alarm_type_name, a.signal_type_name,
a.create_date, a.create_date,
s.name as station_name, s.name as station_name,
a.station_code, a.station_code,
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
s.lat as stationLat, s.lat as stationLat,
s.lng as stationLng s.lng as stationLng
from from
asf_fire_equipment_alarm_log a, asf_fire_equipment_signal_log a,
asf_fire_station_info s asf_fire_station_info s
where where
a.station_code = s.code a.station_code = s.code
...@@ -49,4 +49,15 @@ ...@@ -49,4 +49,15 @@
limit ${top} limit ${top}
</if> </if>
</select> </select>
<select id="distinctByEquipmentId" resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentDto">
SELECT
distinct(ai.fire_equipment_mrid) as mrid
FROM `asf_fire_equipment_signal_log` ai
where
ai.signal_report_date =#{alarmDate}
and ai.is_alarm = true
<if test="stationCode != null and stationCode != ''">
and ai.station_code =#{stationCode}
</if>
</select>
</mapper> </mapper>
<?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.ccs.api.mapper.FireEquipmentSignalMapper">
<select id="faultEquipTopCount" resultType="java.util.Map">
SELECT
count(DISTINCT(a.fire_equipment_mrid)) as total,
a.equipment_definition_name as name
FROM
`asf_fire_equipment_signal_log` a
where
year(a.signal_report_date) = YEAR(#{currentDate})
and a.signal_type = 'faultAlarm'
group by a.equipment_definition_name
ORDER BY total desc
<if test="top != null and top != ''">
limit #{top}
</if>
</select>
</mapper>
...@@ -2,4 +2,19 @@ ...@@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireRiskSourceMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireRiskSourceMapper">
<select id="queryForRpnDescList" resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireRiskSourceDto">
SELECT
rs.mrid,
rs.`name`,
rs.parent_mrid,
IFNULL(rs.rpn, 0) rpn,
IFNULL(rs.rpni, 0) rpni
FROM `asf_fire_risk_source` rs
where
rs.parent_mrid > 0
and rs.station_code = #{stationCode}
<if test="top != null and top !=''">
limit ${top}
</if>
</select>
</mapper> </mapper>
...@@ -2,4 +2,31 @@ ...@@ -2,4 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireRpnChangeLogMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireRpnChangeLogMapper">
<select id="queryForRiseUp" resultType="java.util.Map">
select
d.countOfType0,
d.countOfSource,
CONCAT(ROUND(IFNULL(d.countOfType0/d.countOfSource,0)*100,2),'%')type0Rate
from
(SELECT
count(DISTINCT cl.risk_point_mrid) countOfType0,
(select count(1) from asf_fire_risk_source rs where rs.station_code=cl.station_code ) countOfSource
FROM
asf_fire_rpn_change_log cl
WHERE
cl.level_change_type = 0
and cl.station_code = #{stationCode}
<choose>
<when test="type = '1'">
and DATE_FORMAT( cl.create_date, '%Y%m' ) = DATE_FORMAT(CURDATE() , '%Y%m')
</when>
<when test="type = '2'">
and QUARTER(cl.create_date)=QUARTER(now());
</when>
<when test="type = '3'">
and year(cl.create_date)=year(now())
</when>
</choose>
)d
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireAlarmDayStatisticsMapper"> <mapper namespace="com.yeejoin.amos.boot.module.ccs.api.mapper.FireSignalDayStatisticsMapper">
<select id="queryAlarmTimesTrend" resultType="java.lang.String"> <select id="queryAlarmTimesTrend" resultType="java.lang.String">
select select
(SELECT (SELECT
IFNULL(sum(s.alarm_times),0) IFNULL(sum(s.report_times),0)
FROM `asf_fire_alarm_day_statistics` s FROM `asf_fire_signal_day_statistics` s
<where> <where>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
s.station_code = #{stationCode} and s.station_code = #{stationCode}
</if> </if>
s.collect_date = t.date <if test="signalType != null and signalType != ''">
and s.signal_type = #{signalType}
</if>
and s.collect_date = t.date
and s.is_alarm = true
</where> </where>
) as times ) as times
from from
......
...@@ -6,8 +6,10 @@ ...@@ -6,8 +6,10 @@
resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto"> resultType="com.yeejoin.amos.boot.module.ccs.api.dto.FireStationInfoDto">
SELECT SELECT
i.*, i.*,
IFNULL((SELECT sum(s.alarm_times) from asf_fire_alarm_day_statistics s where s.collect_date = CURRENT_DATE and s.station_code = i.`code`),0) as todayAlarmTimes, IFNULL((SELECT sum(s.report_times) from asf_fire_signal_day_statistics s where s.collect_date = CURRENT_DATE and
IFNULL((SELECT count(1) from asf_fire_latent_danger d where d.deal_state = 1 and d.station_code = i.`code`),0) as existDangerNumber s.station_code = i.`code`),0) as todayAlarmTimes,
IFNULL((SELECT count(1) from asf_fire_latent_danger d where d.deal_state = 1 and d.station_code = i.`code`),0)
as existDangerNumber
FROM FROM
`asf_fire_station_info` i `asf_fire_station_info` i
where i.status = false where i.status = false
...@@ -15,4 +17,43 @@ ...@@ -15,4 +17,43 @@
${orderBy} ${orderBy}
</if> </if>
</select> </select>
<select id="queryStationEquipInfo"
resultType="java.util.Map">
SELECT
si.id,
si.code,
si.`name`,
(select count(1) from ast_fire_equipment e where e.station_code = si.code and e.is_iot = true) as
iotEquipmentNumber,
(select count(DISTINCT(1)) from asf_fire_equipment_signal_log l where l.station_code = si.code and
l.signal_report_date =CURRENT_DATE and l.is_alarm = true) as todayAlarmEquipmentNumber
FROM `asf_fire_station_info` si
<where>
<if test="stationCode != null and stationCode != ''">
si.code = #{stationCode}
</if>
<if test="stationName != null and stationName != ''">
si.name like concat('%', #{stationName},'%')
</if>
</where>
order by iotEquipmentNumber desc
</select>
<select id="lastYearAlarmCount" resultType="java.util.Map">
SELECT
s.code,
s.name,
(select
count(DISTINCT(l.fire_equipment_mrid))
from asf_fire_equipment_signal_log l
where l.is_alarm =true and
l.signal_report_date >= DATE_sub(CURDATE(),INTERVAL 1 year)
and l.signal_report_date <![CDATA[ <= ]]> CURDATE() and l.station_code = s.code) as alarmEquipNumber,
ifnull((SELECT sum(ds.report_times) from asf_fire_signal_day_statistics ds
where ds.is_alarm =true and
ds.collect_date >= DATE_sub(CURDATE(),INTERVAL 1 year)
and ds.collect_date <![CDATA[ <= ]]> CURDATE()
and ds.station_code = s.code),0) as alarmTimes
FROM
`asf_fire_station_info` s
</select>
</mapper> </mapper>
...@@ -45,5 +45,11 @@ public class DutyFireFightingDto implements Serializable { ...@@ -45,5 +45,11 @@ public class DutyFireFightingDto implements Serializable {
@ApiModelProperty(value = "微型消防站Id") @ApiModelProperty(value = "微型消防站Id")
private String fireFightingId; private String fireFightingId;
@ApiModelProperty(value = "值班区域")
private String dutyArea;
@ApiModelProperty(value = "值班区域Id")
private String dutyAreaId;
} }
...@@ -43,4 +43,10 @@ public class DutyFirstAidDto implements Serializable { ...@@ -43,4 +43,10 @@ public class DutyFirstAidDto implements Serializable {
@ApiModelProperty(value = "120急救站Id") @ApiModelProperty(value = "120急救站Id")
private String firstAidId; private String firstAidId;
@ApiModelProperty(value = "值班区域")
private String dutyArea;
@ApiModelProperty(value = "值班区域Id")
private String dutyAreaId;
} }
...@@ -83,8 +83,14 @@ public class OrgUsrFormDto implements Serializable { ...@@ -83,8 +83,14 @@ public class OrgUsrFormDto implements Serializable {
public void setDynamicFormAlert(List<FormValue> dynamicFormAlert) { public void setDynamicFormAlert(List<FormValue> dynamicFormAlert) {
if(dynamicFormAlert!=null) { if(dynamicFormAlert!=null) {
dynamicFormAlert.forEach(formValue->{ dynamicFormAlert.forEach(formValue->{
if("select".equals(formValue.getType())){
this.map.put(formValue.getKey(), formValue.getValueName());
}else{
this.map.put(formValue.getKey(), formValue.getValue()); this.map.put(formValue.getKey(), formValue.getValue());
}
}); });
} }
......
...@@ -134,7 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -134,7 +134,7 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company); List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company);
List<Map<String, Object>> queryByCompanyId(); List<Map<String, Object>> queryByCompanyId(@Param(value="bizNames") List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
} }
...@@ -92,5 +92,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -92,5 +92,8 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList); List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
List<Map<String,Object>> queryCompanyId(String bizOrgName); List<Map<String,Object>> queryCompanyId(String bizOrgName,@Param("codes")List<String> codes);
List<Map<String,Object>> queryCompanyIdNew(String bizOrgName);
} }
...@@ -34,7 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService { ...@@ -34,7 +34,7 @@ public interface IDutyPersonService extends IDutyCommonService {
*/ */
List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId); List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId);
List<Map<String, Object>> queryByCompanyId(); List<Map<String, Object>> queryByCompanyId(List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
} }
...@@ -358,8 +358,11 @@ AND cft.type_code = ( ...@@ -358,8 +358,11 @@ AND cft.type_code = (
where i.field_code = 'userId' and i.field_value is not null) c where i.field_code = 'userId' and i.field_value is not null) c
on cb.instance_id = c.id3 on cb.instance_id = c.id3
where to_days(cb.duty_date) = to_days(now()) and where to_days(cb.duty_date) = to_days(now()) and
a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援保障部' or a.deptId in ( select sequence_nbr from cb_org_usr cou where biz_org_name in
biz_org_name = '综合办公室' or biz_org_name = '消防支队' or biz_org_name = '应急指挥科' )) r ) <foreach item="item" index="index" collection="bizNames" open="(" separator="," close=")">
#{item}
</foreach>
)) r )
</select> </select>
......
...@@ -133,6 +133,9 @@ ...@@ -133,6 +133,9 @@
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_fire_team a FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.typeCode==null'>
and a.type_code in (116,830)
</if>
<if test='par.typeCode!=null and par.typeCode!=""'> <if test='par.typeCode!=null and par.typeCode!=""'>
and a.type_code in (#{par.typeCode}) and a.type_code in (#{par.typeCode})
</if> </if>
...@@ -147,7 +150,9 @@ ...@@ -147,7 +150,9 @@
COUNT(a.sequence_nbr) num COUNT(a.sequence_nbr) num
FROM cb_fire_team a FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.typeCode==null'>
and a.type_code in (116,830)
</if>
<if test='par.typeCode!=null and par.typeCode!=""'> <if test='par.typeCode!=null and par.typeCode!=""'>
and a.type_code in (#{par.typeCode}) and a.type_code in (#{par.typeCode})
</if> </if>
......
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
cb_firefighters firefighters cb_firefighters firefighters
WHERE WHERE
fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in ( fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in (
select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援部') ) select sequence_nbr from cb_org_usr cou where biz_org_name = '消防救援保障部') )
<if test="gw != null"> <if test="gw != null">
And job_title_code In And job_title_code In
<foreach item="item" collection="gw" index="index" open="(" separator="," close=")"> <foreach item="item" collection="gw" index="index" open="(" separator="," close=")">
......
...@@ -691,12 +691,30 @@ LEFT JOIN ( ...@@ -691,12 +691,30 @@ LEFT JOIN (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId, select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.fireManagementPostCode, b.telephone from cb_org_usr cou a.fireManagementPostCode, b.telephone from cb_org_usr cou
left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode', left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
i.field_value_label, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode' i.field_value, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1 and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
left join (select i.instance_id id2,if(i.field_code = 'telephone', left join (select i.instance_id id2,if(i.field_code = 'telephone',
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone' i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
and i.field_value is not null) b on cou .sequence_nbr = b.id2 and i.field_value is not null) b on cou .sequence_nbr = b.id2
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName}) ) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
and (d.fireManagementPostCode = '消防安全管理人' or d.fireManagementPostCode = '消防安全责任人') and (d.fireManagementPostCode in
<foreach item="item" index="index" collection="codes" open="(" separator="," close=")">
#{item}
</foreach>
)
</select>
<select id="queryCompanyIdNew" resultType="map">
select * from (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.administrativePositionCode, b.telephone from cb_org_usr cou
left join (select i.instance_id id1 ,if(i.field_code = 'administrativePositionCode',
i.field_value_label, null) as 'administrativePositionCode' from cb_dynamic_form_instance i where i.field_code = 'administrativePositionCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
left join (select i.instance_id id2,if(i.field_code = 'telephone',
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
and i.field_value is not null) b on cou .sequence_nbr = b.id2
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
</select> </select>
</mapper> </mapper>
...@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{ ...@@ -26,7 +26,7 @@ public class AlertCalledRo implements Serializable{
* *
* </pre> * </pre>
*/ */
private static final long serialVersionUID = 529623529216238088L; private static final long serialVersionUID = -8755622977733065123L;
/** /**
* 通用属性 * 通用属性
...@@ -73,9 +73,12 @@ public class AlertCalledRo implements Serializable{ ...@@ -73,9 +73,12 @@ public class AlertCalledRo implements Serializable{
@Label(value = "警情报送类型(0,警情报送,1,警情续报,2,非警情确认,3,警情结案)") @Label(value = "警情报送类型(0,警情报送,1,警情续报,2,非警情确认,3,警情结案)")
private String alertWay; private String alertWay;
@Label(value = "警情续报,非警情确认,警情结案,选择人员ids") @Label(value = "警情续报,非警情确认,警情结案,选择人员电话号码")
private String ids; private String ids;
@Label(value = "警情续报,非警情确认,警情结案,选择人员AmousIds")
private String usIds;
@Label(value = "警情续报自定义内容") @Label(value = "警情续报自定义内容")
private String feedback; private String feedback;
......
...@@ -30,6 +30,9 @@ public class AlertSubmittedSMSDto { ...@@ -30,6 +30,9 @@ public class AlertSubmittedSMSDto {
@ApiModelProperty(value = "联系电话") @ApiModelProperty(value = "联系电话")
private String userPhone; private String userPhone;
@ApiModelProperty(value = "警情Id")
private String alertCallId;
@ApiModelProperty(value = "协调单位") @ApiModelProperty(value = "协调单位")
private String companyName; private String companyName;
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
jas.submission_method, jas.submission_method,
jas.submission_method_code, jas.submission_method_code,
jas.update_time, jas.update_time,
jaso.sequence_nbr, jaso.sequence_nbr sequenceNbr,
jaso.company_name, jaso.company_name,
jaso.user_name, jaso.user_name,
jaso.user_phone jaso.user_phone
from jc_alert_submitted jas from jc_alert_submitted jas
left join jc_alert_submitted_object jaso on jas.sequence_nbr = jaso.alert_submitted_id right join jc_alert_submitted_object jaso on jas.sequence_nbr = jaso.alert_submitted_id
where 1=1 where 1=1
<if test="alertSubmittedDto.alertCalledId != null and alertSubmittedDto.alertCalledId != ''"> <if test="alertSubmittedDto.alertCalledId != null and alertSubmittedDto.alertCalledId != ''">
and jas.alert_called_id = #{alertSubmittedDto.alertCalledId} and jas.alert_called_id = #{alertSubmittedDto.alertCalledId}
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<select id="getSchedulingContent" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto"> <select id="getSchedulingContent" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto">
SELECT SELECT
s.sequence_nbr, s.sequence_nbr,
s.alert_called_id alertCallId,
s.submission_time, s.submission_time,
o.user_phone, o.user_phone,
o.company_name, o.company_name,
......
...@@ -35,51 +35,51 @@ public interface LatentDangerState { ...@@ -35,51 +35,51 @@ public interface LatentDangerState {
/** /**
* 提交隐患 * 提交隐患
*/ */
提交隐患("提交隐患", "dangerSubmit", null, null, "0"), 提交隐患("提交隐患", "dangerSubmit", null, null, "0", ""),
/** /**
* 现场确认 * 现场确认
*/ */
现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm", "1"), 现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm", "1", ""),
/** /**
* 检查组长确认 * 检查组长确认
*/ */
检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm", "1"), 检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm", "1", ""),
/** /**
* 隐患二次审核确认 * 隐患二次审核确认
*/ */
隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm", "1"), 隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm", "1", ""),
/** /**
* 整改任务分配 * 整改任务分配
*/ */
整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit","", "2"), 整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit","", "2", "allotRecordPage"),
/** /**
* 提交整改资料 * 提交整改资料
*/ */
提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm","", "3"), 提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm","", "3", "rectifyRecordPage"),
/** /**
* 整改检查组长确认 * 整改检查组长确认
*/ */
整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit", "4"), 整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改检查负责人确认 * 整改检查负责人确认
*/ */
整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit", "4"), 整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同) * 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同)
*/ */
整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit", "4"), 整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改检查组长复查确认 * 整改检查组长复查确认
*/ */
整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit", "4"), 整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改二次审核确认 * 整改二次审核确认
*/ */
整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit", "4"), 整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit", "4", "auditRecordPage"),
/** /**
* 整改完毕 * 整改完毕
*/ */
整改完毕("整改完毕", "endOfGovernance", "","", "5"); 整改完毕("整改完毕", "endOfGovernance", "","", "5", "auditRecordPage");
/** /**
* 名称,描述 * 名称,描述
...@@ -106,12 +106,18 @@ public interface LatentDangerState { ...@@ -106,12 +106,18 @@ public interface LatentDangerState {
*/ */
private String processState; private String processState;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext, String processState) { /**
* 跳转页面
*/
private String url;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext, String processState, String url) {
this.name = name; this.name = name;
this.code = code; this.code = code;
this.next = next; this.next = next;
this.rejectNext = rejectNext; this.rejectNext = rejectNext;
this.processState = processState; this.processState = processState;
this.url = url;
} }
public String getName() { public String getName() {
...@@ -153,6 +159,14 @@ public interface LatentDangerState { ...@@ -153,6 +159,14 @@ public interface LatentDangerState {
this.processState = processState; this.processState = processState;
} }
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public static SupervisionDangerStateEnum getEnumByCode(String code) { public static SupervisionDangerStateEnum getEnumByCode(String code) {
for (SupervisionDangerStateEnum _enum : SupervisionDangerStateEnum.values()) { for (SupervisionDangerStateEnum _enum : SupervisionDangerStateEnum.values()) {
if (code.equals(_enum.getCode())) { if (code.equals(_enum.getCode())) {
...@@ -173,6 +187,17 @@ public interface LatentDangerState { ...@@ -173,6 +187,17 @@ public interface LatentDangerState {
return enumName; return enumName;
} }
public static String getEnumUrlByCode(String code) {
String enumUrl = "";
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
if (type.getCode().equals(code)) {
enumUrl = type.getUrl();
break;
}
}
return enumUrl;
}
public static List<Map<String, String>> getEnumList() { public static List<Map<String, String>> getEnumList() {
List<Map<String, String>> enumList = Lists.newArrayList(); List<Map<String, String>> enumList = Lists.newArrayList();
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) { for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
......
...@@ -8,13 +8,7 @@ package com.yeejoin.amos.supervision.common.enums; ...@@ -8,13 +8,7 @@ package com.yeejoin.amos.supervision.common.enums;
public enum RuleTypeEnum { public enum RuleTypeEnum {
GETCONTENT("维保项获取","getContent"), GETCONTENT("维保项获取","getContent"),
CHECKRESULT("结果校验","checkResult" ), CHECKRESULT("结果校验","checkResult" );
// 防火监督
计划提交("计划提交", "addPlan"),
计划审核("计划审核", "planAudit"),
计划生成("计划生成", "addPlanTask"),
计划完成("计划完成", "planCompleted");
/** /**
* 名称,描述 * 名称,描述
......
...@@ -37,4 +37,11 @@ public class TzsCommonParam { ...@@ -37,4 +37,11 @@ public class TzsCommonParam {
public static final String APPJJ = "APPJJ"; public static final String APPJJ = "APPJJ";
public static final String DD = "DD"; public static final String DD = "DD";
public static final String JC = "JC"; public static final String JC = "JC";
public static final String LICENCE_PIC = "licencePic";
public static final String ADMIN_LICENSE_PIC = "adminLicensePic";
public static final String QR_CODE = "qrCode";
public static final String UNIT_TYPE = "UNIT_TYPE";
} }
...@@ -36,4 +36,10 @@ public class UnitInfoApproveDto extends BaseDto { ...@@ -36,4 +36,10 @@ public class UnitInfoApproveDto extends BaseDto {
@ApiModelProperty(value = "0 注册审批 1 变更审批") @ApiModelProperty(value = "0 注册审批 1 变更审批")
private Integer approveType; private Integer approveType;
@ApiModelProperty(value = "企业入驻时间")
private Date approvedTime;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
} }
...@@ -36,6 +36,9 @@ public class UnitInfoChangeDto extends BaseDto { ...@@ -36,6 +36,9 @@ public class UnitInfoChangeDto extends BaseDto {
@ApiModelProperty(value = "单位类型code") @ApiModelProperty(value = "单位类型code")
private String unitTypeCode; private String unitTypeCode;
@ApiModelProperty(value = "组织机构编码")
private String organizationCode;
@ApiModelProperty(value = "主管部门") @ApiModelProperty(value = "主管部门")
private String comptentDept; private String comptentDept;
......
package com.yeejoin.amos.boot.module.tzs.flc.api.dto; package com.yeejoin.amos.boot.module.tzs.flc.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 企业信息表 * 企业信息表
...@@ -25,10 +28,13 @@ public class UnitInfoDto extends BaseDto { ...@@ -25,10 +28,13 @@ public class UnitInfoDto extends BaseDto {
private String orgName; private String orgName;
@ApiModelProperty(value = "证照类型") @ApiModelProperty(value = "证照类型")
private String licenseType; private String licenceType;
@ApiModelProperty(value = "证照类型code") @ApiModelProperty(value = "证照类型code")
private String licenseTypeCode; private String licenceTypeCode;
@ApiModelProperty(value = "组织机构编码")
private String organizationCode;
@ApiModelProperty(value = "单位类型") @ApiModelProperty(value = "单位类型")
private String unitType; private String unitType;
...@@ -94,10 +100,10 @@ public class UnitInfoDto extends BaseDto { ...@@ -94,10 +100,10 @@ public class UnitInfoDto extends BaseDto {
private Date createTime; private Date createTime;
@ApiModelProperty(value = "单位法人") @ApiModelProperty(value = "单位法人")
private String legelPerson; private String legalPerson;
@ApiModelProperty(value = "法人电话") @ApiModelProperty(value = "法人电话")
private String legelPersonTel; private String legalPersonTel;
@ApiModelProperty(value = "单位联系人") @ApiModelProperty(value = "单位联系人")
private String contactPerson; private String contactPerson;
...@@ -126,4 +132,37 @@ public class UnitInfoDto extends BaseDto { ...@@ -126,4 +132,37 @@ public class UnitInfoDto extends BaseDto {
@ApiModelProperty(value = "审批状态 0 审批中 1 审批结束 2 驳回") @ApiModelProperty(value = "审批状态 0 审批中 1 审批结束 2 驳回")
private Integer unitStatus; private Integer unitStatus;
@ApiModelProperty(value = "证照图片")
private List<AttachmentDto> licencePic;
@ApiModelProperty(value = "管理员身份证")
private List<AttachmentDto> adminLicensePic;
@ApiModelProperty(value = "是否变更 0 未变更 1 变更中")
private Boolean isChange;
@ApiModelProperty(value = "提交时间开始")
private String submitTimeStart ;
@ApiModelProperty(value = "提交时间结束")
private String submitTimeEnd ;
@ApiModelProperty(value = "分类名称")
private String typeStr;
@ApiModelProperty(value = "状态名称")
private String statusStr;
@ApiModelProperty(value = "企业二维码")
private List<AttachmentDto> qrcode;
@ApiModelProperty(value = "详细地址全部")
private String fullAddress;
@ApiModelProperty(value = "企业入驻时间")
private Date approvedTime;
@ApiModelProperty(value = "提交时间")
private Date submitTime;
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.entity; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -31,14 +32,20 @@ public class UnitInfo extends BaseEntity { ...@@ -31,14 +32,20 @@ public class UnitInfo extends BaseEntity {
/** /**
* 证照类型 * 证照类型
*/ */
@TableField("license_type") @TableField("licence_type")
private String licenseType; private String licenceType;
/** /**
* 证照类型code * 证照类型code
*/ */
@TableField("license_type_code") @TableField("licence_type_code")
private String licenseTypeCode; private String licenceTypeCode;
/**
* 组织机构编码
*/
@TableField("organization_code")
private String organizationCode;
/** /**
* 单位类型 * 单位类型
...@@ -169,14 +176,14 @@ public class UnitInfo extends BaseEntity { ...@@ -169,14 +176,14 @@ public class UnitInfo extends BaseEntity {
/** /**
* 单位法人 * 单位法人
*/ */
@TableField("legel_person") @TableField("legal_person")
private String legelPerson; private String legalPerson;
/** /**
* 法人电话 * 法人电话
*/ */
@TableField("legel_person_tel") @TableField("legal_person_tel")
private String legelPersonTel; private String legalPersonTel;
/** /**
* 单位联系人 * 单位联系人
...@@ -232,4 +239,22 @@ public class UnitInfo extends BaseEntity { ...@@ -232,4 +239,22 @@ public class UnitInfo extends BaseEntity {
@TableField("unit_status") @TableField("unit_status")
private Integer unitStatus; private Integer unitStatus;
/**
* 是否变更 0 未变更 1 变更中
*/
@TableField(value = "is_change")
private Boolean isChange;
/**
* 企业入驻时间
*/
@TableField("approved_time")
private Date approvedTime;
/**
* 提交时间
*/
@TableField("submit_time")
private Date submitTime;
} }
...@@ -31,14 +31,20 @@ public class UnitInfoChange extends BaseEntity { ...@@ -31,14 +31,20 @@ public class UnitInfoChange extends BaseEntity {
/** /**
* 证照类型 * 证照类型
*/ */
@TableField("license_type") @TableField("licence_type")
private String licenseType; private String licenceType;
/** /**
* 证照类型code * 证照类型code
*/ */
@TableField("license_type_code") @TableField("licence_type_code")
private String licenseTypeCode; private String licenceTypeCode;
/**
* 组织机构编码
*/
@TableField("organization_code")
private String organizationCode;
/** /**
* 单位类型 * 单位类型
...@@ -169,14 +175,14 @@ public class UnitInfoChange extends BaseEntity { ...@@ -169,14 +175,14 @@ public class UnitInfoChange extends BaseEntity {
/** /**
* 单位法人 * 单位法人
*/ */
@TableField("legel_person") @TableField("legal_person")
private String legelPerson; private String legalPerson;
/** /**
* 法人电话 * 法人电话
*/ */
@TableField("legel_person_tel") @TableField("legal_person_tel")
private String legelPersonTel; private String legalPersonTel;
/** /**
* 单位联系人 * 单位联系人
...@@ -208,4 +214,17 @@ public class UnitInfoChange extends BaseEntity { ...@@ -208,4 +214,17 @@ public class UnitInfoChange extends BaseEntity {
@TableField("unit_status") @TableField("unit_status")
private Integer unitStatus; private Integer unitStatus;
/**
* 企业入驻时间
*/
@TableField("approved_time")
private Date approvedTime;
/**
* 提交时间
*/
@TableField("submit_time")
private Date submitTime;
} }
package com.yeejoin.amos.boot.module.tzs.flc.api.service; package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
/** /**
* 企业信息表接口类 * 企业信息表接口类
* *
...@@ -9,4 +12,12 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service; ...@@ -9,4 +12,12 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
*/ */
public interface IUnitInfoService { public interface IUnitInfoService {
/**
* 审批企业注册信息
* @param approveDto
* @return
*/
UnitInfoDto approve(UnitInfoApproveDto approveDto);
UnitInfoDto getDtoById(Long sequenceNbr);
} }
...@@ -43,11 +43,12 @@ public class FireBuildingController extends BaseController { ...@@ -43,11 +43,12 @@ public class FireBuildingController extends BaseController {
@ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name, @ApiParam(value = "建筑名称") @RequestParam(value = "name", required = false) String name,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current, @ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size, @ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@ApiParam(value = "建筑类型") @RequestParam(value = "buildingType") String buildingType,
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) { @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
Page<FireBuildingDto> page = new Page<FireBuildingDto>(); Page<FireBuildingDto> page = new Page<FireBuildingDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(fireBuildingServiceImpl.queryForFireBuildingPage(page, name, stationCode)); return ResponseHelper.buildResponse(fireBuildingServiceImpl.queryForFireBuildingPage(page, name, stationCode, buildingType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.ccs.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.ccs.biz.service.impl.FireEquipmentAlarmServiceImpl;
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.ccs.api.dto.FireEquipmentAlarmDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 设备报警信息表
*
* @author system_generator
* @date 2021-11-09
*/
@RestController
@Api(tags = "设备报警信息表Api")
@RequestMapping(value = "/fire-equipment-alarm")
public class FireEquipmentAlarmController extends BaseController {
@Autowired
FireEquipmentAlarmServiceImpl fireEquipmentAlarmServiceImpl;
/**
* 新增设备报警信息表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增设备报警信息表", notes = "新增设备报警信息表")
public ResponseModel<FireEquipmentAlarmDto> save(@RequestBody FireEquipmentAlarmDto model) {
model = fireEquipmentAlarmServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除设备报警信息表", notes = "根据sequenceNbr删除设备报警信息表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(fireEquipmentAlarmServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个设备报警信息表", notes = "根据sequenceNbr查询单个设备报警信息表")
public ResponseModel<FireEquipmentAlarmDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(fireEquipmentAlarmServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "设备报警信息表分页查询", notes = "设备报警信息表分页查询")
public ResponseModel<Page<FireEquipmentAlarmDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<FireEquipmentAlarmDto> page = new Page<FireEquipmentAlarmDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireEquipmentAlarmServiceImpl.queryForFireEquipmentAlarmPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "设备报警信息表列表全部数据查询", notes = "设备报警信息表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<FireEquipmentAlarmDto>> selectForList() {
return ResponseHelper.buildResponse(fireEquipmentAlarmServiceImpl.queryForFireEquipmentAlarmList());
}
}
package com.yeejoin.amos.boot.module.ccs.biz.controller; package com.yeejoin.amos.boot.module.ccs.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import io.swagger.annotations.ApiOperation; import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import java.util.List; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireEquipmentServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import java.text.ParseException;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/** /**
* 消防设备资产 * 消防设备资产
...@@ -29,74 +29,49 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -29,74 +29,49 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
public class FireEquipmentController extends BaseController { public class FireEquipmentController extends BaseController {
@Autowired @Autowired
FireEquipmentServiceImpl fireEquipmentServiceImpl; IFireEquipmentService iFireEquipmentService;
/** /**
* 新增消防设备资产 * 物联接入汇总
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @ApiOperation(httpMethod = "GET", value = "物联接入汇总", notes = "物联接入汇总")
@ApiOperation(httpMethod = "POST", value = "新增消防设备资产", notes = "新增消防设备资产") @GetMapping(value = "/iot/count")
public ResponseModel<FireEquipmentDto> save(@RequestBody FireEquipmentDto model) { public ResponseModel selectForMonitorCount(
model = fireEquipmentServiceImpl.createWithModel(model); @ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) throws ParseException {
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(iFireEquipmentService.selectForMonitorCount(stationCode));
} }
/**
* 根据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(fireEquipmentServiceImpl.removeById(sequenceNbr));
}
/** /**
* 根据sequenceNbr查询 * 站端物联设备
* *
* @param sequenceNbr 主键 * @param stationCode 换流站code
* @return * @return ResponseModel
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @ApiOperation(httpMethod = "GET", value = "站端物联设备", notes = "站端物联设备")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个消防设备资产", notes = "根据sequenceNbr查询单个消防设备资产") @GetMapping(value = "/station/info")
public ResponseModel<FireEquipmentDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel stationEquipmentInfo(
return ResponseHelper.buildResponse(fireEquipmentServiceImpl.queryBySeq(sequenceNbr)); @ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode,
@ApiParam(value = "换流站名称") @RequestParam(required = false) String stationName) {
return ResponseHelper.buildResponse(iFireEquipmentService.stationEquipmentInfo(stationCode,stationName));
} }
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "消防设备资产分页查询", notes = "消防设备资产分页查询")
public ResponseModel<Page<FireEquipmentDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<FireEquipmentDto> page = new Page<FireEquipmentDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireEquipmentServiceImpl.queryForFireEquipmentPage(page));
}
/** /**
* 列表全部数据查询 * 故障设备top
* *
* @return * @param top 页面展示上限条数
* @return List
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "消防设备资产列表全部数据查询", notes = "消防设备资产列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "故障设备top", notes = "故障设备top")
@GetMapping(value = "/list") @GetMapping(value = "/count/fault/list")
public ResponseModel<List<FireEquipmentDto>> selectForList() { public ResponseModel faultEquipTop(
return ResponseHelper.buildResponse(fireEquipmentServiceImpl.queryForFireEquipmentList()); @ApiParam(value = "页面展示上限条数") @RequestParam(required = false) Long top) {
return ResponseHelper.buildResponse(iFireEquipmentService.faultEquipTopCount(top));
} }
} }
package com.yeejoin.amos.boot.module.ccs.biz.controller; package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireAlarmDayStatisticsDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentSignalDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireAlarmDayStatisticsServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireEquipmentSignalServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
* 换流站告警日统计 * 设备报警信息表
* *
* @author system_generator * @author system_generator
* @date 2021-11-09 * @date 2021-11-09
*/ */
@RestController @RestController
@Api(tags = "换流站告警日统计Api") @Api(tags = "设备信号信息表Api")
@RequestMapping(value = "/fire-alarm-day-statistics") @RequestMapping(value = "/fire-equipment-signal")
public class FireAlarmDayStatisticsController extends BaseController { public class FireEquipmentSignalController extends BaseController {
@Autowired @Autowired
FireAlarmDayStatisticsServiceImpl fireAlarmDayStatisticsServiceImpl; FireEquipmentSignalServiceImpl fireEquipmentSignalServiceImpl;
/** /**
* 列表全部数据查询 * 列表全部数据查询
...@@ -36,9 +36,9 @@ public class FireAlarmDayStatisticsController extends BaseController { ...@@ -36,9 +36,9 @@ public class FireAlarmDayStatisticsController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "换流站告警日统计列表全部数据查询", notes = "换流站告警日统计列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "设备报警信息表列表全部数据查询", notes = "设备报警信息表列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<FireAlarmDayStatisticsDto>> selectForList() { public ResponseModel<List<FireEquipmentSignalDto>> selectForList() {
return ResponseHelper.buildResponse(fireAlarmDayStatisticsServiceImpl.queryForFireAlarmDayStatisticsList()); return ResponseHelper.buildResponse(fireEquipmentSignalServiceImpl.queryForFireEquipmentAlarmList());
} }
} }
package com.yeejoin.amos.boot.module.ccs.biz.controller; package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentAlarmLogDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentSignalLogDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireEquipmentAlarmLogServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireEquipmentSignalLogServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -26,12 +26,12 @@ import java.util.List; ...@@ -26,12 +26,12 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@RestController @RestController
@Api(tags = "设备报警信息日志表Api") @Api(tags = "设备信号信息日志表Api")
@RequestMapping(value = "/fire-equipment-alarm-log") @RequestMapping(value = "/fire-equipment-signal-log")
public class FireEquipmentAlarmLogController extends BaseController { public class FireEquipmentSignalLogController extends BaseController {
@Autowired @Autowired
FireEquipmentAlarmLogServiceImpl fireEquipmentAlarmLogServiceImpl; FireEquipmentSignalLogServiceImpl fireEquipmentSignalLogServiceImpl;
/** /**
* 列表全部数据查询 * 列表全部数据查询
...@@ -41,8 +41,8 @@ public class FireEquipmentAlarmLogController extends BaseController { ...@@ -41,8 +41,8 @@ public class FireEquipmentAlarmLogController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "设备报警信息日志表列表", notes = "设备报警信息日志列表") @ApiOperation(httpMethod = "GET", value = "设备报警信息日志表列表", notes = "设备报警信息日志列表")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<FireEquipmentAlarmLogDto>> selectForList() { public ResponseModel<List<FireEquipmentSignalLogDto>> selectForList() {
return ResponseHelper.buildResponse(fireEquipmentAlarmLogServiceImpl.fireEquipmentAlarmLogList()); return ResponseHelper.buildResponse(fireEquipmentSignalLogServiceImpl.fireEquipmentAlarmLogList());
} }
/** /**
...@@ -53,8 +53,8 @@ public class FireEquipmentAlarmLogController extends BaseController { ...@@ -53,8 +53,8 @@ public class FireEquipmentAlarmLogController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "今日未确认设备报警信息列表", notes = "今日未确认设备报警信息列表,跑马灯使用") @ApiOperation(httpMethod = "GET", value = "今日未确认设备报警信息列表", notes = "今日未确认设备报警信息列表,跑马灯使用")
@GetMapping(value = "/today/list") @GetMapping(value = "/today/list")
public ResponseModel<List<FireEquipmentAlarmLogDto>> todayAlarmList( public ResponseModel<List<FireEquipmentSignalLogDto>> todayAlarmList(
@ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) throws ParseException { @ApiParam(value = "换流站编号") @RequestParam(required = false) String stationCode) throws ParseException {
return ResponseHelper.buildResponse(fireEquipmentAlarmLogServiceImpl.todayAlarmLogList(stationCode)); return ResponseHelper.buildResponse(fireEquipmentSignalLogServiceImpl.todayAlarmLogList(stationCode));
} }
} }
package com.yeejoin.amos.boot.module.ccs.biz.controller; package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireFmeaStatisticsDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireFmeaStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireFmeaStatisticsServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireFmeaStatisticsServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -13,7 +13,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -13,7 +13,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
/** /**
...@@ -23,83 +22,13 @@ import java.util.List; ...@@ -23,83 +22,13 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@RestController @RestController
@Api(tags = "发生率/严重度矩阵统计表Api") @Api(tags = "发生率-严重度矩阵统计表Api")
@RequestMapping(value = "/fire-fmea-statistics") @RequestMapping(value = "/fire-fmea-statistics")
public class FireFmeaStatisticsController extends BaseController { public class FireFmeaStatisticsController extends BaseController {
@Autowired @Autowired
FireFmeaStatisticsServiceImpl fireFmeaStatisticsServiceImpl; FireFmeaStatisticsServiceImpl fireFmeaStatisticsServiceImpl;
/**
* 新增发生率/严重度矩阵统计表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增发生率/严重度矩阵统计表", notes = "新增发生率/严重度矩阵统计表")
public ResponseModel<FireFmeaStatisticsDto> save(@RequestBody FireFmeaStatisticsDto model) {
model = fireFmeaStatisticsServiceImpl.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<FireFmeaStatisticsDto> updateBySequenceNbrFireFmeaStatistics(@RequestBody FireFmeaStatisticsDto model, @PathVariable(value = "sequenceNbr") String sequenceNbr) {
model.setId(sequenceNbr);
return ResponseHelper.buildResponse(fireFmeaStatisticsServiceImpl.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(fireFmeaStatisticsServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个发生率/严重度矩阵统计表", notes = "根据sequenceNbr查询单个发生率/严重度矩阵统计表")
public ResponseModel<FireFmeaStatisticsDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(fireFmeaStatisticsServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "发生率/严重度矩阵统计表分页查询", notes = "发生率/严重度矩阵统计表分页查询")
public ResponseModel<Page<FireFmeaStatisticsDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<FireFmeaStatisticsDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireFmeaStatisticsServiceImpl.queryForFireFmeaStatisticsPage(page));
}
/** /**
* 列表全部数据查询 * 列表全部数据查询
...@@ -107,9 +36,10 @@ public class FireFmeaStatisticsController extends BaseController { ...@@ -107,9 +36,10 @@ public class FireFmeaStatisticsController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "发生率/严重度矩阵统计表列表全部数据查询", notes = "发生率/严重度矩阵统计表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "发生率-严重度矩阵统计", notes = "发生率-严重度矩阵统计")
@GetMapping(value = "/list") @GetMapping(value = "/{stationCode}/list")
public ResponseModel<List<FireFmeaStatisticsDto>> selectForList() { public ResponseModel<List<FireFmeaStatisticsDto>> selectForList(
return ResponseHelper.buildResponse(fireFmeaStatisticsServiceImpl.queryForFireFmeaStatisticsList()); @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode) {
return ResponseHelper.buildResponse(fireFmeaStatisticsServiceImpl.queryForFireFmeaStatisticsList(stationCode));
} }
} }
package com.yeejoin.amos.boot.module.ccs.biz.controller; package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRiskSourceDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireRiskSourceServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireRiskSourceServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -13,9 +12,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -13,9 +12,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* 风险点表 * 风险点表
* *
...@@ -30,62 +26,6 @@ public class FireRiskSourceController extends BaseController { ...@@ -30,62 +26,6 @@ public class FireRiskSourceController extends BaseController {
@Autowired @Autowired
FireRiskSourceServiceImpl fireRiskSourceServiceImpl; FireRiskSourceServiceImpl fireRiskSourceServiceImpl;
/**
* 新增风险点表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增风险点表", notes = "新增风险点表")
public ResponseModel<FireRiskSourceDto> save(@RequestBody FireRiskSourceDto model) {
model = fireRiskSourceServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除风险点表", notes = "根据sequenceNbr删除风险点表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(fireRiskSourceServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个风险点表", notes = "根据sequenceNbr查询单个风险点表")
public ResponseModel<FireRiskSourceDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(fireRiskSourceServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "风险点表分页查询", notes = "风险点表分页查询")
public ResponseModel<Page<FireRiskSourceDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<FireRiskSourceDto> page = new Page<FireRiskSourceDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireRiskSourceServiceImpl.queryForFireRiskSourcePage(page));
}
/** /**
* 列表全部数据查询 * 列表全部数据查询
...@@ -93,9 +33,11 @@ public class FireRiskSourceController extends BaseController { ...@@ -93,9 +33,11 @@ public class FireRiskSourceController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "风险点表列表全部数据查询", notes = "风险点表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "查询风险点RPN统计", notes = "查询风险点RPN统计")
@GetMapping(value = "/list") @GetMapping(value = "/{stationCode}/list")
public ResponseModel<List<FireRiskSourceDto>> selectForList() { public ResponseModel selectForRpnTopList(
return ResponseHelper.buildResponse(fireRiskSourceServiceImpl.queryForFireRiskSourceList()); @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode,
@ApiParam(value = "top值") @RequestParam(required = false) String top) {
return ResponseHelper.buildResponse(fireRiskSourceServiceImpl.selectForRpnTopList(stationCode, top));
} }
} }
package com.yeejoin.amos.boot.module.ccs.biz.controller; package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRpnChangeLogDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireRpnChangeLogServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireRpnChangeLogServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* 风险点变化流水 * 风险点变化流水
* *
...@@ -30,72 +28,16 @@ public class FireRpnChangeLogController extends BaseController { ...@@ -30,72 +28,16 @@ public class FireRpnChangeLogController extends BaseController {
@Autowired @Autowired
FireRpnChangeLogServiceImpl fireRpnChangeLogServiceImpl; FireRpnChangeLogServiceImpl fireRpnChangeLogServiceImpl;
/**
* 新增风险点变化流水
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增风险点变化流水", notes = "新增风险点变化流水")
public ResponseModel<FireRpnChangeLogDto> save(@RequestBody FireRpnChangeLogDto model) {
model = fireRpnChangeLogServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除风险点变化流水", notes = "根据sequenceNbr删除风险点变化流水")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(fireRpnChangeLogServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个风险点变化流水", notes = "根据sequenceNbr查询单个风险点变化流水")
public ResponseModel<FireRpnChangeLogDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(fireRpnChangeLogServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "风险点变化流水分页查询", notes = "风险点变化流水分页查询")
public ResponseModel<Page<FireRpnChangeLogDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<FireRpnChangeLogDto> page = new Page<FireRpnChangeLogDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(fireRpnChangeLogServiceImpl.queryForFireRpnChangeLogPage(page));
}
/** /**
* 列表全部数据查询 * 风险点(PRN)上升百分比
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "风险点变化流水列表全部数据查询", notes = "风险点变化流水列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "风险点(PRN)上升百分比", notes = "风险点(PRN)上升百分比")
@GetMapping(value = "/list") @GetMapping(value = "/{stationCode}/riseUp")
public ResponseModel<List<FireRpnChangeLogDto>> selectForList() { public ResponseModel riseUp(@PathVariable String stationCode) {
return ResponseHelper.buildResponse(fireRpnChangeLogServiceImpl.queryForFireRpnChangeLogList()); return ResponseHelper.buildResponse(fireRpnChangeLogServiceImpl.queryForRiseUp(stationCode));
} }
} }
package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireSignalDayStatisticsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
/**
* 换流站告警日统计
*
* @author system_generator
* @date 2021-11-09
*/
@RestController
@Api(tags = "换流站告警日统计Api")
@RequestMapping(value = "/fire-signal-day-statistics")
public class FireSignalDayStatisticsController extends BaseController {
@Autowired
FireSignalDayStatisticsServiceImpl fireSignalDayStatisticsServiceImpl;
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "警情信息统计", notes = "警情信息统计")
@GetMapping(value = "/alarm/count")
public ResponseModel selectForAlarmCount() throws ParseException {
return ResponseHelper.buildResponse(fireSignalDayStatisticsServiceImpl.selectForAlarmCount());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "警情变化趋势", notes = "警情变化趋势")
@GetMapping(value = "/alarm/trend")
public ResponseModel selectForAlarmTrend(
@ApiParam(value = "开始日期:yyyy-MM-dd", required = true) @RequestParam String beginData,
@ApiParam(value = "结束日期:yyyy-MM-dd", required = true) @RequestParam String endData) {
return ResponseHelper.buildResponse(fireSignalDayStatisticsServiceImpl.selectForAlarmTrend(beginData, endData));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "警情类型占比", notes = "警情类型占比")
@GetMapping(value = "/alarm/percent")
public ResponseModel todayAlarmPercent(
@ApiParam(value = "开始日期:yyyy-MM-dd", required = true) @RequestParam String beginData,
@ApiParam(value = "结束日期:yyyy-MM-dd", required = true) @RequestParam String endData) {
return ResponseHelper.buildResponse(fireSignalDayStatisticsServiceImpl.todayAlarmPercent(beginData, endData));
}
}
...@@ -8,10 +8,7 @@ import io.swagger.annotations.Api; ...@@ -8,10 +8,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -46,4 +43,11 @@ public class FireStationInfoController extends BaseController { ...@@ -46,4 +43,11 @@ public class FireStationInfoController extends BaseController {
@ApiParam(value = "排序条件") @RequestParam(required = false) String orderBy) throws Exception { @ApiParam(value = "排序条件") @RequestParam(required = false) String orderBy) throws Exception {
return ResponseHelper.buildResponse(fireStationInfoServiceImpl.queryForFireStationInfoList(orderBy)); return ResponseHelper.buildResponse(fireStationInfoServiceImpl.queryForFireStationInfoList(orderBy));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "站端信息详情", notes = "站端信息详情")
@GetMapping(value = "/{stationCode}/detail")
public ResponseModel getOne(@PathVariable String stationCode) {
return ResponseHelper.buildResponse(fireStationInfoServiceImpl.getOneByCode(stationCode));
}
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ccs.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.ccs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireVideoDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireVideoDto;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireBuildingServiceImpl;
import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireVideoServiceImpl; import com.yeejoin.amos.boot.module.ccs.biz.service.impl.FireVideoServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -52,13 +53,15 @@ public class FireVideoController extends BaseController { ...@@ -52,13 +53,15 @@ public class FireVideoController extends BaseController {
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode, @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode,
@ApiParam(value = "所在建筑,多个用逗号分隔") @RequestParam(value = "buildingMrids", required = false) String buildingMrids) { @ApiParam(value = "所在建筑,多个用逗号分隔") @RequestParam(value = "buildingMrids", required = false) String buildingMrids) {
List<String> buildingMridList = new ArrayList<>(); List<String> buildingMridList = new ArrayList<>();
if(StringUtils.isNotBlank(buildingMrids)){ //根节点id(全部建筑时使用,本来可以不送来实现过滤,但是地图前端不支持)
String rootMrid = FireBuildingServiceImpl.ROOT_ID;
if (StringUtils.isNotBlank(buildingMrids) && !rootMrid.equals(buildingMrids)) {
buildingMridList = Arrays.stream(buildingMrids.split(",")).collect(Collectors.toList()); buildingMridList = Arrays.stream(buildingMrids.split(",")).collect(Collectors.toList());
} }
Page<FireVideoDto> page = new Page<>(); Page<FireVideoDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(fireVideoServiceImpl.queryForFireVideoPage(page, name, stationCode,buildingMridList)); return ResponseHelper.buildResponse(fireVideoServiceImpl.queryForFireVideoPage(page, name, stationCode, buildingMridList));
} }
} }
...@@ -46,5 +46,12 @@ public class StatisticsController { ...@@ -46,5 +46,12 @@ public class StatisticsController {
return ResponseHelper.buildResponse(iStatisticsService.alarmAndDangerTrend(stationCode, beginDate, endDate)); return ResponseHelper.buildResponse(iStatisticsService.alarmAndDangerTrend(stationCode, beginDate, endDate));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "近一年警情统计", notes = "近一年警情统计")
@GetMapping(value = "/station/lastYearAlarm")
public ResponseModel lastYearAlarmCount() {
return ResponseHelper.buildResponse(iStatisticsService.lastYearAlarmCount());
}
} }
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireAlarmDayStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireAlarmDayStatistics;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireAlarmDayStatisticsMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireAlarmDayStatisticsService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 换流站告警日统计服务实现类
*
* @author system_generator
* @date 2021-11-09
*/
@Service
public class FireAlarmDayStatisticsServiceImpl extends BaseService<FireAlarmDayStatisticsDto, FireAlarmDayStatistics, FireAlarmDayStatisticsMapper> implements IFireAlarmDayStatisticsService {
/**
* 列表查询 示例
*/
public List<FireAlarmDayStatisticsDto> queryForFireAlarmDayStatisticsList() {
return this.queryForList("", false);
}
public int alarmTimesCount(String stationCode, String beginDate, String endDate) {
LambdaQueryWrapper<FireAlarmDayStatistics> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(stationCode), FireAlarmDayStatistics::getStationCode, stationCode);
wrapper.ge(FireAlarmDayStatistics::getCollectDate, beginDate);
wrapper.le(FireAlarmDayStatistics::getCollectDate, endDate);
List<FireAlarmDayStatistics> list = this.list(wrapper);
return list.stream().mapToInt(FireAlarmDayStatistics::getAlarmTimes).sum();
}
public List<String> alarmTimesTrend(String stationCode, String beginDate, String endDate) {
return this.baseMapper.queryAlarmTimesTrend(stationCode, beginDate, endDate);
}
}
\ No newline at end of file
...@@ -12,6 +12,7 @@ import org.typroject.tyboot.core.rdbms.annotation.Condition; ...@@ -12,6 +12,7 @@ import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -24,17 +25,26 @@ import java.util.stream.Collectors; ...@@ -24,17 +25,26 @@ import java.util.stream.Collectors;
*/ */
@Service @Service
public class FireBuildingServiceImpl extends BaseService<FireBuildingDto, FireBuilding, FireBuildingMapper> implements IFireBuildingService { public class FireBuildingServiceImpl extends BaseService<FireBuildingDto, FireBuilding, FireBuildingMapper> implements IFireBuildingService {
public static final String ROOT_ID = "-1";
/** /**
* 分页查询 * 分页查询
*/ */
public Page<FireBuildingDto> queryForFireBuildingPage(Page<FireBuildingDto> page, @Condition(Operator.like) String name, @Condition String stationCode) { public Page<FireBuildingDto> queryForFireBuildingPage(Page<FireBuildingDto> page, @Condition(Operator.like) String name, @Condition String stationCode, String type) {
return this.queryForPage(page, "create_date", false, name, stationCode); return this.queryForPage(page, "create_date", false, name, stationCode, type);
} }
public List<FireBuildingDto> buildingTree(String stationCode) { public List<FireBuildingDto> buildingTree(String stationCode) {
List<FireBuildingDto> dtoList = this.queryForList("create_date", true, stationCode); List<FireBuildingDto> dtoList = this.queryForList("create_date", true, stationCode);
return dtoList.stream().filter(d -> StringUtils.isBlank(d.getParentMrid()) || "0".equals(d.getParentMrid()) || "-1".equals(d.getParentMrid())).peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList()); FireBuildingDto parentNode = new FireBuildingDto();
parentNode.setId(ROOT_ID);
parentNode.setName("全部建筑");
parentNode.setMrid(ROOT_ID);
parentNode.setTreeMrids(ROOT_ID);
List<FireBuildingDto> childrenNode = dtoList.stream().filter(d -> StringUtils.isBlank(d.getParentMrid()) || "0".equals(d.getParentMrid()) || "-1".equals(d.getParentMrid())).peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList());
parentNode.setChildren(childrenNode);
return Collections.singletonList(parentNode);
} }
private List<FireBuildingDto> getChildren(String mrid, List<FireBuildingDto> dtoList) { private List<FireBuildingDto> getChildren(String mrid, List<FireBuildingDto> dtoList) {
......
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipment; import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipment;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalLogMapper;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalMapper;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentMapper; import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentMapper;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentDto; import org.apache.commons.lang3.StringUtils;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 消防设备资产服务实现类 * 消防设备资产服务实现类
...@@ -16,18 +27,35 @@ import java.util.List; ...@@ -16,18 +27,35 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireEquipmentServiceImpl extends BaseService<FireEquipmentDto,FireEquipment,FireEquipmentMapper> implements IFireEquipmentService { public class FireEquipmentServiceImpl extends BaseService<FireEquipmentDto, FireEquipment, FireEquipmentMapper> implements IFireEquipmentService {
/**
* 分页查询 @Autowired
*/ FireEquipmentSignalLogMapper fireEquipmentSignalLogMapper;
public Page<FireEquipmentDto> queryForFireEquipmentPage(Page<FireEquipmentDto> page) { @Autowired
return this.queryForPage(page, null, false); FireStationInfoMapper stationInfoMapper;
@Autowired
FireEquipmentSignalMapper fireEquipmentSignalMapper;
@Override
public Map<String, Object> selectForMonitorCount(String stationCode) throws ParseException {
LambdaQueryWrapper<FireEquipment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(FireEquipment::getIsIot, true);
wrapper.eq(StringUtils.isNotBlank(stationCode), FireEquipment::getStationCode, stationCode);
int totalIotEquipment = this.count(wrapper);
List<FireEquipmentDto> logs = fireEquipmentSignalLogMapper.distinctByEquipmentId(stationCode, DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN));
Map<String, Object> result = new HashMap<>();
result.put("totalIotEquipment", totalIotEquipment);
result.put("todayAlarmEquipment", logs.size());
return result;
} }
/** @Override
* 列表查询 示例 public List<Map<String, Object>> stationEquipmentInfo(String stationCode, String stationName) {
*/ return stationInfoMapper.queryStationEquipInfo(stationCode,stationName);
public List<FireEquipmentDto> queryForFireEquipmentList() { }
return this.queryForList("" , false);
@Override
public List<Map<String, Object>> faultEquipTopCount(Long top) {
return fireEquipmentSignalMapper.faultEquipTopCount(top, new Date());
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentAlarmLogDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentSignalLogDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentAlarmLog; import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignalLog;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentAlarmLogMapper; import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalLogMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentAlarmLogService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentSignalLogService;
import com.yeejoin.amos.boot.module.ccs.biz.util.RequestUtil; import com.yeejoin.amos.boot.module.ccs.biz.util.RequestUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -24,7 +24,7 @@ import java.util.Map; ...@@ -24,7 +24,7 @@ import java.util.Map;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireEquipmentAlarmLogServiceImpl extends BaseService<FireEquipmentAlarmLogDto, FireEquipmentAlarmLog, FireEquipmentAlarmLogMapper> implements IFireEquipmentAlarmLogService { public class FireEquipmentSignalLogServiceImpl extends BaseService<FireEquipmentSignalLogDto, FireEquipmentSignalLog, FireEquipmentSignalLogMapper> implements IFireEquipmentSignalLogService {
@Autowired @Autowired
HttpServletRequest request; HttpServletRequest request;
...@@ -32,13 +32,13 @@ public class FireEquipmentAlarmLogServiceImpl extends BaseService<FireEquipmentA ...@@ -32,13 +32,13 @@ public class FireEquipmentAlarmLogServiceImpl extends BaseService<FireEquipmentA
/** /**
* 告警列表查询-最新告警及跑马灯使用 * 告警列表查询-最新告警及跑马灯使用
*/ */
public List<FireEquipmentAlarmLogDto> fireEquipmentAlarmLogList() { public List<FireEquipmentSignalLogDto> fireEquipmentAlarmLogList() {
Map<String, Object> params = RequestUtil.getRequestParamMap(request); Map<String, Object> params = RequestUtil.getRequestParamMap(request);
return this.getBaseMapper().queryAlarmLogList(params); return this.getBaseMapper().queryAlarmLogList(params);
} }
public List<FireEquipmentAlarmLogDto> todayAlarmLogList(String stationCode) throws ParseException { public List<FireEquipmentSignalLogDto> todayAlarmLogList(String stationCode) throws ParseException {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
//未确认 //未确认
params.put("confirmState","0"); params.put("confirmState","0");
......
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentAlarm; import com.yeejoin.amos.boot.module.ccs.api.entity.FireEquipmentSignal;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentAlarmMapper; import com.yeejoin.amos.boot.module.ccs.api.mapper.FireEquipmentSignalMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentAlarmService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireEquipmentSignalService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentAlarmDto; import com.yeejoin.amos.boot.module.ccs.api.dto.FireEquipmentSignalDto;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -16,18 +16,18 @@ import java.util.List; ...@@ -16,18 +16,18 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireEquipmentAlarmServiceImpl extends BaseService<FireEquipmentAlarmDto,FireEquipmentAlarm,FireEquipmentAlarmMapper> implements IFireEquipmentAlarmService { public class FireEquipmentSignalServiceImpl extends BaseService<FireEquipmentSignalDto, FireEquipmentSignal, FireEquipmentSignalMapper> implements IFireEquipmentSignalService {
/** /**
* 分页查询 * 分页查询
*/ */
public Page<FireEquipmentAlarmDto> queryForFireEquipmentAlarmPage(Page<FireEquipmentAlarmDto> page) { public Page<FireEquipmentSignalDto> queryForFireEquipmentAlarmPage(Page<FireEquipmentSignalDto> page) {
return this.queryForPage(page, null, false); return this.queryForPage(page, null, false);
} }
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
public List<FireEquipmentAlarmDto> queryForFireEquipmentAlarmList() { public List<FireEquipmentSignalDto> queryForFireEquipmentAlarmList() {
return this.queryForList("" , false); return this.queryForList("" , false);
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireFmeaStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireFmeaStatistics; import com.yeejoin.amos.boot.module.ccs.api.entity.FireFmeaStatistics;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireFmeaStatisticsMapper; import com.yeejoin.amos.boot.module.ccs.api.mapper.FireFmeaStatisticsMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireFmeaStatisticsService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireFmeaStatisticsService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireFmeaStatisticsDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List; import java.util.List;
/** /**
...@@ -16,7 +17,7 @@ import java.util.List; ...@@ -16,7 +17,7 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireFmeaStatisticsServiceImpl extends BaseService<FireFmeaStatisticsDto,FireFmeaStatistics,FireFmeaStatisticsMapper> implements IFireFmeaStatisticsService { public class FireFmeaStatisticsServiceImpl extends BaseService<FireFmeaStatisticsDto, FireFmeaStatistics, FireFmeaStatisticsMapper> implements IFireFmeaStatisticsService {
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -26,8 +27,10 @@ public class FireFmeaStatisticsServiceImpl extends BaseService<FireFmeaStatistic ...@@ -26,8 +27,10 @@ public class FireFmeaStatisticsServiceImpl extends BaseService<FireFmeaStatistic
/** /**
* 列表查询 示例 * 列表查询 示例
*
* @param stationCode 换流站编号
*/ */
public List<FireFmeaStatisticsDto> queryForFireFmeaStatisticsList() { public List<FireFmeaStatisticsDto> queryForFireFmeaStatisticsList(String stationCode) {
return this.queryForList("" , false); return this.queryForTopList(20, "mutiby", false, stationCode);
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRiskSourceDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireRiskSource; import com.yeejoin.amos.boot.module.ccs.api.entity.FireRiskSource;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireRiskSourceMapper; import com.yeejoin.amos.boot.module.ccs.api.mapper.FireRiskSourceMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireRiskSourceService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireRiskSourceService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRiskSourceDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List; import java.util.List;
/** /**
...@@ -16,18 +16,9 @@ import java.util.List; ...@@ -16,18 +16,9 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireRiskSourceServiceImpl extends BaseService<FireRiskSourceDto,FireRiskSource,FireRiskSourceMapper> implements IFireRiskSourceService { public class FireRiskSourceServiceImpl extends BaseService<FireRiskSourceDto, FireRiskSource, FireRiskSourceMapper> implements IFireRiskSourceService {
/**
* 分页查询
*/
public Page<FireRiskSourceDto> queryForFireRiskSourcePage(Page<FireRiskSourceDto> page) {
return this.queryForPage(page, null, false);
}
/** public List<FireRiskSourceDto> selectForRpnTopList(String stationCode, String top) {
* 列表查询 示例 return this.baseMapper.queryForRpnDescList(stationCode, top);
*/
public List<FireRiskSourceDto> queryForFireRiskSourceList() {
return this.queryForList("" , false);
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRpnChangeLogDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireRpnChangeLog; import com.yeejoin.amos.boot.module.ccs.api.entity.FireRpnChangeLog;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireRpnChangeLogMapper; import com.yeejoin.amos.boot.module.ccs.api.mapper.FireRpnChangeLogMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireRpnChangeLogService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireRpnChangeLogService;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireRpnChangeLogDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
/** /**
* 风险点变化流水服务实现类 * 风险点变化流水服务实现类
...@@ -16,18 +17,20 @@ import java.util.List; ...@@ -16,18 +17,20 @@ import java.util.List;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireRpnChangeLogServiceImpl extends BaseService<FireRpnChangeLogDto,FireRpnChangeLog,FireRpnChangeLogMapper> implements IFireRpnChangeLogService { public class FireRpnChangeLogServiceImpl extends BaseService<FireRpnChangeLogDto, FireRpnChangeLog, FireRpnChangeLogMapper> implements IFireRpnChangeLogService {
/**
* 分页查询
*/
public Page<FireRpnChangeLogDto> queryForFireRpnChangeLogPage(Page<FireRpnChangeLogDto> page) {
return this.queryForPage(page, null, false);
}
/** @Override
* 列表查询 示例 public Map<String, Object> queryForRiseUp(String stationCode) {
*/ Map<String, Object> result = new HashMap<>();
public List<FireRpnChangeLogDto> queryForFireRpnChangeLogList() { //本月
return this.queryForList("" , false); Map resultMonth = this.baseMapper.queryForRiseUp(stationCode, "1");
//本季度
Map resultSeason = this.baseMapper.queryForRiseUp(stationCode, "2");
//本年
Map resultYear = this.baseMapper.queryForRiseUp(stationCode, "3");
result.put("month", resultMonth);
result.put("season", resultSeason);
result.put("year", resultYear);
return result;
} }
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.ccs.api.dto.FireSignalDayStatisticsDto;
import com.yeejoin.amos.boot.module.ccs.api.entity.FireSignalDayStatistics;
import com.yeejoin.amos.boot.module.ccs.api.enums.SignalTypeOfAlarm;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireSignalDayStatisticsMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireSignalDayStatisticsService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.*;
/**
* 换流站告警日统计服务实现类
*
* @author system_generator
* @date 2021-11-09
*/
@Service
public class FireSignalDayStatisticsServiceImpl extends BaseService<FireSignalDayStatisticsDto, FireSignalDayStatistics, FireSignalDayStatisticsMapper> implements IFireSignalDayStatisticsService {
public int alarmTimesCount(String stationCode, String beginDate, String endDate) {
LambdaQueryWrapper<FireSignalDayStatistics> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(stationCode), FireSignalDayStatistics::getStationCode, stationCode);
wrapper.ge(FireSignalDayStatistics::getCollectDate, beginDate);
wrapper.le(FireSignalDayStatistics::getCollectDate, endDate);
wrapper.eq(FireSignalDayStatistics::getIsAlarm, true);
List<FireSignalDayStatistics> list = this.list(wrapper);
return list.stream().mapToInt(FireSignalDayStatistics::getReportTimes).sum();
}
public List<String> alarmTimesTrend(String stationCode, String beginDate, String endDate) {
return this.baseMapper.queryAlarmTimesTrend(stationCode, beginDate, endDate, null);
}
@Override
public Map<String, Object> selectForAlarmCount() throws ParseException {
//TODO 统计告警类型的指标信息
//今天
String today = DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN);
//昨天
Date yesterday = DateUtils.dateAdd(new Date(), 1, false);
String yesterdayStr = DateUtils.dateFormat(yesterday, DateUtils.DATE_PATTERN);
//本周开始日期
Date weekBegin = DateUtils.beginDateOfWeek(new Date());
//本月开始日期
Date monthBegin = DateUtils.getBeginDateOfMonth(new Date());
//今日告警数量
int todayAlarmTimes = this.alarmTimesCount(null, today, today);
//昨日警情数量
int yesterdayAlarmTimes = this.alarmTimesCount(null, yesterdayStr, yesterdayStr);
//本周警情数目
int weekAlarmTimes = this.alarmTimesCount(null, DateUtils.dateFormat(weekBegin, DateUtils.DATE_PATTERN), today);
//本月警情数目
int monthAlarmTimes = this.alarmTimesCount(null, DateUtils.dateFormat(monthBegin, DateUtils.DATE_PATTERN), today);
Map<String, Object> result = new HashMap<>(8);
result.put("todayAlarmTimes", todayAlarmTimes);
result.put("yesterdayAlarmTimes", yesterdayAlarmTimes);
result.put("weekAlarmTimes", weekAlarmTimes);
result.put("monthAlarmTimes", monthAlarmTimes);
return result;
}
@Override
public Map<String, Object> selectForAlarmTrend(String beginData, String endData) {
//故障告警
List<String> faultAlarm = this.baseMapper.queryAlarmTimesTrend(null, beginData, endData, SignalTypeOfAlarm.FAULT_ALARM.getCode());
//火灾告警
List<String> fireAlarm = this.baseMapper.queryAlarmTimesTrend(null, beginData, endData, SignalTypeOfAlarm.FIRE_ALARM.getCode());
//屏蔽
List<String> shieldAlarm = this.baseMapper.queryAlarmTimesTrend(null, beginData, endData, SignalTypeOfAlarm.SHIELD_ALARM.getCode());
//漏油
List<String> oilAlarm = this.baseMapper.queryAlarmTimesTrend(null, beginData, endData, SignalTypeOfAlarm.OIL_LEAK_ALARM.getCode());
//告警
List<String> alarm = this.baseMapper.queryAlarmTimesTrend(null, beginData, endData, SignalTypeOfAlarm.ALARM.getCode());
Map<String, Object> result = new LinkedHashMap<>(8);
result.put("faultAlarm", faultAlarm);
result.put("fireAlarm", fireAlarm);
result.put("shieldAlarm", shieldAlarm);
result.put("oilLeakAlarm", oilAlarm);
result.put("alarm", alarm);
return result;
}
@Override
public Map<String, Object> todayAlarmPercent(String beginData, String endData) {
Map<String, Object> re = new LinkedHashMap<>(8);
//故障告警
re.put("faultAlarm", this.signalReportTimesCount(beginData, endData, SignalTypeOfAlarm.FAULT_ALARM.getCode()));
//火灾告警
re.put("fireAlarm", this.signalReportTimesCount(beginData, endData, SignalTypeOfAlarm.FIRE_ALARM.getCode()));
//屏蔽
re.put("shieldAlarm", this.signalReportTimesCount(beginData, endData, SignalTypeOfAlarm.SHIELD_ALARM.getCode()));
//漏油
re.put("oilLeakAlarm", this.signalReportTimesCount(beginData, endData, SignalTypeOfAlarm.OIL_LEAK_ALARM.getCode()));
//告警
re.put("alarm", this.signalReportTimesCount(beginData, endData, SignalTypeOfAlarm.ALARM.getCode()));
return re;
}
private int signalReportTimesCount(String beginDate, String endDate, String signalType) {
LambdaQueryWrapper<FireSignalDayStatistics> wrapper = new LambdaQueryWrapper<>();
wrapper.ge(FireSignalDayStatistics::getCollectDate, beginDate);
wrapper.le(FireSignalDayStatistics::getCollectDate, endDate);
wrapper.eq(FireSignalDayStatistics::getSignalType, signalType);
List<FireSignalDayStatistics> list = this.list(wrapper);
return list.stream().mapToInt(FireSignalDayStatistics::getReportTimes).sum();
}
}
\ No newline at end of file
...@@ -7,7 +7,6 @@ import com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper; ...@@ -7,7 +7,6 @@ import com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService; import com.yeejoin.amos.boot.module.ccs.api.service.IFireStationInfoService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List; import java.util.List;
...@@ -20,18 +19,28 @@ import java.util.Optional; ...@@ -20,18 +19,28 @@ import java.util.Optional;
* @date 2021-11-09 * @date 2021-11-09
*/ */
@Service @Service
public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto,FireStationInfo,FireStationInfoMapper> implements IFireStationInfoService { public class FireStationInfoServiceImpl extends BaseService<FireStationInfoDto, FireStationInfo, FireStationInfoMapper> implements IFireStationInfoService {
/** /**
* 列表查询 示例 * 列表查询 示例
*
* @param orderBy * @param orderBy
*/ */
public List<FireStationInfoDto> queryForFireStationInfoList(String orderBy) throws Exception { public List<FireStationInfoDto> queryForFireStationInfoList(String orderBy) throws Exception {
if(StringUtils.isNotBlank(orderBy)){ if (StringUtils.isNotBlank(orderBy)) {
Optional<StationOrderByTypeEnum> op = StationOrderByTypeEnum.getEnum(orderBy); Optional<StationOrderByTypeEnum> op = StationOrderByTypeEnum.getEnum(orderBy);
op.orElseThrow(()->new Exception("不存在查询排序条件")); op.orElseThrow(() -> new Exception("不存在查询排序条件"));
return this.baseMapper.queryStationListWithStatistics(op.get().getOrderBy()); return this.baseMapper.queryStationListWithStatistics(op.get().getOrderBy());
} else { } else {
return this.baseMapper.queryStationListWithStatistics(null); return this.baseMapper.queryStationListWithStatistics(null);
} }
} }
@Override
public FireStationInfoDto getOneByCode(String code) {
List<FireStationInfoDto> dtos = this.queryForList("", false, code);
if (dtos.isEmpty()) {
throw new RuntimeException("不存在指定数据");
}
return dtos.iterator().next();
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.ccs.biz.service.impl; package com.yeejoin.amos.boot.module.ccs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.ccs.api.mapper.FireStationInfoMapper;
import com.yeejoin.amos.boot.module.ccs.api.service.IStatisticsService; import com.yeejoin.amos.boot.module.ccs.api.service.IStatisticsService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -18,11 +19,14 @@ import java.util.Map; ...@@ -18,11 +19,14 @@ import java.util.Map;
public class StatisticsServiceImpl implements IStatisticsService { public class StatisticsServiceImpl implements IStatisticsService {
@Autowired @Autowired
FireAlarmDayStatisticsServiceImpl fireAlarmDayStatisticsService; FireSignalDayStatisticsServiceImpl fireAlarmDayStatisticsService;
@Autowired @Autowired
FireDangerDayStatisticsServiceImpl fireDangerDayStatisticsService; FireDangerDayStatisticsServiceImpl fireDangerDayStatisticsService;
@Autowired
FireStationInfoMapper fireStationInfoMapper;
@Override @Override
public Map<String, Object> alarmAndDangerNumCount(String stationCode) throws ParseException { public Map<String, Object> alarmAndDangerNumCount(String stationCode) throws ParseException {
...@@ -55,4 +59,9 @@ public class StatisticsServiceImpl implements IStatisticsService { ...@@ -55,4 +59,9 @@ public class StatisticsServiceImpl implements IStatisticsService {
result.put("dangerTrend", dangerTrend); result.put("dangerTrend", dangerTrend);
return result; return result;
} }
@Override
public List<Map<String, Object>> lastYearAlarmCount() {
return fireStationInfoMapper.lastYearAlarmCount();
}
} }
...@@ -496,9 +496,9 @@ public class CommandController extends BaseController { ...@@ -496,9 +496,9 @@ public class CommandController extends BaseController {
@GetMapping(value = "ZQ/list") @GetMapping(value = "ZQ/list")
@ApiOperation(httpMethod = "GET", value = "执勤实力列表分页查询", notes = "执勤实力列表分页查询") @ApiOperation(httpMethod = "GET", value = "执勤实力列表分页查询", notes = "执勤实力列表分页查询")
public ResponseModel<IPage<FireTeamZhDto>> ZQlistPage(Integer pageNum, Integer pageSize, RequestData par) { public ResponseModel<IPage<FireTeamZhDto>> ZQlistPage(Integer pageNum, Integer pageSize, RequestData par) {
if(par.getTypeCode()==null){ // if(par.getTypeCode()==null){
par.setTypeCode( AlertStageEnums.ZZZD.getCode()+","+AlertStageEnums.YLJY.getCode()); // par.setTypeCode( AlertStageEnums.ZZZD.getCode()+","+AlertStageEnums.YLJY.getCode());
} // }
Page<FireTeamZhDto> pageBean = new Page<>(pageNum, pageSize); Page<FireTeamZhDto> pageBean = new Page<>(pageNum, pageSize);
List<FireTeamZhDto> list= iFireTeamService.getFireTeamList(pageNum,pageSize,par); List<FireTeamZhDto> list= iFireTeamService.getFireTeamList(pageNum,pageSize,par);
Integer num= iFireTeamService.getFireTeamListCount(par); Integer num= iFireTeamService.getFireTeamListCount(par);
...@@ -1066,9 +1066,6 @@ public class CommandController extends BaseController { ...@@ -1066,9 +1066,6 @@ public class CommandController extends BaseController {
if (e.get("carState").equals("在位")){ if (e.get("carState").equals("在位")){
e.put("carState",FireCarStatusEnum.执勤.getName()); e.put("carState",FireCarStatusEnum.执勤.getName());
} }
e.put("longitude",116.423762);
e.put("latitude",39.511552);
String sequenceNbr = e.get("sequenceNbr").toString(); String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态 //同步力量调派车辆任务状态
alertFormValue.stream().forEach(v->{ alertFormValue.stream().forEach(v->{
......
...@@ -557,4 +557,30 @@ public class OrgUsrController extends BaseController { ...@@ -557,4 +557,30 @@ public class OrgUsrController extends BaseController {
public ResponseModel<Map<String, Integer>> getDeptCountByCompanyIds(@RequestParam List<String> companyIdList) throws Exception { public ResponseModel<Map<String, Integer>> getDeptCountByCompanyIds(@RequestParam List<String> companyIdList) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getDeptCountByCompanyIds(companyIdList)); return ResponseHelper.buildResponse(iOrgUsrService.getDeptCountByCompanyIds(companyIdList));
} }
/**
* 根据机场人员ids获取amos平台人员列表
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据机场人员ids获取amos平台人员列表", notes = "根据机场人员ids获取amos平台人员列表")
@GetMapping(value = "/amos/list/{orgUserId}")
public ResponseModel<List<AgencyUserModel>> getAmosUserByOrgUser(@PathVariable String orgUserId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getAmosUserByOrgUser(orgUserId));
}
/**
* 根据机场单位id获取单位人员列表
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据机场单位id获取单位人员列表", notes = "根据机场单位id获取单位人员列表")
@GetMapping(value = "/{companyId}/person/list")
public ResponseModel<List<OrgUsr>> getPersonListByCompanyId(@PathVariable String companyId) {
return ResponseHelper.buildResponse(iOrgUsrService.getPersonListByCompanyId(companyId));
}
} }
\ No newline at end of file
...@@ -224,7 +224,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -224,7 +224,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
this.getGroupCode(), "carId", "carName", "teamName","result.carId"); this.getGroupCode(), "carId", "carName", "teamName","result.carId");
int count =0; int count =0;
for (Map<String, Object> map : equipmentList) { for (Map<String, Object> map : equipmentList) {
if(map.containsKey("carId") && map.get("carId").equals(carId)) { if(map.containsKey("carId") && map.get("carId").equals(Long.toString(carId))) {
count++; count++;
} }
} }
......
...@@ -287,25 +287,15 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -287,25 +287,15 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
map20.put(ssString, ssString); map20.put(ssString, ssString);
} }
System.out.println("ssssssssss"); System.out.println("ssssssssss");
}); });
} }
@Override @Override
public List<Map<String, Object>> queryByCompanyId(){ public List<Map<String, Object>> queryByCompanyId(List<String> bizNames){
return dutyPersonShiftMapper.queryByCompanyId(); return dutyPersonShiftMapper.queryByCompanyId(bizNames);
} }
@Override @Override
......
...@@ -1600,6 +1600,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1600,6 +1600,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
* @param id * @param id
* @return * @return
*/ */
@Override
public List<OrgUsr> getPersonListByParentId(Long id) { public List<OrgUsr> getPersonListByParentId(Long id) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>(); LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false); wrapper.eq(OrgUsr::getIsDelete, false);
...@@ -1866,9 +1867,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1866,9 +1867,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultMap; return resultMap;
} }
public List<Map<String,Object>> queryCompanyId(String bizOrgName) { public List<Map<String,Object>> queryCompanyId(String bizOrgName,List<String> codes) {
return orgUsrMapper.queryCompanyId(bizOrgName,codes);
}
public List<Map<String,Object>> queryCompanyIdNew(String bizOrgName) {
return orgUsrMapper.queryCompanyId(bizOrgName); return orgUsrMapper.queryCompanyIdNew(bizOrgName);
} }
...@@ -1884,4 +1890,40 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1884,4 +1890,40 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
} }
public List<AgencyUserModel> getAmosUserByOrgUser(String orgUserIds) throws Exception {
if (ValidationUtil.isEmpty(orgUserIds)) {
throw new Exception("账号不存在");
}
List<String> orgUserIdList = Lists.newArrayList(orgUserIds.split(","));
List<OrgUsr> orgUsr = this.baseMapper
.selectList(new LambdaQueryWrapper<OrgUsr>().in(OrgUsr::getSequenceNbr, orgUserIdList));
if (ValidationUtil.isEmpty(orgUsr)) {
throw new Exception("账号不存在");
}
String userIds = Joiner.on(",").join(Lists.transform(orgUsr, OrgUsr::getAmosOrgId));
List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(userIds, false).getResult();
if (ValidationUtil.isEmpty(amosUser)) {
throw new Exception("账号不存在");
}
return amosUser;
}
/**
* 查询组织机构下面的人员列表信息
*
* @param id
* @return
*/
public List<OrgUsr> getPersonListByCompanyId(String id) {
OrgUsr company = this.getById(id);
if (ValidationUtil.isEmpty(company)) {
return null;
}
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
wrapper.likeRight(OrgUsr::getBizOrgCode, company.getBizOrgCode());
return this.baseMapper.selectList(wrapper);
}
} }
...@@ -19,6 +19,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -19,6 +19,8 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
@RestController @RestController
@RequestMapping("/api/planClassifyTree") @RequestMapping("/api/planClassifyTree")
...@@ -29,6 +31,7 @@ public class PlanClassifyTreeController extends AbstractBaseController { ...@@ -29,6 +31,7 @@ public class PlanClassifyTreeController extends AbstractBaseController {
private IPlanClassifyTreeService planClassifyTreeService; private IPlanClassifyTreeService planClassifyTreeService;
@ApiOperation(value = "创建分类") @ApiOperation(value = "创建分类")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
public ResponseModel create(@RequestBody PlanClassifyTree model) { public ResponseModel create(@RequestBody PlanClassifyTree model) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -40,6 +43,7 @@ public class PlanClassifyTreeController extends AbstractBaseController { ...@@ -40,6 +43,7 @@ public class PlanClassifyTreeController extends AbstractBaseController {
} }
@ApiOperation(value = "修改分类") @ApiOperation(value = "修改分类")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/update", method = RequestMethod.PUT) @RequestMapping(value = "/update", method = RequestMethod.PUT)
public ResponseModel update(@RequestBody PlanClassifyTree model) { public ResponseModel update(@RequestBody PlanClassifyTree model) {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
...@@ -51,11 +55,13 @@ public class PlanClassifyTreeController extends AbstractBaseController { ...@@ -51,11 +55,13 @@ public class PlanClassifyTreeController extends AbstractBaseController {
} }
@ApiOperation(value = "删除分类") @ApiOperation(value = "删除分类")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{ids}", method = RequestMethod.DELETE) @RequestMapping(value = "/{ids}", method = RequestMethod.DELETE)
public ResponseModel delete(@PathVariable("ids") String ids) { public ResponseModel delete(@PathVariable("ids") String ids) {
return CommonResponseUtil2.success(planClassifyTreeService.delete(ids)); return CommonResponseUtil2.success(planClassifyTreeService.delete(ids));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询分类树") @ApiOperation(value = "查询分类树")
@RequestMapping(value = "/tree", method = RequestMethod.GET) @RequestMapping(value = "/tree", method = RequestMethod.GET)
public ResponseModel getTree() { public ResponseModel getTree() {
......
...@@ -49,7 +49,12 @@ public class StartLoader implements ApplicationRunner { ...@@ -49,7 +49,12 @@ public class StartLoader implements ApplicationRunner {
String obj = new String(payload); String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) { if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj); JSONObject json = JSON.parseObject(obj);
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", json.get("unitInvolvedName")+","+json.get("address")+",发生警情,请处理。", json.get("id").toString(), json); AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情",
"物联设备发生警情,发生位置:"+json.get("address")!=null?json.get("address").toString():""+
",事发单位:"+json.get("unitInvolvedName")!=null?json.get("unitInvolvedName").toString():""
+",联系人:"+json.get("contactUser")!=null?json.get("contactUser").toString():""
+",联系电话:"+json.get("contactPhone")!=null?json.get("contactPhone").toString():""+".请尽快处理!",
json.get("id").toString(), json);
emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes("UTF-8"), 1, false); emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes("UTF-8"), 1, false);
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -7,17 +7,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -7,17 +7,22 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
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; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto; import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto; import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted;
import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedObjectServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedObjectServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertSubmittedServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.RuleAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.TemplateServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.TemplateServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -34,8 +39,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -34,8 +39,11 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** /**
...@@ -203,6 +211,8 @@ public class AlertSubmittedController extends BaseController { ...@@ -203,6 +211,8 @@ public class AlertSubmittedController extends BaseController {
alertSubmittedService.getAlertSubmittedContent(alertCalledId, templateVos, companyName); alertSubmittedService.getAlertSubmittedContent(alertCalledId, templateVos, companyName);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
throw new RuntimeException("系统异常"); throw new RuntimeException("系统异常");
} catch (ParseException e) {
e.printStackTrace();
} }
return ResponseHelper.buildResponse(templateVos); return ResponseHelper.buildResponse(templateVos);
} }
...@@ -216,10 +226,26 @@ public class AlertSubmittedController extends BaseController { ...@@ -216,10 +226,26 @@ public class AlertSubmittedController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/{id}/scheduling_content", method = RequestMethod.GET) @RequestMapping(value = "/{id}/scheduling_content", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取融合调度短信内容", notes = "获取融合调度短信内容") @ApiOperation(httpMethod = "GET", value = "获取融合调度短信内容", notes = "获取融合调度短信内容")
public ResponseModel<AlertSubmittedSMSDto> getSchedulingContent(@PathVariable Long id) { public ResponseModel<AlertSubmittedSMSDto> getSchedulingContent(@PathVariable Long id) throws ParseException {
// 获取报送内容 // 获取报送内容
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日 // 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
AlertSubmittedSMSDto schedulingContent = alertSubmittedService.getSchedulingContent(id); AlertSubmittedSMSDto schedulingContent = alertSubmittedService.getSchedulingContent(id);
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService.selectAlertCalledByIdNoRedisNew(Long.valueOf(schedulingContent.getAlertCallId()));
/**
* 构建警情报送规则对象
*/
AlertCalledRo alertCalledRo = new AlertCalledRo();
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
String replaceContent = RuleAlertCalledService.init(alertCalledRo,alertCalledVo);
Map<String, String> definitions = new HashMap<>();
definitions.put("$type",alertCalled.getAlertType());
definitions.put("$callTime", DateUtils.dateTimeToDateString(alertCalled.getCallTime()));
definitions.put("$replaceContent",replaceContent);
definitions.put("$address",alertCalled.getAddress());
String content = getTaskInformation( schedulingContent.getSubmissionTemplate(),definitions);
schedulingContent.setSubmissionTemplate(content);
if(!ValidationUtil.isEmpty(schedulingContent.getSubmissionContent())) { if(!ValidationUtil.isEmpty(schedulingContent.getSubmissionContent())) {
try { try {
JSON.parseObject(schedulingContent.getSubmissionContent()); JSON.parseObject(schedulingContent.getSubmissionContent());
...@@ -230,5 +256,12 @@ public class AlertSubmittedController extends BaseController { ...@@ -230,5 +256,12 @@ public class AlertSubmittedController extends BaseController {
} }
return ResponseHelper.buildResponse(schedulingContent); return ResponseHelper.buildResponse(schedulingContent);
} }
private String getTaskInformation(String content, Map<String, String> definitions) {
int size = definitions.size();
String[] keys = definitions.keySet().toArray(new String[size]);
String[] values = definitions.values().toArray(new String[size]);
return StringUtils.replaceEach(content, keys, values);
}
} }
...@@ -369,7 +369,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -369,7 +369,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
alertCalledObjsDto.setAlertFormValue(alertFormValuelist); alertCalledObjsDto.setAlertFormValue(alertFormValuelist);
// 警情报送 // 警情报送
// 调用规则 警情初报 // 调用规则 警情初报
ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(), null); ruleAlertCalledService.fireAlertCalledRule(alertCalledObjsDto, AlertBusinessTypeEnum.警情初报.getCode(), null,null,null);
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 // 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(topic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
/** /**
...@@ -377,9 +377,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -377,9 +377,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
*/ */
eSAlertCalledService.saveAlertCalledToES(alertCalled); eSAlertCalledService.saveAlertCalledToES(alertCalled);
} }
return alertCalledObjsDto; return alertCalledObjsDto;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import static org.hamcrest.CoreMatchers.nullValue;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttPersistenceException; import org.eclipse.paho.client.mqttv3.MqttPersistenceException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary; import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils; import com.yeejoin.amos.boot.biz.common.utils.EnumsUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto; import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedExtDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto; import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto; import com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyZHDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto; import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto; import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto; import com.yeejoin.amos.boot.module.jcs.api.dto.TemplateExtendDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmittedObject;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template; import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertBusinessTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSchedulingTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertSubmitTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.SubmissionMethodEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedObjectService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertSubmittedService;
import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction; import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction;
import com.yeejoin.amos.component.rule.config.RuleConfig; import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.LinkedList;
/** /**
*
* 警情报送记录 服务实现类 * 警情报送记录 服务实现类
* *
*
*
* @author tb * @author tb
*
* @date 2021-06-17 * @date 2021-06-17
*
*/ */
@Service @Service
public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, AlertSubmitted, AlertSubmittedMapper> public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, AlertSubmitted, AlertSubmittedMapper>
implements IAlertSubmittedService { implements IAlertSubmittedService {
@Autowired @Autowired
IAlertSubmittedObjectService iAlertSubmittedObjectService; IAlertSubmittedObjectService iAlertSubmittedObjectService;
@Autowired @Autowired
AlertSubmittedObjectServiceImpl alertSubmittedObjectServiceImpl; AlertSubmittedObjectServiceImpl alertSubmittedObjectServiceImpl;
@Autowired @Autowired
AlertCalledServiceImpl alertCalledService; AlertCalledServiceImpl alertCalledService;
@Autowired @Autowired
DataDictionaryServiceImpl dataDictionaryService; DataDictionaryServiceImpl dataDictionaryService;
@Autowired @Autowired
TemplateServiceImpl templateService; TemplateServiceImpl templateService;
@Autowired @Autowired
PowerTransferServiceImpl powerTransferService; PowerTransferServiceImpl powerTransferService;
@Autowired @Autowired
RuleAlertCalledService ruleAlertCalledService; RuleAlertCalledService ruleAlertCalledService;
@Autowired @Autowired
AlertCalledAction alertCalledAction; AlertCalledAction alertCalledAction;
@Autowired @Autowired
OrgUsrServiceImpl orgUsrService; OrgUsrServiceImpl orgUsrService;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired @Autowired
private FirefightersServiceImpl firefightersService; private FirefightersServiceImpl firefightersService;
@Autowired @Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired @Autowired
IDutyPersonService iDutyPersonService; IDutyPersonService iDutyPersonService;
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
@Value("${mqtt.topic.alert.reporting}") @Value("${mqtt.topic.alert.reporting}")
private String topic; private String topic;
@Value("${mqtt.topic.command.power.deployment}") @Value("${mqtt.topic.command.power.deployment}")
private String powertopic; private String powertopic;
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
@Autowired @Autowired
PowerTransferCompanyResourcesServiceImpl powerTransferCompanyResourcesService;
FireTeamServiceImpl fireTeamServiceImpl;
@Autowired @Autowired
AlertSubmittedMapper alertSubmittedMapper;
IFireTeamService fireTeamService;
@Autowired @Autowired
PowerTransferCompanyMapper powerTransferCompanyMapper;
PowerTransferCompanyResourcesServiceImpl powerTransferCompanyResourcesService;
@Autowired @Autowired
DynamicFormInstanceMapper dynamicFormInstanceMapper;
AlertSubmittedMapper alertSubmittedMapper;
@Autowired @Autowired
FireTeamServiceImpl fireTeamServiceImpl;
PowerTransferCompanyMapper powerTransferCompanyMapper;
@Autowired @Autowired
IFireTeamService fireTeamService;
DynamicFormInstanceMapper dynamicFormInstanceMapper;
@Override @Override
public SchedulingReportingDto listSchedulingByParam(AlertSubmittedDto queryParam) { public SchedulingReportingDto listSchedulingByParam(AlertSubmittedDto queryParam) {
SchedulingReportingDto schedulingReportingDto = new SchedulingReportingDto(); SchedulingReportingDto schedulingReportingDto = new SchedulingReportingDto();
List<AlertSubmittedExtDto> alertSubmittedExtDtoList = this.baseMapper.listSchedulingByParam(queryParam); List<AlertSubmittedExtDto> alertSubmittedExtDtoList = this.baseMapper.listSchedulingByParam(queryParam);
schedulingReportingDto.setSchedulingReportingList(alertSubmittedExtDtoList); schedulingReportingDto.setSchedulingReportingList(alertSubmittedExtDtoList);
Map<String, List<AlertSubmittedExtDto>> groupMap = alertSubmittedExtDtoList.stream()
Map<String, List<AlertSubmittedExtDto>> groupMap =
alertSubmittedExtDtoList.stream()
.collect(Collectors.groupingBy(AlertSubmittedExtDto::getSubmissionMethodCode)); .collect(Collectors.groupingBy(AlertSubmittedExtDto::getSubmissionMethodCode));
int phoneSize = 0; int phoneSize = 0;
int smsSize = 0; int smsSize = 0;
if (ObjectUtils.isNotEmpty(groupMap.get(SubmissionMethodEnum.PHONE.getCode()))) { if (ObjectUtils.isNotEmpty(groupMap.get(SubmissionMethodEnum.PHONE.getCode()))) {
phoneSize = groupMap.get(SubmissionMethodEnum.PHONE.getCode()).size(); phoneSize = groupMap.get(SubmissionMethodEnum.PHONE.getCode()).size();
} }
if (ObjectUtils.isNotEmpty(groupMap.get(SubmissionMethodEnum.SMS.getCode()))) { if (ObjectUtils.isNotEmpty(groupMap.get(SubmissionMethodEnum.SMS.getCode()))) {
smsSize = groupMap.get(SubmissionMethodEnum.SMS.getCode()).size(); smsSize = groupMap.get(SubmissionMethodEnum.SMS.getCode()).size();
} }
String extraInfo = String.format("已调度电话%s起,短信%d批", phoneSize, smsSize); String extraInfo = String.format("已调度电话%s起,短信%d批", phoneSize, smsSize);
schedulingReportingDto.setExtraInfo(extraInfo); schedulingReportingDto.setExtraInfo(extraInfo);
return schedulingReportingDto; return schedulingReportingDto;
} }
@Override @Override
public SchedulingReportingDto listReportingByParam(AlertSubmittedDto queryParam) { public SchedulingReportingDto listReportingByParam(AlertSubmittedDto queryParam) {
SchedulingReportingDto schedulingReportingDto = new SchedulingReportingDto(); SchedulingReportingDto schedulingReportingDto = new SchedulingReportingDto();
List<AlertSubmittedExtDto> alertSubmittedExtDtoList = this.baseMapper.listReportingByParam(queryParam); List<AlertSubmittedExtDto> alertSubmittedExtDtoList = this.baseMapper.listReportingByParam(queryParam);
if (ObjectUtils.isNotEmpty(alertSubmittedExtDtoList)) { if (ObjectUtils.isNotEmpty(alertSubmittedExtDtoList)) {
// 组装额外信息 // 组装额外信息
String _extraInfo = "报送给%s、%s"; String _extraInfo = "报送给%s、%s";
alertSubmittedExtDtoList.forEach(alertSubmittedExtDto -> { alertSubmittedExtDtoList.forEach(alertSubmittedExtDto -> {
try { try {
alertSubmittedExtDto.setExtraInfo(String.format(_extraInfo, alertSubmittedExtDto.getCompanyName(), alertSubmittedExtDto.setExtraInfo(String.format(_extraInfo, alertSubmittedExtDto.getCompanyName(),
alertSubmittedExtDto.getUserName())); alertSubmittedExtDto.getUserName()));
TemplateExtendDto template = templateService.getByType(alertSubmittedExtDto.getBusinessTypeCode()); TemplateExtendDto template = templateService.getByType(alertSubmittedExtDto.getBusinessTypeCode());
String richContent = template.getRichContent();
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService
.selectAlertCalledByIdNoRedisNew(queryParam.getAlertCalledId());
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
/**
*
* 构建警情报送规则对象
*
*/
AlertCalledRo alertCalledRo = new AlertCalledRo();
String replaceContent = RuleAlertCalledService.init(alertCalledRo, alertCalledVo);
Map<String, String> definitions = new HashMap<>();
definitions.put("$type", alertCalled.getAlertType());
definitions.put("$callTime", DateUtils.dateTimeToDateString(alertCalled.getCallTime()));
definitions.put("$replaceContent", replaceContent);
definitions.put("$address", alertCalled.getAddress());
String content = getTaskInformation(template.getRichContent(), definitions);
alertSubmittedExtDto.setSubmissionContentValue( alertSubmittedExtDto.setSubmissionContentValue(
JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent())); JSONObject.parseObject(alertSubmittedExtDto.getSubmissionContent()));
alertSubmittedExtDto.setSubmissionContent(richContent);
alertSubmittedExtDto.setSubmissionContent(content);
} catch (JSONException e) { } catch (JSONException e) {
alertSubmittedExtDto.setSubmissionContentValue(alertSubmittedExtDto.getSubmitContent()); alertSubmittedExtDto.setSubmissionContentValue(alertSubmittedExtDto.getSubmitContent());
} catch (ParseException e) {
e.printStackTrace();
} }
}); });
schedulingReportingDto.setSchedulingReportingList(alertSubmittedExtDtoList); schedulingReportingDto.setSchedulingReportingList(alertSubmittedExtDtoList);
String extraInfo = String.format("已报送%d条", alertSubmittedExtDtoList.size()); String extraInfo = String.format("已报送%d条", alertSubmittedExtDtoList.size());
schedulingReportingDto.setExtraInfo(extraInfo); schedulingReportingDto.setExtraInfo(extraInfo);
} }
return schedulingReportingDto; return schedulingReportingDto;
} }
@Override @Override
public Boolean save(AlertSubmittedDto alertSubmittedDto, String userName) throws Exception { public Boolean save(AlertSubmittedDto alertSubmittedDto, String userName) throws Exception {
try { try {
Map<String, String> map = saveAlertSubmitted(alertSubmittedDto, userName); Map<String, String> map = saveAlertSubmitted(alertSubmittedDto, userName);
// 组装规则入参 // 组装规则入参
AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId()); AlertCalled alertCalled = alertCalledService.getById(alertSubmittedDto.getAlertCalledId());
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService
.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr()); .selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
alertCalledVo.setAlertCalled(alertCalled); alertCalledVo.setAlertCalled(alertCalled);
// 调用规则 // 调用规则
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"), map.get("mobiles"));
ruleAlertCalledService.fireAlertCalledRule(alertCalledVo, map.get("alertWay"), map.get("mobiles"),
map.get("usIds"), map.get("feedBack"));
// 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 // 通知实战指挥页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true); emqKeeper.getMqttClient().publish(powertopic, "0".getBytes(), RuleConfig.DEFAULT_QOS, true);
} catch (MqttException e) { } catch (MqttException e) {
throw new RuntimeException(); throw new RuntimeException();
} }
return true; return true;
} }
/** /**
*
* 规则回调 * 规则回调
*
*/ */
public void ruleCallbackAction(String smsCode, List<Map<String, Object>> sendIds, Object object) throws Exception { public void ruleCallbackAction(String smsCode, List<Map<String, Object>> sendIds, Object object) throws Exception {
// 获取报送对象列表 // 获取报送对象列表
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null; String alertCalledId = null;
List<Map<String, Object>> orgUsers = new LinkedList<>(); List<Map<String, Object>> orgUsers = new LinkedList<>();
String sCode = ""; String sCode = "";
String alertWay = ""; String alertWay = "";
if (object instanceof AlertCalledRo) { if (object instanceof AlertCalledRo) {
AlertCalledRo calledRo = (AlertCalledRo) object; AlertCalledRo calledRo = (AlertCalledRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr(); alertCalledId = calledRo.getSequenceNbr();
String alertTypeCode = calledRo.getAlertTypeCode(); String alertTypeCode = calledRo.getAlertTypeCode();
alertWay = calledRo.getAlertWay(); alertWay = calledRo.getAlertWay();
String unitInvolved = calledRo.getUnitInvolved(); String unitInvolved = calledRo.getUnitInvolved();
// 警情续报 警情结案,非警情确认选择人员电话号码 // 警情续报 警情结案,非警情确认选择人员电话号码
String ids = calledRo.getIds(); String ids = calledRo.getIds();
if (!ValidationUtil.isEmpty(ids)) { if (!ValidationUtil.isEmpty(ids)) {
List<String> ls = Arrays.asList(ids.split(",")); List<String> ls = Arrays.asList(ids.split(","));
ls.stream().forEach(e -> mobiles.add(e)); ls.stream().forEach(e -> mobiles.add(e));
} }
// 获取报送规则 // 获取报送规则
sendIds.stream().forEach(e -> { sendIds.stream().forEach(e -> {
// 一般火灾 // 航空器救援 // 一般火灾 // 航空器救援
if (alertTypeCode.equals(AlertStageEnums.YBHZ.getCode()) if (alertTypeCode.equals(AlertStageEnums.YBHZ.getCode())
|| alertTypeCode.equals(AlertStageEnums.HKJY.getCode())) { || alertTypeCode.equals(AlertStageEnums.HKJY.getCode())) {
if (e.containsKey("onDuty")) { if (e.containsKey("onDuty")) {
// 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。 // 当日值班人员:获值班表中包括消救部、综合办公室、消防支队、应急指挥科的值班人员。
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyId();
String[] arr = e.get("onDuty").toString().split(",");
List<String> list = Arrays.asList(arr);
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyId(list);
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
} }
if (e.containsKey("fireBrigade")) { if (e.containsKey("fireBrigade")) {
// 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员 // 根据人员岗位:班组长、队长、通讯员; 消防队伍--消防人员 中,对应岗位的人员
List<FirefightersDto> fireBrigade = firefightersService List<FirefightersDto> fireBrigade = firefightersService
.queryById(e.get("fireBrigade").toString().split(",")); .queryById(e.get("fireBrigade").toString().split(","));
fireBrigade.stream().forEach(f -> { fireBrigade.stream().forEach(f -> {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("telephone", f.getMobilePhone()); map.put("telephone", f.getMobilePhone());
map.put("sequenceNbr", f.getSequenceNbr()); map.put("sequenceNbr", f.getSequenceNbr());
map.put("bizOrgName", f.getName()); map.put("bizOrgName", f.getName());
orgUsers.add(map); orgUsers.add(map);
}); });
} }
if (e.containsKey("airportUnit")) {
// 根据人员职务:干部&领导 机场单位 模块 消防急救保障部中,“人员职务”不为空的人员 if (e.containsKey("name")) {
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId("消防救援部");
// 消防救援保障部
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyIdNew(e.get("name").toString());
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
} }
// 安运部 // 安运部
if (e.get("type").toString().equals("AY")) { if (e.get("type").toString().equals("AY")) {
if (e.containsKey("airportPost")) {
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId("安运部"); if (e.containsKey("name")) {
String[] arr = e.get("airportPost").toString().split(",");
List<String> list = Arrays.asList(arr);
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(e.get("name").toString(),
list);
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
} }
} }
// 事发单位 // 事发单位
if (e.get("type").toString().equals("SF")) { if (e.get("type").toString().equals("SF")) {
if (e.containsKey("airportPost")) { if (e.containsKey("airportPost")) {
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(unitInvolved);
String[] arr = e.get("airportPost").toString().split(",");
List<String> list = Arrays.asList(arr);
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId(unitInvolved, list);
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
} }
} }
} }
// 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他 // 突发事件救援 // 漏油现场安全保障 // 专机保障 // 其他
if (alertTypeCode.equals(AlertStageEnums.HKJY.getCode()) if (alertTypeCode.equals(AlertStageEnums.HKJY.getCode())
|| alertTypeCode.equals(AlertStageEnums.LYXC.getCode()) || alertTypeCode.equals(AlertStageEnums.LYXC.getCode())
|| alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode()) || alertTypeCode.equals(AlertStageEnums.ZJBZ.getCode())
|| alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) { || alertTypeCode.equals(AlertStageEnums.QTJQ.getCode())) {
if (e.containsKey("onDuty")) { if (e.containsKey("onDuty")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew("消防支队");
List<Map<String, Object>> mapList = iDutyPersonService
.queryByCompanyNew(e.get("name").toString());
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
} }
} }
// 120急救 // 120急救
if (alertTypeCode.equals(AlertStageEnums.JJJQ.getCode())) { if (alertTypeCode.equals(AlertStageEnums.JJJQ.getCode())) {
if (e.containsKey("onDuty")) {
List<Map<String, Object>> mapList = iDutyPersonService.queryByCompanyNew("急救科"); if (e.containsKey("name")) {
orgUsers.addAll(mapList);
} List<Map<String, Object>> mapList = iDutyPersonService
if (e.containsKey("airportUnit")) { .queryByCompanyNew(e.get("name").toString());
List<Map<String, Object>> mapList = iOrgUsrService.queryCompanyId("急救科");
orgUsers.addAll(mapList); orgUsers.addAll(mapList);
List<Map<String, Object>> mapList1 = iOrgUsrService.queryCompanyIdNew(e.get("name").toString());
orgUsers.addAll(mapList1);
} }
} }
}); });
// 警情初报 续报 结案 // 警情初报 续报 结案
// 1.保存警情记录主表 // 1.保存警情记录主表
AlertSubmitted alertSubmitted = new AlertSubmitted(); AlertSubmitted alertSubmitted = new AlertSubmitted();
alertSubmitted.setAlertCalledId(Long.valueOf(calledRo.getSequenceNbr())); alertSubmitted.setAlertCalledId(Long.valueOf(calledRo.getSequenceNbr()));
// 保存初报细分类型(一般火灾、航空器救援等) // 保存初报细分类型(一般火灾、航空器救援等)
alertSubmitted.setBusinessTypeCode(calledRo.getAlertTypeCode()); alertSubmitted.setBusinessTypeCode(calledRo.getAlertTypeCode());
// 警情初报 --- 续报 结案 // 警情初报 --- 续报 结案
if (alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) { if (alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情初报.getName()); alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情初报.getName());
} else if (alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情续报.getName());
sCode = "SMS_JCS_XB";
} else if (alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情结案.getName());
sCode = "SMS_JCS_JA";
} else {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.非警情确认.getName());
sCode = "SMS_JCS_QR";
}
Optional<SubmissionMethodEnum> submissionMethodEnum = Optional.of(SubmissionMethodEnum.SMS); Optional<SubmissionMethodEnum> submissionMethodEnum = Optional.of(SubmissionMethodEnum.SMS);
alertSubmitted.setSubmissionMethodCode(submissionMethodEnum.get().getCode()); alertSubmitted.setSubmissionMethodCode(submissionMethodEnum.get().getCode());
alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName()); alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName());
Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum = Optional.of(AlertSchedulingTypeEnum.融合调度); Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum = Optional.of(AlertSchedulingTypeEnum.融合调度);
alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode()); alertSubmitted.setSchedulingTypeCode(alertSchedulingTypeEnum.get().getCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName()); alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName());
alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo))); alertSubmitted.setSubmissionContent(JSONObject.toJSONString(objectToMap(calledRo)));
// String token = RequestContext.getToken();
// ReginParams reginParams = JSONObject.parseObject(.get(RedisredisUtilsKey.buildReginKey(RequestContext.getExeUserId(),token)).toString(),
// ReginParams.class);
// alertSubmitted.setRecUserName(reginParams.getUserModel().getUserName());
// alertSubmitted.setSender(reginParams.getUserModel().getUserName());
alertSubmitted.setUpdateTime(new Date()); alertSubmitted.setUpdateTime(new Date());
alertSubmitted.setSubmissionTime(new Date()); alertSubmitted.setSubmissionTime(new Date());
this.baseMapper.insert(alertSubmitted); this.baseMapper.insert(alertSubmitted);
alertSubmittedId = alertSubmitted.getSequenceNbr().toString(); alertSubmittedId = alertSubmitted.getSequenceNbr().toString();
Optional<AlertBusinessTypeEnum> alertBusinessTypeEnum = EnumsUtils
.getEnumObject(AlertBusinessTypeEnum.class, e -> e.getCode().equals(calledRo.getAlertTypeCode())); } else if (alertWay.equals(AlertBusinessTypeEnum.警情续报.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情续报.getName());
sCode = "SMS_JCS_XB";
} else if (alertWay.equals(AlertBusinessTypeEnum.警情结案.getCode())) {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.警情结案.getName());
sCode = "SMS_JCS_JA";
} else {
alertSubmitted.setBusinessType(AlertBusinessTypeEnum.非警情确认.getName());
sCode = "SMS_JCS_QR";
}
AlertSubmitted alertSubmittedNew = null;
Optional<AlertBusinessTypeEnum> alertBusinessTypeEnum =
EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
e -> e.getCode().equals(calledRo.getAlertTypeCode()));
smsCode = alertBusinessTypeEnum.get().getSms_code(); smsCode = alertBusinessTypeEnum.get().getSms_code();
if (!alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
LambdaQueryWrapper<AlertSubmitted> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertSubmitted::getAlertCalledId, alertCalledId);
queryWrapper.orderByDesc(AlertSubmitted::getSequenceNbr);
List<AlertSubmitted> alertSubmitteds = alertSubmittedMapper.selectList(queryWrapper);
alertSubmittedNew = alertSubmitteds.get(0);
}
// 组装人员信息 // 组装人员信息
for (Map<String, Object> orgUser : orgUsers) { for (Map<String, Object> orgUser : orgUsers) {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
if (!alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertSubmittedObject.setAlertSubmittedId(alertSubmittedNew.getSequenceNbr());
} else {
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
}
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
// alertSubmittedObject.setCompanyId(Long.valueOf((String) orgUser.get("parentId")));
// alertSubmittedObject.setCompanyName((String) orgUser.get("parenName"));
alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr")))); alertSubmittedObject.setUserId(Long.valueOf(String.valueOf(orgUser.get("sequenceNbr"))));
alertSubmittedObject.setUserName((String) orgUser.get("bizOrgName")); alertSubmittedObject.setUserName((String) orgUser.get("bizOrgName"));
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) { if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone")); mobiles.add((String) orgUser.get("telephone"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone")); alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
// 组装报送内容 // 组装报送内容
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put("address", calledRo.getAddress());
smsParams.put("fireLocation", calledRo.getFireLocation()); smsParams.put("fireLocation", calledRo.getFireLocation());
smsParams.put("burningMaterial", calledRo.getBurningMaterial()); smsParams.put("burningMaterial", calledRo.getBurningMaterial());
smsParams.put("fireSituation", calledRo.getFireSituation()); smsParams.put("fireSituation", calledRo.getFireSituation());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put("trappedNum", calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives()); smsParams.put("dangerousExplosives", calledRo.getDangerousExplosives());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put("companyName", calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put("contactUser", calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("replaceContent", calledRo.getReplaceContent()); smsParams.put("replaceContent", calledRo.getReplaceContent());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
smsParams.put("feedback", calledRo.getFeedback()); smsParams.put("feedback", calledRo.getFeedback());
} }
// 短信报送对象 // 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
if (alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) { if (alertWay.equals(AlertBusinessTypeEnum.警情初报.getCode())) {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
} else { } else {
alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(sCode, mobiles, smsParams);
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
/** /**
*
* 短信报送 * 短信报送
* *
*
*
* @param alertSubmittedDto 警情信息 * @param alertSubmittedDto 警情信息
*
* @param userName 用户名 * @param userName 用户名
*
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map<String, String> saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) { public Map<String, String> saveAlertSubmitted(AlertSubmittedDto alertSubmittedDto, String userName) {
Long alertSubmittedId = alertSubmittedDto.getSequenceNbr(); Long alertSubmittedId = alertSubmittedDto.getSequenceNbr();
String alertWay = ""; String alertWay = "";
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
List<Long> userIds = new ArrayList<>();
if (alertSubmittedId == null) { if (alertSubmittedId == null) {
// 1.保存警情记录主表 // 1.保存警情记录主表
AlertSubmitted alertSubmitted = new AlertSubmitted(); AlertSubmitted alertSubmitted = new AlertSubmitted();
String bussTypeCode; String bussTypeCode;
alertSubmitted.setAlertCalledId(alertSubmittedDto.getAlertCalledId()); alertSubmitted.setAlertCalledId(alertSubmittedDto.getAlertCalledId());
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日 // 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
if ("316".equals(alertSubmittedDto.getBusinessTypeCode())) {
alertSubmitted.setBusinessTypeCode(AlertBusinessTypeEnum.警情续报.getCode());
bussTypeCode = AlertBusinessTypeEnum.警情续报.getCode();
} else {
alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode()); alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode());
bussTypeCode = alertSubmittedDto.getBusinessTypeCode(); bussTypeCode = alertSubmittedDto.getBusinessTypeCode();
}
Optional<AlertBusinessTypeEnum> businessTypeEnum = EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class, Optional<AlertBusinessTypeEnum> businessTypeEnum = EnumsUtils.getEnumObject(AlertBusinessTypeEnum.class,
e -> e.getCode().equals(bussTypeCode)); e -> e.getCode().equals(bussTypeCode));
alertSubmitted.setBusinessType(businessTypeEnum.get().getName()); alertSubmitted.setBusinessType(businessTypeEnum.get().getName());
alertSubmitted.setCallLogId(alertSubmittedDto.getCallLogId()); alertSubmitted.setCallLogId(alertSubmittedDto.getCallLogId());
alertSubmitted.setSubmissionMethodCode(alertSubmittedDto.getSubmissionMethodCode()); alertSubmitted.setSubmissionMethodCode(alertSubmittedDto.getSubmissionMethodCode());
Optional<SubmissionMethodEnum> submissionMethodEnum = EnumsUtils.getEnumObject(SubmissionMethodEnum.class, Optional<SubmissionMethodEnum> submissionMethodEnum = EnumsUtils.getEnumObject(SubmissionMethodEnum.class,
e -> e.getCode().equals(alertSubmittedDto.getSubmissionMethodCode())); e -> e.getCode().equals(alertSubmittedDto.getSubmissionMethodCode()));
alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName()); alertSubmitted.setSubmissionMethod(submissionMethodEnum.get().getName());
Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum = EnumsUtils.getEnumObject(
AlertSchedulingTypeEnum.class, e -> e.getCode().equals(alertSubmittedDto.getSchedulingTypeCode())); Optional<AlertSchedulingTypeEnum> alertSchedulingTypeEnum =
EnumsUtils.getEnumObject(AlertSchedulingTypeEnum.class,
e -> e.getCode().equals(alertSubmittedDto.getSchedulingTypeCode()));
alertSubmitted.setSchedulingTypeCode(alertSubmittedDto.getSchedulingTypeCode()); alertSubmitted.setSchedulingTypeCode(alertSubmittedDto.getSchedulingTypeCode());
alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName()); alertSubmitted.setSchedulingType(alertSchedulingTypeEnum.get().getName());
// 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日 // 任务 4174 日常值班---融合调度----短信模版中的内容用户可以全部删除掉,按照自定义内容重新录入发送内容 by litw 2021年10月27日
if ("316".equals(alertSubmittedDto.getBusinessTypeCode())) {
JSONObject jsonObject = JSON.parseObject(alertSubmittedDto.getSubmitContent().toJSONString());
alertSubmitted.setSubmissionContent(jsonObject.get("custom").toString());
} else {
alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode()); alertSubmitted.setBusinessTypeCode(alertSubmittedDto.getBusinessTypeCode());
alertSubmitted.setSubmissionContent(alertSubmittedDto.getSubmitContent().toJSONString()); alertSubmitted.setSubmissionContent(alertSubmittedDto.getSubmitContent().toJSONString());
}
alertSubmitted.setSender(userName); alertSubmitted.setSender(userName);
alertSubmitted.setRecUserName(userName); alertSubmitted.setRecUserName(userName);
alertSubmitted.setUpdateTime(new Date()); alertSubmitted.setUpdateTime(new Date());
alertSubmitted.setSubmissionTime(new Date()); alertSubmitted.setSubmissionTime(new Date());
this.baseMapper.insert(alertSubmitted); this.baseMapper.insert(alertSubmitted);
alertSubmittedId = alertSubmitted.getSequenceNbr(); alertSubmittedId = alertSubmitted.getSequenceNbr();
} }
// 2.保存任务表 // 2.保存任务表
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Long finalAlertSubmittedId = alertSubmittedId; Long finalAlertSubmittedId = alertSubmittedId;
// 报送给单位 // 报送给单位
if (AlertSubmitTypeEnum.Org.getKey().equals(alertSubmittedDto.getType())) { if (AlertSubmitTypeEnum.Org.getKey().equals(alertSubmittedDto.getType())) {
alertSubmittedDto.getSubmitCompanyList().forEach(company -> { alertSubmittedDto.getSubmitCompanyList().forEach(company -> {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(finalAlertSubmittedId); alertSubmittedObject.setAlertSubmittedId(finalAlertSubmittedId);
alertSubmittedObject.setType(true); alertSubmittedObject.setType(true);
alertSubmittedObject.setCompanyId(company.getCompanyId()); alertSubmittedObject.setCompanyId(company.getCompanyId());
alertSubmittedObject.setCompanyName(company.getCompanyName()); alertSubmittedObject.setCompanyName(company.getCompanyName());
alertSubmittedObject.setRecUserName(userName); alertSubmittedObject.setRecUserName(userName);
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
}); });
} else { } else {
// 报送给个人 // 报送给个人
alertSubmittedDto.getSubmitCompanyList().forEach(company -> { alertSubmittedDto.getSubmitCompanyList().forEach(company -> {
company.getPersonList().forEach(person -> { company.getPersonList().forEach(person -> {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(finalAlertSubmittedId); alertSubmittedObject.setAlertSubmittedId(finalAlertSubmittedId);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(company.getCompanyId()); alertSubmittedObject.setCompanyId(company.getCompanyId());
alertSubmittedObject.setCompanyName(company.getCompanyName()); alertSubmittedObject.setCompanyName(company.getCompanyName());
alertSubmittedObject.setUserId(person.getPersonId()); alertSubmittedObject.setUserId(person.getPersonId());
userIds.add(person.getPersonId());
alertSubmittedObject.setUserName(person.getPersonName()); alertSubmittedObject.setUserName(person.getPersonName());
alertSubmittedObject.setUserPhone(person.getPersonPhone()); alertSubmittedObject.setUserPhone(person.getPersonPhone());
alertSubmittedObject.setRecUserName(userName); alertSubmittedObject.setRecUserName(userName);
if (!ValidationUtil.isEmpty(person.getPersonPhone())) { if (!ValidationUtil.isEmpty(person.getPersonPhone())) {
mobiles.add(person.getPersonPhone()); mobiles.add(person.getPersonPhone());
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
});
}); });
}
// 查询AmousUserId
LambdaQueryWrapper<OrgUsr> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(true, OrgUsr::getSequenceNbr, userIds);
List<String> usIds = new ArrayList<>();
List<OrgUsr> list = orgUsrService.getBaseMapper().selectList(queryWrapper);
if (null != list && list.size() > 0) {
list.stream().forEach(e -> {
if (!ValidationUtil.isEmpty(e.getAmosOrgId())) {
usIds.add(e.getAmosOrgId());
}
}); });
map.put("usIds", StringUtils.join(usIds.toArray(new String[userIds.size()]), ","));
} else {
map.put("usIds", "");
} }
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 3.更新警情状态 // 3.更新警情状态
alertCalledService.updateAlertCalled(alertSubmittedDto.getAlertCalledId(), alertCalledService.updateAlertCalled(alertSubmittedDto.getAlertCalledId(),
alertSubmittedDto.getBusinessTypeCode()); alertSubmittedDto.getBusinessTypeCode());
// 警情续报 // 警情续报
if (AlertBusinessTypeEnum.警情续报.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) { if (AlertBusinessTypeEnum.警情续报.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
alertWay = AlertBusinessTypeEnum.警情续报.getCode(); alertWay = AlertBusinessTypeEnum.警情续报.getCode();
} }
if (AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) { if (AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
alertWay = AlertBusinessTypeEnum.警情结案.getCode(); alertWay = AlertBusinessTypeEnum.警情结案.getCode();
} }
if (AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) { if (AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
alertWay = AlertBusinessTypeEnum.非警情确认.getCode(); alertWay = AlertBusinessTypeEnum.非警情确认.getCode();
} }
if (AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode()) if (AlertBusinessTypeEnum.警情结案.getCode().equals(alertSubmittedDto.getBusinessTypeCode())
|| AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) { || AlertBusinessTypeEnum.非警情确认.getCode().equals(alertSubmittedDto.getBusinessTypeCode())) {
// 查询本次警情调派的车辆 // 查询本次警情调派的车辆
List<String> transferCarIdList = powerTransferService
.queryTransferCarIdsByAlertCalledId(alertSubmittedDto.getAlertCalledId()); List<String> transferCarIdList =
powerTransferService.queryTransferCarIdsByAlertCalledId(alertSubmittedDto.getAlertCalledId());
List<Object> carStatusInfoDtoList = Lists.newArrayList(); List<Object> carStatusInfoDtoList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(transferCarIdList)) { if (!ValidationUtil.isEmpty(transferCarIdList)) {
transferCarIdList.forEach(carId -> { transferCarIdList.forEach(carId -> {
CarStatusInfoDto carStatusInfo = new CarStatusInfoDto(); CarStatusInfoDto carStatusInfo = new CarStatusInfoDto();
carStatusInfo.setSequenceNbr(carId); carStatusInfo.setSequenceNbr(carId);
carStatusInfo.setStatus(FireCarStatusEnum.执勤.getCode()); carStatusInfo.setStatus(FireCarStatusEnum.执勤.getCode());
carStatusInfoDtoList.add(carStatusInfo); carStatusInfoDtoList.add(carStatusInfo);
}); });
} }
// 修改调派车辆任务 // 修改调派车辆任务
powerTransferCompanyResourcesService.updateByAlertCalledId(alertSubmittedDto.getAlertCalledId()); powerTransferCompanyResourcesService.updateByAlertCalledId(alertSubmittedDto.getAlertCalledId());
// 更新所有车辆状态为执勤 // 更新所有车辆状态为执勤
equipFeignClient.updateCarStatus(carStatusInfoDtoList); equipFeignClient.updateCarStatus(carStatusInfoDtoList);
// //跟车辆状态 // //跟车辆状态
// powerTransferCompanyResourcesService.update(new UpdateWrapper<PowerTransferCompanyResources>().eq("resources_id", transferCarIdList).set("status", FireCarStatusEnum.返队.getCode())); // powerTransferCompanyResourcesService.update(new UpdateWrapper<PowerTransferCompanyResources>().eq("resources_id", transferCarIdList).set("status", FireCarStatusEnum.返队.getCode()));
} }
// 4.发送任务消息 // 4.发送任务消息
// 4.1组织短信内容
// HashMap<String, String> smsParams = new HashMap<>(); // 4.1组织短信内容 废弃
// JSONObject submitContent = alertSubmittedDto.getSubmitContent();
// if(!"316".equals(alertSubmittedDto.getBusinessTypeCode())) { JSONObject submitContent = alertSubmittedDto.getSubmitContent();
// smsParams.put("alertType", submitContent.get("alertType").toString());
// smsParams.put("trappedNum", submitContent.get("trappedNum").toString()); String feedBack = submitContent.get("editContent") != null ? submitContent.get("editContent").toString() : "";
// smsParams.put("companyName", submitContent.get("companyName").toString());
// } // 4.2调用短信发送接口 废弃
// 4.2调用短信发送接口 // alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);\
// alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
map.put("feedBack", feedBack);
map.put("alertWay", alertWay); map.put("alertWay", alertWay);
map.put("mobiles", StringUtils.join(mobiles, ",")); map.put("mobiles", StringUtils.join(mobiles, ","));
return map; return map;
} }
/** /**
*
* 短信报送对象 * 短信报送对象
* *
*
*
* @param alertSubmittedObjectList 报送对象列表 * @param alertSubmittedObjectList 报送对象列表
*
* @param smsCode 短信模板code * @param smsCode 短信模板code
*
* @param mobiles 电话号码列表 * @param mobiles 电话号码列表
*
* @param smsParams 报送内容 * @param smsParams 报送内容
*
*/ */
public void saveAlertSubmittedObject(List<AlertSubmittedObject> alertSubmittedObjectList, String smsCode, public void saveAlertSubmittedObject(List<AlertSubmittedObject> alertSubmittedObjectList, String smsCode,
Set<String> mobiles, HashMap<String, String> smsParams) { Set<String> mobiles, HashMap<String, String> smsParams) {
// alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); // alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
} }
public void getAlertSubmittedContent(Long alertCalledId, ArrayList<TemplateDto> templateDtos, String companyName) public void getAlertSubmittedContent(Long alertCalledId, ArrayList<TemplateDto> templateDtos, String companyName)
throws IllegalAccessException { throws IllegalAccessException, ParseException {
AlertCalled alertCalled = alertCalledService.getById(alertCalledId); AlertCalled alertCalled = alertCalledService.getById(alertCalledId);
Map<String, Object> map = objectToMap(alertCalled); Map<String, Object> map = objectToMap(alertCalled);
map.put("companyName", companyName); map.put("companyName", companyName);
map.put("editContent", "可自编辑续报内容");
AlertCalledObjsDto alertCalledVo = (AlertCalledObjsDto) alertCalledService
.selectAlertCalledByIdNoRedisNew(alertCalled.getSequenceNbr());
/**
*
* 构建警情报送规则对象
*
*/
AlertCalledRo alertCalledRo = new AlertCalledRo();
String replaceContent = RuleAlertCalledService.init(alertCalledRo, alertCalledVo);
// 获取模板内容 // 获取模板内容
List<DataDictionary> dataDictionaries = dataDictionaryService
.list(new QueryWrapper<DataDictionary>().eq("type", "JQBSLX")); List<DataDictionary> dataDictionaries =
dataDictionaryService.list(new QueryWrapper<DataDictionary>().eq("type",
"JQBSLX"));
for (DataDictionary dataDictionary : dataDictionaries) { for (DataDictionary dataDictionary : dataDictionaries) {
Template template = templateService
.getOne(new QueryWrapper<Template>().eq("type_code", dataDictionary.getCode()).eq("format", true)); Template template = templateService.getOne(new QueryWrapper<Template>().eq("type_code",
List<PowerTransferCompanyDto> lastPowerTransferCompany;
if ("警情续报".equals(template.getType()) dataDictionary.getCode()).eq("format", true));
&& (lastPowerTransferCompany = powerTransferService.getLastPowerTransferCompany(alertCalledId))
.size() > 0) { Map<String, String> definitions = new HashMap<>();
map.put("businessType", template.getType());
// 获取力量调派内容 definitions.put("$type", alertCalled.getAlertType());
StringBuilder companyNames = new StringBuilder();
StringBuilder resourcesInfo = new StringBuilder(); definitions.put("$callTime", DateUtils.dateTimeToDateString(alertCalled.getCallTime()));
for (PowerTransferCompanyDto powerTransferCompanyDto : lastPowerTransferCompany) {
companyNames.append(powerTransferCompanyDto.getCompanyName()).append("、"); definitions.put("$replaceContent", replaceContent);
resourcesInfo.append(powerTransferCompanyDto.getType())
.append(powerTransferCompanyDto.getResourcesCount()).append("辆、"); definitions.put("$address", alertCalled.getAddress());
}
map.put("companyNames", companyNames.deleteCharAt(companyNames.length() - 1).toString()); String content = getTaskInformation(template.getContent(), definitions);
map.put("resourcesInfo", resourcesInfo.deleteCharAt(resourcesInfo.length() - 1).toString());
map.put("transferTime", lastPowerTransferCompany.get(0).getRecDate()); template.setContent(content);
}
TemplateDto templateDto = new TemplateDto(); TemplateDto templateDto = new TemplateDto();
BeanUtils.copyProperties(template, templateDto); BeanUtils.copyProperties(template, templateDto);
templateDto.setData(map); templateDto.setData(map);
templateDtos.add(templateDto); templateDtos.add(templateDto);
}
} }
private String getTaskInformation(String content, Map<String, String> definitions) {
int size = definitions.size();
String[] keys = definitions.keySet().toArray(new String[size]);
String[] values = definitions.values().toArray(new String[size]);
return StringUtils.replaceEach(content, keys, values);
} }
@Override @Override
public AlertSubmittedSMSDto getSchedulingContent(Long id) { public AlertSubmittedSMSDto getSchedulingContent(Long id) {
return this.baseMapper.getSchedulingContent(id); return this.baseMapper.getSchedulingContent(id);
} }
@Override @Override
public List<InstructionsZHDto> getInstructionsZHDtoList(Long id) { public List<InstructionsZHDto> getInstructionsZHDtoList(Long id) {
List<InstructionsZHDto> listInstructionsZHDto = new ArrayList<>(); List<InstructionsZHDto> listInstructionsZHDto = new ArrayList<>();
// 获取调派记录 // 获取调派记录
List<PowerTransferCompanyZHDto> listPowerTransferCompanyZHDto = powerTransferCompanyMapper List<PowerTransferCompanyZHDto> listPowerTransferCompanyZHDto = powerTransferCompanyMapper
.listPowerTransferCompanyZHDto(id); .listPowerTransferCompanyZHDto(id);
listPowerTransferCompanyZHDto.stream().forEach(PowerTransferCompanyZHDto -> { listPowerTransferCompanyZHDto.stream().forEach(PowerTransferCompanyZHDto -> {
String content = ""; String content = "";
if (PowerTransferCompanyZHDto.getIsDistributionAgencies()) { if (PowerTransferCompanyZHDto.getIsDistributionAgencies()) {
content = "调派" + PowerTransferCompanyZHDto.getCompanyName() + "前往" content = "调派" + PowerTransferCompanyZHDto.getCompanyName() + "前往"
+ PowerTransferCompanyZHDto.getAddress(); + PowerTransferCompanyZHDto.getAddress();
} else { } else {
content = "调派" + PowerTransferCompanyZHDto.getCompanyName() content = "调派" + PowerTransferCompanyZHDto.getCompanyName()
+ PowerTransferCompanyZHDto.getSubmissionContent() + "前往" + PowerTransferCompanyZHDto.getSubmissionContent() + "前往"
+ PowerTransferCompanyZHDto.getAddress(); + PowerTransferCompanyZHDto.getAddress();
} }
InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(), InstructionsZHDto instruct = new InstructionsZHDto(PowerTransferCompanyZHDto.getSequenceNbr(),
PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content, null); PowerTransferCompanyZHDto.getDispatchType(), PowerTransferCompanyZHDto.getRecDate(), content, null);
listInstructionsZHDto.add(instruct); listInstructionsZHDto.add(instruct);
}); });
// 获取融合调度信息 // 获取融合调度信息
List<AlertSubmittedZHDto> listAlertSubmittedZHDto = alertSubmittedMapper.listAlertSubmittedZHDto(id); List<AlertSubmittedZHDto> listAlertSubmittedZHDto = alertSubmittedMapper.listAlertSubmittedZHDto(id);
listAlertSubmittedZHDto.stream().forEach(AlertSubmittedZHDto -> { listAlertSubmittedZHDto.stream().forEach(AlertSubmittedZHDto -> {
JSONObject js = JSONObject.parseObject(AlertSubmittedZHDto.getSubmissionContent()); JSONObject js = JSONObject.parseObject(AlertSubmittedZHDto.getSubmissionContent());
String content = ""; String content = "";
switch (AlertSubmittedZHDto.getBusinessType()) { switch (AlertSubmittedZHDto.getBusinessType()) {
case "警情初报": case "警情初报":
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + ","
+ js.getString("address") + "发生" + js.getString("alertType"); + js.getString("address") + "发生" + js.getString("alertType");
break; break;
case "警情续报": case "警情续报":
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + ","
+ "现场被困人数:" + js.getString("trappedNum") + "人伤亡人数:" + js.getString("casualtiesNum") + "人。"; + "现场被困人数:" + js.getString("trappedNum") + "人伤亡人数:" + js.getString("casualtiesNum") + "人。";
break; break;
case "非警情确认": case "非警情确认":
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + ","
+ "此警情现场确认为假警情。"; + "此警情现场确认为假警情。";
break; break;
case "警情结案": case "警情结案":
content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + "," content = "通知" + AlertSubmittedZHDto.getCompanyName() + ":" + AlertSubmittedZHDto.getUserName() + ","
+ "此警情已完场警情处置,警情已结案。"; + "此警情已完场警情处置,警情已结案。";
break; break;
default: default:
break; break;
} }
InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(), InstructionsZHDto instruct = new InstructionsZHDto(AlertSubmittedZHDto.getSequenceNbr(),
AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content, null); AlertSubmittedZHDto.getBusinessType(), AlertSubmittedZHDto.getSubmissionTime(), content, null);
listInstructionsZHDto.add(instruct); listInstructionsZHDto.add(instruct);
}); });
// 获取归并得警情信息 // 获取归并得警情信息
LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<AlertCalled> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(AlertCalled::getFatherAlert, id); queryWrapper.eq(AlertCalled::getFatherAlert, id);
List<AlertCalled> alertCalleds = alertCalledService.getBaseMapper().selectList(queryWrapper); List<AlertCalled> alertCalleds = alertCalledService.getBaseMapper().selectList(queryWrapper);
alertCalleds.stream().forEach(e -> { alertCalleds.stream().forEach(e -> {
AlertSubmittedZHDto alertSubmittedZHDto = new AlertSubmittedZHDto(); AlertSubmittedZHDto alertSubmittedZHDto = new AlertSubmittedZHDto();
AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto) alertCalledService AlertCalledFormDto alertCalledFormDto = (AlertCalledFormDto) alertCalledService
.selectAlertCalledByIdNoRedis(e.getSequenceNbr()); .selectAlertCalledByIdNoRedis(e.getSequenceNbr());
alertSubmittedZHDto.setAlertCalledFormDto(alertCalledFormDto); alertSubmittedZHDto.setAlertCalledFormDto(alertCalledFormDto);
alertSubmittedZHDto.setSequenceNbr(e.getSequenceNbr()); alertSubmittedZHDto.setSequenceNbr(e.getSequenceNbr());
alertSubmittedZHDto.setBusinessType("警情归并"); alertSubmittedZHDto.setBusinessType("警情归并");
alertSubmittedZHDto.setSubmissionTime(alertCalledFormDto.getAlertCalled().getCallTime()); alertSubmittedZHDto.setSubmissionTime(alertCalledFormDto.getAlertCalled().getCallTime());
alertSubmittedZHDto.setCompanyName(alertCalledFormDto.getAlertCalled().getCompanyName()); alertSubmittedZHDto.setCompanyName(alertCalledFormDto.getAlertCalled().getCompanyName());
alertSubmittedZHDto.setUserName(alertCalledFormDto.getAlertCalled().getRecUserName()); alertSubmittedZHDto.setUserName(alertCalledFormDto.getAlertCalled().getRecUserName());
InstructionsZHDto instruct = new InstructionsZHDto(alertSubmittedZHDto.getSequenceNbr(), InstructionsZHDto instruct = new InstructionsZHDto(alertSubmittedZHDto.getSequenceNbr(),
alertSubmittedZHDto.getBusinessType(), alertSubmittedZHDto.getSubmissionTime(), null, alertSubmittedZHDto.getBusinessType(), alertSubmittedZHDto.getSubmissionTime(), null,
alertSubmittedZHDto.getAlertCalledFormDto()); alertSubmittedZHDto.getAlertCalledFormDto());
listInstructionsZHDto.add(instruct); listInstructionsZHDto.add(instruct);
}); });
// 排序时间倒序 // 排序时间倒序
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始 */ /* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 开始 */
Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() { Collections.sort(listInstructionsZHDto, new Comparator<InstructionsZHDto>() {
@Override @Override
public int compare(InstructionsZHDto o1, InstructionsZHDto o2) { public int compare(InstructionsZHDto o1, InstructionsZHDto o2) {
long i = o2.getSubmissionTime().getTime() - o1.getSubmissionTime().getTime(); long i = o2.getSubmissionTime().getTime() - o1.getSubmissionTime().getTime();
if (i == 0) { if (i == 0) {
return (int) (o2.getSubmissionTime().getTime() - o1.getSubmissionTime().getTime()); return (int) (o2.getSubmissionTime().getTime() - o1.getSubmissionTime().getTime());
} }
return (int) i; return (int) i;
} }
}); });
/* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 结束 */ /* Bug 2613 修改排序 按照发送时间排序 2021-09-01 陈召 结束 */
return listInstructionsZHDto; return listInstructionsZHDto;
} }
/** /**
*
* 将Object对象里面的属性和值转化成Map对象 * 将Object对象里面的属性和值转化成Map对象
* *
*
*
* @param obj 源对象 * @param obj 源对象
*
* @return 转化结果 * @return 转化结果
*
* @throws IllegalAccessException IllegalAccessException * @throws IllegalAccessException IllegalAccessException
*
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static Map<String, Object> objectToMap(Object obj) throws IllegalAccessException { public static Map<String, Object> objectToMap(Object obj) throws IllegalAccessException {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Class<?> clazz = obj.getClass(); Class<?> clazz = obj.getClass();
Field[] fields = clazz.getDeclaredFields(); Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {
field.setAccessible(true); field.setAccessible(true);
String fieldName = field.getName(); String fieldName = field.getName();
if ("dynamicFormAlert".equalsIgnoreCase(fieldName)) { if ("dynamicFormAlert".equalsIgnoreCase(fieldName)) {
List<FormValue> dynamicFormAlert = (List<FormValue>) field.get(obj); List<FormValue> dynamicFormAlert = (List<FormValue>) field.get(obj);
for (FormValue formValue : dynamicFormAlert) { for (FormValue formValue : dynamicFormAlert) {
map.put(formValue.getLabel(), formValue.getValue()); map.put(formValue.getLabel(), formValue.getValue());
} }
} else { } else {
Object value = field.get(obj); Object value = field.get(obj);
map.put(fieldName, value); map.put(fieldName, value);
} }
} }
return map; return map;
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void ruleCallbackActionForPowerTransferForCar(String smsCode, List sendIds, Object object) public void ruleCallbackActionForPowerTransferForCar(String smsCode, List sendIds, Object object)
throws IllegalAccessException, MqttPersistenceException, MqttException { throws IllegalAccessException, MqttPersistenceException, MqttException {
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null; String alertCalledId = null;
Set<Map<String, Object>> userIdList = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> userIdList = new HashSet<Map<String, Object>>();
// 判断当前的规则中是否指定了给当前的车辆驾驶员 // 判断当前的规则中是否指定了给当前的车辆驾驶员
boolean designatedDriver = false; boolean designatedDriver = false;
for (Object id : sendIds) { for (Object id : sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(id)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(id));
if (jsonObject.containsKey("type") && jsonObject.getString("type").equals(AlertStageEnums.BD.getCode())) { if (jsonObject.containsKey("type") && jsonObject.getString("type").equals(AlertStageEnums.BD.getCode())) {
designatedDriver = true; designatedDriver = true;
} }
} }
List<Map<String, Object>> orgUsers = new LinkedList<>(); List<Map<String, Object>> orgUsers = new LinkedList<>();
String sCode = ""; String sCode = "";
if (object instanceof AlertCallePowerTransferRo) { if (object instanceof AlertCallePowerTransferRo) {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object; AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr(); alertCalledId = calledRo.getSequenceNbr();
//先获取消救部领导、消救部值班人员信息
// 先获取消救部领导、消救部值班人员信息
sendIds.stream().forEach(e -> { sendIds.stream().forEach(e -> {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e));
// 消救部 // 消救部
if (jsonObject.containsKey("airportUnit")) { if (jsonObject.containsKey("airportUnit")) {
String departmentName= jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) { { String departmentName = jsonObject.getString("name");
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null);
if (jsonObject.containsKey("airportUnit")) {
{
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getFireRescueDepartmentStaff(departmentName, null);
userIdList.addAll(mapList); userIdList.addAll(mapList);
} }
if(jsonObject.containsKey("onDuty")) { if (jsonObject.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(), departmentName);
userIdList.addAll(mapList); userIdList.addAll(mapList);
} }
} }
} }
}); });
List<Object> companyDetail =JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class);
List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),
Object.class);
for (Object powerTransferCompanyDto : companyDetail) { for (Object powerTransferCompanyDto : companyDetail) {
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerTransferCompanyDto powerDto = JSONObject
.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId(); Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName(); String companyName = powerDto.getCompanyName();
StringBuffer resourcesNum = new StringBuffer(); StringBuffer resourcesNum = new StringBuffer();
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
//FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
// FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
String alertTypeCode = calledRo.getAlertTypeCode(); String alertTypeCode = calledRo.getAlertTypeCode();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
FireTeam fireTeam = fireTeamServiceImpl.getById(companyId);
sendIds.stream().forEach(e -> { sendIds.stream().forEach(e -> {
JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(e)); JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(e));
if (jsonObject1.containsKey("type") && (jsonObject1.getString("type").equals(AlertStageEnums.DD.getCode()))) {
String [] groupCode = jsonObject1.getString("fireBrigade").split(",");
List<String> positionType= Arrays.asList(groupCode);
if (jsonObject1.containsKey("fireBrigade")) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(fireTeam.getCompanyName(),positionType); if (jsonObject1.containsKey("type")
&& (jsonObject1.getString("type").equals(AlertStageEnums.DD.getCode()))) {
String[] groupCode = jsonObject1.getString("fireBrigade").split(",");
List<String> positionType = Arrays.asList(groupCode);
if (jsonObject1.containsKey("fireBrigade")) {
{
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getFireRescueDepartmentStaff(fireTeam.getCompanyName(), positionType);
sendUserIds.addAll(mapList); sendUserIds.addAll(mapList);
} }
if(jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),fireTeam.getCompanyName()); if (jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),
fireTeam.getCompanyName());
sendUserIds.addAll(mapList); sendUserIds.addAll(mapList);
} }
} }
}else if (jsonObject1.containsKey("type") && (jsonObject1.getString("type").equals(AlertStageEnums.ZD.getCode()))) {
String [] groupCode = jsonObject1.get("fireBrigade").toString().split(","); } else if (jsonObject1.containsKey("type")
List<String> positionType= Arrays.asList(groupCode); && (jsonObject1.getString("type").equals(AlertStageEnums.ZD.getCode()))) {
String departmentName= jsonObject1.getString("name");
if (jsonObject1.containsKey("fireBrigade")) { { String[] groupCode = jsonObject1.get("fireBrigade").toString().split(",");
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,positionType);
List<String> positionType = Arrays.asList(groupCode);
String departmentName = jsonObject1.getString("name");
if (jsonObject1.containsKey("fireBrigade")) {
{
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getFireRescueDepartmentStaff(departmentName, positionType);
sendUserIds.addAll(mapList); sendUserIds.addAll(mapList);
} }
if(jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName); if (jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(), departmentName);
sendUserIds.addAll(mapList); sendUserIds.addAll(mapList);
} }
} }
} }
}); });
sendUserIds.addAll(userIdList); sendUserIds.addAll(userIdList);
smsCode = AlertBusinessTypeEnum.力量调派.getSms_code(); smsCode = AlertBusinessTypeEnum.力量调派.getSms_code();
// 组装人员信息 // 组装人员信息
for (Map<String, Object> orgUser : sendUserIds) { for (Map<String, Object> orgUser : sendUserIds) {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(companyId); alertSubmittedObject.setCompanyId(companyId);
alertSubmittedObject.setCompanyName(companyName); alertSubmittedObject.setCompanyName(companyName);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString())); alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString()));
alertSubmittedObject.setUserName(orgUser.get("userName").toString()); alertSubmittedObject.setUserName(orgUser.get("userName").toString());
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) { if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone")); mobiles.add((String) orgUser.get("telephone"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone")); alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put("address", calledRo.getAddress());
smsParams.put("content", calledRo.getContent()); smsParams.put("content", calledRo.getContent());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put("trappedNum", calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put("companyName", calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put("contactUser", calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
List<PowerTransferCompanyResourcesDto> list = powerDto List<PowerTransferCompanyResourcesDto> list = powerDto
.getPowerTransferCompanyResourcesDtoList(); .getPowerTransferCompanyResourcesDtoList();
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (PowerTransferCompanyResourcesDto i : list) { for (PowerTransferCompanyResourcesDto i : list) {
String carName = i.getResourcesName(); String carName = i.getResourcesName();
String resourceName = i.getResourcesNum(); String resourceName = i.getResourcesNum();
String type = i.getType(); String type = i.getType();
resourcesNum.append("车辆" + type); resourcesNum.append("车辆" + type);
resourcesNum.append("车牌号" + carName + " " + resourceName); resourcesNum.append("车牌号" + carName + " " + resourceName);
resourcesNum.append("、"); resourcesNum.append("、");
if (designatedDriver) { if (designatedDriver) {
// 发送单个车辆的信息数据到客户 // 发送单个车辆的信息数据到客户
smsParams.put("resourcesNum", smsParams.put("resourcesNum",
resourcesNum.toString().substring(resourcesNum.toString().length() - 2)); resourcesNum.toString().substring(resourcesNum.toString().length() - 2));
List<AlertSubmittedObject> alertSubmittedObjectListSub = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectListSub = Lists.newArrayList();
Map<String, Object> map = dynamicFormInstanceMapper Map<String, Object> map = dynamicFormInstanceMapper
.getCurentCarIsUserPhone(Long.parseLong(i.getResourcesId())); .getCurentCarIsUserPhone(Long.parseLong(i.getResourcesId()));
AlertSubmittedObject alertSubmittedObjectSub = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObjectSub = new AlertSubmittedObject();
alertSubmittedObjectSub.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObjectSub.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObjectSub.setType(false); alertSubmittedObjectSub.setType(false);
alertSubmittedObjectSub.setCompanyId(companyId); alertSubmittedObjectSub.setCompanyId(companyId);
alertSubmittedObjectSub.setCompanyName(companyName); alertSubmittedObjectSub.setCompanyName(companyName);
alertSubmittedObjectSub.setType(false); alertSubmittedObjectSub.setType(false);
if(map==null || !map.containsKey("userId")) {
if (map == null || !map.containsKey("userId")) {
continue; continue;
} }
alertSubmittedObjectSub.setUserId(Long.parseLong(map.get("userId").toString())); alertSubmittedObjectSub.setUserId(Long.parseLong(map.get("userId").toString()));
alertSubmittedObjectSub.setUserName(map.get("userName").toString()); alertSubmittedObjectSub.setUserName(map.get("userName").toString());
Set<String> mobile =null;
Set<String> mobile = null;
if (!ValidationUtil.isEmpty(map.get("mobilePhone"))) { if (!ValidationUtil.isEmpty(map.get("mobilePhone"))) {
mobile = new HashSet<String>() { mobile = new HashSet<String>() {
{ {
add(map.get("mobilePhone").toString()); add(map.get("mobilePhone").toString());
} }
}; };
alertSubmittedObjectSub.setUserPhone(map.get("mobilePhone").toString()); alertSubmittedObjectSub.setUserPhone(map.get("mobilePhone").toString());
} }
alertSubmittedObjectListSub.add(alertSubmittedObjectSub); alertSubmittedObjectListSub.add(alertSubmittedObjectSub);
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectListSub); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectListSub);
// 调用短信发送接口 // 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(sCode, mobile, smsParams); alertCalledAction.sendAlertCalleCmd(sCode, mobile, smsParams);
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS,
false); false);
} }
} }
} }
String resourcesNumStr = resourcesNum.toString(); String resourcesNumStr = resourcesNum.toString();
sendUserIds.stream().forEach(i -> { sendUserIds.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey("mobilePhone")) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get("mobilePhone").toString());
} }
}); });
smsParams.put("resourcesNum", resourcesNumStr.substring(resourcesNumStr.length() - 2)); smsParams.put("resourcesNum", resourcesNumStr.substring(resourcesNumStr.length() - 2));
// 短信报送对象 // 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
try { try {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
} catch (Exception e) { } catch (Exception e) {
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void ruleCallbackActionForPowerTransferForSurvBrigade(String smsCode, List sendIds, Object object) throws MqttPersistenceException, MqttException {
public void ruleCallbackActionForPowerTransferForSurvBrigade(String smsCode, List sendIds, Object object)
throws MqttPersistenceException, MqttException {
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
Set<String> mobiles = new HashSet<>(); Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null; String alertCalledId = null;
if (object instanceof AlertCallePowerTransferRo) { if (object instanceof AlertCallePowerTransferRo) {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object; AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr(); alertCalledId = calledRo.getSequenceNbr();
Set<Map<String, Object>> userIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> userIds = new HashSet<Map<String, Object>>();
List<Object> companyDetail =JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class);
for(Object e:sendIds) { List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),
Object.class);
for (Object e : sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e));
if(jsonObject.containsKey("type") &&( (jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode())) || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) {
String departmentName= jsonObject.getString("name"); if (jsonObject.containsKey("type")
if (jsonObject.containsKey("airportUnit")) { { && ((jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode()))
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null); || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) {
String departmentName = jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) {
{
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getFireRescueDepartmentStaff(departmentName, null);
userIds.addAll(mapList); userIds.addAll(mapList);
} }
if(jsonObject.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName); if (jsonObject.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(), departmentName);
userIds.addAll(mapList); userIds.addAll(mapList);
} }
} }
} }
} }
for (Object powerTransferCompanyDto : companyDetail) { for (Object powerTransferCompanyDto : companyDetail) {
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerTransferCompanyDto powerDto = JSONObject
.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId(); Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName(); String companyName = powerDto.getCompanyName();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);
for(Object sendObject:sendIds) { FireTeam fireTeam = fireTeamServiceImpl.getById(companyId);
for (Object sendObject : sendIds) {
JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(sendObject)); JSONObject jsonObject1 = JSONObject.parseObject(JSONObject.toJSONString(sendObject));
if (jsonObject1.containsKey("type") && (jsonObject1.getString("type").equals(AlertStageEnums.监控大队.getCode()))) {
if(jsonObject1.containsKey("onDuty")) { if (jsonObject1.containsKey("type")
List<Map<String, Object>> dutyList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId( && (jsonObject1.getString("type").equals(AlertStageEnums.监控大队.getCode()))) {
if (jsonObject1.containsKey("onDuty")) {
List<Map<String, Object>> dutyList = dynamicFormInstanceMapper
.getDutyPersonByTeamIdAndCarId(
DateUtils.getDateNowShortStr(), fireTeam.getCompanyName()); DateUtils.getDateNowShortStr(), fireTeam.getCompanyName());
sendUserIds.addAll(dutyList); sendUserIds.addAll(dutyList);
} }
if (jsonObject1.containsKey("airportUnit")) { {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff( fireTeam.getCompanyName(),null); if (jsonObject1.containsKey("airportUnit")) {
{
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getFireRescueDepartmentStaff(fireTeam.getCompanyName(), null);
sendUserIds.addAll(mapList); sendUserIds.addAll(mapList);
} }
} }
} }
} }
sendUserIds.addAll(userIds); sendUserIds.addAll(userIds);
smsCode = AlertBusinessTypeEnum.力量调派.getSms_code(); smsCode = AlertBusinessTypeEnum.力量调派.getSms_code();
// 组装人员信息 // 组装人员信息
for (Map<String, Object> orgUser : sendUserIds) { for (Map<String, Object> orgUser : sendUserIds) {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setCompanyId(companyId); alertSubmittedObject.setCompanyId(companyId);
alertSubmittedObject.setCompanyName(companyName); alertSubmittedObject.setCompanyName(companyName);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString())); alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString()));
alertSubmittedObject.setUserName(orgUser.get("userName").toString()); alertSubmittedObject.setUserName(orgUser.get("userName").toString());
if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) { if (!ValidationUtil.isEmpty(orgUser.get("telephone"))) {
mobiles.add((String) orgUser.get("telephone")); mobiles.add((String) orgUser.get("telephone"));
alertSubmittedObject.setUserPhone((String) orgUser.get("telephone")); alertSubmittedObject.setUserPhone((String) orgUser.get("telephone"));
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put("address", calledRo.getAddress());
smsParams.put("content", calledRo.getContent()); smsParams.put("content", calledRo.getContent());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put("trappedNum", calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put("companyName", calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put("contactUser", calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
sendUserIds.stream().forEach(i-> { sendUserIds.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey("mobilePhone")) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get("mobilePhone").toString());
} }
}); });
smsParams.put("resourcesNum", companyName); smsParams.put("resourcesNum", companyName);
// 短信报送对象 // 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
try { try {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
}catch(Exception e){
} catch (Exception e) {
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
} }
}
public void ruleCallbackActionForPowerTransferForAid(String smsCode, List sendIds, Object object) throws MqttPersistenceException, MqttException { }
public void ruleCallbackActionForPowerTransferForAid(String smsCode, List sendIds, Object object)
throws MqttPersistenceException, MqttException {
List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList(); List<AlertSubmittedObject> alertSubmittedObjectList = Lists.newArrayList();
...@@ -1041,103 +1954,195 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1041,103 +1954,195 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Set<Map<String, Object>> userIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> userIds = new HashSet<Map<String, Object>>();
HashMap<String, String> smsParams = new HashMap<>(); HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null; String alertCalledId = null;
if (object instanceof AlertCallePowerTransferRo) { if (object instanceof AlertCallePowerTransferRo) {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object; AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId(); String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr(); alertCalledId = calledRo.getSequenceNbr();
//List<FireTeam> fireTeamList= new ArrayList<FireTeam>();
List<Object> companyDetail =JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),Object.class); // List<FireTeam> fireTeamList= new ArrayList<FireTeam>();
//获取急救科、消救部人员信息
for(Object e:sendIds) { List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(calledRo.getCompany()).toString(),
Object.class);
// 获取急救科、消救部人员信息
for (Object e : sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e));
if(jsonObject.containsKey("type") &&( (jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode())) || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) {
String departmentName= jsonObject.getString("name"); if (jsonObject.containsKey("type")
if (jsonObject.containsKey("airportUnit")) { { && ((jsonObject.getString("type").equals(AlertStageEnums.ZH.getCode()))
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getFireRescueDepartmentStaff(departmentName,null); || jsonObject.getString("type").equals(AlertStageEnums.XJ.getCode()))) {
String departmentName = jsonObject.getString("name");
if (jsonObject.containsKey("airportUnit")) {
{
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getFireRescueDepartmentStaff(departmentName, null);
userIds.addAll(mapList); userIds.addAll(mapList);
} }
if(jsonObject.containsKey("onDuty")) { if (jsonObject.containsKey("onDuty")) {
List<Map<String, Object>> mapList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(),departmentName);
List<Map<String, Object>> mapList = dynamicFormInstanceMapper
.getDutyPersonByTeamIdAndCarId(DateUtils.getDateNowShortStr(), departmentName);
userIds.addAll(mapList); userIds.addAll(mapList);
} }
} }
} }
} }
//获取对应急救站的当日值班员信息
// 获取对应急救站的当日值班员信息
for (Object powerTransferCompanyDto : companyDetail) { for (Object powerTransferCompanyDto : companyDetail) {
Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>(); Set<Map<String, Object>> sendUserIds = new HashSet<Map<String, Object>>();
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerTransferCompanyDto powerDto = JSONObject
.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
Long companyId = powerDto.getCompanyId(); Long companyId = powerDto.getCompanyId();
String companyName = powerDto.getCompanyName(); String companyName = powerDto.getCompanyName();
FireTeam fireTeam= fireTeamServiceImpl.getById(companyId);//这个公司ID实际上是120急救站的id值
//fireTeamList.add(fireTeam); FireTeam fireTeam = fireTeamServiceImpl.getById(companyId);// 这个公司ID实际上是120急救站的id值
for(Object e:sendIds) {
// fireTeamList.add(fireTeam);
for (Object e : sendIds) {
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e)); JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(e));
//获取120急救站的规则
if (jsonObject.containsKey("type") && (jsonObject.getString("type").equals(AlertStageEnums.JJZ.getCode()))) { // 获取120急救站的规则
if(!jsonObject.containsKey("onDuty")) {
if (jsonObject.containsKey("type")
&& (jsonObject.getString("type").equals(AlertStageEnums.JJZ.getCode()))) {
if (!jsonObject.containsKey("onDuty")) {
continue; continue;
} }
//fireTeamList.stream().forEach(i->{
//获取120急救排版值班的人员信息 // fireTeamList.stream().forEach(i->{
// 获取120急救排版值班的人员信息
List<Map<String, Object>> dutyList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndAirId( List<Map<String, Object>> dutyList = dynamicFormInstanceMapper.getDutyPersonByTeamIdAndAirId(
DateUtils.getDateNowShortStr(), fireTeam.getCompanyName()); DateUtils.getDateNowShortStr(), fireTeam.getCompanyName());
sendUserIds.addAll(dutyList); sendUserIds.addAll(dutyList);
//});
// });
} }
} }
sendUserIds.addAll(userIds); sendUserIds.addAll(userIds);
smsCode = AlertBusinessTypeEnum.力量调派.getSms_code(); smsCode = AlertBusinessTypeEnum.力量调派.getSms_code();
// 组装人员信息 // 组装人员信息
for (Map<String, Object> orgUser : sendUserIds) { for (Map<String, Object> orgUser : sendUserIds) {
AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject(); AlertSubmittedObject alertSubmittedObject = new AlertSubmittedObject();
alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId)); alertSubmittedObject.setAlertSubmittedId(Long.parseLong(alertSubmittedId));
alertSubmittedObject.setCompanyId(companyId); alertSubmittedObject.setCompanyId(companyId);
alertSubmittedObject.setCompanyName(companyName); alertSubmittedObject.setCompanyName(companyName);
alertSubmittedObject.setType(false); alertSubmittedObject.setType(false);
alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString())); alertSubmittedObject.setUserId(Long.parseLong(orgUser.get("userId").toString()));
alertSubmittedObject.setUserName(orgUser.get("userName").toString()); alertSubmittedObject.setUserName(orgUser.get("userName").toString());
if (!ValidationUtil.isEmpty(orgUser.get("mobilePhone"))) { if (!ValidationUtil.isEmpty(orgUser.get("mobilePhone"))) {
mobiles.add((String) orgUser.get("mobilePhone")); mobiles.add((String) orgUser.get("mobilePhone"));
alertSubmittedObject.setUserPhone(orgUser.get("mobilePhone").toString()); alertSubmittedObject.setUserPhone(orgUser.get("mobilePhone").toString());
} }
alertSubmittedObjectList.add(alertSubmittedObject); alertSubmittedObjectList.add(alertSubmittedObject);
} }
smsParams.put("callTimeStr", calledRo.getCallTimeStr()); smsParams.put("callTimeStr", calledRo.getCallTimeStr());
smsParams.put("address", calledRo.getAddress()); smsParams.put("address", calledRo.getAddress());
smsParams.put("content", calledRo.getContent()); smsParams.put("content", calledRo.getContent());
smsParams.put("trappedNum", calledRo.getTrappedNum()); smsParams.put("trappedNum", calledRo.getTrappedNum());
smsParams.put("casualtiesNum", calledRo.getCasualtiesNum()); smsParams.put("casualtiesNum", calledRo.getCasualtiesNum());
smsParams.put("companyName", calledRo.getCompanyName()); smsParams.put("companyName", calledRo.getCompanyName());
smsParams.put("contactUser", calledRo.getContactUser()); smsParams.put("contactUser", calledRo.getContactUser());
smsParams.put("contactPhone", calledRo.getContactPhone()); smsParams.put("contactPhone", calledRo.getContactPhone());
smsParams.put("alertType", calledRo.getAlertType()); smsParams.put("alertType", calledRo.getAlertType());
sendUserIds.stream().forEach(i -> { sendUserIds.stream().forEach(i -> {
if (i.containsKey("mobilePhone")) { if (i.containsKey("mobilePhone")) {
mobiles.add(i.get("mobilePhone").toString()); mobiles.add(i.get("mobilePhone").toString());
} }
}); });
smsParams.put("resourcesNum", companyName); smsParams.put("resourcesNum", companyName);
// 短信报送对象 // 短信报送对象
alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList); alertSubmittedObjectServiceImpl.saveBatch(alertSubmittedObjectList);
// 发送任务消息 // 发送任务消息
// 组织短信内容 // 组织短信内容
// 调用短信发送接口 // 调用短信发送接口
try { try {
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams); alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
}catch (Exception e) {// TODO: handle exception
} catch (Exception e) {// TODO: handle exception
} }
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false); emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
} }
} }
} }
} }
...@@ -330,7 +330,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -330,7 +330,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
ResponseModel<List<Map<String, Object>>> result = equipFeignClient.getFireCarListAllcount(); ResponseModel<List<Map<String, Object>>> result = equipFeignClient.getFireCarListAllcount();
List<Map<String, Object>> result1 = result.getResult(); List<Map<String, Object>> result1 = result.getResult();
if(result1!=null&&result1.size()> 0){
list.forEach(fireTeamZhDto -> { list.forEach(fireTeamZhDto -> {
Long sequenceNbr = fireTeamZhDto.getSequenceNbr(); Long sequenceNbr = fireTeamZhDto.getSequenceNbr();
result1.forEach(map -> { result1.forEach(map -> {
...@@ -341,6 +341,10 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -341,6 +341,10 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
} }
}); });
}); });
}
/* /*
* *
* if(result1!=null&&result1.size()>0){ Map<String, Object> combineResultMap = * if(result1!=null&&result1.size()>0){ Map<String, Object> combineResultMap =
...@@ -435,7 +439,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -435,7 +439,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>(); LambdaQueryWrapper<FireTeam> queryWrapper = new LambdaQueryWrapper<FireTeam>();
queryWrapper.eq(FireTeam::getTypeCode, code); queryWrapper.eq(FireTeam::getTypeCode, code);
queryWrapper.eq(FireTeam::getIsDelete, false); queryWrapper.eq(FireTeam::getIsDelete, false);
// queryWrapper.eq(FireTeam::getCompany, companyId); queryWrapper.eq(FireTeam::getCompany, companyId);
return this.baseMapper.selectList(queryWrapper); return this.baseMapper.selectList(queryWrapper);
} }
......
...@@ -50,7 +50,7 @@ public class RuleAlertCalledService { ...@@ -50,7 +50,7 @@ public class RuleAlertCalledService {
* @return * @return
* @throws Exception * @throws Exception
*/ */
public Boolean fireAlertCalledRule(AlertCalledObjsDto alertCalledVo,String alertWay, String mobiles) throws Exception { public Boolean fireAlertCalledRule(AlertCalledObjsDto alertCalledVo,String alertWay, String mobiles,String usIds,String feedBack) throws Exception {
AlertCalled alertCalled = alertCalledVo.getAlertCalled(); AlertCalled alertCalled = alertCalledVo.getAlertCalled();
if (ValidationUtil.isEmpty(alertCalled)) { if (ValidationUtil.isEmpty(alertCalled)) {
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
...@@ -59,8 +59,27 @@ public class RuleAlertCalledService { ...@@ -59,8 +59,27 @@ public class RuleAlertCalledService {
* 构建警情报送规则对象 * 构建警情报送规则对象
*/ */
AlertCalledRo alertCalledRo = new AlertCalledRo(); AlertCalledRo alertCalledRo = new AlertCalledRo();
alertCalledRo.setFeedback(feedBack);
String replaceContent = init(alertCalledRo,alertCalledVo);
// 警情 报送类型
alertCalledRo.setAlertWay(alertWay);
alertCalledRo.setReplaceContent(replaceContent);
alertCalledRo.setUsIds(usIds);
if(!ValidationUtil.isEmpty(mobiles)) {
alertCalledRo.setIds(mobiles);
}
//触发规则
ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]);
return true;
}
public static String init(AlertCalledRo alertCalledRo , AlertCalledObjsDto alertCalledVo ) {
AlertCalled alertCalled = alertCalledVo.getAlertCalled();
//通用属性 //通用属性
alertCalledRo.setSequenceNbr(String.valueOf(alertCalled.getSequenceNbr())); alertCalledRo.setSequenceNbr(String.valueOf(alertCalled.getSequenceNbr()));
alertCalledRo.setAddress(alertCalled.getAddress()); alertCalledRo.setAddress(alertCalled.getAddress());
...@@ -167,7 +186,6 @@ public class RuleAlertCalledService { ...@@ -167,7 +186,6 @@ public class RuleAlertCalledService {
if (alertFormValue.getFieldCode().equals("ageGroup")) { if (alertFormValue.getFieldCode().equals("ageGroup")) {
alertCalledRo.setAgeGroup(alertFormValue.getFieldValue()); alertCalledRo.setAgeGroup(alertFormValue.getFieldValue());
} }
} }
} }
...@@ -213,18 +231,7 @@ public class RuleAlertCalledService { ...@@ -213,18 +231,7 @@ public class RuleAlertCalledService {
";年龄段:").concat(ValidationUtil.isEmpty(alertCalledRo.getAgeGroup() ) ? "无" : alertCalledRo.getAgeGroup()); ";年龄段:").concat(ValidationUtil.isEmpty(alertCalledRo.getAgeGroup() ) ? "无" : alertCalledRo.getAgeGroup());
} }
// 警情 报送类型 return replaceContent;
alertCalledRo.setAlertWay(alertWay);
alertCalledRo.setReplaceContent(replaceContent);
if(!ValidationUtil.isEmpty(mobiles)) {
alertCalledRo.setIds(mobiles);
}
//触发规则
ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]);
return true;
} }
public boolean powerTransferCalledRule(Set<PowerTransferCompanyDto> i, Long alertCalledId, String type) throws Exception { public boolean powerTransferCalledRule(Set<PowerTransferCompanyDto> i, Long alertCalledId, String type) throws Exception {
......
package com.yeejoin.amos.latentdanger.business.dto;
import com.yeejoin.amos.component.rule.Label;
import com.yeejoin.amos.component.rule.RuleFact;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @Author: xl
* @Description: 隐患规则实体
* @Date: 2021/11/12 14:44
*/
@Data
@RuleFact(value = "隐患",project = "消息规则")
public class LatentDangerRo implements Serializable {
private static final long serialVersionUID = -2985122485796921797L;
@Label("隐患名称")
private String dangerName;
@Label(value = "隐患等级名称")
private String dangerLevelName;
@Label(value = "执行方法")
private String ruleType;
@Label(value = "整改类型名称")
private String reformTypeName;
@Label(value = "隐患状态")
private String dangerState;
@Label(value = "隐患状态名称")
private String dangerStateName;
@Label(value = "执行状态")
private String excuteStateName;
@Label(value = "推送时间")
private String sendTime;
@Label(value = "接收人")
private List<String> recivers;
@Label(value = "发送到web标识")
private Boolean isSendWeb;
@Label(value = "发送到app标识")
private Boolean isSendApp;
@Label("关联id")
private String relationId;
@Label("消息类型")
private String msgType;
@Label(value = "终端标识")
private String terminal;
@Label(value = "扩展参数")
private Map<String, String> extras;
}
...@@ -13,6 +13,7 @@ import com.google.common.collect.Sets; ...@@ -13,6 +13,7 @@ import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo; import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl; import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService; import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
...@@ -49,20 +50,7 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo; ...@@ -49,20 +50,7 @@ import com.yeejoin.amos.latentdanger.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo; import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailRiskVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo; import com.yeejoin.amos.latentdanger.business.vo.LatentDangerDetailVo;
import com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo; import com.yeejoin.amos.latentdanger.business.vo.LatentDangerListVo;
import com.yeejoin.amos.latentdanger.common.enums.DangerHandleStateEnum; import com.yeejoin.amos.latentdanger.common.enums.*;
import com.yeejoin.amos.latentdanger.common.enums.DictTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.ExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerBizTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerExecuteTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerLevelEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerOvertimeStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerProcessStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerReformTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerStateEnum;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerTypeEnum;
import com.yeejoin.amos.latentdanger.common.enums.OwerEnum;
import com.yeejoin.amos.latentdanger.common.remote.RemoteSpcService; import com.yeejoin.amos.latentdanger.common.remote.RemoteSpcService;
import com.yeejoin.amos.latentdanger.common.remote.RemoteWebSocketServer; import com.yeejoin.amos.latentdanger.common.remote.RemoteWebSocketServer;
import com.yeejoin.amos.latentdanger.common.remote.RemoteWorkFlowService; import com.yeejoin.amos.latentdanger.common.remote.RemoteWorkFlowService;
...@@ -144,6 +132,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -144,6 +132,8 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
private RemoteSpcService remoteSpcService; private RemoteSpcService remoteSpcService;
@Autowired @Autowired
private AsyncTask asyncTask; private AsyncTask asyncTask;
@Autowired
private RuleDangerService ruleDangerService;
// @Autowired // @Autowired
// private Business business; // private Business business;
@Autowired @Autowired
...@@ -288,7 +278,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -288,7 +278,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
latentDanger.setCurrentFlowRecordId(inputRecord.getId()); latentDanger.setCurrentFlowRecordId(inputRecord.getId());
latentDanger.setInstanceId(instance.getString("id")); latentDanger.setInstanceId(instance.getString("id"));
latentDangerMapper.updateById(latentDanger); latentDangerMapper.updateById(latentDanger);
asyncTask.sendDangerMsg(RequestContext.cloneRequestContext(), latentDanger, onSiteConfirmRole); ruleDangerService.addLatentDangerRule(latentDanger, RuleTypeEnum.隐患第一次提交.getCode(), onSiteConfirmRole);
} }
// TODO 使用远程调用替换 // TODO 使用远程调用替换
...@@ -2110,7 +2100,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD ...@@ -2110,7 +2100,7 @@ public class LatentDangerServiceImpl extends BaseService<LatentDangerBo, LatentD
throw new Exception(executeSubmitDto.getMsg()); throw new Exception(executeSubmitDto.getMsg());
} }
List<String> userIds = workflowExecuteService.getUserIdsByWorkflow(latentDanger.getInstanceId(), executeSubmitDto.getCheckLeaderId()); List<String> userIds = workflowExecuteService.getUserIdsByWorkflow(latentDanger.getInstanceId(), executeSubmitDto.getCheckLeaderId());
asyncTask.sendDangerSubmitMsg(RequestContext.cloneRequestContext(), latentDanger, userIds, ExecuteTypeEnum.getNameByCode(executeType)); ruleDangerService.addDangerSubmitRule(latentDanger, userIds, RuleTypeEnum.隐患审核.getCode(), ExecuteTypeEnum.getNameByCode(executeType));
return executeSubmitDto; return executeSubmitDto;
} }
......
package com.yeejoin.amos.latentdanger.business.service.impl;
import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.latentdanger.business.dto.LatentDangerRo;
import com.yeejoin.amos.latentdanger.business.util.DateUtil;
import com.yeejoin.amos.latentdanger.common.enums.LatentDangerState;
import com.yeejoin.amos.latentdanger.dao.entity.LatentDanger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author: xl
* @Description: 隐患触发规则
* @Date: 2021/11/12 14:55
*/
@Service
public class RuleDangerService {
private final String packageId = "消息/addDangerRule";
private final String msgType = "danger";
private final String APP = "APP";
private final String WEB = "WEB";
private final String APP_WEB = "APP/WEB";
@Autowired
private RuleTrigger ruleTrigger;
public Boolean addLatentDangerRule(LatentDanger latentDanger, String ruleType, String roleName) throws Exception {
LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType);
latentDangerRo.setTerminal(APP);
List<RoleModel> result = Privilege.roleClient.queryRoleList(roleName, null).getResult();
if (result.size() > 0) {
List<AgencyUserModel> userModels = Privilege.agencyUserClient.queryByRoleId(String.valueOf(result.get(0).getSequenceNbr()), null).getResult();
List<String> userIds = userModels.stream().map(AgencyUserModel::getUserId).collect(Collectors.toList());
latentDangerRo.setRecivers(userIds);
}
//触发规则
ruleTrigger.publish(latentDangerRo, packageId, new String[0]);
return true;
}
public Boolean addDangerSubmitRule(LatentDanger latentDanger, List<String> userIds, String ruleType, String excuteStateName) throws Exception {
LatentDangerRo latentDangerRo = buildLatentDangerRo(latentDanger, ruleType);
Map<String, String> extras = !ValidationUtil.isEmpty(latentDangerRo.getExtras()) ? latentDangerRo.getExtras() : new HashMap<>();
// 跳转url
String url = LatentDangerState.SupervisionDangerStateEnum.getEnumUrlByCode(latentDanger.getDangerState());
extras.put("url", url);
latentDangerRo.setExtras(extras);
latentDangerRo.setExcuteStateName(excuteStateName);
latentDangerRo.setIsSendWeb(true);
latentDangerRo.setRecivers(userIds);
latentDangerRo.setTerminal(APP_WEB);
//触发规则
ruleTrigger.publish(latentDangerRo, packageId, new String[0]);
return true;
}
private LatentDangerRo buildLatentDangerRo (LatentDanger latentDanger, String ruleType){
LatentDangerRo latentDangerRo = new LatentDangerRo();
BeanUtils.copyProperties(latentDanger, latentDangerRo);
latentDangerRo.setMsgType(msgType);
latentDangerRo.setIsSendApp(true);
latentDangerRo.setRuleType(ruleType);
latentDangerRo.setRelationId(String.valueOf(latentDanger.getId()));
latentDangerRo.setSendTime(DateUtil.date2LongStr(new Date()));
String type = null;
latentDanger.getDangerState();
LatentDangerState.SupervisionDangerStateEnum stateEnum =
LatentDangerState.SupervisionDangerStateEnum.getEnumByCode(latentDanger.getDangerState());
if (!ValidationUtil.isEmpty(stateEnum)) {
if (stateEnum.getProcessState().equals("0") || stateEnum.getProcessState().equals("1")) {
type = "1";
} else if (stateEnum.getProcessState().equals("4")) {
type = "2";
}
}
if (!ValidationUtil.isEmpty(type)){
Map<String, String> map = new HashMap<>();
map.put("type", type);
latentDangerRo.setExtras(map);
}
return latentDangerRo;
}
}
package com.yeejoin.amos.patrol.business.controller; package com.yeejoin.amos.patrol.business.controller;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo; import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
...@@ -38,10 +17,28 @@ import com.yeejoin.amos.patrol.business.util.FileHelper; ...@@ -38,10 +17,28 @@ import com.yeejoin.amos.patrol.business.util.FileHelper;
import com.yeejoin.amos.patrol.business.vo.DangerTimeAxisVo; import com.yeejoin.amos.patrol.business.vo.DangerTimeAxisVo;
import com.yeejoin.amos.patrol.common.enums.DictTypeEnum; import com.yeejoin.amos.patrol.common.enums.DictTypeEnum;
import com.yeejoin.amos.patrol.core.common.response.DangerListResponse; import com.yeejoin.amos.patrol.core.common.response.DangerListResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
@RestController @RestController
@RequestMapping(value = "/api/latent/danger") @RequestMapping(value = "/api/latent/danger")
...@@ -139,7 +136,6 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -139,7 +136,6 @@ public class LatentDangerController extends AbstractBaseController {
} }
return iLatentDangerService.detail(id, user.getUserId(),isFinish); return iLatentDangerService.detail(id, user.getUserId(),isFinish);
} catch (Exception e) { } catch (Exception e) {
logger.error("隐患详情异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试"); return CommonResponseUtil.failure("系统繁忙,请稍后再试");
} }
} }
...@@ -328,4 +324,11 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -328,4 +324,11 @@ public class LatentDangerController extends AbstractBaseController {
return CommonResponseUtil.failure("系统繁忙,请稍后再试"); return CommonResponseUtil.failure("系统繁忙,请稍后再试");
} }
} }
@ApiOperation(value = "应急指挥科人员列表", notes = "应急指挥科人员列表")
@GetMapping(value = "/emergencyCommandSection/person/list")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse getPersonListByCompanyId() {
return CommonResponseUtil.success(iLatentDangerService.getPersonListByCompanyId());
}
} }
...@@ -23,7 +23,11 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor { ...@@ -23,7 +23,11 @@ public class FeignBasicAuthRequestInterceptor implements RequestInterceptor {
HttpServletRequest request = attributes.getRequest(); HttpServletRequest request = attributes.getRequest();
//设置header //设置header
String token = request.getHeader("X-Access-Token"); String token = request.getHeader("token");
if (null == token) {
token = request.getHeader("X-Access-Token");
}
String product = request.getHeader("product"); String product = request.getHeader("product");
String appKey = request.getHeader("appKey"); String appKey = request.getHeader("appKey");
template.header("token", token); template.header("token", token);
......
package com.yeejoin.amos.patrol.business.feign; package com.yeejoin.amos.patrol.business.feign;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory; import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters; import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
public class FeignConfiguration { public class FeignConfiguration {
@Autowired @Autowired
private ObjectFactory<HttpMessageConverters> messageConverters; private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean @Bean
public Encoder feignFormEncoder() { public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); return new SpringFormEncoder(new SpringEncoder(messageConverters));
} }
@Bean @Bean
public FeignBasicAuthRequestInterceptor basicAuthRequestInterceptor() { public FeignBasicAuthRequestInterceptor basicAuthRequestInterceptor() {
return new FeignBasicAuthRequestInterceptor(); return new FeignBasicAuthRequestInterceptor();
......
package com.yeejoin.amos.patrol.business.feign;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
// 机场服务
@FeignClient(name = "${jcs.fegin.name}", path = "jcs", configuration = FeignConfiguration.class)
public interface JcsFeignClient {
/**
* 根据机场人员ids获取amos平台人员列表
*
* @param orgUserId 机场单位人员ids
* @return AgencyUserModel 平台人员信息列表
**/
@RequestMapping(value = "/org-usr/amos/list/{orgUserId}", method = RequestMethod.GET)
ResponseModel<List<AgencyUserModel>> getAmosUserByUserId(@PathVariable String orgUserId);
/**
* 根据机场单位id获取单位下人员列表
*
* @param companyId 机场单位id
* @return Object 单位下人员列表
**/
@RequestMapping(value = "/org-usr/{companyId}/person/list", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getPersonListByCompanyId(@PathVariable String companyId);
}
...@@ -49,5 +49,9 @@ public class LatentDangerExcuteParam { ...@@ -49,5 +49,9 @@ public class LatentDangerExcuteParam {
private Integer dangerLevel; private Integer dangerLevel;
/**
* 治理人员id
*/
public String reviewUserIds;
} }
...@@ -9,6 +9,7 @@ import com.google.common.collect.Maps; ...@@ -9,6 +9,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo; import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel; import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.patrol.business.constants.XJConstant; import com.yeejoin.amos.patrol.business.constants.XJConstant;
...@@ -35,6 +36,7 @@ import com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerNotice ...@@ -35,6 +36,7 @@ import com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerNotice
import com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo; import com.yeejoin.amos.patrol.business.entity.mybatis.extend.LatentDangerPatrolBo;
import com.yeejoin.amos.patrol.business.feign.Business; import com.yeejoin.amos.patrol.business.feign.Business;
import com.yeejoin.amos.patrol.business.feign.EquipFeign; import com.yeejoin.amos.patrol.business.feign.EquipFeign;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.param.LatentDangerExcuteParam; import com.yeejoin.amos.patrol.business.param.LatentDangerExcuteParam;
import com.yeejoin.amos.patrol.business.param.LatentDangerListParam; import com.yeejoin.amos.patrol.business.param.LatentDangerListParam;
import com.yeejoin.amos.patrol.business.param.LatentDangerNormalParam; import com.yeejoin.amos.patrol.business.param.LatentDangerNormalParam;
...@@ -169,6 +171,12 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -169,6 +171,12 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
@Autowired @Autowired
EquipFeign equipFeign; EquipFeign equipFeign;
@Autowired
JcsFeignClient jcsFeignClient;
@Autowired
private WorkflowExcuteServiceImpl workflowExecuteService;
private static final String permissionType = "SUBMENU"; private static final String permissionType = "SUBMENU";
private static final String acctivePermissionType = "activitiItem"; private static final String acctivePermissionType = "activitiItem";
...@@ -199,6 +207,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -199,6 +207,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
private String bizType = "patrol"; private String bizType = "patrol";
@Value("${emergency.command.section.id}")
private String emergencyCommandSectionId;
@Transactional @Transactional
@Override @Override
public CommonResponse saveNormal(LatentDangerNormalParam latentDangerParam, String userId, String userRealName, String departmentId, String departmentName, String companyId, String orgCode, RoleBo role) { public CommonResponse saveNormal(LatentDangerNormalParam latentDangerParam, String userId, String userRealName, String departmentId, String departmentName, String companyId, String orgCode, RoleBo role) {
...@@ -731,12 +742,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -731,12 +742,16 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
@Override @Override
public CommonResponse detail(String id, String userId, boolean isFinish) { public CommonResponse detail(String id, String userId, boolean isFinish) {
JSONObject jsonObject; JSONObject jsonObject;
if(isFinish){ if (isFinish) {
jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id); jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id);
}else{ } else {
jsonObject = remoteWorkFlowService.queryTaskDetail(id); jsonObject = remoteWorkFlowService.queryTaskDetail(id);
} }
if (ValidationUtil.isEmpty(jsonObject)) {
return null;
}
JSONObject task = jsonObject.getJSONObject("data"); JSONObject task = jsonObject.getJSONObject("data");
LatentDangerBo latentDangerBo = latentDangerMapper.getbyBusinessKey(task.getString("businessKey")); LatentDangerBo latentDangerBo = latentDangerMapper.getbyBusinessKey(task.getString("businessKey"));
...@@ -1175,7 +1190,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1175,7 +1190,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// } // }
// } // }
public DangerExecuteSubmitDto executeSubmit(LatentDangerExcuteParam param, public DangerExecuteSubmitDto executeSubmit(LatentDangerExcuteParam executeParam,
LatentDangerExcuteTypeEnum executeTypeEnum, LatentDangerExcuteTypeEnum executeTypeEnum,
LatentDangerBo latentDangerBo, LatentDangerBo latentDangerBo,
String userId, String userId,
...@@ -1184,7 +1199,20 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1184,7 +1199,20 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
String departmentName, String departmentName,
DangerExecuteSubmitDto executeSubmitDto, DangerExecuteSubmitDto executeSubmitDto,
RoleBo role) { RoleBo role) {
JSONObject executeJson = remoteWorkFlowService.execute(param.getTaskId(), executeTypeEnum.getRequestBody()); String governUserId = null;
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患评审通过)) {
// 消防巡查需求:评审通过后指定治理人
// 1.获取治理人员对应的amos平台人员
List<AgencyUserModel> userModelList =
jcsFeignClient.getAmosUserByUserId(executeParam.getReviewUserIds()).getResult();
if (ValidationUtil.isEmpty(userModelList)) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("治理人员指定失败");
return executeSubmitDto;
}
governUserId = Joiner.on(",").join(Lists.transform(userModelList, AgencyUserModel::getUserName));
}
JSONObject executeJson = remoteWorkFlowService.execute(executeParam.getTaskId(), executeTypeEnum.getRequestBody());
if (executeJson == null) { if (executeJson == null) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("执行失败"); executeSubmitDto.setMsg("执行失败");
...@@ -1198,38 +1226,42 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1198,38 +1226,42 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.已撤销)) { if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.已撤销)) {
latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString()); latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString());
saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId, saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(),param.getRemark()); executeParam.getFlowJson(), executeParam.getDangerId(), role, executeTypeEnum.getName(),executeParam.getRemark());
} else if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.治理完毕)) { } else if (executeTypeEnum.getNextState().equals(LatentDangerStateEnum.治理完毕)) {
latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString()); latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString());
saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId, saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(),param.getRemark()); executeParam.getFlowJson(), executeParam.getDangerId(), role, executeTypeEnum.getName(),executeParam.getRemark());
} else { } else {
LatentDangerFlowRecordBo flowRecord = saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId, LatentDangerFlowRecordBo flowRecord = saveFlowRecord(executeJson.getString("id"), data.getString("name"), userId, departmentId,
param.getFlowJson(), param.getDangerId(), role, executeTypeEnum.getName(),param.getRemark()); executeParam.getFlowJson(), executeParam.getDangerId(), role, executeTypeEnum.getName(),executeParam.getRemark());
latentDangerBo.setCurrentFlowRecordId(flowRecord.getId()); latentDangerBo.setCurrentFlowRecordId(flowRecord.getId());
latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString()); latentDangerBo.setDangerState(executeTypeEnum.getNextState().getCode().toString());
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患常规治理)) { if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患常规治理)) {
latentDangerBo.setReformType(LatentDangerReformTypeEnum.常规整改.getCode().toString()); latentDangerBo.setReformType(LatentDangerReformTypeEnum.常规整改.getCode().toString());
latentDangerBo.setReformJson(param.getFlowJson().toJSONString()); latentDangerBo.setReformJson(executeParam.getFlowJson().toJSONString());
latentDangerBo.setInferOtherThings(param.getInferOtherThings()); latentDangerBo.setInferOtherThings(executeParam.getInferOtherThings());
latentDangerBo.setProblemDescription(param.getReasonAnalysis()); latentDangerBo.setProblemDescription(executeParam.getReasonAnalysis());
latentDangerBo.setReasonAnalysis(param.getRemark()); latentDangerBo.setReasonAnalysis(executeParam.getRemark());
} else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理)) { } else if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理)) {
latentDangerBo.setReformType(LatentDangerReformTypeEnum.延期治理.getCode().toString()); latentDangerBo.setReformType(LatentDangerReformTypeEnum.延期治理.getCode().toString());
latentDangerBo.setReformJson(param.getFlowJson().toJSONString()); latentDangerBo.setReformJson(executeParam.getFlowJson().toJSONString());
latentDangerBo.setInferOtherThings(param.getInferOtherThings()); latentDangerBo.setInferOtherThings(executeParam.getInferOtherThings());
latentDangerBo.setProblemDescription(param.getReasonAnalysis()); latentDangerBo.setProblemDescription(executeParam.getReasonAnalysis());
latentDangerBo.setReasonAnalysis(param.getRemark()); latentDangerBo.setReasonAnalysis(executeParam.getRemark());
latentDangerBo.setDelayLimitDate(DateUtil.str2Date(param.getDelayLimitDate(), DateUtil.DATETIME_DEFAULT_FORMAT)); latentDangerBo.setDelayLimitDate(DateUtil.str2Date(executeParam.getDelayLimitDate(), DateUtil.DATETIME_DEFAULT_FORMAT));
} }
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患评审通过)) { if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患评审通过)) {
latentDangerBo.setReformLimitDate(DateUtil.str2Date(param.getReformLimitDate(), DateUtil.DATETIME_DEFAULT_FORMAT)); latentDangerBo.setReformLimitDate(DateUtil.str2Date(executeParam.getReformLimitDate(), DateUtil.DATETIME_DEFAULT_FORMAT));
latentDangerBo.setDangerLevel(param.getDangerLevel().toString()); latentDangerBo.setDangerLevel(executeParam.getDangerLevel().toString());
// 消防巡查需求:评审通过后制定治理人
// 2.指定治理执行人
workflowExecuteService.setTaskAssign(latentDangerBo.getInstanceId(), governUserId);
} }
} }
if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理车间部门审核通过)) { if (executeTypeEnum.equals(LatentDangerExcuteTypeEnum.隐患延期治理车间部门审核通过)) {
// 延期治理评审通过且 不需要 公司审核 // 延期治理评审通过且 不需要 公司审核
if (param.getNeedCompanyVerify() == 0) { if (executeParam.getNeedCompanyVerify() == 0) {
latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请.getCode().toString()); latentDangerBo.setDangerState(LatentDangerStateEnum.延期治理申请.getCode().toString());
latentDangerBo.setReformLimitDate(latentDangerBo.getDelayLimitDate()); latentDangerBo.setReformLimitDate(latentDangerBo.getDelayLimitDate());
} else {// 延期治理评审通过且 需要 公司审核 } else {// 延期治理评审通过且 需要 公司审核
...@@ -1238,7 +1270,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1238,7 +1270,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
latentDangerFlowRecordMapper.getByDangerIdAndCreate(latentDangerBo.getId()); latentDangerFlowRecordMapper.getByDangerIdAndCreate(latentDangerBo.getId());
String flowJsonStr = recordBo.getFlowJson(); String flowJsonStr = recordBo.getFlowJson();
JSONObject flowJson = JSONObject.parseObject(flowJsonStr); JSONObject flowJson = JSONObject.parseObject(flowJsonStr);
flowJson.put("needCompanyVerify", param.getNeedCompanyVerify()); flowJson.put("needCompanyVerify", executeParam.getNeedCompanyVerify());
recordBo.setFlowJson(flowJson.toJSONString()); recordBo.setFlowJson(flowJson.toJSONString());
latentDangerFlowRecordMapper.update(recordBo); latentDangerFlowRecordMapper.update(recordBo);
} }
...@@ -1674,4 +1706,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1674,4 +1706,10 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
} }
return taskId; return taskId;
} }
@Override
public List<Map<String, Object>> getPersonListByCompanyId() {
List<Map<String, Object>> personList = jcsFeignClient.getPersonListByCompanyId(emergencyCommandSectionId).getResult();
return personList;
}
} }
package com.yeejoin.amos.patrol.business.service.intfc; package com.yeejoin.amos.patrol.business.service.intfc;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
...@@ -83,4 +84,6 @@ public interface ILatentDangerService { ...@@ -83,4 +84,6 @@ public interface ILatentDangerService {
List<DangerTimeAxisVo> queryExecuteLog(Integer dateTime); List<DangerTimeAxisVo> queryExecuteLog(Integer dateTime);
String queryTaskByInstanceId(String processInstanceId); String queryTaskByInstanceId(String processInstanceId);
List<Map<String, Object>> getPersonListByCompanyId();
} }
...@@ -6,6 +6,7 @@ import lombok.Data; ...@@ -6,6 +6,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author: xl * @Author: xl
...@@ -16,7 +17,7 @@ import java.util.List; ...@@ -16,7 +17,7 @@ import java.util.List;
@RuleFact(value = "巡检计划",project = "消息规则") @RuleFact(value = "巡检计划",project = "消息规则")
public class PlanRo implements Serializable { public class PlanRo implements Serializable {
private static final long serialVersionUID = 3847767788621939352L; private static final long serialVersionUID = -3493714205659077324L;
@Label("计划名称") @Label("计划名称")
private String name; private String name;
...@@ -50,4 +51,7 @@ public class PlanRo implements Serializable { ...@@ -50,4 +51,7 @@ public class PlanRo implements Serializable {
@Label(value = "终端标识") @Label(value = "终端标识")
private String terminal; private String terminal;
@Label(value = "扩展参数")
private Map<String, String> extras;
} }
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -29,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; ...@@ -29,6 +30,7 @@ import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo; import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto; import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.*; import com.yeejoin.amos.supervision.core.common.response.*;
...@@ -1574,7 +1576,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1574,7 +1576,7 @@ public class CheckServiceImpl implements ICheckService {
Plan plan = planService.queryPlanById(planTask.getPlanId()); Plan plan = planService.queryPlanById(planTask.getPlanId());
// 计划完成,规则推送消息 // 计划完成,规则推送消息
if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){ if (PlanStatusEnum.COMPLETED.getValue() == plan.getStatus()){
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成.getCode()); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划完成);
} }
// p_plan_task_detail更新隐患个数 // p_plan_task_detail更新隐患个数
...@@ -1618,6 +1620,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1618,6 +1620,7 @@ public class CheckServiceImpl implements ICheckService {
} }
}); });
// 1.feign调用保存隐患 // 1.feign调用保存隐患
log.info(String.format("隐患参数:%s", JSON.toJSONString(allDanger)));
FeignClientResult<List<DangerDto>> listFeignClientResult = DangerFeignClient.saveOrUpdateBatch(allDanger); FeignClientResult<List<DangerDto>> listFeignClientResult = DangerFeignClient.saveOrUpdateBatch(allDanger);
if (ObjectUtils.isEmpty(listFeignClientResult.getResult()) || listFeignClientResult.getStatus() != HTTP_OK_STATUS) { if (ObjectUtils.isEmpty(listFeignClientResult.getResult()) || listFeignClientResult.getStatus() != HTTP_OK_STATUS) {
throw new RuntimeException(listFeignClientResult.getDevMessage()); throw new RuntimeException(listFeignClientResult.getDevMessage());
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.supervision.business.dao.repository.*; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam; import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.supervision.core.async.AsyncTask; import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest; import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone; import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
...@@ -227,9 +228,13 @@ public class PlanServiceImpl implements IPlanService { ...@@ -227,9 +228,13 @@ public class PlanServiceImpl implements IPlanService {
} }
try { try {
if (ValidationUtil.isEmpty(status)){ if (ValidationUtil.isEmpty(status)){
rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交.getCode()); // 计划提交 rulePlanService.addPlanRule(plan, userIds, RuleTypeEnum.计划提交); // 计划提交
} else { } else {
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核.getCode(), ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核 if (PlanStatusEnum.EXAMINE_THREE.getValue() != status){
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核
} else {
rulePlanService.addPlanAuditRule(plan, userIds, RuleTypeEnum.计划审核完成, ExecuteStateNameEnum.getNameByCode(excuteState)); // 计划审核完成
}
} }
} catch (Exception e) { } catch (Exception e) {
log.info("规则调用失败"); log.info("规则调用失败");
......
...@@ -29,7 +29,7 @@ import com.yeejoin.amos.supervision.business.vo.PlanTaskVo; ...@@ -29,7 +29,7 @@ import com.yeejoin.amos.supervision.business.vo.PlanTaskVo;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum; import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailIsFinishEnum; import com.yeejoin.amos.supervision.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum; import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.common.enums.RuleTypeEnum; import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone; import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
...@@ -528,7 +528,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -528,7 +528,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
// 规则推送消息 // 规则推送消息
rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成.getCode()); rulePlanService.addPlanRule(plan, null, RuleTypeEnum.计划生成);
} }
// 定时任务监控 // 定时任务监控
jobService.planTaskAddJob(planTask); jobService.planTaskAddJob(planTask);
......
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import com.yeejoin.amos.boot.biz.common.constants.TerminalConstant;
import com.yeejoin.amos.boot.biz.common.enums.RuleTypeEnum;
import com.yeejoin.amos.component.rule.RuleTrigger; import com.yeejoin.amos.component.rule.RuleTrigger;
import com.yeejoin.amos.supervision.business.dto.PlanRo; import com.yeejoin.amos.supervision.business.dto.PlanRo;
import com.yeejoin.amos.supervision.business.feign.JCSFeignClient; import com.yeejoin.amos.supervision.business.feign.JCSFeignClient;
...@@ -11,11 +13,13 @@ import org.springframework.stereotype.Service; ...@@ -11,11 +13,13 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author: xl * @Author: xl
* @Description: 巡检计划触发规则 * @Description: 防火监督触发规则
* @Date: 2021/11/10 9:50 * @Date: 2021/11/10 9:50
*/ */
@Service @Service
...@@ -24,54 +28,60 @@ public class RulePlanService { ...@@ -24,54 +28,60 @@ public class RulePlanService {
private final String packageId = "消息/addPlanRule"; private final String packageId = "消息/addPlanRule";
private final String msgType = "supervision"; private final String msgType = "supervision";
private final String APP = "APP";
private final String WEB = "WEB";
private final String APP_WEB = "APP/WEB";
@Autowired @Autowired
private RuleTrigger ruleTrigger; private RuleTrigger ruleTrigger;
@Autowired @Autowired
private JCSFeignClient jcsFeignClient; private JCSFeignClient jcsFeignClient;
public Boolean addPlanRule(Plan plan, List<String> userIds, String ruleType) throws Exception { public Boolean addPlanRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType); PlanRo planRo = buildPlanRo(plan, userIds, ruleType);
//触发规则 //触发规则
ruleTrigger.publish(planRo, packageId, new String[0]); ruleTrigger.publish(planRo, packageId, new String[0]);
return true; return true;
} }
public Boolean addPlanAuditRule(Plan plan, List<String> userIds, String ruleType, String excuteStateName) throws Exception { public Boolean addPlanAuditRule(Plan plan, List<String> userIds, RuleTypeEnum ruleType, String excuteStateName) throws Exception {
PlanRo planRo = buildPlanRo(plan, userIds, ruleType); PlanRo planRo = buildPlanRo(plan, userIds, ruleType);
planRo.setExcuteStateName(excuteStateName); planRo.setExcuteStateName(excuteStateName);
//触发规则 //触发规则
ruleTrigger.publish(planRo, packageId, new String[0]); ruleTrigger.publish(planRo, packageId, new String[0]);
return true; return true;
} }
private PlanRo buildPlanRo (Plan plan, List<String> userIds, String ruleType){ private PlanRo buildPlanRo(Plan plan, List<String> userIds, RuleTypeEnum ruleType) {
PlanRo planRo = new PlanRo(); PlanRo planRo = new PlanRo();
BeanUtils.copyProperties(plan, planRo); BeanUtils.copyProperties(plan, planRo);
planRo.setMsgType(msgType); planRo.setMsgType(msgType);
planRo.setRuleType(ruleType); planRo.setRuleType(ruleType.getCode());
planRo.setRelationId(String.valueOf(plan.getId())); planRo.setRelationId(String.valueOf(plan.getId()));
planRo.setTerminal(ruleType.getTerminal());
Map<String, String> map = new HashMap<>();
map.put("planId", String.valueOf(plan.getId()));
if (ValidationUtil.isEmpty(userIds)){ if (!ValidationUtil.isEmpty(ruleType.getUrl())){
String leadPeopleIds = plan.getLeadPeopleIds(); map.put("url", ruleType.getUrl());
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())){
leadPeopleIds += "," + plan.getUserId();
} }
userIds = (List<String>)jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
if (TerminalConstant.WEB.equals(ruleType.getTerminal())){
planRo.setIsSendWeb(true);
} else if (TerminalConstant.APP.equals(ruleType.getTerminal())){
planRo.setIsSendApp(true); planRo.setIsSendApp(true);
planRo.setTerminal(WEB); } else if (TerminalConstant.APP_WEB.equals(ruleType.getTerminal())){
} else {
planRo.setIsSendWeb(true); planRo.setIsSendWeb(true);
planRo.setIsSendApp(false); planRo.setIsSendApp(true);
planRo.setTerminal(APP_WEB); }
if (ValidationUtil.isEmpty(userIds)) {
String leadPeopleIds = plan.getLeadPeopleIds();
if (!ValidationUtil.isEmpty(plan.getUserId()) && !leadPeopleIds.contains(plan.getUserId())) {
leadPeopleIds += "," + plan.getUserId();
}
userIds = (List<String>) jcsFeignClient.getAmosIdListByUserIds(leadPeopleIds).getResult();
} }
planRo.setSendTime(DateUtil.date2LongStr(new Date())); planRo.setSendTime(DateUtil.date2LongStr(new Date()));
planRo.setRecivers(userIds); planRo.setRecivers(userIds);
planRo.setExtras(map);
return planRo; return planRo;
} }
} }
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONArray; import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
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.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutySeatDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService; import com.yeejoin.amos.boot.module.tzs.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.component.feign.config.TokenOperation;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors;
/** /**
* 特种设备权限服务实现类 * 特种设备权限服务实现类
...@@ -70,6 +39,22 @@ import java.util.stream.Collectors; ...@@ -70,6 +39,22 @@ import java.util.stream.Collectors;
@Service @Service
public class TzsAuthServiceImpl implements TzsAuthService { public class TzsAuthServiceImpl implements TzsAuthService {
@Autowired
RedisUtils redisUtils;
@Value("${cti.user.name}")
private String ctiUserName;
@Value("${cti.user.pwd}")
private String ctiUserPwd;
/**
* saveUserRedis设置过期时间
*/
@Value("${redis.cache.failure.time}")
private Long redisRegionTimeSecond;
@Override @Override
public List<String> getUserRegionCode() { public List<String> getUserRegionCode() {
...@@ -154,4 +139,86 @@ public class TzsAuthServiceImpl implements TzsAuthService { ...@@ -154,4 +139,86 @@ public class TzsAuthServiceImpl implements TzsAuthService {
} }
} }
private void loginCtiUser() {
String passwd = DesUtil.encode(ctiUserPwd, "qaz");
IdPasswordAuthModel loninData = new IdPasswordAuthModel();
loninData.setLoginId(ctiUserName);
loninData.setPassword(passwd);
FeignClientResult loginResult = Privilege.authClient.idpassword(loninData);
if(loginResult.getStatus() == 200) {
HashMap resultMap = (HashMap) loginResult.getResult();
redisUtils.set(RedisKey.CTI_USER_TOKEN, resultMap.get("token").toString(), redisRegionTimeSecond);
}
}
public void setRequestContext() {
// 需要登录后台账号
RequestContext.setAppKey("AMOS_STUDIO");
RequestContext.setProduct("AMOS_STUDIO_WEB");
if(redisUtils.hasKey(RedisKey.CTI_USER_TOKEN)) {
// 验证token
boolean validToken = TokenOperation.refresh(redisUtils.get(RedisKey.CTI_USER_TOKEN).toString());
if(!validToken) { // 登陆
this.loginCtiUser();
}
} else { // 登陆
this.loginCtiUser();
}
String ctiToken = redisUtils.get(RedisKey.CTI_USER_TOKEN).toString();
RequestContext.setToken(ctiToken);
try {
FeignClientResult<AgencyUserModel> agencyUserModel = Privilege.agencyUserClient.queryByUserName(ctiUserName);
AgencyUserModel userModel = agencyUserModel.getResult();
RequestContext.setExeUserId(userModel.getUserId());
if (userModel == null) {
throw new Exception("无法获取用户信息");
}
saveUserRedis(userModel, ctiToken);
} catch (Exception e) {
//删除失效token缓存
throw new RuntimeException(e.getMessage());
}
}
private void saveUserRedis(AgencyUserModel user, String token) {
String authToken = RedisKey.buildReginKey(user.getUserId(), token);
if (redisUtils.hasKey(authToken)) {
return;
}
CompanyBo company = new CompanyBo();
DepartmentBo department = new DepartmentBo();
RoleBo role = new RoleBo();
CompanyModel companyM = user.getCompanys() != null ? user.getCompanys().get(0) : null ;
Bean.copyExistPropertis(companyM, company);
Map<Long, List<DepartmentModel>> mapDepartments = user.getCompanyDepartments();
DepartmentModel departmentM = companyM != null ? mapDepartments.get(companyM.getSequenceNbr()).get(0) : null ;
Bean.copyExistPropertis(departmentM, department);
Map<Long, List<RoleModel>> roles = user.getOrgRoles();
Long sequenceNbr;
if (departmentM == null) {
sequenceNbr = null;
} else {
sequenceNbr = departmentM.getSequenceNbr();
}
RoleModel roleM = null;
if (sequenceNbr == null) {
roleM = companyM != null ?roles.get(companyM.getSequenceNbr()).get(0) : null;
} else {
roleM = roles.get(sequenceNbr).get(0);
}
Bean.copyExistPropertis(roleM, role);
ReginParams reginParams = new ReginParams();
reginParams.setCompany(company);
reginParams.setRole(role);
reginParams.setDepartment(department);
reginParams.setUserModel(user);
redisUtils.set(authToken, JSONObject.toJSONString(reginParams), redisRegionTimeSecond);
}
} }
\ No newline at end of file
...@@ -73,22 +73,13 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -73,22 +73,13 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
@Autowired @Autowired
private VoiceRecordFileServiceImpl voiceRecordFileServiceImpl; private VoiceRecordFileServiceImpl voiceRecordFileServiceImpl;
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
@Scheduled(fixedDelay=ONE_Minute) @Scheduled(fixedDelay=ONE_Minute)
public void fixedDelayJob(){ public void fixedDelayJob(){
// 需要登录后台账号 // 设置token
RequestContext.setAppKey("AMOS_STUDIO"); tzsAuthServiceImpl.setRequestContext();
RequestContext.setProduct("AMOS_STUDIO_WEB");
if(redisUtils.hasKey(RedisKey.CTI_USER_TOKEN)) {
// 验证token
boolean validToken = TokenOperation.refresh(redisUtils.get(RedisKey.CTI_USER_TOKEN).toString());
if(!validToken) { // 登陆
loginCtiUser();
}
} else { // 登陆
loginCtiUser();
}
String ctiToken = redisUtils.get(RedisKey.CTI_USER_TOKEN).toString();
RequestContext.setToken(ctiToken);
// 首先查找未完成 且失败次数少于5 的 记录 // 首先查找未完成 且失败次数少于5 的 记录
List<VoiceRecordLog> logList = this.list(new LambdaQueryWrapper<VoiceRecordLog>().eq(VoiceRecordLog::getIsDeal,false).lt(VoiceRecordLog::getDealTimes,5)); List<VoiceRecordLog> logList = this.list(new LambdaQueryWrapper<VoiceRecordLog>().eq(VoiceRecordLog::getIsDeal,false).lt(VoiceRecordLog::getDealTimes,5));
if(logList != null && logList.size() >0) { if(logList != null && logList.size() >0) {
...@@ -176,17 +167,6 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -176,17 +167,6 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
} }
private void loginCtiUser() {
String passwd = DesUtil.encode(ctiUserPwd, "qaz");
IdPasswordAuthModel loninData = new IdPasswordAuthModel();
loninData.setLoginId(ctiUserName);
loninData.setPassword(passwd);
FeignClientResult loginResult = Privilege.authClient.idpassword(loninData);
if(loginResult.getStatus() == 200) {
HashMap resultMap = (HashMap) loginResult.getResult();
redisUtils.set(RedisKey.CTI_USER_TOKEN, resultMap.get("token").toString(), 25920000l);
}
}
......
...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto; ...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto; import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator; import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit; import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -237,4 +239,38 @@ public class BeanDtoVoUtils { ...@@ -237,4 +239,38 @@ public class BeanDtoVoUtils {
} }
}); });
} }
/**
* 将企业注册实体类转换为Vo
*
* @param page 原分页对象
* @return 转换后的分页对象
*/
public static IPage<UnitInfoDto> unitInfoIPageDto(IPage<UnitInfo> page) {
return page.convert(item -> {
try {
UnitInfoDto target = new UnitInfoDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(item, target);
if(item.getIsChange()) {
target.setTypeStr("变更");
} else {
target.setTypeStr("注册");
}
if(0 == item.getUnitStatus()) {
target.setStatusStr("审批中");
} else if(1 == item.getUnitStatus()) {
target.setStatusStr("审批结束");
} else if(2 == item.getUnitStatus()) {
target.setStatusStr("已驳回");
}
target.setFullAddress(item.getProvince() + item.getCity() + item.getDistrict() + item.getStree() + item.getCommunity() + item.getAddress());
return target;
} catch (Exception e) {
return null;
}
});
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller; package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
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.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoApproveServiceImpl; import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoApproveServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -66,19 +73,6 @@ public class UnitInfoApproveController extends BaseController { ...@@ -66,19 +73,6 @@ public class UnitInfoApproveController extends BaseController {
} }
/** /**
* 根据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(unitInfoApproveServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询 * 根据sequenceNbr查询
* *
* @param sequenceNbr 主键 * @param sequenceNbr 主键
...@@ -109,15 +103,6 @@ public class UnitInfoApproveController extends BaseController { ...@@ -109,15 +103,6 @@ public class UnitInfoApproveController extends BaseController {
return ResponseHelper.buildResponse(unitInfoApproveServiceImpl.queryForFlcUnitInfoApprovePage(page)); return ResponseHelper.buildResponse(unitInfoApproveServiceImpl.queryForFlcUnitInfoApprovePage(page));
} }
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "企业信息审批意见表列表全部数据查询", notes = "企业信息审批意见表列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<UnitInfoApproveDto>> selectForList() {
return ResponseHelper.buildResponse(unitInfoApproveServiceImpl.queryForFlcUnitInfoApproveList());
}
} }
package com.yeejoin.amos.boot.module.tzs.flc.biz.controller; package com.yeejoin.amos.boot.module.tzs.flc.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import org.springframework.web.bind.annotation.RequestMapping; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import io.swagger.annotations.ApiOperation; import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import org.springframework.web.multipart.MultipartFile;
import java.util.List; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl.UnitInfoServiceImpl; 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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import java.util.Collection;
import org.springframework.web.bind.annotation.*; import java.util.HashMap;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import java.util.Iterator;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import java.util.Map;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import java.util.Random;
/** /**
* 企业信息表 * 企业信息表
...@@ -29,46 +58,183 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -29,46 +58,183 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
public class UnitInfoController extends BaseController { public class UnitInfoController extends BaseController {
@Autowired @Autowired
RedisUtils redisUtils;
/**
* token 过期时间,wechat 系统为7200 ,tzs 系统小于7200 防止获取到无效token
*/
private long time = 600l;
@Autowired
UnitInfoServiceImpl unitInfoServiceImpl; UnitInfoServiceImpl unitInfoServiceImpl;
@Value("${flc.sms.tempCode}")
private String smsTempCode;
@Autowired
private TzsAuthServiceImpl tzsAuthServiceImpl;
/** /**
* 新增企业信息表 * 获取组织机构树
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save") @GetMapping(value = "/region/tree")
@ApiOperation(httpMethod = "POST", value = "新增企业信息表", notes = "新增企业信息表") @ApiOperation(httpMethod = "GET", value = "获取组织机构树", notes = "获取组织机构树")
public ResponseModel<UnitInfoDto> save(@RequestBody UnitInfoDto model) { public ResponseModel<Collection<RegionModel>> getRegionTree(@RequestParam(value = "parentId",required = false) Long parentId) {
model = unitInfoServiceImpl.createWithModel(model); tzsAuthServiceImpl.setRequestContext();
return ResponseHelper.buildResponse(model); Collection<RegionModel> result = null;
if(parentId == null) {
result = Systemctl.regionClient.queryForTree(null).getResult();
} else {
result = Systemctl.regionClient.querySubAgencyTree(parentId).getResult();
}
return ResponseHelper.buildResponse(result);
} }
/** /**
* 根据sequenceNbr更新 * 获取管辖单位树
* *
* @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @GetMapping(value = "/managerment/tree")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新企业信息表", notes = "根据sequenceNbr更新企业信息表") @ApiOperation(httpMethod = "GET", value = "获取管辖单位树", notes = "获取管辖单位树")
public ResponseModel<UnitInfoDto> updateBySequenceNbrFlcUnitInfo(@RequestBody UnitInfoDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<Collection<CompanyModel>> getManagermentTree() {
model.setSequenceNbr(sequenceNbr); Collection<CompanyModel> result = null;
return ResponseHelper.buildResponse(unitInfoServiceImpl.updateWithModel(model)); result = Privilege.companyClient.companyTreeWithoutAuth().getResult();
return ResponseHelper.buildResponse(result);
} }
/** /**
* 根据sequenceNbr删除 * 企业信息图片上传 无token
* *
* @param sequenceNbr 主键
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @PostMapping(value = "/uploadFile")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除企业信息表", notes = "根据sequenceNbr删除企业信息表") @ApiOperation(httpMethod = "POST", value = "企业信息图片上传 无token", notes = "企业信息图片上传 无token")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<String> uploadFile(@ApiParam(value = "文件", required = true)@RequestParam MultipartFile file) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.removeById(sequenceNbr)); if (ValidationUtil.isEmpty(file)){
throw new BadRequest("参数校验失败.");
}
tzsAuthServiceImpl.setRequestContext();
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(file);
String urlString="";
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
urlString=it.next();
}
}
return ResponseHelper.buildResponse(urlString);
}
/**
* 判断组织机构是否存在
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistUnit/{organizationCode}")
@ApiOperation(httpMethod = "GET", value = "判断组织机构是否存在", notes = "判断组织机构是否存在")
public ResponseModel<Boolean> hasExistUnit( @PathVariable(value = "organizationCode") String organizationCode) {
Boolean flag = false;
UnitInfo temp = unitInfoServiceImpl.getOne(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getIsDelete,false).eq(UnitInfo::getOrganizationCode,organizationCode));
if(temp != null) {
flag = true;
}
return ResponseHelper.buildResponse(flag);
}
/**
* 判断用户是否存在
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/hasExistUser/{userName}")
@ApiOperation(httpMethod = "GET", value = "判断用户是否存在", notes = "判断用户是否存在")
public ResponseModel<Boolean> hasExistUser( @PathVariable(value = "userName") String userName) {
Boolean flag = false;
AgencyUserModel user = Privilege.agencyUserClient.queryByUserName(userName).getResult();
if(user != null ) {
flag = true;
}
return ResponseHelper.buildResponse(flag);
}
/**
* 发送手机号验证码
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/sendTelCode/{tel}")
@ApiOperation(httpMethod = "GET", value = "发送手机号验证码", notes = "发送手机号验证码")
public ResponseModel<Boolean> sendTelCode( @PathVariable(value = "tel") String tel) {
if (ValidationUtil.isEmpty(tel)) {
throw new BadRequest("参数校验失败.");
}
Boolean flag = false;
HashMap<String, String> params = new HashMap<>();
String code = this.getRandomCode();
params.put("code",code);
params.put("mobile",tel);
params.put("smsCode", smsTempCode);
try {
Systemctl.smsClient.sendCommonSms(params).getResult();
flag = true;
} catch (Exception e) {
throw new BadRequest("发送短信失败:" + e.getMessage());
}
// code 保存到缓存中
redisUtils.set(RedisKey.FLC_USER_TEL + tel, code,time);
return ResponseHelper.buildResponse(flag);
}
/**
* 验证手机号验证码是否成功
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/verifyTelCode/{tel}/{code}")
@ApiOperation(httpMethod = "GET", value = "验证手机号验证码是否成功", notes = "验证手机号验证码是否成功")
public ResponseModel<Boolean> verifyTelCode(@PathVariable(value = "tel") String tel, @PathVariable(value = "code") String code) {
Boolean flag = false;
if (ValidationUtil.isEmpty(tel) || ValidationUtil.isEmpty(code)) {
throw new BadRequest("参数校验失败.");
}
if(redisUtils.hasKey(RedisKey.FLC_USER_TEL + tel)) {
String redisCode = redisUtils.get(RedisKey.FLC_USER_TEL + tel).toString();
if(code.equals(redisCode)) {
flag = true;
}
}
return ResponseHelper.buildResponse(flag);
}
/**
* 新增企业信息表
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增企业信息表", notes = "新增企业信息表")
public ResponseModel<UnitInfoDto> save(@RequestBody UnitInfoDto model) {
model = unitInfoServiceImpl.saveUnitInfo(model);
return ResponseHelper.buildResponse(model);
} }
/** /**
...@@ -81,36 +247,135 @@ public class UnitInfoController extends BaseController { ...@@ -81,36 +247,135 @@ public class UnitInfoController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个企业信息表", notes = "根据sequenceNbr查询单个企业信息表") @ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个企业信息表", notes = "根据sequenceNbr查询单个企业信息表")
public ResponseModel<UnitInfoDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<UnitInfoDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.queryBySeq(sequenceNbr)); if (ValidationUtil.isEmpty(sequenceNbr) ) {
throw new BadRequest("参数校验失败.");
} }
return ResponseHelper.buildResponse(unitInfoServiceImpl.getDtoById(sequenceNbr));
}
/** /**
* 列表分页查询 * 列表分页查询
* *
* @param current 当前页 * @param pageNum 当前页
* @param current 每页大小 * @param pageSize 每页大小
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET",value = "企业信息表分页查询", notes = "企业信息表分页查询") @ApiOperation(httpMethod = "GET", value = "企业审核列表查询", notes = "企业审核列表查询")
public ResponseModel<Page<UnitInfoDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<IPage<UnitInfoDto>> queryForPage(String pageNum, String pageSize, String sort, UnitInfoDto unitInfoDto) {
(value = "size") int size) { // UnitInfo unitInfo = BeanDtoVoUtils.convert(unitInfoDto, UnitInfo.class);
Page<UnitInfoDto> page = new Page<UnitInfoDto>(); Page<UnitInfo> pageBean;
page.setCurrent(current); IPage<UnitInfo> page;
page.setSize(size); QueryWrapper<UnitInfo> unitInfoQueryWrapper = new QueryWrapper<UnitInfo>();
return ResponseHelper.buildResponse(unitInfoServiceImpl.queryForFlcUnitInfoPage(page));
setQueryWrapper(unitInfoQueryWrapper, unitInfoDto, sort);
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
} else {
pageBean = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
}
page = unitInfoServiceImpl.page(pageBean, unitInfoQueryWrapper);
int num= unitInfoServiceImpl.count(unitInfoQueryWrapper);
pageBean.setTotal(num);
IPage<UnitInfoDto> unitInfoVoIPage = BeanDtoVoUtils.unitInfoIPageDto(page);
return ResponseHelper.buildResponse(unitInfoVoIPage);
}
private QueryWrapper<UnitInfo> setQueryWrapper(QueryWrapper<UnitInfo> queryWrapper, UnitInfoDto unitInfoDto,String sort) {
queryWrapper.eq("is_delete", false);
if(sort!=null) { // 排序失效
String[] date= sort.split(",");
if(date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
}else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
}
}else {
queryWrapper.orderByDesc("submit_time");
}
if (!ValidationUtil.isEmpty(unitInfoDto.getIsChange())) { // 分类 注册 / 信息变更 0 注册 1 变更
queryWrapper.eq("is_change",unitInfoDto.getIsChange());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getSubmitTimeStart())) { // 提交时间
queryWrapper.ge("submit_time",unitInfoDto.getSubmitTimeStart());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getSubmitTimeEnd())) { // 提交时间
queryWrapper.le("submit_time",unitInfoDto.getSubmitTimeEnd());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getUnitTypeCode())) { // 单位类型
queryWrapper.like("unit_type_code",unitInfoDto.getUnitTypeCode());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getOrgName())) { // 单位名称
queryWrapper.like("org_name",unitInfoDto.getOrgName());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getOrganizationCode())) { // 组织机构代码/统一信用代码
queryWrapper.like("organization_code",unitInfoDto.getOrganizationCode());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getAdminName())) { // 管理员
queryWrapper.like("admin_name",unitInfoDto.getAdminName());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getAdminTel())) { // 管理员电话
queryWrapper.like("admin_tel",unitInfoDto.getAdminTel());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getUnitStatus())) { // 审核状态
queryWrapper.like("unit_status",unitInfoDto.getUnitStatus());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getLegalPerson())) { // 法人
queryWrapper.like("legal_person",unitInfoDto.getLegalPerson());
}
if(!ValidationUtil.isEmpty(unitInfoDto.getLegalPersonTel())) { // 法人电话
queryWrapper.like("legal_person_tel",unitInfoDto.getLegalPersonTel());
}
return queryWrapper;
}
private String getRandomCode(){
String code = "";
Random random = new Random();
for (int i = 0; i < 6; i++) {
int r = random.nextInt(10); //每次随机出一个数字(0-9)
code = code + r; //把每次随机出的数字拼在一起
} }
return code;
}
/** /**
* 列表全部数据查询 * 审批企业注册
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "企业信息表列表全部数据查询", notes = "企业信息表列表全部数据查询") @PostMapping(value = "/approve")
@GetMapping(value = "/list") @ApiOperation(httpMethod = "POST", value = "审批企业注册", notes = "审批企业注册")
public ResponseModel<List<UnitInfoDto>> selectForList() { public ResponseModel<UnitInfoDto> approve(@RequestBody UnitInfoApproveDto approveDto) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.queryForFlcUnitInfoList()); if (ValidationUtil.isEmpty(approveDto.getUnitId()) || ValidationUtil.isEmpty(approveDto.getApproveStatus())) {
throw new BadRequest("参数校验失败.");
}
UnitInfoDto model = unitInfoServiceImpl.approve(approveDto);
return ResponseHelper.buildResponse(model);
} }
} }
package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.flc.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.tzs.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzsAuthServiceImpl;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoApproveDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto; import com.yeejoin.amos.boot.module.tzs.flc.api.dto.UnitInfoDto;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo; import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfoChange;
import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitInfoMapper; import com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitInfoMapper;
import com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService; import com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.privilege.util.DesUtil;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* 企业信息表服务实现类 * 企业信息表服务实现类
...@@ -18,17 +55,333 @@ import java.util.List; ...@@ -18,17 +55,333 @@ import java.util.List;
*/ */
@Service @Service
public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, UnitInfoMapper> implements IUnitInfoService { public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, UnitInfoMapper> implements IUnitInfoService {
/**
* 分页查询 private final Logger logger = LogManager.getLogger(UnitInfoServiceImpl.class);
*/
public Page<UnitInfoDto> queryForFlcUnitInfoPage(Page<UnitInfoDto> page) { @Autowired
return this.queryForPage(page, null, false); private TzsAuthServiceImpl tzsAuthServiceImpl;
@Autowired
ISourceFileService ISourceFileService;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
UnitInfoChangeServiceImpl iUnitInfoChangeServiceImpl;
@Autowired
UnitInfoApproveServiceImpl iUnitInfoApproveServiceImpl;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Autowired
UnitInfoChangeServiceImpl unitInfoChangeServiceImpl;
@Autowired
SourceFileServiceImpl sourceFileService;
@Transactional
public UnitInfoDto saveUnitInfo(UnitInfoDto model) {
tzsAuthServiceImpl.setRequestContext();
model.setUnitStatus(0);// 设置为待审核状态
model.setSubmitTime(new Date()); // 提交时间
model.setIsChange(false);// 新增状态不是变更状态
// 处理单位类型
String unitTypeCode = model.getUnitTypeCode();
String[] unitTypeCodes = unitTypeCode.split(",");
String unitType = "";
for(String t : unitTypeCodes) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.UNIT_TYPE).eq(DataDictionary::getCode, t);
DataDictionary temp = iDataDictionaryService.getOne(queryWrapper);
unitType += "," + temp.getName();
}
if(unitType.length() > 0) {
unitType = unitType.substring(1);
model.setUnitType(unitType);
} }
/** // 处理密码信息
* 列表查询 示例 String oldPwd = model.getAdminLoginPwd();
*/ String newPwd = DesUtil.encode(oldPwd, "qaz");
public List<UnitInfoDto> queryForFlcUnitInfoList() { model.setAdminLoginPwd(newPwd);
return this.queryForList("", false); UnitInfo entity = this.prepareEntity(model);
if(this.save(entity)) {
// 处理图片信息
Map<String, List<AttachmentDto>> resultPicMap = new HashMap<>();
resultPicMap.put(TzsCommonParam.LICENCE_PIC,model.getLicencePic());
resultPicMap.put(TzsCommonParam.ADMIN_LICENSE_PIC,model.getAdminLicensePic());
ISourceFileService.saveAttachments(entity.getSequenceNbr(),resultPicMap);
}
return Bean.toModel(entity, model);
}
@Transactional
@Override
public UnitInfoDto approve(UnitInfoApproveDto approveDto) {
UnitInfoDto result = null;
// 如果不存在审批意见 则 默认 通过 / 驳回
// 通过unitid 查找企业信息表 如果不存在则查找 变更表 都不存在返回未找到企业审核表单
String content = approveDto.getContent(); // 审批意见
UnitInfo sourceUnit = this.getById(approveDto.getUnitId());
UnitInfoChange changeUnit = null;
if(sourceUnit == null) {
changeUnit = iUnitInfoChangeServiceImpl.getById(approveDto.getUnitId());
if(changeUnit == null) {
throw new BadRequest("未找到企业审核表单.");
}
sourceUnit = this.getById(changeUnit.getSourceId());
}
if(sourceUnit.getUnitStatus() != 0) { // 无论变更单还是新建单 原始单状态都应该为审核中
throw new BadRequest("表单未处于审核状态中.请确认后操作");
}
Integer approveStatus = approveDto.getApproveStatus(); // 0通过 1驳回
Boolean changeFlag = false;
if(changeUnit != null) {
changeFlag = true;
approveDto.setUnitId(changeUnit.getSequenceNbr());
approveDto.setApproveType(1); // 0 注册审批 1 变更审批
} else {
approveDto.setApproveType(0); // 0 注册审批 1 变更审批
}
approveDto.setSourceId(sourceUnit.getSequenceNbr());
if(0 == approveStatus) {
// 审核通过生成二维码
this.saveUnitInfoQrCode(sourceUnit);
if(StringUtils.isEmpty(content)) {
content = "通过";
}
sourceUnit.setUnitStatus(1);
if(changeFlag) { // 如果是变更单 需要把 变更数据覆盖到原单子 预留(确定字段)
} else { // 如果是审批单 创建用户 创建组织机构 赋权等
sourceUnit.setApprovedTime(new Date());
// 创建用户 创建组织机构 平台组织机构及 org_user表中 赋权
String adminUserName = sourceUnit.getAdminName();
String loginName = sourceUnit.getAdminLoginName();
String pwd = sourceUnit.getAdminLoginPwd();
String adminTel = sourceUnit.getAdminTel();
CompanyModel companyInfo = new CompanyModel();
companyInfo.setAddress(sourceUnit.getProvince() + sourceUnit.getCity() + sourceUnit.getDistrict() + sourceUnit.getStree() + sourceUnit.getCommunity() + sourceUnit.getAddress());
companyInfo.setAgencyCode("tzs");
companyInfo.setParentId(sourceUnit.getManagementUnitId());
companyInfo.setLevel("headquarter");
companyInfo.setCompanyName(sourceUnit.getOrgName());
companyInfo.setContact(sourceUnit.getUnitTel());
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.create(companyInfo);
if(companyResult == null || companyResult.getResult() == null) {
throw new BadRequest("单位注册失败");
}
companyInfo = companyResult.getResult();
AgencyUserModel agencyUserModel = new AgencyUserModel();
agencyUserModel.setUserName(loginName);
agencyUserModel.setRealName(adminUserName);
agencyUserModel.setLockStatus("UNLOCK");
agencyUserModel.setPassword(pwd);
agencyUserModel.setRePassword(pwd);
agencyUserModel.setAgencyCode("tzs");
agencyUserModel.setMobile(adminTel);
// 根据unitTypeCode 获取应用和 角色
String unitTypeCode = sourceUnit.getUnitTypeCode();
String[] unitTypeCodes = unitTypeCode.split(",");
Set<String> roleNameSet = new HashSet<>();
Set<String> appCodesSet = new HashSet<>();
Map<Long, List<Long>> roleSeqsMap = new HashMap<>();
for(String code : unitTypeCodes) {
DataDictionary unitType = iDataDictionaryService.getOne(new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getCode,code));
String appCode = unitType.getTypeDesc();
String[] appCodes = appCode.split(",");
for(String tempCode : appCodes) {
appCodesSet.add(tempCode);
}
roleNameSet.add(unitType.getName());
}
List<RoleModel> userRoleList = new ArrayList<>();
// 全部角色筛选
// 获取角色
FeignClientResult<List<RoleModel>> roleListResult = Privilege.roleClient.queryRoleList(null,null);
List<RoleModel> allRoleList = roleListResult.getResult();
allRoleList.stream().forEach(t -> {
if(roleNameSet.contains(t.getRoleName())) {
userRoleList.add(t);
}
});
List<Long> roleIds = new ArrayList<>();
userRoleList.stream().forEach(r -> {
roleIds.add(r.getSequenceNbr());
});
roleSeqsMap.put(companyInfo.getSequenceNbr(),roleIds);
List<String> appCodes = new ArrayList<>(appCodesSet);
agencyUserModel.setAppCodes(appCodes);
Map<Long, List<RoleModel>> orgRoles = new HashMap<>();
orgRoles.put(companyInfo.getSequenceNbr(),userRoleList);
agencyUserModel.setOrgRoles(orgRoles);
agencyUserModel.setOrgRoleSeqs(roleSeqsMap);
FeignClientResult<AgencyUserModel> userResult = Privilege.agencyUserClient.create(agencyUserModel);
if(userResult == null || userResult.getResult() == null) {
throw new BadRequest("注册失败");
}
// org_user 创建组织机构
OrgUsr org = new OrgUsr();
TreeParser.genTreeCode();
org.setBizOrgCode(TreeParser.genTreeCode());
org.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
org.setBizOrgName(sourceUnit.getOrgName());
org.setRecDate(new Date());
org.setRecUserId(userResult.getResult().getUserId());
org.setRecUserName(userResult.getResult().getUserName());
org.setAmosOrgId(companyInfo.getSequenceNbr()+"");
org.setAmosOrgCode(companyInfo.getOrgCode());
if(!iOrgUsrService.save(org)) {
throw new BadRequest("org单位注册失败");
}
sourceUnit.setOrgUserId(org.getSequenceNbr());
}
} else if(1 == approveStatus) {
if(StringUtils.isEmpty(content)) {
content = "驳回";
}
sourceUnit.setUnitStatus(2);
}
approveDto.setContent(content);
iUnitInfoApproveServiceImpl.createWithModel(approveDto);
if(this.updateById(sourceUnit)) {
if(changeFlag && 1 == approveStatus) { // 变更不通过返回变更表数据 其他情况返回原数据
result = unitChangeInfoToDto(changeUnit);
} else {
result = unitInfoToDto(sourceUnit);
}
}
return result;
}
@Override
public UnitInfoDto getDtoById(Long sequenceNbr) {
UnitInfo unitInfo = this.getById(sequenceNbr);
UnitInfoDto result = null;
// 如果是变更单 同时为 审批中,默认展示变更表中最新数据
if(unitInfo.getIsChange() && unitInfo.getUnitStatus() == 0) {
List<UnitInfoChange> changeList = unitInfoChangeServiceImpl.list(new LambdaQueryWrapper<UnitInfoChange>().eq(UnitInfoChange::getIsDelete,false).eq(UnitInfoChange::getSourceId,sequenceNbr).orderByDesc(UnitInfoChange::getRecDate));
UnitInfoChange temp = changeList.get(0);
result = unitChangeInfoToDto(temp);
} else {
result = unitInfoToDto(unitInfo);
}
return result;
}
private UnitInfoDto unitInfoToDto(UnitInfo source) {
UnitInfoDto target = new UnitInfoDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(source, target);
if(source.getIsChange()) {
target.setTypeStr("变更");
} else {
target.setTypeStr("注册");
}
if(0 == source.getUnitStatus()) {
target.setStatusStr("审批中");
} else if(1 == source.getUnitStatus()) {
target.setStatusStr("审批结束");
} else if(2 == source.getUnitStatus()) {
target.setStatusStr("已驳回");
}
Map<String, List<AttachmentDto>> attachmentMap = sourceFileService.getAttachments(source.getSequenceNbr());
// 获取企业二维码
if(attachmentMap != null) {
if(attachmentMap.get(TzsCommonParam.QR_CODE) != null) {
target.setQrcode(attachmentMap.get(TzsCommonParam.QR_CODE));
}
if(attachmentMap.get(TzsCommonParam.LICENCE_PIC) != null) {
target.setLicencePic(attachmentMap.get(TzsCommonParam.LICENCE_PIC));
}
if(attachmentMap.get(TzsCommonParam.ADMIN_LICENSE_PIC) != null) {
target.setAdminLicensePic(attachmentMap.get(TzsCommonParam.ADMIN_LICENSE_PIC));
}
}
target.setFullAddress(source.getProvince() + source.getCity() + source.getDistrict() + source.getStree() + source.getCommunity() + source.getAddress());
return target;
}
private UnitInfoDto unitChangeInfoToDto(UnitInfoChange source) {
UnitInfoDto target = new UnitInfoDto();
// 把原对象数据拷贝到新对象
BeanUtils.copyProperties(source, target);
if(0 == source.getUnitStatus()) {
target.setStatusStr("审批中");
} else if(1 == source.getUnitStatus()) {
target.setStatusStr("审批结束");
} else if(2 == source.getUnitStatus()) {
target.setStatusStr("已驳回");
}
Map<String, List<AttachmentDto>> attachmentMap = sourceFileService.getAttachments(source.getSourceId());
// 获取附件信息
if(attachmentMap != null) {
if(attachmentMap.get(TzsCommonParam.QR_CODE) != null) {
target.setQrcode(attachmentMap.get(TzsCommonParam.QR_CODE));
}
if(attachmentMap.get(TzsCommonParam.LICENCE_PIC) != null) {
target.setLicencePic(attachmentMap.get(TzsCommonParam.LICENCE_PIC));
}
if(attachmentMap.get(TzsCommonParam.ADMIN_LICENSE_PIC) != null) {
target.setAdminLicensePic(attachmentMap.get(TzsCommonParam.ADMIN_LICENSE_PIC));
}
}
target.setFullAddress(source.getProvince() + source.getCity() + source.getDistrict() + source.getStree() + source.getCommunity() + source.getAddress());
return target;
}
private String saveUnitInfoQrCode( UnitInfo sourceUnit) {
// 二维码生成规则
String qrString = "企业统一信用代码: " +sourceUnit.getOrganizationCode() +"\n\r";
qrString += "管理人: " +sourceUnit.getAdminName() +"\n\r";
qrString += "管理人电话: " +sourceUnit.getAdminTel() +"\n\r";
byte[] bytes = QRCodeUtil.generateQRCodeImageByteData(qrString, 480);
MultipartFile file = new MockMultipartFile("unitInfo_" + sourceUnit.getSequenceNbr() + ".png","unitInfo_" + sourceUnit.getSequenceNbr() + ".png","application/octet-stream" ,bytes);
FeignClientResult<Map<String, String>> result = Systemctl.fileStorageClient.updateCommonFile(file);
Map<String, String> map = result.getResult();
if(map.isEmpty()) {
logger.error("未生成二维码文件");
throw new BadRequest("未生成二维码文件");
}
String filePath = "";
for(Map.Entry<String,String> fileResult : map.entrySet()) {
filePath = fileResult.getKey();
}
// 保存qrCode
List<AttachmentDto> qrCode = new ArrayList<>();
AttachmentDto temp = new AttachmentDto();
temp.setName("unitInfo_" + sourceUnit.getSequenceNbr() + ".png");
temp.setType("image");
temp.setUrl(filePath);
qrCode.add(temp);
Map<String, List<AttachmentDto>> attachmentMap = new HashMap<>();
attachmentMap.put(TzsCommonParam.QR_CODE,qrCode);
sourceFileService.saveAttachments(sourceUnit.getSequenceNbr(),attachmentMap);
return filePath;
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!--日志文件输出的文件名--> <!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/jcs.log.%d{yyyy-MM-dd}.log</FileNamePattern> <FileNamePattern>${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log</FileNamePattern>
<!--日志文件保留天数--> <!--日志文件保留天数-->
<MaxHistory>7</MaxHistory> <MaxHistory>7</MaxHistory>
</rollingPolicy> </rollingPolicy>
......
...@@ -2139,10 +2139,84 @@ ...@@ -2139,10 +2139,84 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenzhao" id="2021-11-15-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column"/>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_column"/>
</preConditions>
<comment>update data cb_data_dictionary</comment>
<sql>
INSERT INTO `cb_dynamic_form_column`(`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (132828674812085, 'dutyArea', '值班区域', 'input', 132828674816, 'like', b'0', b'0', 'dutyFirstAid', NULL, NULL, NULL, '2021-11-15 10:33:18', b'0', NULL, NULL, NULL);
INSERT INTO `cb_dynamic_form_column`(`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (132828674812086, 'dutyAreaId', '值班区域Id', 'input', 132828674816, 'eq', b'0', b'0', 'dutyFirstAid', NULL, NULL, NULL, '2021-11-15 10:33:18', b'0', NULL, NULL, NULL);
</sql>
</changeSet>
<changeSet author="chenzhao" id="2021-11-16-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column"/>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_column"/>
</preConditions>
<comment>insert data cb_dynamic_form_column</comment>
<sql>
INSERT INTO `cb_dynamic_form_column`(`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (132828674812087, 'dutyArea', '值班区域', 'input', 132828674815, 'like', b'0', b'0', 'dutyFireFighting', NULL, NULL, NULL, '2021-11-16 10:33:18', b'0', NULL, NULL, NULL);
INSERT INTO `cb_dynamic_form_column`(`sequence_nbr`, `field_code`, `field_name`, `field_type`, `group_id`, `query_strategy`, `not_null`, `block`, `group_code`, `column_config`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `remark`, `sort`, `org_code`) VALUES (132828674812088, 'dutyAreaId', '值班区域Id', 'input', 132828674815, 'eq', b'0', b'0', 'dutyFireFighting', NULL, NULL, NULL, '2021-11-16 10:33:18', b'0', NULL, NULL, NULL);
</sql>
</changeSet>
<changeSet author="litw" id="2021-11-15-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_template"/>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="jc_template"/>
</preConditions>
<comment>insert data jc_template</comment>
<sql>
INSERT INTO `jc_template` (sequence_nbr, type_code, `type`, content, format, rec_user_name, rec_user_id, rec_date, is_delete) VALUES(26, 'LLDP', '力量调派统一模板', '【力量调派】调派departmentName content 赶往rescueGrid 位置。responseLevel 联系人: contactUser 联系电话: contactPhone 相关警情:【type】时间:callTime replaceContent', 0, NULL, NULL, NULL, 0);
</sql>
</changeSet>
<changeSet author="litengwei" id="2021-11-17-litengwei-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_template" />
</preConditions>
<comment>update data jc_template</comment>
<sql>
update
`jc_template` jc
set
content = '<![CDATA[<p>【警情续报】<span contenteditable="true" data-name="editContent" data-type="input"></span><p>相关警情:时间:$callTime 地点: $address 发生$type 警情 $replaceContent 被困人数:<span contenteditable="true" data-name="trappedNum" data-type="input"></span>;伤亡人数:<span contenteditable="true" data-name="casualtiesNum" data-type="input"></span>;<p>发送单位:<span contentEditable data-name="companyName" data-type="input"></span></p> ]]>'
where jc.type_code = '313'
</sql>
</changeSet>
<changeSet author="litengwei" id="2021-11-17-litengwei-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_template" />
</preConditions>
<comment>update data jc_template</comment>
<sql>
update
jc_template jc
set
content = '<![CDATA[<p>【非警情确认】根据现场反馈信息、视频监控信息和消防物联监控信息,判断 【时间:$callTime 地点: $address 发生$type 警情 $replaceContent ;被困人数:<span contenteditable="true" data-name="trappedNum" data-type="input"></span>;伤亡人数:<span contenteditable="true" data-name="casualtiesNum" data-type="input"></span>; 】 为非警情,请个单位、部门尽快 进行恢复到日常执勤状态。</p><p>发送单位:<span contenteditable="true" data-name="companyName" data-type="input"></span></p>]]>'
where
jc.type_code = '314'
</sql>
</changeSet>
<changeSet author="litengwei" id="2021-11-17-litengwei-3">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_template" />
</preConditions>
<comment>update data jc_template</comment>
<sql>
update
jc_template jc
set
content = '<![CDATA[<p>【警情结案】当前警情已于<span contenteditable="true" data-name="recDate" data-type="input"></span> 当前警情已经结案。</p>相关警情:时间:$callTime 地点: $address 发生$type 警情 $replaceContent;被困人数:<span contenteditable="true" data-name="trappedNum" data-type="input"></span>;伤亡人数:<span contenteditable="true" data-name="casualtiesNum" data-type="input"></span>;<p>发送单位:<span contentEditable data-name="companyName" data-type="input"></span></p>]]>'
where
jc.type_code = '315'
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'巡检地点:', '巡检地点:',
'address', pp.address,
'<br />点编号:', '<br />点编号:',
pp.point_no, pp.point_no,
'<br />当前状态:', '<br />当前状态:',
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
) ]]> saveMsg, ) ]]> saveMsg,
CONCAT( CONCAT(
'巡检地点:', '巡检地点:',
'address', pp.address,
';点编号:', ';点编号:',
pp.point_no, pp.point_no,
';当前状态:', ';当前状态:',
......
...@@ -54,3 +54,6 @@ redis.cache.failure.time=10800 ...@@ -54,3 +54,6 @@ redis.cache.failure.time=10800
rule.definition.load=false rule.definition.load=false
rule.definition.model-package=com.yeejoin.amos.patrol.business.entity.mybatis rule.definition.model-package=com.yeejoin.amos.patrol.business.entity.mybatis
rule.definition.default-agency=STATE_GRID rule.definition.default-agency=STATE_GRID
jcs.fegin.name=JCS-tb
emergency.command.section.id=1418223840361709569
\ No newline at end of file
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'巡检地点:', '巡检地点:',
'address', pp.address,
'<br />点编号:', '<br />点编号:',
pp.point_no, pp.point_no,
'<br />当前状态:', '<br />当前状态:',
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
) ]]> saveMsg, ) ]]> saveMsg,
CONCAT( CONCAT(
'巡检地点:', '巡检地点:',
'address', pp.address,
';点编号:', ';点编号:',
pp.point_no, pp.point_no,
';当前状态:', ';当前状态:',
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
<![CDATA[ <![CDATA[
CONCAT( CONCAT(
'巡检地点:', '巡检地点:',
'address', pp.address,
'<br />点编号:', '<br />点编号:',
pp.point_no, pp.point_no,
'<br />当前状态:', '<br />当前状态:',
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
) ]]> saveMsg, ) ]]> saveMsg,
CONCAT( CONCAT(
'巡检地点:', '巡检地点:',
'address', pp.address,
';点编号:', ';点编号:',
pp.point_no, pp.point_no,
';当前状态:', ';当前状态:',
......
...@@ -76,3 +76,5 @@ mqtt.topic.cti.push=/cti/record ...@@ -76,3 +76,5 @@ mqtt.topic.cti.push=/cti/record
cti.user.name=tzs_cti cti.user.name=tzs_cti
cti.user.pwd=a1234567 cti.user.pwd=a1234567
flc.sms.tempCode=SMS_TZS_0001
\ No newline at end of file
...@@ -81,3 +81,5 @@ mqtt.topic.cti.push=/cti/record ...@@ -81,3 +81,5 @@ mqtt.topic.cti.push=/cti/record
cti.user.name=tzs_cti cti.user.name=tzs_cti
cti.user.pwd=a1234567 cti.user.pwd=a1234567
flc.sms.tempCode=SMS_TZS_0001
...@@ -103,6 +103,204 @@ ...@@ -103,6 +103,204 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="kongfm" id="2021-11-17-01">
<preConditions onFail="MARK_RAN">
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>add data_dictionary </comment>
<sql>
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1043, '1043', '监管单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1044, '1044', '检验单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1045, '1045', '检测单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1046, '1046', '设计单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1047, '1047', '制造单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1048, '1048', '安装单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1049, '1049', '改造单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1050, '1050', '维修单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1051, '1051', '使用单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1052, '1052', '维保单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1053, '1053', '物业单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1054, '1054', '保险公司', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1055, '1055', '物联网公司', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1056, '1056', '气瓶充装单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1057, '1057', '经营单位', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1058, '1058', '其他', 'UNIT_TYPE', 'studio_normalapp_3228379,studio_normalapp_3261162', NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1059, '1059', '组织机构代码证', 'LICENSE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1060, '1060', '营业执照', 'LICENSE_TYPE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1061, '1061', 'A', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1062, '1062', 'B', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1063, '1063', 'C', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1064, '1064', 'D', 'QUALIFICATION_LEVEL', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1065, '1065', '行业', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1066, '1066', '住建', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1067, '1067', '文旅', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary` (`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1068, '1068', '化工', 'COMPTENT_DEPT', NULL, NULL, NULL, NULL, NULL, b'0', 1);
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-11-17-02">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="tz_flc_unit_info"/>
</not>
</preConditions>
<comment>add tz_flc_unit_info table</comment>
<sql>
CREATE TABLE `tz_flc_unit_info` (
`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`org_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位名称',
`licence_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型',
`licence_type_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型code',
`organization_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织机构编码',
`unit_type` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型',
`unit_type_code` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型code',
`comptent_dept` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门',
`comptent_dept_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门编号',
`approve_org` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批准成立机关',
`registration_authority` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登记机构',
`region_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域编码',
`country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家',
`province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省',
`city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '市',
`district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '县区',
`stree` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '街道',
`community` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区',
`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
`longitude` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度',
`latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度',
`management_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管辖单位',
`management_unit_id` bigint(30) NULL DEFAULT NULL COMMENT '管辖单位id',
`qualification_level` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级',
`qualification_level_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级编号',
`create_time` datetime NULL DEFAULT NULL COMMENT '成立日期',
`legal_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位法人',
`legal_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法人电话',
`contact_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位联系人',
`contact_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人电话',
`unit_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位电话',
`admin_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员姓名',
`admin_login_name` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员用户名',
`admin_login_pwd` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员密码',
`admin_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员手机号',
`org_user_id` bigint(32) NULL DEFAULT NULL COMMENT 'org_user_id',
`unit_status` int(11) NULL DEFAULT NULL COMMENT '审批状态 0 审批中 1 审批结束 2 驳回',
`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '更新人id',
`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
`rec_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
`is_change` bit(1) NULL DEFAULT NULL COMMENT '是否变更(0:未变更,1:变更中)',
`approved_time` datetime NULL DEFAULT NULL COMMENT '企业入驻时间',
`submit_time` datetime NULL DEFAULT NULL COMMENT '提交时间',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1460504125366816771 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业信息表' ROW_FORMAT = Dynamic;
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-11-17-03">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="tz_flc_unit_info_approve"/>
</not>
</preConditions>
<comment>add tz_flc_unit_info_approve table</comment>
<sql>
CREATE TABLE `tz_flc_unit_info_approve` (
`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`unit_id` bigint(30) NULL DEFAULT NULL COMMENT 'unit_info_id',
`source_id` bigint(30) NULL DEFAULT NULL COMMENT 'unit_info原表单id',
`content` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批意见',
`approve_status` int(11) NULL DEFAULT NULL COMMENT '审批结果 0 通过 1 驳回',
`approve_type` int(1) NULL DEFAULT NULL COMMENT '0 注册审批 1 变更审批',
`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '审批人id',
`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '审批人',
`rec_date` datetime NULL DEFAULT NULL COMMENT '审批日期',
`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1460809880397582339 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业信息审批意见表' ROW_FORMAT = Dynamic;
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-11-17-04">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="tz_flc_unit_info_change"/>
</not>
</preConditions>
<comment>add tz_flc_unit_info_change table</comment>
<sql>
CREATE TABLE `tz_flc_unit_info_change` (
`sequence_nbr` bigint(30) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`org_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位名称',
`licence_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型',
`licence_type_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '证照类型code',
`unit_type` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型',
`unit_type_code` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位类型code',
`comptent_dept` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门',
`comptent_dept_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '主管部门编号',
`approve_org` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批准成立机关',
`registration_authority` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '登记机构',
`region_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区域编码',
`country` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家',
`province` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省',
`city` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '市',
`district` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '县区',
`stree` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '街道',
`community` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小区',
`address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '详细地址',
`longitude` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '经度',
`latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '纬度',
`management_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管辖单位',
`management_unit_id` bigint(30) NULL DEFAULT NULL COMMENT '管辖单位id',
`qualification_level` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级',
`qualification_level_code` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '资质等级编号',
`create_time` datetime NULL DEFAULT NULL COMMENT '成立日期',
`legal_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位法人',
`legal_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法人电话',
`contact_person` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位联系人',
`contact_person_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人电话',
`unit_tel` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位电话',
`source_id` bigint(30) NULL DEFAULT NULL COMMENT '原记录id(unit_info)',
`unit_status` int(11) NULL DEFAULT NULL COMMENT '审批状态 0 审批中 1 审批结束 2 驳回',
`rec_user_id` bigint(30) NULL DEFAULT NULL COMMENT '更新人id',
`rec_user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人名称',
`rec_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
`is_delete` bit(1) NULL DEFAULT b'0' COMMENT '是否删除(0:未删除,1:已删除)',
`organization_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '组织机构编码',
`approved_time` datetime NULL DEFAULT NULL COMMENT '企业入驻时间',
`submit_time` datetime NULL DEFAULT NULL COMMENT '提交时间',
PRIMARY KEY (`sequence_nbr`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1458311353490657283 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '企业信息变更表' ROW_FORMAT = Dynamic;
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-11-17-05">
<preConditions onFail="MARK_RAN">
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions>
<comment>update cb_data_dictionary UNIT_TYPE</comment>
<sql>
UPDATE `cb_data_dictionary` SET `code` = '1043', `name` = '监管单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1043;
UPDATE `cb_data_dictionary` SET `code` = '1044', `name` = '检验单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1044;
UPDATE `cb_data_dictionary` SET `code` = '1045', `name` = '检测单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1045;
UPDATE `cb_data_dictionary` SET `code` = '1046', `name` = '设计单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1046;
UPDATE `cb_data_dictionary` SET `code` = '1047', `name` = '制造单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1047;
UPDATE `cb_data_dictionary` SET `code` = '1048', `name` = '安装单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1048;
UPDATE `cb_data_dictionary` SET `code` = '1049', `name` = '改造单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1049;
UPDATE `cb_data_dictionary` SET `code` = '1050', `name` = '维修单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1050;
UPDATE `cb_data_dictionary` SET `code` = '1051', `name` = '使用单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1051;
UPDATE `cb_data_dictionary` SET `code` = '1052', `name` = '维保单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1052;
UPDATE `cb_data_dictionary` SET `code` = '1053', `name` = '物业单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1053;
UPDATE `cb_data_dictionary` SET `code` = '1054', `name` = '保险公司', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1054;
UPDATE `cb_data_dictionary` SET `code` = '1055', `name` = '物联网公司', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1055;
UPDATE `cb_data_dictionary` SET `code` = '1056', `name` = '气瓶充装单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1056;
UPDATE `cb_data_dictionary` SET `code` = '1057', `name` = '经营单位', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1057;
UPDATE `cb_data_dictionary` SET `code` = '1058', `name` = '其他', `type` = 'UNIT_TYPE', `type_desc` = 'studio_normalapp_3477687,studio_normalapp_3261162', `parent` = NULL, `rec_user_name` = NULL, `rec_user_id` = NULL, `rec_date` = NULL, `is_delete` = b'0', `sort_num` = 1 WHERE `sequence_nbr` = 1058;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<springcloud.version>Hoxton.SR8</springcloud.version> <springcloud.version>Hoxton.SR8</springcloud.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<tyboot-version>1.1.20</tyboot-version> <tyboot-version>1.1.20</tyboot-version>
<amos.version>1.6.3-SNAPSHOT</amos.version> <amos.version>1.6.5-SNAPSHOT</amos.version>
<itext.version>7.1.1</itext.version> <itext.version>7.1.1</itext.version>
</properties> </properties>
......
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