Commit 517a8d98 authored by kongfm's avatar kongfm

Merge branch 'developer' into chenhao

parents 20555c9b bdc92b74
......@@ -12,13 +12,13 @@ import lombok.AllArgsConstructor;
public enum HomePageEnum {
DISPATCHALARM("dispatchAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
DISPATCHTASK("dispatchTask", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
FIREALARM("fireAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
FAULT("fault", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
SHIELD("shield", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
WARNING("warning", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
NO("no", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
YES("yes", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl");
DISPATCHTASK("dispatchTask", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchTaskServiceImpl"),
FIREALARM("fireAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireAlarmServiceImpl"),
FAULT("fault", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.FaultServiceImpl"),
SHIELD("shield", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.ShieldServiceImpl"),
WARNING("warning", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.WarningServiceImpl"),
NO("no", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.NoServiceImpl"),
YES("yes", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.YesServiceImpl");
......
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 + '\'' +
'}';
}
}
package com.yeejoin.amos.boot.biz.common.utils;
import sun.reflect.ConstructorAccessor;
import sun.reflect.FieldAccessor;
import sun.reflect.ReflectionFactory;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DynamicEnumUtils {
private static ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory();
private static void setFailsafeFieldValue(Field field, Object target, Object value) throws NoSuchFieldException,
IllegalAccessException {
// 反射访问私有变量
field.setAccessible(true);
/**
* 接下来,我们将字段实例中的修饰符更改为不再是final,
* 从而使反射允许我们修改静态final字段。
*/
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
int modifiers = modifiersField.getInt(field);
// 去掉修饰符int中的最后一位
modifiers &= ~Modifier.FINAL;
modifiersField.setInt(field, modifiers);
FieldAccessor fa = reflectionFactory.newFieldAccessor(field, false);
fa.set(target, value);
}
private static void blankField(Class<?> enumClass, String fieldName) throws NoSuchFieldException,
IllegalAccessException {
for (Field field : Class.class.getDeclaredFields()) {
if (field.getName().contains(fieldName)) {
AccessibleObject.setAccessible(new Field[]{field}, true);
setFailsafeFieldValue(field, enumClass, null);
break;
}
}
}
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException {
blankField(enumClass, "enumConstantDirectory"); // Sun (Oracle?!?) JDK 1.5/6
blankField(enumClass, "enumConstants"); // IBM JDK
}
private static ConstructorAccessor getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes)
throws NoSuchMethodException {
Class<?>[] parameterTypes = new Class[additionalParameterTypes.length + 2];
parameterTypes[0] = String.class;
parameterTypes[1] = int.class;
System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length);
return reflectionFactory.newConstructorAccessor(enumClass.getDeclaredConstructor(parameterTypes));
}
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));
}
/**
* 将枚举实例添加到作为参数提供的枚举类中
*
* @param enumType 要修改的枚举类型
* @param enumName 添加的枚举类型名字
* @param additionalTypes 枚举类型参数类型列表
* @param additionalValues 枚举类型参数值列表
* @param <T>
*/
@SuppressWarnings("unchecked")
public static <T extends Enum<?>> void addEnum(Class<T> enumType, String enumName, Class<?>[] additionalTypes, Object[] additionalValues) {
// 0. 检查类型
if (!Enum.class.isAssignableFrom(enumType)) {
throw new RuntimeException("class " + enumType + " is not an instance of Enum");
}
// 1. 在枚举类中查找“$values”持有者并获取以前的枚举实例
Field valuesField = null;
Field[] fields = enumType.getDeclaredFields();
for (Field field : fields) {
if (field.getName().contains("$VALUES")) {
valuesField = field;
break;
}
}
AccessibleObject.setAccessible(new Field[]{valuesField}, true);
try {
// 2. 将他拷贝到数组
T[] previousValues = (T[]) valuesField.get(enumType);
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
// 3. 创建新的枚举项
T newValue = (T) makeEnum(enumType, enumName, values.size(), additionalTypes, additionalValues);
// 4. 添加新的枚举项
values.add(newValue);
// 5. 设定拷贝的数组,到枚举类型
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
// 6. 清楚枚举的缓存
cleanEnumCache(enumType);
} 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
......@@ -46,4 +46,17 @@ public class DutyCarDto implements Serializable {
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift = new ArrayList<>();
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ApiModelProperty(value = "值班结束时间")
private String endTime;
// 需求 958 新增值班区域 值班区域id 字段 前台保存字段 by kongfm 2021-09-15
@ApiModelProperty(value = "值班区域")
private String dutyArea;
@ApiModelProperty(value = "值班区域Id")
private String dutyAreaId;
}
......@@ -62,4 +62,9 @@ public class DutyCarExcelDto implements Serializable {
@ExcelProperty(value = "车辆名称(车牌)", index = 4)
@ApiModelProperty(value = "车辆名称")
private String carName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = RoleNameExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
}
......@@ -39,4 +39,17 @@ public class DutyPersonDto implements Serializable {
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ApiModelProperty(value = "值班结束时间")
private String endTime;
// 需求 958 新增值班区域 值班区域id 字段 前台保存字段 by kongfm 2021-09-15
@ApiModelProperty(value = "值班区域")
private String dutyArea;
@ApiModelProperty(value = "值班区域Id")
private String dutyAreaId;
}
......@@ -52,4 +52,9 @@ public class DutyPersonExcelDto implements Serializable {
@ExcelProperty(value = "岗位", index = 4)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = RoleNameExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZeHua Li
* @date 2020/9/8 13:46
* @since v2.0
*/
@Data
public class EquipmentDetailDownloadTemplateDto implements Serializable {
@ExcelProperty(value = "器材名称", index = 0)
// @Excel(name = "器材名称", width = 30, orderNum = "1")
private String name;
@ExcelProperty(value = "器材编码(从装备定义中获取)", index = 1)
//@Excel(name = "器材编码(从装备定义中获取)", width = 30, orderNum = "2")
private String code;
@ExcelProperty(value = "规格型号", index = 2)
//@Excel(name = "规格型号", width = 30, orderNum = "3")
private String standard;
@ExcelProperty(value = "品牌", index = 3)
//@Excel(name = "品牌", width = 30, orderNum = "4")
private String brand;
@ExcelProperty(value = "生产厂家名称", index = 4)
//@Excel(name = "生产厂家名称", width = 30, orderNum = "5")
private String manufacturerName;
@ExcelProperty(value = "设备编码", index = 5)
//@Excel(name = "设备编码", width = 30, orderNum = "6")
private String systemCode;
@ExcelProperty(value = "物联编码", index = 6)
//@Excel(name = "物联编码", width = 30, orderNum = "7")
private String iotCode;
@ExcelProperty(value = "存放位置(货位编码)", index = 7)
//@Excel(name = "存放位置(货位编码)", width = 30, orderNum = "8")
private String warehouseStructCode;
@ExcelProperty(value = "位置信息", index = 8)
//@Excel(name = "位置信息", width = 30, orderNum = "9")
private String description;
@ExcelProperty(value = "消防系统编码", index = 9)
//@Excel(name = "消防系统编码", width = 30, orderNum = "10")
private String fightingSysCodes;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExcelProperty(value = "所属队伍", index = 10)
//@Excel(name = "所属队伍",width = 30,orderNum = "11")
private String fireTeam;
//动态下拉内容
@ExplicitConstraint(indexNum = 11, sourceClass = RoleNameExplicitConstraint.class,method="getCompany") //动态下拉内容
@ExcelProperty(value = "所属单位", index = 11)
//@Excel(name = "所属单位",width = 30,orderNum = "12")
private String companyName;
}
......@@ -52,46 +52,46 @@ public class FireChemicalDto extends BaseDto {
private String formula;
@ApiModelProperty(value = "主要成分")
@ExcelProperty(value = "主要成分", index = 7)
@ExcelIgnore
private String ingredient;
@ApiModelProperty(value = "泄漏处理")
@ExcelProperty(value = "泄漏处理", index = 8)
@ExcelProperty(value = "泄漏处理", index = 7)
private String leakWay;
@ExcelProperty(value = "中文名", index = 0)
@ApiModelProperty(value = "中文名")
private String name;
@ApiModelProperty(value = "性状")
@ExcelProperty(value = "性状", index = 9)
@ExcelProperty(value = "性状", index = 8)
private String property;
@ApiModelProperty(value = "贮藏方法")
@ExcelProperty(value = "贮藏方法", index = 10)
@ExcelProperty(value = "贮藏方法", index = 9)
private String store;
@ApiModelProperty(value = "症状")
@ExcelProperty(value = "症状", index = 11)
@ExcelProperty(value = "症状", index = 10)
private String symptom;
@ApiModelProperty(value = "禁忌物/禁忌")
@ExcelProperty(value = "禁忌物/禁忌", index = 12)
@ExcelProperty(value = "禁忌物/禁忌", index = 11)
private String tabu;
@ExcelIgnore
@ApiModelProperty(value = "类型code")
private String typeCode;
@ExplicitConstraint(type = "CHEMICALTYPE", indexNum = 13, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "CHEMICALTYPE", indexNum = 12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "类型名称")
@ExcelProperty(value = "类型名称", index = 13)
@ExcelProperty(value = "类型名称", index = 12)
private String type;
// @ExplicitConstraint(indexNum=14,source = {"男","女"}) //固定下拉内容
@ExcelProperty(value = "国标号", index = 14)
@ExcelProperty(value = "国标号", index = 13)
@ApiModelProperty(value = "国标号")
private String un;
@ExcelIgnore
@ApiModelProperty(value = "化学品图片")
@ExcelProperty(value = "化学品图片", index = 15)
private String image;
@ExcelIgnore
@ApiModelProperty(value = "更新时间")
......
......@@ -107,11 +107,13 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "消防专家领域code")
private String expertCode;
@ExcelProperty(value = "人员照片", index = 16)
// @ExcelProperty(value = "人员照片", index = 16)
@ExcelIgnore
@ApiModelProperty(value = "人员照片")
private String personnelPhotos;
@ExcelProperty(value = "资质证书", index = 17)
// @ExcelProperty(value = "资质证书", index = 17)
@ExcelIgnore
@ApiModelProperty(value = "资质证书")
private String qualificationCertificate;
......@@ -131,7 +133,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "消防机构name")
private Long fireTeamName;
@ExcelProperty(value = "备注", index = 18)
@ExcelProperty(value = "备注", index = 16)
@ApiModelProperty(value = "备注")
private String note;
......
......@@ -28,6 +28,7 @@ public class FireTeamDto extends BaseDto {
@ExcelProperty(value = "所属单位", index = 0)
@ApiModelProperty(value = "机构名称")
@ExplicitConstraint(indexNum = 0, sourceClass = RoleNameExplicitConstraint.class,method="getCompanyDetailTree") //动态下拉内容
private String companyName;
@ExcelIgnore
......
package com.yeejoin.amos.boot.module.common.api.dto;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 消防队员
*
......@@ -83,39 +87,42 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "婚姻状况")
private String maritalStatus;
@ExcelIgnore
@ApiModelProperty(value = "籍贯/户口所在地")
private String nativePlace;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "户籍所在地", index = 10)
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue;
@ExplicitConstraint(indexNum = 11, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 11)
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 11)
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 12)
@ApiModelProperty(value = "政治面貌代码")
private String politicalOutlook;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 12)
@ExplicitConstraint(indexNum = 13, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 13)
@ApiModelProperty(value = "现居住地")
private String residence;
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ExcelProperty(value = "现居住地详细地址", index = 14)
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
@ExcelIgnore
@ApiModelProperty(value = "现居住地详情")
private String residenceDetails;
@ExcelProperty(value = "机场住宿情况", index = 13)
@ExcelProperty(value = "机场住宿情况", index = 15)
@ApiModelProperty(value = "机场住宿情况")
private String airportAccommodation;
@ExcelProperty(value = "联系电话", index = 14)
@ExcelProperty(value = "联系电话", index = 16)
@ApiModelProperty(value = "手机")
private String mobilePhone;
@ExplicitConstraint(type = "RYZT", indexNum = 15, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 15)
@ExplicitConstraint(type = "RYZT", indexNum = 17, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 17)
@ApiModelProperty(value = "人员状态,在职/离职")
private String state;
......@@ -123,21 +130,21 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "人员状态,在职/离职字典code")
private String stateCode;
@ExplicitConstraint(type = "GWMC", indexNum = 16, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 16)
@ExplicitConstraint(type = "GWMC", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 18)
@ApiModelProperty(value = "岗位名称")
private String jobTitle;
@ExcelProperty(value = "紧急联系人姓名", index = 17)
@ExcelProperty(value = "紧急联系人姓名", index = 19)
@ApiModelProperty(value = "紧急联系人姓名")
private String emergencyContact;
@ExplicitConstraint(type = "RJGX", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 18)
@ExplicitConstraint(type = "RJGX", indexNum = 20, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 20)
@ApiModelProperty(value = "紧急联系人与本人所属关系")
private String relationship;
@ExcelProperty(value = "紧急联系人电话", index = 19)
@ExcelProperty(value = "紧急联系人电话", index = 21)
@ApiModelProperty(value = "紧急联系人电话")
private String emergencyContactPhone;
......@@ -168,13 +175,88 @@ public class FirefightersExcelDto extends BaseDto {
@ExcelIgnore
@ApiModelProperty(value = "操作人名称")
private String recUserName;
@ExcelIgnore
@ApiModelProperty(value = "岗位资质")
@ApiModelProperty(value = "人员id")
private Long firefightersId;
/*************************岗位职级***********************/
@ApiModelProperty(value = "员工层级")
@ExcelProperty(value = "员工层级", index = 22)
@ExplicitConstraint(type = "YGCJ", indexNum = 22, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
private String employeeHierarchy;
@ApiModelProperty(value = "行政职务")
@ExplicitConstraint(type = "XZZW", indexNum = 23, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "行政职务", index = 23)
private String administrativePosition;
@ApiModelProperty(value = "岗位资质")
@ExplicitConstraint(type = "GWZZ", indexNum = 24, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位资质", index = 24)
private String postQualification;
@ExcelIgnore
@ApiModelProperty(value = "专家领域")
@ApiModelProperty(value = "消防救援人员类别")
@ExplicitConstraint(type = "XFRYLB", indexNum = 25, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防救援人员类别", index = 25)
private String category;
// @ApiModelProperty(value = "消防救援人员状态")
// private String state;
@ApiModelProperty(value = "消防救援衔级别代码")
@ExplicitConstraint(type = "XFJYJB", indexNum = 26, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防救援衔级别代码", index = 26)
private String level;
@ApiModelProperty(value = "消防专家领域")
@ExplicitConstraint(type = "ZJLY", indexNum = 27, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防专家领域", index = 27)
private String areasExpertise;
/*************************学历教育***********************/
@ApiModelProperty(value = "第一学历")
@ExplicitConstraint(type = "XLLX", indexNum = 28, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "第一学历", index = 28)
private String firstDegree;
@ApiModelProperty(value = "最高学历")
@ExplicitConstraint(type = "XLLX", indexNum = 29, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "最高学历", index = 29)
private String highestEducation;
@ApiModelProperty(value = "学位")
@ExplicitConstraint(type = "XWLX", indexNum = 30, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "学位", index = 30)
private String academicDegree;
@ApiModelProperty(value = "毕业院校")
@ExcelProperty(value = "毕业院校", index = 31)
private String school;
@ApiModelProperty(value = "毕业专业名称")
@ExcelProperty(value = "毕业专业名称", index = 32)
private String professionalName;
/*************************工作履历岗***********************/
@ApiModelProperty(value = "参加工作时间")
@ExcelProperty(value = "参加工作时间", index = 33)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workingHours;
@ApiModelProperty(value = "参加消防部门工作时间")
@ExcelProperty(value = "参加消防部门工作时间", index = 34)
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fireWorkingHours;
}
......@@ -51,54 +51,54 @@ public class KeySiteExcleDto implements Serializable {
@ExcelProperty(value = "建筑面积(㎡)", index = 4)
@ApiModelProperty(value = "建筑面积(㎡)")
private String buildingArea;
@ExcelProperty(value = "建筑高度(m)", index = 5)
@ExcelIgnore
@ApiModelProperty(value = "建筑高度(m)")
private String buildingHeight;
@ExplicitConstraint(type = "NHDJ", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "耐火等级", index = 6)
@ExplicitConstraint(type = "NHDJ", indexNum =5, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "耐火等级", index = 5)
@ApiModelProperty(value = "耐火等级")
private String fireEnduranceRate;
@ExplicitConstraint(type = "JZWSYXZ", indexNum =7, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "使用性质", index = 7)
@ExplicitConstraint(type = "JZWSYXZ", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "使用性质", index = 6)
@ApiModelProperty(value = "使用性质")
private String useNature;
@ExcelProperty(value = "责任人", index = 8)
@ExcelProperty(value = "责任人", index = 7)
@ApiModelProperty(value = "责任人")
private String chargePerson;
@ExcelProperty(value = "责任人身份证", index = 9)
@ExcelProperty(value = "责任人身份证", index = 8)
@ApiModelProperty(value = "责任人身份证")
private String chargePersonId;
@ExcelProperty(value = "确定重点防火部位的原因", index = 10)
@ExcelProperty(value = "确定重点防火部位的原因", index = 9)
@ApiModelProperty(value = "确定重点防火部位的原因")
private String keyPreventionReason;
@ExcelProperty(value = "消防设施情况", index = 11)
@ExcelProperty(value = "消防设施情况", index = 10)
@ExplicitConstraint(indexNum=11,source = {"有","无"})
@ApiModelProperty(value = "消防设施情况")
private String fireFacilitiesInfo;
@ExcelProperty(value = "防火标志设立情况", index = 12)
@ExcelProperty(value = "防火标志设立情况", index = 11)
@ApiModelProperty(value = "防火标志设立情况")
private String firePreventionFlagName;
@ExcelProperty(value = "危险源", index = 13)
@ExcelProperty(value = "危险源", index = 12)
@ApiModelProperty(value = "危险源")
private String hazard;
@ExcelProperty(value = "消防安全管理措施", index = 14)
@ExcelProperty(value = "消防安全管理措施", index = 13)
@ApiModelProperty(value = "消防安全管理措施")
private String safetyManagementMeasures;
@ExcelProperty(value = "防范手段措施", index = 15)
@ExcelProperty(value = "防范手段措施", index = 14)
@ApiModelProperty(value = "防范手段措施")
private String preventiveMeasures;
@ExcelProperty(value = "备注", index = 16)
@ExcelProperty(value = "备注", index = 15)
@ApiModelProperty(value = "备注")
private String remark;
}
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
......@@ -306,6 +305,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "物联参数")
private WaterResourceIotDto waterResourceIotDto;
@ExcelIgnore
@ApiModelProperty("设施定义id")
private Long equipId;
......@@ -313,6 +313,7 @@ public class WaterResourceDto extends BaseDto {
@ExcelProperty(value = "设施定义名称", index = 44)
private String equipName;
@ExcelIgnore
@ApiModelProperty("设施分类id")
private Long equipCategoryId;
......
......@@ -122,4 +122,11 @@ public class Firefighters extends BaseEntity {
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue;
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ApiModelProperty(value = "户籍所在地详细地址")
private String nativePlaceVal;
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
}
......@@ -11,6 +11,8 @@ import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.HashMap;
import java.util.Map;
......@@ -30,7 +32,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 10;
private static final Integer LIMIT_NUMBER = 1;
......@@ -88,6 +90,14 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
// 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if(dataValidation instanceof XSSFDataValidation){
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}else{
dataValidation.setSuppressDropDownArrow(false);
}
writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName);
......@@ -95,17 +105,17 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
workbook.setSheetHidden(hiddenIndex, true);
}
}
// 下拉列表约束数据
DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList);
// 阻止输入非下拉选项的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.setShowErrorBox(true);
validation.setSuppressDropDownArrow(true);
validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
sheet.addValidationData(validation);
// // 下拉列表约束数据
// DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// // 设置约束
// DataValidation validation = helper.createValidation(constraint, rangeList);
// // 阻止输入非下拉选项的值
// validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
// validation.setShowErrorBox(true);
// validation.setSuppressDropDownArrow(true);
// validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// // validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
// sheet.addValidationData(validation);
});
}
......
......@@ -11,6 +11,7 @@ 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.LinkedHashMap;
import java.util.List;
import java.util.Map;
......@@ -182,6 +183,21 @@ public interface EquipFeignClient {
* 统计
**/
@RequestMapping(value = "/equipSpecificAlarm/getcountAlarmHandle/{type}", method = RequestMethod.GET)
ResponseModel<Integer> getCountEquipment(@PathVariable String type);
ResponseModel<Integer> getcountAlarmHandle(@PathVariable String type);
/**
* 根据实例id 获取实例信息 // 需求 958 新增值班区域 值班区域id 字段 获取名称 by kongfm 2021-09-15
*
* @return
*/
@RequestMapping(value = "/building/getFormInstanceById", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> getFormInstanceById(@RequestParam Long instanceId);
/**
* 查询所有建筑的数据字典 // 需求 958 新增值班区域 值班区域id 字段 获取下拉列表 by kongfm 2021-09-15
* @return
*/
@RequestMapping(value = "/building/getAllBuilding", method = RequestMethod.GET)
ResponseModel<List<LinkedHashMap<String, Object>>> getAllBuilding();
}
......@@ -86,4 +86,23 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("groupCode") String groupCode);
List<DynamicFormInstance> getInstanceByCodeAndValue(String code, String value);
/**
* 新分页查询带日期过滤// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
*
* @param page 分页信息
* @param appKey 应用
* @param fieldCodes 字段
* @param groupCode 表单类型
* @return IPage<Map < String, Object>>
*/
IPage<Map<String, Object>> pageListNew(
Page page,
@Param("appKey") String appKey,
@Param("fieldCodes") Map<String, Object> fieldCodes,
@Param("groupCode") String groupCode,
@Param("params") Map<String, String> params,
@Param("stratTime") String stratTime,
@Param("endTime") String endTime
);
}
......@@ -39,7 +39,7 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
*
* @return
*/
List<FireBrigadeResourceDto> listMonitorFireBrigade();
List<FireBrigadeResourceDto> listMonitorFireBrigade(@Param("code") String code );
/**
* 查询消防队伍卡片分页列表
......
......@@ -23,6 +23,9 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map);
//BUG 2880 by litw start 2021年9月16日
List<OrgUsr> selectAllChildrenList(@Param("map")Map<String, Object> map);
List<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
......
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.List;
/**
* @author DELL
*/
......@@ -23,4 +25,11 @@ public interface IDutyPersonService extends IDutyCommonService {
* @return List<DutyCarDto>
*/
DutyPersonDto update(Long instanceId, DutyPersonDto dutyPersonDto);
/**
* 根据区域ID 查询此时该区域值班人员 新需求 提供根据区域ID 获取值班人员 by kongfm 2021-09-15
* @param dutyAreaId
* @return
*/
List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId);
}
......@@ -223,7 +223,7 @@ public interface IOrgUsrService {
/**
* 获取登陆人关联机场单位人员信息,部门信息
*/
List<Map<String, Object>> getLoginUserDetails(String userId);
List<Map<String, Object>> getLoginUserDetails(String userId, AgencyUserModel user);
List<OrgUsr> getPersonListByParentId(Long id);
......
......@@ -18,6 +18,7 @@
AND i.field_code = 'userId'
and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate}
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14-->
and s.app_Key = #{appKey}
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay,
......@@ -56,6 +57,7 @@
AND ds.sequence_nbr = s.shift_id
AND i.field_code = 'userName'
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
AND s.app_key = #{appKey}
and i.group_code =#{groupCode}
GROUP BY
......@@ -76,6 +78,7 @@
s.instance_id = i.instance_id
and i.field_code = 'postTypeName'
AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
AND s.app_key = #{appKey}
and i.group_code =#{groupCode}
GROUP BY i.field_value
......
......@@ -198,4 +198,61 @@
</if>
</where>
</select>
<!--不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14-->
<select id="pageListNew" resultType="java.util.Map">
select
d.*
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach collection="fieldCodes" item="value" index="key" separator=",">
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key},
IF(FIND_IN_SET(i.field_type,'radio,select,treeSelect'), MAX(CASE WHEN i.FIELD_CODE = #{key} THEN
i.FIELD_VALUE_LABEL END), null) as ${key}Label
</foreach>
from
cb_dynamic_form_instance i
where
i.GROUP_CODE = #{groupCode}
and i.is_delete = 0
<if test="appKey != null and appKey !=''">
and i.APP_KEY = #{appKey}
</if>
<foreach collection="params" index="key" item="value" separator="">
<if test="key != null and key == 'instanceIds' ">
and find_in_set(i.instance_id, #{value}) > 0
</if>
</foreach>
GROUP by
i.INSTANCE_ID) d
<if test="params != null and params.size() > 0">
where
d.instanceId in (
select tt.instance_id from cb_duty_person_shift tt where tt.duty_date >= #{stratTime}
and tt.duty_date <![CDATA[<=]]> #{endTime}
)
<foreach collection="params" index="key" item="value" separator="">
<choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''">
and d.${key} like concat('%',#{value},'%')
</when>
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value}
</when>
<when test="fieldCodes[key] == 'ge' and value !=null and value !=''">
and d.${key} >= #{value}
</when>
<when test="fieldCodes[key] == 'le' and value !=null and value !=''">
and d.${key} <![CDATA[<=]]> #{value}
</when>
</choose>
</foreach>
</if>
order by instanceId desc
</select>
</mapper>
......@@ -10,7 +10,7 @@
FROM cb_fire_team ft
LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr
WHERE ft.is_delete = 0
and ft.type_code = 118
and ft.type_code = #{code}
GROUP BY ft.sequence_nbr
</select>
<select id="queryFighterByTeamId" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto">
......
......@@ -5,10 +5,12 @@
<select id="getFirefightersJobTitleCount"
resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto">
select COUNT(a.sequence_nbr) num, a.job_title_code jobTitleCode
select COUNT(a.sequence_nbr) num, a.job_title_code
jobTitleCode
from cb_firefighters a
where a.is_delete = 0
GROUP BY a.job_title_code
GROUP BY
a.job_title_code
</select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters"
......@@ -16,7 +18,8 @@
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code
areasExpertiseCode from cb_firefighters a LEFT JOIN
cb_firefighters_post b on
a.sequence_nbr=b.firefighters_id where a.is_delete=0
a.sequence_nbr=b.firefighters_id where
a.is_delete=0
<if test='par.postQualification!=null'>and b.post_qualification_code = #{par.postQualification}</if>
<if test='par.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
......@@ -48,7 +51,8 @@
<select id="listToSelectById" resultType="Map">
SELECT IFNULL(a.personnel_photos, '') personnelPhotos,
SELECT
IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr
sequenceNbr,
IFNULL(a.`name`, '无') `name`,
......@@ -65,31 +69,92 @@
IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age
FROM cb_firefighters a LEFT JOIN cb_firefighters_post b
FROM cb_firefighters a LEFT JOIN
cb_firefighters_post b
ON a.sequence_nbr
= b.firefighters_id LEFT JOIN cb_fire_team c on
= b.firefighters_id LEFT JOIN
cb_fire_team c on
c.sequence_nbr=a.fire_team_id
WHERE a.is_delete =0
and a.sequence_nbr=#{id}
and
a.sequence_nbr=#{id}
</select>
<!-- BUG3553 BY kongfm 人员关系显示汉字 -->
<!---陈浩修改导出的数据量 2021-09-13-->
<select id="exportToExcel"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto">
<!-- SELECT f.*, ( SELECT cb_fire_team.NAME FROM cb_fire_team WHERE cb_fire_team.sequence_nbr
= f.fire_team_id ) fireTeam, emergency_contact, da.NAME AS relationship,
emergency_contact_phone FROM cb_firefighters f LEFT JOIN cb_firefighters_contacts
fc ON f.sequence_nbr = fc.firefighters_id left join cb_data_dictionary da
on da.CODE = fc.relationship where f.is_delete = #{isDelete} -->
SELECT
f.*,
(
SELECT
cb_fire_team. NAME
FROM
cb_fire_team
WHERE
cb_fire_team.sequence_nbr = f.fire_team_id
) fireTeam,
emergency_contact,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fc.relationship
AND type = 'RJGX'
) AS relationship,
emergency_contact_phone,
fw.working_hours,
fw.fire_working_hours,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.first_degree
AND type = 'XLLX'
) AS first_degree,
(
SELECT
NAME
FROM
cb_data_dictionary
WHERE
CODE = fe.highest_education
AND type = 'XLLX'
) AS highest_education,
(
SELECT
f.*,
( SELECT cb_fire_team.NAME FROM cb_fire_team WHERE
cb_fire_team.sequence_nbr = f.fire_team_id ) fireTeam,
emergency_contact,
da.NAME AS relationship,
emergency_contact_phone
NAME
FROM
cb_firefighters f
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr =
fc.firefighters_id
left join cb_data_dictionary da on da.CODE = fc.relationship
where f.is_delete = #{isDelete}
cb_data_dictionary
WHERE
CODE = fe.academic_degree
AND type = 'XWLX'
) AS academic_degree,
fe.school,
fe.professional_name,
fp.*
FROM
cb_firefighters f
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr = fc.firefighters_id
LEFT JOIN cb_firefighters_workexperience fw ON f.sequence_nbr = fw.firefighters_id
LEFT JOIN cb_firefighters_education fe ON f.sequence_nbr = fe.firefighters_id
LEFT JOIN cb_firefighters_post fp ON f.sequence_nbr = fp.firefighters_id
WHERE
f.is_delete = 0
AND fc.is_delete = 0
AND fw.is_delete = 0
AND fe.is_delete = 0
AND fp.is_delete = 0
</select>
</mapper>
......@@ -127,7 +127,7 @@
cb_dynamic_form_instance m GROUP BY m.instance_id) b
on
b.instance_id=a.instance_id where a.unit_name is not null
b.instance_id=a.instance_id where a.unit_name is not null and a.is_delete=0
</select>
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
......@@ -182,7 +182,7 @@
cb_linkage_unit clu
WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat(#{unitName}, '%')
AND clu.unit_name LIKE concat('%',#{unitName}, '%')
</if>
<if
test="linkageUnitType != null and linkageUnitType != ''">
......
......@@ -94,6 +94,21 @@
LIMIT #{map.pageNum}, #{map.pageSize}
</select>
<!--机场单位查询机构下所有子数据 2021-09-16 by litw -->
<select id="selectAllChildrenList" resultType="com.yeejoin.amos.boot.module.common.api.entity.OrgUsr">
select
u.sequence_nbr sequenceNbr,
u.biz_org_name bizOrgName,
u.biz_org_code bizOrgCode
FROM
cb_org_usr u
where
u.is_delete = 0
<if test="map.bizOrgCode != null and map.bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{map.bizOrgCode}, '%')
</if>
</select>
<select id="selectPersonAllList" resultType="Map">
select * from (
......
<?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.common.api.mapper.WaterResourceMapper">
<!--BUG 2919 消防水源导出没有设施定义 分类名称 设施编码 维保周期 by kongfm 2021-09-16 -->
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select r.name,
r.address,
......@@ -16,6 +16,10 @@
r.reality_img,
r.contact_user,
r.contact_phone,
r.equip_name,
r.equip_category_name,
r.equip_code,
r.maintenance_period,
(case r.resource_type when 'crane' then rc.height when 'natural' then rn.height end) height,
(case r.resource_type
when 'crane' then rc.status
......@@ -82,8 +86,8 @@
and a.resource_type= #{par.resourceType}
</if>
<if test='par.distance!=null'>
<!-- and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} -->
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
......@@ -97,8 +101,8 @@
and a.resource_type= #{par.resourceType}
</if>
<if test='par.distance!=null'>
<!-- and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} -->
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance}
</if>
</select>
<select id="getWaterResourceTypeList" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto">
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
/**
* @description:
* @author: tw
* @createDate: 2021/9/15
*/
/**
*物联消息
*
* */
public class AlertNewsDto {
private String title;
private String content;
private String id;
private Object data;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public AlertNewsDto() {
}
public AlertNewsDto(String title, String content, String id, Object data) {
this.title = title;
this.content = content;
this.id = id;
this.data = data;
}
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
/**
* @description:
* @author: tw
* @createDate: 2021/9/16
*/
public class NewsDate {
private Long id; // 物联警情id
private Double floorLongitude; // 建筑经度
private Double floorLatitude; // 建筑纬度
private String floorName; // 建筑名称
private String unitInvolvedId; // 事发单位
private String unitInvolvedName; // 事发单位名称
public Double getFloorLongitude() {
return floorLongitude;
}
public void setFloorLongitude(Double floorLongitude) {
this.floorLongitude = floorLongitude;
}
public Double getFloorLatitude() {
return floorLatitude;
}
public void setFloorLatitude(Double floorLatitude) {
this.floorLatitude = floorLatitude;
}
public String getFloorName() {
return floorName;
}
public void setFloorName(String floorName) {
this.floorName = floorName;
}
public String getUnitInvolvedId() {
return unitInvolvedId;
}
public void setUnitInvolvedId(String unitInvolvedId) {
this.unitInvolvedId = unitInvolvedId;
}
public String getUnitInvolvedName() {
return unitInvolvedName;
}
public void setUnitInvolvedName(String unitInvolvedName) {
this.unitInvolvedName = unitInvolvedName;
}
}
......@@ -17,14 +17,15 @@ public enum ExcelEnums {
WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站")
XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员")
WBRY ("维保人员", "维保人员", "com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto","WBRY"),//("WBRY",维保人员)
KEYSITE ("重點部位", "重點部位", "com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto","KEYSITE"),//{"KEYSITE":重點部位}
KEYSITE ("重点部位", "重点部位", "com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto","KEYSITE"),//{"KEYSITE":重點部位}
CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("JCDW","机场单位")
RYZB ("人员值班", "人员值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto","RYZB"),//("RYZB","人员值班")
// BUG 2455 相关代码 bykongfm
TGRY ("特岗人员", "特岗人员", "com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto","TGRY"),//("TGRY","特岗人员")
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB");//("JYZB","救援装备")
JYZB ("救援装备", "救援装备", "com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto","JYZB"),//("JYZB","救援装备")
XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB");//("XFZB","消防装备")
private String fileName;
private String sheetName;
......
......@@ -12,6 +12,7 @@ import lombok.Getter;
@AllArgsConstructor
public enum FireBrigadeTypeEnum {
专职消防队("fullTime", "116", "专职消防队"),
医疗救援队("monitorTeam", "830", "医疗救援队"),
监控大队("monitorTeam", "118", "监控大队");
private String key;
......
......@@ -47,4 +47,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
Integer AlertCalledcount(@Param("alertStatus")int alertStatus);
//未结束灾情列表
List<AlertCalled> AlertCalledStatusPage(@Param("current")Integer current, @Param("size")Integer size);
}
......@@ -75,4 +75,6 @@ public interface IAlertCalledService {
Integer AlertCalledcount(int type);
List<AlertCalled> AlertCalledStatusPage(Integer current, Integer size);
}
......@@ -33,7 +33,7 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
/**
* 获取力量调派资源树
*/
List<FireBrigadeResourceDto> getPowerTree();
List<FireBrigadeResourceDto> getPowerTree(String type);
List<PowerCompanyCountDto> getPowerCompanyCountDtocount( Long id);
/**
......
......@@ -186,5 +186,19 @@
</select>
<!-- 未结束警情列表 -->
<select id="AlertCalledStatusPage" resultType="com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled">
select * from jc_alert_called where is_delete=0 and alert_status = 0 ORDER BY response_level_code desc
,call_time limit #{current},#{size}
</select>
</mapper>
package com.yeejoin.amos.supervision.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PlanCheckLevelEnum {
DRAFT("单位级",0),
EXAMINE_ONE("公司级",1);
/**
* 名称
*/
private String name;
/**
* 值
*/
private int value;
private PlanCheckLevelEnum(String name, int value) {
this.name = name;
this.value = value;
}
public static String getName(int value) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getValue() == value) {
return c.name;
}
}
return null;
}
public static int getValue(String name) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return -1;
}
public static PlanCheckLevelEnum getEnum(int value) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getValue() == value) {
return c;
}
}
return null;
}
public static PlanCheckLevelEnum getEnum(String name) {
for (PlanCheckLevelEnum c : PlanCheckLevelEnum.values()) {
if (c.getName().equals(name)) {
return c;
}
}
return null;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (PlanCheckLevelEnum c: PlanCheckLevelEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("value", c.getValue() +"");
nameList.add(map);
}
return nameList;
}
public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>();
for (PlanCheckLevelEnum c: PlanCheckLevelEnum.values()) {
nameList.add(c.getName());
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
package com.yeejoin.amos.supervision.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum PlanStatusEnum {
DRAFT("草稿",0),
EXAMINE_ONE("一级待审核",1),
EXAMINE_TWO("二级待审核",2),
EXAMINE_THREE("三级待审核",3),
EXAMINE_FORMULATE("已审核/检查内容未制定",4),
EXAMINE_DEVELOPED("已审核/检查内容已制定",5);
/**
* 名称
*/
private String name;
/**
* 值
*/
private int value;
private PlanStatusEnum(String name, int value) {
this.name = name;
this.value = value;
}
public static String getName(int value) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getValue() == value) {
return c.name;
}
}
return null;
}
public static int getValue(String name) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getName().equals(name)) {
return c.value;
}
}
return -1;
}
public static PlanStatusEnum getEnum(int value) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getValue() == value) {
return c;
}
}
return null;
}
public static PlanStatusEnum getEnum(String name) {
for (PlanStatusEnum c : PlanStatusEnum.values()) {
if (c.getName().equals(name)) {
return c;
}
}
return null;
}
public static List<Map<String,String>> getEnumList() {
List<Map<String,String>> nameList = new ArrayList<>();
for (PlanStatusEnum c: PlanStatusEnum.values()) {
Map<String, String> map = new HashMap<String, String>();
map.put("name", c.getName());
map.put("value", c.getValue() +"");
nameList.add(map);
}
return nameList;
}
public static List<String> getEnumNameList() {
List<String> nameList = new ArrayList<String>();
for (PlanStatusEnum c: PlanStatusEnum.values()) {
nameList.add(c.getName());
}
return nameList;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
package com.yeejoin.amos.supervision.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.annotations.Where;
import javax.persistence.*;
/**
* 检查项
......@@ -183,42 +179,54 @@ public class InputItem extends BasicEntity {
private String testRequirement;
/**
* 检查类型字典值
*/
@Column(name = "check_type_Val")
private String checkTypeId;
/**
* 检查类型
*/
@Column(name="check_type")
@Column(name = "check_type")
private String checkType;
/**
* 父类检查项id
*/
@Column(name="item_parent")
@Column(name = "item_parent")
private String itemParent;
/**
* 检查项分类
*/
@Column(name="item_classify")
@Column(name = "item_classify")
private String itemClassify;
/**
* 适用检查类别
*/
@Lob
@Column(name="item_type_classify")
@Column(name = "item_type_classify")
private String itemTypeClassify;
/**
* 检查项等级
*/
@Column(name="item_level")
@Column(name = "item_level")
private String itemLevel;
/**
* 检查项启用
*/
@Column(name="item_start")
@Column(name = "item_start")
private Integer itemStart;
/**
* 扩展属性
*/
@Transient
private String ext;
public Integer getItemStart() {
return itemStart;
}
......@@ -332,14 +340,14 @@ public class InputItem extends BasicEntity {
}
public String getRiskDesc() {
return riskDesc;
}
return riskDesc;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
public String getItemNo() {
public String getItemNo() {
return itemNo;
}
......@@ -498,4 +506,20 @@ public class InputItem extends BasicEntity {
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
public String getCheckTypeId() {
return checkTypeId;
}
public void setCheckTypeId(String checkTypeId) {
this.checkTypeId = checkTypeId;
}
public String getExt() {
return ext;
}
public void setExt(String ext) {
this.ext = ext;
}
}
\ No newline at end of file
......@@ -163,6 +163,13 @@ public class Plan extends BasicEntity {
*/
@Column(name="plan_type")
private String planType;
/**
* 检查级别
*/
@Column(name="check_level")
private String checkLevel;
/**
* 备注
*/
......@@ -188,8 +195,8 @@ public class Plan extends BasicEntity {
/**
* 状态:0-已停用;1-正常
*/
@Column(name="[status]")
private byte status;
@Column(name="status")
private Integer status;
/**
* 用户编号
*/
......@@ -555,11 +562,11 @@ public class Plan extends BasicEntity {
this.scoreFormula = scoreFormula;
}
public byte getStatus() {
public Integer getStatus() {
return this.status;
}
public void setStatus(byte status) {
public void setStatus(Integer status) {
this.status = status;
}
......@@ -745,4 +752,12 @@ public class Plan extends BasicEntity {
public void setMakerUserDeptName(String makerUserDeptName) {
this.makerUserDeptName = makerUserDeptName;
}
public String getCheckLevel() {
return checkLevel;
}
public void setCheckLevel(String checkLevel) {
this.checkLevel = checkLevel;
}
}
\ No newline at end of file
package com.yeejoin.amos.supervision.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;
/**
* The persistent class for the p_route_point_item database table.
*
*/
@Entity
@Table(name="p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r")
@Table(name = "p_route_point_item")
@NamedQuery(name = "RoutePointItem.findAll", query = "SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 创建者
*/
@Column(name = "creator_id")
private String creatorId;
/**
* 排序
*/
@Column(name = "order_no")
private int orderNo;
/**
* 巡检点检查项id
*/
@Column(name = "point_input_item_id")
private long pointInputItemId;
/**
* 创建者
*/
@Column(name="creator_id")
private String creatorId;
/**
* 排序
*/
@Column(name="order_no")
private int orderNo;
/**
* 巡检点检查项id
*/
@Column(name="point_input_item_id")
private long pointInputItemId;
/**
* 路线点表id
*/
@Column(name="route_point_id")
private long routePointId;
/**
* 点分类id
*/
@Column(name="point_classify_id")
private Long pointClassifyId;
/**
* 前端标记是否绑定
*/
private boolean isBound = true;
private RoutePoint routePoint;
/**
* 标准依据
*/
@Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'")
private String basisJson;
private long pointId;
public RoutePointItem() {
}
public String getCreatorId() {
return this.creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public int getOrderNo() {
return this.orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public long getPointInputItemId() {
return this.pointInputItemId;
}
public void setPointInputItemId(long pointInputItemId) {
this.pointInputItemId = pointInputItemId;
}
public long getRoutePointId() {
return this.routePointId;
}
public void setRoutePointId(long routePointId) {
this.routePointId = routePointId;
}
@ManyToOne
@JoinColumn(name = "routePointId", referencedColumnName = "id", updatable = false, insertable = false)
public RoutePoint getRoutePoint() {
return routePoint;
}
@JsonBackReference
public void setRoutePoint(RoutePoint routePoint) {
this.routePoint = routePoint;
}
public Long getPointClassifyId() {
return pointClassifyId;
}
public void setPointClassifyId(Long pointClassifyId) {
this.pointClassifyId = pointClassifyId;
}
public String getBasisJson() {
return basisJson;
}
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
@Transient
public long getPointId() {
return pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
@Transient
public boolean getIsBound() {
return isBound;
}
public void setIsBound(boolean bound) {
isBound = bound;
}
/**
* 路线点表id
*/
@Column(name = "route_point_id")
private long routePointId;
/**
* 点分类id
*/
@Column(name = "point_classify_id")
private Long pointClassifyId;
/**
* 前端标记是否绑定
*/
private boolean isBound = true;
private RoutePoint routePoint;
/**
* 标准依据
*/
@Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'")
private String basisJson;
/**
* 检查项ID
*/
@Column(name = "input_item_id")
private Long inputItemId;
/**
* 计划ID
*/
@Column(name = "plan_id")
private Long planId;
private long pointId;
public RoutePointItem() {
}
public String getCreatorId() {
return this.creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public int getOrderNo() {
return this.orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public long getPointInputItemId() {
return this.pointInputItemId;
}
public void setPointInputItemId(long pointInputItemId) {
this.pointInputItemId = pointInputItemId;
}
public long getRoutePointId() {
return this.routePointId;
}
public void setRoutePointId(long routePointId) {
this.routePointId = routePointId;
}
@ManyToOne
@JoinColumn(name = "routePointId", referencedColumnName = "id", updatable = false, insertable = false)
public RoutePoint getRoutePoint() {
return routePoint;
}
@JsonBackReference
public void setRoutePoint(RoutePoint routePoint) {
this.routePoint = routePoint;
}
public Long getPointClassifyId() {
return pointClassifyId;
}
public void setPointClassifyId(Long pointClassifyId) {
this.pointClassifyId = pointClassifyId;
}
public String getBasisJson() {
return basisJson;
}
public void setBasisJson(String basisJson) {
this.basisJson = basisJson;
}
@Transient
public long getPointId() {
return pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
@Transient
public boolean getIsBound() {
return isBound;
}
public void setIsBound(boolean bound) {
isBound = bound;
}
public Long getInputItemId() {
return inputItemId;
}
public void setInputItemId(Long inputItemId) {
this.inputItemId = inputItemId;
}
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
}
\ No newline at end of file
......@@ -580,15 +580,11 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY)
@GetMapping(value = "LinkageUnitDto/page")
@ApiOperation(httpMethod = "GET", value = "联动单位分页查询", notes = "联动单位分页查询")
public ResponseModel<Page<LinkageUnitDto>> LinkageUnitDtoQueryForPage(@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize,
String unitName,String linkageUnitTypeCode, String linkageUnitType, String inAgreement) {
public ResponseModel<Page<LinkageUnitDto>> LinkageUnitDtoQueryForPage(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize,String unitName,String linkageUnitTypeCode, String linkageUnitType, String inAgreement) {
Page<LinkageUnitDto> page = new Page<LinkageUnitDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<LinkageUnitDto> linkageUnitDtoPage = iLinkageUnitService.queryForLinkageUnitPage(page, false,
unitName,linkageUnitTypeCode, linkageUnitType, null, inAgreement);
Page<LinkageUnitDto> linkageUnitDtoPage = iLinkageUnitService.queryForLinkageUnitPage(page, false, unitName,linkageUnitTypeCode, linkageUnitType, null, inAgreement);
return ResponseHelper.buildResponse(linkageUnitDtoPage);
}
......@@ -627,9 +623,7 @@ public class CommandController extends BaseController {
@GetMapping(value = "statistics/{id}")
@ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计")
public ResponseModel<Object> getStatistics(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id));
}
/**
* * @param null
......@@ -673,7 +667,6 @@ public class CommandController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段")
public ResponseModel<Object> getstate(@PathVariable Long id) {
AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id);
List<StateDot> list=new ArrayList<>();
list.add(new StateDot("警情接报"));
list.add(new StateDot("力量调派"));
......@@ -779,16 +772,12 @@ public class CommandController extends BaseController {
@ApiOperation(value = "查看文件内容", notes = "查看文件内容")
public ResponseModel<Object> lookHtmlText( HttpServletResponse response,@RequestParam(value = "fileUrl")String fileUrl ,@RequestParam(value = "product")String product,@RequestParam(value = "appKey")String appKey,@RequestParam(value = "token")String token /* @PathVariable String fileName */)
throws Exception {
String fileName =readUrl+fileUrl; //目标文件
String fileName =readUrl+fileUrl; //目标文件
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
String htmlPath= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"file"+File.separator;
String imagePathStr= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"image"+File.separator;
String name = fileUrl.substring(fileUrl.lastIndexOf('/')+1);
String htmlFileName = htmlPath + name.substring(0, name.indexOf(".")) +".html";
String htmlFileName = htmlPath + name.substring(0, name.indexOf(".")) +".html";
File htmlP = new File(htmlPath);
if (!htmlP.exists()) {
htmlP.mkdirs();
......@@ -827,24 +816,18 @@ public class CommandController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据灾情查询单个航空器信息", notes = "根据灾情查询单个航空器信息")
public ResponseModel<AircraftDto> seleteaircraftOne(@PathVariable Long sequenceNbr) {
// 警情动态表单数据
List<AlertFormValue> list = alertFormValueService.getzqlist(sequenceNbr);
for (AlertFormValue alertFormValue : list) {
if("aircraftModel".equals(alertFormValue.getFieldCode())) {
String aircraftModel=alertFormValue.getFieldValue();
if(aircraftModel!=null&&!"".equals(aircraftModel)) {
AircraftDto aircraftDto=aircraftService.queryByAircraftSeq(RequestContext.getAgencyCode(),1411994005943717890L);
//现场照片 待完成,
return ResponseHelper.buildResponse(aircraftDto);
}
}
}
return ResponseHelper.buildResponse(null);
}
......@@ -852,7 +835,6 @@ public class CommandController extends BaseController {
@GetMapping(value = "/getOrgUsrzhDto/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情")
public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) {
AlertCalled AlertCalled = iAlertCalledService.getAlertCalledById(id);
String buildId = null;
OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto();
......@@ -949,8 +931,6 @@ public class CommandController extends BaseController {
@RequestMapping(value = "/getVideo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页获取视频", notes = "分页获取视频")
public ResponseModel<Object> getVideo(long current, long size)throws Exception {
Page page = new Page(current, size);
List<OrderItem> list= OrderItem.ascs("id");
page.setOrders(list);
......@@ -1011,7 +991,6 @@ public class CommandController extends BaseController {
OrgusrDataxDto orgusrDataxDto=new OrgusrDataxDto();
if(AlertCalled.getUnitInvolved()!=null&&!"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto= iOrgUsrService.getOrgUsrzhDto( AlertCalled.getUnitInvolved());
if(orgUsrzhDto!=null&&orgUsrzhDto.size()>0&&orgUsrzhDto.get(0)!=null){
buildId=orgUsrzhDto.get(0).getBuildId()==null?null:Long.valueOf(orgUsrzhDto.get(0).getBuildId());
}
......@@ -1046,10 +1025,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派列表", notes = "app-根据警情id查询力量调派列表")
@GetMapping(value = "/app/transferList")
public ResponseModel getPowerTransferList(@RequestParam String alertId,
@RequestParam(defaultValue = "team") String type,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
public ResponseModel getPowerTransferList(@RequestParam String alertId,@RequestParam(defaultValue = "team") String type, @RequestParam(value = "current") int current, @RequestParam(value = "size") int size) {
Page page = new Page();
page.setSize(size);
page.setCurrent(current);
......@@ -1059,8 +1035,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派资源统计", notes = "app-根据警情id查询力量调派资源统计")
@GetMapping(value = "/app/transfer/statistics")
public ResponseModel getPowerTransferStatistics(@RequestParam String alertId,
@RequestParam(defaultValue = "team") String type) {
public ResponseModel getPowerTransferStatistics(@RequestParam String alertId, @RequestParam(defaultValue = "team") String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type));
}
......@@ -1076,7 +1051,6 @@ public class CommandController extends BaseController {
} catch (Exception e) {
throw new BaseException("更新车辆状态异常", "", e.getMessage());
}
return ResponseHelper.buildResponse(true);
}
......@@ -1149,20 +1123,29 @@ public class CommandController extends BaseController {
@GetMapping(value = "/DynamicFlightInfo/{dynamicFlightId}")
@ApiOperation(httpMethod = "GET", value = "航班信息", notes = "航班信息")
public ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId) {
ResponseModel<Object> dataModel = iotFeignClient.DynamicFlightInfo(dynamicFlightId);
if (dataModel != null) {
return ResponseHelper.buildResponse(dataModel.getResult());
}
return ResponseHelper.buildResponse(null);
}
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "AlertCalledStatusPage")
@ApiOperation(httpMethod = "GET", value = "未结束的灾情列表", notes = "未结束的灾情列表")
public ResponseModel<Page<AlertCalled>> AlertCalledStatusPage( @RequestParam(value = "current") Integer current, @RequestParam(value = "size") Integer size) {
if (null == current || null == size) {
current = 1;
size = Integer.MAX_VALUE;
}
List<AlertCalled> list= iAlertCalledService.AlertCalledStatusPage( current, size);
int num= iAlertCalledService.AlertCalledcount(0);
Page<AlertCalled> pageBean = new Page<>(current, size, num);
pageBean.setRecords(list);
return ResponseHelper.buildResponse(pageBean);
}
......
......@@ -134,7 +134,7 @@ public class DutyCarController extends BaseController {
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}")
@DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId)
......
......@@ -166,4 +166,18 @@ public class DutyPersonController extends BaseController {
}
/**
*
* 新接口 根据值班区域id 查询值班人 by kongfm 2021-09-15
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/findByDutyAreaId/{dutyAreaId}")
@ApiOperation(httpMethod = "GET", value = "根据值班区域ID查询当前值班人", notes = "根据值班区域ID查询当前值班人")
public ResponseModel<List<DutyPersonDto>> findByDutyAreaId(
@PathVariable Long dutyAreaId
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId));
}
}
......@@ -20,7 +20,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
......
......@@ -7,8 +7,12 @@ import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -165,12 +169,22 @@ public class OrgPersonController {
@RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据orgCode查询", notes = "根据orgCode查询")
public ResponseModel<Collection<OrgUsr>> selectUsersByOrgCode(HttpServletRequest request, String pageNum,
String pageSize, @PathVariable Long orgCode) {
String pageSize, @PathVariable String orgCode) {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_code", orgCode);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
return ResponseHelper.buildResponse(iOrgUsrService.listByMap(columnMap));
Collection<OrgUsr> temp = iOrgUsrService.listByMap(columnMap);
temp.stream().forEach(t -> {
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
if(StringUtils.isNotEmpty(t.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(t.getAmosOrgId());
if(null !=result1.getResult()) {
t.setAmosOrgCode(result1.getResult().getRealName());
}
}
});
return ResponseHelper.buildResponse(temp);
}
/**
......
......@@ -342,7 +342,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门树", notes = "根据登陆人获取单位部门树")
public ResponseModel<List<OrgMenuDto>> selectCompanyTreeByUser() throws Exception {
......@@ -358,7 +358,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyUserTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门用户树", notes = "根据登陆人获取单位部门用户树")
public ResponseModel<List<OrgMenuDto>> companyUserTreeByUser() {
......@@ -374,7 +374,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyListByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位列表", notes = "根据登陆人获取单位列表")
public ResponseModel<List<CheckObjectDto>> companyListByUser() {
......@@ -404,7 +404,7 @@ public class OrgUsrController extends BaseController {
* @param
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系")
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@RequestParam(value = "userId", required = false) String userId) {
......@@ -413,7 +413,7 @@ public class OrgUsrController extends BaseController {
if (StringUtils.isEmpty(userIds)) {
userIds = user.getUserId();
}
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds);
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds, user);
return ResponseHelper.buildResponse(loginUserDetails);
}
......
......@@ -12,14 +12,18 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -42,6 +46,9 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
String driverPostTypeCode = "5";
@Autowired
EquipFeignClient equipFeign;
@Override
public String getGroupCode() {
return "dutyCar";
......@@ -49,14 +56,83 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override
public DutyCarDto save(DutyCarDto dutyCarDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据
String groupCode = this.getGroupCode();
String userId = dutyCarDto.getUserId();
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null;
if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
// 根据建筑id 查找建筑
ResponseModel<Map<String, Object>> response = null;
try {
response = equipFeign.getFormInstanceById(Long.parseLong(dutyCarDto.getDutyAreaId()));
} catch (NumberFormatException e) {
throw new BadRequest("值班区域id异常!");
}
Map<String, Object> result = response.getResult();
dutyCarDto.setDutyArea(result.get("name").toString());
}
Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
Long instanceId = dynamicFormInstanceService.commonSave(groupCode,map);
if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作
instanceId = instances.get(0).getInstanceId(); // 已经有了走更新方法
//1.查询已有数据
List<DynamicFormInstance> hasInstances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
//2.list 转 map
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(hasInstances, "fieldCode", DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
for (DynamicFormColumn column : columns) {
DynamicFormInstance formInstance = instanceMap.get(column.getFieldCode());
if (!ObjectUtils.isEmpty(formInstance)) {
//有的更新
formInstance.setFieldValue(map.get(column.getFieldCode()) != null ? map.get(column.getFieldCode()).toString() : "");
} else {
//没有的新增
formInstance = new DynamicFormInstance();
buildFormInstanceData(instanceId, map, column, formInstance);
}
entrys.add(formInstance);
}
if(!entrys.isEmpty()){
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
} else {
instanceId = dynamicFormInstanceService.commonSave(groupCode,map);
}
if(dutyCarDto.getDutyShift() != null && dutyCarDto.getDutyShift().size() == 0) {
Calendar startDate = Calendar.getInstance();
startDate.setTime(DateUtils.longStr2Date(dutyCarDto.getStartTime()));
int dates = startDate.getActualMaximum(Calendar.DAY_OF_MONTH);
startDate.set(Calendar.DAY_OF_MONTH, 1);
List<DutyPersonShift> dutyShift = new ArrayList<>(dates);
for (int i = 0 ; i < dates ; i ++) {
DutyPersonShift temp = new DutyPersonShift();
temp.setAppKey(RequestContext.getAppKey());
temp.setDutyDate(startDate.getTime());
temp.setIsDelete(false);
temp.setInstanceId(instanceId);
dutyShift.add(temp);
startDate.add(Calendar.DAY_OF_YEAR,1);
}
dutyPersonShiftService.saveOrUpdateBatch(dutyShift);
}
//2.保存值班信息
insertPersonShift(instanceId, dutyCarDto);
//3.返回保存后的数据
return dutyCarDto;
}
@Override
......@@ -83,7 +159,12 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
private void insertPersonShift(Long instanceId, DutyCarDto dutyCarDto) {
Set<DutyPersonShift> personShiftList = dutyCarDto.getDutyShift().stream().map(dto -> {
DutyPersonShift dutyPersonShift = new DutyPersonShift();
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift dutyPersonShift = dutyPersonShiftService.getOne(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId,instanceId).eq(DutyPersonShift::getDutyDate,dto.getDutyDate()));
if(dutyPersonShift == null) {
dutyPersonShift = new DutyPersonShift();
}
dto.setInstanceId(instanceId);
Bean.copyExistPropertis(dto, dutyPersonShift);
dutyPersonShift.setAppKey(RequestContext.getAppKey());
......
......@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -77,10 +78,13 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
throws ParseException {
// 1.已column为准 进行返回
String groupCode = this.getGroupCode();
IPage<Map<String, Object>> iPage = dynamicFormInstanceService.pageList(current, size, groupCode);
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
IPage<Map<String, Object>> iPage = dynamicFormInstanceService.pageListNew(current, size, groupCode, beginDate, endDate);
for (Map<String, Object> m : iPage.getRecords()) {
this.fillDutyShiftData(beginDate, endDate, m);
}
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
return iPage;
}
......@@ -96,9 +100,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
// 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
if(beginDate != null ) {
SimpleDateFormat shortformat = new SimpleDateFormat("yyyy-MM-dd");
if(beginDate != null ) {
Calendar c = Calendar.getInstance();
c.setTime(DateUtils.longStr2Date(beginDate));
if(DateUtils.longStr2Date(beginDate) != null) {
c.setTime(DateUtils.longStr2Date(beginDate));
} else {
c.setTime(shortformat.parse(beginDate));
}
c.set(Calendar.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY,0);
c.set(Calendar.MINUTE,0);
......@@ -107,7 +116,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
if(endDate != null ) {
Calendar c = Calendar.getInstance();
c.setTime(DateUtils.longStr2Date(beginDate));
if(DateUtils.longStr2Date(endDate) != null) {
c.setTime(DateUtils.longStr2Date(endDate));
} else {
c.setTime(shortformat.parse(endDate));
}
c.add(Calendar.MONTH, 1);
c.set(Calendar.DAY_OF_MONTH, 1);
c.add(Calendar.DATE, -1);
......@@ -126,7 +139,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Bean.copyExistPropertis(e, dto);
// 没值班信息,默认休
DutyShift dutyShift = keyNameMap.get(e.getShiftId());
dto.setShiftName(dutyShift != null ? dutyShift.getName() : "休");
dto.setShiftName(dutyShift != null ? dutyShift.getName() : "休");
dto.setColor(dutyShift != null ? dutyShift.getColor() : "");
return dto;
}).collect(Collectors.toList());
......@@ -186,6 +199,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
for (Map<String, Object> map : list) {
this.fillDutyShiftData(beginDate, endDate, map);
}
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
list = list.stream().filter(m ->
m.get("dutyShift") != null && ((List<DutyPersonShiftDto>) m.get("dutyShift")).size() > 0
).collect(Collectors.toList());
/*bug2472 添加根据部门id筛选数据的方法 陈浩 2021-08-21 开始 */
if(teamId!=null && teamId.intValue()!=0) {
List<OrgUsr> orgUsrList = orgUsrService.getPersonListByParentId(teamId);
......@@ -211,6 +229,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override
public List downloadList(String beginDate, String endDate) throws ParseException {
List<Map<String, Object>> maps = this.list(null,beginDate, endDate);
// BUG 2807 如果不存在值班数据则不显示
maps = maps.stream().filter(m ->
m.get("dutyShift") != null && ((List<DutyPersonShiftDto>) m.get("dutyShift")).size() > 0
).collect(Collectors.toList());
JSONArray jsonArray = new JSONArray();
jsonArray.addAll(maps);
List<?> list = new ArrayList<>();
......
......@@ -72,7 +72,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
List<DynamicFormInitDto> listForm = new ArrayList<DynamicFormInitDto>();
String appKey = RequestContext.getAppKey();
// 组装数据
dynamicFormColumn.parallelStream().forEach(dynamicForm -> {
dynamicFormColumn.stream().forEach(dynamicForm -> {
if ( dynamicForm.getFieldType().equals("input") ||
dynamicForm.getFieldType().equals("string") ||
dynamicForm.getFieldType().equals("datetime") ||
......@@ -193,7 +193,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
}
});
return listForm.stream().sorted(Comparator.comparing(DynamicFormInitDto::getSort)).collect(Collectors.toList());
return listForm.stream().sorted(Comparator.nullsFirst(Comparator.comparing(DynamicFormInitDto::getSort))).collect(Collectors.toList());
}
public List<SelectItem> getdata(Collection<DataDictionary> list) {
......
......@@ -132,6 +132,14 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
Page page = new Page(current, size);
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
}
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
public IPage<Map<String, Object>> pageListNew(int current, int size, String groupCode, String beginDate, String endDate) {
Map<String, String> params = this.getRequestParamMap();
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page(current, size);
return this.getBaseMapper().pageListNew(page, RequestContext.getAppKey(), fieldCodes, groupCode, params, beginDate, endDate);
}
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode, Map<String, String> params) {
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
......@@ -264,11 +265,23 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} else {
keySiteDto.setFirePreventionFlag(false);
}
keySiteDto =Bean.toPo(getCurrentInfo(), keySiteDto);
excelList.add(keySiteDto);
}
return this.saveBatch(excelList);
}
public BaseEntity getCurrentInfo() {
BaseEntity userModel= new BaseEntity();
/* String keyString= RequestContext.getExeUserId();
String token=RequestContext.getToken();
ReginParams params = JSONObject.parseObject(redisUtils
.get(RedisKey.buildReginKey(keyString, token)).toString(),
ReginParams.class);*/
userModel.setRecUserId("3141675");
userModel.setRecUserName("admin_jcs");
userModel.setRecDate( new Date());
return userModel;
}
@Override
public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
......
......@@ -210,6 +210,7 @@ public class MaintenanceCompanyServiceImpl
// 新增删除维保单位逻辑,BUG 2500 单位下有子单位或者人员时应无法直接删除. by litw satrt
LambdaQueryWrapper<MaintenanceCompany> wrapperCompany = new LambdaQueryWrapper<MaintenanceCompany>();
wrapperCompany.eq(MaintenanceCompany::getParentId,sequenceNbr);
wrapperCompany.eq(MaintenanceCompany::getIsDelete,false);
int count = maintenanceCompanyMapper.selectCount(wrapperCompany);
if(count > 0) {
throw new BadRequest("单位下有子单位或者人员,无法删除");
......
package com.yeejoin.amos.boot.module.jcs.biz.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertNewsDto;
import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2021/9/16
*/
@Component
public class StartLoader implements ApplicationRunner {
private final Logger logger = LoggerFactory.getLogger(StartLoader.class);
@Autowired
private EmqKeeper emqKeeper;
@Value("${mqtt.topic.alert.iot}")
private String topic;
@Value("${mqtt.topic.alert.iot.web}")
private String topicweb;
@Override
public void run(ApplicationArguments args) throws Exception {
logger.info("開始監聽物聯警情======================================");
loadSysParams();
}
public void loadSysParams(){
try {
emqKeeper.getMqttClient().subscribe(topic, (s, mqttMessage) -> {
byte[] payload = mqttMessage.getPayload();
try {
String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj);
JSONObject date = (JSONObject) JSON.toJSON(json.get("data"));
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", date.get("unitInvolvedName")+","+date.get("floorName")+"楼,发生警情,请处理。", date.get("id").toString(), obj);
emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes(), RuleConfig.DEFAULT_QOS, true);
}
} catch (Exception e) {
logger.error("系统异常", e);
}
});
} catch (MqttException e) {
logger.info("订阅物联警情异常", e);
}
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.netflix.discovery.converters.Auto;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 导出导入
......@@ -36,6 +34,9 @@ public class ExcelController extends BaseController {
@Autowired
ExcelServiceImpl excelService;
@Autowired
DataSourcesImpl dataSources;
private static final String NOT_DUTY = "休班";
......@@ -53,15 +54,22 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!");
}
}
/**
* * @param Map par 可以传递过滤条件,传入具体实现类中
* @return
* <PRE>
* author tw
* date 2021/9/13
* </PRE>
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类")
@GetMapping("/export/{type}")
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type) {
public void getFireStationFile(HttpServletResponse response, @PathVariable(value = "type") String type , @RequestParam Map par) {
try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonExport(response, excelDto);
excelService.commonExport(response, excelDto,par);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
......@@ -79,10 +87,14 @@ public class ExcelController extends BaseController {
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonUpload(multipartFile, excelDto);
return ResponseHelper.buildResponse(null);
} catch (Exception e) {
} catch (RuntimeException e) {
e.printStackTrace();
throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日
}catch (Exception e){
throw new RuntimeException("系统异常!");
}
}
......@@ -165,4 +177,17 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!");
}
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出给提供设备接口")
@PostMapping("/exportForEquipment")
public ResponseModel<String[]> getFireStationFileByParams(@RequestParam(value = "type") String type,
@RequestParam(value = "method") String method) {
try {
return ResponseHelper.buildResponse(dataSources.selectList(type,method));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -27,16 +23,16 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamCardDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
......
......@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -130,7 +131,8 @@ public class FirefightersController extends BaseController {
queryWrapper.eq("is_delete", 0);
List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper);
if (firefightersJacket != null && firefightersJacket.size() > 0) {
throw new RuntimeException("该消防还有在装装备!");
// BUG 2222 by litw start 2021年9月10日
throw new BadRequest("该消防还有在装装备!");
}
try {
iFirefightersService.update(new UpdateWrapper<Firefighters>().eq("sequence_nbr", id).set("is_delete", 1));
......
......@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FireBrigadeResourceDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
......@@ -29,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays;
import java.util.List;
/**
* 力量调派
......@@ -43,7 +47,8 @@ public class PowerTransferController extends BaseController {
@Autowired
PowerTransferServiceImpl powerTransferService;
@Autowired
FireTeamServiceImpl fireTeamService;
@Autowired
EquipFeignClient equipFeignClient;
......@@ -184,10 +189,11 @@ public class PowerTransferController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/power/tree")
@ApiOperation(value = "力量调派资源树", notes = "力量调派资源树")
public ResponseModel<Object> getPowerTree() {
return ResponseHelper.buildResponse(powerTransferService.getPowerTree());
public ResponseModel<Object> getPowerTree( @RequestParam String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTree(type));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/power/list")
@ApiOperation(value = "力量出动列表", notes = "力量调派资源树")
......
......@@ -449,7 +449,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum()));
listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser()));
listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone()));
listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
// listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(alertFormValue -> {
String valueCode = alertFormValue.getFieldValueCode();
if(null == valueCode) {
......@@ -674,11 +674,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//未结案警情统计
@Override
public Integer AlertCalledcount(int type) {
return alertCalledMapper.AlertCalledcount(1);
return alertCalledMapper.AlertCalledcount(0);
}
@Override
public List<AlertCalled> AlertCalledStatusPage(Integer current, Integer size) {
return alertCalledMapper.AlertCalledStatusPage( current, size);
}
@Override
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -152,6 +153,9 @@ public class DataSourcesImpl implements DataSources {
case "getCitys":
str =getCitys();
break;
case "getDutyArea":
str =getDutyArea();
break;
}
}
return str;
......@@ -362,4 +366,15 @@ public class DataSourcesImpl implements DataSources {
}
});
}
private String[] getDutyArea() {
ResponseModel<List<LinkedHashMap<String, Object>>> response = equipFeignClient.getAllBuilding();
List<LinkedHashMap<String, Object>> buildingList = response.getResult();
List<String> areaList = Lists.newArrayList();
buildingList.forEach(building -> {
areaList.add(building.get("buildName") + "@" + building.get("instanceId"));
});
String[] str = areaList.toArray(new String[buildingList.size()]);
return str;
}
}
......@@ -29,7 +29,7 @@ public class DispatchMapServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1);
Integer num= alertCalledMapper1.AlertCalledcount(0);
return num;
}
}
......@@ -28,7 +28,7 @@ public class DispatchTaskServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1);
Integer num= alertCalledMapper1.AlertCalledcount(0);
return num;
}
}
......@@ -30,7 +30,7 @@ public class FaultServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("BREAKDOWN");
return ResponseHelper.buildResponse(data!=null?data.getResult():0);
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("BREAKDOWN");
return data!=null?data.getResult():0;
}
}
......@@ -31,7 +31,7 @@ public class FireAlarmServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("FIREALARM");
return ResponseHelper.buildResponse(data!=null?data.getResult():0);
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("FIREALARM");
return data!=null?data.getResult():0;
}
}
......@@ -67,8 +67,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
*
* @return
*/
public List<FireBrigadeResourceDto> listMonitorFireBrigade() {
return fireTeamMapper.listMonitorFireBrigade();
public List<FireBrigadeResourceDto> listMonitorFireBrigade(String code ) {
return fireTeamMapper.listMonitorFireBrigade(code);
}
/**
......@@ -200,8 +200,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
if(fireTeam.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
fireTeam.setAddress(address.getString(BizConstant.ADDRESS));
fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
// fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
// fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}
if (ValidationUtil.isEmpty(fireTeam.getParent())) {
fireTeam.setTreeCode(TreeParser.genTreeCode());
......
......@@ -30,7 +30,7 @@ public class NoServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("NOTICE");
return ResponseHelper.buildResponse(data!=null?data.getResult():0);
ResponseModel<Integer> data= quipFeignClient1.getcountAlarmHandle("no");
return data!=null?data.getResult():0;
}
}
......@@ -154,9 +154,22 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
@Override
public List<FireBrigadeResourceDto> getPowerTree() {
public List<FireBrigadeResourceDto> getPowerTree(String type) {
List<FireBrigadeResourceDto> fireBrigadeResourceList = Lists.newArrayList();
if(type!=null&&!"".equals(type)){
// 3.消防队伍-监控大队
List<FireBrigadeResourceDto> monitorFireBrigadeList1 = fireTeamService.listMonitorFireBrigade(FireBrigadeTypeEnum.医疗救援队.getCode());
FireBrigadeResourceDto monitorResourceDto1 = new FireBrigadeResourceDto();
monitorResourceDto1.setId("0");
monitorResourceDto1.setName(FireBrigadeTypeEnum.医疗救援队.getName());
monitorResourceDto1.setType(FireBrigadeTypeEnum.医疗救援队.getKey());
monitorResourceDto1.setChildren(monitorFireBrigadeList1);
if (!CollectionUtils.isEmpty(monitorFireBrigadeList1)) {
fireBrigadeResourceList.add(monitorResourceDto1);
}
}
// 1.调用装备服务接口查询车辆列表
List<FireBrigadeResourceDto> fireCarDtoList = Lists.newArrayList();
ResponseModel<Object> result = equipFeignService.getFireCarListAll();
......@@ -208,7 +221,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
// 3.消防队伍-监控大队
List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade();
List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade(FireBrigadeTypeEnum.监控大队.getCode());
FireBrigadeResourceDto monitorResourceDto = new FireBrigadeResourceDto();
monitorResourceDto.setId("0");
monitorResourceDto.setName(FireBrigadeTypeEnum.监控大队.getName());
......@@ -219,6 +232,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
fireBrigadeResourceList.add(monitorResourceDto);
}
return fireBrigadeResourceList;
}
......
......@@ -30,7 +30,7 @@ public class ShieldServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("SHIELD");
return ResponseHelper.buildResponse(data!=null?data.getResult():0);
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("SHIELD");
return data!=null?data.getResult():0;
}
}
......@@ -30,7 +30,7 @@ public class WarningServiceImpl implements IHomePageService {
@Override
public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("NOTICE");
return ResponseHelper.buildResponse(data!=null?data.getResult():0);
ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("NOTICE");
return data!=null?data.getResult():0;
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/**
* @description:
......@@ -11,12 +17,20 @@ import org.springframework.stereotype.Service;
@Service
public class YesServiceImpl implements IHomePageService {
//实现首页dispatchMap
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override
public Object getHomePageData() {
return 0;
ResponseModel<Integer> data= quipFeignClient1.getcountAlarmHandle("yes");
return data!=null?data.getResult():0;
}
}
......@@ -104,8 +104,8 @@ public class CheckController extends AbstractBaseController {
// @Value("${file.port}")
// private String filePort;
@Value("${file.url}")
private String fileUrl;
// @Value("${file.url}")
// private String fileUrl;
@Value("${amosRefresh.patrol.topic}")
private String patrolTopic;
......@@ -196,7 +196,8 @@ public class CheckController extends AbstractBaseController {
String fileName = "巡检记录图片" + new Date().getTime() + ".zip";
// String rootPath = "http://" + fileIp + ":" + filePort + "/";
for (Map<String, Object> map : list) {
map.put("photoData", fileUrl + map.get("photoData").toString());
// map.put("photoData", fileUrl + map.get("photoData").toString());
map.put("photoData", map.get("photoData").toString());
}
FileHelper.exportZip(list, fileName, response);
}
......@@ -210,7 +211,8 @@ public class CheckController extends AbstractBaseController {
String fileName = "巡检记录图片" + new Date().getTime() + ".zip";
// String rootPath = "http://" + fileIp + ":" + filePort + "/";
for (Map<String, Object> map : list) {
map.put("photoData", fileUrl + map.get("photoData").toString());
// map.put("photoData", fileUrl + map.get("photoData").toString());
map.put("photoData", map.get("photoData").toString());
}
FileHelper.exportZip(list, fileName, response);
}
......
......@@ -95,9 +95,9 @@ public class GroupController extends AbstractBaseController{
for (DepartmentBo d : departmentBos) {
LinkedHashMap<String, Object> dept = new LinkedHashMap<>();
dept.put("id", d.getSequenceNbr());
dept.put("key", d.getSequenceNbr());
dept.put("value", d.getSequenceNbr());
dept.put("id", String.valueOf(d.getSequenceNbr()));
dept.put("key", String.valueOf(d.getSequenceNbr()));
dept.put("value", String.valueOf(d.getSequenceNbr()));
dept.put("state", "open");
dept.put("type", "department");
dept.put("orgCode", loginOrgCode+"-"+d.getSequenceNbr());
......
......@@ -56,7 +56,6 @@ public class LatentDangerController extends AbstractBaseController {
@PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse();
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
......
......@@ -8,7 +8,7 @@ import java.io.Serializable;
@RuleFact(value = "消防设备",project = "维保规范")
public class EquipmentInputItemRo implements Serializable {
private static final long serialVersionUID = -7088399431688039744L;
private static final long serialVersionUID = 2994025183812872473L;
@Label("设备名称")
private String equipmentName;
......
......@@ -47,4 +47,19 @@ public class LatentDangerNormalParam {
* 建筑名称
*/
private String structureName;
/**
* 隐患地址经度
*/
private String longitude;
/**
* 隐患地址纬度
*/
private String latitude;
/**
* 业务类型(不同业务创建的隐患以此区分)
*/
private String bizType;
}
......@@ -44,9 +44,9 @@ public class LatentDangerPatrolItemParam {
private String instanceKey;
/*
/**
* 隐患名称
* */
*/
private String name;
private String limitDate;
......
......@@ -142,8 +142,8 @@ public class CheckServiceImpl implements ICheckService {
//
// @Value("${file.port}")
// private String filePort;
@Value("${file.url}")
private String fileUrl;
// @Value("${file.url}")
// private String fileUrl;
@Override
public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) {
......@@ -549,7 +549,8 @@ public class CheckServiceImpl implements ICheckService {
PointCheckDetailBo pointCheckDetailBo = list.get(0);
List<CheckShot> pointShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), 0l,0l);
pointShot.forEach(action -> {
pointImgUrls.add(fileUrl + action.getPhotoData());
// pointImgUrls.add(fileUrl + action.getPhotoData());
pointImgUrls.add(action.getPhotoData());
});
Check check = checkDao.findById(checkId).get();
pointCheckRespone.setPointId(pointCheckDetailBo.getPointId());
......@@ -586,7 +587,8 @@ public class CheckServiceImpl implements ICheckService {
List<String> pointInputImgUrls = new ArrayList<>();
List<CheckShot> pointInputShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), action.getCheckInputId(),action.getClassifyId());
pointInputShot.forEach(inputShot -> {
pointInputImgUrls.add(fileUrl + inputShot.getPhotoData());
// pointInputImgUrls.add(fileUrl + inputShot.getPhotoData());
pointInputImgUrls.add(inputShot.getPhotoData());
});
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone();
appCheckInputRespone.setCheckInputId(action.getCheckInputId());
......@@ -633,7 +635,8 @@ public class CheckServiceImpl implements ICheckService {
PointCheckDetailBo pointCheckDetailBo = list.get(0);
List<CheckShot> pointShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), 0l,0l);
pointShot.forEach(action -> {
pointImgUrls.add(fileUrl + action.getPhotoData());
// pointImgUrls.add(fileUrl + action.getPhotoData());
pointImgUrls.add(action.getPhotoData());
});
Check check = checkDao.findById(checkId).get();
pointCheckRespone.setPointId(pointCheckDetailBo.getPointId());
......@@ -674,7 +677,8 @@ public class CheckServiceImpl implements ICheckService {
List<String> pointInputImgUrls = new ArrayList<>();
List<CheckShot> pointInputShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), action.getCheckInputId(),action.getClassifyId());
pointInputShot.forEach(inputShot -> {
pointInputImgUrls.add(fileUrl + inputShot.getPhotoData());
// pointInputImgUrls.add(fileUrl + inputShot.getPhotoData());
pointInputImgUrls.add(inputShot.getPhotoData());
});
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone();
appCheckInputRespone.setCheckInputId(action.getCheckInputId());
......@@ -765,8 +769,10 @@ public class CheckServiceImpl implements ICheckService {
// String ipPort = "http://" + fileIp + ":" + filePort + "/";
for (Map<String, Object> map : checkimgs) {
String imgPath = map.get("photoData").toString().replace("\\", "/");
map.put("photoData", fileUrl + imgPath);
map.put("openOperUrl", "window.open('" + fileUrl + imgPath + "')");
// map.put("photoData", fileUrl + imgPath);
// map.put("openOperUrl", "window.open('" + fileUrl + imgPath + "')");
map.put("photoData", imgPath);
map.put("openOperUrl", "window.open('" + imgPath + "')");
}
resp.put("imgs", checkimgs);
return resp;
......@@ -1118,8 +1124,8 @@ public class CheckServiceImpl implements ICheckService {
//checkInputId
if (e.get("inputId").toString().equals(imgContent.get(i).get("checkInputId").toString())
&& e.get("classifyId").toString().equals(imgContent.get(i).get("classifyId").toString())) {
photoList.add(fileUrl + imgContent.get(i).get("photoData"));
// photoList.add(fileUrl + imgContent.get(i).get("photoData"));
photoList.add(String.valueOf(imgContent.get(i).get("photoData")));
}
if (PointStatusEnum.UNQUALIFIED.getName().equals(e.get("IsOK").toString())) {
equip.put("IsOK", PointStatusEnum.UNQUALIFIED.getName());
......@@ -1177,7 +1183,8 @@ public class CheckServiceImpl implements ICheckService {
//checkInputId
if(e.get("checkInputId").toString().equals(imgContent.get(i).get("checkInputId").toString())
&& e.get("classifyId").toString().equals(imgContent.get(i).get("classifyId").toString())){
e.put("photoData",fileUrl+imgContent.get(i).get("photoData"));
// e.put("photoData",fileUrl+imgContent.get(i).get("photoData"));
e.put("photoData",imgContent.get(i).get("photoData"));
}
}
});
......
package com.yeejoin.amos.patrol.business.service.impl;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -106,6 +77,34 @@ import com.yeejoin.amos.patrol.dao.entity.PointClassify;
import com.yeejoin.amos.patrol.exception.YeeException;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static org.typroject.tyboot.core.foundation.context.RequestContext.getProduct;
@Service("latentDangerService")
public class LatentDangerServiceImpl implements ILatentDangerService {
......@@ -180,8 +179,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// @Value("${LatentDanger.flow.photoUrls}")
// private String photoUrlPre;
@Value("${file.url}")
private String fileUrl;
// @Value("${file.url}")
// private String fileUrl;
@Value("${file.url}")
private String fileServerAddress;
......@@ -419,7 +418,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
String[] photoUrlsList = photoUrls.split(",");
for (String url : photoUrlsList) {
if (!"".equals(url)){
photoUrlsB.append(fileUrl+url);
// photoUrlsB.append(fileUrl+url);
photoUrlsB.append(url);
photoUrlsB.append(",");
}
}
......@@ -440,7 +440,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
record.setExcuteUserId(userId);
record.setExcuteDepartmentId(departmentId);
if(flowJson != null && org.apache.commons.lang3.StringUtils.isNotBlank(flowJson.getString("photoUrls"))){
flowJson.put("photoUrls",fileUrl+flowJson.getString("photoUrls"));
// flowJson.put("photoUrls",fileUrl+flowJson.getString("photoUrls"));
flowJson.put("photoUrls",flowJson.getString("photoUrls"));
}
record.setFlowJson(flowJson != null ? flowJson.toJSONString() : null);
record.setFlowTaskName(taskName);
......@@ -540,14 +541,14 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
@Override
public CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId) {
JSONObject respBody;
Date startDate = new Date();
Date startDate = new Date();
if (latentDangerListParam.getIsHandle()) {
respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType());
} else {
respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType());
}
Date endDate = new Date();
logger.info("-------------------------工作流列表时间" +(endDate.getTime()-startDate.getTime()));
Date endDate = new Date();
logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime()));
JSONArray taskJsonList = respBody.getJSONArray("data");
List<JSONObject> taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class);
List<String> bussinessKeys = new ArrayList<>();
......@@ -720,9 +721,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
}
@Override
public CommonResponse detail(String id, String userId,boolean isFinish) {
public CommonResponse detail(String id, String userId, boolean isFinish) {
JSONObject jsonObject;
if(isFinish==true){
if(isFinish){
jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id);
}else{
jsonObject = remoteWorkFlowService.queryTaskDetail(id);
......@@ -1172,7 +1173,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
String departmentName,
DangerExecuteSubmitDto executeSubmitDto,
RoleBo role) {
JSONObject executeJson = remoteWorkFlowService.excute(param.getTaskId(), executeTypeEnum.getRequestBody());
JSONObject executeJson = remoteWorkFlowService.execute(param.getTaskId(), executeTypeEnum.getRequestBody());
if (executeJson == null) {
executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("执行失败");
......
......@@ -105,8 +105,8 @@ public class TaskServiceImpl implements ITaskService {
// @Value("${LatentDanger.flow.photoUrls}")
// private String photoUrl;
@Value("${file.url}")
private String fileUrl;
// @Value("${file.url}")
// private String fileUrl;
@Override
@Transactional
public Long addNewTask(TaskParam param) {
......@@ -174,7 +174,8 @@ public class TaskServiceImpl implements ITaskService {
List<String> list = new ArrayList<>();
List<String> picList = taskPictureMapper.queryTaskFeedbackPic(feedback.getId());
for (int i = 0; i <picList.size() ; i++) {
list.add(fileUrl+ picList.get(i));
// list.add(fileUrl+ picList.get(i));
list.add(picList.get(i));
}
feedbackBo.setFeedbackPics(list);
feedbackList.add(feedbackBo);
......
......@@ -173,7 +173,7 @@ public class RemoteWorkFlowService {
// return json;
// }
public JSONObject excute(String taskId, String requestBody) {
public JSONObject execute(String taskId, String requestBody) {
Map<String, String> map = Maps.newHashMap();
map.put("taskId", taskId);
Map<String, String> headerMap = Maps.newHashMap();
......
......@@ -95,6 +95,10 @@
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
</dependency>
......
package com.yeejoin.amos.supervision.business.controller;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dto.CheckDto;
import com.yeejoin.amos.supervision.business.param.CheckInfoPageParam;
import com.yeejoin.amos.supervision.business.param.CheckPageParam;
import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import com.yeejoin.amos.supervision.business.param.CheckStatisticalParam;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.ISafety3DDataSendService;
import com.yeejoin.amos.supervision.business.util.*;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.core.async.AsyncTask;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.supervision.core.framework.PersonIdentify;
import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.mqtt.WebMqttComponent;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.BooleanUtils;
import org.slf4j.Logger;
......@@ -35,48 +34,22 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dto.CheckDto;
import com.yeejoin.amos.supervision.business.param.CheckInfoPageParam;
import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import com.yeejoin.amos.supervision.business.param.CheckStatisticalParam;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.ISafety3DDataSendService;
import com.yeejoin.amos.supervision.business.util.CheckPageParamUtil;
import com.yeejoin.amos.supervision.business.util.CheckParamUtil;
import com.yeejoin.amos.supervision.business.util.CommonResponse;
import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
import com.yeejoin.amos.supervision.business.util.DaoCriteria;
import com.yeejoin.amos.supervision.business.util.FileHelper;
import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.business.util.ToolUtils;
import com.yeejoin.amos.supervision.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.*;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = "/api/check")
@Api(tags = "巡检记录api")
......@@ -100,14 +73,14 @@ public class CheckController extends AbstractBaseController {
@Value("${linux.img.path}")
private String linuxImgPath;
// @Value("${file.ip}")
// @Value("${file.ip}")
// private String fileIp;
//
// @Value("${file.port}")
// private String filePort;
@Value("${file.url}")
private String fileUrl;
@Value("${amosRefresh.patrol.topic}")
private String patrolTopic;
@Autowired
......@@ -572,7 +545,7 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存检查记录", notes = "保存检查记录")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public ResponseModel saveSupervisionCheckRecord( @ApiParam(value = "检查信息", required = false) @RequestBody(required = true) CheckRecordParam requestParam) {
public ResponseModel saveSupervisionCheckRecord(@ApiParam(value = "检查信息", required = false) @RequestBody(required = true) CheckRecordParam requestParam) {
try {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
......@@ -585,4 +558,26 @@ public class CheckController extends AbstractBaseController {
}
}
/**
* 分页查询检查项
*
* @param queryRequests
* @param pageable
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询检查记录", notes = "分页查询检查记录")
@RequestMapping(value = "/queryPage", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse queryPage(
@ApiParam(value = "组合查询条件", required = false, defaultValue = "[]") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = false, defaultValue = "current=0&pageSize=10或pageNumber0&pageSize=10") CommonPageable pageable) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("orgCode", loginOrgCode);
CheckPageParam criterias = CheckParamUtil.fillCheckPageParam(queryRequests, pageable, paramMap);
Page<CheckVo> page = checkService.queryPage(criterias);
return CommonResponseUtil.success(page);
}
}
......@@ -231,6 +231,28 @@ public class InputItemController extends AbstractBaseController {
}
/**
* 分页查询检查项
*
* @param queryRequests
* @param pageable
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询检查项", notes = "分页查询检查项")
@RequestMapping(value = "/queryPage", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse queryPage(
@ApiParam(value = "组合查询条件", required = false, defaultValue = "[]") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = false, defaultValue = "current=0&pageSize=10或pageNumber0&pageSize=10") CommonPageable pageable) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("orgCode", loginOrgCode);
InputItemPageParam criterias = InputItemParamUtil.fillInputItemPageParam(queryRequests, pageable, paramMap);
Page<InputItemVo> page = inputItemService.queryPage(criterias);
return CommonResponseUtil.success(page);
}
/**
* 条件查询检查项
*
* @param queryRequests
......
......@@ -196,7 +196,7 @@ public class PlanController extends AbstractBaseController {
@RequestMapping(value = "/setPlanStatus", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse setPlanStatus(
@ApiParam(value = "计划id") @RequestParam(value = "planId", required = false) Long planId,
@ApiParam(value = "计划状态") @RequestParam(value = "status", required = false) byte status ) {
@ApiParam(value = "计划状态") @RequestParam(value = "status", required = false) Integer status ) {
planService.setplanstatus(planId, status);
return CommonResponseUtil.success();
}
......
package com.yeejoin.amos.supervision.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IRoutePointItemService;
import com.yeejoin.amos.supervision.business.util.CommonResponse;
import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
import com.yeejoin.amos.supervision.business.util.InputItemParamUtil;
import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import java.util.HashMap;
import java.util.List;
/**
* @author gaojianqiang
* @date 2021/09/10 11:28
*/
@RestController
@RequestMapping(value = "/api/routePointItem")
@Api(tags = "巡检路线点项api")
public class RoutePointItemController extends AbstractBaseController {
private final Logger log = LoggerFactory.getLogger(RoutePointItemController.class);
@Autowired
private IRoutePointItemService routePointItemService;
/**
* 增加巡检路线点项关系
*
* @param plan 巡检计划
* @param inputItemIds 巡检项IDS
* @return CommonResponse
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡检路线点项关系", notes = "新增巡检路线点项关系")
@PostMapping(value = "/addRoutePointItem", produces = "application/json;charset=UTF-8")
public CommonResponse addRoute(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan plan,
@ApiParam(value = "检查项IDS", required = false) @RequestParam List<Long> inputItemIds,
@ApiParam(value = "是否保存并提交", required = true) @RequestParam Boolean status) {
try {
String userId = getUserId();
if (StringUtils.isNotBlank(userId)) {
return CommonResponseUtil.success(routePointItemService.addRoutePointItemList(plan, inputItemIds, status, userId));
}
return CommonResponseUtil.failure("创建用户为空!");
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检路线点项关系新增失败!");
}
}
/**
* 分页查询检查项
*
* @param queryRequests
* @param pageable
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "分页查询检查项", notes = "分页查询检查项")
@RequestMapping(value = "/queryPage", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse queryPage(
@ApiParam(value = "组合查询条件", required = false, defaultValue = "[]") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = false, defaultValue = "current=0&pageSize=10或pageNumber0&pageSize=10") CommonPageable pageable) {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> paramMap = new HashMap<String, Object>();
paramMap.put("orgCode", loginOrgCode);
InputItemPageParam criterias = InputItemParamUtil.fillInputItemPageParam(queryRequests, pageable, paramMap);
Page<RoutePointItemVo> page = routePointItemService.queryPage(criterias);
return CommonResponseUtil.success(page);
}
/**
* 删除巡检路线点项关系
*
* @param ids
* @return CommonResponse
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "删除巡检路线点项关系", notes = "删除巡检路线点项关系")
@PostMapping(value = "/deleteByIdIn", produces = "application/json;charset=UTF-8")
public CommonResponse deleteByIdIn(@ApiParam(value = "ids", required = true) @RequestParam List<Long> ids) {
try {
routePointItemService.deleteByIdIn(ids);
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("删除巡检路线点项关系失败!");
}
}
}
......@@ -38,4 +38,10 @@ public interface InputItemMapper {
void updatePointById(Map<String, Object> param);
List<Long> getIds();
List<InputItem> findByIdIn(@Param("list") List<Long> inputItemIds);
long queryPageCount(InputItemPageParam param);
List<InputItemVo> queryPage(InputItemPageParam param);
}
package com.yeejoin.amos.supervision.business.dao.mapper;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
public interface RoutePointItemMapper extends BaseMapper{
import java.util.List;
public void updateRoutePointItem( RoutePointItem pointItem);
public interface RoutePointItemMapper extends BaseMapper {
public void updateRoutePointItem(RoutePointItem pointItem);
int delRoutePointItemByRouteId(Long routeId);
long queryPageCount(InputItemPageParam param);
List<RoutePointItemVo> queryPage(InputItemPageParam param);
}
......@@ -30,6 +30,11 @@ public interface IPlanDao extends BaseDao<Plan, Long> {
@Query(value = "UPDATE p_plan SET is_delete = 1,`status` = 1 WHERE id IN (?1)", nativeQuery = true)
void updatePlanDel(List<Long> ids);
@Modifying
@Transactional
@Query(value = "UPDATE p_plan SET `status` = (?1) WHERE id = (?2)", nativeQuery = true)
void updatePlanStatus(Integer status, Long planId);
Plan findByOriginalId(String originalId);
@Query(value = "select * from p_plan where original_id in (?1) and is_delete = 0", nativeQuery = true)
......
......@@ -22,5 +22,10 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> {
@Modifying
@Transactional
@Query(value = "delete from p_route_point_item WHERE id in (?1)", nativeQuery = true)
void deleteByRoutePointItemId(List<Long> delRoutePointItemIds);
int deleteByRoutePointItemId(List<Long> delRoutePointItemIds);
@Modifying
@Transactional
@Query(value = "delete from p_route_point_item WHERE plan_id = ?1", nativeQuery = true)
void deleteByPlanId(Long planId);
}
package com.yeejoin.amos.supervision.business.param;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import lombok.Data;
@Data
public class CheckPageParam extends CommonPageable {
private Long planId;
private Long companyId;
private String orgCode;
}
......@@ -4,82 +4,129 @@ import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import java.util.List;
public class InputItemPageParam extends CommonPageable{
private String isScore;
private String itemType;
private String name;
private String level;
private String itemNo;
/**
* 机构
*/
private String orgCode;
private String inputClassify;
public String getItemClassify() {
return itemClassify;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
}
private String itemClassify;
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
private List<Long> catalogIds;
public String getItemNo() {
return itemNo;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getIsScore() {
return isScore;
}
public void setIsScore(String isScore) {
this.isScore = isScore;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public List<Long> getCatalogIds() {
return catalogIds;
}
public void setCatalogIds(List<Long> catalogIds) {
this.catalogIds = catalogIds;
}
public class InputItemPageParam extends CommonPageable {
private String isScore;
private String itemType;
private String name;
private String level;
private String itemNo;
private String checkTypeId;
private String itemStart;
private Long planId;
private String itemTypeClassifyIds;
/**
* 机构
*/
private String orgCode;
private String inputClassify;
public String getItemClassify() {
return itemClassify;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
}
private String itemClassify;
public String getInputClassify() {
return inputClassify;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
}
private List<Long> catalogIds;
public String getItemNo() {
return itemNo;
}
public void setItemNo(String itemNo) {
this.itemNo = itemNo;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
public String getIsScore() {
return isScore;
}
public void setIsScore(String isScore) {
this.isScore = isScore;
}
public String getItemType() {
return itemType;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public List<Long> getCatalogIds() {
return catalogIds;
}
public void setCatalogIds(List<Long> catalogIds) {
this.catalogIds = catalogIds;
}
public String getCheckTypeId() {
return checkTypeId;
}
public void setCheckTypeId(String checkTypeId) {
this.checkTypeId = checkTypeId;
}
public String getItemStart() {
return itemStart;
}
public void setItemStart(String itemStart) {
this.itemStart = itemStart;
}
public Long getPlanId() {
return planId;
}
public void setPlanId(Long planId) {
this.planId = planId;
}
public String getItemTypeClassifyIds() {
return itemTypeClassifyIds;
}
public void setItemTypeClassifyIds(String itemTypeClassifyIds) {
this.itemTypeClassifyIds = itemTypeClassifyIds;
}
}
......@@ -277,4 +277,12 @@ public class InputItemServiceImpl implements IInputItemService {
inputItemMapper.updatePointById(param);
}
@Override
public Page<InputItemVo> queryPage(InputItemPageParam param) {
long total = inputItemMapper.queryPageCount(param);
List<InputItemVo> content = inputItemMapper.queryPage(param);
Page<InputItemVo> result = new PageImpl<InputItemVo>(content, param, total);
return result;
}
}
......@@ -10,6 +10,7 @@ import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil;
......@@ -81,6 +82,10 @@ public class PlanServiceImpl implements IPlanService {
Map<String, String> userIdNameMap = userModels.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName));
content.forEach(c -> {
this.buildUserName(c, "createBy", userIdNameMap);
if (c.containsKey("status")) {
String finishStatusDesc = PlanStatusEnum.getName(Integer.parseInt(c.get("status").toString()));
c.put("statusDesc", finishStatusDesc);
}
});
return new PageImpl<>(content, param, total);
}
......@@ -110,7 +115,7 @@ public class PlanServiceImpl implements IPlanService {
String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString();
String userId = map.get("user_id") == null ? "" : map.get("user_id").toString();
param.setOrgCode(orgCode);
param.setStatus(Byte.parseByte(XJConstant.PLAN_STATUS_STOP));
// param.setStatus(Byte.parseByte(XJConstant.PLAN_STATUS_STOP));
param.setNextGenDate(DateUtil.getIntervalDate(new Date(), 0));
param.setCreateBy(userId);
addPlanRequest.setPlan(param);
......@@ -144,7 +149,7 @@ public class PlanServiceImpl implements IPlanService {
if (plan.getId()>0) {
// 删除相关点项内容
iRoutePointDao.delRoutePointByRouteId(plan.getRouteId());
iRoutePointItemDao.delRoutePointItem(plan.getRouteId());
// iRoutePointItemDao.delRoutePointItem(plan.getRouteId());
saveRoute.setId(plan.getRouteId());
}
......@@ -173,16 +178,16 @@ public class PlanServiceImpl implements IPlanService {
iRoutePointDao.save(routePoint);
// List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point);
List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point);
pointMapper.getPointClassInputItemById(point);
if (!ObjectUtils.isEmpty(pointInputItems)) {
pointInputItems.forEach(pointInputItem -> {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setRoutePointId(routePoint.getId());
routePointItem.setPointInputItemId(pointInputItem.getId());
iRoutePointItemDao.save(routePointItem);
});
}
// List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point);
// pointMapper.getPointClassInputItemById(point);
// if (!ObjectUtils.isEmpty(pointInputItems)) {
// pointInputItems.forEach(pointInputItem -> {
// RoutePointItem routePointItem = new RoutePointItem();
// routePointItem.setRoutePointId(routePoint.getId());
// routePointItem.setPointInputItemId(pointInputItem.getId());
// iRoutePointItemDao.save(routePointItem);
// });
// }
});
}
}
......@@ -236,7 +241,7 @@ public class PlanServiceImpl implements IPlanService {
for (long planId : planIds) {
List<Plan> planList = getPlanByRouteId(planId);
for (Plan plan : planList) {
plan.setStatus((byte) 1);
plan.setStatus(1);
planDao.save(plan);
}
}
......@@ -265,7 +270,7 @@ public class PlanServiceImpl implements IPlanService {
}
@Override
public void setplanstatus (Long id, byte status) {
public void setplanstatus (Long id, Integer status) {
Plan oriPlan = planDao.findById(id).get();
oriPlan.setStatus(status);
planDao.save(oriPlan);
......
......@@ -3,46 +3,25 @@ package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.safety.common.cache.PointStatusCache;
import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dao.repository.ICatalogTreeDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanTaskDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanTaskDetailDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointClassifyDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointInputItemDao;
import com.yeejoin.amos.supervision.business.dao.repository.IPointPhotoDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointItemDao;
import com.yeejoin.amos.supervision.business.dto.FormValue;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.dto.PointDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.*;
import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam;
import com.yeejoin.amos.supervision.business.param.MovePointParam;
import com.yeejoin.amos.supervision.business.param.PointImportParam;
import com.yeejoin.amos.supervision.business.param.PointImportQueryParam;
import com.yeejoin.amos.supervision.business.param.PointParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.DaoCriteria;
import com.yeejoin.amos.supervision.business.vo.*;
import com.yeejoin.amos.supervision.business.vo.InputItemVo;
import com.yeejoin.amos.supervision.business.vo.LeavelMovePointVo;
import com.yeejoin.amos.supervision.business.vo.MaintenanceResourceData;
import com.yeejoin.amos.supervision.business.vo.PointClassifyVo;
import com.yeejoin.amos.supervision.business.vo.PointInputItemVo;
import com.yeejoin.amos.supervision.business.vo.PointVo;
import com.yeejoin.amos.supervision.common.enums.PointStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.PointResponse;
......@@ -51,19 +30,8 @@ import com.yeejoin.amos.supervision.core.util.query.BaseQuerySpecification;
import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.safety.common.cache.PointStatusCache;
import com.yeejoin.amos.supervision.dao.entity.CatalogTree;
import com.yeejoin.amos.supervision.dao.entity.InputItem;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.supervision.dao.entity.Point;
import com.yeejoin.amos.supervision.dao.entity.PointClassify;
import com.yeejoin.amos.supervision.dao.entity.PointInputItem;
import com.yeejoin.amos.supervision.dao.entity.PointPhoto;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.assertj.core.util.Sets;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -141,7 +109,7 @@ public class PointServiceImpl implements IPointService {
Point point = pointParam.getPoint();
point.setIsDelete(false);
iPointDao.saveAndFlush(point);
addClassifyAndInputItem(pointParam, point);
// addClassifyAndInputItem(pointParam, point);
return point;
}
......
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