Commit f65b98a2 authored by tianbo's avatar tianbo

Merge branch 'developer' into developer-latentDanger

# Conflicts: # amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IOrgUsrService.java # amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
parents b8bbe044 bc3c95c7
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "DutyFireFightingDto", description = "微型消防站值班")
public class DutyFireFightingDto implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "单位ID")
private String teamId;
@ApiModelProperty(value = "单位名称")
private String teamName;
@ApiModelProperty(value = "岗位id")
private String postType;
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ApiModelProperty(value = "值班结束时间")
private String endTime;
@ApiModelProperty(value = "微型消防站")
private String fireFighting;
@ApiModelProperty(value = "微型消防站Id")
private String fireFightingId;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import java.io.Serializable;
import java.util.List;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "DutyFireFightingExcleDto", description = "微型消防站值班")
public class DutyFireFightingExcleDto implements Serializable{
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "序号", index = 0)
@ApiModelProperty(value = "序号")
private Integer number;
@ExcelIgnore
@ApiModelProperty(value = "单位ID")
private String teamId;
@ExcelProperty(value = "单位名称", index = 1)
@ApiModelProperty(value = "单位名称")
private String teamName;
@ExcelIgnore
@ApiModelProperty(value = "用户id")
private String userId;
@ExcelProperty(value = "用户名称", index = 2)
@ApiModelProperty(value = "用户名称")
private String userName;
// @ExcelIgnore
// @ApiModelProperty(value = "部门id")
// private String deptId;
// @ExcelIgnore
// @ApiModelProperty(value = "部门名称")
// private String deptName;
@ExcelIgnore
@ApiModelProperty(value = "岗位id")
private String postType;
@ExcelProperty(value = "岗位", index = 3)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
@ExcelProperty(value = "微型消防站", index = 4)
@ApiModelProperty(value = "微型消防站")
private String fireFighting;
@ExcelIgnore
@ApiModelProperty(value = "微型消防站Id")
private String fireFightingId;
@ExcelIgnore
@ApiModelProperty(value = "值班信息")
private List<DutyPersonShiftDto> dutyShift;
@ExcelIgnore
@ApiModelProperty(value = "值班开始时间")
private String startTime;
@ExcelIgnore
@ApiModelProperty(value = "值班结束时间")
private String endTime;
}
...@@ -63,48 +63,51 @@ public class FireExpertsDto extends BaseDto { ...@@ -63,48 +63,51 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "政治面貌") @ApiModelProperty(value = "政治面貌")
private String politicalOutlook; private String politicalOutlook;
@ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getCitys") //固定下拉内容 // @ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getCitys") //固定下拉内容
@ExcelProperty(value = "籍贯", index = 8) @ExcelIgnore
// @ExcelProperty(value = "籍贯", index = 8)
@ApiModelProperty(value = "籍贯") @ApiModelProperty(value = "籍贯")
private String nativePlace; private String nativePlace;
// @ExplicitConstraint(indexNum = 9, sourceClass = RoleNameExplicitConstraint.class, method = "getAdministrativeDivisions") //固定下拉内容 // @ExplicitConstraint(indexNum = 9, sourceClass = RoleNameExplicitConstraint.class, method = "getAdministrativeDivisions") //固定下拉内容
@ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getCitys") //固定下拉内容
@ExcelProperty(value = "籍贯/户口所在地详细地址", index = 9) @ExcelProperty(value = "籍贯/户口所在地详细地址", index = 8)
@ApiModelProperty(value = "籍贯/户口所在地详细地址") @ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal; private String nativePlaceVal;
@ExplicitConstraint(indexNum = 10,sourceClass = CommonExplicitConstraint.class,method ="getCitys") // @ExplicitConstraint(indexNum = 10,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ApiModelProperty(value = "现居住地") @ApiModelProperty(value = "现居住地")
@ExcelProperty(value = "现居住地", index = 10) @ExcelIgnore
//@ExcelProperty(value = "现居住地", index = 10)
private String residence; private String residence;
// @ExcelIgnore
@ExplicitConstraint(indexNum =11,sourceClass = CommonExplicitConstraint.class,method ="getCitys") //@ExplicitConstraint(indexNum =11,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 11) @ExcelProperty(value = "现居住地", index = 10)
@ApiModelProperty(value = "居住地详情") @ApiModelProperty(value = "居住地详情")
private String residenceDetails; private String residenceDetails;
@ExcelProperty(value = "现居住地详细地址", index = 12) @ExplicitConstraint(indexNum =9,sourceClass = CommonExplicitConstraint.class,method ="getCitys")
@ExcelProperty(value = "现居住地", index = 9)
@ApiModelProperty(value = "现居住地详细地址") @ApiModelProperty(value = "现居住地详细地址")
private String residenceDetailVal; private String residenceDetailVal;
@ExcelProperty(value = "办公电话", index = 13) @ExcelProperty(value = "办公电话", index = 11)
@ApiModelProperty(value = "办公电话") @ApiModelProperty(value = "办公电话")
private String officePhone; private String officePhone;
@ExcelProperty(value = "移动电话", index = 14) @ExcelProperty(value = "移动电话", index = 12)
@ApiModelProperty(value = "移动电话") @ApiModelProperty(value = "移动电话")
private String mobilePhone; private String mobilePhone;
@ExplicitConstraint(type = "XLLX", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XLLX", indexNum = 13, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "最高学历", index = 15) @ExcelProperty(value = "最高学历", index = 13)
@ApiModelProperty(value = "最高学历") @ApiModelProperty(value = "最高学历")
private String highestEducation; private String highestEducation;
@ExplicitConstraint(type = "GWMC", indexNum = 16, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "GWMC", indexNum = 14, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 16) @ExcelProperty(value = "岗位名称", index = 14)
@ApiModelProperty(value = "岗位名称") @ApiModelProperty(value = "岗位名称")
private String jobs; private String jobs;
...@@ -112,8 +115,8 @@ public class FireExpertsDto extends BaseDto { ...@@ -112,8 +115,8 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "岗位名称code") @ApiModelProperty(value = "岗位名称code")
private String jobsCode; private String jobsCode;
@ExplicitConstraint(type = "ZJLY", indexNum = 17, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "ZJLY", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防专家领域", index = 17) @ExcelProperty(value = "消防专家领域", index = 15)
@ApiModelProperty(value = "消防专家领域") @ApiModelProperty(value = "消防专家领域")
private String expert; private String expert;
...@@ -147,7 +150,7 @@ public class FireExpertsDto extends BaseDto { ...@@ -147,7 +150,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;
......
...@@ -75,4 +75,7 @@ public class OrgUsrDto extends BaseDto { ...@@ -75,4 +75,7 @@ public class OrgUsrDto extends BaseDto {
@ApiModelProperty(value = "动态表单值") @ApiModelProperty(value = "动态表单值")
private List<DynamicFormInstance> dynamicFormValue; private List<DynamicFormInstance> dynamicFormValue;
@ApiModelProperty(value = "动态表单值-DTO类型")
private List<DynamicFormInstanceDto> dynamicFormValueDto;
} }
...@@ -65,8 +65,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -65,8 +65,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "管理单位id") @ApiModelProperty(value = "管理单位id")
private Long managementUnitId; private Long managementUnitId;
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList") @ExplicitConstraint(indexNum = 9, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "管理单位", index = 5) @ExcelProperty(value = "管理单位", index = 9)
@ApiModelProperty(value = "管理单位") @ApiModelProperty(value = "管理单位")
private String managementUnit; private String managementUnit;
...@@ -74,8 +74,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -74,8 +74,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "维保单位id") @ApiModelProperty(value = "维保单位id")
private Long maintenanceUnitId; private Long maintenanceUnitId;
@ExplicitConstraint(indexNum = 6, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList") @ExplicitConstraint(indexNum = 10, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "维保单位", index = 6) @ExcelProperty(value = "维保单位", index = 10)
@ApiModelProperty(value = "维保单位") @ApiModelProperty(value = "维保单位")
private String maintenanceUnit; private String maintenanceUnit;
...@@ -103,11 +103,11 @@ public class WaterResourceDto extends BaseDto { ...@@ -103,11 +103,11 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "实景图") @ApiModelProperty(value = "实景图")
private String realityImg; private String realityImg;
@ExcelProperty(value = "联系人姓名", index = 9) @ExcelProperty(value = "联系人姓名", index = 41)
@ApiModelProperty(value = "联系人姓名") @ApiModelProperty(value = "联系人姓名")
private String contactUser; private String contactUser;
@ExcelProperty(value = "联系人电话", index = 10) @ExcelProperty(value = "联系人电话", index = 42)
@ApiModelProperty(value = "联系人电话") @ApiModelProperty(value = "联系人电话")
private String contactPhone; private String contactPhone;
...@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源可用状态类别代码") @ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode; private String statusCode;
@ExplicitConstraint(type = "SYKYZT", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "SYZT", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 12) @ExcelProperty(value = "水源可用状态", index = 12)
@ApiModelProperty(value = "水源可用状态类别名称") @ApiModelProperty(value = "水源可用状态类别名称")
private String status; private String status;
...@@ -160,7 +160,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -160,7 +160,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防给水管网形式类型代码") @ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode; private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容 @ExplicitConstraint(type = "XFJSGW", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 15) @ExcelProperty(value = "消防给水管网形式", index = 15)
@ApiModelProperty(value = "消防给水管网形式") @ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName; private String pipeTypeName;
...@@ -254,11 +254,19 @@ public class WaterResourceDto extends BaseDto { ...@@ -254,11 +254,19 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "四季变化简要情况") @ApiModelProperty(value = "四季变化简要情况")
private String seasonChangeInfo; private String seasonChangeInfo;
@ExplicitConstraint(indexNum = 32, source = {"1", "0"}) //固定下拉内容 // @ExplicitConstraint(indexNum = 32, source = {"0", "1"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 32) // @ExcelProperty(value = "有无枯水期", index = 32)
@ExcelIgnore
@ApiModelProperty(value = "有无枯水期") @ApiModelProperty(value = "有无枯水期")
private Boolean hasDrySeason; private Boolean hasDrySeason;
@ExplicitConstraint(indexNum = 32, source = {"有", "无"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 32)
@ApiModelProperty(value = "有无枯水期")
private String hasDrySeasonType;
@ExcelProperty(value = "枯水期跨度简要情况", index = 33) @ExcelProperty(value = "枯水期跨度简要情况", index = 33)
@ApiModelProperty(value = "枯水期跨度简要情况") @ApiModelProperty(value = "枯水期跨度简要情况")
private String dryPeriodSpan; private String dryPeriodSpan;
...@@ -305,8 +313,8 @@ public class WaterResourceDto extends BaseDto { ...@@ -305,8 +313,8 @@ public class WaterResourceDto extends BaseDto {
private Long equipId; private Long equipId;
@ApiModelProperty("设施定义名称") @ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 41) @ExcelProperty(value = "设施定义名称", index = 5)
@ExplicitConstraint(indexNum = 41, sourceClass = CommonExplicitConstraint.class, method = "getEquipDefinition") @ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getEquipDefinition")
private String equipName; private String equipName;
@ExcelIgnore @ExcelIgnore
...@@ -324,7 +332,7 @@ public class WaterResourceDto extends BaseDto { ...@@ -324,7 +332,7 @@ public class WaterResourceDto extends BaseDto {
private String equipCode; private String equipCode;
@ApiModelProperty("维保周期") @ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 42) @ExcelProperty(value = "维保周期(月)", index = 6)
private String maintenancePeriod; private String maintenancePeriod;
......
...@@ -6,270 +6,298 @@ import java.io.OutputStream; ...@@ -6,270 +6,298 @@ import java.io.OutputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.excel.annotation.ExcelProperty; import org.apache.poi.ss.usermodel.BorderStyle;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader; import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.read.metadata.ReadSheet; import com.alibaba.excel.read.metadata.ReadSheet;
import com.alibaba.excel.support.ExcelTypeEnum; import com.alibaba.excel.support.ExcelTypeEnum;
import com.alibaba.excel.write.builder.ExcelWriterSheetBuilder;
import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont; import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
public class ExcelUtil { public class ExcelUtil {
private static final Integer DUTY_CAR_START_INDEX = 5; private static final Integer DUTY_CAR_START_INDEX = 5;
/** /**
* 生成excel模板 * 生成excel模板
* *
* @param response * @param response
* @param fileName 下载的文件名, * @param fileName 下载的文件名,
* @param sheetName sheet名 * @param sheetName sheet名
* @param data 导出的数据 * @param data 导出的数据
* @param model 导出的头 * @param model 导出的头
* @param flag true模板填充下拉 false 不填充 * @param flag true模板填充下拉 false 不填充
*/ */
public static void createTemplate(HttpServletResponse response, String fileName, public static void createTemplate(HttpServletResponse response, String fileName, String sheetName,
String sheetName, List<? extends Object> data, List<? extends Object> data, Class<?> model, DataSources dataDictionaryMapper, boolean flag) {
Class<?> model, DataSources dataDictionaryMapper, boolean flag) {
HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle(); HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle();
try { try {
//下拉列表集合 // 下拉列表集合
Map<Integer, String[]> explicitListConstraintMap = new HashMap<>(); Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
if (flag) { if (flag) {
//循环获取对应列得下拉列表信息 // 循环获取对应列得下拉列表信息
Field[] declaredFields = model.getDeclaredFields(); Field[] declaredFields = model.getDeclaredFields();
for (int i = 0; i < declaredFields.length; i++) { for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i]; Field field = declaredFields[i];
//解析注解信息 // 解析注解信息
ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class); ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class);
resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper); resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper);
} }
} }
EasyExcel.write(getOutputStream(fileName, response, ExcelTypeEnum.XLSX), model) EasyExcel.write(getOutputStream(fileName, response, ExcelTypeEnum.XLSX), model)
.excelType(ExcelTypeEnum.XLSX).sheet(sheetName) .excelType(ExcelTypeEnum.XLSX).sheet(sheetName)
.registerWriteHandler(new TemplateCellWriteHandlerDate(explicitListConstraintMap)) .registerWriteHandler(new TemplateCellWriteHandlerDate(explicitListConstraintMap))
.registerWriteHandler(new TemplateCellWriteHandler()) .registerWriteHandler(new TemplateCellWriteHandler())
.registerWriteHandler(horizontalCellStyleStrategy) .registerWriteHandler(horizontalCellStyleStrategy).doWrite(data);
.doWrite(data); } catch (Exception e) {
} catch (Exception e) { e.printStackTrace();
e.printStackTrace(); throw new RuntimeException("系统异常!");
throw new RuntimeException("系统异常!");
} }
} }
/** /**
* 生成excel模板 * 生成excel模板
* *
* @param response * @param response
* @param fileName 下载的文件名, * @param fileName 下载的文件名,
* @param sheetName sheet名 * @param sheetName sheet名
* @param data 导出的数据 * @param data 导出的数据
* @param model 导出的头 * @param model 导出的头
* @param flag true模板填充下拉 false 不填充 * @param flag true模板填充下拉 false 不填充
*/ */
public static void createDutyTemplate(HttpServletResponse response, String fileName, String sheetName, List<? public static void createDutyTemplate(HttpServletResponse response, String fileName, String sheetName,
extends Object> data, Class<?> model, List<String> dayByMonth, String[] dutyNameList, List<? extends Object> data, Class<?> model, List<String> dayByMonth, String[] dutyNameList,
DataSources dataDictionaryMapper, DataSources dataDictionaryMapper, boolean flag, boolean typeFlag) {
boolean flag) {
HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle(); HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle();
try { try {
// 组装表头 // 组装表头
List<List<String>> dutyCarTitleList = new ArrayList<>(); List<List<String>> dutyCarTitleList = new ArrayList<>();
Field[] declaredFields = model.getDeclaredFields(); Field[] declaredFields = model.getDeclaredFields();
for (int i = 0; i < declaredFields.length; i++) { for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i]; Field field = declaredFields[i];
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class); ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
if (excelProperty != null) { if (excelProperty != null) {
ArrayList<String> head = new ArrayList<>(); ArrayList<String> head = new ArrayList<>();
head.add(excelProperty.value()[0]); head.add(excelProperty.value()[0]);
dutyCarTitleList.add(head); dutyCarTitleList.add(head);
} }
} }
int size = dutyCarTitleList.size(); int size = dutyCarTitleList.size();
if (dayByMonth != null) { if (dayByMonth != null) {
for (int i = 0; i < dayByMonth.size(); i++) { for (int i = 0; i < dayByMonth.size(); i++) {
ArrayList<String> dutyDay = new ArrayList<>(); ArrayList<String> dutyDay = new ArrayList<>();
dutyDay.add(dayByMonth.get(i)); dutyDay.add(dayByMonth.get(i));
dutyCarTitleList.add(dutyDay); dutyCarTitleList.add(dutyDay);
} }
} }
//下拉列表集合 // 下拉列表集合
Map<Integer, String[]> explicitListConstraintMap = new HashMap<>(); Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
if (flag) { if (flag) {
// 组装下拉列表 // 组装下拉列表
for (int i = 0; i < declaredFields.length; i++) { for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i]; Field field = declaredFields[i];
//解析注解信息 // 解析注解信息
ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class); ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class);
resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper); resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper);
} }
if (dayByMonth != null) { if (dayByMonth != null) {
for (int i = 0; i < dayByMonth.size(); i++) { for (int i = 0; i < dayByMonth.size(); i++) {
explicitListConstraintMap.put(size + i, dutyNameList); explicitListConstraintMap.put(size + i, dutyNameList);
} }
} }
} }
// String s = new String(fileName.getBytes(), "UTF-8"); // String s = new String(fileName.getBytes(), "UTF-8");
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8")); // response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8"));
ExcelWriterSheetBuilder excelWriterSheetBuilder = EasyExcel.write(getOutputStream(fileName, response, ExcelWriterSheetBuilder excelWriterSheetBuilder = null;
ExcelTypeEnum.XLSX)).head(dutyCarTitleList).excelType(ExcelTypeEnum.XLSX) ;
.sheet(sheetName).registerWriteHandler(new TemplateCellWriteHandlerDate(explicitListConstraintMap)) if (typeFlag) {
.registerWriteHandler(new TemplateCellWriteHandler()) List<Map<Integer, String[]>> fireStationExplicitListConstraintMap = new ArrayList<Map<Integer, String[]>>();
.registerWriteHandler(horizontalCellStyleStrategy); List<List<Object>> resultList =new ArrayList<List<Object>>();
excelWriterSheetBuilder.doWrite(data); data.stream().forEach(i -> {
} catch (Exception e) { Map<Integer, String[]> map = new HashMap<>();
e.printStackTrace(); List<Object> detail = (List<Object>) i;
throw new RuntimeException("系统异常!"); // 微型消防站中的对应单位微型消防站下拉列表数据的集合
List<String> fireStationDetailList = (List<String>) detail.get(detail.size()-1);
String[] strings = new String[fireStationDetailList.size()];
map.put(4, fireStationDetailList.toArray(strings));
map.putAll(explicitListConstraintMap);
fireStationExplicitListConstraintMap.add(map);
detail.remove(detail.size()-1);
resultList.add(detail);
});
excelWriterSheetBuilder= EasyExcel
.write(getOutputStream(fileName, response, ExcelTypeEnum.XLSX))
.head(dutyCarTitleList)
.excelType(ExcelTypeEnum.XLSX).sheet(sheetName)
.registerWriteHandler(
new TemplateDynamicCellWriteHandlerDate(fireStationExplicitListConstraintMap))
.registerWriteHandler(new TemplateCellWriteHandler())
.registerWriteHandler(horizontalCellStyleStrategy);
excelWriterSheetBuilder.doWrite(resultList);
} else {
excelWriterSheetBuilder= EasyExcel
.write(getOutputStream(fileName, response, ExcelTypeEnum.XLSX))
.head(dutyCarTitleList)
.excelType(ExcelTypeEnum.XLSX).sheet(sheetName)
.registerWriteHandler(
new TemplateCellWriteHandlerDate(explicitListConstraintMap))
.registerWriteHandler(new TemplateCellWriteHandler())
.registerWriteHandler(horizontalCellStyleStrategy);
excelWriterSheetBuilder.doWrite(data);
}
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
} }
} }
/** /**
* 读取 Excel(第一个 sheet) 指定行开始读取 * 读取 Excel(第一个 sheet) 指定行开始读取
* *
* @param excel 文件 * @param excel 文件
* @param rowType 模板实体类 * @param rowType 模板实体类
* @param header 指定不读取的表头行数, * @param header 指定不读取的表头行数,
* @param <T> * @param <T>
* @return 集合数据 * @return 集合数据
* @throws Exception * @throws Exception
*/ */
public static <T> List<T> readFirstSheetExcel(MultipartFile excel, Class<T> rowType, int header) throws Exception { public static <T> List<T> readFirstSheetExcel(MultipartFile excel, Class<T> rowType, int header) throws Exception {
ExcelReader reader = getReader(excel, header); ExcelReader reader = getReader(excel, header);
if (reader == null) { if (reader == null) {
return new ArrayList<>(); return new ArrayList<>();
} }
return readExcel(reader, rowType, 0); return readExcel(reader, rowType, 0);
} }
/**
* 读取 Excel(多个 sheet)
*
* @param reader 读取的excel
* @param rowModel excel模板实体类
* @param sheetCount sheet
* @param <T>
* @return
*/
public static <T> List<T> readExcel(ExcelReader reader, Class<T> rowModel, int sheetCount) {
if (reader == null) {
return new ArrayList<>();
}
ExcelListener<T> excelListener = new ExcelListener<>();
ReadSheet readSheet = EasyExcel.readSheet(sheetCount).head(rowModel).registerReadListener(excelListener)
.build();
reader.read(readSheet);
return excelListener.getList();
}
/** /**
* 读取 Excel(多个 sheet) * @param excel 需要解析的 Excel 文件
* * @param header 指定不读取表头行数,
* @param reader 读取的excel * @return
* @param rowModel excel模板实体类 * @throws Exception
* @param sheetCount sheet */
* @param <T> public static ExcelReader getReader(MultipartFile excel, int header) throws Exception {
* @return String fileName = excel.getOriginalFilename();
*/ if (fileName == null) {
public static <T> List<T> readExcel(ExcelReader reader, Class<T> rowModel, int sheetCount) { throw new Exception("文件不存在!");
if (reader == null) { }
return new ArrayList<>(); if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue())
} && !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
ExcelListener<T> excelListener = new ExcelListener<>(); throw new Exception("文件类型异常!");
ReadSheet readSheet = EasyExcel.readSheet(sheetCount) }
.head(rowModel) InputStream inputStream;
.registerReadListener(excelListener) try {
.build(); inputStream = excel.getInputStream();
reader.read(readSheet); return EasyExcel.read(inputStream).headRowNumber(header).build();
return excelListener.getList(); } catch (IOException e) {
} // do something
}
return null;
}
/**
* 解析注解内容 获取下列表信息
*
* @param explicitConstraint
* @return
*/
public static Map<Integer, String[]> resolveExplicitConstraint(Map<Integer, String[]> explicitListConstraintMap,
ExplicitConstraint explicitConstraint, DataSources dataDictionaryMapper) {
if (explicitConstraint == null) {
return null;
}
// 固定下拉信息
String[] source = explicitConstraint.source();
if (source.length > 0) {
explicitListConstraintMap.put(explicitConstraint.indexNum(), source);
}
// 动态下拉信息
Class<? extends ExplicitInterface>[] classes = explicitConstraint.sourceClass();
if (classes.length > 0) {
ExplicitInterface explicitInterface = null;
try {
explicitInterface = classes[0].newInstance();
String[] source1 = explicitInterface.source(explicitConstraint.type(), explicitConstraint.method(),
dataDictionaryMapper);
if (source1.length > 0) {
explicitListConstraintMap.put(explicitConstraint.indexNum(), source1);
}
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
/** /**
* @param excel 需要解析的 Excel 文件 * 导出文件时为Writer生成OutputStream
* @param header 指定不读取表头行数, */
* @return private static OutputStream getOutputStream(String fileName, HttpServletResponse response,
* @throws Exception ExcelTypeEnum excelTypeEnum) throws Exception {
*/ // 创建本地文件
public static ExcelReader getReader(MultipartFile excel, int header) throws Exception { String filePath = fileName + excelTypeEnum.getValue();
String fileName = excel.getOriginalFilename(); try {
if (fileName == null) { fileName = new String(filePath.getBytes(), "UTF-8");
throw new Exception("文件不存在!"); response.setCharacterEncoding(StandardCharsets.UTF_8.name());
} response.setContentType("application/vnd.ms-excel");
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) { response.addHeader("Content-Disposition", "filename=" + fileName);
throw new Exception("文件类型异常!"); response.setHeader("Content-Disposition",
} "attachment; filename=" + URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()));
InputStream inputStream; return response.getOutputStream();
try { } catch (IOException e) {
inputStream = excel.getInputStream(); throw new Exception("系统异常");
return EasyExcel.read(inputStream). }
headRowNumber(header). }
build();
} catch (IOException e) {
//do something
}
return null;
}
/**
/** * 创建我的cell 策略
* 解析注解内容 获取下列表信息 *
* * @return
* @param explicitConstraint */
* @return public static HorizontalCellStyleStrategy setMyCellStyle() {
*/
public static Map<Integer, String[]> resolveExplicitConstraint(Map<Integer, String[]> explicitListConstraintMap,
ExplicitConstraint explicitConstraint,
DataSources dataDictionaryMapper) {
if (explicitConstraint == null) {
return null;
}
//固定下拉信息
String[] source = explicitConstraint.source();
if (source.length > 0) {
explicitListConstraintMap.put(explicitConstraint.indexNum(), source);
}
//动态下拉信息
Class<? extends ExplicitInterface>[] classes = explicitConstraint.sourceClass();
if (classes.length > 0) {
ExplicitInterface explicitInterface = null;
try {
explicitInterface = classes[0].newInstance();
String[] source1 = explicitInterface.source(explicitConstraint.type(), explicitConstraint.method(),
dataDictionaryMapper);
if (source1.length > 0) {
explicitListConstraintMap.put(explicitConstraint.indexNum(), source1);
}
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
/**
* 导出文件时为Writer生成OutputStream
*/
private static OutputStream getOutputStream(String fileName, HttpServletResponse response,
ExcelTypeEnum excelTypeEnum) throws Exception {
//创建本地文件
String filePath = fileName + excelTypeEnum.getValue();
try {
fileName = new String(filePath.getBytes(),"UTF-8");
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setContentType("application/vnd.ms-excel");
response.addHeader("Content-Disposition", "filename=" + fileName);
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName,
StandardCharsets.UTF_8.name()));
return response.getOutputStream();
} catch (IOException e) {
throw new Exception("系统异常");
}
}
/**
* 创建我的cell 策略
*
* @return
*/
public static HorizontalCellStyleStrategy setMyCellStyle() {
// // 头的策略 // // 头的策略
// WriteCellStyle headWriteCellStyle = new WriteCellStyle(); // WriteCellStyle headWriteCellStyle = new WriteCellStyle();
...@@ -293,41 +321,40 @@ public class ExcelUtil { ...@@ -293,41 +321,40 @@ public class ExcelUtil {
// // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 // // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// return horizontalCellStyleStrategy; // return horizontalCellStyleStrategy;
// 表头样式策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
// 设置表头居中对齐
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// 表头前景色
headWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
WriteFont headWriteFont = new WriteFont();
headWriteFont.setBold(true);
headWriteFont.setFontName("宋体");
headWriteFont.setFontHeightInPoints((short) 10);
headWriteCellStyle.setWriteFont(headWriteFont);
// 表头样式策略 // 2 内容样式策略
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//设置表头居中对齐 WriteFont contentWriteFont = new WriteFont();
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); // 内容字体大小
//表头前景色 contentWriteFont.setFontName("宋体");
headWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); contentWriteFont.setFontHeightInPoints((short) 10);
WriteFont headWriteFont = new WriteFont(); contentWriteCellStyle.setWriteFont(contentWriteFont);
headWriteFont.setBold(true); // 设置自动换行
headWriteFont.setFontName("宋体"); contentWriteCellStyle.setWrapped(true);
headWriteFont.setFontHeightInPoints((short) 10); // 设置垂直居中
headWriteCellStyle.setWriteFont(headWriteFont); contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
// 头默认了 FillPatternType所以可以不指定。
//2 内容样式策略 // contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); // 设置水平居中
WriteFont contentWriteFont = new WriteFont(); contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
//内容字体大小
contentWriteFont.setFontName("宋体");
contentWriteFont.setFontHeightInPoints((short) 10);
contentWriteCellStyle.setWriteFont(contentWriteFont);
//设置自动换行
contentWriteCellStyle.setWrapped(true);
//设置垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
// 头默认了 FillPatternType所以可以不指定。
// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
//设置水平居中
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
//设置边框样式 // 设置边框样式
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderTop(BorderStyle.THIN); contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.THIN); contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN); contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
} }
} }
package com.yeejoin.amos.boot.module.common.api.excel;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.poi.ss.usermodel.DataValidation;
import org.apache.poi.ss.usermodel.DataValidationConstraint;
import org.apache.poi.ss.usermodel.DataValidationHelper;
import org.apache.poi.ss.usermodel.Name;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
public class TemplateDynamicCellWriteHandlerDate implements SheetWriteHandler{
/**
* 构造器注入
*/
private List<Map<Integer, String[]>> explicitListConstraintMap = new ArrayList<Map<Integer, String[]>>();
public TemplateDynamicCellWriteHandlerDate(List<Map<Integer, String[]>> explicitListConstraintMap) {
this.explicitListConstraintMap = explicitListConstraintMap;
}
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 0;
/**
* 返回excel列标A-Z-AA-ZZ
*
* @param num 列数
* @return java.lang.String
*/
private String getExcelLine(int num) {
String line = "";
int first = num / 26;
int second = num % 26;
if (first > 0) {
line = (char) ('A' + first - 1) + "";
}
line += (char) ('A' + second) + "";
return line;
}
@Override
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
// TODO Auto-generated method stub
}
@Override
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
if(explicitListConstraintMap!=null) {
// 这里可以对cell进行任何操作
Sheet sheet = writeSheetHolder.getSheet();
DataValidationHelper helper = sheet.getDataValidationHelper();
for(int index =0 ; index < explicitListConstraintMap.size() ;index++ ) {
int startIndex = index+1;
explicitListConstraintMap.get(index).forEach((k, v)->{
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(startIndex, startIndex, k, k);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if (v.length > LIMIT_NUMBER) {
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String sheetName = "hidden" +startIndex + k;
Workbook workbook = writeWorkbookHolder.getWorkbook();
Sheet hiddenSheet = workbook.createSheet(sheetName);
for (int i = 0, length = v.length; i < length; i++) {
// 开始的行数i,列数k
hiddenSheet.createRow(i).createCell(k).setCellValue(v[i]);
}
Name category1Name = workbook.createName();
category1Name.setNameName(sheetName);
String excelLine = getExcelLine(k);
// =hidden!$H:$1:$H$50 sheet为hidden的 H1列开始H50行数据获取下拉数组
String refers = "=" + sheetName + "!$" + excelLine + "$1:$" + excelLine + "$" + (v.length + 1);
// 将刚才设置的sheet引用到你的下拉列表中
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
DataValidation dataValidation = helper.createValidation(constraint, rangeList);
if(dataValidation instanceof XSSFDataValidation){
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
}else{
dataValidation.setSuppressDropDownArrow(false);
}
writeSheetHolder.getSheet().addValidationData(dataValidation);
// 设置存储下拉列值得sheet为隐藏
int hiddenIndex = workbook.getSheetIndex(sheetName);
if (!workbook.isSheetHidden(hiddenIndex)) {
workbook.setSheetHidden(hiddenIndex, true);
}
}
});
}
}
}
}
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
import java.text.ParseException; import java.text.ParseException;
import java.util.List; import java.util.List;
...@@ -86,4 +87,33 @@ public interface IDutyCommonService { ...@@ -86,4 +87,33 @@ public interface IDutyCommonService {
* @return * @return
*/ */
List<Long> getDutyShiftIdList(); List<Long> getDutyShiftIdList();
/**
* 添加动态表单数据保存的方法,返回保存数据的instanceid
* @param userId
* @param map
* @param groupCode
* @return
*/
public Long excuteDynamicFormInstance( String userId,Map<String, Object> map, String groupCode);
/**
* 修改动态表单数据
* @param groupCode
* @param instanceId
* @param map
*/
public void updateDynamicFormInstance(String groupCode,Long instanceId, Map<String, Object> map) ;
/**
* 保存值班人的信息---
* @param instanceId
* @param dutyShift
* @param startTime
*/
public void saveDutyPersonShiftDetail( Long instanceId ,List<DutyPersonShiftDto> dutyShift ,String startTime) ;
/**
* 添加值班人的信息 可以保存空信息
* @param instanceId
* @param dutyShiftList
*/
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList);
} }
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
public interface IDutyFireFightingService extends IDutyCommonService {
/**
* 值班信息保存
* @param DutyFireFightingDto 对象
* @return List<DutyCarDto>
*/
DutyFireFightingDto save(DutyFireFightingDto dto);
/**
* 更新
* @param instanceId 实例id
* @param DutyFireFightingDto 业务对象
* @return List<DutyCarDto>
*/
DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto);
}
...@@ -224,4 +224,11 @@ public interface IOrgUsrService { ...@@ -224,4 +224,11 @@ public interface IOrgUsrService {
* @return * @return
*/ */
String getAmosIdByOrgUserId(String orgUserId) throws Exception; String getAmosIdByOrgUserId(String orgUserId) throws Exception;
/**
* 查询目标公司下所有人员的简要信息,数据包含:所在公司id和name ,人员id和name,岗位id和name
* @param ids
* @return
*/
List<Map<String, Object>> getPersonDetailByCompanyIds(List<String> ids);
} }
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
r.contact_user, r.contact_user,
r.contact_phone, r.contact_phone,
r.equip_name, r.equip_name,
r.longitude,
r.latitude,
r.equip_category_name, r.equip_category_name,
r.equip_code, r.equip_code,
r.maintenance_period, r.maintenance_period,
...@@ -45,6 +47,7 @@ ...@@ -45,6 +47,7 @@
rn.quality_situation_info, rn.quality_situation_info,
rn.season_change_info, rn.season_change_info,
rn.has_dry_season, rn.has_dry_season,
(case rn.has_dry_season when 0 then '有' when 1 then '无' end) hasDrySeasonType,
rn.dry_period_span, rn.dry_period_span,
rp.intake_height, rp.intake_height,
rp.elevation_difference, rp.elevation_difference,
......
...@@ -25,8 +25,8 @@ public enum ExcelEnums { ...@@ -25,8 +25,8 @@ public enum ExcelEnums {
// 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","消防装备") XFZB ("消防装备", "消防装备", "com.yeejoin.amos.boot.module.common.api.dto.EquipmentDetailDownloadTemplateDto","XFZB"),//("XFZB","消防装备")
WXXFZB("微型消防站值班", "微型消防站值班", "com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingExcleDto","WXXFZB");//("WXXFZB","微型消防站值班")
private String fileName; private String fileName;
private String sheetName; private String sheetName;
private String classUrl; private String classUrl;
......
...@@ -28,7 +28,7 @@ public class DispatchConsultFeedbackDto extends BaseDto { ...@@ -28,7 +28,7 @@ public class DispatchConsultFeedbackDto extends BaseDto {
private String emergencyCall; private String emergencyCall;
@ApiModelProperty(value = "投诉反馈方式") @ApiModelProperty(value = "投诉反馈方式")
private String consultFeedbackType; private String consultFeedbackCode;
@ApiModelProperty(value = "投诉反馈结果") @ApiModelProperty(value = "投诉反馈结果")
private String feedbackResult; private String feedbackResult;
......
...@@ -28,7 +28,7 @@ public class DispatchRepairFeedbackDto extends BaseDto { ...@@ -28,7 +28,7 @@ public class DispatchRepairFeedbackDto extends BaseDto {
private String emergencyCall; private String emergencyCall;
@ApiModelProperty(value = "报修反馈方式") @ApiModelProperty(value = "报修反馈方式")
private String fixFeedbackType; private String fixFeedbackCode;
@ApiModelProperty(value = "报修反馈结果") @ApiModelProperty(value = "报修反馈结果")
private String feedbackResult; private String feedbackResult;
......
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 微信公众号维修反馈dto 类
*/
@Data
@ApiModel(value="WechatUserFeedbackDto", description="微信公众号上报人反馈DTO")
public class WechatUserFeedbackDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id")
private Long alertId;
@ApiModelProperty(value = "结果评价")
private String feedBackResult;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "现场照片")
private List<AttachmentDto> imgs;
}
...@@ -19,9 +19,9 @@ public enum AlertStageEnums { ...@@ -19,9 +19,9 @@ public enum AlertStageEnums {
TSZX("962","TSZX", "投诉咨询"), TSZX("962","TSZX", "投诉咨询"),
// 来源类型JQLYLX // 来源类型JQLYLX
DHBJ("963","233","电话报警"), DHBJ("963","96333","电话报警"),
// 来源类型JQLYLX WLJR("1014","WLJR","物联接入"),
GZHSB("972","APPJJ","移动端上报"), APPJJ("1015","APPJJ","移动端上报"),
// 警情阶段 JQJD // 警情阶段 JQJD
JJ("964","JJ","接警"), JJ("964","JJ","接警"),
......
...@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> { ...@@ -22,11 +22,7 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
Long sequenceNbr, Long sequenceNbr,
int current, int size); int current, int size);
List<ElevatorWlInfoDto> queryElevatorListDetails(String address, List<ElevatorWlInfoDto> queryElevatorListDetails(
String registerCode,
Integer rescueCode,
String type,
Integer dealStatus,
Long sequenceNbr Long sequenceNbr
); );
......
...@@ -5,8 +5,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto; ...@@ -5,8 +5,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto; import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatUserFeedbackDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -46,5 +48,7 @@ public interface IDispatchTaskService { ...@@ -46,5 +48,7 @@ public interface IDispatchTaskService {
List<MainPersonDto> todayTaskPerson(); List<MainPersonDto> todayTaskPerson();
WechatMyBussinessDto saveUserFeed(WechatUserFeedbackDto wechatUserFeedbackDto);
} }
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
</select> </select>
<select id="getImportantEventDetail" resultType="java.util.Map"> <select id="getImportantEventDetail" resultType="java.util.Map">
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
<select id="getTodayEmergencyDetail" resultType="java.util.Map"> <select id="getTodayEmergencyDetail" resultType="java.util.Map">
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
union all union all
select tzs.contact_phone,tzs.rec_user_name, select tzs.contact_phone,tzs.rec_user_name,
tzs.type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address, tzs.alert_stage as type,tzs.emergency_person,tzs.alarm_type,tzs.alert_source,tzs.address,
tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time, tzs.device_id,tzs.contact_user,tzs.alarm_type_code,tzs.sequence_nbr,date_format(tzs.call_time,"%Y-%m-%d %H:%i:%S") call_time,
tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id tzs.rec_user_id,tzs.registration_code,tzs.emergency_call,tzs.type_code,tzs.equipment_id
,te.latitude ,te.region_code ,te.longitude,tzs.injured from ( ,te.latitude ,te.region_code ,te.longitude,tzs.injured from (
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
select select
te.sequence_nbr sequenceNbr, te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area, concat(te.province,te.city,te.district) area,
te.category, te.device_category category,
te.register_code registerCode, te.register_code registerCode,
te.rescue_code rescueCode, te.rescue_code rescueCode,
te.address , te.address ,
tea.start_date happenTime, te.start_date happenTime,
tea.type , te.type ,
case tea.deal_status case te.deal_status
when '0' then '处置完成' when '0' then '处置完成'
when '1' then '故障发生' when '1' then '故障发生'
when '2' then '发出通知' when '2' then '发出通知'
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
ELSE '' END dealStatus, ELSE '' END dealStatus,
'电梯' categoryName, '电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider '立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
<if test="address != null and address != ''"> <if test="address != null and address != ''">
and te.address like CONCAT(CONCAT('%',#{address}),'%') and te.address like CONCAT(CONCAT('%',#{address}),'%')
...@@ -34,14 +33,15 @@ ...@@ -34,14 +33,15 @@
and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%') and te.rescue_code like CONCAT(CONCAT('%',#{rescueCode}),'%')
</if> </if>
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and tec.type = #{type} and te.type = #{type}
</if> </if>
<if test="dealStatus != null and dealStatus != ''">sequenceNbr <if test="dealStatus != null and dealStatus != ''">
and tec.deal_status = #{dealStatus} and te.deal_status = #{dealStatus}
</if> </if>
<if test="sequenceNbr != null and sequenceNbr != ''"> <if test="sequenceNbr != null and sequenceNbr != ''">
and te.sequence_nbr = #{sequenceNbr} and te.sequence_nbr = #{sequenceNbr}
</if> </if>
group by register_code
order by start_date DESC limit #{current},#{size} order by start_date DESC limit #{current},#{size}
</select> </select>
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
select select
te.sequence_nbr sequenceNbr, te.sequence_nbr sequenceNbr,
concat(te.province,te.city,te.district) area, concat(te.province,te.city,te.district) area,
te.category, te.device_category category,
te.register_code registerCode, te.register_code registerCode,
te.rescue_code rescueCode, te.rescue_code rescueCode,
te.address , te.address ,
tea.start_date happenTime, te.start_date happenTime,
tea.type , te.type ,
case tea.deal_status case te.deal_status
when '0' then '处置完成' when '0' then '处置完成'
when '1' then '故障发生' when '1' then '故障发生'
when '2' then '发出通知' when '2' then '发出通知'
...@@ -65,8 +65,7 @@ ...@@ -65,8 +65,7 @@
ELSE '' END dealStatus, ELSE '' END dealStatus,
'电梯' categoryName, '电梯' categoryName,
'立信远大科技有限公司' IotServiceProvider '立信远大科技有限公司' IotServiceProvider
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
<if test="sequenceNbr != null and sequenceNbr != ''"> <if test="sequenceNbr != null and sequenceNbr != ''">
and te.sequence_nbr = #{sequenceNbr} and te.sequence_nbr = #{sequenceNbr}
...@@ -77,9 +76,9 @@ ...@@ -77,9 +76,9 @@
select count(1) from ( select count(1) from (
select select
te.sequence_nbr te.sequence_nbr
from tcb_elevator te inner join tz_elevator_alarm tea on from tz_elevator_alarm te
te.register_code = tea.register_code
where 1=1 where 1=1
group by register_code order by start_date desc
) te ) te
</select> </select>
......
...@@ -33,7 +33,7 @@ import java.util.Map; ...@@ -33,7 +33,7 @@ import java.util.Map;
@Api(tags = "值班车辆接口Api") @Api(tags = "值班车辆接口Api")
@RequestMapping(value = "/common/duty-car") @RequestMapping(value = "/common/duty-car")
public class DutyCarController extends BaseController { public class DutyCarController extends BaseController {
@Autowired @Autowired
IDutyCarService iDutyCarService; IDutyCarService iDutyCarService;
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@Api(tags = "微型消防站值班接口Api")
@RequestMapping(value = "/common/duty-FireFighting")
public class DutyFireFightingController extends BaseController{
@Autowired
IDutyFireFightingService iDutyFireFightingService;
/**
* 值班列表视图--分页
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page-list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-分页", notes = "值班列表视图-分页")
public ResponseModel<IPage<Map<String, Object>>> pageList(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页面大小", required = true) @RequestParam(value = "size") int size) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.pageList(current, size, beginDate, endDate));
}
/**
* 值班列表视图--不分页
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-不分页", notes = "值班列表视图-不分页")
public ResponseModel list(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.list(null,beginDate, endDate));
}
/**
* 值班月视图
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/statistics-day")
@ApiOperation(httpMethod = "GET", value = "值班月视图", notes = "值班月视图")
public ResponseModel<List<Map<String, Object>>> dutyDetail(
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate
) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.statisticsDay(beginDate, endDate));
}
/**
* 调班
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping("/duty-adjust")
@ApiOperation(httpMethod = "POST", value = "调班保存", notes = "调班保存")
public ResponseModel dutyAdjustSave(@RequestBody DutyFireFightingDto dto) {
return ResponseHelper.buildResponse(iDutyFireFightingService.save(dto));
}
/**
* 调班
*
* @param instanceId 实例id
* @param dutyCarDto 业务对象
* @return DutyCarDto
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping("/duty-adjust")
@ApiOperation(httpMethod = "PUT", value = "调班更新", notes = "调班更新")
public ResponseModel dutyAdjustUpdate(
@RequestParam Long instanceId,
@RequestBody DutyFireFightingDto dto) {
return ResponseHelper.buildResponse(iDutyFireFightingService.update(instanceId, dto));
}
/**
* 微型消防站导出
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "微型消防站导出", notes = "微型消防站导出")
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyFireFightingService.downloadList(beginDate, endDate));
}
/**
* 值班数据删除
*
* @param instanceId 实例id
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping("/{instanceId}/{startTime}/{endTime}")
@ApiOperation(httpMethod = "DELETE", value = "值班数据删除", notes = "值班数据删除")
public ResponseModel deleteDutyData(@PathVariable Long instanceId,@PathVariable String startTime,@PathVariable String endTime) {
if (ValidationUtil.isEmpty(instanceId)
|| ValidationUtil.isEmpty(startTime)
|| ValidationUtil.isEmpty(endTime)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(iDutyFireFightingService.deleteDutyData(instanceId, startTime, endTime));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定日期值班人信息列表")
@GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
@ApiParam(value = "班次id") @RequestParam(required = false) Long shiftId,
@ApiParam(value = "岗位") @RequestParam(required = false) String postType){
return ResponseHelper.buildResponse(iDutyFireFightingService.dayDutyPersonList(dutyDay,shiftId,postType));
}
}
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import java.text.ParseException;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -17,11 +23,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest; ...@@ -17,11 +23,14 @@ 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.HttpServletRequest; import com.baomidou.mybatisplus.core.metadata.IPage;
import javax.servlet.http.HttpServletResponse; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.text.ParseException; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.List; import com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
/** /**
......
...@@ -55,7 +55,7 @@ public class FireExpertsController extends BaseController { ...@@ -55,7 +55,7 @@ public class FireExpertsController extends BaseController {
@Autowired @Autowired
DataDictionaryServiceImpl dataDictionaryService; DataDictionaryServiceImpl dataDictionaryService;
/** /**
...@@ -67,6 +67,9 @@ public class FireExpertsController extends BaseController { ...@@ -67,6 +67,9 @@ public class FireExpertsController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<FireExpertsDto> save(@RequestBody FireExpertsDto model) { public ResponseModel<FireExpertsDto> save(@RequestBody FireExpertsDto model) {
String expertCode = model.getExpertCode();
DataDictionary zjly = dataDictionaryService.getByCode(expertCode, "ZJLY");
model.setExpert(zjly.getName());
model = fireExpertsServiceImpl.createWithModel(model); model = fireExpertsServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
......
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.Arrays; import java.util.Arrays;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
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.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -57,6 +59,9 @@ public class FirefightersPostController extends BaseController { ...@@ -57,6 +59,9 @@ public class FirefightersPostController extends BaseController {
@Autowired @Autowired
FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService; FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService;
@Autowired @Autowired
DataDictionaryServiceImpl dataDictionaryService;
@Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
...@@ -81,6 +86,13 @@ public class FirefightersPostController extends BaseController { ...@@ -81,6 +86,13 @@ public class FirefightersPostController extends BaseController {
queryWrapper.eq("firefighters_id", firefightersDataDto.getFirefightersPost().getFirefightersId()); queryWrapper.eq("firefighters_id", firefightersDataDto.getFirefightersPost().getFirefightersId());
FirefightersPost firefightersPost = iFirefightersPostService.getOne(queryWrapper); FirefightersPost firefightersPost = iFirefightersPostService.getOne(queryWrapper);
/*bug3071 消防人员,专家领域选择子分类时概要信息中专家领域未显示 2021-10-09 chenzhao */
if (firefightersDataDto.getFirefightersPost().getAreasExpertiseCode() != null){
String areasExpertiseCode = firefightersDataDto.getFirefightersPost().getAreasExpertiseCode();
DataDictionary zjly = dataDictionaryService.getByCode(areasExpertiseCode, "ZJLY");
firefightersDataDto.getFirefightersPost().setAreasExpertise(zjly.getName());
}
/*bug3071 消防人员,专家领域选择子分类时概要信息中专家领域未显示 2021-10-09 chenzhao */
if (firefightersPost == null) { if (firefightersPost == null) {
iFirefightersPostService.save(firefightersDataDto.getFirefightersPost()); iFirefightersPostService.save(firefightersDataDto.getFirefightersPost());
} else { } else {
......
...@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; ...@@ -12,8 +12,10 @@ import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.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.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr; import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.FireTeamMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService; import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -51,6 +53,10 @@ public class OrgUsrController extends BaseController { ...@@ -51,6 +53,10 @@ public class OrgUsrController extends BaseController {
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired @Autowired
ESOrgUsrService eSOrgUsrService; ESOrgUsrService eSOrgUsrService;
@Autowired
FireTeamMapper fireTeamMapper;
@Autowired @Autowired
EmqKeeper emqKeeper; EmqKeeper emqKeeper;
@Value("${jcs.company.topic.delete}") @Value("${jcs.company.topic.delete}")
...@@ -85,19 +91,16 @@ public class OrgUsrController extends BaseController { ...@@ -85,19 +91,16 @@ public class OrgUsrController extends BaseController {
public ResponseModel<String> deleteById(HttpServletRequest request, @PathVariable Long id) { public ResponseModel<String> deleteById(HttpServletRequest request, @PathVariable Long id) {
// 删除时,只作逻辑删除 // 删除时,只作逻辑删除
// BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm // BUG 2741 首先判断是否为公司 如果公司底下有人员不可直接删除 bykongfm
OrgUsr tempOrg = iOrgUsrService.getById(id.toString());
if(tempOrg.getBizOrgType().equals("COMPANY")) {
List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false));
if(tempList.size() > 0) {
return ResponseHelper.buildResponse("-1");
}
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start //bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
if(tempOrg.getBizOrgType().equals("DEPARTMENT")) { OrgUsr tempOrg = iOrgUsrService.getById(id.toString());
if(tempOrg.getBizOrgType().equals("COMPANY") || tempOrg.getBizOrgType().equals("DEPARTMENT")) {
List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false)); List<OrgUsr> tempList = iOrgUsrService.list(new LambdaQueryWrapper<OrgUsr>().eq(OrgUsr::getParentId,id).eq(OrgUsr::getIsDelete,false));
if(tempList.size() > 0) { /*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 start*/
List<FireTeam> fireTeams = fireTeamMapper.listFireTeamById(id);
if(tempList.size() > 0 || fireTeams.size() > 0 ) {
return ResponseHelper.buildResponse("-1"); return ResponseHelper.buildResponse("-1");
} }
/*bug3031 删除机场单位后,队伍所属单位字段数据未清空 2021-10-09 end*/
} }
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end //bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01)); // iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
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.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;
...@@ -12,23 +29,6 @@ import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; ...@@ -12,23 +29,6 @@ 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.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -58,14 +58,6 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -58,14 +58,6 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
public DutyCarDto save(DutyCarDto dutyCarDto) { public DutyCarDto save(DutyCarDto dutyCarDto) {
// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 // BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14
//1.保存行数据 //1.保存行数据
String groupCode = this.getGroupCode();
String userId = dutyCarDto.getUserId();
List<DynamicFormInstance> instances = dynamicFormInstanceService
.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null;
if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) { if(StringUtils.isNotEmpty(dutyCarDto.getDutyAreaId())) {
// 根据建筑id 查找建筑 // 根据建筑id 查找建筑
ResponseModel<Map<String, Object>> response = null; ResponseModel<Map<String, Object>> response = null;
...@@ -78,102 +70,28 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -78,102 +70,28 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
dutyCarDto.setDutyArea(result.get("name").toString()); dutyCarDto.setDutyArea(result.get("name").toString());
} }
Map<String, Object> map = Bean.BeantoMap(dutyCarDto); Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
if (!instances.isEmpty()) {
// 0.定位instanceId,准备进行更新操作 // 修改操作动态表单的方法,修改人陈浩 -------------start 2021-09-28
instanceId = instances.get(0).getInstanceId(); // 已经有了走更新方法 Long instanceId =excuteDynamicFormInstance(dutyCarDto.getUserId(),map,this.getGroupCode());
//1.查询已有数据 saveDutyPersonShiftDetail( instanceId ,dutyCarDto.getDutyShift() ,dutyCarDto.getStartTime()) ;
List<DynamicFormInstance> hasInstances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); insertPersonShift(instanceId, dutyCarDto.getDutyShift());
//2.list 转 map // 修改操作动态表单的方法,修改人陈浩 -------------end 2021-09-28
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(hasInstances, "fieldCode", DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
for (DynamicFormColumn column : columns) {
DynamicFormInstance formInstance = instanceMap.get(column.getFieldCode());
if (!ObjectUtils.isEmpty(formInstance)) {
//有的更新
formInstance.setFieldValue(map.get(column.getFieldCode()) != null ? map.get(column.getFieldCode()).toString() : "");
} else {
//没有的新增
formInstance = new DynamicFormInstance();
buildFormInstanceData(instanceId, map, column, formInstance);
}
entrys.add(formInstance);
}
if(!entrys.isEmpty()){
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
} else {
instanceId = dynamicFormInstanceService.commonSave(groupCode,map);
}
if(dutyCarDto.getDutyShift() != null && dutyCarDto.getDutyShift().size() == 0) {
Calendar startDate = Calendar.getInstance();
startDate.setTime(DateUtils.longStr2Date(dutyCarDto.getStartTime()));
int dates = startDate.getActualMaximum(Calendar.DAY_OF_MONTH);
startDate.set(Calendar.DAY_OF_MONTH, 1);
List<DutyPersonShift> dutyShift = new ArrayList<>(dates);
for (int i = 0 ; i < dates ; i ++) {
DutyPersonShift temp = new DutyPersonShift();
temp.setAppKey(RequestContext.getAppKey());
temp.setDutyDate(startDate.getTime());
temp.setIsDelete(false);
temp.setInstanceId(instanceId);
dutyShift.add(temp);
startDate.add(Calendar.DAY_OF_YEAR,1);
}
dutyPersonShiftService.saveOrUpdateBatch(dutyShift);
}
//2.保存值班信息
insertPersonShift(instanceId, dutyCarDto);
//3.返回保存后的数据 //3.返回保存后的数据
return dutyCarDto; return dutyCarDto;
} }
@Override @Override
public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) { public DutyCarDto update(Long instanceId, DutyCarDto dutyCarDto) {
String groupCode = this.getGroupCode();
//1.查询已有数据 //修改操作动态表单修改的逻辑方法,陈浩 start ----2021-09-28
List<DynamicFormInstance> instances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dutyCarDto));
//2.list 转 map //修改操作动态表单修改的逻辑方法,陈浩 end ----2021-09-28
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instances, "fieldCode", DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
Map<String, Object> map = Bean.BeantoMap(dutyCarDto);
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
updateFormValue(entrys, map, instanceId, columns, instanceMap);
if (!entrys.isEmpty()) {
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
//5.更新值班信息人日期数据 //5.更新值班信息人日期数据
insertPersonShift(instanceId, dutyCarDto); insertPersonShift(instanceId, dutyCarDto.getDutyShift());
return dutyCarDto; return dutyCarDto;
} }
private void insertPersonShift(Long instanceId, DutyCarDto dutyCarDto) {
Set<DutyPersonShift> personShiftList = dutyCarDto.getDutyShift().stream().map(dto -> {
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift dutyPersonShift = dutyPersonShiftService.getOne(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId,instanceId).eq(DutyPersonShift::getDutyDate,dto.getDutyDate()));
if(dutyPersonShift == null) {
dutyPersonShift = new DutyPersonShift();
}
dto.setInstanceId(instanceId);
Bean.copyExistPropertis(dto, dutyPersonShift);
dutyPersonShift.setAppKey(RequestContext.getAppKey());
return dutyPersonShift;
}).collect(Collectors.toSet());
if (!personShiftList.isEmpty()) {
dutyPersonShiftService.saveOrUpdateBatch(personShiftList);
}
}
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());
......
...@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence; ...@@ -35,6 +35,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
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.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
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.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
...@@ -294,8 +295,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -294,8 +295,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
String fileName; String fileName;
if ("dutyCar".equals(groupCode)) { if ("dutyCar".equals(groupCode)) {
list = jsonArray.toJavaList(DutyCarDto.class); list = jsonArray.toJavaList(DutyCarDto.class);
} else { } else if("dutyPerson".equals(groupCode)){
list = jsonArray.toJavaList(DutyPersonDto.class); list = jsonArray.toJavaList(DutyPersonDto.class);
}else if("dutyFireFighting".equals(groupCode)){
list = jsonArray.toJavaList(DutyFireFightingDto.class);
} }
return list; return list;
} }
...@@ -487,4 +490,105 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -487,4 +490,105 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public List<Long> getDutyShiftIdList() { public List<Long> getDutyShiftIdList() {
return getOnDuty(new DateTime()); return getOnDuty(new DateTime());
} }
/***
* 将操作动态表单的方法单独提出来
* @author 陈浩
* @serialData 2021-09-28
* @param userId
* @param map
* @param groupCode
* @return
*/
public Long excuteDynamicFormInstance( String userId,Map<String, Object> map, String groupCode) {
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 (!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);
}
return instanceId;
}
public void updateDynamicFormInstance(String groupCode,Long instanceId, Map<String, Object> map) {
//1.查询已有数据
List<DynamicFormInstance> instances = dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
//2.list 转 map
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instances, "fieldCode", DynamicFormInstance.class);
//3.查询列数据,已列为主
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
//页面数据转Map
//4.已列为主 填充动态表单数据
List<DynamicFormInstance> entrys = new ArrayList<>();
updateFormValue(entrys, map, instanceId, columns, instanceMap);
if (!entrys.isEmpty()) {
dynamicFormInstanceService.saveOrUpdateBatch(entrys);
}
}
public void saveDutyPersonShiftDetail( Long instanceId ,List<DutyPersonShiftDto> dutyShift ,String startTime) {
if(dutyShift != null && dutyShift.size() == 0) {
Calendar startDate = Calendar.getInstance();
startDate.setTime(DateUtils.longStr2Date(startTime));
int dates = startDate.getActualMaximum(Calendar.DAY_OF_MONTH);
startDate.set(Calendar.DAY_OF_MONTH, 1);
List<DutyPersonShift> dutyShiftList = 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);
dutyShiftList.add(temp);
startDate.add(Calendar.DAY_OF_YEAR,1);
}
dutyPersonShiftService.saveOrUpdateBatch(dutyShiftList);
}
}
public void insertPersonShift(Long instanceId, List<DutyPersonShiftDto> dutyShiftList) {
Set<DutyPersonShift> personShiftList = dutyShiftList.stream().map(dto -> {
// BUG 2807 修改时发现BUG 车辆保存有问题 by kongfm 2021-09-14
// 根据instanceId 和 日期查找 如果有则更新
DutyPersonShift dutyPersonShift = dutyPersonShiftService.getOne(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId,instanceId).eq(DutyPersonShift::getDutyDate,dto.getDutyDate()));
if(dutyPersonShift == null) {
dutyPersonShift = new DutyPersonShift();
}
dto.setInstanceId(instanceId);
Bean.copyExistPropertis(dto, dutyPersonShift);
dutyPersonShift.setAppKey(RequestContext.getAppKey());
return dutyPersonShift;
}).collect(Collectors.toSet());
if (!personShiftList.isEmpty()) {
dutyPersonShiftService.saveOrUpdateBatch(personShiftList);
}
}
} }
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.Bean;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
import com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService;
@Service
public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implements IDutyFireFightingService {
@Autowired
FireStationServiceImpl fireStationServiceImpl;
@Override
@Transactional(rollbackFor = Exception.class)
public DutyFireFightingDto save(DutyFireFightingDto dto) {
// 根据微型消防站ID,获取微型消防站名称
FireStationDto fireStationDtoResult = fireStationServiceImpl
.queryBySeq(Long.parseLong(dto.getFireFightingId()));
dto.setFireFighting(fireStationDtoResult.getName());
Map<String, Object> map = Bean.BeantoMap(dto);
Long instanceId = excuteDynamicFormInstance(dto.getUserId(), map, this.getGroupCode());
saveDutyPersonShiftDetail(instanceId, dto.getDutyShift(), dto.getStartTime());
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
@Override
public DutyFireFightingDto update(Long instanceId, DutyFireFightingDto dto) {
updateDynamicFormInstance(this.getGroupCode(),instanceId,Bean.BeantoMap(dto));
insertPersonShift(instanceId, dto.getDutyShift());
return dto;
}
public String getGroupCode() {
return "dutyFireFighting";
}
}
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.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto; import com.yeejoin.amos.boot.module.common.api.dto.FireStationDto;
...@@ -116,4 +117,25 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat ...@@ -116,4 +117,25 @@ public class FireStationServiceImpl extends BaseService<FireStationDto, FireStat
this.updateById(entity); this.updateById(entity);
return Bean.toModel(entity, model); return Bean.toModel(entity, model);
} }
/**
* 列表查询 示例
*/
public List<FireStation> queryForFireStationList(List<String> companyIdList) {
LambdaQueryWrapper<FireStation> wrapper =new LambdaQueryWrapper<FireStation>();
wrapper.eq(FireStation::getIsDelete, false);
wrapper.in(FireStation::getBizCompanyId, companyIdList);
return this.baseMapper.selectList(wrapper);
}
/**
* 查询当前公司下的所有微型消防站信息
* @param companyId
* @return
*/
public List<Map<String , Object>> queryForFireStationListByCompanyId(Long companyId) {
LambdaQueryWrapper<FireStation> wrapper =new LambdaQueryWrapper<FireStation>();
wrapper.eq(FireStation::getIsDelete, false);
wrapper.eq(FireStation::getBizCompanyId, companyId);
wrapper.select(FireStation::getSequenceNbr,FireStation::getName);
return this.baseMapper.selectMaps(wrapper);
}
} }
...@@ -26,19 +26,25 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -26,19 +26,25 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.multipart.MultipartFile; 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.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.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.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.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.QRCodeUtil; import com.yeejoin.amos.boot.biz.common.utils.QRCodeUtil;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson; import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto;
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.dto.DutyPersonShiftDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyShiftDto;
...@@ -76,6 +82,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany; ...@@ -76,6 +82,7 @@ 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;
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.api.service.IDutyFireFightingService;
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;
...@@ -169,6 +176,9 @@ public class ExcelServiceImpl { ...@@ -169,6 +176,9 @@ public class ExcelServiceImpl {
FirefightersEducationServiceImpl ifirefightersEducationService; FirefightersEducationServiceImpl ifirefightersEducationService;
@Autowired @Autowired
FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService; FirefightersWorkexperienceServiceImpl ifirefightersWorkexperienceService;
@Autowired
IDutyFireFightingService dutyFireFightingService;
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();
...@@ -304,6 +314,9 @@ public class ExcelServiceImpl { ...@@ -304,6 +314,9 @@ public class ExcelServiceImpl {
case "JYZB": case "JYZB":
excelImportLinkageUnitJYZBDto(multipartFile); excelImportLinkageUnitJYZBDto(multipartFile);
break; break;
case "WXXFZB":
excelImportDutyPerson(multipartFile, "WXXFZB");
break;
} }
return; return;
} }
...@@ -836,6 +849,10 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -836,6 +849,10 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
item.setEquipCategoryId(Long.parseLong(equipCategory[1])); item.setEquipCategoryId(Long.parseLong(equipCategory[1]));
} }
if (item.getHasDrySeasonType() != null) {
boolean flag= "有".equals(item.getHasDrySeasonType())?true:false;
item.setHasDrySeason(flag);
}
if (item.getEquipName() != null) { if (item.getEquipName() != null) {
String[] equipCategory = item.getEquipName().split("@"); String[] equipCategory = item.getEquipName().split("@");
item.setEquipId(Long.parseLong(equipCategory[1])); item.setEquipId(Long.parseLong(equipCategory[1]));
...@@ -875,6 +892,16 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -875,6 +892,16 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
String[] highestEducation = fireExperts.getHighestEducation().split("@"); String[] highestEducation = fireExperts.getHighestEducation().split("@");
fireExperts.setHighestEducation(highestEducation[1]); // BUG 2942 by litw 2021年9月18日 导入学历编号 fireExperts.setHighestEducation(highestEducation[1]); // BUG 2942 by litw 2021年9月18日 导入学历编号
} }
if (fireExperts.getNativePlaceVal() != null){
String[] nativePlaceVal = fireExperts.getNativePlaceVal().split("@");
fireExperts.setNativePlace(nativePlaceVal[1]);
fireExperts.setNativePlaceVal(nativePlaceVal[0]);
}
if (fireExperts.getResidenceDetailVal() != null){
String[] residenceDetailVal = fireExperts.getResidenceDetailVal().split("@");
fireExperts.setResidence(residenceDetailVal[1]);
fireExperts.setResidenceDetailVal(residenceDetailVal[0]);
}
excelEntityList.add(fireExperts); excelEntityList.add(fireExperts);
}); });
fireExpertsServiceImpl.saveBatch(excelEntityList); fireExpertsServiceImpl.saveBatch(excelEntityList);
...@@ -908,6 +935,9 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -908,6 +935,9 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
} else if (ExcelEnums.RYZB.getType().equals(dutyType)) { } else if (ExcelEnums.RYZB.getType().equals(dutyType)) {
initDutyPersonData(sheet, dataList, dayByMonth); initDutyPersonData(sheet, dataList, dayByMonth);
dutyPersonService.saveImportData(dataList); dutyPersonService.saveImportData(dataList);
}else if (ExcelEnums.WXXFZB.getType().equals(dutyType)) {
initDutyFireFightingData(sheet, dataList, dayByMonth);
dutyFireFightingService.saveImportData(dataList);
} }
} }
} }
...@@ -1020,7 +1050,59 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -1020,7 +1050,59 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
} }
} }
} }
private void initDutyFireFightingData(XSSFSheet sheet, List<Map<String, Object>> dataList, List<Date> dayByMonth) {
// 遍历行,i = 1,从第二行开始,第一行是表头跳过。
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
DutyFireFightingDto dutyFireFightingDto = new DutyFireFightingDto();
// row是一行数据,row.getCell(i),代表拿到这一行,第i列数据
Row row = sheet.getRow(i);
if (row == null) {
continue;
}
Cell cell = row.getCell(4);
if(cell ==null ){
continue;
}
cell = row.getCell(1);
if(cell !=null ){
String[] split = cell.toString().split("@");
dutyFireFightingDto.setTeamId(split[1]);
dutyFireFightingDto.setTeamName(split[0]);
}
cell = row.getCell(2);
if (cell != null) {
String[] splitStr = cell.toString().split("@");
dutyFireFightingDto.setUserName(splitStr[0]);
dutyFireFightingDto.setUserId(splitStr[1]);
}
cell = row.getCell(3);
if (cell != null) {
String[] splitStr = cell.toString().split("@");
dutyFireFightingDto.setPostTypeName(splitStr[0]);
dutyFireFightingDto.setPostType(splitStr[1]);
}
cell = row.getCell(4);
if (cell != null) {
String[] splitStr = cell.toString().split("@");
dutyFireFightingDto.setFireFighting(splitStr[0]);
dutyFireFightingDto.setFireFightingId(splitStr[1]);
}
List<DutyPersonShiftDto> dutyShift = new ArrayList<>();
for (int j = 0; j < dayByMonth.size(); j++) {
cell = row.getCell(5 + j);
String dutyType = cell == null ? "" : cell.toString();
if (!StringUtils.isEmpty(dutyType)) {
DutyPersonShiftDto dutyPersonShiftDto = new DutyPersonShiftDto();
dutyPersonShiftDto.setDutyDate(dayByMonth.get(j));
dutyPersonShiftDto.setShiftId(Long.valueOf(dutyType.split("@")[1]));
dutyShift.add(dutyPersonShiftDto);
}
}
dutyFireFightingDto.setDutyShift(dutyShift);
Map<String, Object> dutyPersonDtoMap = Bean.BeantoMap(dutyFireFightingDto);
dataList.add(dutyPersonDtoMap);
}
}
private void excelImportMaintenancePerson(MultipartFile multipartFile) throws Exception { private void excelImportMaintenancePerson(MultipartFile multipartFile) throws Exception {
List<MaintenancePersonExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile, List<MaintenancePersonExcleDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
MaintenancePersonExcleDto.class, 1); MaintenancePersonExcleDto.class, 1);
...@@ -1066,18 +1148,22 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -1066,18 +1148,22 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
data = initDutyCarTemplate(ids); data = initDutyCarTemplate(ids);
} else if (ExcelEnums.RYZB.getType().equals(excelDto.getType())) { } else if (ExcelEnums.RYZB.getType().equals(excelDto.getType())) {
data = initDutyPersonTemplate(ids); data = initDutyPersonTemplate(ids);
}else if(ExcelEnums.WXXFZB.getType().equals(excelDto.getType())){
data = initDutyDutyFireFightingTemplate(ids);
} }
//代码报错暂时注释掉
// else if(ExcelEnums.WXXFZB.getType().equals(excelDto.getType())){
// data = initDutyDutyFireFightingTemplate(ids);
// }
// 获取日期 // 获取日期
List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate); List<Map<String, Object>> rangeDate = dutyPersonShiftService.getBaseMapper().genRangeDate(beginDate, endDate);
List<String> dayByMonth = new ArrayList<>(); List<String> dayByMonth = new ArrayList<>();
rangeDate.forEach(item -> dayByMonth.add((String) item.get("date"))); rangeDate.forEach(item -> dayByMonth.add((String) item.get("date")));
exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, true); if(ExcelEnums.WXXFZB.getType().equals(excelDto.getType())) {
exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, true,true);
}else {
exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, true,false);
}
} }
private List<List<Object>> initDutyDutyFireFightingTemplate(String ids) { private List<List<Object>> initDutyDutyFireFightingTemplate(String ids) {
List<List<Object>> data = new ArrayList<>(); List<List<Object>> data = new ArrayList<>();
// 根据id列表获取单位下的微型消防站集合 // 根据id列表获取单位下的微型消防站集合
...@@ -1085,16 +1171,18 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -1085,16 +1171,18 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
if (!ValidationUtil.isEmpty(ids)) { if (!ValidationUtil.isEmpty(ids)) {
companyIdList = Lists.newArrayList(ids.split(",")); companyIdList = Lists.newArrayList(ids.split(","));
} }
List<FirefightersDto> firefightersDtoList = fireTeamService.getFighterByTeamId(companyIdList); List<Map<String, Object>> personDetailList = orgUsrServer.getPersonDetailByCompanyIds(companyIdList);
if (!firefightersDtoList.isEmpty()) { if (!personDetailList.isEmpty()) {
AtomicInteger row = new AtomicInteger(1); AtomicInteger row = new AtomicInteger(1);
firefightersDtoList.forEach(o -> { personDetailList.forEach(o -> {
DutyFireFightingDto dto= (DutyFireFightingDto) Bean.mapToBean(o, DutyFireFightingDto.class);
ArrayList<Object> list = new ArrayList<>(); ArrayList<Object> list = new ArrayList<>();
list.add(row.getAndIncrement()); list.add(row.getAndIncrement());
list.add(o.getFireTeamName() + "@" + o.getFireTeamId()); list.add(dto.getTeamName() +"@" + dto.getTeamId());
list.add(o.getName() + "@" + o.getSequenceNbr()); list.add(dto.getUserName()+ "@" + dto.getUserId());
list.add(o.getJobTitle() + "@" + o.getJobTitleCode()); list.add(dto.getPostTypeName()+ "@" + dto.getPostType());
list.add(o.get("fireStation"));
data.add(list); data.add(list);
}); });
} }
...@@ -1112,9 +1200,34 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -1112,9 +1200,34 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
data = initDutyCarInfo(beginDate, endDate, dayByMonth); data = initDutyCarInfo(beginDate, endDate, dayByMonth);
} else if (ExcelEnums.RYZB.getType().equals(excelDto.getType())) { } else if (ExcelEnums.RYZB.getType().equals(excelDto.getType())) {
data = initDutyPersonInfo(beginDate, endDate, dayByMonth); data = initDutyPersonInfo(beginDate, endDate, dayByMonth);
}else if(ExcelEnums.WXXFZB.getType().equals(excelDto.getType())){
data = initDutyDutyFireFightingTemplate(beginDate, endDate, dayByMonth);
} }
exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, false); exportDutyTemplate(response, excelDto.getClassUrl(), dayByMonth, excelDto, data, false,false);
}
private List<List<Object>> initDutyDutyFireFightingTemplate(String beginDate, String endDate,
List<String> dayByMonth) throws ParseException {
List<DutyFireFightingDto> list=dutyFireFightingService.downloadList(beginDate, endDate);
List<List<Object>> data = new ArrayList<>();
// 组装导出数据
if (!list.isEmpty()) {
AtomicInteger row = new AtomicInteger(1);
list.forEach(o -> {
ArrayList<Object> detailList = new ArrayList<>();
detailList.add(row.getAndIncrement());
detailList.add(o.getTeamName());
detailList.add(o.getUserName());
detailList.add(o.getPostTypeName());
detailList.add(o.getFireFighting());
List<DutyPersonShiftDto> dutyShift = o.getDutyShift();
initDutyShift(dayByMonth, dutyShift, detailList);
data.add(detailList);
});
}
return data;
} }
private List<List<Object>> initDutyCarTemplate(String teamIds) { private List<List<Object>> initDutyCarTemplate(String teamIds) {
...@@ -1177,13 +1290,14 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -1177,13 +1290,14 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
private void exportDutyTemplate(HttpServletResponse response, String classUrl, List<String> dayByMonth, private void exportDutyTemplate(HttpServletResponse response, String classUrl, List<String> dayByMonth,
ExcelDto excelDto, List<? extends Object> data, Boolean flag) { ExcelDto excelDto, List<? extends Object> data, Boolean flag,Boolean typeFlag) {
try { try {
// 获取排班类型 // 获取排班类型
String[] dutyNameList = getDutyNameList(); String[] dutyNameList = getDutyNameList();
Class<?> clz = Class.forName(classUrl); Class<?> clz = Class.forName(classUrl);
ExcelUtil.createDutyTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data, clz, ExcelUtil.createDutyTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), data, clz,
dayByMonth, dutyNameList, dataSourcesImpl, flag); dayByMonth, dutyNameList, dataSourcesImpl, flag,typeFlag);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -1332,16 +1446,17 @@ if (excelDtoList != null && excelDtoList.size() > 0) { ...@@ -1332,16 +1446,17 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
break; break;
} }
} }
@Autowired
private RedisUtils redisUtils;
public BaseEntity getCurrentInfo() { public BaseEntity getCurrentInfo() {
BaseEntity userModel= new BaseEntity(); BaseEntity userModel= new BaseEntity();
/* String keyString= RequestContext.getExeUserId(); String keyString= RequestContext.getExeUserId();
String token=RequestContext.getToken(); String token=RequestContext.getToken();
ReginParams params = JSONObject.parseObject(redisUtils ReginParams params = JSONObject.parseObject(redisUtils
.get(RedisKey.buildReginKey(keyString, token)).toString(), .get(RedisKey.buildReginKey(keyString, token)).toString(),
ReginParams.class);*/ ReginParams.class);
userModel.setRecUserId("3141675"); userModel.setRecUserId(params.getUserModel().getUserId());
userModel.setRecUserName("admin_jcs"); userModel.setRecUserName(params.getUserModel().getUserName());
userModel.setRecDate( new Date()); userModel.setRecDate( new Date());
return userModel; return userModel;
} }
......
package com.yeejoin.amos.boot.module.tzs.biz.controller; package com.yeejoin.amos.boot.module.tzs.biz.controller;
import java.util.List; import java.util.List;
import java.util.Map;
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.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto; import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatUserFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -14,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -14,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
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.foundation.utils.ValidationUtil;
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;
...@@ -46,6 +59,15 @@ public class DispatchTaskController extends BaseController { ...@@ -46,6 +59,15 @@ public class DispatchTaskController extends BaseController {
@Autowired @Autowired
RedisUtils redisUtils; RedisUtils redisUtils;
@Autowired
ISourceFileService sourceFileService;
@Autowired
IDispatchTaskService dispatchTaskService;
@Autowired
AlertFormValueServiceImpl iAlertFormValueService;
/** /**
* 根据派遣单位类型和警情id 获取任务模板 * 根据派遣单位类型和警情id 获取任务模板
* @param orgTypeCode * @param orgTypeCode
...@@ -111,4 +133,206 @@ public class DispatchTaskController extends BaseController { ...@@ -111,4 +133,206 @@ public class DispatchTaskController extends BaseController {
List<MainPersonDto> list = dispatchTaskServiceImpl.todayTaskPerson(); List<MainPersonDto> list = dispatchTaskServiceImpl.todayTaskPerson();
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
/**
* 微信公众号维修反馈接口
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveUserFeed")
@ApiOperation(httpMethod = "POST", value = "微信公众号上报人反馈接口", notes = "微信公众号上报人反馈接口")
public ResponseModel<WechatMyBussinessDto> saveUserFeed(@RequestBody WechatUserFeedbackDto model) {
return ResponseHelper.buildResponse(dispatchTaskServiceImpl.saveUserFeed(model));
}
/**
* 点击到达触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/taskArrive/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击到达触发事件", notes = "点击到达触发事件")
public ResponseModel<WechatMyTaskDto> taskArrive(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskServiceImpl.taskArrive(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/**
* 点击救援完成触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/saveFinish/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击救援完成触发事件", notes = "点击救援完成触发事件")
public ResponseModel<WechatMyTaskDto> saveFinish(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskServiceImpl.saveFinish(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/**
* 获取任务详情
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTaskInfo/{taskId}")
@ApiOperation(httpMethod = "GET", value = "获取任务详情", notes = "获取任务详情")
public ResponseModel<WechatMyTaskDto> getTaskInfo(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
}
private WechatMyTaskDto getTaskDtoByTaskId(Long taskId) {
WechatMyTaskDto temp = dispatchTaskService.getTaskInfoByTaskId(taskId);
List<AlertFormValue> paperList = null;
Map<String, List<AttachmentDto>> imgMap = null;
List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null;
List<AttachmentDto> feedbackDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援
temp.setHasDeadHurt("无");
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getAlertId());
// 警情动态表单数据
List<AlertFormValue> alertList = iAlertFormValueService.list(queryWrapper);
alertList.stream().forEach(t -> {
String value = t.getFieldValue();
if("trapped_floor_num".equals(t.getFieldCode())) {
// 被困楼层
temp.setTrappedFloorNum(value);
} else if("trapped_num".equals(t.getFieldCode())) {
// 被困人数
temp.setTrappedNum(value);
} else if("injured_num".equals(t.getFieldCode())) {
// 受伤人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
} else if("die_num".equals(t.getFieldCode())) {
// 死亡人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
}
});
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
} else if("feedback_result".equals(t.getFieldCode())) {
// 反馈结果
temp.setFeedbackResult(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
temp.setActionResult(value);
}
});
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
}
return temp;
}
} }
...@@ -125,6 +125,7 @@ public class WechatController extends BaseController { ...@@ -125,6 +125,7 @@ public class WechatController extends BaseController {
@Autowired @Autowired
ISourceFileService sourceFileService; ISourceFileService sourceFileService;
/** /**
* 获取微信回调信息返回验证是否通过 * 获取微信回调信息返回验证是否通过
* @param signature * @param signature
...@@ -426,20 +427,6 @@ public class WechatController extends BaseController { ...@@ -426,20 +427,6 @@ public class WechatController extends BaseController {
} }
/**
* 获取任务详情
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getTaskInfo/{taskId}")
@ApiOperation(httpMethod = "GET", value = "获取任务详情", notes = "获取任务详情")
public ResponseModel<WechatMyTaskDto> getTaskInfo(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
}
/** /**
* 获取业务详情 * 获取业务详情
...@@ -456,45 +443,6 @@ public class WechatController extends BaseController { ...@@ -456,45 +443,6 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(getBussinessDtoById(bussinessId)); return ResponseHelper.buildResponse(getBussinessDtoById(bussinessId));
} }
/**
* 点击到达触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/taskArrive/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击到达触发事件", notes = "点击到达触发事件")
public ResponseModel<WechatMyTaskDto> taskArrive(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskService.taskArrive(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/**
* 点击救援完成触发事件
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/saveFinish/{taskId}")
@ApiOperation(httpMethod = "GET", value = "点击救援完成触发事件", notes = "点击救援完成触发事件")
public ResponseModel<WechatMyTaskDto> saveFinish(@PathVariable Long taskId) {
if (ValidationUtil.isEmpty(taskId)){
throw new BadRequest("参数校验失败.");
}
if(dispatchTaskService.saveFinish(taskId)) {
return ResponseHelper.buildResponse(getTaskDtoByTaskId(taskId));
} else {
return ResponseHelper.buildResponse(new WechatMyTaskDto());
}
}
/** /**
* 获取任务列表 * 获取任务列表
...@@ -561,122 +509,7 @@ public class WechatController extends BaseController { ...@@ -561,122 +509,7 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(urlString); return ResponseHelper.buildResponse(urlString);
} }
private WechatMyTaskDto getTaskDtoByTaskId(Long taskId) {
WechatMyTaskDto temp = dispatchTaskService.getTaskInfoByTaskId(taskId);
List<AlertFormValue> paperList = null;
Map<String, List<AttachmentDto>> imgMap = null;
List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援
temp.setHasDeadHurt("无");
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getAlertId());
// 警情动态表单数据
List<AlertFormValue> alertList = iAlertFormValueService.list(queryWrapper);
alertList.stream().forEach(t -> {
String value = t.getFieldValue();
if("trapped_floor_num".equals(t.getFieldCode())) {
// 被困楼层
temp.setTrappedFloorNum(value);
} else if("trapped_num".equals(t.getFieldCode())) {
// 被困人数
temp.setTrappedNum(value);
} else if("injured_num".equals(t.getFieldCode())) {
// 受伤人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
} else if("die_num".equals(t.getFieldCode())) {
// 死亡人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
}
});
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
break;
case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
} else if("feedback_result".equals(t.getFieldCode())) {
// 反馈结果
temp.setFeedbackResult(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
break;
case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
temp.setActionResult(value);
}
});
break;
}
return temp;
}
private WechatMyBussinessDto getBussinessDtoById(Long alertId) { private WechatMyBussinessDto getBussinessDtoById(Long alertId) {
...@@ -688,6 +521,7 @@ public class WechatController extends BaseController { ...@@ -688,6 +521,7 @@ public class WechatController extends BaseController {
List<AttachmentDto> imgDtos = null; List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null; Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null; List<AttachmentDto> errorImgDtos = null;
List<AttachmentDto> feedbackDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) { switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援 case "960" : // 困人救援
...@@ -775,11 +609,11 @@ public class WechatController extends BaseController { ...@@ -775,11 +609,11 @@ public class WechatController extends BaseController {
imgMap = sourceFileService.getAttachments(temp.getPaperId()); imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs"); imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos); temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr()); errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr());
errorImgDtos = errorImgMap.get("imgs"); errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos); temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break; break;
case "962" : // 投诉建议 case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>(); queryWrapper = new LambdaQueryWrapper<>();
...@@ -793,6 +627,11 @@ public class WechatController extends BaseController { ...@@ -793,6 +627,11 @@ public class WechatController extends BaseController {
temp.setActionResult(value); temp.setActionResult(value);
} }
}); });
errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break; break;
} }
return temp; return temp;
......
...@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -289,15 +290,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper(); LambdaQueryWrapper<DispatchPaper> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId)); queryWrapper.eq(DispatchPaper::getAlertId,Long.valueOf(alertId));
DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper); DispatchPaper dispatchPaper = dispatchPaperService.getOne(queryWrapper);
List<DispatchTask> dispatchTask = null;
LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper(); if(!ValidationUtil.isEmpty(dispatchPaper)) {
queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr())); LambdaQueryWrapper<DispatchTask> queryWrapper1 = new LambdaQueryWrapper();
List<DispatchTask> dispatchTask = dispatchTaskService.list(queryWrapper1); queryWrapper1.eq(DispatchTask::getPaperId,Long.valueOf(dispatchPaper.getSequenceNbr()));
dispatchTask = dispatchTaskService.list(queryWrapper1);
}
String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"}; String [] str = new String[]{"使用单位","一级响应","二级响应","三级响应","市级监督"};
if(null != dispatchPaper) { if(null != dispatchPaper) {
for(String s:str) { for(String s:str) {
AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto(); AlertHandlerInfoDto alertHandlerInfoDto = new AlertHandlerInfoDto();
if(null != dispatchTask &&dispatchTask.size() > 0 ) { if(null != dispatchTask &&dispatchTask.size() > 0 ) {
...@@ -465,8 +467,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -465,8 +467,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// 警情报送 // 警情报送
alertCalled.setAlertStatus(false); alertCalled.setAlertStatus(false);
alertCalled.setAlertSource(AlertStageEnums.GZHSB.getValue()); alertCalled.setAlertSource(AlertStageEnums.APPJJ.getValue());
alertCalled.setAlertSourceCode(AlertStageEnums.GZHSB.getCode()); alertCalled.setAlertSourceCode(AlertStageEnums.APPJJ.getCode());
alertCalled.setIsDelete(false); alertCalled.setIsDelete(false);
alertCalled.setAlertStage(AlertStageEnums.JJ.getValue()); alertCalled.setAlertStage(AlertStageEnums.JJ.getValue());
alertCalled.setAlertStageCode(AlertStageEnums.JJ.getId()); alertCalled.setAlertStageCode(AlertStageEnums.JJ.getId());
......
...@@ -219,8 +219,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -219,8 +219,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
return new DispatchSaveFeedbackDto(); // 如果没有派遣就没有派遣反馈信息 return new DispatchSaveFeedbackDto(); // 如果没有派遣就没有派遣反馈信息
} }
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
dispatchSaveFeedbackDto.setFeedbackCode(dispatchPaper.getFeedbackCode()); // dispatchSaveFeedbackDto.setFeedbackCode(dispatchPaper.getFeedbackCode());
dispatchSaveFeedbackDto.setFeedbackType(dispatchPaper.getFeedbackType()); // dispatchSaveFeedbackDto.setFeedbackType(dispatchPaper.getFeedbackType());
dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime());
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) {
dispatchSaveFeedbackDto.setFeedbackUid(null); dispatchSaveFeedbackDto.setFeedbackUid(null);
...@@ -297,6 +297,11 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -297,6 +297,11 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
dispatchSaveFeedbackDto.setFixRemark(value); dispatchSaveFeedbackDto.setFixRemark(value);
break; break;
case TzsCommonParam.FIX_FEEDBACK_TYPE:// 保修反馈方式
value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setFeedbackCode(value);
dispatchSaveFeedbackDto.setFeedbackType(alertFormValue.getFieldValue());
break;
} }
}); });
...@@ -358,12 +363,21 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -358,12 +363,21 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
alertFormValue.setFieldValueCode(errorResult.getCode()); alertFormValue.setFieldValueCode(errorResult.getCode());
} }
break; break;
case TzsCommonParam.FIX_FEEDBACK_TYPE:
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFeedbackCode())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKFS).eq(DataDictionary::getCode, dispatchSaveFeedbackDto.getFeedbackCode());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode());
}
break;
} }
}); });
if(StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFeedbackCode())) { // if(StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFeedbackCode())) {
dispatchPaper.setFeedbackCode(dispatchSaveFeedbackDto.getFeedbackCode()); // dispatchPaper.setFeedbackCode(dispatchSaveFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchSaveFeedbackDto.getFeedbackCode()).getValue()); // dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchSaveFeedbackDto.getFeedbackCode()).getValue());
} // }
dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid()); dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname());
...@@ -407,9 +421,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -407,9 +421,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
} }
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
dispatchRepairFeedbackDto.setFeedbackCode(dispatchPaper.getFeedbackCode());// 维修反馈code dispatchRepairFeedbackDto.setFixFeedbackCode(dispatchPaper.getFeedbackCode());// 维修反馈code
dispatchRepairFeedbackDto.setFeedbackType(dispatchPaper.getFeedbackType());// 维修反馈类型 dispatchRepairFeedbackDto.setFixFeedbackTime(dispatchPaper.getFeedbackTime()); //报修人反馈时间
dispatchRepairFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime()); //维修完成时间
dispatchRepairFeedbackDto.setRemark(dispatchPaper.getRemark()); // 维修反馈备注 dispatchRepairFeedbackDto.setRemark(dispatchPaper.getRemark()); // 维修反馈备注
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { //维修反馈人 if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) { //维修反馈人
dispatchRepairFeedbackDto.setFeedbackUid(null); dispatchRepairFeedbackDto.setFeedbackUid(null);
...@@ -448,10 +461,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -448,10 +461,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case TzsCommonParam.FIX_FEEDBACK_TIME: //报修反馈时间 case TzsCommonParam.FIX_FEEDBACK_TIME: //报修反馈时间
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
if (StringUtils.isBlank(value)) { if (StringUtils.isBlank(value)) {
dispatchRepairFeedbackDto.setFixFeedbackTime(null); dispatchRepairFeedbackDto.setFeedbackFinishTime(null);
} else { } else {
try { try {
dispatchRepairFeedbackDto.setFixFeedbackTime(DateUtils.longStr2Date(value)); dispatchRepairFeedbackDto.setFeedbackFinishTime(DateUtils.longStr2Date(value));
} catch (Exception e) { } catch (Exception e) {
throw new BadRequest("维修反馈时间格式错误"); throw new BadRequest("维修反馈时间格式错误");
} }
...@@ -463,7 +476,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -463,7 +476,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break; break;
case TzsCommonParam.FIX_FEEDBACK_TYPE:// 保修反馈方式 case TzsCommonParam.FIX_FEEDBACK_TYPE:// 保修反馈方式
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchRepairFeedbackDto.setFixFeedbackType(value); dispatchRepairFeedbackDto.setFeedbackCode(value);
break; break;
case TzsCommonParam.FIX_FEEDBACK_UNAME: case TzsCommonParam.FIX_FEEDBACK_UNAME:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
...@@ -504,7 +517,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -504,7 +517,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
@Override @Override
public Boolean saveDispatchRepairFeedback(DispatchRepairFeedbackDto dispatchRepairFeedbackDto, AgencyUserModel user) { public Boolean saveDispatchRepairFeedback(DispatchRepairFeedbackDto dispatchRepairFeedbackDto, AgencyUserModel user) {
Boolean flag = false; Boolean flag = false;
// 保存救援回访信息 // 保存维修回访信息
DispatchPaperFormDto dispatchPaperFormDto = this.selectDispatchPaperDtoByAlertId(dispatchRepairFeedbackDto.getAlertId()); DispatchPaperFormDto dispatchPaperFormDto = this.selectDispatchPaperDtoByAlertId(dispatchRepairFeedbackDto.getAlertId());
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper(); DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
// 动态字段 // 动态字段
...@@ -513,26 +526,26 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -513,26 +526,26 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dynamicFormAlert.stream().forEach(alertFormValue -> { dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) { switch (alertFormValue.getFieldCode()) {
case TzsCommonParam.FIX_FEEDBACK_TIME: case TzsCommonParam.FIX_FEEDBACK_TIME:
if (dispatchRepairFeedbackDto.getFixFeedbackTime() != null) { if (dispatchRepairFeedbackDto.getFeedbackFinishTime() != null) {
if(alertFormValue.getFieldValue() == null) { if(alertFormValue.getFieldValue() == null) {// 维修人员反馈
tempMap.put(TzsCommonParam.BXFK,true); tempMap.put("WXFK",true);
} }
alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchRepairFeedbackDto.getFixFeedbackTime())); alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchRepairFeedbackDto.getFeedbackFinishTime()));
} }
break; break;
case TzsCommonParam.FEEDBACK_RESULT: case TzsCommonParam.FEEDBACK_RESULT:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackResult())) { if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>(); QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", TzsCommonParam.WXJG).eq("code", dispatchRepairFeedbackDto.getFeedbackResult()); queryWrapper.eq("type", TzsCommonParam.FKJG).eq("code", dispatchRepairFeedbackDto.getFeedbackResult());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
} }
break; break;
case TzsCommonParam.FIX_FEEDBACK_TYPE: case TzsCommonParam.FIX_FEEDBACK_TYPE:
if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackType())) { if (StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackCode())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKFS).eq(DataDictionary::getCode, dispatchRepairFeedbackDto.getFixFeedbackType()); queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKFS).eq(DataDictionary::getCode, dispatchRepairFeedbackDto.getFeedbackCode());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
...@@ -570,23 +583,25 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -570,23 +583,25 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break; break;
} }
}); });
if(StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackCode())) { if(StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFixFeedbackCode())) {
dispatchPaper.setFeedbackCode(dispatchRepairFeedbackDto.getFeedbackCode()); dispatchPaper.setFeedbackCode(dispatchRepairFeedbackDto.getFixFeedbackCode());
dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchRepairFeedbackDto.getFeedbackCode()).getValue()); dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchRepairFeedbackDto.getFixFeedbackCode()).getValue());
} }
dispatchPaper.setFeedbackFinishTime(dispatchRepairFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchRepairFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchRepairFeedbackDto.getFeedbackUid()); dispatchPaper.setFeedbackUid(dispatchRepairFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname());
dispatchPaper.setRepairUser(dispatchRepairFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchRepairFeedbackDto.getRemark()); dispatchPaper.setRemark(dispatchRepairFeedbackDto.getRemark());
if(dispatchPaper.getFeedbackTime() == null && dispatchRepairFeedbackDto.getFeedbackTime() != null) { dispatchPaper.setFeedbackFinishTime(dispatchRepairFeedbackDto.getFixFeedbackTime());
tempMap.put("FEEDBACK",true); if(dispatchPaper.getFeedbackTime() == null && dispatchRepairFeedbackDto.getFixFeedbackTime() != null) { // 上报人反馈
tempMap.put("BXFK",true);
} }
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime()); dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFixFeedbackTime());
// 保存动态表单数据 // 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert); iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表 // 保存派遣表
flag = this.updateById(dispatchPaper); flag = this.updateById(dispatchPaper);
if(tempMap.get("FEEDBACK") != null) { if(tempMap.get("WXFK") != null) {
// 维修反馈 // 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId(); Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) { if(taskId == null) {
...@@ -683,7 +698,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -683,7 +698,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break; break;
case TzsCommonParam.CONSULT_FEEDBACK_TYPE:// 咨询反馈方式 case TzsCommonParam.CONSULT_FEEDBACK_TYPE:// 咨询反馈方式
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValueCode();
dispatchConsultFeedbackDto.setConsultFeedbackType(value); dispatchConsultFeedbackDto.setConsultFeedbackCode(value);
break; break;
case TzsCommonParam.CONSULT_FEEDBACK_UNAME: case TzsCommonParam.CONSULT_FEEDBACK_UNAME:
value = alertFormValue.getFieldValue(); value = alertFormValue.getFieldValue();
...@@ -726,7 +741,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -726,7 +741,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
case TzsCommonParam.CONSULT_FEEDBACK_TIME: case TzsCommonParam.CONSULT_FEEDBACK_TIME:
if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null) { if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null ) { if(alertFormValue.getFieldValue() == null ) {
tempMap.put(TzsCommonParam.TSRFK,true); tempMap.put("FEEDBACK",true);
} }
alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchConsultFeedbackDto.getConsultFeedbackTime())); alertFormValue.setFieldValue(DateUtils.date2LongStr(dispatchConsultFeedbackDto.getConsultFeedbackTime()));
} }
...@@ -741,9 +756,9 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -741,9 +756,9 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
} }
break; break;
case TzsCommonParam.CONSULT_FEEDBACK_TYPE: case TzsCommonParam.CONSULT_FEEDBACK_TYPE:
if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackType())) { if (StringUtils.isNotBlank(dispatchConsultFeedbackDto.getConsultFeedbackCode())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKFS).eq(DataDictionary::getCode, dispatchConsultFeedbackDto.getConsultFeedbackType()); queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKFS).eq(DataDictionary::getCode, dispatchConsultFeedbackDto.getConsultFeedbackCode());
DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper); DataDictionary feedbackType = iDataDictionaryService.getOne(queryWrapper);
alertFormValue.setFieldValue(feedbackType.getName()); alertFormValue.setFieldValue(feedbackType.getName());
alertFormValue.setFieldValueCode(feedbackType.getCode()); alertFormValue.setFieldValueCode(feedbackType.getCode());
...@@ -777,12 +792,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -777,12 +792,13 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchConsultFeedbackDto.getFeedbackCode()).getValue()); dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchConsultFeedbackDto.getFeedbackCode()).getValue());
} }
if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) { if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) {
tempMap.put("FEEDBACK",true); tempMap.put("TSRFK",true);
} }
dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime()); dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime());
dispatchPaper.setFeedbackFinishTime(dispatchConsultFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchConsultFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchConsultFeedbackDto.getFeedbackUid()); dispatchPaper.setFeedbackUid(dispatchConsultFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchConsultFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchConsultFeedbackDto.getFeedbackUname());
dispatchPaper.setDealUser(dispatchConsultFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchConsultFeedbackDto.getRemark()); dispatchPaper.setRemark(dispatchConsultFeedbackDto.getRemark());
// 保存动态表单数据 // 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert); iAlertFormValueService.updateBatchById(dynamicFormAlert);
......
...@@ -17,8 +17,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto; ...@@ -17,8 +17,10 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.MainPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto; import com.yeejoin.amos.boot.module.tzs.api.dto.RescueProcessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatUserFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper; import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchPaper;
...@@ -116,6 +118,10 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -116,6 +118,10 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
@Autowired
ISourceFileService sourceFileService;
@Value("${tzs.wechat.tempId.kr}") @Value("${tzs.wechat.tempId.kr}")
private String KRJY_TEMPID; private String KRJY_TEMPID;
...@@ -310,15 +316,67 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -310,15 +316,67 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
DispatchTask task = this.getById(wechatDispatchFeedbackDto.getTaskId()); DispatchTask task = this.getById(wechatDispatchFeedbackDto.getTaskId());
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getById(task.getPaperId()); DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getById(task.getPaperId());
Date now = new Date(); Date now = new Date();
// 反馈方式 AlertCalled alertCalled = alertCalledServiceImpl.getById(task.getAlertId());
dispatchPaper.setFeedbackCode("856"); // 反馈方式 -- 根据类型保存到动态表中
dispatchPaper.setFeedbackType("主动反馈"); if(alertCalled.getAlarmTypeCode().equals(AlertStageEnums.KRJY.getId())) { // 困人救援
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,"主动反馈").
set(AlertFormValue::getFieldValueCode,"856").
eq(AlertFormValue::getFieldCode,"fix_feedback_type").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,task.getResponseUserName()).
eq(AlertFormValue::getFieldCode,"fix_feedback_uname").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,task.getResponseUserId() + "").
eq(AlertFormValue::getFieldCode,"fix_feedback_uid").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,wechatDispatchFeedbackDto.getRemark()).
eq(AlertFormValue::getFieldCode,"fix_remark").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
} else if(alertCalled.getAlarmTypeCode().equals(AlertStageEnums.GZWX.getId())) { // 故障维修
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,"主动反馈").
set(AlertFormValue::getFieldValueCode,"856").
eq(AlertFormValue::getFieldCode,"fix_feedback_type").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,task.getResponseUserName()).
eq(AlertFormValue::getFieldCode,"fix_feedback_uname").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,task.getResponseUserId() + "").
eq(AlertFormValue::getFieldCode,"fix_feedback_uid").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,wechatDispatchFeedbackDto.getRemark()).
eq(AlertFormValue::getFieldCode,"fix_remark").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
} else if(alertCalled.getAlarmTypeCode().equals(AlertStageEnums.TSZX.getId())) {// 投诉建议
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,"主动反馈").
set(AlertFormValue::getFieldValueCode,"856").
eq(AlertFormValue::getFieldCode,"consult_feedback_type").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,task.getResponseUserName()).
eq(AlertFormValue::getFieldCode,"consult_feedback_uname").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,task.getResponseUserId() + "").
eq(AlertFormValue::getFieldCode,"consult_feedback_uid").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,wechatDispatchFeedbackDto.getRemark()).
eq(AlertFormValue::getFieldCode,"main_feedback_result").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
}
// 反馈时间 // 反馈时间
dispatchPaper.setFeedbackFinishTime(now); dispatchPaper.setFeedbackFinishTime(now);
dispatchPaper.setFeedbackTime(now);
// 反馈人信息
dispatchPaper.setFeedbackUid(task.getResponseUserId() + "");
dispatchPaper.setFeedbackUname(task.getResponseUserName());
dispatchPaper.setRepairUser(task.getResponseUserName()); dispatchPaper.setRepairUser(task.getResponseUserName());
// 保存照片 // 保存照片
...@@ -361,6 +419,11 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -361,6 +419,11 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
WechatMyTaskDto temp = this.getTaskInfoByTaskId(wechatDispatchFeedbackDto.getTaskId()); WechatMyTaskDto temp = this.getTaskInfoByTaskId(wechatDispatchFeedbackDto.getTaskId());
List<AlertFormValue> paperList = null; List<AlertFormValue> paperList = null;
Map<String, List<AttachmentDto>> imgMap = null;
List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null;
List<AttachmentDto> feedbackDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) { switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援 case "960" : // 困人救援
...@@ -411,7 +474,11 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -411,7 +474,11 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
} }
}); });
// 预留照片处理
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
break; break;
case "961" : // 故障维修 case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>(); queryWrapper = new LambdaQueryWrapper<>();
...@@ -440,6 +507,12 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -440,6 +507,12 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
} }
}); });
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break; break;
case "962" : // 投诉建议 case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>(); queryWrapper = new LambdaQueryWrapper<>();
...@@ -449,12 +522,18 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -449,12 +522,18 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
paperList.stream().forEach(t -> { paperList.stream().forEach(t -> {
String value = t.getFieldValue(); String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) { if("action_result".equals(t.getFieldCode())) {
// 处置结果get // 处置结果
temp.setActionResult(value); temp.setActionResult(value);
} }
}); });
errorImgMap = sourceFileService.getAttachments(temp.getAlertId());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break; break;
} }
return temp; return temp;
} }
...@@ -500,6 +579,182 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -500,6 +579,182 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
@Transactional @Transactional
@Override @Override
public WechatMyBussinessDto saveUserFeed(WechatUserFeedbackDto wechatUserFeedbackDto) {
AlertCalled alertCalled = alertCalledServiceImpl.getById(wechatUserFeedbackDto.getAlertId());
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getOne(new LambdaQueryWrapper<DispatchPaper>().eq(DispatchPaper::getIsDelete,0).eq(DispatchPaper::getAlertId,wechatUserFeedbackDto.getAlertId()));
Date now = new Date();
dispatchPaper.setFeedbackCode("856");
dispatchPaper.setFeedbackType("主动反馈");
// 反馈时间
dispatchPaper.setFeedbackFinishTime(now);
dispatchPaper.setFeedbackTime(now);
// 反馈人信息
dispatchPaper.setFeedbackUid(alertCalled.getEmergencyCall());
dispatchPaper.setFeedbackUname(alertCalled.getEmergencyCall() + alertCalled.getEmergencyPerson());
// 保存照片
Map<String, List<AttachmentDto>> attachmentMap = new HashMap<>();
attachmentMap.put("feedbacks",wechatUserFeedbackDto.getImgs());
ISourceFileService.saveAttachments(alertCalled.getSequenceNbr(),attachmentMap);
// 备注
dispatchPaper.setRemark(wechatUserFeedbackDto.getRemark());
dispatchPaperServiceImpl.updateById(dispatchPaper);
if(alertCalled.getAlarmTypeCode().equals(AlertStageEnums.KRJY.getId())) { // 困人救援
} else if(alertCalled.getAlarmTypeCode().equals(AlertStageEnums.GZWX.getId())) { // 故障维修
if (StringUtils.isNotBlank(wechatUserFeedbackDto.getFeedBackResult())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKJG).eq(DataDictionary::getCode, wechatUserFeedbackDto.getFeedBackResult());
DataDictionary feedbackResult = iDataDictionaryService.getOne(queryWrapper);
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,feedbackResult.getName()).
set(AlertFormValue::getFieldValueCode,feedbackResult.getCode()).
eq(AlertFormValue::getFieldCode,"feedback_result").
eq(AlertFormValue::getAlertCalledId,dispatchPaper.getSequenceNbr()));
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(alertCalled.getSequenceNbr(),TzsCommonParam.BXFK,null,null);
} else if(alertCalled.getAlarmTypeCode().equals(AlertStageEnums.TSZX.getId())) {// 投诉建议
if (StringUtils.isNotBlank(wechatUserFeedbackDto.getFeedBackResult())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.FKJG).eq(DataDictionary::getCode, wechatUserFeedbackDto.getFeedBackResult());
DataDictionary feedbackResult = iDataDictionaryService.getOne(queryWrapper);
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,feedbackResult.getName()).
set(AlertFormValue::getFieldValueCode,feedbackResult.getCode()).
eq(AlertFormValue::getFieldCode,"feedback_result").
eq(AlertFormValue::getAlertCalledId,dispatchPaper.getSequenceNbr()));
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(alertCalled.getSequenceNbr(),TzsCommonParam.TSRFK,null,null);
}
WechatMyBussinessDto temp = alertCalledServiceImpl.getBussinessInfoById(alertCalled.getSequenceNbr());
List<AlertFormValue> paperList = null;
Map<String, List<AttachmentDto>> imgMap = null;
List<AttachmentDto> imgDtos = null;
Map<String, List<AttachmentDto>> errorImgMap = null;
List<AttachmentDto> errorImgDtos = null;
List<AttachmentDto> feedbackDtos = null;
LambdaQueryWrapper<AlertFormValue> queryWrapper = new LambdaQueryWrapper<>();
switch (temp.getTaskTypeCode()) {
case "960" : // 困人救援
temp.setHasDeadHurt("无");
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getSequenceNbr());
// 警情动态表单数据
List<AlertFormValue> alertList = iAlertFormValueService.list(queryWrapper);
alertList.stream().forEach(t -> {
String value = t.getFieldValue();
if("trapped_floor_num".equals(t.getFieldCode())) {
// 被困楼层
temp.setTrappedFloorNum(value);
} else if("trapped_num".equals(t.getFieldCode())) {
// 被困人数
temp.setTrappedNum(value);
} else if("injured_num".equals(t.getFieldCode())) {
// 受伤人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
} else if("die_num".equals(t.getFieldCode())) {
// 死亡人数
if(StringUtils.isNotEmpty(value)) {
temp.setHasDeadHurt("有");
}
}
});
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
break;
case "961" : // 故障维修
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("save_time".equals(t.getFieldCode())) {
// 救援完成时间
if(StringUtils.isNotBlank(value)) {
temp.setSaveTime(DateUtils.longStr2Date(value));
}
} else if("error_result".equals(t.getFieldCode())) {
// 故障原因
temp.setErrorResult(value);
} else if("fix_result".equals(t.getFieldCode())) {
// 维修结果
temp.setFixResult(value);
} else if("fix_remark".equals(t.getFieldCode())) {
// 维修备注
temp.setRemark(value);
} else if("feedback_result".equals(t.getFieldCode())) {
// 反馈结果
temp.setFeedbackResult(value);
}
});
imgMap = sourceFileService.getAttachments(temp.getPaperId());
imgDtos = imgMap.get("imgs");
temp.setFixImgs(imgDtos);
errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
case "962" : // 投诉建议
queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AlertFormValue::getAlertCalledId, temp.getPaperId());
// 派遣动态表单
paperList = iAlertFormValueService.list(queryWrapper);
paperList.stream().forEach(t -> {
String value = t.getFieldValue();
if("action_result".equals(t.getFieldCode())) {
// 处置结果
temp.setActionResult(value);
}
});
errorImgMap = sourceFileService.getAttachments(temp.getSequenceNbr());
errorImgDtos = errorImgMap.get("imgs");
temp.setErrorImgs(errorImgDtos);
feedbackDtos = errorImgMap.get("feedbacks");
temp.setFeedBackImgs(feedbackDtos);
break;
}
return temp;
}
@Transactional
@Override
public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) { public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) {
if(sendUser == null) { if(sendUser == null) {
throw new BadRequest("派遣任务创建人不能为空"); throw new BadRequest("派遣任务创建人不能为空");
......
...@@ -173,6 +173,7 @@ public class ESElevatorServiceImpl { ...@@ -173,6 +173,7 @@ public class ESElevatorServiceImpl {
esElevatorDto.setHappenTime(al.getCallTime()); esElevatorDto.setHappenTime(al.getCallTime());
esElevatorDto.setAlertId(String.valueOf(al.getSequenceNbr())); esElevatorDto.setAlertId(String.valueOf(al.getSequenceNbr()));
esElevatorDto.setAlarmTypeCode(al.getAlarmTypeCode()); esElevatorDto.setAlarmTypeCode(al.getAlarmTypeCode());
esElevatorDto.setType(al.getAlertStage());
list.add(esElevatorDto); list.add(esElevatorDto);
break; break;
} }
......
...@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev ...@@ -122,10 +122,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
} }
public List<ElevatorWlInfoDto> queryElevatorListDetails(ElevatorWlInfoDto esElevatorDto) { public List<ElevatorWlInfoDto> queryElevatorListDetails(ElevatorWlInfoDto esElevatorDto) {
return elevatorMapper.queryElevatorListDetails(esElevatorDto.getAddress(), return elevatorMapper.queryElevatorListDetails(
esElevatorDto.getRegisterCode(),esElevatorDto.getRescueCode(), esElevatorDto.getSequenceNbr());
esElevatorDto.getType(), esElevatorDto.getDealStatus() != null ? Integer.parseInt(esElevatorDto.getDealStatus()) :null
, esElevatorDto.getSequenceNbr());
} }
public int queryElevatorListCount() { public int queryElevatorListCount() {
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
...@@ -64,6 +65,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -64,6 +65,10 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
@Autowired @Autowired
RescueProcessServiceImpl rescueProcessServiceImpl; RescueProcessServiceImpl rescueProcessServiceImpl;
@Autowired
AlertFormValueServiceImpl iAlertFormValueService;
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
...@@ -197,15 +202,19 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -197,15 +202,19 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String person = dispatchTask.getResponseUserName(); String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId); DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
DispatchPaper dispatchPaper = dispatchPaperFormDto.getDispatchPaper();
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
if(TzsCommonParam.FIX_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put("FKFS",alertFormValue.getFieldValue());
}
}); });
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult")); // 反馈方式从动态表单中取得
String FKFS = tempMap.get("FKFS") == null ? "" : tempMap.get("FKFS");
content = content.replace("$FKFS",FKFS).replace("$fixResult",tempMap.get("fixResult"));
} else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据 } else if(TzsCommonParam.WXFK_TS.equals(type)) { //从派遣单获取数据
//投诉的维修反馈修改成维保已处置 //投诉的维修反馈修改成维保已处置
CZHJ = DispatchPaperEnums.disposed; CZHJ = DispatchPaperEnums.disposed;
...@@ -219,44 +228,40 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -219,44 +228,40 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue()); tempMap.put("fixResult",alertFormValue.getFieldValue());
} else if(TzsCommonParam.CONSULT_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",dispatchPaper.getFeedbackType()).replace("$fixResult",tempMap.get("fixResult")); content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$fixResult",tempMap.get("fixResult"));
type = TzsCommonParam.WXFK; type = TzsCommonParam.WXFK;
} else if(TzsCommonParam.BXFK.equals(type)) { } else if(TzsCommonParam.BXFK.equals(type)) {
//报修反馈 //报修反馈
CZHJ = DispatchPaperEnums.reportorBack; CZHJ = DispatchPaperEnums.reportorBack;
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); String person = alertCalledVo.getEmergencyPerson() + "(" + alertCalledVo.getEmergencyCall() + ")";
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId); DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.FIX_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FEEDBACK_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue()); tempMap.put("feedbackResult",alertFormValue.getFieldValue());
} else if(TzsCommonParam.FIX_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("fixResult",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("fixResult")); content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult"));
} else if(TzsCommonParam.TSRFK.equals(type)) { } else if(TzsCommonParam.TSRFK.equals(type)) {
//投诉人已反馈 //投诉人已反馈
CZHJ = DispatchPaperEnums.complainantBack; CZHJ = DispatchPaperEnums.complainantBack;
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); String person = alertCalledVo.getEmergencyPerson() + "(" + alertCalledVo.getEmergencyCall() + ")";
String person = dispatchTask.getResponseUserName();
content = content.replace("$createTime",createTime).replace("$person",person); content = content.replace("$createTime",createTime).replace("$person",person);
DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId); DispatchPaperFormDto dispatchPaperFormDto = dispatchPaperServiceImpl.selectDispatchPaperDtoByAlertId(alertId);
List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert(); List<AlertFormValue> dynamicForm = dispatchPaperFormDto.getDynamicFormAlert();
Map<String,String> tempMap = new HashMap<String,String>(); Map<String,String> tempMap = new HashMap<String,String>();
dynamicForm.stream().forEach(alertFormValue -> { dynamicForm.stream().forEach(alertFormValue -> {
if(TzsCommonParam.CONSULT_FEEDBACK_TYPE.equals(alertFormValue.getFieldCode())) { if(TzsCommonParam.FEEDBACK_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put(TzsCommonParam.FKFS,alertFormValue.getFieldValue()); tempMap.put("feedbackResult",alertFormValue.getFieldValue());
} else if(TzsCommonParam.ACTION_RESULT.equals(alertFormValue.getFieldCode())) {
tempMap.put("action_result",alertFormValue.getFieldValue());
} }
}); });
content = content.replace("$FKFS",tempMap.get(TzsCommonParam.FKFS)).replace("$feedbackResult",tempMap.get("action_result")); content = content.replace("$FKFS",dispatchPaperFormDto.getDispatchPaper().getFeedbackType()).replace("$feedbackResult",tempMap.get("feedbackResult"));
} }
AlertStageEnums RZHJ = AlertStageEnums.getEnumByCode(type); AlertStageEnums RZHJ = AlertStageEnums.getEnumByCode(type);
repairConsult.setType(RZHJ.getCode()); repairConsult.setType(RZHJ.getCode());
......
...@@ -42,9 +42,9 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a ...@@ -42,9 +42,9 @@ tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url=http://36.46.151.113:8000 tzs.cti.url=http://36.46.151.113:8000
tzs.wechat.url=https://api.weixin.qq.com tzs.wechat.url=https://api.weixin.qq.com
##wechatAPPID wx79aca5bb1cb4af92 wx8918c1aaad956617 ##wechatAPPID wx79aca5bb1cb4af92 uat-wx8918c1aaad956617
tzs.wechat.appid=wx79aca5bb1cb4af92 tzs.wechat.appid=wx8918c1aaad956617
##wechatSECRET 337c3d8f3e749140d4f9aedc8311033b f3a12323ba731d282c3d4698c27c3e97 ##wechatSECRET f3a12323ba731d282c3d4698c27c3e97 uat-337c3d8f3e749140d4f9aedc8311033b
tzs.wechat.secret=337c3d8f3e749140d4f9aedc8311033b tzs.wechat.secret=337c3d8f3e749140d4f9aedc8311033b
##wechatToken ##wechatToken
......
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