Commit 1bcfacc5 authored by chenhao's avatar chenhao

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

parents ae451824 b71c8cc6
package com.yeejoin.amos.boot.biz.common.utils;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
public enum CodeInfoEnum {
LOCK(1L, 1L, "LOCK_TYPE", "LOCK"), UNLOCK(1L, 2L, "LOCK_TYPE", "LOCK");
public Long classId;
public Long infoId;
public String classCode;
public String infoCode;
CodeInfoEnum(Long classId, Long infoId, String classCode, String infoCode) {
this.classId = classId;
this.infoId = infoId;
this.classCode = classCode;
this.infoCode = infoCode;
}
public static CodeInfoEnum getByInfoId(Long infoId) {
return CodeInfoEnum.valueOf(infoId + "");
}
public static List getByClassId(Long classId) {
return Arrays.stream(CodeInfoEnum.values()).filter(item -> item.classId.equals(classId)).collect(Collectors.toList());
}
public static CodeInfoEnum getByClassCodeAndInfoCode(String classCode, String infoCode) {
Optional opt = Arrays.stream(CodeInfoEnum.values()).filter(item -> item.classCode.equals(classCode) && item.infoCode.equals(infoCode)).findFirst();
return (CodeInfoEnum) opt.orElse(null);
}
@Override
public String toString() {
return "CodeInfoEnum{" +
"classId=" + classId +
", infoId=" + infoId +
", classCode='" + classCode + '\'' +
", infoCode='" + infoCode + '\'' +
'}';
}
}
......@@ -12,7 +12,12 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DynamicEnumUtils {
/**
* 动态枚举工具类
*
* @author DELL
*/
public class DynamicEnumUtil {
private static ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory();
private static void setFailsafeFieldValue(Field field, Object target, Object value) throws NoSuchFieldException,
......@@ -49,8 +54,10 @@ public class DynamicEnumUtils {
}
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException {
blankField(enumClass, "enumConstantDirectory"); // Sun (Oracle?!?) JDK 1.5/6
blankField(enumClass, "enumConstants"); // IBM JDK
// Sun (Oracle?!?) JDK 1.5/6
blankField(enumClass, "enumConstantDirectory");
// IBM JDK
blankField(enumClass, "enumConstants");
}
private static ConstructorAccessor getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes)
......@@ -64,24 +71,25 @@ public class DynamicEnumUtils {
private static Object makeEnum(Class<?> enumClass, String value, int ordinal, Class<?>[] additionalTypes,
Object[] additionalValues) throws Exception {
Object[] parms = new Object[additionalValues.length + 2];
parms[0] = value;
parms[1] = Integer.valueOf(ordinal);
System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length);
return enumClass.cast(getConstructorAccessor(enumClass, additionalTypes).newInstance(parms));
Object[] params = new Object[additionalValues.length + 2];
params[0] = value;
params[1] = Integer.valueOf(ordinal);
System.arraycopy(additionalValues, 0, params, 2, additionalValues.length);
return enumClass.cast(getConstructorAccessor(enumClass, additionalTypes).newInstance(params));
}
/**
* 将枚举实例添加到作为参数提供的枚举类中
*
* @param <T>
* @param enumType 要修改的枚举类型
* @param enumName 添加的枚举类型名字
* @param additionalTypes 枚举类型参数类型列表
* @param additionalValues 枚举类型参数值列表
* @param <T>
* @return
*/
@SuppressWarnings("unchecked")
public static <T extends Enum<?>> void addEnum(Class<T> enumType, String enumName, Class<?>[] additionalTypes, Object[] additionalValues) {
public static <T extends Enum<?>> T addEnum(Class<T> enumType, String enumName, Class<?>[] additionalTypes, Object[] additionalValues) {
// 0. 检查类型
if (!Enum.class.isAssignableFrom(enumType)) {
......@@ -115,70 +123,9 @@ public class DynamicEnumUtils {
// 6. 清楚枚举的缓存
cleanEnumCache(enumType);
return newValue;
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
}
public static void main(String[] args) {
//
synchronized (CodeInfoEnum.class) {
addEnum(CodeInfoEnum.class, "3", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{2L, 3L, "ActiveStatus", "Active"});
addEnum(CodeInfoEnum.class, "4", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{2L, 4L, "ActiveStatus", "Inactive"});
addEnum(CodeInfoEnum.class, "5", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 5L, "Optype", "OP1"});
addEnum(CodeInfoEnum.class, "6", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 6L, "Optype", "OP2"});
addEnum(CodeInfoEnum.class, "7", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 7L, "Optype", "OP3"});
addEnum(CodeInfoEnum.class, "8", new Class[]{Long.class, Long.class, String.class, String.class}, new Object[]{3L, 8L, "Optype", "OP4"});
}
CodeInfoEnum codeInfoEnum = CodeInfoEnum.valueOf("5");
System.out.println(codeInfoEnum);
// Run a few tests just to show it works OK.
System.out.println(Arrays.deepToString(CodeInfoEnum.values()));
System.out.println("============================打印所有枚举(包括固定的和动态的),可以将数据库中保存的CIC以枚举的形式加载到JVM");
for (CodeInfoEnum codeInfo : CodeInfoEnum.values()) {
System.out.println(codeInfo.toString());
}
System.out.println("============================通过codeId找到的枚举,用于PO转VO的处理");
CodeInfoEnum activeStatus_Active = CodeInfoEnum.getByInfoId(3L);
System.out.println(activeStatus_Active);
System.out.println("============================通过ClassId找到的枚举列表");
List<CodeInfoEnum> activeStatusEnumList = CodeInfoEnum.getByClassId(3L);
for (CodeInfoEnum codeInfo : activeStatusEnumList) {
System.out.println(codeInfo);
}
System.out.println("============================通过ClassCode和InfoCode获取枚举,用于导入验证CIC合法性");
CodeInfoEnum toGetActiveStatus_Active = CodeInfoEnum.getByClassCodeAndInfoCode("ActiveStatus", "Active");
System.out.println(toGetActiveStatus_Active);
System.out.println("============================通过ClassCode和InfoCode获取枚举,输入不存在的Code,则返回NULL");
CodeInfoEnum toGetActiveStatus_miss = CodeInfoEnum.getByClassCodeAndInfoCode("ActiveStatus", "MISS");
System.out.println(toGetActiveStatus_miss);
}
}
\ No newline at end of file
......@@ -122,4 +122,45 @@ public class QRCodeUtil {
}
return null;
}
/**
* 根据二维码信息,生成二维码图片 用户excel,word等导出图片 可自定义图片大小
*
* @param content
* @return
*/
public static byte[] generateQRCodeImageByteData(String content, int size) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>();
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
hints.put(EncodeHintType.MARGIN, 1);
BitMatrix bitMatrix = new MultiFormatWriter().encode(
content
, BarcodeFormat.QR_CODE
, size
, size,
hints);
int width = bitMatrix.getWidth();
int height = bitMatrix.getHeight();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF);
}
}
ImageIO.write(image, "png", out);
return out.toByteArray();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
}
......@@ -13,7 +13,8 @@ import com.alibaba.fastjson.JSONObject;
import feign.Response;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration =
{ CommonMultipartSupportConfig.class })
public interface WorkflowFeignService {
/**
* 发起流程
......
......@@ -84,13 +84,13 @@ public class FireExpertsDto extends BaseDto {
// @ExcelIgnore
//@ExplicitConstraint(indexNum =11,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 10)
@ExcelProperty(value = "居住地详情", index = 10)
@ApiModelProperty(value = "居住地详情")
private String residenceDetails;
@ExplicitConstraint(indexNum =9,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 9)
@ApiModelProperty(value = "现居住地详细地址")
@ApiModelProperty(value = "现居住地")
private String residenceDetailVal;
@ExcelProperty(value = "办公电话", index = 11)
......
......@@ -113,7 +113,7 @@ public class FirefightersZhDto extends BaseDto {
@ApiModelProperty(value = "机构名称")
private String companyName;
@ApiModelProperty(value = "专家领域")
@ApiModelProperty(value = "station领域")
private String areasExpertise;
@ApiModelProperty(value = "消防专家领域字典code")
......
......@@ -182,16 +182,12 @@ public interface EquipFeignClient {
@RequestMapping(value = "/car/simple/{id}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> queryCarSimpleInfoById(@PathVariable Long id);
/**
* 统计
**/
@RequestMapping(value = "/equipSpecificAlarm/getCountAlarm/{type}", method = RequestMethod.GET)
ResponseModel<Integer> getCountAlarm(@PathVariable String type);
/**
* 统计
**/
......@@ -199,6 +195,14 @@ public interface EquipFeignClient {
ResponseModel<Integer> getcountAlarmHandle(@PathVariable String type);
/**
* 获取装备全路径
*
* @return Map<String, Object>
**/
@RequestMapping(value = "/building/getBuildingAbsolutePosition", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getBuildingAbsolutePosition();
/**
* 根据实例id 获取实例信息 // 需求 958 新增值班区域 值班区域id 字段 获取名称 by kongfm 2021-09-15
*
* @return
......@@ -222,5 +226,4 @@ public interface EquipFeignClient {
@RequestMapping(value = "/equipment/listLike/{code}", method = RequestMethod.GET)
ResponseModel<List<LinkedHashMap<String, Object>>> listLikePage(@PathVariable String code);
}
package com.yeejoin.amos.boot.module.common.api.feign;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.feign.config.InnerInvokException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* 防火监督服务feign
*
* @author Dell
*/
@FeignClient(name = "${supervision.feign.name}", path = "equip", configuration = {MultipartSupportConfig.class})
public interface SupervisionFeignClient {
/**
* 获取巡检隐患相关数据
*
* @param param
* @return
*/
@RequestMapping(value = "/patrol/danger/info", method = RequestMethod.GET)
ResponseModel<Object> getPatrolDangerInfo(@RequestBody Object param);
/**
* 修改巡检检查项
*
* @param param
* @return
*/
@RequestMapping(value = "/patrol/danger/check", method = RequestMethod.GET)
ResponseModel<Object> setPatrolDangerCheck(@RequestBody JSONObject param);
/**
* 查询隐患巡检信息
*
* @param latentDangerId
* @return
*/
@RequestMapping(value = "/{latentDangerId}", method = RequestMethod.GET)
ResponseModel<Object> getLatentDangerPatrolInfo(@PathVariable Long latentDangerId);
}
......@@ -98,5 +98,12 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
*/
Integer getFighterNumByTeamId(Long teamId);
/**
* 根据companyCode 返回机构下所有的队伍
* @param teamId
* @return
*/
List<FireTeam> byTeamId(Long teamId);
}
......@@ -216,10 +216,23 @@ public interface IOrgUsrService {
* @return
*/
List<OrgUsrExcelDto> exportPersonToExcelByParentId(Long parentId);
/**
* 根据机场人员id获取amos账号信息
*
* @param orgUserId
* @return
* @exception
*/
AgencyUserModel getAmosIdByOrgUserId(String orgUserId) throws Exception;
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
* @param ids
* @return
*/
public List<Map<String, Object>> getPersonDetailByCompanyIds(List<String> ids);
List<Map<String, Object>> getPersonDetailByCompanyIds(List<String> ids);
List<OrgUsr> selectCompanyUsers(Long orgUnitId);
}
......@@ -150,6 +150,16 @@
AND is_delete = 0
</select>
<select id="byTeamId" resultType="com.yeejoin.amos.boot.module.common.api.entity.FireTeam">
SELECT
*
FROM
cb_fire_team
WHERE
company_code = #{teamId}
AND is_delete = 0
</select>
</mapper>
......@@ -34,8 +34,14 @@ public class ESAlertCalledDto extends BaseDto {
/**
* 响应级别字典code 为了过滤用(只有航空器故障有)
*/
@ApiModelProperty(value = "响应级别")
@ApiModelProperty(value = "响应级别code")
private String responseLevelCode;
/**
* 响应级别字典名称 为了过滤用(只有航空器故障有)
*/
@ApiModelProperty(value = "响应级别")
private String responseLevel;
/**
* 警情阶段
*/
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 机场单位消防安全报告
*
* @author litw
* @date 2021-10-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="OrgUsrSafeReportDto", description="机场单位消防安全报告")
public class OrgUsrSafeReportDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "报告名称")
private String name;
@ApiModelProperty(value = "报告类型")
private String type;
@ApiModelProperty(value = "报告类型code")
private String typeCode;
@ApiModelProperty(value = "生效年份")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date takeEffectYear;
@ApiModelProperty(value = "签订时间")
private Date signedDate;
@ApiModelProperty(value = "机构代码用于权限过滤")
private String orgCode;
@ApiModelProperty(value = "所属机场单位名称")
private String company;
@ApiModelProperty(value = "所属机场单位id")
private Long companyId;
@ApiModelProperty(value = "单位类型(1机场单位,0机场部门)")
private String companyType;
@ApiModelProperty(value = "责任人")
private String dutyPerson;
@ApiModelProperty(value = "责任人Id")
private String dutyPersonId;
@ApiModelProperty(value = "附件")
private Map<String, List<AttachmentDto>> attachments;
@ApiModelProperty(value = "合同附件")
private String attachment;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author litw
* @date 2021-10-12.
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="OrgUsrSafeReportDto", description="机场单位消防安全报告")
public class OrgUsrSafeReportExcelDto extends BaseDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "报告名称", index = 0)
@ApiModelProperty(value = "报告名称")
private String name;
@ExcelProperty(value = "报告类型", index = 1)
@ApiModelProperty(value = "报告类型")
private String type;
@ExcelIgnore
@ApiModelProperty(value = "报告类型code")
private String typeCode;
@ExcelProperty(value = "生效年份", index = 2)
@ApiModelProperty(value = "生效年份")
private Date takeEffectYear;
@ExcelProperty(value = "签订时间", index = 3)
@ApiModelProperty(value = "签订时间")
private Date signedDate;
@ExcelIgnore
@ApiModelProperty(value = "机构代码用于权限过滤")
private String orgCode;
@ExplicitConstraint(method = "getCompany", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "所属机场单位名称", index = 4)
@ApiModelProperty(value = "所属机场单位名称")
private String company;
@ExcelIgnore
@ApiModelProperty(value = "所属机场单位id")
private Long companyId;
@ExcelIgnore
@ApiModelProperty(value = "单位类型(1机场单位,0机场部门)")
private String companyType;
@ExcelProperty(value = "责任人", index = 5)
@ApiModelProperty(value = "责任人")
private String dutyPerson;
@ExcelIgnore
@ApiModelProperty(value = "责任人Id")
private String dutyPersonId;
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 机场单位消防安全报告
*
* @author litw
* @date 2021-10-09
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cb_org_usr_safe_report")
public class OrgUsrSafeReport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 报告名称
*/
@TableField("name")
private String name;
/**
* 报告类型
*/
@TableField("type")
private String type;
/**
* 报告类型code
*/
@TableField("type_code")
private String typeCode;
/**
* 生效年份
*/
@TableField("take_effect_year")
private Date takeEffectYear;
/**
* 签订时间
*/
@TableField("signed_date")
private Date signedDate;
/**
* 机构代码用于权限过滤
*/
@TableField("org_code")
private String orgCode;
/**
* 所属机场单位名称
*/
@TableField("company")
private String company;
/**
* 所属机场单位id
*/
@TableField("company_id")
private Long companyId;
/**
* 单位类型(1机场单位,0机场部门)
*/
@TableField("company_type")
private String companyType;
/**
* 责任人
*/
@TableField("duty_person")
private String dutyPerson;
/**
* 责任人Id
*/
@TableField("duty_person_id")
private String dutyPersonId;
@ApiModelProperty(value = "合同附件")
private String attachment;
}
......@@ -26,7 +26,8 @@ public enum ExcelEnums {
TGRY ("特岗人员", "特岗人员", "com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto","TGRY"),//("TGRY","特岗人员")
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备")
XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB");//("WXXFZB","微型消防站值班")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB"),//("WXXFZB","微型消防站值班")
XFAQBG("消防安全报告", "消防安全报告", "com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportExcelDto","XFAQBG");//("XFAQBG","微型消防站值班")
private String fileName;
private String sheetName;
private String classUrl;
......
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsrSafeReport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 机场单位消防安全报告 Mapper 接口
*
* @author litw
* @date 2021-10-09
*/
public interface OrgUsrSafeReportMapper extends BaseMapper<OrgUsrSafeReport> {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 机场单位消防安全报告接口类
*
* @author litw
* @date 2021-10-09
*/
public interface IOrgUsrSafeReportService {
}
......@@ -25,7 +25,10 @@
a.alert_stage alertStage,
a.call_time callTime,
a.rescue_grid rescueGrid,
a.alert_type alertType,
-- a.alert_type alertType,
CONCAT('【',a.alert_type,'】',IFNULL((select field_value from jc_alert_form_value where jc_alert_form_value.alert_called_id =a.sequence_nbr and jc_alert_form_value.field_code='remark'),"")) alertType,
a.alert_type_code alarmTypeCode,
a.unit_involved unitInvolved,
a.trapped_num trappedNum,
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.OrgUsrSafeReportMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-boot-module-api</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-latentdanger-api</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
</project>
package com.yeejoin.amos.latentdanger.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author DELL
*/
@Getter
@AllArgsConstructor
public enum DangerHandleStateEnum {
/**
* 隐患治理中
*/
HANDLE("隐患治理中", 0),
/**
* 隐患治理完成
*/
COMPLETED("隐患治理完成", 1);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
}
package com.yeejoin.amos.latentdanger.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 字典枚举对象
* @author maoying
*
*/
public enum DictTypeEnum {
/**
* 隐患等级
*/
DANGERLEVEL("隐患等级", "DANGER_LEVEL");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private DictTypeEnum(String name, String code){
this.name = name;
this.code = code;
}
public static DictTypeEnum getEnum(String code) {
DictTypeEnum instance = null;
for(DictTypeEnum type: DictTypeEnum.values()) {
if (type.getCode().equals(code)) {
instance = type;
break;
}
}
return instance;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> list = new ArrayList<>();
for(DictTypeEnum e : DictTypeEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("code", e.getCode());
map.put("name", e.getName());
list.add(map);
}
return list;
}
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;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author DELL
*/
public enum ExecuteStateEnum {
/**
* 未执行
*/
未执行("未执行", 0, ""),
通过("通过", 1, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
驳回("驳回", 2, "{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
已确认("已确认", 3, ""),
停止执行("停止执行", 4, ""),
作业开始执行("作业开始执行", 5, ""),
作业完成("作业完成", 6, "");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
private String requestBody;
ExecuteStateEnum(String name, Integer code, String requestBody) {
this.name = name;
this.code = code;
this.requestBody = requestBody;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getRequestBody() {
return requestBody;
}
public void setRequestBody(String requestBody) {
this.requestBody = requestBody;
}
public static ExecuteStateEnum getByCode(Integer code) {
for (ExecuteStateEnum e : ExecuteStateEnum.values()) {
if (code.equals(e.getCode())) {
return e;
}
}
return null;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author DELL
*/
public enum ExecuteTypeEnum {
/**
* 未执行
*/
未执行("未执行", 1, ""),
通过("通过", 2, "0"),
驳回("驳回", 3, "1");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
/**
* 工作流条件(0通过1驳回)
*/
private String condition;
ExecuteTypeEnum(String name, Integer code, String condition) {
this.name = name;
this.code = code;
this.condition = condition;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getCondition() {
return condition;
}
public void setCode(String condition) {
this.condition = condition;
}
public static ExecuteTypeEnum getByCode(Integer code) {
for (ExecuteTypeEnum e : ExecuteTypeEnum.values()) {
if (code.equals(e.getCode())) {
return e;
}
}
return null;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 规则请求枚举
* @author WJK
*
*/
@Getter
@AllArgsConstructor
public enum InstanceKeyEnum {
NORMAL("无码无计划隐患","normalHazardManagement"),
PATROL("巡检隐患","hazardManagement" );
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* 业务配置枚举
*
* @author DELL
*/
public enum LatentDangerBizTypeEnum {
/**
* 防火监督
*/
防火监督("防火监督", "supervision"),
/**
* 巡检
*/
巡检("巡检", "patrol");
/**
* 业务名称
*/
String name;
/**
* 业务code
*/
String code;
LatentDangerBizTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
public static LatentDangerBizTypeEnum getByCode(String code) {
for (LatentDangerBizTypeEnum l : LatentDangerBizTypeEnum.values()) {
if (l.getCode().equals(code)) {
return l;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author Dell
*/
public enum LatentDangerExecuteTypeEnum {
填写隐患完成("填写隐患完成", 1, ExecuteStateEnum.通过, LatentDangerStateEnum.待评审,
"{\"action\": \"complete\"}"),
隐患评审通过("隐患评审通过", 2, ExecuteStateEnum.通过, LatentDangerStateEnum.待治理,
"{\"reviewResult\": \"通过\"}"),
隐患评审拒绝("隐患评审拒绝", 3, ExecuteStateEnum.驳回, LatentDangerStateEnum.已撤销,
"{\"reviewResult\": \"不通过\"}"),
隐患常规治理("隐患常规治理", 4, ExecuteStateEnum.通过, LatentDangerStateEnum.待验证,
"{\"rectifyResult\": \"常规整改\"}"),
隐患安措计划("隐患安措计划", 5, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rectification\",\"value\": \"plan\"}]}"),
隐患延期治理("隐患延期治理", 15, ExecuteStateEnum.通过, LatentDangerStateEnum.延期治理申请待车间部门审核,
"{\"rectifyResult\": \"延期\"}"),
隐患延期治理车间部门审核通过("隐患延期治理车间部门审核通过", 16, ExecuteStateEnum.通过, LatentDangerStateEnum.待治理,
"{\"approveResult\": \"通过\"}"),
隐患延期治理车间部门审核拒绝("隐患延期治理车间部门审核拒绝", 17, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"approveResult\": \"不通过\"}"),
隐患延期治理公司审核通过("隐患延期治理公司审核通过", 18, ExecuteStateEnum.通过, LatentDangerStateEnum.待治理,
"{\"approveResult\": true}"),
隐患延期治理公司审核拒绝("隐患延期治理公司审核拒绝", 19, ExecuteStateEnum.驳回, LatentDangerStateEnum.延期治理申请待车间部门审核,
"{\"approveResult\": false}"),
填写安措计划完成("填写安措计划完成", 6, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\"}"),
车间部门审核通过("车间部门审核通过", 7, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
车间部门审核拒绝("车间部门审核拒绝", 8, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
总工程师审核通过("总工程师审核通过", 9, ExecuteStateEnum.通过, LatentDangerStateEnum.安措计划中,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
总工程师审核拒绝("总工程师审核拒绝", 10, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
公司负责人审核通过("公司负责人审核通过", 11, ExecuteStateEnum.通过, LatentDangerStateEnum.待验证,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": false}]}"),
公司负责人审核拒绝("公司负责人审核拒绝", 12, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"action\": \"complete\",\"variables\": [{\"name\": \"rejected\",\"value\": true}]}"),
隐患验证通过("隐患验证通过", 13, ExecuteStateEnum.通过, LatentDangerStateEnum.治理完毕,
"{\"validationResult\": \"通过\"}"),
隐患验证拒绝("隐患验证拒绝", 14, ExecuteStateEnum.驳回, LatentDangerStateEnum.待治理,
"{\"validationResult\": \"不通过\"}");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
/**
* 执行状态
*/
private ExecuteStateEnum executeState;
private String requestBody;
private LatentDangerStateEnum nextState;
LatentDangerExecuteTypeEnum(String name, Integer code, ExecuteStateEnum executeState, LatentDangerStateEnum nextState, String requestBody) {
this.name = name;
this.code = code;
this.executeState = executeState;
this.requestBody = requestBody;
this.nextState = nextState;
}
public static LatentDangerExecuteTypeEnum getByCode(Integer code) {
for (LatentDangerExecuteTypeEnum e : LatentDangerExecuteTypeEnum.values()) {
if (code.equals(e.getCode())) {
return e;
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public ExecuteStateEnum getExecuteState() {
return executeState;
}
public void setExecuteState(ExecuteStateEnum executeState) {
this.executeState = executeState;
}
public String getRequestBody() {
return requestBody;
}
public void setRequestBody(String requestBody) {
this.requestBody = requestBody;
}
public LatentDangerStateEnum getNextState() {
return nextState;
}
public void setNextState(LatentDangerStateEnum nextState) {
this.nextState = nextState;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import com.yeejoin.amos.boot.biz.common.utils.DynamicEnumUtil;
import java.util.HashMap;
import java.util.Map;
/**
* @author DELL
*/
public enum LatentDangerLevelEnum {
/**
* 安全问题
*/
安全问题("安全问题", "0", "0", 1),
/**
* 一般隐患
*/
一般隐患("一般隐患", "1", "1", 2),
/**
* 重大隐患
*/
重大隐患("重大隐患", "2", "2", 3);
/**
* 枚举缓存
*/
public static Map<String, LatentDangerLevelEnum> enumMap = new HashMap<>();
public static final String dictCode = "_DANGER_LEVEL";
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 风险源等级
*/
private String riskSourceDangerLevelCode;
/**
* 排序
*/
private Integer order;
// static {
// EnumSet<LatentDangerLevelEnum> set = EnumSet.allOf(LatentDangerLevelEnum.class);
// for (LatentDangerLevelEnum each : set) {
// // 增加一个缓存 减少对枚举的修改
// enumMap.put(each.code, each);
// }
// }
LatentDangerLevelEnum(String name, String code, String riskSourceDangerLevelCode, Integer order) {
this.name = name;
this.code = code;
this.riskSourceDangerLevelCode = riskSourceDangerLevelCode;
this.order = order;
}
public static LatentDangerLevelEnum getByRiskSourceDangerLevelCode(String riskSourceDangerLevelCode) {
for (LatentDangerLevelEnum l : LatentDangerLevelEnum.values()) {
if (riskSourceDangerLevelCode.equals(l.getRiskSourceDangerLevelCode())) {
return l;
}
}
return null;
}
public static LatentDangerLevelEnum getEnumByOrder(Integer order) {
for (LatentDangerLevelEnum l : enumMap.values()) {
if (order.equals(l.getOrder())) {
return l;
}
}
return null;
}
/**
* 根据关键字段获取枚举值 可以在这里做一些修改 来达到动态添加的效果
*
* @param code
*/
public static LatentDangerLevelEnum getEnumByCode(String code) {
// 这里可以做一些修改 比如若从 enumMap 中没有取得 则加载配置动态添加
return enumMap.get(code);
}
public static LatentDangerLevelEnum addEnumDynamic(String enumName, String name, String code,
String riskSourceDangerLevelCode, Integer order) {
LatentDangerLevelEnum dangerLevelEnum = DynamicEnumUtil.addEnum(LatentDangerLevelEnum.class, enumName,
new Class[]{String.class, String.class, String.class, Integer.class}, new Object[]{name, code,
riskSourceDangerLevelCode, order});
enumMap.put(code, dangerLevelEnum);
return dangerLevelEnum;
}
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 getRiskSourceDangerLevelCode() {
return riskSourceDangerLevelCode;
}
public void setRiskSourceDangerLevelCode(String riskSourceDangerLevelCode) {
this.riskSourceDangerLevelCode = riskSourceDangerLevelCode;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author DELL
*/
public enum LatentDangerOvertimeStateEnum {
/**
* 未逾期
*/
未逾期("未超时", 0),
已逾期("已超时", 1);
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private Integer code;
LatentDangerOvertimeStateEnum(String name, Integer code) {
this.name = name;
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public static LatentDangerOvertimeStateEnum getByCode(Integer code) {
for (LatentDangerOvertimeStateEnum l : LatentDangerOvertimeStateEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* 隐患执行状态
*
* @author DELL
*/
public enum LatentDangerProcessStateEnum {
/**
* 未审核
*/
未审核("未审核", "0"),
/**
* 待审核
*/
待审核("待审核", "1"),
/**
* 待整改
*/
待整改("待整改", "2"),
/**
* 待复核
*/
待复核("待复核", "3"),
/**
* 治理完毕
*/
治理完毕("治理完毕", "4");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
LatentDangerProcessStateEnum(String name, String code) {
this.name = name;
this.code = code;
}
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 static String getEnumName(String code) {
String name = "";
for(LatentDangerProcessStateEnum type: LatentDangerProcessStateEnum.values()) {
if (type.getCode()==code) {
name = type.getName();
break;
}
}
return name;
}
public static LatentDangerProcessStateEnum getByCode(String code) {
for (LatentDangerProcessStateEnum l : LatentDangerProcessStateEnum.values()) {
if (l.getCode().equals(code)) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import com.yeejoin.amos.boot.biz.common.utils.DynamicEnumUtil;
import java.util.HashMap;
import java.util.Map;
/**
* 隐患治理方式枚举
*
* @author DELL
*/
public enum LatentDangerReformTypeEnum {
/**
* 常规整改
*/
常规整改("常规整改", "1"),
/**
* 安措计划
*/
安措计划("安措计划", "2"),
/**
* 延期治理
*/
延期治理("延期治理", "3");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 枚举缓存
*/
public static Map<String, LatentDangerReformTypeEnum> enumMap = new HashMap<>();
public static final String dictCode = "_GOVERNANCE";
LatentDangerReformTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
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;
}
/**
* 根据关键字段获取枚举值 可以在这里做一些修改 来达到动态添加的效果
*
* @param code
*/
public static LatentDangerReformTypeEnum getEnumByCode(String code) {
// 这里可以做一些修改 比如若从 enumMap 中没有取得 则加载配置动态添加
return enumMap.get(code);
}
public static LatentDangerReformTypeEnum addEnumDynamic(String enumName, String name, String code) {
LatentDangerReformTypeEnum dangerReformTypeEnum = DynamicEnumUtil.addEnum(LatentDangerReformTypeEnum.class, enumName,
new Class[]{String.class, String.class}, new Object[]{name, code});
enumMap.put(code, dangerReformTypeEnum);
return dangerReformTypeEnum;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
public interface LatentDangerState {
/**
* 根据code获取枚举
*
* @param code
* @return
*/
static LatentDangerState getEnumByCode(String code) {
return null;
}
/**
* 根据code获取枚举名称
*
* @param code
* @return
*/
static String getEnumNameByCode(String code) {
return null;
}
enum SupervisionDangerStateEnum implements LatentDangerState {
/**
* 提交隐患
*/
提交隐患("提交隐患", "dangerSubmit", null, null, "0"),
/**
* 现场确认
*/
现场确认("现场确认", "onSiteConfirm", "leaderConfirm","onSiteConfirm", "1"),
/**
* 检查组长确认
*/
检查组长确认("检查组长确认", "leaderConfirm", "secondConfirm","onSiteConfirm", "1"),
/**
* 隐患二次审核确认
*/
隐患二次审核确认("隐患二次审核确认", "secondConfirm", "taskDispatch","onSiteConfirm", "1"),
/**
* 整改任务分配
*/
整改任务分配("整改任务分配", "taskDispatch", "governFileSubmit","", "2"),
/**
* 提交整改资料
*/
提交整改资料("提交整改资料", "governFileSubmit", "governChargerConfirm","", "2"),
/**
* 整改检查组长确认
*/
整改检查组长确认("整改检查组长确认", "governLeaderConfirm", "governChargerConfirm","governFileSubmit", "3"),
/**
* 整改检查负责人确认
*/
整改检查负责人确认("整改检查负责人确认", "governChargerConfirm", "governLeadershipConfirm","governFileSubmit", "3"),
/**
* 整改检查分管领导确认(根据计划类型不同,分管领导确认完流程不同)
*/
整改检查分管领导确认("整改检查分管领导确认", "governLeadershipConfirm", "governLeaderReviewConfirm","governFileSubmit", "3"),
/**
* 整改检查组长复查确认
*/
整改检查组长复查确认("整改检查组长复查确认", "governLeaderReviewConfirm", "governSecondReviewConfirm","governFileSubmit", "3"),
/**
* 整改二次审核确认
*/
整改二次审核确认("整改二次审核确认", "governSecondReviewConfirm", "endOfGovernance","governFileSubmit", "3"),
/**
* 整改完毕
*/
整改完毕("整改完毕", "endOfGovernance", "","", "4");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 通过下一步骤
*/
private String next;
/**
* 拒绝下一步骤
*/
private String rejectNext;
/**
* 流程状态
*/
private String processState;
SupervisionDangerStateEnum(String name, String code, String next, String rejectNext, String processState) {
this.name = name;
this.code = code;
this.next = next;
this.rejectNext = rejectNext;
this.processState = processState;
}
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 getNext() {
return next;
}
public void setNext(String next) {
this.next = next;
}
public String getRejectNext() {
return rejectNext;
}
public void setRejectNext(String rejectNext) {
this.rejectNext = rejectNext;
}
public String getProcessState() {
return processState;
}
public void setProcessState(String processState) {
this.processState = processState;
}
public static SupervisionDangerStateEnum getEnumByCode(String code) {
for (SupervisionDangerStateEnum _enum : SupervisionDangerStateEnum.values()) {
if (code.equals(_enum.getCode())) {
return _enum;
}
}
return null;
}
public static String getEnumNameByCode(String code) {
String enumName = "";
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
if (type.getCode().equals(code)) {
enumName = type.getName();
break;
}
}
return enumName;
}
public static List<Map<String, String>> getEnumList() {
List<Map<String, String>> enumList = Lists.newArrayList();
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
Map<String, String> resultMap = Maps.newHashMap();
resultMap.put("key", type.getCode());
resultMap.put("name", type.getName());
enumList.add(resultMap);
}
return enumList;
}
public static List<SupervisionDangerStateEnum> getEnumListByProcessState(String processState) {
List<SupervisionDangerStateEnum> enumList = Lists.newArrayList();
for(SupervisionDangerStateEnum type: SupervisionDangerStateEnum.values()) {
if (type.getProcessState().equals(processState)) {
enumList.add(type);
}
}
return enumList;
}
}
enum PatrolDangerStateEnum implements LatentDangerState {
/**
* 待评审
*/
待评审("待评审", "1"),
待治理("待治理", "2"),
安措计划中("安措计划中", "3"),
待验证("待验证", "4"),
治理完毕("治理完毕", "5"),
已撤销("已撤销", "6"),
延期治理申请("延期治理中", "7"),
延期治理申请待车间部门审核("延期治理待车间部门审核", "8"),
延期治理申请待公司审核("延期治理待公司审核", "9");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
PatrolDangerStateEnum(String name, String code) {
this.name = name;
this.code = code;
}
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 LatentDangerState getEnumByCode(String code) {
for (PatrolDangerStateEnum _enum : PatrolDangerStateEnum.values()) {
if (code.equals(_enum.getCode())) {
return _enum;
}
}
return null;
}
public String getEnumNameByCode(String code) {
String enumName = "";
for(PatrolDangerStateEnum type: PatrolDangerStateEnum.values()) {
if (type.getCode().equals(code)) {
enumName = type.getName();
break;
}
}
return enumName;
}
public static List<Map<String, String>> getEnumList() {
List<Map<String, String>> enumList = Lists.newArrayList();
for(PatrolDangerStateEnum type: PatrolDangerStateEnum.values()) {
Map<String, String> resultMap = Maps.newHashMap();
resultMap.put("key", type.getCode());
resultMap.put("name", type.getName());
enumList.add(resultMap);
}
return enumList;
}
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import com.yeejoin.amos.boot.biz.common.utils.DynamicEnumUtil;
import java.util.HashMap;
import java.util.Map;
public enum LatentDangerStateEnum {
待评审("待评审", "1"),
待治理("待治理", "2"),
安措计划中("安措计划中", "3"),
待验证("待验证", "4"),
治理完毕("治理完毕", "5"),
已撤销("已撤销", "6"),
延期治理申请("延期治理中", "7"),
延期治理申请待车间部门审核("延期治理待车间部门审核", "8"),
延期治理申请待公司审核("延期治理待公司审核", "9");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
/**
* 枚举缓存
*/
public static Map<String, LatentDangerStateEnum> enumMap = new HashMap<>();
public static final String dictCode = "_GOVERNANCE_PROGRESS";
LatentDangerStateEnum(String name, String code) {
this.name = name;
this.code = code;
}
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 static String getEnumName(String code) {
return enumMap.get(code).getName();
}
public static LatentDangerStateEnum getByCode(String code) {
return enumMap.get(code);
}
public static LatentDangerStateEnum addEnumDynamic(String enumName, String name, String code) {
LatentDangerStateEnum dangerStateEnum = DynamicEnumUtil.addEnum(LatentDangerStateEnum.class, enumName,
new Class[]{String.class, String.class}, new Object[]{name, code});
enumMap.put(code, dangerStateEnum);
return dangerStateEnum;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* 隐患来源类型枚举
*
* @author DELL
*/
public enum LatentDangerTypeEnum {
/**
* 无码检查
*/
无码检查("无码检查", "1"),
/**
* 计划检查
*/
计划检查("计划检查", "2"),
/**
* 无计划检查
*/
无计划检查("无计划检查", "3"),
/**
* 随手拍
*/
随手拍("随手拍", "4");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
LatentDangerTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
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 static String getEnumName(String code) {
String name = "";
for(LatentDangerTypeEnum type: LatentDangerTypeEnum.values()) {
if (type.getCode()==code) {
name = type.getName();
break;
}
}
return name;
}
public static LatentDangerTypeEnum getByCode(String code) {
for (LatentDangerTypeEnum l : LatentDangerTypeEnum.values()) {
if (code.equals(l.getCode())) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
public enum MsgSubscribeEnum {
/**
* 风险评价提醒推送
*/
风险评价提醒推送("riskFatorApp", "风险评价提醒", "风险评价提醒", false, "default"),
/**
* 隐患治理推送
*/
隐患治理推送("latentDangerApp", "隐患治理", "隐患治理移动端推送", false, "default");
private String msgType;
private String title;
private String desc;
private Boolean canConfig;
private String type;
MsgSubscribeEnum(String msgType, String title, String desc, Boolean canConfig, String type) {
this.msgType = msgType;
this.title = title;
this.desc = desc;
this.canConfig = canConfig;
this.type = type;
}
public static List<Map<String, String>> getEnumList() {
List<Map<String, String>> list = Lists.newArrayList();
for (MsgSubscribeEnum e : MsgSubscribeEnum.values()) {
if (e.canConfig && !e.getMsgType().equals("checkRecordNoPushApp") && !e.getType().equals("email")) {
Map<String, String> msgType = Maps.newHashMap();
msgType.put(e.getMsgType(), e.getTitle());
list.add(msgType);
}
}
return list;
}
public static MsgSubscribeEnum getByMsgType(String msgType) {
for (MsgSubscribeEnum typeEnum : MsgSubscribeEnum.values()) {
if (msgType.equals(typeEnum.msgType)) {
return typeEnum;
}
}
return null;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Boolean getCanConfig() {
return canConfig;
}
public void setCanConfig(Boolean canConfig) {
this.canConfig = canConfig;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
public enum MsgTypeEnum {
/**
* 隐患排查
*/
CHECK("隐患排查", "check");
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private MsgTypeEnum(String name, String code) {
this.name = name;
this.code = code;
}
public static MsgTypeEnum getEnum(String code) {
MsgTypeEnum MsgTypeEnum = null;
for (MsgTypeEnum type : MsgTypeEnum.values()) {
if (type.getCode().equals(code)) {
MsgTypeEnum = type;
break;
}
}
return MsgTypeEnum;
}
public static List<Map<String, String>> getEnumList() {
List<Map<String, String>> list = new ArrayList<>();
for (MsgTypeEnum e : MsgTypeEnum.values()) {
Map<String, String> msgType = new HashMap<>();
msgType.put(e.getCode(), e.getName());
list.add(msgType);
}
return list;
}
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;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* 拥有者枚举
* @author WJK
*
*/
public enum OwerEnum {
/**
* 我的
*/
MY("我的","0"),
ALL("全部","1" );
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private OwerEnum(String name, String code){
this.name = name;
this.code = code;
}
public static OwerEnum getEnum(String code) {
OwerEnum jPushTypeEnum = null;
for(OwerEnum type: OwerEnum.values()) {
if (type.getCode().equals(code)) {
jPushTypeEnum = type;
break;
}
}
return jPushTypeEnum;
}
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;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* @author DELL
*/
public enum WorkFlowRiskFactorUriEnum {
/**
* 隐患治理结果推送
*/
隐患治理结果推送("隐患治理结果推送", "/api/protal/hiddentrouble", "");
private String desc;
private String uri;
private String params;
WorkFlowRiskFactorUriEnum(String desc, String uri, String params) {
this.desc = desc;
this.uri = uri;
this.params = params;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
public enum WorkFlowUriEnum {
启动流程("启动流程", "/workflow/task/startTask", ""),
流程详情("流程详情", "/workflow/task/{taskId}", "taskId"),
合并启动流程("合并启动流程", "/workflow/task/startProcess", ""),
所有已执行任务详情("所有已执行任务详情","/workflow/activitiHistory/task/detail/{taskId}","taskId"),
流程任务("流程任务", "/workflow/task?processInstanceId={processInstanceId}", "processInstanceId"),
我的代办("我的代办", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
我的代办有ID("我的代办有ID", "/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
已执行任务("已执行任务", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}", "processDefinitionKey"),
已执行任务有ID("已执行任务有ID", "/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}", "processDefinitionKey,userId"),
启动免登录流程("启动免登录流程", "/processes/{appKey}", "appKey"),
当前节点("当前节点", "/wf/taskstodo?processInstanceId={processInstanceId}", "processInstanceId"),
执行流程("执行流程", "/workflow/task/pickupAndCompleteTask/{taskId}", "taskId"),
终止流程("终止流程", "/wf/processes/{processInstanceId}?deleteReason={deleteReason}", "processInstanceId,deleteReason"),
当前子节点("当前子节点", "/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}", "processInstanceId,taskDefinitionKey"),
工作流流水("工作流流水","/wf/processes/{processInstanceId}/tasks", "processInstanceId"),
子节点信息("子节点信息","/workflow/task/list/all/{instanceId}", "instanceId");
private String desc;
private String uri;
private String params;
WorkFlowUriEnum(String desc, String uri, String params) {
this.desc = desc;
this.uri = uri;
this.params = params;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
package com.yeejoin.amos.latentdanger.common.enums;
/**
* 是否枚举
* @author WJK
*
*/
public enum YesOrNoEnum {
NO("否","0"),
YES("是","1" );
/**
* 名称,描述
*/
private String name;
/**
* 编码
*/
private String code;
private YesOrNoEnum(String name, String code){
this.name = name;
this.code = code;
}
public static YesOrNoEnum getEnum(String code) {
YesOrNoEnum jPushTypeEnum = null;
for(YesOrNoEnum type: YesOrNoEnum.values()) {
if (type.getCode().equals(code)) {
jPushTypeEnum = type;
break;
}
}
return jPushTypeEnum;
}
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;
}
}
package com.yeejoin.amos.latentdanger.core.common.request;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
/**
* <pre>
* 分页实体
* </pre>
*
* @author as-chenjiajun
* @version $Id: CommonPageable.java, v 0.1 2016-12-14 上午10:42:44 as-chenjiajun
* Exp $
*/
public class CommonPageable implements Pageable {
/**
* 页号(大于等于0)
*/
protected int pageNumber = 0;
/**
* 每页大小(大于等于0)
*/
protected int pageSize = 10;
/**
* 起始索引
*/
protected int offset = 0;
/**
* 排序
*/
protected Sort sort = null;
public CommonPageable() {
this.pageNumber = 0;
this.pageSize = 10;
this.offset = pageSize * pageNumber;
}
public CommonPageable(int pageNumber, int pageSize) {
this.pageNumber = pageNumber;
this.pageSize = pageSize;
this.offset = pageSize * pageNumber;
}
public CommonPageable(int pageNumber, int pageSize, Sort sort) {
this.pageNumber = pageNumber;
this.pageSize = pageSize;
this.sort = sort;
this.offset = pageSize * pageNumber;
}
public int getPageNumber() {
return this.pageNumber;
}
public void setPageNumber(int pageNumber) {
this.pageNumber = pageNumber;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public long getOffset() {
offset = pageSize * pageNumber;
return offset;
}
public void setOffset(int offset) {
this.offset = offset;
}
public Sort getSort() {
return sort;
}
public void setSort(Sort sort) {
this.sort = sort;
}
public Pageable next() {
return null;
}
public Pageable previousOrFirst() {
return null;
}
public Pageable first() {
return null;
}
public boolean hasPrevious() {
return false;
}
}
package com.yeejoin.amos.patrol.core.common.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
* <pre>
* 公共请求对象
* </pre>
*
* @author as-shibaobao
* @version $Id: CommonRequest.java, v 0.1 2018年1月26日 上午10:59:19 as-shibaobao Exp $
*/
@ApiModel
public class CommonRequest {
/**
* 字段名称
*/
@ApiModelProperty(value="字段名称",required=true)
private String name;
/**
* 字段值
*/
@ApiModelProperty(value="字段值",required=true)
private Object value;
/**
* 查询类型
*/
@ApiModelProperty(value="查询类型",notes="空值时,默认为等于;其它类型按QueryOperatorEnum",required=false)
private String type;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
package com.yeejoin.amos.latentdanger.core.common.request;
import java.util.List;
/**
* @author DELL
*/
public class LatentDangerResultPushSpcRequest {
/**
* 隐患状态
*/
private String hiddenTroubleStatus;
/**
* 处理时间
*/
private String processingTime;
/**
* 隐患名称
*/
private String hiddenTroubleName;
/**
* 风险点id
*/
private String riskSourceId;
/**
* 所有隐患的状态集合
*/
private List<String> troubleList;
public String getHiddenTroubleStatus() {
return hiddenTroubleStatus;
}
public void setHiddenTroubleStatus(String hiddenTroubleStatus) {
this.hiddenTroubleStatus = hiddenTroubleStatus;
}
public String getProcessingTime() {
return processingTime;
}
public void setProcessingTime(String processingTime) {
this.processingTime = processingTime;
}
public String getHiddenTroubleName() {
return hiddenTroubleName;
}
public void setHiddenTroubleName(String hiddenTroubleName) {
this.hiddenTroubleName = hiddenTroubleName;
}
public String getRiskSourceId() {
return riskSourceId;
}
public void setRiskSourceId(String riskSourceId) {
this.riskSourceId = riskSourceId;
}
public List<String> getTroubleList() {
return troubleList;
}
public void setTroubleList(List<String> troubleList) {
this.troubleList = troubleList;
}
}
package com.yeejoin.amos.patrol.core.common.request;
/**
* 线路巡检点巡检项查询条件
* @author Administrator
*
*/
public class RoutePointInputItemRequest {
/**
* 巡检点id
*/
private Long pointId;
/**
* 是否绑定
*/
private String isBound;
/**
* 路线id
*/
private Long routeId;
/**
* 分类id
*/
private Long classifyId;
/**
* 巡检项等级
*/
private String level;
/**
* 巡检项名称
*/
private String inputName;
public Long getPointId() {
return pointId;
}
public void setPointId(Long pointId) {
this.pointId = pointId;
}
public Long getRouteId() {
return routeId;
}
public void setRouteId(Long routeId) {
this.routeId = routeId;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getInputName() {
return inputName;
}
public void setInputName(String inputName) {
this.inputName = inputName;
}
public String getIsBound() {
return isBound;
}
public void setIsBound(String isBound) {
this.isBound = isBound;
}
}
/**
* NewHeight.com Inc.
* Copyright (c) 2008-2010 All Rights Reserved.
*/
package com.yeejoin.amos.patrol.core.common.response;
import java.util.List;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
/**
* <pre>
* 分页数据
* </pre>
*
* @author as-youjun
* @version $Id: CompanyPage.java, v 0.1 2017年4月13日 上午11:35:25 as-youjun Exp $
*/
public final class CommonPage<T> extends PageImpl<T> {
/**
* <pre>
* uid
* </pre>
*/
private static final long serialVersionUID = -5533124806408380886L;
/**
*
*/
private String message;
/**
* 返回结果状态
*/
private String result;
public CommonPage(List<T> content, Pageable pageable, long total) {
super(content, pageable, total);
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getResult()
{
return result;
}
public void setResult(String result)
{
this.result = result;
}
}
package com.yeejoin.amos.latentdanger.core.common.response;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
@Data
public class DangerListResponse {
/**
* 隐患id
*/
private Long dangerId;
@Excel(name = "治理进度", orderNum = "1")
private String dangerState;// 治理进度
@Excel(name = "隐患名称", width = 20, orderNum = "2")
private String dangerName;// 隐患名称
@Excel(name = "隐患地点", width = 20, orderNum = "3")
private String structureName;// 隐患地点
private String dangerPosition;// 详细地址
private String structureId;// 建筑Id
@Excel(name = "隐患级别", orderNum = "4")
private String dangerLevel;// 隐患级别
@Excel(name = "治理方式", orderNum = "5")
private String reformType;// 治理方式
private Date deadlineDate;
@Excel(name = "整改期限", width = 20, orderNum = "6")
private String deadline;// 整改期限
@Excel(name = "是否逾期", orderNum = "7")
private String overtimeState;// 是否逾期
@Excel(name = "隐患来源名称", width = 15, orderNum = "8")
private String dangerTypeName;//隐患来源名称
private String dangerType;//隐患来源
/**
* 隐患流程id
*/
private String processInstanceId;
/**
* 可执行人
*/
private String canExecuteUser;
/**
* 隐患发现人
*/
private String discoverUser;
/**
* 执行人
*/
private String executeUser;
/**
* 问题描述
*/
@Excel(name = "问题描述", width = 35, orderNum = "9")
private String problemDescription;
/**
* 原因分析
*/
@Excel(name = "原因分析", width = 35, orderNum = "10")
private String reasonAnalysis;
/**
* 举一反三
*/
@Excel(name = "举一反三", width = 35, orderNum = "11")
private String inferOtherThings;
/**
* 备注
*/
@Excel(name = "备注", width = 35, orderNum = "12")
private String remark;
}
package com.yeejoin.amos.latentdanger.core.common.response;
import lombok.Data;
@Data
public class WebStockResponse {
/**
* 消息类型
*/
private String type;
/**
* 内容
*/
private String content;
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* 基本实体类
* </pre>
* @author DELL
*/
@Data
public class BasicEntity implements Serializable {
private static final long serialVersionUID = -5464322936854328207L;
/**
* id
*/
@TableId(type = IdType.ID_WORKER)
private Long id;
// @CreatedDate
@Column(name = "create_date")
private Date createDate;
// @Id
// @GeneratedValue(strategy = GenerationType.IDENTITY)
// @Column(name = "ID", nullable = false, unique = true)
// public long getId() {
// return id;
// }
//
// public void setId(long id) {
// this.id = id;
// }
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* @author keyong
* @title: LatentDanger
* <pre>
* @description: 隐患表
* </pre>
* @date 2021/1/26 14:03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "p_latent_danger", autoResultMap = true)
@ApiModel(value="LatentDanger", description="隐患信息")
public class LatentDanger extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
* 业务唯一标识
*/
private String businessKey;
/**
* 公司组织机构
*/
private String orgCode;
/**
* 隐患名称
*/
private String dangerName;
private String instanceId;
private Long currentFlowRecordId;
/**
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
private String dangerLevel;
/**
* 隐患等级名称
*/
private String dangerLevelName;
/**
* 隐患地点
*/
private String dangerPosition;
/**
* 隐患类型(1:普通隐患;2:巡检隐患)
*/
private String dangerType;
/**
* 隐患类型名称
*/
private String dangerTypeName;
/**
* 备注
*/
private String remark;
/**
* 整改类型(1:常规整改;2:安措计划;3:延期整改)
*/
private String reformType;
/**
* 整改类型名称
*/
private String reformTypeName;
/**
* 限制时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reformLimitDate;
private Integer overtimeState;
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONObject reformJson;
/**
* 隐患状态(1:待评审;2:待治理;3:安措计划中;4:逾期未治理;5:待验证;6:治理完毕;7:已撤销)
*/
private String dangerState;
/**
* 隐患状态名称
*/
private String dangerStateName;
/**
* 发现人
*/
private String discovererUserId;
private String discovererDepartmentId;
private String photoUrls;
/**
* 是否删除(0:否;1:是)
*/
private Boolean deleted;
/**
* 记录修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateDate;
/**
* 延期治理时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date delayLimitDate;
/**
* 问题描述
*/
private String problemDescription;
/**
* 原因分析
*/
private String reasonAnalysis;
/**
* 举一反三
*/
private String inferOtherThings;
/**
* 检查记录创建的隐患检查项对应id
*/
private Long bizId;
/**
* 建筑id
*/
private Long structureId;
/**
* 建筑名称
*/
private String structureName;
private String instanceKey;
/**
* 业务类型(不同业务创建的隐患以此区分:巡检隐患、防火监督隐患、其他隐患。。。)
*/
private String bizType;
@TableField(exist = false)
private String bizTypeName;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 业务信息
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONObject bizInfo;
/**
* 是否审核状态
*/
@TableField(exist = false)
private Boolean unReviewed;
public Boolean getUnReviewed() {
if ("dangerSubmit".equals(this.getDangerState())) {
return true;
}
return false;
}
/**
* 提交信息
*/
@TableField(exist = false)
private JSONObject flowJson;
/**
* 阶段状态
*/
@TableField(exist = false)
private String processState;
/**
* 阶段状态名称
*/
@TableField(exist = false)
private String processStateName;
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date;
/**
* @author keyong
* @title: LatentDangerFlowRecord
* <pre>
* @description: 隐患工作流记录表
* </pre>
* @date 2021/1/26 14:18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("p_latent_danger_flow_record")
@ApiModel(value="LatentDangerFlowRecord", description="隐患工作流记录信息")
public class LatentDangerFlowRecord extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "danger_id")
private Long dangerId;
@Column(name = "action_flag")
private String actionFlag;
@Column(name = "flow_task_name")
private String flowTaskName;
@Column(name = "flow_task_user_ids")
private String flowTaskUserIds;
@Column(name = "flow_task_id")
private String flowTaskId;
@Column(name = "execute_state")
private Integer executeState;
@Column(name = "execute_user_id")
private String executeUserId;
@Column(name = "execute_user_name")
private String executeUserName;
@Column(name = "execute_result")
private String executeResult;
@Column(name = "remark")
private String remark;
@Column(name = "flow_json")
private String flowJson;
/**
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Boolean deleted = false;
/**
* 记录修改时间
*/
@Column(name = "update_date")
private Date updateDate;
@Column(name = "execute_department_id")
private String executeDepartmentId;
@Column(name = "execute_department_name")
private String executeDepartmentName;
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.Transient;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import java.util.Date;
/**
* @author keyong
* @title: LatentDangerPatrol
* <pre>
* @description: 隐患巡检关系表
* </pre>
* @date 2021/1/26 14:51
*/
@TableName("cb_latent_danger_patrol")
@Data
public class LatentDangerPatrol extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "latent_danger_id")
private Long latentDangerId;
@Column(name = "point_classify_id")
private Long pointClassifyId;
@Column(name = "check_id")
private Long checkId;
@Column(name = "item_id")
private Long itemId;
@Column(name = "point_id")
private Long pointId;
@Column(name = "route_id")
private Long routeId;
@Column(name = "risk_factor_flow_id")
private String riskFactorFlowId;
@Column(name = "route_point_item_id")
private Long routePointItemId;
/**
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Integer deleted;
/**
* 检查类型-交大字段,只是前段显示用
*/
@Transient
private String checkType;
/**
* 记录修改时间
*/
@Column(name = "update_date")
private Date updateDate;
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* @author keyong
* @title: LatentDangerPhoto
* <pre>
* @description: 隐患图片
* </pre>
* @date 2021/1/26 14:50
*/
@TableName("cb_latent_danger_photo")
@Data
public class LatentDangerPhoto extends BasicEntity {
private static final long serialVersionUID = 1L;
@Column(name = "biz_code")
private String bizCode;
@Column(name = "url")
private String url;
@Column(name = "biz_id")
private Long bizId;
@Column(name = "deleted")
private String deleted;
@Column(name = "update_date")
private String updateDate;
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
* 消息
*
* @author Administrator
*/
@TableName("p_msg")
public class Msg extends BasicEntity {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 标题
*/
@Column(name = "title")
private String title;
/**
* 消息
*/
@Lob
@Column(name = "body")
private String body;
private String pushBody;
/**
* 接收人名称
*/
@Column(name = "reciver_name")
private String reciverName;
/**
* 接收人ID
*/
@Column(name = "user_id")
private String userId;
/**
* 消息类型:对应MsgTypeEnum类,
*/
@Column(name = "msg_type")
private String msgType;
/**
* 发送状态0:未发送;1:已发送
*/
@Column(name = "status")
private int status = 1;
/**
* 发送时间
*/
@Column(name = "send_time")
private Date sendTime;
/**
* 关联id:巡检点;任务;计划
*/
@Column(name = "relation_id")
private Long relationId;
/**
* 发送方式true 按用户设置时间发送(主要针对任务提醒和消息发送),false 定时器发送
*/
@Column(name = "is_immediately")
private boolean isImmediately = true;
/**
* 定点发送时间
*/
@Column(name = "fixed_time")
private Date fixedTime;
/**
* 组织机构
*/
@Column(name = "org_code")
private String orgCode;
/**
* 是否已读
*/
@Column(name = "is_read")
private boolean isRead = false;
/**
* 接收消息电话号码
*/
@Column(name = "target_tel")
private String targetTel;
/**
* 创建者
*/
@Column(name = "create_by")
private Long createBy;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Date getSendTime() {
return sendTime;
}
public void setSendTime(Date sendTime) {
this.sendTime = sendTime;
}
public Long getRelationId() {
return relationId;
}
public void setRelationId(Long relationId) {
this.relationId = relationId;
}
public boolean getIsImmediately() {
return isImmediately;
}
public void setIsImmediately(boolean isImmediately) {
this.isImmediately = isImmediately;
}
public Date getFixedTime() {
return fixedTime;
}
public void setFixedTime(Date fixedTime) {
this.fixedTime = fixedTime;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public boolean getIsRead() {
return isRead;
}
public void setIsRead(boolean isRead) {
this.isRead = isRead;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getTargetTel() {
return targetTel;
}
public void setTargetTel(String targetTel) {
this.targetTel = targetTel;
}
public Long getCreateBy() {
return createBy;
}
public void setCreateBy(Long createBy) {
this.createBy = createBy;
}
@Transient
public String getPushBody() {
return pushBody;
}
public void setPushBody(String pushBody) {
this.pushBody = pushBody;
}
public String getReciverName() {
return reciverName;
}
public void setReciverName(String reciverName) {
this.reciverName = reciverName;
}
}
package com.yeejoin.amos.latentdanger.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
* 消息订阅设置实体
*
* @author gaodongdong
*/
@TableName("p_msg_subscribe")
public class MsgSubscribe extends BasicEntity {
/**
*
*/
private static final long serialVersionUID = -3679029984718140789L;
@Column(name = "org_code")
private String orgCode; // 公司ID
@Column(name = "user_id")
private String userId; // 用户ID
@Column(name = "msg_type")
private String msgType; // 消息类型
@Column(name = "attribute1")
private String attribute1; // 消息属性
@Column(name = "attribute2")
private String attribute2;
@Column(name = "attribute3")
private String attribute3;
@Column(name = "attribute4")
private String attribute4;
@Column(name = "attribute5")
private String attribute5;
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
public String getAttribute1() {
return attribute1;
}
public void setAttribute1(String attribute1) {
this.attribute1 = attribute1;
}
public String getAttribute2() {
return attribute2;
}
public void setAttribute2(String attribute2) {
this.attribute2 = attribute2;
}
public String getAttribute3() {
return attribute3;
}
public void setAttribute3(String attribute3) {
this.attribute3 = attribute3;
}
public String getAttribute4() {
return attribute4;
}
public void setAttribute4(String attribute4) {
this.attribute4 = attribute4;
}
public String getAttribute5() {
return attribute5;
}
public void setAttribute5(String attribute5) {
this.attribute5 = attribute5;
}
}
package com.yeejoin.amos.patrol.common.enums;
import io.swagger.models.auth.In;
public enum LatentDangerLevelEnum {
安全问题("安全问题", 0, "0"),
......@@ -64,4 +66,13 @@ public enum LatentDangerLevelEnum {
}
return null;
}
public static LatentDangerLevelEnum getByCode(String code) {
for (LatentDangerLevelEnum l : LatentDangerLevelEnum.values()) {
if (l.getCode().equals(Integer.parseInt(code))) {
return l;
}
}
return null;
}
}
......@@ -44,4 +44,13 @@ public enum LatentDangerReformTypeEnum {
}
return null;
}
public static LatentDangerReformTypeEnum getByCode(String code) {
for (LatentDangerReformTypeEnum l : LatentDangerReformTypeEnum.values()) {
if (l.getCode().equals(Integer.parseInt(code))) {
return l;
}
}
return null;
}
}
......@@ -60,4 +60,13 @@ public enum LatentDangerStateEnum {
}
return null;
}
public static LatentDangerStateEnum getByCode(String code) {
for (LatentDangerStateEnum l : LatentDangerStateEnum.values()) {
if (l.getCode().equals(Integer.parseInt(code))) {
return l;
}
}
return null;
}
}
......@@ -56,4 +56,13 @@ public enum LatentDangerTypeEnum {
}
return null;
}
public static LatentDangerTypeEnum getByCode(String code) {
for (LatentDangerTypeEnum l : LatentDangerTypeEnum.values()) {
if (l.getCode().equals(Integer.parseInt(code))) {
return l;
}
}
return null;
}
}
package com.yeejoin.amos.patrol.dao.entity;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -21,6 +29,10 @@ import java.util.Date;
@NamedQuery(name = "LatentDanger.findAll", query = "SELECT c FROM LatentDanger c")
@Where(clause = "deleted=0") //表示未删除的数据
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "p_latent_danger", autoResultMap = true)
@ApiModel(value="LatentDanger", description="隐患信息")
public class LatentDanger extends BasicEntity {
private static final long serialVersionUID = 1L;
......@@ -53,7 +65,13 @@ public class LatentDanger extends BasicEntity {
* 隐患等级(1:一般隐患;2:重大隐患;0:安全问题)
*/
@Column(name = "danger_level")
private Integer dangerLevel;
private String dangerLevel;
/**
* 隐患等级名称
*/
@Column(name = "danger_level_name")
private String dangerLevelName;
/**
* 隐患地点
......@@ -65,7 +83,13 @@ public class LatentDanger extends BasicEntity {
* 隐患类型(1:普通隐患;2:巡检隐患)
*/
@Column(name = "danger_type")
private Integer dangerType;
private String dangerType;
/**
* 隐患类型名称
*/
@Column(name = "danger_type_name")
private String dangerTypeName;
/**
* 备注
......@@ -77,12 +101,19 @@ public class LatentDanger extends BasicEntity {
* 整改类型(1:常规整改;2:安措计划;3:延期整改)
*/
@Column(name = "reform_type")
private Integer reformType;
private String reformType;
/**
* 整改类型名称
*/
@Column(name = "reform_type_name")
private String reformTypeName;
/**
* 限制时间
*/
@Column(name = "reform_limit_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reformLimitDate;
@Column(name = "overtime_state")
......@@ -95,7 +126,13 @@ public class LatentDanger extends BasicEntity {
* 隐患状态(1:待评审;2:待治理;3:安措计划中;4:逾期未治理;5:待验证;6:治理完毕;7:已撤销)
*/
@Column(name = "danger_state")
private Integer dangerState;
private String dangerState;
/**
* 隐患状态名称
*/
@Column(name = "danger_state_name")
private String dangerStateName;
/**
* 发现人
......@@ -113,18 +150,20 @@ public class LatentDanger extends BasicEntity {
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Integer deleted;
private Boolean deleted;
/**
* 记录修改时间
*/
@Column(name = "update_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateDate;
/**
* 延期治理时间
*/
@Column(name = "delay_limit_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date delayLimitDate;
/**
......@@ -148,7 +187,73 @@ public class LatentDanger extends BasicEntity {
/**
* 检查记录创建的隐患检查项对应id
*/
@Column(name = "check_input_id")
private Long checkInputId;
@Column(name = "biz_id")
private Long bizId;
/**
* 建筑id
*/
private Long structureId;
/**
* 建筑名称
*/
private String structureName;
private String instanceKey;
/**
* 业务类型(不同业务创建的隐患以此区分:巡检隐患、防火监督隐患、其他隐患。。。)
*/
private String bizType;
@TableField(exist = false)
private String bizTypeName;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 业务信息
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private JSONObject bizInfo;
/**
* 是否审核状态
*/
@TableField(exist = false)
private Boolean unReviewed;
public Boolean getUnReviewed() {
if ("dangerSubmit".equals(this.getDangerState())) {
return true;
}
return false;
}
/**
* 提交信息
*/
@TableField(exist = false)
private JSONObject flowJson;
/**
* 阶段状态
*/
@TableField(exist = false)
private String processState;
/**
* 阶段状态名称
*/
@TableField(exist = false)
private String processStateName;
}
package com.yeejoin.amos.patrol.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Where;
import javax.persistence.Column;
......@@ -22,6 +26,10 @@ import java.util.Date;
@NamedQuery(name = "LatentDangerFlowRecord.findAll", query = "SELECT c FROM LatentDangerFlowRecord c")
@Where(clause = "deleted=0") //表示未删除的数据
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("p_latent_danger_flow_record")
@ApiModel(value="LatentDangerFlowRecord", description="隐患工作流记录信息")
public class LatentDangerFlowRecord extends BasicEntity {
private static final long serialVersionUID = 1L;
......@@ -40,14 +48,17 @@ public class LatentDangerFlowRecord extends BasicEntity {
@Column(name = "flow_task_id")
private String flowTaskId;
@Column(name = "excute_state")
private Integer excuteState;
@Column(name = "execute_state")
private Integer executeState;
@Column(name = "excute_user_id")
private String excuteUserId;
@Column(name = "execute_user_id")
private String executeUserId;
@Column(name = "excute_result")
private String excuteResult;
@Column(name = "execute_user_name")
private String executeUserName;
@Column(name = "execute_result")
private String executeResult;
@Column(name = "remark")
private String remark;
......@@ -59,7 +70,7 @@ public class LatentDangerFlowRecord extends BasicEntity {
* 是否删除(0:否;1:是)
*/
@Column(name = "deleted")
private Integer deleted;
private Boolean deleted = false;
/**
* 记录修改时间
......@@ -67,7 +78,9 @@ public class LatentDangerFlowRecord extends BasicEntity {
@Column(name = "update_date")
private Date updateDate;
@Column(name = "excute_department_id")
private String excuteDepartmentId;
@Column(name = "execute_department_id")
private String executeDepartmentId;
@Column(name = "execute_department_name")
private String executeDepartmentName;
}
......@@ -224,6 +224,8 @@ public class InputItem extends BasicEntity {
/**
* 检查类别IDS
*/
private String ext;
@Column(name = "item_type_classify_ids")
private String itemTypeClassifyIds;
......@@ -515,6 +517,11 @@ public class InputItem extends BasicEntity {
this.checkTypeId = checkTypeId;
}
@Transient
public String getExt() {
return ext;
}
public String getItemTypeClassifyIds() {
return itemTypeClassifyIds;
}
......
......@@ -82,6 +82,8 @@ public class AlertCalledQueryDto {
@ApiModelProperty(value = "条数")
private Integer pageSize;
@ExcelIgnore
@ApiModelProperty(value = "ID")
private Long sequenceNbr;
}
......@@ -57,4 +57,10 @@ public class AlertPaperInfoDto {
@ApiModelProperty(value = "状态信息")
private String alertStatus;
@ApiModelProperty(value = "电梯id")
private String elevatorId;
@ApiModelProperty(value = "电梯设备编码")
private String elevatorCode;
}
......@@ -118,4 +118,7 @@ public class DispatchPaperDto extends BaseDto {
@ApiModelProperty(value = "到达反馈方式code")
private String arriveFeedbackCode;
@ApiModelProperty(value = "救出时间-- 冗余字段便于查询")
private Date saveTime;
}
......@@ -22,6 +22,9 @@ public class WechatDispatchFeedbackDto {
@ApiModelProperty(value = "维修结果")
private String fixResult;
@ApiModelProperty(value = "处置结果")
private String dealResult;
@ApiModelProperty(value = "电梯故障原因分类")
private String errorResult;
......
......@@ -134,4 +134,10 @@ public class WechatMyTaskDto {
@ApiModelProperty(value = "处置结果")
private String actionResult;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
}
......@@ -217,5 +217,9 @@ public class DispatchPaper extends BaseEntity {
@TableField("arrive_feedback_code")
private String arriveFeedbackCode;
/**
* 救出时间-- 冗余字段便于查询
*/
@TableField("save_time")
private Date saveTime;
}
......@@ -16,4 +16,11 @@ public interface IElevatorService extends IService<Elevator> {
* @return
*/
Elevator selectByAlertId(Long alertId);
/**
* 根据电梯id 生成电梯二维码
* @param elevatorId
* @return
*/
String saveElevatorQrCode(Long elevatorId);
}
......@@ -178,6 +178,7 @@
<select id="queryAlertListByQueryDto" resultType="java.util.Map">
SELECT
a.sequence_nbr AS sequenceNbr,
a.work_order_number AS workOrderNumber,
a.rec_user_name AS
creator,
......@@ -439,6 +440,7 @@
e.address,
e.rescue_code as rescueCode,
p.dispatch_time as dispatchTime,
p.save_time as saveTime,
e.use_unit as useUnit,
e.use_unit_id as useUnitId,
e.use_unit_authority as useUnitAuthority,
......
......@@ -45,6 +45,7 @@
e.address,
e.rescue_code as rescueCode,
p.dispatch_time as dispatchTime,
p.save_time as saveTime,
e.use_unit as useUnit,
e.use_unit_id as useUnitId,
e.use_unit_authority as useUnitAuthority,
......@@ -61,7 +62,9 @@
p.feedback_uname as feedbackUname,
p.feedback_finish_time as dealTime,
p.deal_org_name as dealOrg,
p.deal_user as dealUser
p.deal_user as dealUser,
e.longitude as longitude,
e.latitude as latitude
from tz_dispatch_task t
LEFT JOIN tz_alert_called a on a.sequence_nbr = t.alert_id
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id
......
......@@ -24,5 +24,6 @@
<module>amos-boot-module-maintenance-api</module>
<module>amos-boot-module-supervision-api</module>
<module>amos-boot-module-knowledgebase-api</module>
<module>amos-boot-module-latentdanger-api</module>
</modules>
</project>
\ No newline at end of file
......@@ -11,7 +11,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.dto.CheckObjectDto;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgDepartmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.UserDto;
import com.yeejoin.amos.boot.module.common.api.dto.UserUnitDto;
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.feign.EquipFeignClient;
......@@ -19,13 +27,16 @@ import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.UserOrgTreeModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -95,12 +106,12 @@ public class OrgUsrController extends BaseController {
OrgUsr tempOrg = iOrgUsrService.getById(id.toString());
if(tempOrg.getBizOrgType().equals("COMPANY") || tempOrg.getBizOrgType().equals("DEPARTMENT")) {
List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false));
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 start*/
List<FireTeam> fireTeams = fireTeamMapper.listFireTeamById(id);
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 start*/
List<FireTeam> fireTeams = fireTeamMapper.byTeamId(id);
if(tempList.size() > 0 || fireTeams.size() > 0 ) {
return ResponseHelper.buildResponse("-1");
}
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 end*/
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-13 end*/
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
......@@ -325,6 +336,19 @@ public class OrgUsrController extends BaseController {
}
/**
* 获取当前登陆人所在机场单位人员
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/company/users/{orgUnitId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据amos userid获取单位", notes = "根据amos userid获取单位")
public ResponseModel<List<OrgUsr>> selectCompanyUsers(@PathVariable Long orgUnitId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectCompanyUsers(orgUnitId));
}
/**
* 根据名称模糊匹配
*
* @param name
......@@ -481,5 +505,16 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.amosIdExist(amosId));
}
/**
* 根据机场人员id获取amos平台人员id
*
* @param
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/amos/{orgUserId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据机场人员id获取amos平台人员信息", notes = "根据机场人员id获取amos平台人员信息")
public ResponseModel<AgencyUserModel> getAmosIdByOrgUserId(@PathVariable String orgUserId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getAmosIdByOrgUserId(orgUserId));
}
}
\ No newline at end of file
......@@ -93,6 +93,11 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
* 新增
***/
public FireStationDto add(FireStationDto model) {
/*bug 3072 微型消防站,新增页面多次点击保存报主键重复错误 2021-10-13 chenzhao */
if (model.getSequenceNbr() != null){
Update(model);
}
/*bug 3072 微型消防站,新增页面多次点击保存报主键重复错误 2021-10-13 chenzhao */
if (model.getBizCompanyId() != null) {
OrgUsr orgUsr = orgUsrMapper.selectById(model.getBizCompanyId());
......
......@@ -7,6 +7,8 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
......@@ -42,6 +44,8 @@ import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ESAlertCalledService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.swing.plaf.basic.BasicViewportUI;
/**
* 警情接警记录
*
......@@ -61,7 +65,8 @@ public class AlertCalledController extends BaseController {
private ESAlertCalledService eSAlertCalledService;
@Autowired
RedisUtils redisUtils;
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
@Value("${redis.cache.failure.time}")
......@@ -163,7 +168,7 @@ public class AlertCalledController extends BaseController {
/* bug2408 筛选参数解析异常 修改筛选条件方法 修改入参分离筛选条件
alertStatus 警情状态 alertTypeCode 报警类型code alertSourceCode 警情来源code
陈召 2021-08-21 开始*/
IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus, alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd,sort);
IPage<AlertCalled> alertCalledIPage = iAlertCalledService.queryForCalledList(page, alertStatus,alertTypeCode, alertSourceCode, callTimeStart, callTimeEnd,sort);
/* bug 2406 接警记录,列表缺少警情状态字段 by litw start*/
alertCalledIPage.getRecords().stream().forEach(e->{
if(e.getAlertStatus()) {
......@@ -197,7 +202,18 @@ public class AlertCalledController extends BaseController {
@RequestBody ESAlertCalledRequestDto alertCalledVo,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception {
return ResponseHelper.buildResponse(eSAlertCalledService.queryByKeys(alertCalledVo, current, size));
/*bug 3090 警情填报,相似警情中响应级别错误显示为code 2021-10-13 chenzhao */
Page<ESAlertCalledDto> esAlertCalledDtoPage = eSAlertCalledService.queryByKeys(alertCalledVo, current, size);
List<ESAlertCalledDto> records = esAlertCalledDtoPage.getRecords();
for (ESAlertCalledDto record : records) {
if (record.getResponseLevelCode() != null){
DataDictionary byCode = dataDictionaryService.getByCode(record.getResponseLevelCode(),"XYJBR");
record.setResponseLevel(byCode.getName());
}
}
/*bug 3090 警情填报,相似警情中响应级别错误显示为code 2021-10-13 chenzhao */
return ResponseHelper.buildResponse(esAlertCalledDtoPage);
}
/**
......
......@@ -96,7 +96,7 @@ public class ExcelController extends BaseController {
e.printStackTrace();
throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日
}catch (Exception e){
throw new RuntimeException("系统异常!");
throw new BadRequest("文件格式不正确或excel 模板不匹配!");
}
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SourceFileServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportDto;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.OrgUsrSafeReportServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
/**
* 机场单位消防安全报告
*
* @author litw
* @date 2021-10-09
*/
@RestController
@Api(tags = "机场单位消防安全报告Api")
@RequestMapping(value = "/org-usr-safe-report")
public class OrgUsrSafeReportController extends BaseController {
@Autowired
OrgUsrSafeReportServiceImpl orgUsrSafeReportServiceImpl;
@Autowired
SourceFileServiceImpl sourceFileService;
/**
* 新增机场单位消防安全报告
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增机场单位消防安全报告", notes = "新增机场单位消防安全报告")
public ResponseModel<OrgUsrSafeReportDto> save(@RequestBody OrgUsrSafeReportDto model) {
model = orgUsrSafeReportServiceImpl.createWithModel(model);
if (ObjectUtils.isNotEmpty(model.getAttachments())) {
saveAttachments(model);
}
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/updateById")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新机场单位消防安全报告", notes = "根据sequenceNbr更新机场单位消防安全报告")
public ResponseModel<OrgUsrSafeReportDto> updateBySequenceNbrOrgUsrSafeReport(@RequestBody OrgUsrSafeReportDto model) {
if (ObjectUtils.isNotEmpty(model.getAttachments())) {
saveAttachments(model);
}
return ResponseHelper.buildResponse(orgUsrSafeReportServiceImpl.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(orgUsrSafeReportServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个机场单位消防安全报告", notes = "根据sequenceNbr查询单个机场单位消防安全报告")
public ResponseModel<OrgUsrSafeReportDto> selectOne(@PathVariable Long sequenceNbr) {
OrgUsrSafeReportDto dto = orgUsrSafeReportServiceImpl.queryBySeq(sequenceNbr);
dto.setAttachments(sourceFileService.getAttachments(sequenceNbr));
return ResponseHelper.buildResponse(dto);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "机场单位消防安全报告分页查询", notes = "机场单位消防安全报告分页查询")
public ResponseModel<Page<OrgUsrSafeReportDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size, OrgUsrSafeReportDto orgUsrSafeReportDto) {
Page<OrgUsrSafeReportDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(orgUsrSafeReportServiceImpl.queryForOrgUsrSafeReportPage(page,
orgUsrSafeReportDto.getName(),
orgUsrSafeReportDto.getType(),
orgUsrSafeReportDto.getTakeEffectYear(),
orgUsrSafeReportDto.getCompanyId()));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "机场单位消防安全报告列表全部数据查询", notes = "机场单位消防安全报告列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<OrgUsrSafeReportDto>> selectForList() {
return ResponseHelper.buildResponse(orgUsrSafeReportServiceImpl.queryForOrgUsrSafeReportList());
}
public void saveAttachments(OrgUsrSafeReportDto orgUsrSafeReportDto) {
if (!ValidationUtil.isEmpty(orgUsrSafeReportDto.getAttachments())) {
List<SourceFile> sourceFiles = Lists.newArrayList();
Map<String, List<AttachmentDto>> attachmentMap = orgUsrSafeReportDto.getAttachments();
attachmentMap.entrySet().forEach(entry -> {
List<AttachmentDto> atts = entry.getValue();
sourceFiles.addAll(attachment2SourceFile(entry.getKey(), atts));
});
sourceFileService.saveSourceFile(orgUsrSafeReportDto.getSequenceNbr(), sourceFiles);
}
}
private List<SourceFile> attachment2SourceFile(String type, List<AttachmentDto> attachmentDtoList) {
List<SourceFile> sourceFiles = Lists.newArrayList();
if (!ValidationUtil.isEmpty(attachmentDtoList)) {
attachmentDtoList.forEach(a -> {
SourceFile s = new SourceFile();
s.setFilePath(a.getUrl());
s.setFileName(a.getName());
s.setFileCategory(type);
sourceFiles.add(s);
});
}
return sourceFiles;
}
}
......@@ -358,19 +358,30 @@ public class DataSourcesImpl implements DataSources {
FeignClientResult<java.util.Collection<RegionModel>> region = Systemctl.regionClient.queryForTreeParent(null);
java.util.Collection<RegionModel> regions = region.getResult();// 以及地址
List<String> address = new ArrayList<>();
setAddress(address,regions);
setAddress("",address,regions);
String[] str = address.toArray(new String[address.size()]);
return str;
}
private void setAddress(List<String> address, Collection<RegionModel> regions) {
regions.stream().forEach(item -> {
private void setAddress(String name,List<String> address, Collection<RegionModel> regions) {
for (RegionModel item : regions) {
//添加自己的
address.add(item.getRegionName() + "@" + item.getSequenceNbr());
address.add(name+" "+item.getRegionName() + "@" + item.getSequenceNbr());
if(item.getChildren() != null && item.getChildren().size() > 0) {
setAddress(address,item.getChildren());
setAddress(name+" "+item.getRegionName() ,address,item.getChildren());
}
});
}
// regions.stream().forEach(item -> {
// //添加自己的
// name =name+item.getRegionName();
// address.add(name + "@" + item.getSequenceNbr());
// if(item.getChildren() != null && item.getChildren().size() > 0) {
// setAddress(name ,address,item.getChildren());
// }
// });
}
private String[] getDutyArea() {
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
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.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
......@@ -106,11 +78,39 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.RescueEquipmentServi
import com.yeejoin.amos.boot.module.common.biz.service.impl.SpecialPositionStaffServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.OrgUsrSafeReportExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.OrgUsrSafeReport;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author tb
......@@ -183,6 +183,9 @@ public class ExcelServiceImpl {
@Autowired
IDutyFireFightingService dutyFireFightingService;
@Autowired
OrgUsrSafeReportServiceImpl orgUsrSafeReportService;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl();
Class<?> clz = Class.forName(url);
......@@ -321,6 +324,9 @@ public class ExcelServiceImpl {
case "WXXFZB":
excelImportDutyPerson(multipartFile, "WXXFZB");
break;
case "XFAQBG":
excelImportSafeReport(multipartFile);
break;
}
return;
}
......@@ -945,6 +951,32 @@ public class ExcelServiceImpl {
}
}
private void excelImportSafeReport(MultipartFile multipartFile) throws Exception {
String fileName = multipartFile.getOriginalFilename();
if (fileName == null) {
throw new Exception("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new Exception("文件类型异常!");
}
List<OrgUsrSafeReportExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, OrgUsrSafeReportExcelDto.class, 1);
List<OrgUsrSafeReport> excelEntityList = new ArrayList<>();
excelDtoList.forEach(fireExpertsDto -> {
OrgUsrSafeReport reportExcel= new OrgUsrSafeReport();
reportExcel = Bean.toPo(fireExpertsDto, reportExcel);
reportExcel = Bean.toPo(getCurrentInfo(), reportExcel);
if (reportExcel.getCompany() != null) {
String[] compandyArr = reportExcel.getCompany().split("@");
reportExcel.setCompany(compandyArr[0]);
reportExcel.setCompanyId(Long.valueOf(compandyArr[1]));
}
excelEntityList.add(reportExcel);
});
orgUsrSafeReportService.saveBatch(excelEntityList);
}
private void initDutyCarData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
// 遍历行,i = 1,从第二行开始,第一行是表头跳过。
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment