Commit 517a8d98 authored by kongfm's avatar kongfm

Merge branch 'developer' into chenhao

parents 20555c9b bdc92b74
...@@ -12,13 +12,13 @@ import lombok.AllArgsConstructor; ...@@ -12,13 +12,13 @@ import lombok.AllArgsConstructor;
public enum HomePageEnum { public enum HomePageEnum {
DISPATCHALARM("dispatchAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"), DISPATCHALARM("dispatchAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"),
DISPATCHTASK("dispatchTask", "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.DispatchMapServiceImpl"), FIREALARM("fireAlarm", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireAlarmServiceImpl"),
FAULT("fault", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"), FAULT("fault", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.FaultServiceImpl"),
SHIELD("shield", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"), SHIELD("shield", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.ShieldServiceImpl"),
WARNING("warning", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"), WARNING("warning", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.WarningServiceImpl"),
NO("no", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"), NO("no", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.NoServiceImpl"),
YES("yes", "com.yeejoin.amos.boot.module.jcs.biz.service.impl.DispatchMapServiceImpl"); 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 { ...@@ -46,4 +46,17 @@ public class DutyCarDto implements Serializable {
@ApiModelProperty(value = "值班信息") @ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift = new ArrayList<>(); 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 { ...@@ -62,4 +62,9 @@ public class DutyCarExcelDto implements Serializable {
@ExcelProperty(value = "车辆名称(车牌)", index = 4) @ExcelProperty(value = "车辆名称(车牌)", index = 4)
@ApiModelProperty(value = "车辆名称") @ApiModelProperty(value = "车辆名称")
private String carName; 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 { ...@@ -39,4 +39,17 @@ public class DutyPersonDto implements Serializable {
@ApiModelProperty(value = "值班信息") @ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift; 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 { ...@@ -52,4 +52,9 @@ public class DutyPersonExcelDto implements Serializable {
@ExcelProperty(value = "岗位", index = 4) @ExcelProperty(value = "岗位", index = 4)
@ApiModelProperty(value = "岗位名称") @ApiModelProperty(value = "岗位名称")
private String postTypeName; 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 { ...@@ -52,46 +52,46 @@ public class FireChemicalDto extends BaseDto {
private String formula; private String formula;
@ApiModelProperty(value = "主要成分") @ApiModelProperty(value = "主要成分")
@ExcelProperty(value = "主要成分", index = 7) @ExcelIgnore
private String ingredient; private String ingredient;
@ApiModelProperty(value = "泄漏处理") @ApiModelProperty(value = "泄漏处理")
@ExcelProperty(value = "泄漏处理", index = 8) @ExcelProperty(value = "泄漏处理", index = 7)
private String leakWay; private String leakWay;
@ExcelProperty(value = "中文名", index = 0) @ExcelProperty(value = "中文名", index = 0)
@ApiModelProperty(value = "中文名") @ApiModelProperty(value = "中文名")
private String name; private String name;
@ApiModelProperty(value = "性状") @ApiModelProperty(value = "性状")
@ExcelProperty(value = "性状", index = 9) @ExcelProperty(value = "性状", index = 8)
private String property; private String property;
@ApiModelProperty(value = "贮藏方法") @ApiModelProperty(value = "贮藏方法")
@ExcelProperty(value = "贮藏方法", index = 10) @ExcelProperty(value = "贮藏方法", index = 9)
private String store; private String store;
@ApiModelProperty(value = "症状") @ApiModelProperty(value = "症状")
@ExcelProperty(value = "症状", index = 11) @ExcelProperty(value = "症状", index = 10)
private String symptom; private String symptom;
@ApiModelProperty(value = "禁忌物/禁忌") @ApiModelProperty(value = "禁忌物/禁忌")
@ExcelProperty(value = "禁忌物/禁忌", index = 12) @ExcelProperty(value = "禁忌物/禁忌", index = 11)
private String tabu; private String tabu;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "类型code") @ApiModelProperty(value = "类型code")
private String typeCode; private String typeCode;
@ExplicitConstraint(type = "CHEMICALTYPE", indexNum = 13, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "CHEMICALTYPE", indexNum = 12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "类型名称") @ApiModelProperty(value = "类型名称")
@ExcelProperty(value = "类型名称", index = 13) @ExcelProperty(value = "类型名称", index = 12)
private String type; private String type;
// @ExplicitConstraint(indexNum=14,source = {"男","女"}) //固定下拉内容 // @ExplicitConstraint(indexNum=14,source = {"男","女"}) //固定下拉内容
@ExcelProperty(value = "国标号", index = 14) @ExcelProperty(value = "国标号", index = 13)
@ApiModelProperty(value = "国标号") @ApiModelProperty(value = "国标号")
private String un; private String un;
@ExcelIgnore
@ApiModelProperty(value = "化学品图片") @ApiModelProperty(value = "化学品图片")
@ExcelProperty(value = "化学品图片", index = 15)
private String image; private String image;
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
......
...@@ -107,11 +107,13 @@ public class FireExpertsDto extends BaseDto { ...@@ -107,11 +107,13 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "消防专家领域code") @ApiModelProperty(value = "消防专家领域code")
private String expertCode; private String expertCode;
@ExcelProperty(value = "人员照片", index = 16) // @ExcelProperty(value = "人员照片", index = 16)
@ExcelIgnore
@ApiModelProperty(value = "人员照片") @ApiModelProperty(value = "人员照片")
private String personnelPhotos; private String personnelPhotos;
@ExcelProperty(value = "资质证书", index = 17) // @ExcelProperty(value = "资质证书", index = 17)
@ExcelIgnore
@ApiModelProperty(value = "资质证书") @ApiModelProperty(value = "资质证书")
private String qualificationCertificate; private String qualificationCertificate;
...@@ -131,7 +133,7 @@ public class FireExpertsDto extends BaseDto { ...@@ -131,7 +133,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "消防机构name") @ApiModelProperty(value = "消防机构name")
private Long fireTeamName; private Long fireTeamName;
@ExcelProperty(value = "备注", index = 18) @ExcelProperty(value = "备注", index = 16)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String note; private String note;
......
...@@ -28,6 +28,7 @@ public class FireTeamDto extends BaseDto { ...@@ -28,6 +28,7 @@ public class FireTeamDto extends BaseDto {
@ExcelProperty(value = "所属单位", index = 0) @ExcelProperty(value = "所属单位", index = 0)
@ApiModelProperty(value = "机构名称") @ApiModelProperty(value = "机构名称")
@ExplicitConstraint(indexNum = 0, sourceClass = RoleNameExplicitConstraint.class,method="getCompanyDetailTree") //动态下拉内容
private String companyName; private String companyName;
@ExcelIgnore @ExcelIgnore
......
package com.yeejoin.amos.boot.module.common.api.dto; 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.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; 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.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint; import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint; import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 消防队员 * 消防队员
* *
...@@ -83,39 +87,42 @@ public class FirefightersExcelDto extends BaseDto { ...@@ -83,39 +87,42 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "婚姻状况") @ApiModelProperty(value = "婚姻状况")
private String maritalStatus; private String maritalStatus;
@ExcelIgnore
@ApiModelProperty(value = "籍贯/户口所在地")
private String nativePlace;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm @ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "户籍所在地", index = 10) @ExcelProperty(value = "户籍所在地", index = 10)
@ApiModelProperty(value = "籍贯/户口所在地的值") @ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue; private String nativePlaceValue;
@ExplicitConstraint(indexNum = 11, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容 // BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ExcelProperty(value = "政治面貌", index = 11) @ExcelProperty(value = "籍贯/户口所在地详细地址", index = 11)
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 12)
@ApiModelProperty(value = "政治面貌代码") @ApiModelProperty(value = "政治面貌代码")
private String politicalOutlook; private String politicalOutlook;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm @ExplicitConstraint(indexNum = 13, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 12) @ExcelProperty(value = "现居住地", index = 13)
@ApiModelProperty(value = "现居住地") @ApiModelProperty(value = "现居住地")
private String residence; private String residence;
// BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改
@ExcelProperty(value = "现居住地详细地址", index = 14)
@ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal;
@ExcelIgnore @ExcelProperty(value = "机场住宿情况", index = 15)
@ApiModelProperty(value = "现居住地详情")
private String residenceDetails;
@ExcelProperty(value = "机场住宿情况", index = 13)
@ApiModelProperty(value = "机场住宿情况") @ApiModelProperty(value = "机场住宿情况")
private String airportAccommodation; private String airportAccommodation;
@ExcelProperty(value = "联系电话", index = 14) @ExcelProperty(value = "联系电话", index = 16)
@ApiModelProperty(value = "手机") @ApiModelProperty(value = "手机")
private String mobilePhone; private String mobilePhone;
@ExplicitConstraint(type = "RYZT", indexNum = 15, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "RYZT", indexNum = 17, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 15) @ExcelProperty(value = "人员状态", index = 17)
@ApiModelProperty(value = "人员状态,在职/离职") @ApiModelProperty(value = "人员状态,在职/离职")
private String state; private String state;
...@@ -123,21 +130,21 @@ public class FirefightersExcelDto extends BaseDto { ...@@ -123,21 +130,21 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "人员状态,在职/离职字典code") @ApiModelProperty(value = "人员状态,在职/离职字典code")
private String stateCode; private String stateCode;
@ExplicitConstraint(type = "GWMC", indexNum = 16, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "GWMC", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 16) @ExcelProperty(value = "岗位名称", index = 18)
@ApiModelProperty(value = "岗位名称") @ApiModelProperty(value = "岗位名称")
private String jobTitle; private String jobTitle;
@ExcelProperty(value = "紧急联系人姓名", index = 17) @ExcelProperty(value = "紧急联系人姓名", index = 19)
@ApiModelProperty(value = "紧急联系人姓名") @ApiModelProperty(value = "紧急联系人姓名")
private String emergencyContact; private String emergencyContact;
@ExplicitConstraint(type = "RJGX", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "RJGX", indexNum = 20, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 18) @ExcelProperty(value = "与紧急联系人关系", index = 20)
@ApiModelProperty(value = "紧急联系人与本人所属关系") @ApiModelProperty(value = "紧急联系人与本人所属关系")
private String relationship; private String relationship;
@ExcelProperty(value = "紧急联系人电话", index = 19) @ExcelProperty(value = "紧急联系人电话", index = 21)
@ApiModelProperty(value = "紧急联系人电话") @ApiModelProperty(value = "紧急联系人电话")
private String emergencyContactPhone; private String emergencyContactPhone;
...@@ -168,13 +175,88 @@ public class FirefightersExcelDto extends BaseDto { ...@@ -168,13 +175,88 @@ public class FirefightersExcelDto extends BaseDto {
@ExcelIgnore @ExcelIgnore
@ApiModelProperty(value = "操作人名称") @ApiModelProperty(value = "操作人名称")
private String recUserName; private String recUserName;
@ExcelIgnore @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; 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; 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 { ...@@ -51,54 +51,54 @@ public class KeySiteExcleDto implements Serializable {
@ExcelProperty(value = "建筑面积(㎡)", index = 4) @ExcelProperty(value = "建筑面积(㎡)", index = 4)
@ApiModelProperty(value = "建筑面积(㎡)") @ApiModelProperty(value = "建筑面积(㎡)")
private String buildingArea; private String buildingArea;
@ExcelProperty(value = "建筑高度(m)", index = 5) @ExcelIgnore
@ApiModelProperty(value = "建筑高度(m)") @ApiModelProperty(value = "建筑高度(m)")
private String buildingHeight; private String buildingHeight;
@ExplicitConstraint(type = "NHDJ", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "NHDJ", indexNum =5, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "耐火等级", index = 6) @ExcelProperty(value = "耐火等级", index = 5)
@ApiModelProperty(value = "耐火等级") @ApiModelProperty(value = "耐火等级")
private String fireEnduranceRate; private String fireEnduranceRate;
@ExplicitConstraint(type = "JZWSYXZ", indexNum =7, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "JZWSYXZ", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "使用性质", index = 7) @ExcelProperty(value = "使用性质", index = 6)
@ApiModelProperty(value = "使用性质") @ApiModelProperty(value = "使用性质")
private String useNature; private String useNature;
@ExcelProperty(value = "责任人", index = 8) @ExcelProperty(value = "责任人", index = 7)
@ApiModelProperty(value = "责任人") @ApiModelProperty(value = "责任人")
private String chargePerson; private String chargePerson;
@ExcelProperty(value = "责任人身份证", index = 9) @ExcelProperty(value = "责任人身份证", index = 8)
@ApiModelProperty(value = "责任人身份证") @ApiModelProperty(value = "责任人身份证")
private String chargePersonId; private String chargePersonId;
@ExcelProperty(value = "确定重点防火部位的原因", index = 10) @ExcelProperty(value = "确定重点防火部位的原因", index = 9)
@ApiModelProperty(value = "确定重点防火部位的原因") @ApiModelProperty(value = "确定重点防火部位的原因")
private String keyPreventionReason; private String keyPreventionReason;
@ExcelProperty(value = "消防设施情况", index = 11) @ExcelProperty(value = "消防设施情况", index = 10)
@ExplicitConstraint(indexNum=11,source = {"有","无"}) @ExplicitConstraint(indexNum=11,source = {"有","无"})
@ApiModelProperty(value = "消防设施情况") @ApiModelProperty(value = "消防设施情况")
private String fireFacilitiesInfo; private String fireFacilitiesInfo;
@ExcelProperty(value = "防火标志设立情况", index = 12) @ExcelProperty(value = "防火标志设立情况", index = 11)
@ApiModelProperty(value = "防火标志设立情况") @ApiModelProperty(value = "防火标志设立情况")
private String firePreventionFlagName; private String firePreventionFlagName;
@ExcelProperty(value = "危险源", index = 13) @ExcelProperty(value = "危险源", index = 12)
@ApiModelProperty(value = "危险源") @ApiModelProperty(value = "危险源")
private String hazard; private String hazard;
@ExcelProperty(value = "消防安全管理措施", index = 14) @ExcelProperty(value = "消防安全管理措施", index = 13)
@ApiModelProperty(value = "消防安全管理措施") @ApiModelProperty(value = "消防安全管理措施")
private String safetyManagementMeasures; private String safetyManagementMeasures;
@ExcelProperty(value = "防范手段措施", index = 15) @ExcelProperty(value = "防范手段措施", index = 14)
@ApiModelProperty(value = "防范手段措施") @ApiModelProperty(value = "防范手段措施")
private String preventiveMeasures; private String preventiveMeasures;
@ExcelProperty(value = "备注", index = 16) @ExcelProperty(value = "备注", index = 15)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
} }
...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.dto; ...@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; 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.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint; import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint; import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
...@@ -306,6 +305,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -306,6 +305,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "物联参数") @ApiModelProperty(value = "物联参数")
private WaterResourceIotDto waterResourceIotDto; private WaterResourceIotDto waterResourceIotDto;
@ExcelIgnore
@ApiModelProperty("设施定义id") @ApiModelProperty("设施定义id")
private Long equipId; private Long equipId;
...@@ -313,6 +313,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -313,6 +313,7 @@ public class WaterResourceDto extends BaseDto {
@ExcelProperty(value = "设施定义名称", index = 44) @ExcelProperty(value = "设施定义名称", index = 44)
private String equipName; private String equipName;
@ExcelIgnore
@ApiModelProperty("设施分类id") @ApiModelProperty("设施分类id")
private Long equipCategoryId; private Long equipCategoryId;
......
...@@ -122,4 +122,11 @@ public class Firefighters extends BaseEntity { ...@@ -122,4 +122,11 @@ public class Firefighters extends BaseEntity {
@ApiModelProperty(value = "籍贯/户口所在地的值") @ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue; 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; ...@@ -11,6 +11,8 @@ import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint; import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddressList; import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -30,7 +32,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler { ...@@ -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 { ...@@ -88,6 +90,14 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
// 将刚才设置的sheet引用到你的下拉列表中 // 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers); DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList); DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if(dataValidation instanceof XSSFDataValidation){
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}else{
dataValidation.setSuppressDropDownArrow(false);
}
writeSheetHolder.getSheet().addValidationData(dataValidation); writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏 // 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName); int hiddenIndex = workbook.getSheetIndex(sheetName);
...@@ -95,17 +105,17 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler { ...@@ -95,17 +105,17 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
workbook.setSheetHidden(hiddenIndex, true); workbook.setSheetHidden(hiddenIndex, true);
} }
} }
// 下拉列表约束数据 // // 下拉列表约束数据
DataValidationConstraint constraint = helper.createExplicitListConstraint(v); // DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// 设置约束 // // 设置约束
DataValidation validation = helper.createValidation(constraint, rangeList); // DataValidation validation = helper.createValidation(constraint, rangeList);
// 阻止输入非下拉选项的值 // // 阻止输入非下拉选项的值
validation.setErrorStyle(DataValidation.ErrorStyle.STOP); // validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
validation.setShowErrorBox(true); // validation.setShowErrorBox(true);
validation.setSuppressDropDownArrow(true); // validation.setSuppressDropDownArrow(true);
validation.createErrorBox("提示", "此值与单元格定义格式不一致"); // validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓"); // // validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
sheet.addValidationData(validation); // sheet.addValidationData(validation);
}); });
} }
......
...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -182,6 +183,21 @@ public interface EquipFeignClient { ...@@ -182,6 +183,21 @@ public interface EquipFeignClient {
* 统计 * 统计
**/ **/
@RequestMapping(value = "/equipSpecificAlarm/getcountAlarmHandle/{type}", method = RequestMethod.GET) @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 ...@@ -86,4 +86,23 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("groupCode") String groupCode); @Param("groupCode") String groupCode);
List<DynamicFormInstance> getInstanceByCodeAndValue(String code, String value); 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> { ...@@ -39,7 +39,7 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
* *
* @return * @return
*/ */
List<FireBrigadeResourceDto> listMonitorFireBrigade(); List<FireBrigadeResourceDto> listMonitorFireBrigade(@Param("code") String code );
/** /**
* 查询消防队伍卡片分页列表 * 查询消防队伍卡片分页列表
......
...@@ -23,6 +23,9 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -23,6 +23,9 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List<Map<String, Object>> selectPersonList(@Param("map")Map<String, Object> map); 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<OrgUsr> selectCompanyDepartmentMsg();
List<Map<String, Object>> selectPersonAllList(Map<String, Object> map); List<Map<String, Object>> selectPersonAllList(Map<String, Object> map);
......
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.List;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -23,4 +25,11 @@ public interface IDutyPersonService extends IDutyCommonService { ...@@ -23,4 +25,11 @@ public interface IDutyPersonService extends IDutyCommonService {
* @return List<DutyCarDto> * @return List<DutyCarDto>
*/ */
DutyPersonDto update(Long instanceId, DutyPersonDto dutyPersonDto); 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 { ...@@ -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); List<OrgUsr> getPersonListByParentId(Long id);
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
AND i.field_code = 'userId' AND i.field_code = 'userId'
and s.duty_date >= #{beginDate} and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> #{endDate} 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} and s.app_Key = #{appKey}
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 --> GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay, ) a) as maxDutyPersonNumDay,
...@@ -56,6 +57,7 @@ ...@@ -56,6 +57,7 @@
AND ds.sequence_nbr = s.shift_id AND ds.sequence_nbr = s.shift_id
AND i.field_code = 'userName' AND i.field_code = 'userName'
AND s.duty_date = #{dutyDate} AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
AND s.app_key = #{appKey} AND s.app_key = #{appKey}
and i.group_code =#{groupCode} and i.group_code =#{groupCode}
GROUP BY GROUP BY
...@@ -76,6 +78,7 @@ ...@@ -76,6 +78,7 @@
s.instance_id = i.instance_id s.instance_id = i.instance_id
and i.field_code = 'postTypeName' and i.field_code = 'postTypeName'
AND s.duty_date = #{dutyDate} AND s.duty_date = #{dutyDate}
AND s.shift_id is not null
AND s.app_key = #{appKey} AND s.app_key = #{appKey}
and i.group_code =#{groupCode} and i.group_code =#{groupCode}
GROUP BY i.field_value GROUP BY i.field_value
......
...@@ -198,4 +198,61 @@ ...@@ -198,4 +198,61 @@
</if> </if>
</where> </where>
</select> </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> </mapper>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
FROM cb_fire_team ft FROM cb_fire_team ft
LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr LEFT JOIN cb_firefighters ff ON ff.fire_team_id = ft.sequence_nbr
WHERE ft.is_delete = 0 WHERE ft.is_delete = 0
and ft.type_code = 118 and ft.type_code = #{code}
GROUP BY ft.sequence_nbr GROUP BY ft.sequence_nbr
</select> </select>
<select id="queryFighterByTeamId" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto"> <select id="queryFighterByTeamId" resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto">
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
<select id="getFirefightersJobTitleCount" <select id="getFirefightersJobTitleCount"
resultType="com.yeejoin.amos.boot.biz.common.utils.FirefightersTreeDto"> 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 from cb_firefighters a
where a.is_delete = 0 where a.is_delete = 0
GROUP BY a.job_title_code GROUP BY
a.job_title_code
</select> </select>
<!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm --> <!--消防队员列表按时间倒叙排列add desc 2021-09-08 by kongfm -->
<select id="getFirefighters" <select id="getFirefighters"
...@@ -16,7 +18,8 @@ ...@@ -16,7 +18,8 @@
select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code select a.*,b.areas_expertise areasExpertise ,b.areas_expertise_code
areasExpertiseCode from cb_firefighters a LEFT JOIN areasExpertiseCode from cb_firefighters a LEFT JOIN
cb_firefighters_post b on 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.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.areasExpertise!=null'>and b.areas_expertise_code= #{par.areasExpertise}</if>
<if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if> <if test='par.name!=null'>and a.name like concat ('%',#{par.name},'%')</if>
...@@ -48,7 +51,8 @@ ...@@ -48,7 +51,8 @@
<select id="listToSelectById" resultType="Map"> <select id="listToSelectById" resultType="Map">
SELECT IFNULL(a.personnel_photos, '') personnelPhotos, SELECT
IFNULL(a.personnel_photos, '') personnelPhotos,
a.sequence_nbr a.sequence_nbr
sequenceNbr, sequenceNbr,
IFNULL(a.`name`, '无') `name`, IFNULL(a.`name`, '无') `name`,
...@@ -65,31 +69,92 @@ ...@@ -65,31 +69,92 @@
IFNULL(b.post_qualification, '无') IFNULL(b.post_qualification, '无')
postQualification, year ( from_days( datediff( now( ), postQualification, year ( from_days( datediff( now( ),
a.birthday_time))) age 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 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 c.sequence_nbr=a.fire_team_id
WHERE a.is_delete =0 WHERE a.is_delete =0
and a.sequence_nbr=#{id} and
a.sequence_nbr=#{id}
</select> </select>
<!-- BUG3553 BY kongfm 人员关系显示汉字 --> <!-- BUG3553 BY kongfm 人员关系显示汉字 -->
<!---陈浩修改导出的数据量 2021-09-13-->
<select id="exportToExcel" <select id="exportToExcel"
resultType="com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto"> 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 SELECT
f.*, NAME
( 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 FROM
cb_firefighters f cb_data_dictionary
LEFT JOIN cb_firefighters_contacts fc ON f.sequence_nbr = WHERE
fc.firefighters_id CODE = fe.academic_degree
left join cb_data_dictionary da on da.CODE = fc.relationship AND type = 'XWLX'
where f.is_delete = #{isDelete} ) 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> </select>
</mapper> </mapper>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
cb_dynamic_form_instance m GROUP BY m.instance_id) b cb_dynamic_form_instance m GROUP BY m.instance_id) b
on 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> </select>
<!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm --> <!--联动单位列表按时间倒叙排列add order by clu.rec_date desc 同时处理单位根节点-1时查询全部数据问题 2021-09-08 by kongfm -->
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
cb_linkage_unit clu cb_linkage_unit clu
WHERE clu.is_delete=0 WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''"> <if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat(#{unitName}, '%') AND clu.unit_name LIKE concat('%',#{unitName}, '%')
</if> </if>
<if <if
test="linkageUnitType != null and linkageUnitType != ''"> test="linkageUnitType != null and linkageUnitType != ''">
......
...@@ -94,6 +94,21 @@ ...@@ -94,6 +94,21 @@
LIMIT #{map.pageNum}, #{map.pageSize} LIMIT #{map.pageNum}, #{map.pageSize}
</select> </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 id="selectPersonAllList" resultType="Map">
select * from ( select * from (
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.WaterResourceMapper"> <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 id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto">
select r.name, select r.name,
r.address, r.address,
...@@ -16,6 +16,10 @@ ...@@ -16,6 +16,10 @@
r.reality_img, r.reality_img,
r.contact_user, r.contact_user,
r.contact_phone, 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.height when 'natural' then rn.height end) height,
(case r.resource_type (case r.resource_type
when 'crane' then rc.status when 'crane' then rc.status
...@@ -82,8 +86,8 @@ ...@@ -82,8 +86,8 @@
and a.resource_type= #{par.resourceType} and a.resource_type= #{par.resourceType}
</if> </if>
<if test='par.distance!=null'> <if test='par.distance!=null'>
<!-- and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} --> #{par.distance}
</if> </if>
ORDER BY distance limit #{pageNum},#{pageSize} ORDER BY distance limit #{pageNum},#{pageSize}
</select> </select>
...@@ -97,8 +101,8 @@ ...@@ -97,8 +101,8 @@
and a.resource_type= #{par.resourceType} and a.resource_type= #{par.resourceType}
</if> </if>
<if test='par.distance!=null'> <if test='par.distance!=null'>
<!-- and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance} --> #{par.distance}
</if> </if>
</select> </select>
<select id="getWaterResourceTypeList" resultType="com.yeejoin.amos.boot.module.common.api.dto.WaterResourceTypeDto"> <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 { ...@@ -17,14 +17,15 @@ public enum ExcelEnums {
WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站") WXXFZ("微型消防站", "微型消防站", "com.yeejoin.amos.boot.module.common.api.dto.FireStationDto","WXXFZ"),//("WXXFZ","微型消防站")
XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员") XFRY ("消防人员", "消防人员", "com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto","XFRY"),//("XFRY","消防人员")
WBRY ("维保人员", "维保人员", "com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto","WBRY"),//("WBRY",维保人员) 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","车辆执勤") CLZQ ("车辆执勤", "车辆执勤", "com.yeejoin.amos.boot.module.common.api.dto.DutyCarExcelDto","CLZQ"),//("CLZQ","车辆执勤")
JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位") JCDWRY ("机场单位人员", "机场单位人员", "com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto","JCDWRY"),//("JCDW","机场单位")
LDDW ("联动单位", "联动单位", "com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto","LDDW"),//("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","人员值班") RYZB ("人员值班", "人员值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto","RYZB"),//("RYZB","人员值班")
// BUG 2455 相关代码 bykongfm // BUG 2455 相关代码 bykongfm
TGRY ("特岗人员", "特岗人员", "com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto","TGRY"),//("TGRY","特岗人员") 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 fileName;
private String sheetName; private String sheetName;
......
...@@ -12,6 +12,7 @@ import lombok.Getter; ...@@ -12,6 +12,7 @@ import lombok.Getter;
@AllArgsConstructor @AllArgsConstructor
public enum FireBrigadeTypeEnum { public enum FireBrigadeTypeEnum {
专职消防队("fullTime", "116", "专职消防队"), 专职消防队("fullTime", "116", "专职消防队"),
医疗救援队("monitorTeam", "830", "医疗救援队"),
监控大队("monitorTeam", "118", "监控大队"); 监控大队("monitorTeam", "118", "监控大队");
private String key; private String key;
......
...@@ -47,4 +47,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -47,4 +47,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
Integer AlertCalledcount(@Param("alertStatus")int alertStatus); Integer AlertCalledcount(@Param("alertStatus")int alertStatus);
//未结束灾情列表
List<AlertCalled> AlertCalledStatusPage(@Param("current")Integer current, @Param("size")Integer size);
} }
...@@ -75,4 +75,6 @@ public interface IAlertCalledService { ...@@ -75,4 +75,6 @@ public interface IAlertCalledService {
Integer AlertCalledcount(int type); Integer AlertCalledcount(int type);
List<AlertCalled> AlertCalledStatusPage(Integer current, Integer size);
} }
...@@ -33,7 +33,7 @@ public interface IPowerTransferService extends IService<PowerTransfer> { ...@@ -33,7 +33,7 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
/** /**
* 获取力量调派资源树 * 获取力量调派资源树
*/ */
List<FireBrigadeResourceDto> getPowerTree(); List<FireBrigadeResourceDto> getPowerTree(String type);
List<PowerCompanyCountDto> getPowerCompanyCountDtocount( Long id); List<PowerCompanyCountDto> getPowerCompanyCountDtocount( Long id);
/** /**
......
...@@ -186,5 +186,19 @@ ...@@ -186,5 +186,19 @@
</select> </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> </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; 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 org.hibernate.annotations.Where;
import javax.persistence.*;
/** /**
* 检查项 * 检查项
...@@ -183,42 +179,54 @@ public class InputItem extends BasicEntity { ...@@ -183,42 +179,54 @@ public class InputItem extends BasicEntity {
private String testRequirement; private String testRequirement;
/** /**
* 检查类型字典值
*/
@Column(name = "check_type_Val")
private String checkTypeId;
/**
* 检查类型 * 检查类型
*/ */
@Column(name="check_type") @Column(name = "check_type")
private String checkType; private String checkType;
/** /**
* 父类检查项id * 父类检查项id
*/ */
@Column(name="item_parent") @Column(name = "item_parent")
private String itemParent; private String itemParent;
/** /**
* 检查项分类 * 检查项分类
*/ */
@Column(name="item_classify") @Column(name = "item_classify")
private String itemClassify; private String itemClassify;
/** /**
* 适用检查类别 * 适用检查类别
*/ */
@Lob @Lob
@Column(name="item_type_classify") @Column(name = "item_type_classify")
private String itemTypeClassify; private String itemTypeClassify;
/** /**
* 检查项等级 * 检查项等级
*/ */
@Column(name="item_level") @Column(name = "item_level")
private String itemLevel; private String itemLevel;
/** /**
* 检查项启用 * 检查项启用
*/ */
@Column(name="item_start") @Column(name = "item_start")
private Integer itemStart; private Integer itemStart;
/**
* 扩展属性
*/
@Transient
private String ext;
public Integer getItemStart() { public Integer getItemStart() {
return itemStart; return itemStart;
} }
...@@ -332,14 +340,14 @@ public class InputItem extends BasicEntity { ...@@ -332,14 +340,14 @@ public class InputItem extends BasicEntity {
} }
public String getRiskDesc() { public String getRiskDesc() {
return riskDesc; return riskDesc;
} }
public void setRiskDesc(String riskDesc) { public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc; this.riskDesc = riskDesc;
} }
public String getItemNo() { public String getItemNo() {
return itemNo; return itemNo;
} }
...@@ -498,4 +506,20 @@ public class InputItem extends BasicEntity { ...@@ -498,4 +506,20 @@ public class InputItem extends BasicEntity {
public void setBasisJson(String basisJson) { public void setBasisJson(String basisJson) {
this.basisJson = 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 { ...@@ -163,6 +163,13 @@ public class Plan extends BasicEntity {
*/ */
@Column(name="plan_type") @Column(name="plan_type")
private String planType; private String planType;
/**
* 检查级别
*/
@Column(name="check_level")
private String checkLevel;
/** /**
* 备注 * 备注
*/ */
...@@ -188,8 +195,8 @@ public class Plan extends BasicEntity { ...@@ -188,8 +195,8 @@ public class Plan extends BasicEntity {
/** /**
* 状态:0-已停用;1-正常 * 状态:0-已停用;1-正常
*/ */
@Column(name="[status]") @Column(name="status")
private byte status; private Integer status;
/** /**
* 用户编号 * 用户编号
*/ */
...@@ -555,11 +562,11 @@ public class Plan extends BasicEntity { ...@@ -555,11 +562,11 @@ public class Plan extends BasicEntity {
this.scoreFormula = scoreFormula; this.scoreFormula = scoreFormula;
} }
public byte getStatus() { public Integer getStatus() {
return this.status; return this.status;
} }
public void setStatus(byte status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
...@@ -745,4 +752,12 @@ public class Plan extends BasicEntity { ...@@ -745,4 +752,12 @@ public class Plan extends BasicEntity {
public void setMakerUserDeptName(String makerUserDeptName) { public void setMakerUserDeptName(String makerUserDeptName) {
this.makerUserDeptName = 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; 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 com.fasterxml.jackson.annotation.JsonBackReference;
import javax.persistence.*;
/** /**
* The persistent class for the p_route_point_item database table. * The persistent class for the p_route_point_item database table.
*
*/ */
@Entity @Entity
@Table(name="p_route_point_item") @Table(name = "p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r") @NamedQuery(name = "RoutePointItem.findAll", query = "SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity { 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;
/** /**
* 创建者 * 路线点表id
*/ */
@Column(name="creator_id") @Column(name = "route_point_id")
private String creatorId; private long routePointId;
/**
/** * 点分类id
* 排序 */
*/ @Column(name = "point_classify_id")
@Column(name="order_no") private Long pointClassifyId;
private int orderNo;
/** /**
* 巡检点检查项id * 前端标记是否绑定
*/ */
@Column(name="point_input_item_id") private boolean isBound = true;
private long pointInputItemId;
private RoutePoint routePoint;
/**
* 路线点表id /**
*/ * 标准依据
@Column(name="route_point_id") */
private long routePointId; @Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'")
private String basisJson;
/**
* 点分类id /**
*/ * 检查项ID
@Column(name="point_classify_id") */
private Long pointClassifyId; @Column(name = "input_item_id")
private Long inputItemId;
/**
/** * 计划ID
* 前端标记是否绑定 */
*/ @Column(name = "plan_id")
private boolean isBound = true; private Long planId;
private RoutePoint routePoint; private long pointId;
/** public RoutePointItem() {
* 标准依据 }
*/
@Column(name = "basis_json", columnDefinition = "text COMMENT '标准依据'") public String getCreatorId() {
private String basisJson; return this.creatorId;
private long pointId; }
public RoutePointItem() {
} public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
public String getCreatorId() { }
return this.creatorId;
} public int getOrderNo() {
return this.orderNo;
public void setCreatorId(String creatorId) { }
this.creatorId = creatorId;
} public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
public int getOrderNo() { }
return this.orderNo;
} public long getPointInputItemId() {
return this.pointInputItemId;
public void setOrderNo(int orderNo) { }
this.orderNo = orderNo;
} public void setPointInputItemId(long pointInputItemId) {
this.pointInputItemId = pointInputItemId;
public long getPointInputItemId() { }
return this.pointInputItemId;
} public long getRoutePointId() {
return this.routePointId;
public void setPointInputItemId(long pointInputItemId) { }
this.pointInputItemId = pointInputItemId;
} public void setRoutePointId(long routePointId) {
this.routePointId = routePointId;
public long getRoutePointId() { }
return this.routePointId;
} @ManyToOne
@JoinColumn(name = "routePointId", referencedColumnName = "id", updatable = false, insertable = false)
public void setRoutePointId(long routePointId) { public RoutePoint getRoutePoint() {
this.routePointId = routePointId; return routePoint;
} }
@ManyToOne @JsonBackReference
@JoinColumn(name = "routePointId", referencedColumnName = "id", updatable = false, insertable = false) public void setRoutePoint(RoutePoint routePoint) {
public RoutePoint getRoutePoint() { this.routePoint = routePoint;
return routePoint; }
}
@JsonBackReference
public void setRoutePoint(RoutePoint routePoint) { public Long getPointClassifyId() {
this.routePoint = routePoint; return pointClassifyId;
} }
public void setPointClassifyId(Long pointClassifyId) {
public Long getPointClassifyId() { this.pointClassifyId = pointClassifyId;
return pointClassifyId; }
}
public void setPointClassifyId(Long pointClassifyId) { public String getBasisJson() {
this.pointClassifyId = pointClassifyId; return basisJson;
} }
public void setBasisJson(String basisJson) {
public String getBasisJson() { this.basisJson = basisJson;
return basisJson; }
}
@Transient
public void setBasisJson(String basisJson) { public long getPointId() {
this.basisJson = basisJson; return pointId;
} }
@Transient
public long getPointId() { public void setPointId(long pointId) {
return pointId; this.pointId = pointId;
} }
public void setPointId(long pointId) { @Transient
this.pointId = pointId; public boolean getIsBound() {
} return isBound;
}
@Transient
public boolean getIsBound() { public void setIsBound(boolean bound) {
return isBound; isBound = bound;
} }
public void setIsBound(boolean bound) { public Long getInputItemId() {
isBound = bound; 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 { ...@@ -580,15 +580,11 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY)
@GetMapping(value = "LinkageUnitDto/page") @GetMapping(value = "LinkageUnitDto/page")
@ApiOperation(httpMethod = "GET", value = "联动单位分页查询", notes = "联动单位分页查询") @ApiOperation(httpMethod = "GET", value = "联动单位分页查询", notes = "联动单位分页查询")
public ResponseModel<Page<LinkageUnitDto>> LinkageUnitDtoQueryForPage(@RequestParam(value = "pageNum") int pageNum, public ResponseModel<Page<LinkageUnitDto>> LinkageUnitDtoQueryForPage(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize,String unitName,String linkageUnitTypeCode, String linkageUnitType, String inAgreement) {
@RequestParam(value = "pageSize") int pageSize,
String unitName,String linkageUnitTypeCode, String linkageUnitType, String inAgreement) {
Page<LinkageUnitDto> page = new Page<LinkageUnitDto>(); Page<LinkageUnitDto> page = new Page<LinkageUnitDto>();
page.setCurrent(pageNum); page.setCurrent(pageNum);
page.setSize(pageSize); page.setSize(pageSize);
Page<LinkageUnitDto> linkageUnitDtoPage = iLinkageUnitService.queryForLinkageUnitPage(page, false, Page<LinkageUnitDto> linkageUnitDtoPage = iLinkageUnitService.queryForLinkageUnitPage(page, false, unitName,linkageUnitTypeCode, linkageUnitType, null, inAgreement);
unitName,linkageUnitTypeCode, linkageUnitType, null, inAgreement);
return ResponseHelper.buildResponse(linkageUnitDtoPage); return ResponseHelper.buildResponse(linkageUnitDtoPage);
} }
...@@ -627,9 +623,7 @@ public class CommandController extends BaseController { ...@@ -627,9 +623,7 @@ public class CommandController extends BaseController {
@GetMapping(value = "statistics/{id}") @GetMapping(value = "statistics/{id}")
@ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计") @ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计")
public ResponseModel<Object> getStatistics(@PathVariable Long id) { public ResponseModel<Object> getStatistics(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id)); return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id));
} }
/** /**
* * @param null * * @param null
...@@ -673,7 +667,6 @@ public class CommandController extends BaseController { ...@@ -673,7 +667,6 @@ public class CommandController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段") @ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段")
public ResponseModel<Object> getstate(@PathVariable Long id) { public ResponseModel<Object> getstate(@PathVariable Long id) {
AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id); AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id);
List<StateDot> list=new ArrayList<>(); List<StateDot> list=new ArrayList<>();
list.add(new StateDot("警情接报")); list.add(new StateDot("警情接报"));
list.add(new StateDot("力量调派")); list.add(new StateDot("力量调派"));
...@@ -779,16 +772,12 @@ public class CommandController extends BaseController { ...@@ -779,16 +772,12 @@ public class CommandController extends BaseController {
@ApiOperation(value = "查看文件内容", notes = "查看文件内容") @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 */) 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 { throws Exception {
String fileName =readUrl+fileUrl; //目标文件 String fileName =readUrl+fileUrl; //目标文件
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) { if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
String htmlPath= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"file"+File.separator; 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 imagePathStr= System.getProperty("user.dir")+File.separator+"lookHtml"+File.separator+"image"+File.separator;
String name = fileUrl.substring(fileUrl.lastIndexOf('/')+1); 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); File htmlP = new File(htmlPath);
if (!htmlP.exists()) { if (!htmlP.exists()) {
htmlP.mkdirs(); htmlP.mkdirs();
...@@ -827,24 +816,18 @@ public class CommandController extends BaseController { ...@@ -827,24 +816,18 @@ public class CommandController extends BaseController {
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据灾情查询单个航空器信息", notes = "根据灾情查询单个航空器信息") @ApiOperation(httpMethod = "GET", value = "根据灾情查询单个航空器信息", notes = "根据灾情查询单个航空器信息")
public ResponseModel<AircraftDto> seleteaircraftOne(@PathVariable Long sequenceNbr) { public ResponseModel<AircraftDto> seleteaircraftOne(@PathVariable Long sequenceNbr) {
// 警情动态表单数据 // 警情动态表单数据
List<AlertFormValue> list = alertFormValueService.getzqlist(sequenceNbr); List<AlertFormValue> list = alertFormValueService.getzqlist(sequenceNbr);
for (AlertFormValue alertFormValue : list) { for (AlertFormValue alertFormValue : list) {
if("aircraftModel".equals(alertFormValue.getFieldCode())) { if("aircraftModel".equals(alertFormValue.getFieldCode())) {
String aircraftModel=alertFormValue.getFieldValue(); String aircraftModel=alertFormValue.getFieldValue();
if(aircraftModel!=null&&!"".equals(aircraftModel)) { if(aircraftModel!=null&&!"".equals(aircraftModel)) {
AircraftDto aircraftDto=aircraftService.queryByAircraftSeq(RequestContext.getAgencyCode(),1411994005943717890L); AircraftDto aircraftDto=aircraftService.queryByAircraftSeq(RequestContext.getAgencyCode(),1411994005943717890L);
//现场照片 待完成, //现场照片 待完成,
return ResponseHelper.buildResponse(aircraftDto); return ResponseHelper.buildResponse(aircraftDto);
} }
} }
} }
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
...@@ -852,7 +835,6 @@ public class CommandController extends BaseController { ...@@ -852,7 +835,6 @@ public class CommandController extends BaseController {
@GetMapping(value = "/getOrgUsrzhDto/{id}") @GetMapping(value = "/getOrgUsrzhDto/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情") @ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情")
public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) { public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) {
AlertCalled AlertCalled = iAlertCalledService.getAlertCalledById(id); AlertCalled AlertCalled = iAlertCalledService.getAlertCalledById(id);
String buildId = null; String buildId = null;
OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto(); OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto();
...@@ -949,8 +931,6 @@ public class CommandController extends BaseController { ...@@ -949,8 +931,6 @@ public class CommandController extends BaseController {
@RequestMapping(value = "/getVideo", method = RequestMethod.GET) @RequestMapping(value = "/getVideo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页获取视频", notes = "分页获取视频") @ApiOperation(httpMethod = "GET", value = "分页获取视频", notes = "分页获取视频")
public ResponseModel<Object> getVideo(long current, long size)throws Exception { public ResponseModel<Object> getVideo(long current, long size)throws Exception {
Page page = new Page(current, size); Page page = new Page(current, size);
List<OrderItem> list= OrderItem.ascs("id"); List<OrderItem> list= OrderItem.ascs("id");
page.setOrders(list); page.setOrders(list);
...@@ -1011,7 +991,6 @@ public class CommandController extends BaseController { ...@@ -1011,7 +991,6 @@ public class CommandController extends BaseController {
OrgusrDataxDto orgusrDataxDto=new OrgusrDataxDto(); OrgusrDataxDto orgusrDataxDto=new OrgusrDataxDto();
if(AlertCalled.getUnitInvolved()!=null&&!"".equals(AlertCalled.getUnitInvolved())) { if(AlertCalled.getUnitInvolved()!=null&&!"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto= iOrgUsrService.getOrgUsrzhDto( AlertCalled.getUnitInvolved()); List<OrgUsrzhDto> orgUsrzhDto= iOrgUsrService.getOrgUsrzhDto( AlertCalled.getUnitInvolved());
if(orgUsrzhDto!=null&&orgUsrzhDto.size()>0&&orgUsrzhDto.get(0)!=null){ if(orgUsrzhDto!=null&&orgUsrzhDto.size()>0&&orgUsrzhDto.get(0)!=null){
buildId=orgUsrzhDto.get(0).getBuildId()==null?null:Long.valueOf(orgUsrzhDto.get(0).getBuildId()); buildId=orgUsrzhDto.get(0).getBuildId()==null?null:Long.valueOf(orgUsrzhDto.get(0).getBuildId());
} }
...@@ -1046,10 +1025,7 @@ public class CommandController extends BaseController { ...@@ -1046,10 +1025,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派列表", notes = "app-根据警情id查询力量调派列表") @ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派列表", notes = "app-根据警情id查询力量调派列表")
@GetMapping(value = "/app/transferList") @GetMapping(value = "/app/transferList")
public ResponseModel getPowerTransferList(@RequestParam String alertId, public ResponseModel getPowerTransferList(@RequestParam String alertId,@RequestParam(defaultValue = "team") String type, @RequestParam(value = "current") int current, @RequestParam(value = "size") int size) {
@RequestParam(defaultValue = "team") String type,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) {
Page page = new Page(); Page page = new Page();
page.setSize(size); page.setSize(size);
page.setCurrent(current); page.setCurrent(current);
...@@ -1059,8 +1035,7 @@ public class CommandController extends BaseController { ...@@ -1059,8 +1035,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派资源统计", notes = "app-根据警情id查询力量调派资源统计") @ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派资源统计", notes = "app-根据警情id查询力量调派资源统计")
@GetMapping(value = "/app/transfer/statistics") @GetMapping(value = "/app/transfer/statistics")
public ResponseModel getPowerTransferStatistics(@RequestParam String alertId, public ResponseModel getPowerTransferStatistics(@RequestParam String alertId, @RequestParam(defaultValue = "team") String type) {
@RequestParam(defaultValue = "team") String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type)); return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type));
} }
...@@ -1076,7 +1051,6 @@ public class CommandController extends BaseController { ...@@ -1076,7 +1051,6 @@ public class CommandController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
throw new BaseException("更新车辆状态异常", "", e.getMessage()); throw new BaseException("更新车辆状态异常", "", e.getMessage());
} }
return ResponseHelper.buildResponse(true); return ResponseHelper.buildResponse(true);
} }
...@@ -1149,20 +1123,29 @@ public class CommandController extends BaseController { ...@@ -1149,20 +1123,29 @@ public class CommandController extends BaseController {
@GetMapping(value = "/DynamicFlightInfo/{dynamicFlightId}") @GetMapping(value = "/DynamicFlightInfo/{dynamicFlightId}")
@ApiOperation(httpMethod = "GET", value = "航班信息", notes = "航班信息") @ApiOperation(httpMethod = "GET", value = "航班信息", notes = "航班信息")
public ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId) { public ResponseModel<Object> DynamicFlightInfo(@PathVariable String dynamicFlightId) {
ResponseModel<Object> dataModel = iotFeignClient.DynamicFlightInfo(dynamicFlightId); ResponseModel<Object> dataModel = iotFeignClient.DynamicFlightInfo(dynamicFlightId);
if (dataModel != null) { if (dataModel != null) {
return ResponseHelper.buildResponse(dataModel.getResult()); return ResponseHelper.buildResponse(dataModel.getResult());
} }
return ResponseHelper.buildResponse(null); 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 { ...@@ -134,7 +134,7 @@ public class DutyCarController extends BaseController {
* @return ResponseModel * @return ResponseModel
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}") @DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除") @ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) { public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId) if (ValidationUtil.isEmpty(instanceId)
......
...@@ -166,4 +166,18 @@ public class DutyPersonController extends BaseController { ...@@ -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; ...@@ -20,7 +20,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto; 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.api.service.ILinkageUnitService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
......
...@@ -7,8 +7,12 @@ import com.yeejoin.amos.boot.module.common.api.dto.*; ...@@ -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.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; 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.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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -165,12 +169,22 @@ public class OrgPersonController { ...@@ -165,12 +169,22 @@ public class OrgPersonController {
@RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET) @RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据orgCode查询", notes = "根据orgCode查询") @ApiOperation(httpMethod = "GET", value = "根据orgCode查询", notes = "根据orgCode查询")
public ResponseModel<Collection<OrgUsr>> selectUsersByOrgCode(HttpServletRequest request, String pageNum, 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<>(); Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00); columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_code", orgCode); columnMap.put("biz_org_code", orgCode);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON); 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 { ...@@ -342,7 +342,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyTreeByUser", method = RequestMethod.GET) @RequestMapping(value = "/companyTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门树", notes = "根据登陆人获取单位部门树") @ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门树", notes = "根据登陆人获取单位部门树")
public ResponseModel<List<OrgMenuDto>> selectCompanyTreeByUser() throws Exception { public ResponseModel<List<OrgMenuDto>> selectCompanyTreeByUser() throws Exception {
...@@ -358,7 +358,7 @@ public class OrgUsrController extends BaseController { ...@@ -358,7 +358,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyUserTreeByUser", method = RequestMethod.GET) @RequestMapping(value = "/companyUserTreeByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门用户树", notes = "根据登陆人获取单位部门用户树") @ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位部门用户树", notes = "根据登陆人获取单位部门用户树")
public ResponseModel<List<OrgMenuDto>> companyUserTreeByUser() { public ResponseModel<List<OrgMenuDto>> companyUserTreeByUser() {
...@@ -374,7 +374,7 @@ public class OrgUsrController extends BaseController { ...@@ -374,7 +374,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyListByUser", method = RequestMethod.GET) @RequestMapping(value = "/companyListByUser", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位列表", notes = "根据登陆人获取单位列表") @ApiOperation(httpMethod = "GET", value = "根据登陆人获取单位列表", notes = "根据登陆人获取单位列表")
public ResponseModel<List<CheckObjectDto>> companyListByUser() { public ResponseModel<List<CheckObjectDto>> companyListByUser() {
...@@ -404,7 +404,7 @@ public class OrgUsrController extends BaseController { ...@@ -404,7 +404,7 @@ public class OrgUsrController extends BaseController {
* @param * @param
* @return * @return
*/ */
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET) @RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系") @ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系")
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@RequestParam(value = "userId", required = false) String userId) { public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@RequestParam(value = "userId", required = false) String userId) {
...@@ -413,7 +413,7 @@ public class OrgUsrController extends BaseController { ...@@ -413,7 +413,7 @@ public class OrgUsrController extends BaseController {
if (StringUtils.isEmpty(userIds)) { if (StringUtils.isEmpty(userIds)) {
userIds = user.getUserId(); userIds = user.getUserId();
} }
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds); List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds, user);
return ResponseHelper.buildResponse(loginUserDetails); return ResponseHelper.buildResponse(loginUserDetails);
} }
......
...@@ -12,14 +12,18 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; ...@@ -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.mapper.FirefightersMapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; 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 org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -42,6 +46,9 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -42,6 +46,9 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
String driverPostTypeCode = "5"; String driverPostTypeCode = "5";
@Autowired
EquipFeignClient equipFeign;
@Override @Override
public String getGroupCode() { public String getGroupCode() {
return "dutyCar"; return "dutyCar";
...@@ -49,14 +56,83 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -49,14 +56,83 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
@Override @Override
public DutyCarDto save(DutyCarDto dutyCarDto) { public DutyCarDto save(DutyCarDto dutyCarDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据 //1.保存行数据
String groupCode = this.getGroupCode(); 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); 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.保存值班信息 //2.保存值班信息
insertPersonShift(instanceId, dutyCarDto); insertPersonShift(instanceId, dutyCarDto);
//3.返回保存后的数据 //3.返回保存后的数据
return dutyCarDto; return dutyCarDto;
} }
@Override @Override
...@@ -83,7 +159,12 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -83,7 +159,12 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
private void insertPersonShift(Long instanceId, DutyCarDto dutyCarDto) { private void insertPersonShift(Long instanceId, DutyCarDto dutyCarDto) {
Set<DutyPersonShift> personShiftList = dutyCarDto.getDutyShift().stream().map(dto -> { 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); dto.setInstanceId(instanceId);
Bean.copyExistPropertis(dto, dutyPersonShift); Bean.copyExistPropertis(dto, dutyPersonShift);
dutyPersonShift.setAppKey(RequestContext.getAppKey()); dutyPersonShift.setAppKey(RequestContext.getAppKey());
......
...@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -30,6 +30,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -77,10 +78,13 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -77,10 +78,13 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
throws ParseException { throws ParseException {
// 1.已column为准 进行返回 // 1.已column为准 进行返回
String groupCode = this.getGroupCode(); 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()) { for (Map<String, Object> m : iPage.getRecords()) {
this.fillDutyShiftData(beginDate, endDate, m); this.fillDutyShiftData(beginDate, endDate, m);
} }
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
return iPage; return iPage;
} }
...@@ -96,9 +100,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -96,9 +100,14 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
// 根据时间 查询值班关系表 // 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm // BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
if(beginDate != null ) { SimpleDateFormat shortformat = new SimpleDateFormat("yyyy-MM-dd");
if(beginDate != null ) {
Calendar c = Calendar.getInstance(); 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.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY,0); c.set(Calendar.HOUR_OF_DAY,0);
c.set(Calendar.MINUTE,0); c.set(Calendar.MINUTE,0);
...@@ -107,7 +116,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -107,7 +116,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
if(endDate != null ) { if(endDate != null ) {
Calendar c = Calendar.getInstance(); 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.add(Calendar.MONTH, 1);
c.set(Calendar.DAY_OF_MONTH, 1); c.set(Calendar.DAY_OF_MONTH, 1);
c.add(Calendar.DATE, -1); c.add(Calendar.DATE, -1);
...@@ -126,7 +139,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -126,7 +139,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Bean.copyExistPropertis(e, dto); Bean.copyExistPropertis(e, dto);
// 没值班信息,默认休 // 没值班信息,默认休
DutyShift dutyShift = keyNameMap.get(e.getShiftId()); DutyShift dutyShift = keyNameMap.get(e.getShiftId());
dto.setShiftName(dutyShift != null ? dutyShift.getName() : "休"); dto.setShiftName(dutyShift != null ? dutyShift.getName() : "休");
dto.setColor(dutyShift != null ? dutyShift.getColor() : ""); dto.setColor(dutyShift != null ? dutyShift.getColor() : "");
return dto; return dto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
...@@ -186,6 +199,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -186,6 +199,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
for (Map<String, Object> map : list) { for (Map<String, Object> map : list) {
this.fillDutyShiftData(beginDate, endDate, map); 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 开始 */ /*bug2472 添加根据部门id筛选数据的方法 陈浩 2021-08-21 开始 */
if(teamId!=null && teamId.intValue()!=0) { if(teamId!=null && teamId.intValue()!=0) {
List<OrgUsr> orgUsrList = orgUsrService.getPersonListByParentId(teamId); List<OrgUsr> orgUsrList = orgUsrService.getPersonListByParentId(teamId);
...@@ -211,6 +229,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -211,6 +229,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override @Override
public List downloadList(String beginDate, String endDate) throws ParseException { public List downloadList(String beginDate, String endDate) throws ParseException {
List<Map<String, Object>> maps = this.list(null,beginDate, endDate); 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 jsonArray = new JSONArray();
jsonArray.addAll(maps); jsonArray.addAll(maps);
List<?> list = new ArrayList<>(); List<?> list = new ArrayList<>();
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -24,6 +34,9 @@ import java.util.stream.Collectors; ...@@ -24,6 +34,9 @@ import java.util.stream.Collectors;
@Service @Service
public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDutyPersonService{ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDutyPersonService{
@Autowired
EquipFeignClient equipFeign;
@Override @Override
public String getGroupCode(){ public String getGroupCode(){
return "dutyPerson"; return "dutyPerson";
...@@ -31,14 +44,86 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -31,14 +44,86 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Override @Override
public DutyPersonDto save(DutyPersonDto dutyPersonDto) { public DutyPersonDto save(DutyPersonDto dutyPersonDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据 //1.保存行数据
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
String userId = dutyPersonDto.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;
// 如果人员有区域id 则创建区域字段
if(StringUtils.isNotEmpty(dutyPersonDto.getDutyAreaId())) {
// 根据建筑id 查找建筑
ResponseModel<Map<String, Object>> response = null;
try {
response = equipFeign.getFormInstanceById(Long.parseLong(dutyPersonDto.getDutyAreaId()));
} catch (NumberFormatException e) {
throw new BadRequest("值班区域id异常!");
}
Map<String, Object> result = response.getResult();
dutyPersonDto.setDutyArea(result.get("name").toString());
}
Map<String, Object> map = Bean.BeantoMap(dutyPersonDto); Map<String, Object> map = Bean.BeantoMap(dutyPersonDto);
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(dutyPersonDto.getDutyShift() != null && dutyPersonDto.getDutyShift().size() == 0) {
Calendar startDate = Calendar.getInstance();
startDate.setTime(DateUtils.longStr2Date(dutyPersonDto.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.保存值班信息 //2.保存值班信息
insertPersonShift(instanceId, dutyPersonDto); insertPersonShift(instanceId, dutyPersonDto);
//3.返回保存后的数据 //3.返回保存后的数据
return dutyPersonDto; return dutyPersonDto;
} }
@Override @Override
...@@ -90,4 +175,63 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -90,4 +175,63 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) { private void buildFormInstanceData(Long instanceId, Map<String, Object> map, DynamicFormColumn column, DynamicFormInstance formInstance) {
fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId()); fillFormInstanceData(instanceId, map, column, formInstance, sequence.nextId());
} }
@Override
public List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId) {
Date now = new Date();
Calendar c = Calendar.getInstance();
c.setTime(now);
c.set(Calendar.DAY_OF_MONTH, 1);
c.set(Calendar.HOUR_OF_DAY,0);
c.set(Calendar.MINUTE,0);
c.set(Calendar.SECOND,0);
String beginDate = DateUtils.date2LongStr(c.getTime());
c.setTime(now);
c.add(Calendar.MONTH, 1);
c.set(Calendar.DAY_OF_MONTH, 1);
c.add(Calendar.DATE, -1);
c.set(Calendar.HOUR_OF_DAY,23);
c.set(Calendar.MINUTE,59);
c.set(Calendar.SECOND,59);
String endDate = DateUtils.date2LongStr(c.getTime());
List<DutyPersonDto> temp = new ArrayList<>();
dutyPersonShiftService.list(new LambdaQueryWrapper<DutyPersonShift>()
.ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate)
.le(endDate != null, DutyPersonShift::getDutyDate, endDate).groupBy(DutyPersonShift::getInstanceId))
.stream().forEach(e -> {
//1.查询已有数据
List<DynamicFormInstance> instances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, e.getInstanceId()).eq(DynamicFormInstance::getGroupCode,this.getGroupCode()));
if(instances.size() > 0) {
DutyPersonDto dto = new DutyPersonDto();
boolean add = false;
for(DynamicFormInstance t : instances) {
if("userId".equals(t.getFieldCode())) {
dto.setUserId(t.getFieldValue());
} else if("userName".equals(t.getFieldCode())) {
dto.setUserName(t.getFieldValue());
} else if("deptId".equals(t.getFieldCode())) {
dto.setDeptId(t.getFieldValue());
} else if("deptName".equals(t.getFieldCode())) {
dto.setDeptName(t.getFieldValue());
} else if("postType".equals(t.getFieldCode())) {
dto.setPostType(t.getFieldValue());
} else if("postTypeName".equals(t.getFieldCode())) {
dto.setPostTypeName(t.getFieldValue());
} else if("dutyArea".equals(t.getFieldCode())) {
dto.setDutyArea(t.getFieldValue());
} else if("dutyAreaId".equals(t.getFieldCode())) {
if(dutyAreaId.toString().equals(t.getFieldValue())) {
add = true;
}
dto.setDutyAreaId(t.getFieldValue());
}
}
if(add) {
temp.add(dto);
}
}
});
return temp;
}
} }
...@@ -72,7 +72,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD ...@@ -72,7 +72,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
List<DynamicFormInitDto> listForm = new ArrayList<DynamicFormInitDto>(); List<DynamicFormInitDto> listForm = new ArrayList<DynamicFormInitDto>();
String appKey = RequestContext.getAppKey(); String appKey = RequestContext.getAppKey();
// 组装数据 // 组装数据
dynamicFormColumn.parallelStream().forEach(dynamicForm -> { dynamicFormColumn.stream().forEach(dynamicForm -> {
if ( dynamicForm.getFieldType().equals("input") || if ( dynamicForm.getFieldType().equals("input") ||
dynamicForm.getFieldType().equals("string") || dynamicForm.getFieldType().equals("string") ||
dynamicForm.getFieldType().equals("datetime") || dynamicForm.getFieldType().equals("datetime") ||
...@@ -193,7 +193,7 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD ...@@ -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) { public List<SelectItem> getdata(Collection<DataDictionary> list) {
......
...@@ -132,6 +132,14 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta ...@@ -132,6 +132,14 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
Page page = new Page(current, size); Page page = new Page(current, size);
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params); 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) { 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)); List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists; 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.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto; import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
...@@ -264,11 +265,23 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -264,11 +265,23 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
} else { } else {
keySiteDto.setFirePreventionFlag(false); keySiteDto.setFirePreventionFlag(false);
} }
keySiteDto =Bean.toPo(getCurrentInfo(), keySiteDto);
excelList.add(keySiteDto); excelList.add(keySiteDto);
} }
return this.saveBatch(excelList); 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 @Override
public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) { public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr) {
LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>(); LambdaQueryWrapper<KeySite> mapper =new LambdaQueryWrapper<KeySite>();
......
...@@ -210,6 +210,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -210,6 +210,7 @@ public class MaintenanceCompanyServiceImpl
// 新增删除维保单位逻辑,BUG 2500 单位下有子单位或者人员时应无法直接删除. by litw satrt // 新增删除维保单位逻辑,BUG 2500 单位下有子单位或者人员时应无法直接删除. by litw satrt
LambdaQueryWrapper<MaintenanceCompany> wrapperCompany = new LambdaQueryWrapper<MaintenanceCompany>(); LambdaQueryWrapper<MaintenanceCompany> wrapperCompany = new LambdaQueryWrapper<MaintenanceCompany>();
wrapperCompany.eq(MaintenanceCompany::getParentId,sequenceNbr); wrapperCompany.eq(MaintenanceCompany::getParentId,sequenceNbr);
wrapperCompany.eq(MaintenanceCompany::getIsDelete,false);
int count = maintenanceCompanyMapper.selectCount(wrapperCompany); int count = maintenanceCompanyMapper.selectCount(wrapperCompany);
if(count > 0) { if(count > 0) {
throw new BadRequest("单位下有子单位或者人员,无法删除"); throw new BadRequest("单位下有子单位或者人员,无法删除");
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.io.Serializable;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -14,8 +15,10 @@ import java.util.stream.Collectors; ...@@ -14,8 +15,10 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -361,8 +364,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -361,8 +364,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
/*BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始*/ /*BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始*/
if (req.get("parentId") != null && req.get("parentId") != ""){ if (req.get("parentId") != null && req.get("parentId") != ""){
OrgUsr parent = this.getById(req.get("parentId").toString()); OrgUsr parent = this.getById(req.get("parentId").toString());
map.put("bizOrgCode", ObjectUtils.isEmpty(parent) ? null : parent.getBizOrgCode()); map.put("bizOrgCode", ObjectUtils.isEmpty(parent) ? null : parent.getBizOrgCode());
} }
/*BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始*/ /*BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始*/
...@@ -377,7 +380,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -377,7 +380,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize()); map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize()); map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map); List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
list.stream().forEach(t -> {
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
if(null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(t.get("amosOrgId").toString());
if(null !=result1.getResult()) {
t.put("amosOrgCode",result1.getResult().getRealName());
}
}
});
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/ /*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/
pageBean.setRecords(list); pageBean.setRecords(list);
return pageBean; return pageBean;
...@@ -539,6 +551,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -539,6 +551,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 动态表单数据 // 动态表单数据
List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id); List<DynamicFormInstanceDto> list = alertFormValueServiceImpl.listByCalledId(id);
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
// 机场人员AMOS角色丢失修正, by litw start 2021年9月10日
if(StringUtils.isNotEmpty(orgUsr.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(orgUsr.getAmosOrgId());
if(null !=result1.getResult()) {
orgUsr.setAmosOrgCode(result1.getResult().getRealName());
}
}
// 机场人员AMOS角色丢失修正, by litw end 2021年9月10日
result = Bean.BeantoMap(orgUsr); result = Bean.BeantoMap(orgUsr);
/*bug 2869 部门为空人员详情报空指针 2021-09-15 陈召 开始*/ /*bug 2869 部门为空人员详情报空指针 2021-09-15 陈召 开始*/
if (orgUsr.getParentId()!= null){ if (orgUsr.getParentId()!= null){
...@@ -613,11 +634,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -613,11 +634,6 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgCode(getOrgCodeStr()); orgUsr.setBizOrgCode(getOrgCodeStr());
} }
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
OrgPersonVo.setAmosOrgCode(user.getRealName());
}
saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue()); saveOrgUsrDynamicFormInstance(orgUsr, OrgPersonVo.getDynamicFormValue());
} }
...@@ -656,6 +672,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -656,6 +672,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr()); orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
} }
orgUsr.setSequenceNbr(id); orgUsr.setSequenceNbr(id);
// 查询机构下的所有部门单位人员数据,进行bizOrgCode的统一修改 BUG 2880 by litw start 2021年9月16日
String oriOrgCode = oriOrgUsr.getBizOrgCode();
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("bizOrgCode", oriOrgCode);
List<OrgUsr> list = orgUsrMapper.selectAllChildrenList(columnMap);
list.stream().forEach(e->{
e.setBizOrgCode(e.getBizOrgCode().replace(oriOrgCode,orgUsr.getBizOrgCode()));
});
this.updateBatchById(list);
/*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */ /*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */
saveOrgUsr(orgUsr, oriOrgUsr); saveOrgUsr(orgUsr, oriOrgUsr);
// 保存动态表单数据 // 保存动态表单数据
...@@ -681,9 +707,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -681,9 +707,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
orgUsr.setSequenceNbr(id); orgUsr.setSequenceNbr(id);
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) { if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult(); AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
oriOrgUsr.setAmosOrgCode(user.getRealName()); // oriOrgUsr.setAmosOrgCode(user.getRealName()); 去掉AmosOrgCode by litw 2021年9月10日
oriOrgUsr.setAmosOrgId(user.getUserId()); oriOrgUsr.setAmosOrgId(user.getUserId());
orgUsr.setAmosOrgCode(user.getRealName()); //orgUsr.setAmosOrgCode(user.getRealName()); 去掉AmosOrgCode by litw 2021年9月10日
orgUsr.setAmosOrgId(user.getUserId()); orgUsr.setAmosOrgId(user.getUserId());
} }
...@@ -762,6 +788,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -762,6 +788,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception { public OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception {
OrgUsr orgUsr = getById(id); OrgUsr orgUsr = getById(id);
// 动态表单数据 // 动态表单数据
List<FormValue> formValue = getFormValueDetail(id); List<FormValue> formValue = getFormValueDetail(id);
OrgPersonFormDto orgPersonFormVo = new OrgPersonFormDto(formValue); OrgPersonFormDto orgPersonFormVo = new OrgPersonFormDto(formValue);
...@@ -782,6 +809,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -782,6 +809,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
columnMap.put("is_delete", CommonConstant.IS_DELETE_00); columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON); columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
Collection<OrgUsr> list = listByMap(columnMap); Collection<OrgUsr> list = listByMap(columnMap);
// list.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 getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId", return getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId",
"getBizOrgType"); "getBizOrgType");
} }
...@@ -1010,28 +1046,39 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1010,28 +1046,39 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (ObjectUtils.isEmpty(ids)) { if (ObjectUtils.isEmpty(ids)) {
return null; return null;
} }
return ids.stream().map(m -> { List<CompanyPerson> tempList = new ArrayList<CompanyPerson>();
for(Long tempId : ids) {
// BUG 2740 机场单位主键varchar 导致 通过主键搜索返回多条数据 2021 - 09 - 09by kongfm // BUG 2740 机场单位主键varchar 导致 通过主键搜索返回多条数据 2021 - 09 - 09by kongfm
OrgUsr org = getById(m.toString()); OrgUsr org = getById(tempId.toString());
if (ObjectUtils.isEmpty(org)) { if (ObjectUtils.isEmpty(org)) {
return null; continue;
} }
CompanyPerson company = new CompanyPerson(); CompanyPerson company = new CompanyPerson();
BeanUtils.copyProperties(org, company); BeanUtils.copyProperties(org, company);
company.setPersons(this.queryForListByParentIdAndOrgType(org.getSequenceNbr(), OrgPersonEnum.人员.getKey())); company.setPersons(this.queryForListByParentIdAndOrgType(org.getSequenceNbr(), OrgPersonEnum.人员.getKey()));
return company; tempList.add(company);
}).filter(c -> { }
return c != null; return tempList;
}).collect(Collectors.toList());
} }
// BUG 2736 人员导出过滤已经删除的数据by kongfm // BUG 2736 人员导出过滤已经删除的数据by kongfm
// 该方法使用时参数有问题 会有下标越界问题,现在更改为public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType) 2021-09-13 by kongfm
public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType, Boolean isDelete) { public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType, Boolean isDelete) {
return this.queryForList(null, false, parentId, bizOrgType, isDelete); return this.queryForList(null, false, parentId, bizOrgType, isDelete);
} }
public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType) { public List<OrgUsrDto> queryForListByParentIdAndOrgType(Long parentId, String bizOrgType) {
return Bean.toModels(this.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getParentId,parentId).eq(OrgUsr::getBizOrgType,bizOrgType)), this.getModelClass()); // BUG 2843 过滤没有绑定关联账户的user by kongfm 2021-09-16
List<OrgUsr> tempUserList = this.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getIsDelete,false).eq(OrgUsr::getParentId,parentId).eq(OrgUsr::getBizOrgType,bizOrgType).isNotNull(OrgUsr::getAmosOrgId));
tempUserList.stream().forEach(m -> {
if( StringUtils.isNotEmpty(m.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(m.getAmosOrgId());
if(null !=result1.getResult()) {
m.setAmosOrgCode(result1.getResult().getRealName());
}
}
});
return Bean.toModels(tempUserList,this.getModelClass());
} }
public OrgUsrDto getOrg(String amosUserId) { public OrgUsrDto getOrg(String amosUserId) {
...@@ -1205,11 +1252,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1205,11 +1252,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
Set<Long> set = new HashSet<>(); Set<Long> set = new HashSet<>();
orgUsrList.forEach(orgUsr -> { orgUsrList.forEach(orgUsr -> {
Long parent = ObjectUtils.isEmpty(orgUsr.getParentId()) ? 0L : Long.parseLong(orgUsr.getParentId()); if (!StringUtils.isEmpty(orgUsr.getParentId())) {
if (set.add(parent)) { Long parent = Long.parseLong(orgUsr.getParentId());
Long companyIdByDto = getCompanyIdByDto(parent, companyList); if (set.add(parent)) {
List<CheckObjectDto> orgUsrTreeDtoList = this.baseMapper.getCompanyAndKeySite(companyIdByDto); Long companyIdByDto = getCompanyIdByDto(parent, companyList);
list.addAll(companyAndKeySiteList(orgUsrTreeDtoList)); List<CheckObjectDto> orgUsrTreeDtoList = this.baseMapper.getCompanyAndKeySite(companyIdByDto);
list.addAll(companyAndKeySiteList(orgUsrTreeDtoList));
}
} }
}); });
// 返回所在用户单位列表 // 返回所在用户单位列表
...@@ -1229,7 +1278,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1229,7 +1278,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) { if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) {
return orgUsr.getSequenceNbr(); return orgUsr.getSequenceNbr();
} else { } else {
pid = getCompanyIdByDto(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList); if (!StringUtils.isEmpty(orgUsr.getParentId())) {
pid = getCompanyIdByDto(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
}
} }
} }
} }
...@@ -1332,8 +1383,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1332,8 +1383,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<OrgMenuDto> treeList = buildTreeParallel(companyDepartmentMsgList); List<OrgMenuDto> treeList = buildTreeParallel(companyDepartmentMsgList);
Set<Long> set = new HashSet<>(); Set<Long> set = new HashSet<>();
orgUsrList.forEach(orgUsr -> { orgUsrList.forEach(orgUsr -> {
Long parentId = Long.parseLong(orgUsr.getParentId()); if (!StringUtils.isEmpty(orgUsr.getParentId())) {
getTreeChildre(list, treeList, parentId, set, companyDepartmentMsgList); Long parentId = Long.parseLong(orgUsr.getParentId());
getTreeChildre(list, treeList, parentId, set, companyDepartmentMsgList);
}
}); });
return list; return list;
} }
...@@ -1362,7 +1415,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1362,7 +1415,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 获取登陆人所在公司 // 获取登陆人所在公司
Long pid = getCompanyId(parentId, companyDepartmentMsgList); Long pid = getCompanyId(parentId, companyDepartmentMsgList);
if (set.add(pid)) { if (set.add(pid)) {
List<OrgMenuDto> list1 = treeList.stream().filter(orgMenuDto -> orgMenuDto.getKey().equals(pid)).collect(Collectors.toList()); List<OrgMenuDto> list1 = treeList.stream().filter(orgMenuDto -> !ObjectUtils.isEmpty(orgMenuDto) && pid.equals(orgMenuDto.getKey())).collect(Collectors.toList());
list.addAll(list1); list.addAll(list1);
} }
} }
...@@ -1377,7 +1430,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1377,7 +1430,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) { if (orgUsr.getBizOrgType().equals(OrgPersonEnum.公司.getKey()) && ObjectUtils.isEmpty(orgUsr.getParentId())) {
return orgUsr.getSequenceNbr(); return orgUsr.getSequenceNbr();
} else { } else {
pid = getCompanyId(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList); if (!StringUtils.isEmpty(orgUsr.getParentId())) {
pid = getCompanyId(Long.parseLong(orgUsr.getParentId()), companyDepartmentMsgList);
}
} }
} }
} }
...@@ -1404,7 +1459,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1404,7 +1459,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override @Override
public List<Map<String, Object>> getLoginUserDetails (String userId) { public List<Map<String, Object>> getLoginUserDetails (String userId, AgencyUserModel user) {
// 获取登陆人关联账号 // 获取登陆人关联账号
List<OrgUsr> orgUsrs = getUsrList(userId); List<OrgUsr> orgUsrs = getUsrList(userId);
...@@ -1418,7 +1473,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1418,7 +1473,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
wrapper.eq(OrgUsr::getIsDelete, false); wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(BaseEntity::getSequenceNbr, orgUsr.getParentId()); wrapper.eq(BaseEntity::getSequenceNbr, orgUsr.getParentId());
OrgUsr one = this.getOne(wrapper); OrgUsr one = this.getOne(wrapper);
map.put("other",one); map.put(OrgPersonEnum.部门.getKey(),one);
map.put("AMOSUSER",user);
list.add(map); list.add(map);
}); });
...@@ -1439,7 +1495,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1439,7 +1495,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrList; return orgUsrList;
} }
/**
* 重写getByid 方法 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
* @param id
* @return
*/
@Override
public OrgUsr getById(Serializable id) {
OrgUsr orgUser = this.baseMapper.selectById(id);
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
if(orgUser != null && StringUtils.isNotEmpty(orgUser.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(orgUser.getAmosOrgId());
if(null !=result1.getResult()) {
orgUser.setAmosOrgCode(result1.getResult().getRealName());
}
}
return orgUser;
}
} }
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; 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.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto; 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.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 com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/** /**
* 导出导入 * 导出导入
...@@ -36,6 +34,9 @@ public class ExcelController extends BaseController { ...@@ -36,6 +34,9 @@ public class ExcelController extends BaseController {
@Autowired @Autowired
ExcelServiceImpl excelService; ExcelServiceImpl excelService;
@Autowired
DataSourcesImpl dataSources;
private static final String NOT_DUTY = "休班"; private static final String NOT_DUTY = "休班";
...@@ -53,15 +54,22 @@ public class ExcelController extends BaseController { ...@@ -53,15 +54,22 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
/**
* * @param Map par 可以传递过滤条件,传入具体实现类中
* @return
* <PRE>
* author tw
* date 2021/9/13
* </PRE>
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导出公用类") @ApiOperation(value = "导出公用类")
@GetMapping("/export/{type}") @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 { try {
ExcelEnums excelEnums= ExcelEnums.getByKey(type); ExcelEnums excelEnums= ExcelEnums.getByKey(type);
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType()); ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonExport(response, excelDto); excelService.commonExport(response, excelDto,par);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
...@@ -79,10 +87,14 @@ public class ExcelController extends BaseController { ...@@ -79,10 +87,14 @@ public class ExcelController extends BaseController {
ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType()); ExcelDto excelDto = new ExcelDto(excelEnums.getFileName(), excelEnums.getSheetName(), excelEnums.getClassUrl(), excelEnums.getType());
excelService.commonUpload(multipartFile, excelDto); excelService.commonUpload(multipartFile, excelDto);
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} catch (Exception e) { } catch (RuntimeException e) {
e.printStackTrace(); e.printStackTrace();
throw new BadRequest("文件格式不正确或excel 模板不匹配"); // BUG 2821 by litw 2021年9月16日
}catch (Exception e){
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
...@@ -165,4 +177,17 @@ public class ExcelController extends BaseController { ...@@ -165,4 +177,17 @@ public class ExcelController extends BaseController {
throw new RuntimeException("系统异常!"); 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; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; 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.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; 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.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -27,16 +23,16 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -27,16 +23,16 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.Menu; 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.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; 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.FireTeamCardDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamListDto; 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.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.FireTeamServiceImpl;
......
...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -130,7 +131,8 @@ public class FirefightersController extends BaseController { ...@@ -130,7 +131,8 @@ public class FirefightersController extends BaseController {
queryWrapper.eq("is_delete", 0); queryWrapper.eq("is_delete", 0);
List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper); List<FirefightersJacket> firefightersJacket = iFirefightersJacketService.list(queryWrapper);
if (firefightersJacket != null && firefightersJacket.size() > 0) { if (firefightersJacket != null && firefightersJacket.size() > 0) {
throw new RuntimeException("该消防还有在装装备!"); // BUG 2222 by litw start 2021年9月10日
throw new BadRequest("该消防还有在装装备!");
} }
try { try {
iFirefightersService.update(new UpdateWrapper<Firefighters>().eq("sequence_nbr", id).set("is_delete", 1)); iFirefightersService.update(new UpdateWrapper<Firefighters>().eq("sequence_nbr", id).set("is_delete", 1));
......
...@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils; 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.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; 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.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; 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.boot.module.jcs.biz.service.impl.PowerTransferServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -29,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper; ...@@ -29,6 +32,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* 力量调派 * 力量调派
...@@ -43,7 +47,8 @@ public class PowerTransferController extends BaseController { ...@@ -43,7 +47,8 @@ public class PowerTransferController extends BaseController {
@Autowired @Autowired
PowerTransferServiceImpl powerTransferService; PowerTransferServiceImpl powerTransferService;
@Autowired
FireTeamServiceImpl fireTeamService;
@Autowired @Autowired
EquipFeignClient equipFeignClient; EquipFeignClient equipFeignClient;
...@@ -184,10 +189,11 @@ public class PowerTransferController extends BaseController { ...@@ -184,10 +189,11 @@ public class PowerTransferController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/power/tree") @GetMapping(value = "/power/tree")
@ApiOperation(value = "力量调派资源树", notes = "力量调派资源树") @ApiOperation(value = "力量调派资源树", notes = "力量调派资源树")
public ResponseModel<Object> getPowerTree() { public ResponseModel<Object> getPowerTree( @RequestParam String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTree()); return ResponseHelper.buildResponse(powerTransferService.getPowerTree(type));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/power/list") @GetMapping(value = "/power/list")
@ApiOperation(value = "力量出动列表", notes = "力量调派资源树") @ApiOperation(value = "力量出动列表", notes = "力量调派资源树")
......
...@@ -449,7 +449,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -449,7 +449,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum())); listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum()));
listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser())); 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())); // listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(alertFormValue -> { list.stream().forEach(alertFormValue -> {
String valueCode = alertFormValue.getFieldValueCode(); String valueCode = alertFormValue.getFieldValueCode();
if(null == valueCode) { if(null == valueCode) {
...@@ -674,11 +674,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -674,11 +674,13 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
//未结案警情统计 //未结案警情统计
@Override @Override
public Integer AlertCalledcount(int type) { 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 @Override
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -152,6 +153,9 @@ public class DataSourcesImpl implements DataSources { ...@@ -152,6 +153,9 @@ public class DataSourcesImpl implements DataSources {
case "getCitys": case "getCitys":
str =getCitys(); str =getCitys();
break; break;
case "getDutyArea":
str =getDutyArea();
break;
} }
} }
return str; return str;
...@@ -362,4 +366,15 @@ public class DataSourcesImpl implements DataSources { ...@@ -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 { ...@@ -29,7 +29,7 @@ public class DispatchMapServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1); Integer num= alertCalledMapper1.AlertCalledcount(0);
return num; return num;
} }
} }
...@@ -28,7 +28,7 @@ public class DispatchTaskServiceImpl implements IHomePageService { ...@@ -28,7 +28,7 @@ public class DispatchTaskServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
Integer num= alertCalledMapper1.AlertCalledcount(1); Integer num= alertCalledMapper1.AlertCalledcount(0);
return num; return num;
} }
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInitDto;
import com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireChemicalDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FirefightersInfoDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.MaintenancePersonExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrFormDto;
import com.yeejoin.amos.boot.module.common.api.dto.RescueEquipmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.SpecialPositionStaffDto;
import com.yeejoin.amos.boot.module.common.api.dto.WaterResourceDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.FireChemical; import com.yeejoin.amos.boot.module.common.api.entity.FireChemical;
...@@ -21,6 +65,9 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireStation; ...@@ -21,6 +65,9 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireStation;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.Firefighters; import com.yeejoin.amos.boot.module.common.api.entity.Firefighters;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersContacts;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersEducation;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersPost;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersWorkexperience;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment; import com.yeejoin.amos.boot.module.common.api.entity.RescueEquipment;
import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff; import com.yeejoin.amos.boot.module.common.api.entity.SpecialPositionStaff;
...@@ -28,42 +75,28 @@ import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil; ...@@ -28,42 +75,28 @@ import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService; import com.yeejoin.amos.boot.module.common.api.service.IKeySiteService;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService; import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.*; import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyPersonShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyShiftServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireChemicalServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireStationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersContactsServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersEducationServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersPostServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FirefightersWorkexperienceServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.RescueEquipmentServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.SpecialPositionStaffServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft; import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import ch.qos.logback.core.subst.Token;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.ibatis.annotations.Case;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.elasticsearch.search.aggregations.metrics.ParsedSingleValueNumericMetricsAggregation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* @author tb * @author tb
...@@ -76,8 +109,6 @@ public class ExcelServiceImpl { ...@@ -76,8 +109,6 @@ public class ExcelServiceImpl {
private static final String MAINTENANCE_PERSON = "maintenancePerson"; private static final String MAINTENANCE_PERSON = "maintenancePerson";
@Autowired @Autowired
private RedisUtils redisUtils;
@Autowired
DataSourcesImpl dataSourcesImpl; DataSourcesImpl dataSourcesImpl;
@Autowired @Autowired
FireChemicalServiceImpl fireChemicalServiceImpl; FireChemicalServiceImpl fireChemicalServiceImpl;
...@@ -121,6 +152,17 @@ public class ExcelServiceImpl { ...@@ -121,6 +152,17 @@ public class ExcelServiceImpl {
SpecialPositionStaffServiceImpl specialPositionStaffServiceImpl; SpecialPositionStaffServiceImpl specialPositionStaffServiceImpl;
@Autowired @Autowired
RescueEquipmentServiceImpl rescueEquipmentServiceImpl; RescueEquipmentServiceImpl rescueEquipmentServiceImpl;
@Autowired
IOrgUsrService orgUsrServer;
@Autowired
FirefightersPostServiceImpl iFirefightersPostService;
@Autowired
FirefightersContactsServiceImpl ifirefightersContactsService;
@Autowired
FirefightersEducationServiceImpl ifirefightersEducationService;
@Autowired
FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService;
public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException { public void templateExport(HttpServletResponse response, ExcelDto excelDto) throws ClassNotFoundException {
String url = excelDto.getClassUrl(); String url = excelDto.getClassUrl();
...@@ -129,7 +171,7 @@ public class ExcelServiceImpl { ...@@ -129,7 +171,7 @@ public class ExcelServiceImpl {
true); true);
} }
public void commonExport(HttpServletResponse response, ExcelDto excelDto) { public void commonExport(HttpServletResponse response, ExcelDto excelDto,Map par) {
switch (excelDto.getType()) { switch (excelDto.getType()) {
case "WHP": case "WHP":
...@@ -281,6 +323,7 @@ public class ExcelServiceImpl { ...@@ -281,6 +323,7 @@ public class ExcelServiceImpl {
} else { } else {
continue; continue;
} }
positionStaffDto = Bean.toPo(getCurrentInfo(),positionStaffDto);
specialPositionStaffServiceImpl.createWithModel(positionStaffDto); specialPositionStaffServiceImpl.createWithModel(positionStaffDto);
} }
} }
...@@ -317,7 +360,7 @@ public class ExcelServiceImpl { ...@@ -317,7 +360,7 @@ public class ExcelServiceImpl {
} else { } else {
continue; continue;
} }
rescueEquipmentDto = Bean.toPo(getCurrentInfo(),rescueEquipmentDto);
rescueEquipmentServiceImpl.createWithModel(rescueEquipmentDto); rescueEquipmentServiceImpl.createWithModel(rescueEquipmentDto);
} }
...@@ -326,8 +369,8 @@ public class ExcelServiceImpl { ...@@ -326,8 +369,8 @@ public class ExcelServiceImpl {
private void excelImportLinkageUnitZhDto(MultipartFile multipartFile) throws Exception { private void excelImportLinkageUnitZhDto(MultipartFile multipartFile) throws Exception {
List<LinkageUnitDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, LinkageUnitDto.class, 1); List<LinkageUnitDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, LinkageUnitDto.class, 1);
if (excelDtoList != null && excelDtoList.size() > 0) { if (excelDtoList != null && excelDtoList.size() > 0) {
excelDtoList.forEach(linkageUnitDto -> { excelDtoList.forEach(linkageUnitDto -> {
if (linkageUnitDto.getLinkageUnitType() != null) { if (linkageUnitDto.getLinkageUnitType() != null) {
String[] certificates = linkageUnitDto.getLinkageUnitType().split("@"); String[] certificates = linkageUnitDto.getLinkageUnitType().split("@");
...@@ -339,7 +382,7 @@ public class ExcelServiceImpl { ...@@ -339,7 +382,7 @@ public class ExcelServiceImpl {
linkageUnitDto.setEmergencyLinkageUnit(certificates[0]); linkageUnitDto.setEmergencyLinkageUnit(certificates[0]);
linkageUnitDto.setEmergencyLinkageUnitCode(certificates[1]); linkageUnitDto.setEmergencyLinkageUnitCode(certificates[1]);
} }
linkageUnitDto =Bean.toPo(getCurrentInfo(),linkageUnitDto);
linkageUnitServiceImpl.saveLinkageModel(linkageUnitDto); linkageUnitServiceImpl.saveLinkageModel(linkageUnitDto);
}); });
} }
...@@ -369,13 +412,11 @@ public class ExcelServiceImpl { ...@@ -369,13 +412,11 @@ public class ExcelServiceImpl {
dynamicFormValue.forEach(dynamicFormInstanceDto -> { dynamicFormValue.forEach(dynamicFormInstanceDto -> {
switch (dynamicFormInstanceDto.getFieldCode()) { switch (dynamicFormInstanceDto.getFieldCode()) {
case "administrativePositionCode": case "administrativePositionCode":
if (orgUsrExcelDto.getAdministrativePositionCode() != null) { if (orgUsrExcelDto.getAdministrativePositionCode() != null) {
String[] certificates = orgUsrExcelDto.getAdministrativePositionCode().split("@"); String[] certificates = orgUsrExcelDto.getAdministrativePositionCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
} }
break; break;
case "auditCycle": case "auditCycle":
...@@ -397,23 +438,26 @@ public class ExcelServiceImpl { ...@@ -397,23 +438,26 @@ public class ExcelServiceImpl {
} }
break; break;
case "certificateType": case "certificateType": //持证类别
if (orgUsrExcelDto.getCertificateType() != null) { if (orgUsrExcelDto.getCertificateType() != null) {
String[] certificates = orgUsrExcelDto.getCertificateType().split("@"); String[] certificates = orgUsrExcelDto.getCertificateType().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
} }
break; // BUG 2892 导入机场单位没有持证类别和 人员性别 处理 by kongfm 2021-09-16
case "fireManagementPostCode": case "fireManagementPostCode":
if (orgUsrExcelDto.getFireManagementPostCode() != null) { if (orgUsrExcelDto.getFireManagementPostCode() != null) {
String[] certificates = orgUsrExcelDto.getFireManagementPostCode().split("@"); String[] certificates = orgUsrExcelDto.getFireManagementPostCode().split("@");
dynamicFormInstanceDto.setFieldValue(certificates[1]); dynamicFormInstanceDto.setFieldValue(certificates[1]);
dynamicFormInstanceDto.setFieldValueLabel(certificates[0]); dynamicFormInstanceDto.setFieldValueLabel(certificates[0]);
} }
break; break;
case "gender": case "gender":
dynamicFormInstanceDto.setFieldValue(orgUsrExcelDto.getGender()); if (orgUsrExcelDto.getGender() != null) {// BUG 2892 导入机场单位没有持证类别和 人员性别 处理 by kongfm 2021-09-16
String[] gender = orgUsrExcelDto.getGender().split("@");
dynamicFormInstanceDto.setFieldValue(gender[1]);
dynamicFormInstanceDto.setFieldValueLabel(gender[0]);
}
break; break;
case "internalPositionCode": case "internalPositionCode":
if (orgUsrExcelDto.getInternalPositionCode() != null) { if (orgUsrExcelDto.getInternalPositionCode() != null) {
...@@ -461,9 +505,8 @@ public class ExcelServiceImpl { ...@@ -461,9 +505,8 @@ public class ExcelServiceImpl {
dynamicFormInstancelist.add(dynamicFormInstance); dynamicFormInstancelist.add(dynamicFormInstance);
}); });
orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist); orgUsrExcelDto.setDynamicFormValue(dynamicFormInstancelist);
Bean.toPo(getCurrentInfo(),orgUsrExcelDto);
try { try {
orgUsrService.saveOrgPersonExcel(orgUsrExcelDto); orgUsrService.saveOrgPersonExcel(orgUsrExcelDto);
} catch (Exception e) { } catch (Exception e) {
...@@ -482,7 +525,20 @@ public class ExcelServiceImpl { ...@@ -482,7 +525,20 @@ public class ExcelServiceImpl {
FirefightersContacts firefightersContacts = new FirefightersContacts(); FirefightersContacts firefightersContacts = new FirefightersContacts();
firefighters = Bean.toPo(item, firefighters); firefighters = Bean.toPo(item, firefighters);
firefighters = Bean.toPo(getCurrentInfo(), firefighters); firefighters = Bean.toPo(getCurrentInfo(), firefighters);
//手动添加主键,以便于给岗位、职位等实体赋值id
Long sequenceId =sequence.nextId();
firefighters.setSequenceNbr(sequenceId);
item.setFirefightersId(sequenceId);
firefightersContacts = Bean.toPo(item, firefightersContacts); firefightersContacts = Bean.toPo(item, firefightersContacts);
FirefightersWorkexperience firefightersWorkexperience =new FirefightersWorkexperience();
FirefightersEducation firefightersEducation=new FirefightersEducation();
FirefightersPost firefightersPost=new FirefightersPost();
firefightersWorkexperience = Bean.toPo(item, firefightersWorkexperience);
firefightersEducation = Bean.toPo(item, firefightersEducation);
firefightersPost = Bean.toPo(item, firefightersPost);
if (item.getFireTeam() != null) { if (item.getFireTeam() != null) {
Long fireTeamId = Long.valueOf(item.getFireTeam().split("@")[1]); Long fireTeamId = Long.valueOf(item.getFireTeam().split("@")[1]);
firefighters.setFireTeamId(fireTeamId); firefighters.setFireTeamId(fireTeamId);
...@@ -521,6 +577,56 @@ public class ExcelServiceImpl { ...@@ -521,6 +577,56 @@ public class ExcelServiceImpl {
firefighters.setResidence(tempCity[0]); firefighters.setResidence(tempCity[0]);
firefighters.setResidenceDetails(tempCity[1]); firefighters.setResidenceDetails(tempCity[1]);
} }
/*************************岗位职级***********************/
if (item.getEmployeeHierarchy()!= null) {
String[] employeeHierarchy = item.getEmployeeHierarchy().split("@");
firefightersPost.setEmployeeHierarchy(employeeHierarchy[0]);
firefightersPost.setEmployeeHierarchyCode(employeeHierarchy[1]);
}
if (item.getAdministrativePosition()!= null) {
String[] employeeHierarchy = item.getAdministrativePosition().split("@");
firefightersPost.setAdministrativePosition(employeeHierarchy[0]);
firefightersPost.setAdministrativePositionCode(employeeHierarchy[1]);
}
if (item.getEmployeeHierarchy()!= null) {
String[] employeeHierarchy = item.getEmployeeHierarchy().split("@");
firefightersPost.setEmployeeHierarchy(employeeHierarchy[0]);
firefightersPost.setEmployeeHierarchyCode(employeeHierarchy[1]);
}
if (item.getPostQualification()!= null) {
String[] employeeHierarchy = item.getPostQualification().split("@");
firefightersPost.setPostQualification(employeeHierarchy[0]);
firefightersPost.setPostQualificationCode(employeeHierarchy[1]);
}
if (item.getCategory()!= null) {
String[] employeeHierarchy = item.getCategory().split("@");
firefightersPost.setCategory(employeeHierarchy[0]);
firefightersPost.setCategoryCode(employeeHierarchy[1]);
}
if (item.getLevel()!= null) {
String[] employeeHierarchy = item.getLevel().split("@");
firefightersPost.setLevel(employeeHierarchy[0]);
firefightersPost.setLevelCode(employeeHierarchy[1]);
}
if (item.getAreasExpertise()!= null) {
String[] employeeHierarchy = item.getAreasExpertise().split("@");
firefightersPost.setAreasExpertise(employeeHierarchy[0]);
firefightersPost.setAreasExpertiseCode(employeeHierarchy[1]);
}
/*************************学历教育***********************/
if (item.getFirstDegree()!= null) {
String[] employeeHierarchy = item.getFirstDegree().split("@");
firefightersEducation.setFirstDegree(employeeHierarchy[1]);
}
if (item.getHighestEducation()!= null) {
String[] employeeHierarchy = item.getHighestEducation().split("@");
firefightersEducation.setHighestEducation(employeeHierarchy[1]);
}
iFirefightersPostService.save(firefightersPost);
ifirefightersEducationService.save(firefightersEducation);
ifirefightersWorkexperienceService.save(firefightersWorkexperience);
// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm // BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
FirefightersInfoDto firefightersInfo = new FirefightersInfoDto(firefighters, firefightersContacts); FirefightersInfoDto firefightersInfo = new FirefightersInfoDto(firefighters, firefightersContacts);
firefightersService.saveFirefighters(firefightersInfo); firefightersService.saveFirefighters(firefightersInfo);
...@@ -549,14 +655,29 @@ public class ExcelServiceImpl { ...@@ -549,14 +655,29 @@ public class ExcelServiceImpl {
}); });
fireStationService.saveBatch(excelEntityList); fireStationService.saveBatch(excelEntityList);
} }
private void excelImportFireTeam(MultipartFile multipartFile) throws Exception { private void excelImportFireTeam(MultipartFile multipartFile) throws Exception {
List<FireTeamDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireTeamDto.class, 1); List<FireTeamDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, FireTeamDto.class, 1);
List<FireTeam> excelEntityList = new ArrayList<>(); List<FireTeam> excelEntityList = new ArrayList<>();
excelDtoList.forEach(item -> { excelDtoList.forEach(item -> {
FireTeam fireTeam = new FireTeam(); FireTeam fireTeam = new FireTeam();
fireTeam = Bean.toPo(item, fireTeam); fireTeam = Bean.toPo(item, fireTeam);
fireTeam = Bean.toPo(getCurrentInfo(), fireTeam); fireTeam = Bean.toPo(getCurrentInfo(), fireTeam);
/* bug2835 添加获取上级单位的信息方法 陈浩 2021-09-10 --start*/
if(fireTeam.getCompanyName()!=null) {
String[] companyArray = fireTeam.getCompanyName().split("@");
fireTeam.setCompany(Long.parseLong(companyArray[1]));
fireTeam.setCompanyName(companyArray[0]);
try {
OrgUsrFormDto companyDto =orgUsrServer.selectCompanyById(Long.parseLong(companyArray[1]));
fireTeam.setCompanyCode(companyDto.getBizOrgCode());
} catch (Exception e) {
}
}
/* bug2835 添加获取上级单位的信息方法 陈浩 2021-09-10 --end*/
if (fireTeam.getType() != null) { if (fireTeam.getType() != null) {
String[] type = fireTeam.getType().split("@"); String[] type = fireTeam.getType().split("@");
fireTeam.setType(type[0]); fireTeam.setType(type[0]);
...@@ -688,6 +809,7 @@ public class ExcelServiceImpl { ...@@ -688,6 +809,7 @@ public class ExcelServiceImpl {
excelDtoList.forEach(fireExpertsDto -> { excelDtoList.forEach(fireExpertsDto -> {
FireExperts fireExperts = new FireExperts(); FireExperts fireExperts = new FireExperts();
fireExperts = Bean.toPo(fireExpertsDto, fireExperts); fireExperts = Bean.toPo(fireExpertsDto, fireExperts);
fireExperts = Bean.toPo(getCurrentInfo(),fireExperts);
if (fireExperts.getCertificatesType() != null) { if (fireExperts.getCertificatesType() != null) {
String[] certificates = fireExperts.getCertificatesType().split("@"); String[] certificates = fireExperts.getCertificatesType().split("@");
fireExperts.setCertificatesType(certificates[0]); fireExperts.setCertificatesType(certificates[0]);
...@@ -729,7 +851,8 @@ public class ExcelServiceImpl { ...@@ -729,7 +851,8 @@ public class ExcelServiceImpl {
if (sheet != null) { if (sheet != null) {
// 获取表头月份 // 获取表头月份
Row titleRow = sheet.getRow(0); Row titleRow = sheet.getRow(0);
Cell monthCell = titleRow.getCell(5); // 958
Cell monthCell = titleRow.getCell(6);
String dateStr = monthCell == null ? "" : monthCell.toString(); String dateStr = monthCell == null ? "" : monthCell.toString();
List<Date> dayByMonth = DateUtils.getDayByMonth(dateStr); List<Date> dayByMonth = DateUtils.getDayByMonth(dateStr);
...@@ -776,9 +899,15 @@ public class ExcelServiceImpl { ...@@ -776,9 +899,15 @@ public class ExcelServiceImpl {
dutyCarDto.setCarName(carName[0]); dutyCarDto.setCarName(carName[0]);
dutyCarDto.setCarId(carName[1]); dutyCarDto.setCarId(carName[1]);
} }
cell = row.getCell(5);
if (cell != null) {
String[] dutyArea = cell.toString().split("@");
dutyCarDto.setDutyArea(dutyArea[0]);
dutyCarDto.setDutyAreaId(dutyArea[1]);
}
List<DutyPersonShiftDto> dutyShift = dutyCarDto.getDutyShift(); List<DutyPersonShiftDto> dutyShift = dutyCarDto.getDutyShift();
for (int j = 0; j < dayByMonth.size(); j++) { for (int j = 0; j < dayByMonth.size(); j++) {
cell = row.getCell(5 + j); cell = row.getCell(6 + j);
String dutyType = cell == null ? "" : cell.toString(); String dutyType = cell == null ? "" : cell.toString();
if (!StringUtils.isEmpty(dutyType)) { if (!StringUtils.isEmpty(dutyType)) {
DutyPersonShiftDto dutyPersonShiftDto = new DutyPersonShiftDto(); DutyPersonShiftDto dutyPersonShiftDto = new DutyPersonShiftDto();
...@@ -821,9 +950,16 @@ public class ExcelServiceImpl { ...@@ -821,9 +950,16 @@ public class ExcelServiceImpl {
dutyPersonDto.setPostTypeName(split[0]); dutyPersonDto.setPostTypeName(split[0]);
dutyPersonDto.setPostType(split[1]); dutyPersonDto.setPostType(split[1]);
} }
//需求958 添加值班区域 导入 by kongfm 2021-09-15
cell = row.getCell(5);
if (cell != null) {
String[] dutyArea = cell.toString().split("@");
dutyPersonDto.setDutyArea(dutyArea[0]);
dutyPersonDto.setDutyAreaId(dutyArea[1]);
}
List<DutyPersonShiftDto> dutyShift = new ArrayList<>(); List<DutyPersonShiftDto> dutyShift = new ArrayList<>();
for (int j = 0; j < dayByMonth.size(); j++) { for (int j = 0; j < dayByMonth.size(); j++) {
cell = row.getCell(5 + j); cell = row.getCell(6 + j);
String dutyType = cell == null ? "" : cell.toString(); String dutyType = cell == null ? "" : cell.toString();
if (!StringUtils.isEmpty(dutyType)) { if (!StringUtils.isEmpty(dutyType)) {
DutyPersonShiftDto dutyPersonShiftDto = new DutyPersonShiftDto(); DutyPersonShiftDto dutyPersonShiftDto = new DutyPersonShiftDto();
...@@ -851,6 +987,7 @@ public class ExcelServiceImpl { ...@@ -851,6 +987,7 @@ public class ExcelServiceImpl {
// 先填充主表的属性 // 先填充主表的属性
MaintenanceCompany maintenanceCompany = new MaintenanceCompany(); MaintenanceCompany maintenanceCompany = new MaintenanceCompany();
maintenanceCompany = Bean.toPo(maintenancePersonExcleDto, maintenanceCompany); maintenanceCompany = Bean.toPo(maintenancePersonExcleDto, maintenanceCompany);
maintenanceCompany = Bean.toPo(getCurrentInfo(),maintenanceCompany);
maintenanceCompany.setType(PERSON); maintenanceCompany.setType(PERSON);
if (maintenanceCompany.getParentId() != null) { if (maintenanceCompany.getParentId() != null) {
long getParentId = Long.valueOf(maintenancePersonExcleDto.getParentName().split("@")[1]); long getParentId = Long.valueOf(maintenancePersonExcleDto.getParentName().split("@")[1]);
...@@ -1001,7 +1138,7 @@ public class ExcelServiceImpl { ...@@ -1001,7 +1138,7 @@ public class ExcelServiceImpl {
list.add(o.getUserName()); list.add(o.getUserName());
list.add(o.getPostTypeName()); list.add(o.getPostTypeName());
list.add(o.getCarName()); list.add(o.getCarName());
list.add(o.getDutyArea());
List<DutyPersonShiftDto> dutyShift = o.getDutyShift(); List<DutyPersonShiftDto> dutyShift = o.getDutyShift();
initDutyShift(dayByMonth, dutyShift, list); initDutyShift(dayByMonth, dutyShift, list);
...@@ -1040,7 +1177,7 @@ public class ExcelServiceImpl { ...@@ -1040,7 +1177,7 @@ public class ExcelServiceImpl {
list.add(o.getUserName()); list.add(o.getUserName());
list.add(o.getDeptName()); list.add(o.getDeptName());
list.add(o.getPostTypeName()); list.add(o.getPostTypeName());
list.add(o.getDutyArea());
List<DutyPersonShiftDto> dutyShift = o.getDutyShift(); List<DutyPersonShiftDto> dutyShift = o.getDutyShift();
initDutyShift(dayByMonth, dutyShift, list); initDutyShift(dayByMonth, dutyShift, list);
...@@ -1133,7 +1270,6 @@ public class ExcelServiceImpl { ...@@ -1133,7 +1270,6 @@ public class ExcelServiceImpl {
userModel.setRecUserId("3141675"); userModel.setRecUserId("3141675");
userModel.setRecUserName("admin_jcs"); userModel.setRecUserName("admin_jcs");
userModel.setRecDate( new Date()); userModel.setRecDate( new Date());
userModel.setIsDelete(false);
return userModel; return userModel;
} }
} }
...@@ -30,7 +30,7 @@ public class FaultServiceImpl implements IHomePageService { ...@@ -30,7 +30,7 @@ public class FaultServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("BREAKDOWN"); ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("BREAKDOWN");
return ResponseHelper.buildResponse(data!=null?data.getResult():0); return data!=null?data.getResult():0;
} }
} }
...@@ -31,7 +31,7 @@ public class FireAlarmServiceImpl implements IHomePageService { ...@@ -31,7 +31,7 @@ public class FireAlarmServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("FIREALARM"); ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("FIREALARM");
return ResponseHelper.buildResponse(data!=null?data.getResult():0); return data!=null?data.getResult():0;
} }
} }
...@@ -67,8 +67,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -67,8 +67,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
* *
* @return * @return
*/ */
public List<FireBrigadeResourceDto> listMonitorFireBrigade() { public List<FireBrigadeResourceDto> listMonitorFireBrigade(String code ) {
return fireTeamMapper.listMonitorFireBrigade(); return fireTeamMapper.listMonitorFireBrigade(code);
} }
/** /**
...@@ -200,8 +200,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire ...@@ -200,8 +200,8 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
if(fireTeam.getAddress()!=null){ if(fireTeam.getAddress()!=null){
JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress()); JSONObject address = WaterResourceServiceImpl.getLongLatFromAddress(fireTeam.getAddress());
fireTeam.setAddress(address.getString(BizConstant.ADDRESS)); fireTeam.setAddress(address.getString(BizConstant.ADDRESS));
fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE))); // fireTeam.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE))); // fireTeam.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
} }
if (ValidationUtil.isEmpty(fireTeam.getParent())) { if (ValidationUtil.isEmpty(fireTeam.getParent())) {
fireTeam.setTreeCode(TreeParser.genTreeCode()); fireTeam.setTreeCode(TreeParser.genTreeCode());
......
...@@ -30,7 +30,7 @@ public class NoServiceImpl implements IHomePageService { ...@@ -30,7 +30,7 @@ public class NoServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("NOTICE"); ResponseModel<Integer> data= quipFeignClient1.getcountAlarmHandle("no");
return ResponseHelper.buildResponse(data!=null?data.getResult():0); return data!=null?data.getResult():0;
} }
} }
...@@ -154,9 +154,22 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -154,9 +154,22 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
} }
@Override @Override
public List<FireBrigadeResourceDto> getPowerTree() { public List<FireBrigadeResourceDto> getPowerTree(String type) {
List<FireBrigadeResourceDto> fireBrigadeResourceList = Lists.newArrayList(); 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.调用装备服务接口查询车辆列表 // 1.调用装备服务接口查询车辆列表
List<FireBrigadeResourceDto> fireCarDtoList = Lists.newArrayList(); List<FireBrigadeResourceDto> fireCarDtoList = Lists.newArrayList();
ResponseModel<Object> result = equipFeignService.getFireCarListAll(); ResponseModel<Object> result = equipFeignService.getFireCarListAll();
...@@ -208,7 +221,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -208,7 +221,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
} }
// 3.消防队伍-监控大队 // 3.消防队伍-监控大队
List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade(); List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade(FireBrigadeTypeEnum.监控大队.getCode());
FireBrigadeResourceDto monitorResourceDto = new FireBrigadeResourceDto(); FireBrigadeResourceDto monitorResourceDto = new FireBrigadeResourceDto();
monitorResourceDto.setId("0"); monitorResourceDto.setId("0");
monitorResourceDto.setName(FireBrigadeTypeEnum.监控大队.getName()); monitorResourceDto.setName(FireBrigadeTypeEnum.监控大队.getName());
...@@ -219,6 +232,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -219,6 +232,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
fireBrigadeResourceList.add(monitorResourceDto); fireBrigadeResourceList.add(monitorResourceDto);
} }
return fireBrigadeResourceList; return fireBrigadeResourceList;
} }
......
...@@ -30,7 +30,7 @@ public class ShieldServiceImpl implements IHomePageService { ...@@ -30,7 +30,7 @@ public class ShieldServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("SHIELD"); ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("SHIELD");
return ResponseHelper.buildResponse(data!=null?data.getResult():0); return data!=null?data.getResult():0;
} }
} }
...@@ -30,7 +30,7 @@ public class WarningServiceImpl implements IHomePageService { ...@@ -30,7 +30,7 @@ public class WarningServiceImpl implements IHomePageService {
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient.getCountAlarm("NOTICE"); ResponseModel<Integer> data= quipFeignClient1.getCountAlarm("NOTICE");
return ResponseHelper.buildResponse(data!=null?data.getResult():0); return data!=null?data.getResult():0;
} }
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.biz.common.service.IHomePageService; 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.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.PostConstruct;
/** /**
* @description: * @description:
...@@ -11,12 +17,20 @@ import org.springframework.stereotype.Service; ...@@ -11,12 +17,20 @@ import org.springframework.stereotype.Service;
@Service @Service
public class YesServiceImpl implements IHomePageService { public class YesServiceImpl implements IHomePageService {
//实现首页dispatchMap @Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
quipFeignClient1= quipFeignClient;
}
//火警
@Override @Override
public Object getHomePageData() { public Object getHomePageData() {
ResponseModel<Integer> data= quipFeignClient1.getcountAlarmHandle("yes");
return 0; return data!=null?data.getResult():0;
} }
} }
...@@ -104,8 +104,8 @@ public class CheckController extends AbstractBaseController { ...@@ -104,8 +104,8 @@ public class CheckController extends AbstractBaseController {
// @Value("${file.port}") // @Value("${file.port}")
// private String filePort; // private String filePort;
@Value("${file.url}") // @Value("${file.url}")
private String fileUrl; // private String fileUrl;
@Value("${amosRefresh.patrol.topic}") @Value("${amosRefresh.patrol.topic}")
private String patrolTopic; private String patrolTopic;
...@@ -196,7 +196,8 @@ public class CheckController extends AbstractBaseController { ...@@ -196,7 +196,8 @@ public class CheckController extends AbstractBaseController {
String fileName = "巡检记录图片" + new Date().getTime() + ".zip"; String fileName = "巡检记录图片" + new Date().getTime() + ".zip";
// String rootPath = "http://" + fileIp + ":" + filePort + "/"; // String rootPath = "http://" + fileIp + ":" + filePort + "/";
for (Map<String, Object> map : list) { 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); FileHelper.exportZip(list, fileName, response);
} }
...@@ -210,7 +211,8 @@ public class CheckController extends AbstractBaseController { ...@@ -210,7 +211,8 @@ public class CheckController extends AbstractBaseController {
String fileName = "巡检记录图片" + new Date().getTime() + ".zip"; String fileName = "巡检记录图片" + new Date().getTime() + ".zip";
// String rootPath = "http://" + fileIp + ":" + filePort + "/"; // String rootPath = "http://" + fileIp + ":" + filePort + "/";
for (Map<String, Object> map : list) { 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); FileHelper.exportZip(list, fileName, response);
} }
......
...@@ -95,9 +95,9 @@ public class GroupController extends AbstractBaseController{ ...@@ -95,9 +95,9 @@ public class GroupController extends AbstractBaseController{
for (DepartmentBo d : departmentBos) { for (DepartmentBo d : departmentBos) {
LinkedHashMap<String, Object> dept = new LinkedHashMap<>(); LinkedHashMap<String, Object> dept = new LinkedHashMap<>();
dept.put("id", d.getSequenceNbr()); dept.put("id", String.valueOf(d.getSequenceNbr()));
dept.put("key", d.getSequenceNbr()); dept.put("key", String.valueOf(d.getSequenceNbr()));
dept.put("value", d.getSequenceNbr()); dept.put("value", String.valueOf(d.getSequenceNbr()));
dept.put("state", "open"); dept.put("state", "open");
dept.put("type", "department"); dept.put("type", "department");
dept.put("orgCode", loginOrgCode+"-"+d.getSequenceNbr()); dept.put("orgCode", loginOrgCode+"-"+d.getSequenceNbr());
......
...@@ -56,7 +56,6 @@ public class LatentDangerController extends AbstractBaseController { ...@@ -56,7 +56,6 @@ public class LatentDangerController extends AbstractBaseController {
@PostMapping(value = "/normal/save") @PostMapping(value = "/normal/save")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) { public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse();
try { try {
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) { if (ObjectUtils.isEmpty(user)) {
......
...@@ -8,7 +8,7 @@ import java.io.Serializable; ...@@ -8,7 +8,7 @@ import java.io.Serializable;
@RuleFact(value = "消防设备",project = "维保规范") @RuleFact(value = "消防设备",project = "维保规范")
public class EquipmentInputItemRo implements Serializable { public class EquipmentInputItemRo implements Serializable {
private static final long serialVersionUID = -7088399431688039744L; private static final long serialVersionUID = 2994025183812872473L;
@Label("设备名称") @Label("设备名称")
private String equipmentName; private String equipmentName;
......
...@@ -47,4 +47,19 @@ public class LatentDangerNormalParam { ...@@ -47,4 +47,19 @@ public class LatentDangerNormalParam {
* 建筑名称 * 建筑名称
*/ */
private String structureName; private String structureName;
/**
* 隐患地址经度
*/
private String longitude;
/**
* 隐患地址纬度
*/
private String latitude;
/**
* 业务类型(不同业务创建的隐患以此区分)
*/
private String bizType;
} }
...@@ -44,9 +44,9 @@ public class LatentDangerPatrolItemParam { ...@@ -44,9 +44,9 @@ public class LatentDangerPatrolItemParam {
private String instanceKey; private String instanceKey;
/* /**
* 隐患名称 * 隐患名称
* */ */
private String name; private String name;
private String limitDate; private String limitDate;
......
...@@ -142,8 +142,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -142,8 +142,8 @@ public class CheckServiceImpl implements ICheckService {
// //
// @Value("${file.port}") // @Value("${file.port}")
// private String filePort; // private String filePort;
@Value("${file.url}") // @Value("${file.url}")
private String fileUrl; // private String fileUrl;
@Override @Override
public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) { public Page<CheckInfoVo> getCheckInfo(String toke,String product,String appKey,CheckInfoPageParam param) {
...@@ -549,7 +549,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -549,7 +549,8 @@ public class CheckServiceImpl implements ICheckService {
PointCheckDetailBo pointCheckDetailBo = list.get(0); PointCheckDetailBo pointCheckDetailBo = list.get(0);
List<CheckShot> pointShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), 0l,0l); List<CheckShot> pointShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), 0l,0l);
pointShot.forEach(action -> { pointShot.forEach(action -> {
pointImgUrls.add(fileUrl + action.getPhotoData()); // pointImgUrls.add(fileUrl + action.getPhotoData());
pointImgUrls.add(action.getPhotoData());
}); });
Check check = checkDao.findById(checkId).get(); Check check = checkDao.findById(checkId).get();
pointCheckRespone.setPointId(pointCheckDetailBo.getPointId()); pointCheckRespone.setPointId(pointCheckDetailBo.getPointId());
...@@ -586,7 +587,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -586,7 +587,8 @@ public class CheckServiceImpl implements ICheckService {
List<String> pointInputImgUrls = new ArrayList<>(); List<String> pointInputImgUrls = new ArrayList<>();
List<CheckShot> pointInputShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), action.getCheckInputId(),action.getClassifyId()); List<CheckShot> pointInputShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), action.getCheckInputId(),action.getClassifyId());
pointInputShot.forEach(inputShot -> { pointInputShot.forEach(inputShot -> {
pointInputImgUrls.add(fileUrl + inputShot.getPhotoData()); // pointInputImgUrls.add(fileUrl + inputShot.getPhotoData());
pointInputImgUrls.add(inputShot.getPhotoData());
}); });
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone(); AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone();
appCheckInputRespone.setCheckInputId(action.getCheckInputId()); appCheckInputRespone.setCheckInputId(action.getCheckInputId());
...@@ -633,7 +635,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -633,7 +635,8 @@ public class CheckServiceImpl implements ICheckService {
PointCheckDetailBo pointCheckDetailBo = list.get(0); PointCheckDetailBo pointCheckDetailBo = list.get(0);
List<CheckShot> pointShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), 0l,0l); List<CheckShot> pointShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), 0l,0l);
pointShot.forEach(action -> { pointShot.forEach(action -> {
pointImgUrls.add(fileUrl + action.getPhotoData()); // pointImgUrls.add(fileUrl + action.getPhotoData());
pointImgUrls.add(action.getPhotoData());
}); });
Check check = checkDao.findById(checkId).get(); Check check = checkDao.findById(checkId).get();
pointCheckRespone.setPointId(pointCheckDetailBo.getPointId()); pointCheckRespone.setPointId(pointCheckDetailBo.getPointId());
...@@ -674,7 +677,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -674,7 +677,8 @@ public class CheckServiceImpl implements ICheckService {
List<String> pointInputImgUrls = new ArrayList<>(); List<String> pointInputImgUrls = new ArrayList<>();
List<CheckShot> pointInputShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), action.getCheckInputId(),action.getClassifyId()); List<CheckShot> pointInputShot = checkShotDao.findAllByCheckIdAndCheckInputIdAndClassifyId(pointCheckDetailBo.getCheckId(), action.getCheckInputId(),action.getClassifyId());
pointInputShot.forEach(inputShot -> { pointInputShot.forEach(inputShot -> {
pointInputImgUrls.add(fileUrl + inputShot.getPhotoData()); // pointInputImgUrls.add(fileUrl + inputShot.getPhotoData());
pointInputImgUrls.add(inputShot.getPhotoData());
}); });
AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone(); AppCheckInputRespone appCheckInputRespone = new AppCheckInputRespone();
appCheckInputRespone.setCheckInputId(action.getCheckInputId()); appCheckInputRespone.setCheckInputId(action.getCheckInputId());
...@@ -765,8 +769,10 @@ public class CheckServiceImpl implements ICheckService { ...@@ -765,8 +769,10 @@ public class CheckServiceImpl implements ICheckService {
// String ipPort = "http://" + fileIp + ":" + filePort + "/"; // String ipPort = "http://" + fileIp + ":" + filePort + "/";
for (Map<String, Object> map : checkimgs) { for (Map<String, Object> map : checkimgs) {
String imgPath = map.get("photoData").toString().replace("\\", "/"); String imgPath = map.get("photoData").toString().replace("\\", "/");
map.put("photoData", fileUrl + imgPath); // map.put("photoData", fileUrl + imgPath);
map.put("openOperUrl", "window.open('" + fileUrl + imgPath + "')"); // map.put("openOperUrl", "window.open('" + fileUrl + imgPath + "')");
map.put("photoData", imgPath);
map.put("openOperUrl", "window.open('" + imgPath + "')");
} }
resp.put("imgs", checkimgs); resp.put("imgs", checkimgs);
return resp; return resp;
...@@ -1118,8 +1124,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1118,8 +1124,8 @@ public class CheckServiceImpl implements ICheckService {
//checkInputId //checkInputId
if (e.get("inputId").toString().equals(imgContent.get(i).get("checkInputId").toString()) if (e.get("inputId").toString().equals(imgContent.get(i).get("checkInputId").toString())
&& e.get("classifyId").toString().equals(imgContent.get(i).get("classifyId").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())) { if (PointStatusEnum.UNQUALIFIED.getName().equals(e.get("IsOK").toString())) {
equip.put("IsOK", PointStatusEnum.UNQUALIFIED.getName()); equip.put("IsOK", PointStatusEnum.UNQUALIFIED.getName());
...@@ -1177,7 +1183,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1177,7 +1183,8 @@ public class CheckServiceImpl implements ICheckService {
//checkInputId //checkInputId
if(e.get("checkInputId").toString().equals(imgContent.get(i).get("checkInputId").toString()) if(e.get("checkInputId").toString().equals(imgContent.get(i).get("checkInputId").toString())
&& e.get("classifyId").toString().equals(imgContent.get(i).get("classifyId").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; 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.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -106,6 +77,34 @@ import com.yeejoin.amos.patrol.dao.entity.PointClassify; ...@@ -106,6 +77,34 @@ import com.yeejoin.amos.patrol.dao.entity.PointClassify;
import com.yeejoin.amos.patrol.exception.YeeException; import com.yeejoin.amos.patrol.exception.YeeException;
import com.yeejoin.amos.patrol.feign.RemoteSecurityService; import com.yeejoin.amos.patrol.feign.RemoteSecurityService;
import com.yeejoin.amos.patrol.mqtt.WebMqttComponent; 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") @Service("latentDangerService")
public class LatentDangerServiceImpl implements ILatentDangerService { public class LatentDangerServiceImpl implements ILatentDangerService {
...@@ -180,8 +179,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -180,8 +179,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
// @Value("${LatentDanger.flow.photoUrls}") // @Value("${LatentDanger.flow.photoUrls}")
// private String photoUrlPre; // private String photoUrlPre;
@Value("${file.url}") // @Value("${file.url}")
private String fileUrl; // private String fileUrl;
@Value("${file.url}") @Value("${file.url}")
private String fileServerAddress; private String fileServerAddress;
...@@ -419,7 +418,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -419,7 +418,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
String[] photoUrlsList = photoUrls.split(","); String[] photoUrlsList = photoUrls.split(",");
for (String url : photoUrlsList) { for (String url : photoUrlsList) {
if (!"".equals(url)){ if (!"".equals(url)){
photoUrlsB.append(fileUrl+url); // photoUrlsB.append(fileUrl+url);
photoUrlsB.append(url);
photoUrlsB.append(","); photoUrlsB.append(",");
} }
} }
...@@ -440,7 +440,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -440,7 +440,8 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
record.setExcuteUserId(userId); record.setExcuteUserId(userId);
record.setExcuteDepartmentId(departmentId); record.setExcuteDepartmentId(departmentId);
if(flowJson != null && org.apache.commons.lang3.StringUtils.isNotBlank(flowJson.getString("photoUrls"))){ 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.setFlowJson(flowJson != null ? flowJson.toJSONString() : null);
record.setFlowTaskName(taskName); record.setFlowTaskName(taskName);
...@@ -540,14 +541,14 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -540,14 +541,14 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
@Override @Override
public CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId) { public CommonResponse list(String toke, String product, String appKey, LatentDangerListParam latentDangerListParam, AgencyUserModel user, String loginOrgCode, String deptId) {
JSONObject respBody; JSONObject respBody;
Date startDate = new Date(); Date startDate = new Date();
if (latentDangerListParam.getIsHandle()) { if (latentDangerListParam.getIsHandle()) {
respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType()); respBody = remoteWorkFlowService.completedPageTask(user.getUserName(),latentDangerListParam.getBelongType());
} else { } else {
respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType()); respBody = remoteWorkFlowService.pageTask(user.getUserId(),latentDangerListParam.getBelongType());
} }
Date endDate = new Date(); Date endDate = new Date();
logger.info("-------------------------工作流列表时间" +(endDate.getTime()-startDate.getTime())); logger.info("-------------------------工作流列表时间" + (endDate.getTime() - startDate.getTime()));
JSONArray taskJsonList = respBody.getJSONArray("data"); JSONArray taskJsonList = respBody.getJSONArray("data");
List<JSONObject> taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class); List<JSONObject> taskList = JSONObject.parseArray(taskJsonList.toJSONString(), JSONObject.class);
List<String> bussinessKeys = new ArrayList<>(); List<String> bussinessKeys = new ArrayList<>();
...@@ -720,9 +721,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -720,9 +721,9 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
} }
@Override @Override
public CommonResponse detail(String id, String userId,boolean isFinish) { public CommonResponse detail(String id, String userId, boolean isFinish) {
JSONObject jsonObject; JSONObject jsonObject;
if(isFinish==true){ if(isFinish){
jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id); jsonObject = remoteWorkFlowService.queryFinishTaskDetail(id);
}else{ }else{
jsonObject = remoteWorkFlowService.queryTaskDetail(id); jsonObject = remoteWorkFlowService.queryTaskDetail(id);
...@@ -1172,7 +1173,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -1172,7 +1173,7 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
String departmentName, String departmentName,
DangerExecuteSubmitDto executeSubmitDto, DangerExecuteSubmitDto executeSubmitDto,
RoleBo role) { RoleBo role) {
JSONObject executeJson = remoteWorkFlowService.excute(param.getTaskId(), executeTypeEnum.getRequestBody()); JSONObject executeJson = remoteWorkFlowService.execute(param.getTaskId(), executeTypeEnum.getRequestBody());
if (executeJson == null) { if (executeJson == null) {
executeSubmitDto.setIsOk(false); executeSubmitDto.setIsOk(false);
executeSubmitDto.setMsg("执行失败"); executeSubmitDto.setMsg("执行失败");
......
...@@ -105,8 +105,8 @@ public class TaskServiceImpl implements ITaskService { ...@@ -105,8 +105,8 @@ public class TaskServiceImpl implements ITaskService {
// @Value("${LatentDanger.flow.photoUrls}") // @Value("${LatentDanger.flow.photoUrls}")
// private String photoUrl; // private String photoUrl;
@Value("${file.url}") // @Value("${file.url}")
private String fileUrl; // private String fileUrl;
@Override @Override
@Transactional @Transactional
public Long addNewTask(TaskParam param) { public Long addNewTask(TaskParam param) {
...@@ -174,7 +174,8 @@ public class TaskServiceImpl implements ITaskService { ...@@ -174,7 +174,8 @@ public class TaskServiceImpl implements ITaskService {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
List<String> picList = taskPictureMapper.queryTaskFeedbackPic(feedback.getId()); List<String> picList = taskPictureMapper.queryTaskFeedbackPic(feedback.getId());
for (int i = 0; i <picList.size() ; i++) { 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); feedbackBo.setFeedbackPics(list);
feedbackList.add(feedbackBo); feedbackList.add(feedbackBo);
......
...@@ -173,7 +173,7 @@ public class RemoteWorkFlowService { ...@@ -173,7 +173,7 @@ public class RemoteWorkFlowService {
// return json; // return json;
// } // }
public JSONObject excute(String taskId, String requestBody) { public JSONObject execute(String taskId, String requestBody) {
Map<String, String> map = Maps.newHashMap(); Map<String, String> map = Maps.newHashMap();
map.put("taskId", taskId); map.put("taskId", taskId);
Map<String, String> headerMap = Maps.newHashMap(); Map<String, String> headerMap = Maps.newHashMap();
......
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
</dependency>
<dependency>
<groupId>cn.jpush.api</groupId> <groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId> <artifactId>jpush-client</artifactId>
</dependency> </dependency>
......
package com.yeejoin.amos.supervision.business.controller; package com.yeejoin.amos.supervision.business.controller;
import java.io.ByteArrayInputStream; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import java.io.File; import com.yeejoin.amos.supervision.business.constants.XJConstant;
import java.io.FileInputStream; import com.yeejoin.amos.supervision.business.dto.CheckDto;
import java.io.IOException; import com.yeejoin.amos.supervision.business.param.CheckInfoPageParam;
import java.io.InputStream; import com.yeejoin.amos.supervision.business.param.CheckPageParam;
import java.util.Date; import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import java.util.HashMap; import com.yeejoin.amos.supervision.business.param.CheckStatisticalParam;
import java.util.List; import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
import java.util.Map; import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.ISafety3DDataSendService;
import javax.servlet.http.HttpServletResponse; import com.yeejoin.amos.supervision.business.util.*;
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.supervision.business.vo.CheckAnalysisVo; import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.core.async.AsyncTask; 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.framework.PersonIdentify;
import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.mqtt.WebMqttComponent; 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.io.IOUtils;
import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.BooleanUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -35,48 +34,22 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -35,48 +34,22 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import 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.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; 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 @RestController
@RequestMapping(value = "/api/check") @RequestMapping(value = "/api/check")
@Api(tags = "巡检记录api") @Api(tags = "巡检记录api")
...@@ -100,14 +73,14 @@ public class CheckController extends AbstractBaseController { ...@@ -100,14 +73,14 @@ public class CheckController extends AbstractBaseController {
@Value("${linux.img.path}") @Value("${linux.img.path}")
private String linuxImgPath; private String linuxImgPath;
// @Value("${file.ip}") // @Value("${file.ip}")
// private String fileIp; // private String fileIp;
// //
// @Value("${file.port}") // @Value("${file.port}")
// private String filePort; // private String filePort;
@Value("${file.url}") @Value("${file.url}")
private String fileUrl; private String fileUrl;
@Value("${amosRefresh.patrol.topic}") @Value("${amosRefresh.patrol.topic}")
private String patrolTopic; private String patrolTopic;
@Autowired @Autowired
...@@ -572,7 +545,7 @@ public class CheckController extends AbstractBaseController { ...@@ -572,7 +545,7 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存检查记录", notes = "保存检查记录") @ApiOperation(value = "保存检查记录", notes = "保存检查记录")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @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 { try {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams); String orgCode = getOrgCode(reginParams);
...@@ -585,4 +558,26 @@ public class CheckController extends AbstractBaseController { ...@@ -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 { ...@@ -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 * @param queryRequests
......
...@@ -196,7 +196,7 @@ public class PlanController extends AbstractBaseController { ...@@ -196,7 +196,7 @@ public class PlanController extends AbstractBaseController {
@RequestMapping(value = "/setPlanStatus", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/setPlanStatus", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse setPlanStatus( public CommonResponse setPlanStatus(
@ApiParam(value = "计划id") @RequestParam(value = "planId", required = false) Long planId, @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); planService.setplanstatus(planId, status);
return CommonResponseUtil.success(); 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("删除巡检路线点项关系失败!");
}
}
}
package com.yeejoin.amos.supervision.business.dao.mapper; package com.yeejoin.amos.supervision.business.dao.mapper;
import java.util.HashMap; import com.yeejoin.amos.supervision.business.entity.mybatis.*;
import java.util.List; import com.yeejoin.amos.supervision.business.param.*;
import java.util.Map;
import com.yeejoin.amos.supervision.business.param.CheckStatisticalParam;
import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam; import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam;
import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckDetailBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckInfoBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckInputBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckTraListBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckUserBo;
import com.yeejoin.amos.supervision.business.param.CheckInfoListPageParam;
import com.yeejoin.amos.supervision.business.param.CheckInfoPageParam;
import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam;
import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoBusinessRespone; import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoBusinessRespone;
import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoRespone; import com.yeejoin.amos.supervision.core.common.response.PointCheckInfoRespone;
import com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface CheckMapper extends BaseMapper { public interface CheckMapper extends BaseMapper {
long countCheckInfoData(CheckInfoPageParam param); long countCheckInfoData(CheckInfoPageParam param);
List<CheckInfoVo> getCheckInfo(CheckInfoPageParam param); List<CheckInfoVo> getCheckInfo(CheckInfoPageParam param);
List<Map> queryUnqualifiedInputItem(@Param(value="checkId") int checkId); List<Map> queryUnqualifiedInputItem(@Param(value = "checkId") int checkId);
List<Map> queryCheckPointInputItem(@Param(value="planTaskId") int planTaskId, @Param(value="pointId") int pointId); List<Map> queryCheckPointInputItem(@Param(value = "planTaskId") int planTaskId, @Param(value = "pointId") int pointId);
List<PointCheckDetailBo> findCheckPointInputItem(@Param(value="checkId") long checkId); List<PointCheckDetailBo> findCheckPointInputItem(@Param(value = "checkId") long checkId);
int checkHasRecord(CheckRecordParam requestParam); int checkHasRecord(CheckRecordParam requestParam);
List<Map<String, Object>> queryCheckPointImgs(@Param(value="planTaskId") int planTaskId, @Param(value="pointId") int pointId); List<Map<String, Object>> queryCheckPointImgs(@Param(value = "planTaskId") int planTaskId, @Param(value = "pointId") int pointId);
/** /**
* 巡检日历饼图数据 * 巡检日历饼图数据
* @param param *
* @return * @param param
*/ * @return
Map<String,Object> pieChartData(CheckRecordParam param); */
Map<String, Object> pieChartData(CheckRecordParam param);
/**
* 巡检日历日历数据 /**
* @param param * 巡检日历日历数据
* @return *
*/ * @param param
List<Map<String,Object>> calendarData(CheckRecordParam param); * @return
*/
List<Map<String, Object>> queryRecordByPointId(HashMap<String, Object> req); List<Map<String, Object>> calendarData(CheckRecordParam param);
Map<String, Object> queryCheckById(@Param(value="checkId") int checkId); List<Map<String, Object>> queryRecordByPointId(HashMap<String, Object> req);
List<Map<String, Object>> queryCheckInputItems(@Param(value="checkId") int checkId); Map<String, Object> queryCheckById(@Param(value = "checkId") int checkId);
List<Map<String, Object>> queryCheckImgs(@Param(value="checkId") int checkId); List<Map<String, Object>> queryCheckInputItems(@Param(value = "checkId") int checkId);
/** List<Map<String, Object>> queryCheckImgs(@Param(value = "checkId") int checkId);
* 查询所有巡检记录图片
* @param param /**
* @return * 查询所有巡检记录图片
*/ *
List<Map<String, Object>> getCheckInfoImgsList(CheckInfoPageParam param); * @param param
* @return
/** */
* 根据巡检记录id获取所有图片 List<Map<String, Object>> getCheckInfoImgsList(CheckInfoPageParam param);
* @param ids
* @return /**
*/ * 根据巡检记录id获取所有图片
List<Map<String, Object>> getCheckInfoImgsByCheckIdsList(@Param(value="checkIds") Long[] ids); *
* @param ids
/** * @return
* 根据ids获取巡检记录 */
* @param ids List<Map<String, Object>> getCheckInfoImgsByCheckIdsList(@Param(value = "checkIds") Long[] ids);
* @return
*/ /**
List<CheckInfoVo> getSelectedCheckInfoList(@Param(value="checkIds") Long[] ids); * 根据ids获取巡检记录
*
/** * @param ids
* 月巡检情况统计 * @return
* @param param */
* @return List<CheckInfoVo> getSelectedCheckInfoList(@Param(value = "checkIds") Long[] ids);
*/
List<HashMap<String, Object>> getCountMonthChk(HashMap<String, Object> param); /**
* 月巡检情况统计
/** *
* 月巡检情况统计 * @param param
* @return * @return
*/ */
List<HashMap<String, Object>> getCountMonthChkNew(); List<HashMap<String, Object>> getCountMonthChk(HashMap<String, Object> param);
/** /**
* 获取巡检日历信息列表 * 月巡检情况统计
* *
* @param paramMap * @return
* @return */
*/ List<HashMap<String, Object>> getCountMonthChkNew();
List<HashMap<String, String>> getCalenderCountInfoList(HashMap<String, Object> paramMap);
/**
/** * 获取巡检日历信息列表
* 获取巡检人员 *
* * @param paramMap
* @param paramsMap * @return
* @return */
*/ List<HashMap<String, String>> getCalenderCountInfoList(HashMap<String, Object> paramMap);
List<CheckUserBo> getCheckUserInfoList(HashMap<String, Object> paramsMap);
/**
/** * 获取巡检人员
* 根据巡检点id获取最新一条巡检记录 *
* * @param paramsMap
* @param pointId * @return
* @return */
*/ List<CheckUserBo> getCheckUserInfoList(HashMap<String, Object> paramsMap);
Long getLastsetCheckByPointID(@Param(value = "pointID") Long pointId);
/**
/** * 根据巡检点id获取最新一条巡检记录
* 根据巡检记录ID查询巡检项个数 *
* * @param pointId
* @param checkID * @return
* @return */
*/ Long getLastsetCheckByPointID(@Param(value = "pointID") Long pointId);
long countCheckInputByMybatis(@Param(value = "checkID") Long checkID);
/**
* 根据巡检记录ID查询巡检项个数
*
/** * @param checkID
* 根据巡检记录ID查询装备个数 * @return
* */
* @param checkID long countCheckInputByMybatis(@Param(value = "checkID") Long checkID);
* @return
*/
long countClassifyByMybatis(@Param(value = "checkID") Long checkID); /**
* 根据巡检记录ID查询装备个数
/** *
* 根据巡检记录ID获取巡检项 * @param checkID
* * @return
* @param param */
* @return long countClassifyByMybatis(@Param(value = "checkID") Long checkID);
*/
List<CheckInputBo> getCheckInputByCheckId(CheckDetailInputPageParam param); /**
* 根据巡检记录ID获取巡检项
/** *
* 根据巡检记录ID获取巡检项 * @param param
* * @return
* @param param */
* @return List<CheckInputBo> getCheckInputByCheckId(CheckDetailInputPageParam param);
*/
List<HashMap<String,Object>> getEquipInputByCheckId(CheckDetailInputPageParam param); /**
* 根据巡检记录ID获取巡检项
/** *
* 根据巡检记录ID查询巡检装备 * @param param
* * @return
* @param checkID */
* @return List<HashMap<String, Object>> getEquipInputByCheckId(CheckDetailInputPageParam param);
*/
List<HashMap<String,Object>> getCheckEquipByCheckID(Long checkID); /**
/** * 根据巡检记录ID查询巡检装备
* 根据巡检记录ID获取图片信息 *
* * @param checkID
* @param param * @return
* @return */
*/ List<HashMap<String, Object>> getCheckEquipByCheckID(Long checkID);
List<HashMap<String,Object>> getEquipInfoImgsByCheckIdsList(Long checkID);
/** /**
* 根据巡检记录ID和点ID获取巡检记录详情 * 根据巡检记录ID获取图片信息
* *
* @param param * @param param
* @return * @return
*/ */
CheckDetailBo getCheckDetailByID(CheckDetailInputPageParam param); List<HashMap<String, Object>> getEquipInfoImgsByCheckIdsList(Long checkID);
/** /**
* 根据巡检记录ID获取巡检记录图片信息 * 根据巡检记录ID和点ID获取巡检记录详情
* *
* @param checkID * @param param
* @return * @return
*/ */
List<String> getCheckInputPhotoByID(@Param(value = "checkId") Long checkID); CheckDetailBo getCheckDetailByID(CheckDetailInputPageParam param);
/** /**
* 查询巡检轨迹数量 * 根据巡检记录ID获取巡检记录图片信息
* *
* @param params * @param checkID
* @return * @return
*/ */
long countCheckTraListData(CheckPtListPageParam params); List<String> getCheckInputPhotoByID(@Param(value = "checkId") Long checkID);
/** /**
* 查询巡检轨迹 * 查询巡检轨迹数量
* *
* @param params * @param params
* @return * @return
*/ */
List<CheckTraListBo> getCheckTraList(CheckPtListPageParam params); long countCheckTraListData(CheckPtListPageParam params);
/** /**
* 根据检查id获取检查信息 * 查询巡检轨迹
* @param checkId *
* @return * @param params
*/ * @return
List<PointCheckInfoRespone> getCheckInfoById(@Param(value = "checkId") Long checkId); */
List<CheckTraListBo> getCheckTraList(CheckPtListPageParam params);
/**
* 根据检查id获取检查信息
*
* @param checkId
* @return
*/
List<PointCheckInfoRespone> getCheckInfoById(@Param(value = "checkId") Long checkId);
/** /**
* 计划路线点最新巡检记录查询 * 计划路线点最新巡检记录查询
*
* @param params * @param params
* @return * @return
*/ */
List<PlanRoutePointBo> getLastPointCheckList(CheckPtListPageParam params); List<PlanRoutePointBo> getLastPointCheckList(CheckPtListPageParam params);
/** /**
* 计划路线点最新巡检记录分页统计用 * 计划路线点最新巡检记录分页统计用
* @param params *
* @return * @param params
*/ * @return
long countLastPointCheckData(CheckPtListPageParam params); */
long countLastPointCheckData(CheckPtListPageParam params);
/**
* 查询巡检记录信息记录个数 /**
* * 查询巡检记录信息记录个数
* @param params *
* @return * @param params
*/ * @return
long countCheckInfoListData(CheckInfoListPageParam params); */
long countCheckInfoListData1(CheckInfoListPageParam params); long countCheckInfoListData(CheckInfoListPageParam params);
/** long countCheckInfoListData1(CheckInfoListPageParam params);
* 查询巡检记录列表信息
* /**
* @param params * 查询巡检记录列表信息
* @return *
*/ * @param params
List<CheckInfoBo> getCheckInfoList(CheckInfoListPageParam params); * @return
*/
List<Map<String,Object>> getCheckInfoList1(CheckInfoListPageParam params); List<CheckInfoBo> getCheckInfoList(CheckInfoListPageParam params);
/**
* 查询点及线路信息 List<Map<String, Object>> getCheckInfoList1(CheckInfoListPageParam params);
* @return
*/ /**
public List<Map<String,Object>> getRoutesAndPointsInfo(); * 查询点及线路信息
*
/** * @return
* 巡检情况统计分析 */
* @param param public List<Map<String, Object>> getRoutesAndPointsInfo();
* @return
*/ /**
List<CheckAnalysisVo> getCheckStatisticalAnalysis(CheckStatisticalParam param); * 巡检情况统计分析
*
/** * @param param
* 根据orgCode查询公司累计巡检次数 * @return
* @param loginOrgCode */
* @return List<CheckAnalysisVo> getCheckStatisticalAnalysis(CheckStatisticalParam param);
*/
long getCumulativeCheckCountByOrgCode(String loginOrgCode); /**
* 根据orgCode查询公司累计巡检次数
/** *
* 根据条件查询日巡检次数 * @param loginOrgCode
* @param param * @return
* @return */
*/ long getCumulativeCheckCountByOrgCode(String loginOrgCode);
List<Long> getCheckDataCount(HashMap<String, Object> param);
/**
PointCheckInfoBusinessRespone getCheckInfoBusinessById(@Param(value = "checkId") Long checkId); * 根据条件查询日巡检次数
*
List<String> getLivePhotos(@Param(value = "checkId") Long checkID); * @param param
* @return
*/
List<String> getPhotosByCheckIDAndInputId(@Param(value = "checkId") int checkId, @Param(value = "checkInputId")int checkInputId, @Param(value = "classifyId")int classifyId); List<Long> getCheckDataCount(HashMap<String, Object> param);
PointCheckInfoBusinessRespone getCheckInfoBusinessById(@Param(value = "checkId") Long checkId);
List<String> getLivePhotos(@Param(value = "checkId") Long checkID);
List<String> getPhotosByCheckIDAndInputId(@Param(value = "checkId") int checkId, @Param(value = "checkInputId") int checkInputId, @Param(value = "classifyId") int classifyId);
List<Long> getPlanCheckDataCount(HashMap<String, Object> param); List<Long> getPlanCheckDataCount(HashMap<String, Object> param);
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds); //Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
long getItemCount(HashMap<String, Object> params); long getItemCount(HashMap<String, Object> params);
List<HashMap<String, Object>> getCheckItems(HashMap<String, Object> params);
List<HashMap<String, Object>> getCheckItems(HashMap<String, Object> params); List<Map<String, Object>> getPlanExecuteTeams();
List<Map<String, Object>> getPlanExecuteTeams(); int checkHasRecord(@Param(value = "planTaskId") Long planTaskId, @Param(value = "pointId") Long pointId);
int checkHasRecord(@Param(value = "planTaskId") Long planTaskId, @Param(value = "pointId") Long pointId); long queryPageCount(CheckPageParam param);
List<CheckVo> queryPage(CheckPageParam param);
} }
...@@ -38,4 +38,10 @@ public interface InputItemMapper { ...@@ -38,4 +38,10 @@ public interface InputItemMapper {
void updatePointById(Map<String, Object> param); void updatePointById(Map<String, Object> param);
List<Long> getIds(); 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; 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; 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); int delRoutePointItemByRouteId(Long routeId);
long queryPageCount(InputItemPageParam param);
List<RoutePointItemVo> queryPage(InputItemPageParam param);
} }
...@@ -30,6 +30,11 @@ public interface IPlanDao extends BaseDao<Plan, Long> { ...@@ -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) @Query(value = "UPDATE p_plan SET is_delete = 1,`status` = 1 WHERE id IN (?1)", nativeQuery = true)
void updatePlanDel(List<Long> ids); 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); Plan findByOriginalId(String originalId);
@Query(value = "select * from p_plan where original_id in (?1) and is_delete = 0", nativeQuery = true) @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> { ...@@ -22,5 +22,10 @@ public interface IRoutePointItemDao extends BaseDao<RoutePointItem, Long> {
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "delete from p_route_point_item WHERE id in (?1)", nativeQuery = true) @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; ...@@ -4,82 +4,129 @@ import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import java.util.List; import java.util.List;
public class InputItemPageParam extends CommonPageable{ public class InputItemPageParam extends CommonPageable {
private String isScore; private String isScore;
private String itemType; private String itemType;
private String name; private String name;
private String level; private String level;
private String itemNo; private String itemNo;
/** private String checkTypeId;
* 机构 private String itemStart;
*/ private Long planId;
private String orgCode; private String itemTypeClassifyIds;
/**
private String inputClassify; * 机构
*/
public String getItemClassify() { private String orgCode;
return itemClassify;
} private String inputClassify;
public void setItemClassify(String itemClassify) { public String getItemClassify() {
this.itemClassify = itemClassify; return itemClassify;
} }
private String itemClassify; public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify;
public String getInputClassify() { }
return inputClassify;
} private String itemClassify;
public void setInputClassify(String inputClassify) { public String getInputClassify() {
this.inputClassify = inputClassify; return inputClassify;
} }
private List<Long> catalogIds; public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify;
public String getItemNo() { }
return itemNo;
} private List<Long> catalogIds;
public void setItemNo(String itemNo) {
this.itemNo = itemNo; public String getItemNo() {
} return itemNo;
public String getLevel() { }
return level;
} public void setItemNo(String itemNo) {
public void setLevel(String level) { this.itemNo = itemNo;
this.level = level; }
}
public String getIsScore() { public String getLevel() {
return isScore; return level;
} }
public void setIsScore(String isScore) {
this.isScore = isScore; public void setLevel(String level) {
} this.level = level;
public String getItemType() { }
return itemType;
} public String getIsScore() {
public void setItemType(String itemType) { return isScore;
this.itemType = itemType; }
}
public String getName() { public void setIsScore(String isScore) {
return name; this.isScore = isScore;
} }
public void setName(String name) {
this.name = name; public String getItemType() {
} return itemType;
public String getOrgCode() { }
return orgCode;
} public void setItemType(String itemType) {
public void setOrgCode(String orgCode) { this.itemType = itemType;
this.orgCode = orgCode; }
}
public String getName() {
public List<Long> getCatalogIds() { return name;
return catalogIds; }
}
public void setName(String name) {
public void setCatalogIds(List<Long> catalogIds) { this.name = name;
this.catalogIds = catalogIds; }
}
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;
}
} }
package com.yeejoin.amos.supervision.business.service.impl; package com.yeejoin.amos.supervision.business.service.impl;
import java.text.SimpleDateFormat; import com.alibaba.fastjson.JSONArray;
import java.util.ArrayList; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays; import com.google.common.base.Joiner;
import java.util.Date; import com.google.common.collect.Lists;
import java.util.HashMap; import com.google.common.collect.Maps;
import java.util.HashSet; import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.supervision.business.constants.XJConstant; import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.CheckMapper; import com.yeejoin.amos.supervision.business.dao.mapper.CheckMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.supervision.business.dao.repository.*;
import com.yeejoin.amos.supervision.business.dto.CheckDto;
import com.yeejoin.amos.supervision.business.dto.CheckRecordDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.*;
import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.*;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckService; import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
import com.yeejoin.amos.supervision.business.service.intfc.IEquipmentHandlerService; import com.yeejoin.amos.supervision.business.service.intfc.IEquipmentHandlerService;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService; import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam;
import com.yeejoin.amos.supervision.business.util.ToolUtils; import com.yeejoin.amos.supervision.business.util.ToolUtils;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.business.vo.CheckVo;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.*;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.cxf.common.util.CollectionUtils; import org.apache.cxf.common.util.CollectionUtils;
...@@ -43,64 +50,10 @@ import org.springframework.stereotype.Service; ...@@ -43,64 +50,10 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import com.alibaba.fastjson.JSONArray; import javax.annotation.Resource;
import com.alibaba.fastjson.JSONObject; import javax.transaction.Transactional;
import com.google.common.base.Joiner; import java.util.*;
import com.google.common.collect.Lists; import java.util.stream.Collectors;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.DepartmentModel;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.supervision.business.dao.repository.ICatalogTreeDao;
import com.yeejoin.amos.supervision.business.dao.repository.ICheckDao;
import com.yeejoin.amos.supervision.business.dao.repository.ICheckInputDao;
import com.yeejoin.amos.supervision.business.dao.repository.ICheckShotDao;
import com.yeejoin.amos.supervision.business.dao.repository.IInputItemDao;
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.dto.CheckDto;
import com.yeejoin.amos.supervision.business.dto.CheckRecordDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckDetailBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckInfoBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckInputBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckTraListBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckUserBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.EquipmentInputItemRo;
import com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.CheckInfoListPageParam;
import com.yeejoin.amos.supervision.business.param.CheckInfoPageParam;
import com.yeejoin.amos.supervision.business.param.CheckInputParam;
import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam;
import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import com.yeejoin.amos.supervision.business.param.CheckStatisticalParam;
import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam;
import com.yeejoin.amos.supervision.business.util.Toke;
import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.common.response.CalendarStatusCountRespone;
import com.yeejoin.amos.supervision.core.common.response.CommonPage;
import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.supervision.core.common.response.PatrolUserRespone;
import com.yeejoin.amos.supervision.core.common.response.PointInfoResponse;
import com.yeejoin.amos.supervision.core.common.response.PointPositionInfoSyn3DRespone;
import com.yeejoin.amos.supervision.core.common.response.QueryCriteriaRespone;
import com.yeejoin.amos.supervision.core.common.response.RouteResponse;
import com.yeejoin.amos.supervision.dao.entity.Check;
import com.yeejoin.amos.supervision.dao.entity.CheckInput;
import com.yeejoin.amos.supervision.dao.entity.CheckShot;
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;
@Service("checkService") @Service("checkService")
public class CheckServiceImpl implements ICheckService { public class CheckServiceImpl implements ICheckService {
...@@ -150,14 +103,14 @@ public class CheckServiceImpl implements ICheckService { ...@@ -150,14 +103,14 @@ public class CheckServiceImpl implements ICheckService {
@Autowired @Autowired
IPlanTaskService planTaskService; IPlanTaskService planTaskService;
// @Value("${file.ip}") // @Value("${file.ip}")
// private String fileIp; // private String fileIp;
// //
// @Value("${file.port}") // @Value("${file.port}")
// private String filePort; // private String filePort;
@Value("${file.url}") @Value("${file.url}")
private String fileUrl; private String fileUrl;
@Override @Override
public Page<CheckInfoVo> getCheckInfo(String toke, String product, String appKey, CheckInfoPageParam param) { public Page<CheckInfoVo> getCheckInfo(String toke, String product, String appKey, CheckInfoPageParam param) {
long total = checkMapper.countCheckInfoData(param); long total = checkMapper.countCheckInfoData(param);
...@@ -1384,7 +1337,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1384,7 +1337,7 @@ public class CheckServiceImpl implements ICheckService {
@Transactional @Transactional
public CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception { public CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(personIdentity) ) { if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(personIdentity)) {
throw new RuntimeException("获取用户信息失败"); throw new RuntimeException("获取用户信息失败");
} }
String mtUserSeq = personIdentity.getPersonSeq(); String mtUserSeq = personIdentity.getPersonSeq();
...@@ -1435,20 +1388,20 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1435,20 +1388,20 @@ public class CheckServiceImpl implements ICheckService {
String depId = check.getDepId(); String depId = check.getDepId();
String depName = check.getDepName(); String depName = check.getDepName();
if (!userId.contains(mtUserSeq)) { if (!userId.contains(mtUserSeq)) {
check.setUserId(userId+","+mtUserSeq); check.setUserId(userId + "," + mtUserSeq);
check.setUserName(userName1+","+userName); check.setUserName(userName1 + "," + userName);
} }
if (!companyId.contains(reginParams.getCompany().getSequenceNbr().toString())) { if (!companyId.contains(reginParams.getCompany().getSequenceNbr().toString())) {
check.setCompanyId(companyId+","+reginParams.getCompany().getSequenceNbr().toString()); check.setCompanyId(companyId + "," + reginParams.getCompany().getSequenceNbr().toString());
} }
if (!companyName.contains(reginParams.getCompany().getCompanyName())) { if (!companyName.contains(reginParams.getCompany().getCompanyName())) {
check.setCompanyName(companyName+","+reginParams.getCompany().getCompanyName()); check.setCompanyName(companyName + "," + reginParams.getCompany().getCompanyName());
} }
if (!depId.contains(personIdentity.getCompanyId())) { if (!depId.contains(personIdentity.getCompanyId())) {
check.setDepId(depId+","+personIdentity.getCompanyId()); check.setDepId(depId + "," + personIdentity.getCompanyId());
} }
if (!depName.contains(personIdentity.getCompanyName())) { if (!depName.contains(personIdentity.getCompanyName())) {
check.setDepName(depName+","+personIdentity.getCompanyName()); check.setDepName(depName + "," + personIdentity.getCompanyName());
} }
} }
...@@ -1561,7 +1514,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1561,7 +1514,7 @@ public class CheckServiceImpl implements ICheckService {
//7.返回不合格记录 //7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList); return new CheckDto(check.getId(), unqualifiedCheckItemList);
} catch (Exception e) { } catch (Exception e) {
throw new Exception(e.getMessage(),e); throw new Exception(e.getMessage(), e);
} }
} }
...@@ -1595,5 +1548,13 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1595,5 +1548,13 @@ public class CheckServiceImpl implements ICheckService {
return checkMapper.checkHasRecord(planTaskId, pointId); return checkMapper.checkHasRecord(planTaskId, pointId);
} }
@Override
public Page<CheckVo> queryPage(CheckPageParam param) {
long total = checkMapper.queryPageCount(param);
List<CheckVo> content = checkMapper.queryPage(param);
Page<CheckVo> result = new PageImpl<CheckVo>(content, param, total);
return result;
}
} }
...@@ -277,4 +277,12 @@ public class InputItemServiceImpl implements IInputItemService { ...@@ -277,4 +277,12 @@ public class InputItemServiceImpl implements IInputItemService {
inputItemMapper.updatePointById(param); 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; ...@@ -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.dao.repository.*;
import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam; import com.yeejoin.amos.supervision.business.param.PlanInfoPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanService;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest; import com.yeejoin.amos.supervision.core.common.request.AddPlanRequest;
import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone; import com.yeejoin.amos.supervision.core.common.response.PlanPointRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
...@@ -81,6 +82,10 @@ public class PlanServiceImpl implements IPlanService { ...@@ -81,6 +82,10 @@ public class PlanServiceImpl implements IPlanService {
Map<String, String> userIdNameMap = userModels.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName)); Map<String, String> userIdNameMap = userModels.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, AgencyUserModel::getRealName));
content.forEach(c -> { content.forEach(c -> {
this.buildUserName(c, "createBy", userIdNameMap); 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); return new PageImpl<>(content, param, total);
} }
...@@ -110,7 +115,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -110,7 +115,7 @@ public class PlanServiceImpl implements IPlanService {
String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString(); String orgCode = map.get("org_code") == null ? "" : map.get("org_code").toString();
String userId = map.get("user_id") == null ? "" : map.get("user_id").toString(); String userId = map.get("user_id") == null ? "" : map.get("user_id").toString();
param.setOrgCode(orgCode); 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.setNextGenDate(DateUtil.getIntervalDate(new Date(), 0));
param.setCreateBy(userId); param.setCreateBy(userId);
addPlanRequest.setPlan(param); addPlanRequest.setPlan(param);
...@@ -144,7 +149,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -144,7 +149,7 @@ public class PlanServiceImpl implements IPlanService {
if (plan.getId()>0) { if (plan.getId()>0) {
// 删除相关点项内容 // 删除相关点项内容
iRoutePointDao.delRoutePointByRouteId(plan.getRouteId()); iRoutePointDao.delRoutePointByRouteId(plan.getRouteId());
iRoutePointItemDao.delRoutePointItem(plan.getRouteId()); // iRoutePointItemDao.delRoutePointItem(plan.getRouteId());
saveRoute.setId(plan.getRouteId()); saveRoute.setId(plan.getRouteId());
} }
...@@ -173,16 +178,16 @@ public class PlanServiceImpl implements IPlanService { ...@@ -173,16 +178,16 @@ public class PlanServiceImpl implements IPlanService {
iRoutePointDao.save(routePoint); iRoutePointDao.save(routePoint);
// List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point); // List<PointInputItem> pointInputItems = pointMapper.getCheckPointById(point);
List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point); // List<PointInputItem> pointInputItems = iPointInputItemDao.getPointInputItemByPointId(point);
pointMapper.getPointClassInputItemById(point); // pointMapper.getPointClassInputItemById(point);
if (!ObjectUtils.isEmpty(pointInputItems)) { // if (!ObjectUtils.isEmpty(pointInputItems)) {
pointInputItems.forEach(pointInputItem -> { // pointInputItems.forEach(pointInputItem -> {
RoutePointItem routePointItem = new RoutePointItem(); // RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setRoutePointId(routePoint.getId()); // routePointItem.setRoutePointId(routePoint.getId());
routePointItem.setPointInputItemId(pointInputItem.getId()); // routePointItem.setPointInputItemId(pointInputItem.getId());
iRoutePointItemDao.save(routePointItem); // iRoutePointItemDao.save(routePointItem);
}); // });
} // }
}); });
} }
} }
...@@ -236,7 +241,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -236,7 +241,7 @@ public class PlanServiceImpl implements IPlanService {
for (long planId : planIds) { for (long planId : planIds) {
List<Plan> planList = getPlanByRouteId(planId); List<Plan> planList = getPlanByRouteId(planId);
for (Plan plan : planList) { for (Plan plan : planList) {
plan.setStatus((byte) 1); plan.setStatus(1);
planDao.save(plan); planDao.save(plan);
} }
} }
...@@ -265,7 +270,7 @@ public class PlanServiceImpl implements IPlanService { ...@@ -265,7 +270,7 @@ public class PlanServiceImpl implements IPlanService {
} }
@Override @Override
public void setplanstatus (Long id, byte status) { public void setplanstatus (Long id, Integer status) {
Plan oriPlan = planDao.findById(id).get(); Plan oriPlan = planDao.findById(id).get();
oriPlan.setStatus(status); oriPlan.setStatus(status);
planDao.save(oriPlan); planDao.save(oriPlan);
......
...@@ -3,46 +3,25 @@ package com.yeejoin.amos.supervision.business.service.impl; ...@@ -3,46 +3,25 @@ package com.yeejoin.amos.supervision.business.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Lists; 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.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.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.InputItemMapper; 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.PointMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RouteMapper; 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.*;
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.FormValue;
import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto; import com.yeejoin.amos.supervision.business.dto.OrgUsrFormDto;
import com.yeejoin.amos.supervision.business.dto.PointDto; import com.yeejoin.amos.supervision.business.dto.PointDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo; import com.yeejoin.amos.supervision.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.supervision.business.feign.EquipFeign; import com.yeejoin.amos.supervision.business.feign.EquipFeign;
import com.yeejoin.amos.supervision.business.param.*; 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.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.DaoCriteria; import com.yeejoin.amos.supervision.business.util.DaoCriteria;
import com.yeejoin.amos.supervision.business.vo.*; 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.common.enums.PointStatusEnum;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.PointResponse; import com.yeejoin.amos.supervision.core.common.response.PointResponse;
...@@ -51,19 +30,8 @@ import com.yeejoin.amos.supervision.core.util.query.BaseQuerySpecification; ...@@ -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.dao.entity.*;
import com.yeejoin.amos.supervision.exception.YeeException; import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; 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.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.assertj.core.util.Sets; import org.assertj.core.util.Sets;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -141,7 +109,7 @@ public class PointServiceImpl implements IPointService { ...@@ -141,7 +109,7 @@ public class PointServiceImpl implements IPointService {
Point point = pointParam.getPoint(); Point point = pointParam.getPoint();
point.setIsDelete(false); point.setIsDelete(false);
iPointDao.saveAndFlush(point); iPointDao.saveAndFlush(point);
addClassifyAndInputItem(pointParam, point); // addClassifyAndInputItem(pointParam, point);
return point; return point;
} }
......
package com.yeejoin.amos.supervision.business.service.impl;
import com.google.common.collect.Lists;
import com.yeejoin.amos.supervision.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.supervision.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.supervision.business.dao.repository.IPlanDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointDao;
import com.yeejoin.amos.supervision.business.dao.repository.IRoutePointItemDao;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import com.yeejoin.amos.supervision.business.service.intfc.IRoutePointItemService;
import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo;
import com.yeejoin.amos.supervision.common.enums.PlanStatusEnum;
import com.yeejoin.amos.supervision.dao.entity.InputItem;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.RoutePoint;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service("routePointItemService")
public class RoutePointItemServiceImpl implements IRoutePointItemService {
@Autowired
private IRoutePointItemDao routePointItemDao;
@Autowired
private IRoutePointDao routePointDao;
@Autowired
private IPlanDao planDao;
@Autowired
private InputItemMapper inputItemMapper;
@Autowired
private RoutePointItemMapper routePointItemMapper;
@Override
@Transactional
public List<RoutePointItem> addRoutePointItemList(Plan plan, List<Long> inputItemIds, Boolean status, String userId) {
Long planId = plan.getId();
Long routeId = plan.getRouteId();
if (routeId != null && planId != null) {
if (status) {
planDao.updatePlanStatus(PlanStatusEnum.EXAMINE_DEVELOPED.getValue(), planId);
} else {
if (CollectionUtils.isNotEmpty(inputItemIds)) {
List<InputItem> inputItemList = inputItemMapper.findByIdIn(inputItemIds);
List<RoutePoint> routePointList = routePointDao.findByRouteId(routeId);
if (CollectionUtils.isNotEmpty(inputItemList) && CollectionUtils.isNotEmpty(routePointList)) {
List<RoutePointItem> list = new ArrayList<>();
routePointList.stream().forEach(route -> {
Long routePointId = route.getId();
inputItemList.stream().forEach(item -> {
RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setPlanId(planId);
routePointItem.setInputItemId(item.getId());
routePointItem.setBasisJson(item.getBasisJson());
routePointItem.setOrderNo(item.getOrderNo());
routePointItem.setRoutePointId(routePointId);
routePointItem.setCreatorId(userId);
routePointItem.setCreateDate(new Date());
list.add(routePointItem);
});
});
return routePointItemDao.saveAll(list);
}
}
}
}
return Lists.newArrayList();
}
@Override
public Page<RoutePointItemVo> queryPage(InputItemPageParam param) {
long total = routePointItemMapper.queryPageCount(param);
List<RoutePointItemVo> content = routePointItemMapper.queryPage(param);
Page<RoutePointItemVo> result = new PageImpl<RoutePointItemVo>(content, param, total);
return result;
}
@Override
public Integer deleteByIdIn(List<Long> ids) {
if (CollectionUtils.isNotEmpty(ids)) {
return routePointItemDao.deleteByRoutePointItemId(ids);
}
return 0;
}
}
...@@ -294,7 +294,7 @@ public class SynDataServiceImpl implements ISynDataService { ...@@ -294,7 +294,7 @@ public class SynDataServiceImpl implements ISynDataService {
plan.setMinSpace(0); plan.setMinSpace(0);
plan.setIsScore("1"); plan.setIsScore("1");
plan.setError(0); plan.setError(0);
plan.setStatus(Byte.parseByte(XJConstant.PLAN_STATUS_START)); plan.setStatus(Integer.parseInt(XJConstant.PLAN_STATUS_START));
plan.setNextGenDate(DateUtil.getIntervalDate(now, 0)); plan.setNextGenDate(DateUtil.getIntervalDate(now, 0));
plan.setCreateBy(userId.toString()); plan.setCreateBy(userId.toString());
plan.setRemark1(synPlanParam.getRemark()); plan.setRemark1(synPlanParam.getRemark());
...@@ -381,7 +381,7 @@ public class SynDataServiceImpl implements ISynDataService { ...@@ -381,7 +381,7 @@ public class SynDataServiceImpl implements ISynDataService {
public CommonResponse stopPlan(String originalId) { public CommonResponse stopPlan(String originalId) {
Plan plan = iPlanDao.findByOriginalId(originalId); Plan plan = iPlanDao.findByOriginalId(originalId);
if (plan != null) { if (plan != null) {
plan.setStatus(Byte.parseByte(XJConstant.PLAN_STATUS_STOP)); plan.setStatus(Integer.parseInt(XJConstant.PLAN_STATUS_STOP));
iPlanDao.save(plan); iPlanDao.save(plan);
List<PlanTask> planTasks = iplanTaskDao.findByPlanId(plan.getId()); List<PlanTask> planTasks = iplanTaskDao.findByPlanId(plan.getId());
if (!CollectionUtils.isEmpty(planTasks)) { if (!CollectionUtils.isEmpty(planTasks)) {
......
package com.yeejoin.amos.supervision.business.service.intfc; package com.yeejoin.amos.supervision.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.exception.YeeException;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.supervision.business.dto.CheckDto; import com.yeejoin.amos.supervision.business.dto.CheckDto;
import com.yeejoin.amos.supervision.business.dto.CheckRecordDto; import com.yeejoin.amos.supervision.business.dto.CheckRecordDto;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckDetailBo; import com.yeejoin.amos.supervision.business.entity.mybatis.*;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckInfoBo; import com.yeejoin.amos.supervision.business.param.*;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckInputBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckTraListBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.CheckUserBo;
import com.yeejoin.amos.supervision.business.entity.mybatis.PlanRoutePointBo;
import com.yeejoin.amos.supervision.business.param.CheckInfoListPageParam;
import com.yeejoin.amos.supervision.business.param.CheckInfoPageParam;
import com.yeejoin.amos.supervision.business.param.CheckPtListPageParam;
import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import com.yeejoin.amos.supervision.business.param.CheckStatisticalParam;
import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam; import com.yeejoin.amos.supervision.business.util.CheckDetailInputPageParam;
import com.yeejoin.amos.supervision.business.util.Toke; 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.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.common.response.CommonPage; import com.yeejoin.amos.supervision.core.common.response.CommonPage;
import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse; import com.yeejoin.amos.supervision.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.supervision.core.common.response.QueryCriteriaRespone; import com.yeejoin.amos.supervision.core.common.response.QueryCriteriaRespone;
import com.yeejoin.amos.supervision.dao.entity.CheckShot; import com.yeejoin.amos.supervision.dao.entity.CheckShot;
import com.yeejoin.amos.supervision.exception.YeeException;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface ICheckService { public interface ICheckService {
/** /**
...@@ -65,9 +53,9 @@ public interface ICheckService { ...@@ -65,9 +53,9 @@ public interface ICheckService {
*/ */
List<Map> queryUnqualifiedInputItem(int checkId); List<Map> queryUnqualifiedInputItem(int checkId);
AppPointCheckRespone queryCheckPointDetail(String toke,String product,String appKey,long checkId); AppPointCheckRespone queryCheckPointDetail(String toke, String product, String appKey, long checkId);
AppPointCheckRespone queryCheckPointDetailInVersion2(String toke,String product,String appKey,long checkId); AppPointCheckRespone queryCheckPointDetailInVersion2(String toke, String product, String appKey, long checkId);
/** /**
* 巡检统计 * 巡检统计
...@@ -93,7 +81,7 @@ public interface ICheckService { ...@@ -93,7 +81,7 @@ public interface ICheckService {
*/ */
Map<String, Object> queryRecordById(int checkId); Map<String, Object> queryRecordById(int checkId);
List<CheckInfoVo> getCheckInfoList(String toke,String product,String appKey,CheckInfoPageParam param); List<CheckInfoVo> getCheckInfoList(String toke, String product, String appKey, CheckInfoPageParam param);
/** /**
* 查询巡检记录所有图片 * 查询巡检记录所有图片
...@@ -117,7 +105,7 @@ public interface ICheckService { ...@@ -117,7 +105,7 @@ public interface ICheckService {
* @param ids * @param ids
* @return * @return
*/ */
List<CheckInfoVo> getSelectedCheckInfoList(String toke,String product,String appKey,Long[] ids); List<CheckInfoVo> getSelectedCheckInfoList(String toke, String product, String appKey, Long[] ids);
/** /**
* 本月隐患治理趋势统计 * 本月隐患治理趋势统计
...@@ -135,7 +123,7 @@ public interface ICheckService { ...@@ -135,7 +123,7 @@ public interface ICheckService {
* @param userInfo * @param userInfo
* @return * @return
*/ */
QueryCriteriaRespone getQueryCriteriaInit(String toke,String product,String appKey,String loginOrgCode, String roleTypeName, String departmentId, String companyId); QueryCriteriaRespone getQueryCriteriaInit(String toke, String product, String appKey, String loginOrgCode, String roleTypeName, String departmentId, String companyId);
List<HashMap<String, String>> getCalCountChkInfo(HashMap<String, Object> paramMap); List<HashMap<String, String>> getCalCountChkInfo(HashMap<String, Object> paramMap);
...@@ -161,7 +149,8 @@ public interface ICheckService { ...@@ -161,7 +149,8 @@ public interface ICheckService {
* @param param * @param param
* @return * @return
*/ */
List<HashMap<String,Object>> getEquipInputByCheckId(CheckDetailInputPageParam param); List<HashMap<String, Object>> getEquipInputByCheckId(CheckDetailInputPageParam param);
/** /**
* 根据巡检记录ID和巡检点ID获取巡检记录详情 * 根据巡检记录ID和巡检点ID获取巡检记录详情
* *
...@@ -202,7 +191,7 @@ public interface ICheckService { ...@@ -202,7 +191,7 @@ public interface ICheckService {
* @param user * @param user
* @return * @return
*/ */
QueryCriteriaRespone findCheckSystemInit(String toke,String product,String appKey,String type, String orgCode, String roleTypeName, String departmentId, String companyId); QueryCriteriaRespone findCheckSystemInit(String toke, String product, String appKey, String type, String orgCode, String roleTypeName, String departmentId, String companyId);
/** /**
* 巡检记录查询 * 巡检记录查询
...@@ -212,7 +201,7 @@ public interface ICheckService { ...@@ -212,7 +201,7 @@ public interface ICheckService {
*/ */
Page<CheckInfoBo> getCheckInfoList(CheckInfoListPageParam params); Page<CheckInfoBo> getCheckInfoList(CheckInfoListPageParam params);
Page<Map<String, Object>> getCheckInfoList1(String toke,String product,String appKey,CheckInfoListPageParam params); Page<Map<String, Object>> getCheckInfoList1(String toke, String product, String appKey, CheckInfoListPageParam params);
/** /**
* 视图模块初始化数据 * 视图模块初始化数据
...@@ -245,25 +234,27 @@ public interface ICheckService { ...@@ -245,25 +234,27 @@ public interface ICheckService {
*/ */
List<Long> getCheckDataCount(HashMap<String, Object> param); List<Long> getCheckDataCount(HashMap<String, Object> param);
List<String> getCheckPhotosByCheckAndInputId(int checkId, int checkInputId,int classifyId); List<String> getCheckPhotosByCheckAndInputId(int checkId, int checkInputId, int classifyId);
List<String> getLivePhotos(Long checkID); List<String> getLivePhotos(Long checkID);
List<Long> getPlanCheckDataCount(HashMap<String, Object> param); List<Long> getPlanCheckDataCount(HashMap<String, Object> param);
/** /**
* 查询巡检装备 * 查询巡检装备
* *
* @param param * @param param
* @return * @return
*/ */
List<HashMap<String,Object>> getEquipByCheckId(CheckDetailInputPageParam param); List<HashMap<String, Object>> getEquipByCheckId(CheckDetailInputPageParam param);
/** /**
* 最近一次漏检记录 * 最近一次漏检记录
*
* @param relationId 关系id * @param relationId 关系id
* @return CheckRecordDto * @return CheckRecordDto
*/ */
Map<String,CheckRecordDto> obtainLastCheckRecord(String[] relationId); Map<String, CheckRecordDto> obtainLastCheckRecord(String[] relationId);
Page<HashMap<String, Object>> getPlanExecuteInfo(HashMap<String, Object> map, CommonPageable page); Page<HashMap<String, Object>> getPlanExecuteInfo(HashMap<String, Object> map, CommonPageable page);
...@@ -273,6 +264,7 @@ public interface ICheckService { ...@@ -273,6 +264,7 @@ public interface ICheckService {
/** /**
* 保存检查记录 * 保存检查记录
*
* @param recordParam 填写记录 * @param recordParam 填写记录
* @param reginParams 权限信息 * @param reginParams 权限信息
* @return CheckDto * @return CheckDto
...@@ -281,9 +273,12 @@ public interface ICheckService { ...@@ -281,9 +273,12 @@ public interface ICheckService {
/** /**
* 校验是否已经填写过 * 校验是否已经填写过
*
* @param planTaskId * @param planTaskId
* @param pointId * @param pointId
* @return * @return
*/ */
int checkHasRecord(Long planTaskId, Long pointId); int checkHasRecord(Long planTaskId, Long pointId);
Page<CheckVo> queryPage(CheckPageParam criterias);
} }
...@@ -118,4 +118,6 @@ public interface IInputItemService { ...@@ -118,4 +118,6 @@ public interface IInputItemService {
List getItemParent(String id); List getItemParent(String id);
void updatePointById(Map<String, Object> param); void updatePointById(Map<String, Object> param);
Page<InputItemVo> queryPage(InputItemPageParam criterias);
} }
...@@ -76,7 +76,7 @@ public interface IPlanService { ...@@ -76,7 +76,7 @@ public interface IPlanService {
/** /**
* 计划启用停用 * 计划启用停用
*/ */
void setplanstatus(Long id, byte status); void setplanstatus(Long id, Integer status);
/** /**
* 获取计划详情 * 获取计划详情
......
package com.yeejoin.amos.supervision.business.service.intfc;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import org.springframework.data.domain.Page;
import java.util.List;
public interface IRoutePointItemService {
List<RoutePointItem> addRoutePointItemList(Plan plan, List<Long> inputItemIds, Boolean status, String userId);
Page<RoutePointItemVo> queryPage(InputItemPageParam criterias);
Integer deleteByIdIn(List<Long> ids);
}
package com.yeejoin.amos.supervision.business.util; package com.yeejoin.amos.supervision.business.util;
import java.text.SimpleDateFormat; import com.yeejoin.amos.supervision.business.param.CheckPageParam;
import java.util.List;
import com.yeejoin.amos.supervision.business.param.CheckRecordParam; import com.yeejoin.amos.supervision.business.param.CheckRecordParam;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.core.enums.QueryOperatorEnum; import com.yeejoin.amos.supervision.core.enums.QueryOperatorEnum;
import org.springframework.util.ObjectUtils;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
public class CheckParamUtil { public class CheckParamUtil {
public static CheckRecordParam checkCalendar(List<DaoCriteria> daoCriterias){ public static CheckRecordParam checkCalendar(List<DaoCriteria> daoCriterias) {
CheckRecordParam param = new CheckRecordParam(); CheckRecordParam param = new CheckRecordParam();
for(int i=0;i<daoCriterias.size();i++){ for (int i = 0; i < daoCriterias.size(); i++) {
DaoCriteria daoCriteria = daoCriterias.get(i); DaoCriteria daoCriteria = daoCriterias.get(i);
String operator = daoCriteria.getOperator(); String operator = daoCriteria.getOperator();
String name = daoCriteria.getPropertyName(); String name = daoCriteria.getPropertyName();
if("checkTime".equals(name)){ if ("checkTime".equals(name)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
param.setCheckTime(daoCriterias.get(i).getValue().toString()); param.setCheckTime(daoCriterias.get(i).getValue().toString());
}else if("routeId".equals(name)){ } else if ("routeId".equals(name)) {
param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString())); param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString()));
}else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){ } else if ("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())) {
param.setOrgCode(daoCriterias.get(i).getValue().toString()+"%"); param.setOrgCode(daoCriterias.get(i).getValue().toString() + "%");
} }
} }
return param; return param;
} }
public static CheckPageParam fillCheckPageParam(List<CommonRequest> queryRequests, CommonPageable commonPageable,
HashMap<String, Object> perMap) {
CheckPageParam param = new CheckPageParam();
if (queryRequests != null && !queryRequests.isEmpty()) {
for (int i = 0; i < queryRequests.size(); i++) {
String name = queryRequests.get(i).getName();
if (ObjectUtils.isEmpty(queryRequests.get(i).getValue())) {
continue;
}
if ("planId".equals(name)) {
param.setPlanId(Long.parseLong(queryRequests.get(i).getValue().toString()));
} else if ("companyId".equals(name)) {
param.setCompanyId(Long.parseLong(queryRequests.get(i).getValue().toString()));
}
}
}
param.setOrgCode(perMap.get("orgCode").toString());
if (commonPageable != null) {
param.setOffset(Integer.parseInt(String.valueOf(commonPageable.getOffset())));
param.setPageNumber(commonPageable.getPageNumber());
param.setPageSize(commonPageable.getPageSize());
}
return param;
}
} }
package com.yeejoin.amos.supervision.business.util; package com.yeejoin.amos.supervision.business.util;
import java.sql.PreparedStatement;
import java.util.HashMap;
import java.util.List;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam; import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import org.springframework.util.ObjectUtils;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
import com.yeejoin.amos.supervision.core.common.request.CommonRequest; import com.yeejoin.amos.supervision.core.common.request.CommonRequest;
import com.yeejoin.amos.supervision.dao.entity.InputItem; import com.yeejoin.amos.supervision.dao.entity.InputItem;
import org.springframework.util.ObjectUtils;
import java.util.HashMap;
import java.util.List;
public class InputItemParamUtil { public class InputItemParamUtil {
...@@ -58,6 +56,14 @@ public class InputItemParamUtil { ...@@ -58,6 +56,14 @@ public class InputItemParamUtil {
param.setInputClassify(toString(queryRequests.get(i).getValue())); param.setInputClassify(toString(queryRequests.get(i).getValue()));
} else if ("itemClassify".equals(name)) { } else if ("itemClassify".equals(name)) {
param.setItemClassify(toString(queryRequests.get(i).getValue())); param.setItemClassify(toString(queryRequests.get(i).getValue()));
} else if ("checkTypeId".equals(name)) {
param.setCheckTypeId(toString(queryRequests.get(i).getValue()));
} else if ("itemStart".equals(name)) {
param.setItemStart(toString(queryRequests.get(i).getValue()));
} else if ("planId".equals(name)) {
param.setPlanId(Long.parseLong(queryRequests.get(i).getValue().toString()));
} else if ("itemTypeClassifyIds".equals(name)) {
param.setItemTypeClassifyIds(toString(queryRequests.get(i).getValue()));
} }
} }
} }
......
package com.yeejoin.amos.supervision.business.vo;
import lombok.Data;
import java.util.Date;
@Data
public class CheckVo {
/**
* 检查项ID
*/
private Long inputItemId;
/**
* 检查项名称
*/
private String inputItemName;
/**
* 安全隐患个数
*/
private Integer safetyDangerNum;
/**
* 重大隐患个数
*/
private Integer majorDangerNum;
/**
* 检查时间
*/
private Date checkTime;
/**
* 检查人
*/
private String userName;
/**
* 责任单位ID
*/
private String companyId;
/**
* 责任单位
*/
private String companyName;
/**
* 扩展属性
*/
private String ext;
}
...@@ -3,382 +3,402 @@ package com.yeejoin.amos.supervision.business.vo; ...@@ -3,382 +3,402 @@ package com.yeejoin.amos.supervision.business.vo;
import java.util.Date; import java.util.Date;
public class InputItemVo { public class InputItemVo {
private long id ; private long id;
/** /**
* 分类ID * 分类ID
*/ */
private long catalogId; private long catalogId;
private String catalogName; private String catalogName;
/** /**
* 创建者 * 创建者
*/ */
private String createBy; private String createBy;
/** /**
* 配置JSON * 配置JSON
*/ */
private String dataJson; private String dataJson;
/** /**
* 默认值 * 默认值
*/ */
private String defaultValue; private String defaultValue;
/** /**
* 扩展项json * 扩展项json
*/ */
private String inputJson; private String inputJson;
/** /**
* 是否多选 * 是否多选
*/ */
private String isMultiline; private String isMultiline;
/** /**
* 是否必填 * 是否必填
*/ */
private String isMust; private String isMust;
/** /**
* 是否评分 * 是否评分
*/ */
private String isScore; private String isScore;
/** /**
* 检查项类型 * 检查项类型
*/ */
private String itemType; private String itemType;
/** /**
* 检查项名称 * 检查项名称
*/ */
private String name; private String name;
/** /**
* 排序编码 * 排序编码
*/ */
private int orderNo; private int orderNo;
/** /**
* 组织编码 * 组织编码
*/ */
private String orgCode; private String orgCode;
/** /**
* 拍照配置json * 拍照配置json
*/ */
private String pictureJson; private String pictureJson;
private String remark; private String remark;
/** /**
* 是否删除:0表示未删除,1表示已删除 * 是否删除:0表示未删除,1表示已删除
*/ */
private boolean isDelete; private boolean isDelete;
/** /**
* 巡检项等级 * 巡检项等级
*/ */
private String level; private String level;
/** /**
* 巡检项编号s * 巡检项编号s
*/ */
private String itemNo; private String itemNo;
/** /**
* 风险描述 * 风险描述
*/ */
private String riskDesc; private String riskDesc;
/** /**
* 维保项内容 * 维保项内容
*/ */
private String maintenanceContent; private String maintenanceContent;
/** /**
* 测试要求 * 测试要求
*/ */
private String testRequirement; private String testRequirement;
/** /**
* 维保方法 * 维保方法
*/ */
private String checkMethod; private String checkMethod;
/** /**
* 创建时间 * 创建时间
*/ */
private Date createDate; private Date createDate;
/** /**
* 维保项分类 * 维保项分类
*/ */
private String inputClassify; private String inputClassify;
private String checkType; private String checkTypeId;
private String itemParent; private String checkType;
private String itemClassify; private String itemParent;
private String itemTypeClassify; private String itemClassify;
private String itemLevel; private String itemTypeClassify;
private String itemStart; private String itemLevel;
private String itemStart;
public String getCheckType() { /**
return checkType; * 扩展属性
} */
private String ext;
public void setCheckType(String checkType) {
this.checkType = checkType; public String getCheckType() {
} return checkType;
}
public String getItemParent() {
return itemParent; public void setCheckType(String checkType) {
} this.checkType = checkType;
}
public void setItemParent(String itemParent) {
this.itemParent = itemParent; public String getItemParent() {
} return itemParent;
}
public String getItemClassify() {
return itemClassify; public void setItemParent(String itemParent) {
} this.itemParent = itemParent;
}
public void setItemClassify(String itemClassify) {
this.itemClassify = itemClassify; public String getItemClassify() {
} return itemClassify;
}
public String getItemTypeClassify() {
return itemTypeClassify; public void setItemClassify(String itemClassify) {
} this.itemClassify = itemClassify;
}
public void setItemTypeClassify(String itemTypeClassify) {
this.itemTypeClassify = itemTypeClassify; public String getItemTypeClassify() {
} return itemTypeClassify;
}
public String getItemLevel() {
return itemLevel; public void setItemTypeClassify(String itemTypeClassify) {
} this.itemTypeClassify = itemTypeClassify;
}
public void setItemLevel(String itemLevel) {
this.itemLevel = itemLevel; public String getItemLevel() {
} return itemLevel;
}
public String getItemStart() {
return itemStart; public void setItemLevel(String itemLevel) {
} this.itemLevel = itemLevel;
}
public void setItemStart(String itemStart) {
this.itemStart = itemStart; public String getItemStart() {
} return itemStart;
}
public String getInputClassify() {
return inputClassify; public void setItemStart(String itemStart) {
} this.itemStart = itemStart;
}
public void setInputClassify(String inputClassify) {
this.inputClassify = inputClassify; public String getInputClassify() {
} return inputClassify;
}
public Date getCreateDate() {
return createDate; public void setInputClassify(String inputClassify) {
} this.inputClassify = inputClassify;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate; public Date getCreateDate() {
} return createDate;
}
public void setCheckMethod(String checkMethod) {
this.checkMethod = checkMethod; public void setCreateDate(Date createDate) {
} this.createDate = createDate;
}
public String getCheckMethod() {
return checkMethod; public void setCheckMethod(String checkMethod) {
} this.checkMethod = checkMethod;
}
public void setMaintenanceContent(String maintenanceContent) {
this.maintenanceContent = maintenanceContent; public String getCheckMethod() {
} return checkMethod;
}
public void setTestRequirement(String testRequirement) {
this.testRequirement = testRequirement; public void setMaintenanceContent(String maintenanceContent) {
} this.maintenanceContent = maintenanceContent;
}
public String getMaintenanceContent() {
return maintenanceContent;
}
public String getTestRequirement() {
return testRequirement;
}
public String getItemNo() { public void setTestRequirement(String testRequirement) {
return itemNo; this.testRequirement = testRequirement;
} }
public void setItemNo(String itemNo) { public String getMaintenanceContent() {
this.itemNo = itemNo; return maintenanceContent;
} }
public String getLevel() { public String getTestRequirement() {
return level; return testRequirement;
} }
public void setLevel(String level) { public String getItemNo() {
this.level = level; return itemNo;
} }
public long getId() { public void setItemNo(String itemNo) {
return id; this.itemNo = itemNo;
} }
public void setId(long id) { public String getLevel() {
this.id = id; return level;
} }
public long getCatalogId() { public void setLevel(String level) {
return catalogId; this.level = level;
} }
public void setCatalogId(long catalogId) { public long getId() {
this.catalogId = catalogId; return id;
} }
public String getCreateBy() { public void setId(long id) {
return createBy; this.id = id;
} }
public void setCreateBy(String createBy) { public long getCatalogId() {
this.createBy = createBy; return catalogId;
} }
public String getDataJson() { public void setCatalogId(long catalogId) {
return dataJson; this.catalogId = catalogId;
} }
public void setDataJson(String dataJson) { public String getCreateBy() {
this.dataJson = dataJson; return createBy;
} }
public String getDefaultValue() { public void setCreateBy(String createBy) {
return defaultValue; this.createBy = createBy;
} }
public void setDefaultValue(String defaultValue) { public String getDataJson() {
this.defaultValue = defaultValue; return dataJson;
} }
public String getInputJson() { public void setDataJson(String dataJson) {
return inputJson; this.dataJson = dataJson;
} }
public void setInputJson(String inputJson) { public String getDefaultValue() {
this.inputJson = inputJson; return defaultValue;
} }
public String getIsMultiline() { public void setDefaultValue(String defaultValue) {
return isMultiline; this.defaultValue = defaultValue;
} }
public void setIsMultiline(String isMultiline) { public String getInputJson() {
this.isMultiline = isMultiline; return inputJson;
} }
public String getIsMust() { public void setInputJson(String inputJson) {
return isMust; this.inputJson = inputJson;
} }
public void setIsMust(String isMust) { public String getIsMultiline() {
this.isMust = isMust; return isMultiline;
} }
public String getIsScore() { public void setIsMultiline(String isMultiline) {
return isScore; this.isMultiline = isMultiline;
} }
public void setIsScore(String isScore) { public String getIsMust() {
this.isScore = isScore; return isMust;
} }
public String getItemType() { public void setIsMust(String isMust) {
return itemType; this.isMust = isMust;
} }
public void setItemType(String itemType) { public String getIsScore() {
this.itemType = itemType; return isScore;
} }
public String getName() { public void setIsScore(String isScore) {
return name; this.isScore = isScore;
} }
public void setName(String name) { public String getItemType() {
this.name = name; return itemType;
} }
public int getOrderNo() { public void setItemType(String itemType) {
return orderNo; this.itemType = itemType;
} }
public void setOrderNo(int orderNo) { public String getName() {
this.orderNo = orderNo; return name;
} }
public String getOrgCode() { public void setName(String name) {
return orgCode; this.name = name;
} }
public void setOrgCode(String orgCode) { public int getOrderNo() {
this.orgCode = orgCode; return orderNo;
} }
public String getPictureJson() { public void setOrderNo(int orderNo) {
return pictureJson; this.orderNo = orderNo;
} }
public void setPictureJson(String pictureJson) { public String getOrgCode() {
this.pictureJson = pictureJson; return orgCode;
} }
public String getRemark() { public void setOrgCode(String orgCode) {
return remark; this.orgCode = orgCode;
} }
public void setRemark(String remark) { public String getPictureJson() {
this.remark = remark; return pictureJson;
} }
public boolean isDelete() { public void setPictureJson(String pictureJson) {
return isDelete; this.pictureJson = pictureJson;
} }
public void setDelete(boolean isDelete) { public String getRemark() {
this.isDelete = isDelete; return remark;
} }
public String getCatalogName() { public void setRemark(String remark) {
return catalogName; this.remark = remark;
} }
public void setCatalogName(String catalogName) { public boolean isDelete() {
this.catalogName = catalogName; return isDelete;
} }
public InputItemVo() { public void setDelete(boolean isDelete) {
super(); this.isDelete = isDelete;
// TODO Auto-generated constructor stub }
}
public String getRiskDesc() { public String getCatalogName() {
return riskDesc; return catalogName;
} }
public void setRiskDesc(String riskDesc) { public void setCatalogName(String catalogName) {
this.riskDesc = riskDesc; this.catalogName = catalogName;
} }
public InputItemVo() {
super();
// TODO Auto-generated constructor stub
}
public String getRiskDesc() {
return riskDesc;
}
public void setRiskDesc(String riskDesc) {
this.riskDesc = riskDesc;
}
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;
}
} }
package com.yeejoin.amos.supervision.business.vo;
import lombok.Data;
@Data
public class RoutePointItemVo {
private Long id;
/**
* 检查项ID
*/
private Long itemId;
/**
* 检查项名称
*/
private String name;
private String itemType;
private String inputClassify;
private String checkType;
private String itemClassify;
private String itemTypeClassify;
private String itemLevel;
}
\ No newline at end of file
...@@ -53,7 +53,7 @@ public class PersonIdentifyAspect { ...@@ -53,7 +53,7 @@ public class PersonIdentifyAspect {
ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity(); ReginParams.PersonIdentity personIdentity = new ReginParams.PersonIdentity();
if (!ObjectUtils.isEmpty(result)) { if (!ObjectUtils.isEmpty(result)) {
Map map = (Map)result.get(0); Map map = (Map)result.get(0);
Map other = (Map)map.get("other"); Map other = (Map)map.get("DEPARTMENT");
Map person = (Map)map.get("PERSON"); Map person = (Map)map.get("PERSON");
if (!ObjectUtils.isEmpty(person)) { if (!ObjectUtils.isEmpty(person)) {
personIdentity.setPersonSeq((String) person.get("sequenceNbr")); personIdentity.setPersonSeq((String) person.get("sequenceNbr"));
......
spring.application.name=JCS-chenhao spring.application.name=JCS
server.servlet.context-path=/jcs server.servlet.context-path=/jcs
server.port=11100 server.port=11100
spring.profiles.active=dev spring.profiles.active=dev
...@@ -7,10 +7,10 @@ spring.jackson.time-zone=GMT+8 ...@@ -7,10 +7,10 @@ spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml logging.config=classpath:logback-${spring.profiles.active}.xml
## mybatis-plus配置控制台打印完整带参数SQL语句 ## mybatis-plus配置控制台打印完整带参数SQL语句
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
## redis失效时间 ## redis失效时间
redis.cache.failure.time=10800 redis.cache.failure.time=10800
## unit(h) ## unit(h)
...@@ -52,17 +52,21 @@ spring.redis.lettuce.pool.min-idle=0 ...@@ -52,17 +52,21 @@ spring.redis.lettuce.pool.min-idle=0
spring.redis.expire.time=300 spring.redis.expire.time=300
#在重启服务的过程中是否清空缓存的标识符 --2021-09-09 #在重启服务的过程中是否清空缓存的标识符 --2021-09-09
my.spring.redis.cache.isclean=false my.spring.redis.cache.isclean=false
## mqtt-警情初报消息主题 ## mqtt-警情初报消息主题
mqtt.topic.alert.reporting=alertReporting mqtt.topic.alert.reporting=alertReporting
## 实战指挥新警情�?�报主题 ## 实战指挥新警情主题
mqtt.topic.command.alert.notice=alertNotice mqtt.topic.command.alert.notice=alertNotice
## 跑马灯地震,天气预警信息 ## 跑马灯地震、天气预警信息
mqtt.topic.command.meteorological.notice=meteorological mqtt.topic.command.meteorological.notice=meteorological
mqtt.topic.command.power.deployment=power mqtt.topic.command.power.deployment=power
mqtt.topic.alert.iot=iotnews
mqtt.topic.alert.iot.web=iotNewsWeb
security.systemctl.name=AMOS-API-SYSTEMCTL security.systemctl.name=AMOS-API-SYSTEMCTL
jcs.company.topic.add=jcs/company/topic/add jcs.company.topic.add=jcs/company/topic/add
...@@ -70,10 +74,13 @@ jcs.company.topic.delete=jcs/company/topic/delete ...@@ -70,10 +74,13 @@ jcs.company.topic.delete=jcs/company/topic/delete
iot.fegin.name=AMOS-API-IOT iot.fegin.name=AMOS-API-IOT
equip.fegin.name=AMOS-EQUIPMANAGE equip.fegin.name=AMOS-EQUIPMANAGE-kfm
## 设备联动服务(车库门、广播、警铃) ## 设备联动服务(车库门、广播、警铃)
control.fegin.name=JCS-API-CONTROL control.fegin.name=JCS-API-CONTROL
## 故障报修流程 ## 故障报修流程
failure.work.flow.processDefinitionKey=malfunction_repair failure.work.flow.processDefinitionKey=malfunction_repair
\ No newline at end of file #设置文件上传的大小限制
spring.servlet.multipart.maxFileSize=3MB
spring.servlet.multipart.maxRequestSize=3MB
\ No newline at end of file
...@@ -163,7 +163,13 @@ ...@@ -163,7 +163,13 @@
</changeSet> </changeSet>
<changeSet author="litengwei" id="2021-09-01-litengwei-1"> <changeSet author="litengwei" id="2021-09-01-litengwei-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" /> <tableExists tableName="cb_data_dictionary" />
<!-- <sqlCheck expectedResult="0">select count(*) from cb_data_dictionary where sequence_nbr between 1152 and-->
<!-- 1166</sqlCheck>-->
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions> </preConditions>
<comment>add data cb_data_dictionary</comment> <comment>add data cb_data_dictionary</comment>
<sql> <sql>
...@@ -187,6 +193,9 @@ ...@@ -187,6 +193,9 @@
<changeSet author="litengwei" id="2021-09-01-litengwei-2"> <changeSet author="litengwei" id="2021-09-01-litengwei-2">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_form" /> <tableExists tableName="jc_alert_form" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="jc_alert_form"/>
</not>
</preConditions> </preConditions>
<comment>add data jc_alert_form</comment> <comment>add data jc_alert_form</comment>
<sql> <sql>
...@@ -270,6 +279,9 @@ ...@@ -270,6 +279,9 @@
<changeSet author="chenhao" id="2021-09-06-chenhao-1"> <changeSet author="chenhao" id="2021-09-06-chenhao-1">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" /> <tableExists tableName="cb_data_dictionary" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</not>
</preConditions> </preConditions>
<comment>insert data cb_data_dictionary</comment> <comment>insert data cb_data_dictionary</comment>
<sql> <sql>
...@@ -312,6 +324,24 @@ ...@@ -312,6 +324,24 @@
'调派任务状态(执行中:executing,已完成:finished)'; '调派任务状态(执行中:executing,已完成:finished)';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-09-13-chenhao-1">
<comment>update data cb_firefighters_workexperience</comment>
<sql>
ALTER TABLE `cb_firefighters_workexperience` modify working_hours date COMMENT '参加工作时间';
ALTER TABLE `cb_firefighters_workexperience` modify fire_working_hours date COMMENT '参加消防部门工作时间';
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-09-13-kongfm-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_firefighters"/>
</preConditions>
<comment>BUG 3658 优化 by kongfm 2021-09-13 需求详细说明 1. 添加两个字段 2. 地区选择联动 只有新增时带联动 编辑时不带联动 3. 导出模板及导入同步修改</comment>
<sql>
ALTER TABLE `cb_firefighters` add native_place_val varchar(255) COMMENT '户籍所在地详细地址';
ALTER TABLE `cb_firefighters` add residence_detail_val varchar(255) COMMENT '现居住地详细地址';
</sql>
</changeSet>
<changeSet author="chenzhao" id="2021-09-07-chenzhao"> <changeSet author="chenzhao" id="2021-09-07-chenzhao">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
...@@ -428,4 +458,29 @@ ...@@ -428,4 +458,29 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="kongfm" id="2021-09-15-kongfm-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_org_usr"/>
</preConditions>
<comment>BUG 2889 机场单位主键不为long 导致一系列报错,修改主键类型</comment>
<sql>
alter table cb_org_usr MODIFY sequence_nbr BIGINT(32);
</sql>
</changeSet>
<changeSet author="kongfm" id="2021-09-15-kongfm-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_dynamic_form_column" />
<not>
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_dynamic_form_column"/>
</not>
</preConditions>
<comment>优化项958 值班区域字段添加</comment>
<sql>
INSERT INTO cb_dynamic_form_column (sequence_nbr, field_code, field_name, field_type, group_id, query_strategy, not_null, block, group_code, rec_date, is_delete) VALUES ('132828674811007', 'dutyArea', '值班区域', 'input', '132828674811', 'like', b'0', b'0', 'dutyPerson', '2021-09-14 02:29:15', b'0');
INSERT INTO cb_dynamic_form_column (sequence_nbr, field_code, field_name, field_type, group_id, query_strategy, not_null, block, group_code, rec_date, is_delete) VALUES ('132828674811008', 'dutyAreaId', '值班区域Id', 'input', '132828674811', 'eq', b'1', b'0', 'dutyPerson', '2021-09-14 02:29:15', b'0');
INSERT INTO cb_dynamic_form_column (sequence_nbr, field_code, field_name, field_type, group_id, query_strategy, not_null, block, group_code, rec_date, is_delete) VALUES ('132828674810009', 'dutyArea', '值班区域', 'input', '132828674810', 'like', b'0', b'0', 'dutyCar', '2021-09-14 02:29:15', b'0');
INSERT INTO cb_dynamic_form_column (sequence_nbr, field_code, field_name, field_type, group_id, query_strategy, not_null, block, group_code, rec_date, is_delete) VALUES ('132828674810010', 'dutyAreaId', '值班区域Id', 'input', '132828674810', 'eq', b'1', b'0', 'dutyCar', '2021-09-14 02:29:15', b'0');
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -48,3 +48,7 @@ amosRefresh.patrol.topic =patrolCheckInsert ...@@ -48,3 +48,7 @@ amosRefresh.patrol.topic =patrolCheckInsert
management.endpoints.web.exposure.exclude=* management.endpoints.web.exposure.exclude=*
## redis失效时间 ## redis失效时间
redis.cache.failure.time=10800 redis.cache.failure.time=10800
rule.definition.load=false
rule.definition.model-package=com.yeejoin.amos.patrol.business.entity.mybatis
rule.definition.default-agency=STATE_GRID
\ No newline at end of file
...@@ -84,4 +84,41 @@ ...@@ -84,4 +84,41 @@
MODIFY COLUMN `dep_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门名称'; MODIFY COLUMN `dep_name` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '执行部门名称';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="tb" id="tb-202109101731-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_latent_danger" columnName="biz_type"/>
</not>
</preConditions>
<comment>p_latent_danger add COLUMN biz_type '业务类型(不同业务创建的隐患以此区分)'</comment>
<sql>
ALTER TABLE p_latent_danger add COLUMN `biz_type` varchar(30) DEFAULT NULL COMMENT '业务类型(不同业务创建的隐患以此区分)' after
`id`;
</sql>
</changeSet>
<changeSet author="tb" id="tb-202109101731-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_latent_danger" columnName="longitude"/>
</not>
</preConditions>
<comment>p_latent_danger add COLUMN longitude '隐患地址经度'</comment>
<sql>
ALTER TABLE p_latent_danger add COLUMN `longitude` varchar(30) DEFAULT NULL COMMENT '隐患地址经度' after
`danger_position`;
</sql>
</changeSet>
<changeSet author="tb" id="tb-202109101731-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_latent_danger" columnName="latitude"/>
</not>
</preConditions>
<comment>p_latent_danger add COLUMN latitude '隐患地址纬度'</comment>
<sql>
ALTER TABLE p_latent_danger add COLUMN `latitude` varchar(30) DEFAULT NULL COMMENT '隐患地址纬度' after
`longitude`;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -216,4 +216,48 @@ ...@@ -216,4 +216,48 @@
ALTER TABLE `p_check_input` ADD COLUMN `major_danger_num` int(11) DEFAULT NULL COMMENT '重大隐患个数' AFTER `safety_danger_num`; ALTER TABLE `p_check_input` ADD COLUMN `major_danger_num` int(11) DEFAULT NULL COMMENT '重大隐患个数' AFTER `safety_danger_num`;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="gaojianqiang" id="1630567666-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_input_item" columnName="check_type_id"/>
</not>
</preConditions>
<comment>p_input_item ADD COLUMN check_type_id</comment>
<sql>
ALTER TABLE `p_input_item` ADD COLUMN `check_type_id` varchar(32) DEFAULT NULL COMMENT '检查类别字典值';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="1630567666-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_route_point_item" columnName="input_item_id"/>
</not>
</preConditions>
<comment>p_route_point_item ADD COLUMN input_item_id</comment>
<sql>
ALTER TABLE `p_route_point_item` ADD COLUMN `input_item_id` bigint(20) DEFAULT NULL COMMENT '巡检项id';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="1630567666-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_route_point_item" columnName="plan_id"/>
</not>
</preConditions>
<comment>p_route_point_item ADD COLUMN plan_id</comment>
<sql>
ALTER TABLE `p_route_point_item` ADD COLUMN `plan_id` bigint(20) DEFAULT NULL COMMENT '计划ID';
</sql>
</changeSet>
<changeSet author="gaojianqiang" id="1630567666-4">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_input_item" columnName="item_type_classify_ids"/>
</not>
</preConditions>
<comment>p_input_item ADD COLUMN item_type_classify_ids</comment>
<sql>
ALTER TABLE `p_input_item` ADD COLUMN `item_type_classify_ids` varchar(64) DEFAULT NULL COMMENT '检查类别IDS';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -1981,5 +1981,56 @@ ...@@ -1981,5 +1981,56 @@
c.point_id = #{pointId} c.point_id = #{pointId}
and c.plan_task_id = #{planTaskId} and c.plan_task_id = #{planTaskId}
</select> </select>
<select id="queryPageCount" resultType="long">
SELECT
COUNT(1)
FROM
p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id
<where>
<if test="planId != null">
c.plan_id = #{planId}
</if>
<if test="companyId != null">
AND c.company_id = #{companyId}
</if>
<if test="orgCode != null">
c.org_code = #{orgCode}
</if>
</where>
</select>
<select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.CheckVo">
SELECT
i.id,
i.`name`,
ci.safety_danger_num,
ci.major_danger_num,
c.check_time,
c.user_name,
c.company_id,
c.company_name,
IF
( c.check_time IS NULL, 0, 1 ) AS ext
FROM
p_check c
LEFT JOIN p_check_input ci ON ci.check_id = c.id
LEFT JOIN p_input_item i ON i.id = ci.input_id
<where>
<if test="planId != null">
c.plan_id = #{planId}
</if>
<if test="companyId != null">
AND c.company_id = #{companyId}
</if>
<if test="orgCode != null">
c.org_code = #{orgCode}
</if>
ORDER BY c.check_time DESC
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -66,12 +66,14 @@ ...@@ -66,12 +66,14 @@
<result property="checkMethod" column="check_method" /> <result property="checkMethod" column="check_method" />
<result property="createDate" column="create_date" /> <result property="createDate" column="create_date" />
<result property="inputClassify" column="input_classify" /> <result property="inputClassify" column="input_classify" />
<result property="checkTypeId" column="check_type_id" />
<result property="checkType" column="check_type" /> <result property="checkType" column="check_type" />
<result property="itemParent" column="item_parent" /> <result property="itemParent" column="item_parent" />
<result property="itemClassify" column="item_classify" /> <result property="itemClassify" column="item_classify" />
<result property="itemTypeClassify" column="item_type_classify" /> <result property="itemTypeClassify" column="item_type_classify" />
<result property="itemLevel" column="item_level" /> <result property="itemLevel" column="item_level" />
<result property="itemStart" column="item_start" /> <result property="itemStart" column="item_start" />
<result property="ext" column="ext" />
</resultMap> </resultMap>
<!--统计 --> <!--统计 -->
<select id="countInputItemInfoData" resultType="long"> <select id="countInputItemInfoData" resultType="long">
...@@ -80,26 +82,29 @@ ...@@ -80,26 +82,29 @@
FROM FROM
p_input_item a p_input_item a
where a.is_delete = '0' and a.input_type != '1' where a.is_delete = '0' and a.input_type != '1'
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> <if test="name!=null and name!=''"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="inputClassify != null"> and a.input_classify = #{inputClassify}</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="checkTypeId!=null and checkTypeId!=''"> and a.check_type_id = #{checkTypeId} </if>
<if test="itemStart!=null"> and a.item_start = #{itemStart} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if> <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
<if test="itemTypeClassifyIds != null"> and FIND_IN_SET(#{itemTypeClassifyIds}, a.item_type_classify_ids)</if>
order by a.id desc order by a.id desc
</select> </select>
<!--查询 --> <!--查询 -->
<select id="getInputItemInfo" resultMap="inputItemMap"> <select id="getInputItemInfo" resultMap="inputItemMap">
SELECT SELECT
a.id, a.id,
a.name, a.NAME,
a.item_no, a.item_no,
a.item_type, a.item_type,
a.is_must, a.is_must,
a.default_value, a.default_value,
a.is_score, a.is_score,
b.name as catalog_name, b.NAME AS catalog_name,
a.remark, a.remark,
a.level, a.LEVEL,
a.risk_desc, a.risk_desc,
a.maintenance_content, a.maintenance_content,
a.test_requirement, a.test_requirement,
...@@ -111,16 +116,24 @@ ...@@ -111,16 +116,24 @@
a.item_classify, a.item_classify,
a.item_type_classify, a.item_type_classify,
a.item_level, a.item_level,
a.item_start a.item_start,
from IF
p_input_item a left join p_catalog_tree b on a.catalog_id = b.id ( i.input_item_id IS NULL, 0, 1 ) AS ext
where a.is_delete = '0' FROM
and a.input_type != '1' p_input_item a
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if> LEFT JOIN p_catalog_tree b ON a.catalog_id = b.id
LEFT JOIN p_route_point_item i ON a.id = i.input_item_id
WHERE
a.is_delete = '0'
AND a.input_type != '1'
<if test="name!=null and name!=''"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if> <if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if> <if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<!-- <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>--> <if test="checkTypeId!=null and checkTypeId!=''"> and a.check_type_id = #{checkTypeId} </if>
<if test="itemStart!=null"> and a.item_start = #{itemStart} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if> <if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
<if test="itemTypeClassifyIds != null"> and FIND_IN_SET(#{itemTypeClassifyIds}, a.item_type_classify_ids)</if>
order by a.id desc order by a.id desc
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
...@@ -305,4 +318,62 @@ ...@@ -305,4 +318,62 @@
WHERE WHERE
is_delete = 0 is_delete = 0
</select> </select>
<select id="findByIdIn" resultType="com.yeejoin.amos.supervision.dao.entity.InputItem">
SELECT
*
FROM
p_input_item
<where>
is_delete = 0
<if test="list != null and list.size() >0">
AND id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<!--统计 -->
<select id="queryPageCount" resultType="long">
SELECT
count(1) AS total_num
FROM
p_input_item a
WHERE
a.is_delete = '0'
AND a.input_type != '1'
<if test="name!=null and name!=''"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="checkTypeId!=null and checkTypeId!=''"> and a.check_type_id = #{checkTypeId} </if>
<if test="itemStart!=null"> and a.item_start = #{itemStart} </if>
<!--<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>-->
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
<if test="itemTypeClassifyIds != null"> and FIND_IN_SET(#{itemTypeClassifyIds}, a.item_type_classify_ids)</if>
<if test="planId != null">and a.id NOT IN ( SELECT p.input_item_id FROM p_route_point_item p WHERE p.plan_id = #{planId} )</if>
</select>
<!--查询 -->
<select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.InputItemVo">
SELECT
a.*
FROM
p_input_item a
WHERE
a.is_delete = '0'
AND a.input_type != '1'
<if test="name!=null and name!=''"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="checkTypeId!=null and checkTypeId!=''"> and a.check_type_id = #{checkTypeId} </if>
<if test="itemStart!=null"> and a.item_start = #{itemStart} </if>
<!--<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>-->
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
<if test="itemTypeClassifyIds != null"> and FIND_IN_SET(#{itemTypeClassifyIds}, a.item_type_classify_ids)</if>
<if test="planId != null">and a.id NOT IN ( SELECT p.input_item_id FROM p_route_point_item p WHERE p.plan_id = #{planId} )</if>
order by a.id desc
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -119,12 +119,13 @@ ...@@ -119,12 +119,13 @@
WHERE WHERE
a.route_Id = b.id and a.is_delete = 0 a.route_Id = b.id and a.is_delete = 0
<if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if> <if test="planName!=null"> and a.name like concat(concat("%",#{planName}),"%")</if>
<if test="planType!=null"> and a.plan_Type = #{planType}</if> <if test="checkTypeId!=null and checkTypeId != '' "> and a.check_type_id = #{checkTypeId}</if>
<if test="leadPerson!=null and leadPerson != '' "> and a.lead_people_ids = #{leadPerson}</if>
<if test="routeId!=null"> and a.route_Id = #{routeId}</if> <if test="routeId!=null"> and a.route_Id = #{routeId}</if>
<if test="remark!=null"> and a.remark like concat(concat("%",#{remark}),"%")</if> <if test="remark!=null"> and a.remark1 like concat(concat("%",#{remark}),"%")</if>
<if test="deptId!=null"> and a.dept_id = #{deptId}</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if> <if test="userId!=null"> and FIND_IN_SET(#{userId},a.user_id)</if>
<if test="orgCode!=null"> and (a.org_Code like concat (#{orgCode},"-%")or a.org_Code= #{orgCode})</if>
<if test="ownerId!=null"> and b.owner_id = #{ownerId}</if>
</select> </select>
<!--巡检计划查询 --> <!--巡检计划查询 -->
<select id="getPlanInfo" resultType="java.util.HashMap"> <select id="getPlanInfo" resultType="java.util.HashMap">
...@@ -156,6 +157,7 @@ ...@@ -156,6 +157,7 @@
a.maker_user_id as makerUserId, a.maker_user_id as makerUserId,
a.maker_user_name as makerUserName, a.maker_user_name as makerUserName,
a.maker_user_dept_name as makerUserDeptName, a.maker_user_dept_name as makerUserDeptName,
a.check_level as checkLevel,
(select count(1) from p_route_point ppo where ppo.route_id = b.id) as totalPoint, (select count(1) from p_route_point ppo where ppo.route_id = b.id) as totalPoint,
(select count(1) from p_plan_task t where t.plan_id = a.id) as totalPlanTask, (select count(1) from p_plan_task t where t.plan_id = a.id) as totalPlanTask,
(select count(1) from p_plan_task t where t.plan_id = a.id and t.finish_status <![CDATA[<=]]> 1 ) as waitFinishPlanTask (select count(1) from p_plan_task t where t.plan_id = a.id and t.finish_status <![CDATA[<=]]> 1 ) as waitFinishPlanTask
......
...@@ -43,4 +43,41 @@ ...@@ -43,4 +43,41 @@
route_id = #{routeId} route_id = #{routeId}
) )
</delete> </delete>
<!--统计 -->
<select id="queryPageCount" resultType="long">
SELECT
COUNT(1)
FROM
p_route_point_item pi
LEFT JOIN p_input_item i ON i.id = pi.input_item_id
<where>
<if test="name!=null"> and i.name like concat(concat("%",#{name}),"%")</if>
<if test="planId!=null"> and pi.plan_id = #{planId} </if>
<!-- <if test="orgCode!=null"> and i.org_Code = #{orgCode}</if>-->
</where>
</select>
<!--查询 -->
<select id="queryPage" resultType="com.yeejoin.amos.supervision.business.vo.RoutePointItemVo">
SELECT
pi.id,
i.id AS itemId,
i.`name`,
i.item_type,
i.input_classify,
i.check_type,
i.item_classify,
i.item_type_classify,i.item_level
FROM
p_route_point_item pi
LEFT JOIN p_input_item i ON i.id = pi.input_item_id
<where>
<if test="name!=null"> and i.name like concat(concat("%",#{name}),"%")</if>
<if test="planId!=null"> and pi.plan_id = #{planId} </if>
<!-- <if test="orgCode!=null"> and i.org_Code = #{orgCode}</if>-->
</where>
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -25,6 +25,13 @@ ...@@ -25,6 +25,13 @@
<artifactId>spring-boot-starter-data-elasticsearch</artifactId> <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> </project>
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