Commit ea90397b authored by 李成龙's avatar 李成龙

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

parents 306c46be 7f2d4b65
......@@ -64,7 +64,7 @@ public class ControllerAop {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
// 不需要添加请求头的接口
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/wechat-relation/save","/tzs/alert-called/saveMobile"};
String[] url = new String[]{"/api/user/selectInfo", "/api/user/save/curCompany", "/jcs/command/lookHtmlText", "/jcs/common/duty-person/findByDutyAreaId", "/tzs/wechatBack", "/tzs/wechat-relation/save","/tzs/alert-called/saveMobile","/tzs/elevator/getElevatorInfo"};
// 获取请求路径
for(String uri : url) {
if(request.getRequestURI().indexOf(uri) != -1) {
......
package com.yeejoin.amos.boot.biz.common.excel;
/***
*
* 获取动态值
*
* **/
public class CommonExplicitConstraint implements ExplicitInterface {
@Override
public String[] source(String type, String method, DataSources dataDictionaryMapper) throws Exception {
return dataDictionaryMapper.selectList(type, method);
}
}
package com.yeejoin.amos.boot.biz.common.excel;
/**
*
* 字段列动态值获取
*
* ***/
public interface DataSources {
String[] selectList(String type, String method) throws Exception;
}
package com.yeejoin.amos.boot.biz.common.excel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import java.util.ArrayList;
import java.util.List;
//如果没有特殊说明,下面的案例将默认使用这个监听器
public class ExcelListener<T> extends AnalysisEventListener<T> {
List<T> list = new ArrayList<T>();
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
/**
* 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来
*/
public ExcelListener() {}
/**
* 这个每一条数据解析都会来调用
*
* @param data
* @param context
*/
@Override
public void invoke(T data, AnalysisContext context) {
list.add(data);
}
/**
* 所有数据解析完成了 都会来调用
*
* @param context
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
}
}
package com.yeejoin.amos.boot.biz.common.excel;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.params.ExcelForEachParams;
import cn.afterturn.easypoi.excel.export.styler.IExcelExportStyler;
import org.apache.poi.ss.usermodel.*;
/**
* @title: ExcelStyleUtil
* @Author fpy
* @Date: 2021/7/8 15:36
* @Version 1.0
*/
public class ExcelStyleUtil implements IExcelExportStyler {
private static final short STRING_FORMAT = (short) BuiltinFormats.getBuiltinFormat("TEXT");
private static final short FONT_SIZE_TEN = 10;
private static final short FONT_SIZE_ELEVEN = 11;
private static final short FONT_SIZE_TWELVE = 12;
/**
* 大标题样式
*/
private CellStyle headerStyle;
/**
* 每列标题样式
*/
private CellStyle titleStyle;
/**
* 数据行样式
*/
private CellStyle styles;
public ExcelStyleUtil(Workbook workbook) {
this.init(workbook);
}
/**
* 初始化样式
*
* @param workbook
*/
private void init(Workbook workbook) {
//this.headerStyle = initHeaderStyle(workbook);
this.titleStyle = initTitleStyle(workbook);
this.styles = initStyles(workbook);
}
/**
* 大标题样式
*
* @param color
* @return
*/
@Override
public CellStyle getHeaderStyle(short color) {
return headerStyle;
}
/**
* 每列标题样式
*
* @param color
* @return
*/
@Override
public CellStyle getTitleStyle(short color) {
return titleStyle;
}
/**
* 数据行样式
*
* @param parity 可以用来表示奇偶行
* @param entity 数据内容
* @return 样式
*/
@Override
public CellStyle getStyles(boolean parity, ExcelExportEntity entity) {
return styles;
}
/**
* 获取样式方法
*
* @param dataRow 数据行
* @param obj 对象
* @param data 数据
*/
@Override
public CellStyle getStyles(Cell cell, int dataRow, ExcelExportEntity entity, Object obj, Object data) {
return getStyles(true, entity);
}
/**
* 模板使用的样式设置
*/
@Override
public CellStyle getTemplateStyles(boolean isSingle, ExcelForEachParams excelForEachParams) {
return null;
}
/**
* 初始化--大标题样式
*
* @param workbook
* @return
*/
private CellStyle initHeaderStyle(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
style.setFont(getFont(workbook, FONT_SIZE_TWELVE, true));
return style;
}
/**
* 初始化--每列标题样式
*
* @param workbook
* @return
*/
private CellStyle initTitleStyle(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
//style.setFont(getFont(workbook, FONT_SIZE_ELEVEN, false));
//背景色
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
return style;
}
/**
* 初始化--数据行样式
*
* @param workbook
* @return
*/
private CellStyle initStyles(Workbook workbook) {
CellStyle style = getBaseCellStyle(workbook);
style.setFont(getFont(workbook, FONT_SIZE_TEN, false));
style.setDataFormat(STRING_FORMAT);
return style;
}
/**
* 基础样式
*
* @return
*/
private CellStyle getBaseCellStyle(Workbook workbook) {
CellStyle style = workbook.createCellStyle();
//下边框
style.setBorderBottom(BorderStyle.THIN);
//左边框
style.setBorderLeft(BorderStyle.THIN);
//上边框
style.setBorderTop(BorderStyle.THIN);
//右边框
style.setBorderRight(BorderStyle.THIN);
//水平居中
style.setAlignment(HorizontalAlignment.CENTER);
//上下居中
style.setVerticalAlignment(VerticalAlignment.CENTER);
//设置自动换行
style.setWrapText(true);
return style;
}
/**
* 字体样式
*
* @param size 字体大小
* @param isBold 是否加粗
* @return
*/
private Font getFont(Workbook workbook, short size, boolean isBold) {
Font font = workbook.createFont();
//字体样式
font.setFontName("宋体");
//是否加粗
font.setBold(isBold);
//字体大小
font.setFontHeightInPoints(size);
return font;
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.biz.common.excel;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.read.metadata.ReadSheet;
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.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ExcelUtil {
private static final Integer DUTY_CAR_START_INDEX = 5;
/**
* 生成excel模板
*
* @param response
* @param fileName 下载的文件名,
* @param sheetName sheet名
* @param data 导出的数据
* @param model 导出的头
* @param flag true模板填充下拉 false 不填充
*/
public static void createTemplate(HttpServletResponse response, String fileName,
String sheetName, List<? extends Object> data,
Class<?> model, DataSources dataDictionaryMapper, boolean flag) {
HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle();
try {
//下拉列表集合
Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
if (flag) {
//循环获取对应列得下拉列表信息
Field[] declaredFields = model.getDeclaredFields();
for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i];
//解析注解信息
ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class);
resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper);
}
}
EasyExcel.write(getOutputStream(fileName, response, ExcelTypeEnum.XLSX), model)
.excelType(ExcelTypeEnum.XLSX).sheet(sheetName)
.registerWriteHandler(new TemplateCellWriteHandlerDate(explicitListConstraintMap))
.registerWriteHandler(new TemplateCellWriteHandler())
.registerWriteHandler(horizontalCellStyleStrategy)
.doWrite(data);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常!");
}
}
/**
* 生成excel模板
*
* @param response
* @param fileName 下载的文件名,
* @param sheetName sheet名
* @param data 导出的数据
* @param model 导出的头
* @param flag true模板填充下拉 false 不填充
*/
public static void createDutyTemplate(HttpServletResponse response, String fileName, String sheetName, List<?
extends Object> data, Class<?> model, List<String> dayByMonth, String[] dutyNameList,
DataSources dataDictionaryMapper,
boolean flag) {
HorizontalCellStyleStrategy horizontalCellStyleStrategy = setMyCellStyle();
try {
// 组装表头
List<List<String>> dutyCarTitleList = new ArrayList<>();
Field[] declaredFields = model.getDeclaredFields();
for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i];
ExcelProperty excelProperty = field.getAnnotation(ExcelProperty.class);
if (excelProperty != null) {
ArrayList<String> head = new ArrayList<>();
head.add(excelProperty.value()[0]);
dutyCarTitleList.add(head);
}
}
int size = dutyCarTitleList.size();
if (dayByMonth != null) {
for (int i = 0; i < dayByMonth.size(); i++) {
ArrayList<String> dutyDay = new ArrayList<>();
dutyDay.add(dayByMonth.get(i));
dutyCarTitleList.add(dutyDay);
}
}
//下拉列表集合
Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
if (flag) {
// 组装下拉列表
for (int i = 0; i < declaredFields.length; i++) {
Field field = declaredFields[i];
//解析注解信息
ExplicitConstraint explicitConstraint = field.getAnnotation(ExplicitConstraint.class);
resolveExplicitConstraint(explicitListConstraintMap, explicitConstraint, dataDictionaryMapper);
}
if (dayByMonth != null) {
for (int i = 0; i < dayByMonth.size(); i++) {
explicitListConstraintMap.put(size + i, dutyNameList);
}
}
}
// String s = new String(fileName.getBytes(), "UTF-8");
// response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(s, "UTF-8"));
ExcelWriterSheetBuilder 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) 指定行开始读取
*
* @param excel 文件
* @param rowType 模板实体类
* @param header 指定不读取的表头行数,
* @param <T>
* @return 集合数据
* @throws Exception
*/
public static <T> List<T> readFirstSheetExcel(MultipartFile excel, Class<T> rowType, int header) throws Exception {
ExcelReader reader = getReader(excel, header);
if (reader == null) {
return new ArrayList<>();
}
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();
}
/**
* @param excel 需要解析的 Excel 文件
* @param header 指定不读取表头行数,
* @return
* @throws Exception
*/
public static ExcelReader getReader(MultipartFile excel, int header) throws Exception {
String fileName = excel.getOriginalFilename();
if (fileName == null) {
throw new Exception("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new Exception("文件类型异常!");
}
InputStream inputStream;
try {
inputStream = excel.getInputStream();
return EasyExcel.read(inputStream).
headRowNumber(header).
build();
} 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;
}
/**
* 导出文件时为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();
// // 设置表头居中对齐
// headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// // 颜色
// headWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
//
// WriteFont headWriteFont = new WriteFont();
// headWriteFont.setFontHeightInPoints((short) 10);
// // 字体
// headWriteCellStyle.setWriteFont(headWriteFont);
// headWriteCellStyle.setWrapped(true);
// // 内容的策略
// WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
// // 设置内容靠中对齐
// contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// // 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy
// (headWriteCellStyle, contentWriteCellStyle);
// // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭
// 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 contentWriteCellStyle = new WriteCellStyle();
WriteFont contentWriteFont = new WriteFont();
//内容字体大小
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.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
}
}
package com.yeejoin.amos.boot.biz.common.excel;
import java.lang.annotation.*;
/**
* 导出模板数据
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface ExplicitConstraint {
//定义固定下拉内容
String[]source()default {};
//定义动态下拉内容,
Class[]sourceClass()default {};
//列标号必须和字段下标一致
int indexNum() default 0;
//字典type
String type() default "";
//接口查询
String method() default "";
}
package com.yeejoin.amos.boot.biz.common.excel;
public interface ExplicitInterface {
/**
* 动态下拉列表的内容数组
* @return
* type 字典类型
*/
String[] source(String type, String method, DataSources dataDictionaryMapper) throws Exception;
}
package com.yeejoin.amos.boot.biz.common.excel;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.*;
/**
* excel通用单元格格式类
*/
public class TemplateCellWriteHandler implements CellWriteHandler {
@Override
public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row,
Head head, int relativeRowIndex, boolean isHead) {
// TODO Auto-generated method stub
}
@Override
public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, CellData cellData,
Cell cell, Head head, int relativeRowIndex, boolean isHead) {
Workbook workbooks = writeSheetHolder.getSheet().getWorkbook();
if (0 == cell.getRowIndex()) {
writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(), 20 * 256);
CellStyle cellStyle = workbooks.createCellStyle();
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//居中
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);//设置前景填充样式
cellStyle.setFillForegroundColor(IndexedColors.ROYAL_BLUE.getIndex());//前景填充色
Font font1 = workbooks.createFont();//设置字体
font1.setBold(true);
font1.setColor((short)1);
font1.setFontHeightInPoints((short)15);
cellStyle.setFont(font1);
cell.setCellStyle(cellStyle);
}
// //其他列
// if (!isHead){
// CellStyle style = workbooks.createCellStyle();
// DataFormat dataFormat = workbooks.createDataFormat();
// style.setDataFormat(dataFormat.getFormat("@"));
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// style.setAlignment(HorizontalAlignment.CENTER);
// cell.setCellStyle(style);
// }
// //设置日期
// if (!isHead && cell.getColumnIndex()==19 || !isHead && cell.getColumnIndex()==21|| !isHead && cell.getColumnIndex()==20){
// CellStyle style = workbooks.createCellStyle();
// DataFormat dataFormat = workbooks.createDataFormat();
// style.setDataFormat(dataFormat.getFormat("yyyy/mm/dd hh:mm:ss"));
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// style.setAlignment(HorizontalAlignment.CENTER);
// cell.setCellStyle(style);
// }
// //设置金额
// if (!isHead && cell.getColumnIndex()==15 ||!isHead && cell.getColumnIndex()==16||!isHead && cell.getColumnIndex()==22 ||!isHead && cell.getColumnIndex()==24||!isHead && cell.getColumnIndex()==25){
// CellStyle style = workbooks.createCellStyle();
// DataFormat dataFormat = workbooks.createDataFormat();
// style.setDataFormat(dataFormat.getFormat("0.00"));
// style.setVerticalAlignment(VerticalAlignment.CENTER);
// style.setAlignment(HorizontalAlignment.CENTER);
// cell.setCellStyle(style);
// }
}
}
package com.yeejoin.amos.boot.biz.common.excel;
import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.HashMap;
import java.util.Map;
/**
* excel通用单元格格式类下拉框赋值
*/
public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
/**
* 构造器注入
*/
private Map<Integer, String[]> explicitListConstraintMap = new HashMap<>();
public TemplateCellWriteHandlerDate(Map<Integer, String[]> explicitListConstraintMap) {
this.explicitListConstraintMap = explicitListConstraintMap;
}
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 1;
/**
* 返回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();
// k 为存在下拉数据集的单元格下表 v为下拉数据集
explicitListConstraintMap.forEach((k, v) -> {
// 设置下拉单元格的首行 末行 首列 末列
CellRangeAddressList rangeList = new CellRangeAddressList(1, 65536, k, k);
// 如果下拉值总数大于100,则使用一个新sheet存储,避免生成的导入模板下拉值获取不到
if (v.length > LIMIT_NUMBER) {
//定义sheet的名称
//1.创建一个隐藏的sheet 名称为 hidden + k
String sheetName = "hidden" + 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);
}
}
// // 下拉列表约束数据
// DataValidationConstraint constraint = helper.createExplicitListConstraint(v);
// // 设置约束
// DataValidation validation = helper.createValidation(constraint, rangeList);
// // 阻止输入非下拉选项的值
// validation.setErrorStyle(DataValidation.ErrorStyle.STOP);
// validation.setShowErrorBox(true);
// validation.setSuppressDropDownArrow(true);
// validation.createErrorBox("提示", "此值与单元格定义格式不一致");
// // validation.createPromptBox("填写说明:","填写内容只能为下拉数据集中的单位,其他单位将会导致无法入仓");
// sheet.addValidationData(validation);
});
}
}
}
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.biz.common.service;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
public interface IWorkflowExcuteService{
/**
......@@ -16,14 +18,14 @@ public interface IWorkflowExcuteService{
* @param processInstanceId 流程定义的ID
* @return true 可以执行,false 无执行权限
*/
boolean checkTaskAuth(String processInstanceId);
boolean checkTaskAuth(String processInstanceId, ReginParams userInfo);
/**
* 检查当前登录人有没有流程操作权限
* @param processInstanceId 流程定义的ID
* @return 包含是否执行的角色权限flag,以及当前任务的id
*/
Map<String, Object> checkTaskAuthMap(String processInstanceId);
Map<String, Object> checkTaskAuthMap(String processInstanceId, ReginParams userInfo);
/**
* 设置当前任务的执行人,只支持当前节点流程拥有单个可执行任务的情况,不支持并行网关产生的多条任务设置人的任务情况
* @param processInstanceId
......@@ -37,7 +39,7 @@ public interface IWorkflowExcuteService{
* @param userInfo
* @return
*/
boolean CompleteTask(String processInstanceId,String condition);
boolean CompleteTask(String processInstanceId,String condition, ReginParams userInfo);
}
......@@ -7,15 +7,19 @@ import java.util.Map;
import java.util.Random;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import ch.qos.logback.core.joran.conditional.IfAction;
@Service
public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
......@@ -43,49 +47,60 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
@Override
public boolean checkTaskAuth(String processInstanceId) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId);
public boolean checkTaskAuth(String processInstanceId, ReginParams userInfo) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId, userInfo);
return Boolean.parseBoolean(map.get("checkFlag").toString());
}
@Override
public Map<String, Object> checkTaskAuthMap(String processInstanceId) {
public Map<String, Object> checkTaskAuthMap(String processInstanceId, ReginParams userInfo) {
// 获取当前登录用户的角色
String currentLoginUserRole = userInfo.getRole().getRoleName();
String currentLoginUserId = userInfo.getUserModel().getUserId();
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
JSONObject teskObject = workflowFeignService.getTask(processInstanceId);
JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
if (ObjectUtils.isNotEmpty(teskObject)) {
map.put("taskId", teskObject.getString("id"));
JSONArray taskDetailArray = teskObject.getJSONArray("data");
for (Object obj : taskDetailArray) {
JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
if ("制定计划+内容".equals(detail.getString("name")) || "现场确认".equals(detail.getString("name")) ) {
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put("name", teskObject.getString("name"));
map.put("name", detail.getString("name"));
return map;
}
JSONObject taskGroupNameObject = workflowFeignService.getTaskGroupName(detail.getString("id"));
// 获取流程中原本设置的当前节点的执行权限
JSONArray taskGroupNameDetail = taskGroupNameObject.getJSONArray("data");
// 如果拿不到当前任务的执行角色,再去获取当前任务有没有默认的执行人,如果都没有则返回校验失败
if (ObjectUtils.isEmpty(taskGroupNameDetail)) {
JSONObject taskAssignObject = workflowFeignService.getTaskAssign(detail.getString("id"));
String assignUser = taskAssignObject.getJSONObject("data").getString("assignee");
if (StringUtils.isNotBlank(assignUser)) {
// 如果当前登录人与当前任务的设定人不一定,则直接返回权限校验失败
if (!currentLoginUserId.equals(assignUser)) {
return map;
}
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put("name", detail.getString("name"));
map.put("assign", assignUser);
return map;
}
continue;
}
String defaultExecutionRoleProcess = taskGroupNameDetail.getJSONObject(0).getString("groupId");
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if (!defaultExecutionRoleProcess.equals(currentLoginUserRole)) {
continue;
}
map.put("taskId", detail.getString("id"));
map.put("checkFlag", true);
map.put("name", detail.getString("name"));
map.put("groupName", currentLoginUserRole);
}
}
/*
* JSONObject teskObject = workflowFeignService.getTaskList(processInstanceId);
* if (ObjectUtils.isNotEmpty(teskObject)) { JSONArray taskDetailArray =
* teskObject.getJSONArray("data"); for (Object obj : taskDetailArray) {
* JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(obj));
* JSONObject taskGroupNameObject =
* workflowFeignService.getTaskGroupName(detail.getString("id")); //
* 获取流程中原本设置的当前节点的执行权限 JSONArray taskGroupNameDetail =
* taskGroupNameObject.getJSONArray("data"); //
* 如果拿不到当前任务的执行角色,再去获取当前任务有没有默认的执行人,如果都没有则返回校验失败 if
* (ObjectUtils.isEmpty(taskGroupNameDetail)) { JSONObject taskAssignObject =
* workflowFeignService.getTaskAssign(detail.getString("id")); String assignUser
* = taskAssignObject.getJSONObject("data").getString("assignee"); if
* (StringUtils.isNotBlank(assignUser)) { // 如果当前登录人与当前任务的设定人不一定,则直接返回权限校验失败 if
* (!currentLoginUserId.equals(assignUser)) { return map; } else {
* map.put("taskId", detail.getString("id")); map.put("checkFlag", true);
* map.put("name", detail.getString("name")); map.put("assign", assignUser);
* return map; } } continue; } String defaultExecutionRoleProcess =
* taskGroupNameDetail.getJSONObject(0).getString("groupId"); //
* 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出 if
* (!defaultExecutionRoleProcess.equals(currentLoginUserRole)) { continue; }
* map.put("taskId", detail.getString("id")); map.put("checkFlag", true);
* map.put("name", detail.getString("name"));
* map.put("groupName",currentLoginUserRole); } }
*/
return map;
}
......@@ -126,13 +141,13 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
@Override
public boolean CompleteTask(String processInstanceId, String condition) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId);
public boolean CompleteTask(String processInstanceId, String condition, ReginParams userInfo) {
Map<String, Object> map = checkTaskAuthMap(processInstanceId, userInfo);
if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
HashMap<String, Object> conditionMap = new HashMap<String, Object>();
conditionMap.put("condition", condition);
try {
workflowFeignService.completeNoExecuteFromInstanceAdd(map.get("taskId").toString(), conditionMap);
workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap);
} catch (Exception e) {
throw new RuntimeException("完成任务失败");
}
......
......@@ -3,15 +3,12 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.typroject.tyboot.core.foundation.utils.Bean;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 值班班次
......@@ -58,12 +55,12 @@ public class DutyCarExcelDto implements Serializable {
@ApiModelProperty(value = "车辆id")
private String carId;
@ExplicitConstraint(indexNum = 4, sourceClass = RoleNameExplicitConstraint.class, method = "getCarList") //固定下拉内容
@ExplicitConstraint(indexNum = 4, sourceClass = CommonExplicitConstraint.class, method = "getCarList") //固定下拉内容
@ExcelProperty(value = "车辆名称(车牌)", index = 4)
@ApiModelProperty(value = "车辆名称")
private String carName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = RoleNameExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
......
......@@ -3,13 +3,12 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 值班班次
......@@ -48,12 +47,12 @@ public class DutyPersonExcelDto implements Serializable {
@ApiModelProperty(value = "岗位id")
private String postType;
@ExplicitConstraint(type = "DUTY_POST_TYPE", indexNum = 4, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "DUTY_POST_TYPE", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位", index = 4)
@ApiModelProperty(value = "岗位名称")
private String postTypeName;
// 需求 958 新增值班区域 值班区域id 字段 导出字段 by kongfm 2021-09-15
@ExplicitConstraint(indexNum = 5, sourceClass = RoleNameExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getDutyArea") //固定下拉内容
@ExcelProperty(value = "值班区域", index = 5)
@ApiModelProperty(value = "值班区域")
private String dutyArea;
......
......@@ -2,7 +2,7 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import lombok.Data;
import java.io.Serializable;
......@@ -55,13 +55,13 @@ public class EquipmentDetailDownloadTemplateDto implements Serializable {
//@Excel(name = "消防系统编码", width = 30, orderNum = "10")
private String fightingSysCodes;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExplicitConstraint(indexNum = 10, sourceClass = CommonExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExcelProperty(value = "所属队伍", index = 10)
//@Excel(name = "所属队伍",width = 30,orderNum = "11")
private String fireTeam;
//动态下拉内容
@ExplicitConstraint(indexNum = 11, sourceClass = RoleNameExplicitConstraint.class,method="getCompany") //动态下拉内容
@ExplicitConstraint(indexNum = 11, sourceClass = CommonExplicitConstraint.class,method="getCompany") //动态下拉内容
@ExcelProperty(value = "所属单位", index = 11)
//@Excel(name = "所属单位",width = 30,orderNum = "12")
private String companyName;
......
......@@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -81,7 +81,7 @@ public class FireChemicalDto extends BaseDto {
@ApiModelProperty(value = "类型code")
private String typeCode;
@ExplicitConstraint(type = "CHEMICALTYPE", indexNum = 12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "CHEMICALTYPE", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "类型名称")
@ExcelProperty(value = "类型名称", index = 12)
private String type;
......
......@@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -30,7 +30,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "单位")
private String companyName;
@ExplicitConstraint(type = "RYZJLX", indexNum = 2, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYZJLX", indexNum = 2, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "证件类型", index = 2)
@ApiModelProperty(value = "证件类型")
private String certificatesType;
......@@ -52,7 +52,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "出生日期")
private Date birthdayTime;
@ExplicitConstraint(indexNum = 6, sourceClass = RoleNameExplicitConstraint.class, method = "getNations") //固定下拉内容
@ExplicitConstraint(indexNum = 6, sourceClass = CommonExplicitConstraint.class, method = "getNations") //固定下拉内容
@ExcelProperty(value = "民族", index = 6)
@ApiModelProperty(value = "民族")
private String nation;
......@@ -62,7 +62,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "籍贯")
private String nativePlace;
@ExplicitConstraint(indexNum = 8, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 8)
@ApiModelProperty(value = "政治面貌")
private String politicalOutlook;
......@@ -84,12 +84,12 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "移动电话")
private String mobilePhone;
@ExplicitConstraint(type = "XLLX", indexNum = 13, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XLLX", indexNum = 13, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "最高学历", index = 13)
@ApiModelProperty(value = "最高学历")
private String highestEducation;
@ExplicitConstraint(type = "GWMC", indexNum = 14, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "GWMC", indexNum = 14, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 14)
@ApiModelProperty(value = "岗位名称")
private String jobs;
......@@ -98,7 +98,7 @@ public class FireExpertsDto extends BaseDto {
@ApiModelProperty(value = "岗位名称code")
private String jobsCode;
@ExplicitConstraint(type = "ZJLY", indexNum = 15, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "ZJLY", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防专家领域", index = 15)
@ApiModelProperty(value = "消防专家领域")
private String expert;
......
......@@ -5,7 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -34,7 +34,7 @@ public class FireStationDto extends BaseDto {
@ApiModelProperty(value = "所在建筑物id")
private String whereBuildingId;
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class, method = "getBuildingList")
@ExplicitConstraint(indexNum = 1, sourceClass = CommonExplicitConstraint.class, method = "getBuildingList")
@ExcelProperty(value = "所在建筑", index = 1)
@ApiModelProperty(value = "所在建筑物名称")
private String whereBuilding;
......@@ -59,7 +59,7 @@ public class FireStationDto extends BaseDto {
@ApiModelProperty(value = "单位id")
private Long bizCompanyId;
@ExplicitConstraint(indexNum = 6, sourceClass = RoleNameExplicitConstraint.class, method = "getBizCompanyList")
@ExplicitConstraint(indexNum = 6, sourceClass = CommonExplicitConstraint.class, method = "getBizCompanyList")
@ExcelProperty(value = "所属单位", index = 6)
@ApiModelProperty(value = "所属单位名称")
private String bizCompany;
......@@ -81,8 +81,8 @@ public class FireStationDto extends BaseDto {
@ExcelProperty(value = "装备简要情况", index = 9)
@ApiModelProperty(value = "装备简要情况")
private String equipmentBrief;
@ExcelProperty(value = "微型消防站照片", index = 10)
/*bug 2963 微型消防站,导入模板里面不应该有照片字段 2021-09-24 CEHNZHAO*/
@ExcelIgnore
@ApiModelProperty(value = "图片信息")
private String img;
......
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 微型消防站
......
......@@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -28,7 +28,7 @@ public class FireTeamDto extends BaseDto {
@ExcelProperty(value = "所属单位", index = 0)
@ApiModelProperty(value = "机构名称")
@ExplicitConstraint(indexNum = 0, sourceClass = RoleNameExplicitConstraint.class,method="getCompanyDetailTree") //动态下拉内容
@ExplicitConstraint(indexNum = 0, sourceClass = CommonExplicitConstraint.class,method="getCompanyDetailTree") //动态下拉内容
private String companyName;
@ExcelIgnore
......@@ -39,7 +39,7 @@ public class FireTeamDto extends BaseDto {
@ApiModelProperty(value = "机构code")
private String companyCode;
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExplicitConstraint(indexNum = 1, sourceClass = CommonExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExcelProperty(value = "上级队伍", index = 1)
@ApiModelProperty(value = "父级名称")
private String parentName;
......@@ -52,7 +52,7 @@ public class FireTeamDto extends BaseDto {
@ApiModelProperty(value = "单位名称")
private String name;
@ExplicitConstraint(type = "XFJGLX", indexNum = 3, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XFJGLX", indexNum = 3, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "队伍类型", index = 3)
@ApiModelProperty(value = "消防队类型(专职消防队,监控大队)")
private String type;
......@@ -77,7 +77,7 @@ public class FireTeamDto extends BaseDto {
@ApiModelProperty(value = "联系人id")
private Long contactUserId;
@ExplicitConstraint(indexNum = 7, sourceClass = RoleNameExplicitConstraint.class,method = "getFirefighters") //动态下拉内容
@ExplicitConstraint(indexNum = 7, sourceClass = CommonExplicitConstraint.class,method = "getFirefighters") //动态下拉内容
@ExcelProperty(value = "联系人", index = 7)
@ApiModelProperty(value = "联系人")
private String contactUser;
......
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 消防队伍
......
......@@ -9,7 +9,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -41,7 +41,7 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "员工编码")
private String employeeNumber;
@ExplicitConstraint(indexNum = 2, sourceClass = RoleNameExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExplicitConstraint(indexNum = 2, sourceClass = CommonExplicitConstraint.class,method="getFireTeam") //动态下拉内容
@ExcelProperty(value = "消防队伍", index = 2)
@ApiModelProperty(value = "队伍")
private String fireTeam;
......@@ -54,12 +54,12 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "机构code")
private String companyCode;
@ExplicitConstraint(indexNum = 3, sourceClass = RoleNameExplicitConstraint.class,method="getCompany") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExplicitConstraint(indexNum = 3, sourceClass = CommonExplicitConstraint.class,method="getCompany") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "所属部门", index = 3)
@ApiModelProperty(value = "机构名称")
private String companyName;
@ExplicitConstraint(type = "RYZJLX", indexNum = 4, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYZJLX", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "证件类型", index = 4)
@ApiModelProperty(value = "常用证件类型代码")
private String certificatesType;
......@@ -77,19 +77,19 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "性别")
private String gender;
@ExplicitConstraint(indexNum = 8, sourceClass = RoleNameExplicitConstraint.class, method = "getNations") //固定下拉内容
@ExplicitConstraint(indexNum = 8, sourceClass = CommonExplicitConstraint.class, method = "getNations") //固定下拉内容
@ExcelProperty(value = "民族", index = 8)
@ApiModelProperty(value = "民族")
private String nation;
@ExplicitConstraint(indexNum = 9, sourceClass = RoleNameExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容
@ExplicitConstraint(indexNum = 9, sourceClass = CommonExplicitConstraint.class, method = "getMaritalStatus") //固定下拉内容
@ExcelProperty(value = "婚姻状况", index = 9)
@ApiModelProperty(value = "婚姻状况")
private String maritalStatus;
@ExplicitConstraint(indexNum = 10, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExplicitConstraint(indexNum = 10, sourceClass = CommonExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "户籍所在地", index = 10)
@ApiModelProperty(value = "籍贯/户口所在地的值")
private String nativePlaceValue;
......@@ -99,12 +99,12 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "籍贯/户口所在地详细地址")
private String nativePlaceVal;
@ExplicitConstraint(indexNum = 12, sourceClass = RoleNameExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExplicitConstraint(indexNum = 12, sourceClass = CommonExplicitConstraint.class, method = "getPoliticalOutlook") //固定下拉内容
@ExcelProperty(value = "政治面貌", index = 12)
@ApiModelProperty(value = "政治面貌代码")
private String politicalOutlook;
@ExplicitConstraint(indexNum = 13, sourceClass = RoleNameExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExplicitConstraint(indexNum = 13, sourceClass = CommonExplicitConstraint.class,method="getCitys") //动态下拉内容// BUG 2760 修改消防人员导出模板和 导入问题 bykongfm
@ExcelProperty(value = "现居住地", index = 13)
@ApiModelProperty(value = "现居住地")
private String residence;
......@@ -121,7 +121,7 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "手机")
private String mobilePhone;
@ExplicitConstraint(type = "RYZT", indexNum = 17, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYZT", indexNum = 17, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 17)
@ApiModelProperty(value = "人员状态,在职/离职")
private String state;
......@@ -130,7 +130,7 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "人员状态,在职/离职字典code")
private String stateCode;
@ExplicitConstraint(type = "GWMC", indexNum = 18, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "GWMC", indexNum = 18, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位名称", index = 18)
@ApiModelProperty(value = "岗位名称")
private String jobTitle;
......@@ -139,7 +139,7 @@ public class FirefightersExcelDto extends BaseDto {
@ApiModelProperty(value = "紧急联系人姓名")
private String emergencyContact;
@ExplicitConstraint(type = "RJGX", indexNum = 20, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RJGX", indexNum = 20, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "与紧急联系人关系", index = 20)
@ApiModelProperty(value = "紧急联系人与本人所属关系")
private String relationship;
......@@ -182,21 +182,21 @@ public class FirefightersExcelDto extends BaseDto {
/*************************岗位职级***********************/
@ApiModelProperty(value = "员工层级")
@ExcelProperty(value = "员工层级", index = 22)
@ExplicitConstraint(type = "YGCJ", indexNum = 22, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "YGCJ", indexNum = 22, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
private String employeeHierarchy;
@ApiModelProperty(value = "行政职务")
@ExplicitConstraint(type = "XZZW", indexNum = 23, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XZZW", indexNum = 23, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "行政职务", index = 23)
private String administrativePosition;
@ApiModelProperty(value = "岗位资质")
@ExplicitConstraint(type = "GWZZ", indexNum = 24, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "GWZZ", indexNum = 24, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位资质", index = 24)
private String postQualification;
@ApiModelProperty(value = "消防救援人员类别")
@ExplicitConstraint(type = "XFRYLB", indexNum = 25, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XFRYLB", indexNum = 25, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防救援人员类别", index = 25)
private String category;
......@@ -204,28 +204,28 @@ public class FirefightersExcelDto extends BaseDto {
// private String state;
@ApiModelProperty(value = "消防救援衔级别代码")
@ExplicitConstraint(type = "XFJYJB", indexNum = 26, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XFJYJB", indexNum = 26, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防救援衔级别代码", index = 26)
private String level;
@ApiModelProperty(value = "消防专家领域")
@ExplicitConstraint(type = "ZJLY", indexNum = 27, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "ZJLY", indexNum = 27, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防专家领域", index = 27)
private String areasExpertise;
/*************************学历教育***********************/
@ApiModelProperty(value = "第一学历")
@ExplicitConstraint(type = "XLLX", indexNum = 28, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XLLX", indexNum = 28, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "第一学历", index = 28)
private String firstDegree;
@ApiModelProperty(value = "最高学历")
@ExplicitConstraint(type = "XLLX", indexNum = 29, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XLLX", indexNum = 29, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "最高学历", index = 29)
private String highestEducation;
@ApiModelProperty(value = "学位")
@ExplicitConstraint(type = "XWLX", indexNum = 30, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XWLX", indexNum = 30, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "学位", index = 30)
private String academicDegree;
......
......@@ -5,7 +5,7 @@ import java.io.Serializable;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -29,7 +29,7 @@ public class KeySiteExcleDto implements Serializable {
private String name;
@ExcelProperty(value = "所属单位/部门id", index = 1)
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class, method = "getCompanyDetailTree") //固定下拉内容
@ExplicitConstraint(indexNum = 1, sourceClass = CommonExplicitConstraint.class, method = "getCompanyDetailTree") //固定下拉内容
@ApiModelProperty(value = "所属单位/部门id")
private String belongName;
......@@ -37,7 +37,7 @@ public class KeySiteExcleDto implements Serializable {
private Long belongId;
@ExcelProperty(value = "所属建筑id", index = 2)
@ExplicitConstraint(indexNum = 2, sourceClass = RoleNameExplicitConstraint.class, method = "getBuildTree") //固定下拉内容
@ExplicitConstraint(indexNum = 2, sourceClass = CommonExplicitConstraint.class, method = "getBuildTree") //固定下拉内容
@ApiModelProperty(value = "所属建筑id")
private String buildingName;
......@@ -55,12 +55,12 @@ public class KeySiteExcleDto implements Serializable {
@ExcelIgnore
@ApiModelProperty(value = "建筑高度(m)")
private String buildingHeight;
@ExplicitConstraint(type = "NHDJ", indexNum =5, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "NHDJ", indexNum =5, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "耐火等级", index = 5)
@ApiModelProperty(value = "耐火等级")
private String fireEnduranceRate;
@ExplicitConstraint(type = "JZWSYXZ", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "JZWSYXZ", indexNum =6, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "使用性质", index = 6)
@ApiModelProperty(value = "使用性质")
private String useNature;
......
......@@ -5,7 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -40,7 +40,7 @@ public class LinkageUnitDto extends BaseDto {
private String parentId;
@ExcelProperty(value = "服务类别", index = 1)
@ExplicitConstraint(type = "LDDWLB", indexNum =1, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "LDDWLB", indexNum =1, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "服务类别")
private String linkageUnitType;
......@@ -72,7 +72,7 @@ public class LinkageUnitDto extends BaseDto {
@ApiModelProperty(value = "协议结束日期")
private Date agreementEndDate;
@ExcelProperty(value = "应急联动单位类别", index = 7)
@ExplicitConstraint(type = "YJLDDW", indexNum =7, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "YJLDDW", indexNum =7, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "应急联动单位类别")
private String emergencyLinkageUnit;
@ExcelIgnore
......
......@@ -6,7 +6,7 @@ import java.util.Date;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -34,7 +34,7 @@ public class MaintenancePersonExcleDto implements Serializable {
@ApiModelProperty(value = "员工编号")
protected String code;
@ExplicitConstraint(indexNum = 2, sourceClass = RoleNameExplicitConstraint.class, method = "getCompanyAndDeparementTree") //固定下拉内容
@ExplicitConstraint(indexNum = 2, sourceClass = CommonExplicitConstraint.class, method = "getCompanyAndDeparementTree") //固定下拉内容
@ExcelProperty(value = "所属单位及部门", index =2)
@ApiModelProperty(value = "所属单位及部门")
private String parentName;
......@@ -42,7 +42,7 @@ public class MaintenancePersonExcleDto implements Serializable {
@ExcelIgnore
private Long parentId;
@ExplicitConstraint(type = "XB", indexNum = 3, sourceClass = RoleNameExplicitConstraint.class)
@ExplicitConstraint(type = "XB", indexNum = 3, sourceClass = CommonExplicitConstraint.class)
@ExcelProperty(value = "性别", index =3)
@ApiModelProperty(value = "性别")
private String gender;
......@@ -68,17 +68,17 @@ public class MaintenancePersonExcleDto implements Serializable {
@ApiModelProperty(value = "系统账户")
private String systemAccount;
@ExplicitConstraint(type = "WBRYZT", indexNum =9, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "WBRYZT", indexNum =9, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index =9)
@ApiModelProperty(value = "人员状态")
private String status;
@ExplicitConstraint(type = "WBZYZS", indexNum = 10, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "WBZYZS", indexNum = 10, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "职业资格证书", index =10)
@ApiModelProperty(value = "职业资格证书")
private String professionalCertificate;
@ExplicitConstraint(type = "WBZYZG", indexNum = 11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "WBZYZG", indexNum = 11, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "职业资格", index =11)
@ApiModelProperty(value = "职业资格")
private String qualification;
......
......@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -54,7 +54,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "员工编号")
private String personNumber;
@ExplicitConstraint(type = "XB", indexNum = 4, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XB", indexNum = 4, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "性别", index = 4)
@ApiModelProperty(value = "性别")
private String gender;
......@@ -63,7 +63,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "性别code")
private String genderCode;
@ExplicitConstraint(type = "RYZJLX", indexNum = 5, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYZJLX", indexNum = 5, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "证件类型", index = 5)
@ApiModelProperty(value = "证件类型")
private String certificatesType;
......@@ -80,7 +80,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "联系电话")
private String telephone;
@ExplicitConstraint(type = "RYZT", indexNum = 8, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYZT", indexNum = 8, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "人员状态", index = 8)
@ApiModelProperty(value = "人员状态")
private String state;
......@@ -89,7 +89,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "人员状态code")
private String stateCode;
@ExplicitConstraint(type = "AQPX", indexNum = 9, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "AQPX", indexNum = 9, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "是否进行安全培训", index = 9)
@ApiModelProperty(value = "是否进行安全培训")
private String safetyTraining;
......@@ -98,7 +98,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "是否进行安全培训code")
private String safetyTrainingCode;
@ExplicitConstraint(type = "XZZW", indexNum = 10, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XZZW", indexNum = 10, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "行政职务", index = 10)
@ApiModelProperty(value = "行政职务")
private String administrativePosition;
......@@ -107,7 +107,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "行政职务code")
private String administrativePositionCode;
@ExplicitConstraint(type = "JGNBZW", indexNum = 11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "JGNBZW", indexNum = 11, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防管理组织机构内部职务", index = 11)
@ApiModelProperty(value = "消防管理组织机构内部职务")
private String internalPosition;
......@@ -116,7 +116,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "消防管理组织机构内部职务code")
private String internalPositionCode;
@ExplicitConstraint(type = "XFGLGW", indexNum = 12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XFGLGW", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防管理岗位", index = 12)
@ApiModelProperty(value = "消防管理岗位")
private String fireManagementPost;
......@@ -125,7 +125,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "消防管理岗位code")
private String fireManagementPostCode;
@ExplicitConstraint(type = "GWMC", indexNum = 13, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "GWMC", indexNum = 13, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "岗位类型", index = 13)
@ApiModelProperty(value = "岗位类型")
private String positionType;
......@@ -134,7 +134,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "岗位类型code")
private String positionTypeCode;
@ExplicitConstraint(type = "CZLB", indexNum = 14, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "CZLB", indexNum = 14, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "持证类别", index = 14)
@ApiModelProperty(value = "持证类别")
private String certificateType;
......@@ -147,7 +147,7 @@ public class OrgPersonExcelDto extends BaseDto {
@ApiModelProperty(value = "持证时间")
private Date holdingTime;
@ExplicitConstraint(type = "SHZQ", indexNum = 16, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "SHZQ", indexNum = 16, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "审核周期", index = 16)
@ApiModelProperty(value = "审核周期")
private String auditCycle;
......
......@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -54,7 +54,7 @@ public class OrgUsrExcelDto extends BaseDto {
private String buildId;
@ExcelProperty(value = "所属单位部门", index = 1)
@ExplicitConstraint(indexNum = 1, sourceClass = RoleNameExplicitConstraint.class, method = "getparent") //固定下拉内容
@ExplicitConstraint(indexNum = 1, sourceClass = CommonExplicitConstraint.class, method = "getparent") //固定下拉内容
@ApiModelProperty(value = "归属机构/部门/人员")
private String parentId;
......@@ -89,38 +89,38 @@ public class OrgUsrExcelDto extends BaseDto {
@ExcelProperty(value = "行政职务", index = 2)
@ExplicitConstraint(type = "XZZW", indexNum =2, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "XZZW", indexNum =2, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String administrativePositionCode;// 行政职务
@ExcelProperty(value = "审核周期", index = 3)
@ExplicitConstraint(type = "SHZQ", indexNum =3, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "SHZQ", indexNum =3, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String auditCycle; //审核周期
@ExcelProperty(value = "证件号码", index = 4)
private String certificatesNumber;// 证件号码
@ExcelProperty(value = "证件类型", index = 5)
@ExplicitConstraint(type = "RYZJLX", indexNum =5, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "RYZJLX", indexNum =5, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String certificatesTypeCode; //证件类型
@ExcelProperty(value = "持证类别", index = 6)
@ExplicitConstraint(type = "CZLB", indexNum =6, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "CZLB", indexNum =6, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String certificateType; //持证类别
@ExcelProperty(value = "消防管理岗位", index = 7)
@ExplicitConstraint(type = "XFGLGW", indexNum =7, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "XFGLGW", indexNum =7, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String fireManagementPostCode; //消防管理岗位
@ExcelProperty(value = "性别", index = 8)
@ExplicitConstraint(type = "XB", indexNum =8, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "XB", indexNum =8, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String gender; //性别
@ExcelProperty(value = "消防管理组织机构内部职务", index = 9)
@ExplicitConstraint(type = "JGNBZW", indexNum =9, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "JGNBZW", indexNum =9, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String internalPositionCode; //消防管理组织机构内部职务
@ExcelProperty(value = "员工编号", index = 10)
private String personNumber; //员工编号
@ExcelProperty(value = "岗位类型", index = 11)
@ExplicitConstraint(type = "GWMC", indexNum =11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "GWMC", indexNum =11, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String positionType; //岗位类型
@ExcelProperty(value = "是否进行安全培训", index = 12)
@ExplicitConstraint(type = "AQPX", indexNum =12, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "AQPX", indexNum =12, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String safetyTraining; //是否进行安全培训
@ExcelProperty(value = "人员状态", index = 13)
@ExplicitConstraint(type = "RYZT", indexNum =13, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内
@ExplicitConstraint(type = "RYZT", indexNum =13, sourceClass = CommonExplicitConstraint.class) //动态下拉内
private String stateCode; //人员状态
@ExcelProperty(value = "联系电话", index = 14)
private String telephone; //联系电话
......
......@@ -5,7 +5,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -27,7 +27,7 @@ public class RescueEquipmentDto extends BaseDto {
@ExcelProperty(value = "车辆类型", index = 0)
@ExplicitConstraint(type = "JYZBLX", indexNum = 0, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "JYZBLX", indexNum = 0, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "车辆类型")
private String vehicleType;
......@@ -44,7 +44,7 @@ public class RescueEquipmentDto extends BaseDto {
private Double fee;
@ExcelProperty(value = "单位名称", index =3)
@ExplicitConstraint(indexNum = 3, sourceClass = RoleNameExplicitConstraint.class,method="getUnitTeam") //动态下拉内容
@ExplicitConstraint(indexNum = 3, sourceClass = CommonExplicitConstraint.class,method="getUnitTeam") //动态下拉内容
@ApiModelProperty(value = "单位名称")
private String company;
......
......@@ -3,15 +3,13 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 特岗人员
*
......@@ -27,7 +25,7 @@ public class SpecialPositionStaffDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "岗位名称", index = 0)
@ExplicitConstraint(type = "GWMC", indexNum = 0, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "GWMC", indexNum = 0, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ApiModelProperty(value = "岗位名称")
private String positionName;
......@@ -40,7 +38,7 @@ public class SpecialPositionStaffDto extends BaseDto {
private Long personNumber;
@ExcelProperty(value = "单位名称", index = 2)
@ExplicitConstraint(indexNum = 2, sourceClass = RoleNameExplicitConstraint.class,method="getUnitTeam") //动态下拉内容
@ExplicitConstraint(indexNum = 2, sourceClass = CommonExplicitConstraint.class,method="getUnitTeam") //动态下拉内容
@ApiModelProperty(value = "单位名称")
private String company;
......
......@@ -3,8 +3,8 @@ package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -46,7 +46,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "资源类型(消火栓:hydrant、消防水鹤:crane、天然水源:natural、消防水池:pool)")
private String resourceType;
@ExplicitConstraint(type = "XFSYLX", indexNum = 2, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "XFSYLX", indexNum = 2, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "资源类型", index = 2)
@ApiModelProperty(value = "资源类型名称(消火栓、消防水鹤、天然水源、消防水池)")
private String resourceTypeName;
......@@ -55,7 +55,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "所在建筑id")
private Long belongBuildingId;
@ExplicitConstraint(indexNum = 3, sourceClass = RoleNameExplicitConstraint.class, method = "getBuildingList")
@ExplicitConstraint(indexNum = 3, sourceClass = CommonExplicitConstraint.class, method = "getBuildingList")
@ExcelProperty(value = "所在建筑", index = 3)
@ApiModelProperty(value = "所在建筑")
private String belongBuilding;
......@@ -64,7 +64,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "所属消防系统id")
private Long belongFightingSystemId;
@ExplicitConstraint(indexNum = 4, sourceClass = RoleNameExplicitConstraint.class, method = "getFireSystemList")
@ExplicitConstraint(indexNum = 4, sourceClass = CommonExplicitConstraint.class, method = "getFireSystemList")
@ExcelProperty(value = "所属消防系统", index = 4)
@ApiModelProperty(value = "所属消防系统")
private String belongFightingSystem;
......@@ -73,7 +73,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "管理单位id")
private Long managementUnitId;
@ExplicitConstraint(indexNum = 5, sourceClass = RoleNameExplicitConstraint.class, method = "getCompanyList")
@ExplicitConstraint(indexNum = 5, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "管理单位", index = 5)
@ApiModelProperty(value = "管理单位")
private String managementUnit;
......@@ -82,7 +82,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "维保单位id")
private Long maintenanceUnitId;
@ExplicitConstraint(indexNum = 6, sourceClass = RoleNameExplicitConstraint.class, method = "getCompanyList")
@ExplicitConstraint(indexNum = 6, sourceClass = CommonExplicitConstraint.class, method = "getCompanyList")
@ExcelProperty(value = "维保单位", index = 6)
@ApiModelProperty(value = "维保单位")
private String maintenanceUnit;
......@@ -103,19 +103,19 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "实景图集合")
private List<Object> realityImgList;
@ExcelProperty(value = "方位图", index = 9)
@ExcelIgnore
@ApiModelProperty(value = "方位图")
private String orientationImg;
@ExcelProperty(value = "实景图", index = 10)
@ExcelIgnore
@ApiModelProperty(value = "实景图")
private String realityImg;
@ExcelProperty(value = "联系人姓名", index = 11)
@ExcelProperty(value = "联系人姓名", index = 9)
@ApiModelProperty(value = "联系人姓名")
private String contactUser;
@ExcelProperty(value = "联系人电话", index = 12)
@ExcelProperty(value = "联系人电话", index = 10)
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
......@@ -143,7 +143,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "资源id")
private Long resourceId;
@ExcelProperty(value = "高度(cm)", index = 13)
@ExcelProperty(value = "高度(cm)", index = 11)
@ApiModelProperty(value = "高度(cm)")
private Float height;
......@@ -151,16 +151,16 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源可用状态类别代码")
private String statusCode;
@ExplicitConstraint(type = "SYKYZT", indexNum = 14, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 14)
@ExplicitConstraint(type = "SYKYZT", indexNum = 12, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源可用状态", index = 12)
@ApiModelProperty(value = "水源可用状态类别名称")
private String status;
@ExcelProperty(value = "所属路段", index = 15)
@ExcelProperty(value = "所属路段", index = 13)
@ApiModelProperty(value = "所属路段")
private String section;
@ExcelProperty(value = "所属管网", index = 16)
@ExcelProperty(value = "所属管网", index = 14)
@ApiModelProperty(value = "所属管网")
private String pipeNetwork;
......@@ -168,33 +168,33 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防给水管网形式类型代码")
private String pipeTypeCode;
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 17, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 17)
@ExplicitConstraint(type = "XFJSGWXS", indexNum = 15, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防给水管网形式", index = 15)
@ApiModelProperty(value = "消防给水管网形式")
private String pipeTypeName;
@ExcelProperty(value = "管网直径(cm)", index = 18)
@ExcelProperty(value = "管网直径(cm)", index = 16)
@ApiModelProperty(value = "管网直径(cm)")
private Float pipeDiameter;
@ExcelProperty(value = "进水管直径(cm)", index = 19)
@ExcelProperty(value = "进水管直径(cm)", index = 17)
@ApiModelProperty(value = "进水管直径(cm)")
private Float inletPipeDiameter;
@ExcelProperty(value = "出水管直径(cm)", index = 20)
@ExcelProperty(value = "出水管直径(cm)", index = 18)
@ApiModelProperty(value = "出水管直径(cm)")
private Float outletPipeDiameter;
@ExcelProperty(value = "加水车道数量(个)", index = 21)
@ExcelProperty(value = "加水车道数量(个)", index = 19)
@ApiModelProperty(value = "加水车道数量(个)")
private Integer waterfillingLaneNum;
@ExcelProperty(value = "供水单位名称", index = 22)
@ExcelProperty(value = "供水单位名称", index = 20)
@ApiModelProperty(value = "供水单位名称")
private String waterSupplyName;
@ExplicitConstraint(type = "XHSXTLX", indexNum = 23, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓系统类型", index = 23)
@ExplicitConstraint(type = "XHSXTLX", indexNum = 21, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓系统类型", index = 21)
@ApiModelProperty(value = "消火栓系统类型")
private String systemType;
......@@ -202,7 +202,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消火栓系统类型code")
private String systemTypeCode;
@ExcelProperty(value = "消防设施状况", index = 24)
@ExcelProperty(value = "消防设施状况", index = 22)
@ApiModelProperty(value = "消防设施状况分类")
private String facilitiesCategory;
......@@ -210,12 +210,12 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防设施状况分类code")
private String facilitiesCategoryCode;
@ExcelProperty(value = "道路路口路段", index = 25)
@ExcelProperty(value = "道路路口路段", index = 23)
@ApiModelProperty(value = "道路路口路段简要情况")
private String roadJunctionInfo;
@ExplicitConstraint(type = "XHSFZXS", indexNum = 26, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓放置形式", index = 26)
@ExplicitConstraint(type = "XHSFZXS", indexNum = 24, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消火栓放置形式", index = 24)
@ApiModelProperty(value = "消火栓放置形式")
private String placeForm;
......@@ -223,8 +223,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消火栓放置形式code")
private String placeFormCode;
@ExplicitConstraint(type = "XFSDJK", indexNum = 27, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防水带接口", index = 27)
@ExplicitConstraint(type = "XFSDJK", indexNum = 25, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "消防水带接口", index = 25)
@ApiModelProperty(value = "消防水带接口")
private String hoseConnection;
......@@ -232,8 +232,8 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "消防水带接口code")
private String hoseConnectionCode;
@ExplicitConstraint(type = "QSXS", indexNum = 28, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "取水形式", index = 28)
@ExplicitConstraint(type = "QSXS", indexNum = 26, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "取水形式", index = 26)
@ApiModelProperty(value = "取水形式")
private String intakeForm;
......@@ -241,61 +241,61 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "水源类型代码")
private String typeCode;
@ExplicitConstraint(type = "TRSYLX", indexNum = 29, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源类型", index = 29)
@ExplicitConstraint(type = "TRSYLX", indexNum = 27, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "水源类型", index = 27)
@ApiModelProperty(value = "水源类型")
private String type;
@ExcelProperty(value = "容积(m³)", index = 30)
@ExcelProperty(value = "容积(m³)", index = 28)
@ApiModelProperty(value = "容积(m³)")
private Float volume;
@ExcelProperty(value = "面积(㎡)", index = 31)
@ExcelProperty(value = "面积(㎡)", index = 29)
@ApiModelProperty(value = "面积(㎡)")
private Float area;
@ExcelProperty(value = "水质情况", index = 32)
@ExcelProperty(value = "水质情况", index = 30)
@ApiModelProperty(value = "水质情况")
private String qualitySituationInfo;
@ExcelProperty(value = "四季变化简要情况", index = 33)
@ExcelProperty(value = "四季变化简要情况", index = 31)
@ApiModelProperty(value = "四季变化简要情况")
private String seasonChangeInfo;
@ExplicitConstraint(indexNum = 34, source = {"1", "0"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 34)
@ExplicitConstraint(indexNum = 32, source = {"1", "0"}) //固定下拉内容
@ExcelProperty(value = "有无枯水期", index = 32)
@ApiModelProperty(value = "有无枯水期")
private Boolean hasDrySeason;
@ExcelProperty(value = "枯水期跨度简要情况", index = 35)
@ExcelProperty(value = "枯水期跨度简要情况", index = 33)
@ApiModelProperty(value = "枯水期跨度简要情况")
private String dryPeriodSpan;
@ExcelProperty(value = "取水高度(cm)", index = 36)
@ExcelProperty(value = "取水高度(cm)", index = 34)
@ApiModelProperty(value = "取水高度(cm)")
private Float intakeHeight;
@ExcelProperty(value = "水源标高差(cm)", index = 37)
@ExcelProperty(value = "水源标高差(cm)", index = 35)
@ApiModelProperty(value = "水源标高差(cm)")
private Float elevationDifference;
@ExcelProperty(value = "停车位置", index = 38)
@ExcelProperty(value = "停车位置", index = 36)
@ApiModelProperty(value = "停车位置")
private String parkingPosition;
@ExcelProperty(value = "停车数量(个)", index = 39)
@ExcelProperty(value = "停车数量(个)", index = 37)
@ApiModelProperty(value = "停车数量(个)")
private Integer parkingNum;
@ExcelProperty(value = "储水量容积", index = 40)
@ExcelProperty(value = "储水量容积", index = 38)
@ApiModelProperty(value = "储水量容积物联编码")
private String iotWaterStorage;
@ExcelProperty(value = "流量", index = 41)
@ExcelProperty(value = "流量", index = 39)
@ApiModelProperty(value = "流量物联编码")
private String iotFlowRate;
@ExcelProperty(value = "状态", index = 42)
@ExcelProperty(value = "状态", index = 40)
@ApiModelProperty(value = "状态物联编码")
private String iotStatus;
......@@ -313,7 +313,7 @@ public class WaterResourceDto extends BaseDto {
private Long equipId;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 43)
@ExcelProperty(value = "设施定义名称", index = 41)
private String equipName;
@ExcelIgnore
......@@ -321,8 +321,8 @@ public class WaterResourceDto extends BaseDto {
private Long equipCategoryId;
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
@ApiModelProperty("设施分类名称")
@ExplicitConstraint(indexNum = 44, sourceClass = RoleNameExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 44)
@ExplicitConstraint(indexNum = 44, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 42)
private String equipCategoryName;
@ApiModelProperty("设施编码")
......@@ -330,6 +330,6 @@ public class WaterResourceDto extends BaseDto {
private String equipCode;
@ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 45)
@ExcelProperty(value = "维保周期(月)", index = 43)
private String maintenancePeriod;
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* @author system_generator
* @date 2021-06-29
......
package com.yeejoin.amos.boot.module.common.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* @author system_generator
......
......@@ -5,7 +5,7 @@ package com.yeejoin.amos.boot.module.common.api.excel;
* 获取动态值
*
* **/
public class RoleNameExplicitConstraint implements ExplicitInterface {
public class CommonExplicitConstraint implements ExplicitInterface {
@Override
public String[] source(String type, String method, DataSources dataDictionaryMapper) throws Exception {
......
......@@ -10,3 +10,6 @@ import java.util.List;
public interface DataSources {
String[] selectList(String type,String method) throws Exception;
}
......@@ -34,5 +34,5 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersExcelDto> exportToExcel(Boolean isDelete);
List<String> getFirefightersName(String contactName);
List<String> getFirefightersName( );
}
......@@ -36,6 +36,6 @@ public KeySiteDto getSequenceNbr(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id);
public List<String> getAddress(String address);
public List<String> getAddress();
}
......@@ -99,7 +99,7 @@
a.name ,
a.contact_user contactUser,
a.contact_phone contactPhone,
( SELECT count( 1 ) FROM cb_firefighters WHERE fire_team_id = a.sequence_n br AND is_delete = 0 ) userNum,
( SELECT count( 1 ) FROM cb_firefighters WHERE fire_team_id = a.sequence_nbr AND is_delete = 0 ) userNum,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null
......
......@@ -159,13 +159,14 @@ AND fp.is_delete = 0
<select id="getFirefightersName" resultType="string">
SELECT
a.name
cb_firefighters.name
FROM
cb_firefighters a
cb_firefighters
WHERE
a.is_delete =0
and
a.name like concat ('%',#{contactName},'%')
cb_firefighters.is_delete = 0 AND
cb_firefighters.name IS NOT NULL AND
cb_firefighters.name != ''
group by cb_firefighters.name
</select>
</mapper>
......@@ -138,10 +138,14 @@
<select id="getAddress" resultType="string">
SELECT
c.address_desc
FROM cb_key_site c
where c.is_delete = FALSE
and
c.address_desc like concat ('%',#{address},'%');
cb_key_site.address_desc
FROM
cb_key_site
WHERE
cb_key_site.is_delete = FALSE AND
cb_key_site.address_desc IS NOT NULL AND
cb_key_site.address_desc != ''
GROUP BY
cb_key_site.address_desc
</select>
</mapper>
......@@ -565,6 +565,7 @@ GROUP BY
SELECT *
FROM cb_org_usr
WHERE is_delete = 0
and
amos_org_id = #{amosId}
</select>
......
......@@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -59,7 +59,7 @@ public class AircraftDto extends BaseDto {
@ApiModelProperty(value = "翼展面积")
private Double wingspanArea;
@ExplicitConstraint(type = "FDJLX", indexNum = 8, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "FDJLX", indexNum = 8, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "发动机类型", index = 8)
@ApiModelProperty(value = "发动机类型")
private String engineType;
......@@ -76,7 +76,7 @@ public class AircraftDto extends BaseDto {
@ApiModelProperty(value = "发动机型号")
private String engineModel;
@ExplicitConstraint(type = "RYLX", indexNum = 11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYLX", indexNum = 11, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "燃油类型", index = 11)
@ApiModelProperty(value = "燃油类型")
private String fuelType;
......
......@@ -4,7 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.CommonExplicitConstraint;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -47,7 +47,7 @@ public class AircraftDtos extends BaseRowModel {
@ApiModelProperty(value = "翼展面积")
private Double wingspanArea;
@ExplicitConstraint(type = "FDJLX", indexNum = 8, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "FDJLX", indexNum = 8, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "发动机类型", index = 8)
@ApiModelProperty(value = "发动机类型")
private String engineType;
......@@ -64,7 +64,7 @@ public class AircraftDtos extends BaseRowModel {
@ApiModelProperty(value = "发动机型号")
private String engineModel;
@ExplicitConstraint(type = "RYLX", indexNum = 11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExplicitConstraint(type = "RYLX", indexNum = 11, sourceClass = CommonExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "燃油类型", index = 11)
@ApiModelProperty(value = "燃油类型")
private String fuelType;
......
......@@ -108,4 +108,9 @@ public class AlertCalledDto extends BaseDto{
@ApiModelProperty(value = "警情状态str")
private String alertStatusStr;
@ApiModelProperty(value = "来源系统")
private String systemSource;
@ApiModelProperty(value = "系统来源code")
private String systemSourceCode;
}
......@@ -127,4 +127,11 @@ public class AlertCalled extends BaseEntity {
@TableField(exist=false)
@ApiModelProperty(value = "警情状态str")
private String alertStatusStr;
@ApiModelProperty(value = "来源系统")
private String systemSource;
@ApiModelProperty(value = "系统来源code")
private String systemSourceCode;
}
......@@ -36,9 +36,9 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
List<AlertCalledTodyDto> getTodayAlertCalled();
List<String> getContactName(String contactName);
List<String> getContactName( );
List<String> getAddress(String address);
List<String> getAddress();
List<AlertCalled> selectAllPage(Long current, Long size,
Integer alertStatus,
......
......@@ -190,24 +190,28 @@
<select id="getContactName" resultType="string">
SELECT
a.contact_user
jc_alert_called.contact_user
FROM
jc_alert_called a
jc_alert_called
WHERE
a.is_delete =0
and
a.contact_user like concat ('%',#{contactName},'%')
jc_alert_called.is_delete = 0 AND
jc_alert_called.contact_user IS NOT NULL AND
jc_alert_called.contact_user != ''
GROUP BY
jc_alert_called.contact_user
</select>
<select id="getAddress" resultType="string">
SELECT
a.address
jc_alert_called.address
FROM
jc_alert_called a
jc_alert_called
WHERE
a.is_delete =0
and
a.address like concat ('%',#{address},'%')
jc_alert_called.is_delete =0 AND
jc_alert_called.address IS NOT NULL AND
jc_alert_called.address != ''
GROUP BY
jc_alert_called.address
</select>
<!-- 未结束警情列表 -->
......
......@@ -48,11 +48,6 @@ public class DangerDto {
private Boolean deleted;
/**
* 治理方式
*/
private String governWay;
/**
* 业务类型(不同业务创建的隐患以此区分:巡检隐患、防火监督隐患、其他隐患。。。)
*/
private String bizType;
......
......@@ -7,7 +7,6 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import java.util.List;
/**
* 警情接警填报记录
......@@ -150,7 +149,7 @@ public class AlertCalledDto extends BaseDto {
private String describe;
@ApiModelProperty(value = "图片")
private List<String> images;
private String images;
@ApiModelProperty(value = "设备id")
private Long equipmentId;
......
......@@ -15,15 +15,15 @@ import java.util.Date;
public class ElevatorMaintenanceInfoDto {
@ApiModelProperty(value = "最新维保日期")
private Date maintenanceTime;
private Date maintainTime;
@ApiModelProperty(value = "下次维保日期")
private Date nextMaintenanceTime;
private Date nextMaintainTime;
@ApiModelProperty(value = "维保单位")
private String maintenanceUnit;
private String maintainUnit;
@ApiModelProperty(value = "维保人员")
private String maintenancePerson;
private String maintainPerson;
}
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="DispatchSaveFeedbackDto", description="救援回访DTO")
public class WechatDispatchFeedbackDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "任务id")
private Long taskId;
@ApiModelProperty(value = "维修结果")
private String fixResult;
@ApiModelProperty(value = "电梯故障原因分类")
private String errorResult;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "现场照片")
private List<AttachmentDto> imgs;
}
......@@ -225,4 +225,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "设备id")
private Long equipmentId;
@TableField("images")
@ApiModelProperty(value = "图片")
private String images;
}
......@@ -62,4 +62,10 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
String alertStage,
String alertStatus,
String address);
Map<String, Integer> getTodayEmergencyCount();
Map<String, Integer> getImportantEventCount();
Map<String, Integer> getImportantEventDetail();
}
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
......@@ -31,4 +32,6 @@ public interface IDispatchTaskService {
Boolean saveFinish(Long taskId);
List<WechatMyTaskListDto> getTaskListByPhonePager(String phone,String typeCode,Long current);
WechatMyTaskDto saveWechatFeedBack(WechatDispatchFeedbackDto wechatDispatchFeedbackDto);
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper">
<mapper
namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper">
<select id="queryAlertStatusCount" resultType="java.util.Map">
SELECT
count( 1 ) calledCount,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN alarm_type_code = '960' THEN 1 ELSE 0 END ) sleepyIncidentCount,
sum( CASE WHEN alarm_type_code = '961' THEN 1 ELSE 0 END ) faultRescueCount,
sum( CASE WHEN alarm_type_code = '962' THEN 1 ELSE 0 END ) suggestionsCount
sum( CASE WHEN father_alert is null THEN
1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN alarm_type_code = '960'
THEN 1 ELSE 0 END )
sleepyIncidentCount,
sum( CASE WHEN alarm_type_code
= '961' THEN 1 ELSE 0 END )
faultRescueCount,
sum( CASE WHEN
alarm_type_code = '962' THEN 1 ELSE 0 END )
suggestionsCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -16,9 +24,11 @@
and call_time >= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
and call_time <![CDATA[ <= ]]>
#{endDate}
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
......@@ -27,7 +37,8 @@
<select id="queryNearlyCount" resultType="java.util.Map">
SELECT
DATE_ADD(#{beginDate},INTERVAL -7 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum( CASE WHEN
father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -35,16 +46,19 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -7 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -7 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -7 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -6 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum(
CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -52,16 +66,19 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -6 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -6 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -6 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -5 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum(
CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -69,16 +86,19 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -5 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -5 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -5 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -4 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum(
CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -86,16 +106,19 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -4 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -4 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -4 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -3 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum(
CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -103,16 +126,19 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -3 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -3 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -3 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -2 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum(
CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -120,16 +146,19 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -2 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -2 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -2 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
UNION ALL
SELECT
DATE_ADD(#{beginDate},INTERVAL -1 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
sum(
CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -137,9 +166,11 @@
and call_time >= DATE_ADD(#{beginDate},INTERVAL -1 DAY)
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -1 DAY)
and call_time <![CDATA[ <= ]]>
DATE_ADD(#{endDate},INTERVAL -1 DAY)
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
<if
test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''">
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
</if>
......@@ -148,17 +179,20 @@
<select id="queryAlertListByQueryDto" resultType="java.util.Map">
SELECT
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
a.rec_user_name AS
creator,
a.emergency_person AS emergency,
a.call_time AS emergencyTime,
a.emergency_call AS emergencyCall,
a.device_id AS deviceId,
e.address AS elevatorAddress,
e.address AS
elevatorAddress,
a.region_code AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
CASE a.alert_status
CASE
a.alert_status
WHEN 0 THEN
'未完成'
WHEN 1 THEN
......@@ -168,34 +202,43 @@
END AS alertStatus
FROM
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.rescue_code = a.device_id
LEFT JOIN tcb_elevator e ON e.rescue_code =
a.device_id
WHERE 1=1
<if test="workOrderNumber != null and workOrderNumber != ''">
AND a.work_order_number like CONCAT(CONCAT('%',#{workOrderNumber}),'%')
AND a.work_order_number like
CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if>
<if test="creator != null and creator != ''">
AND a.rec_user_name like CONCAT(CONCAT('%',#{creator}),'%')
AND a.rec_user_name like
CONCAT(CONCAT('%',#{creator}),'%')
</if>
<if test="emergency != null and emergency != ''">
AND a.emergency_person like CONCAT(CONCAT('%',#{emergency}),'%')
AND a.emergency_person like
CONCAT(CONCAT('%',#{emergency}),'%')
</if>
<if test="emergencyTimeStart != null ">
and #{emergencyTimeStart} <![CDATA[ <= ]]> a.call_time
and #{emergencyTimeStart} <![CDATA[ <= ]]>
a.call_time
</if>
<if test="emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> #{emergencyTimeEnd}
and a.call_time <![CDATA[ <= ]]>
#{emergencyTimeEnd}
</if>
<if test="workOrderNumber != null and workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
and call_time <![CDATA[ <= ]]>
#{endDate}
</if>
<if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like CONCAT(CONCAT('%',#{emergencyCall}),'%')
AND a.emergency_call like
CONCAT(CONCAT('%',#{emergencyCall}),'%')
</if>
<if test="deviceId != null and deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{deviceId}),'%')
</if>
<if test="elevatorAddress != null and elevatorAddress != ''">
AND e.address like CONCAT(CONCAT('%',#{elevatorAddress}),'%')
AND e.address like
CONCAT(CONCAT('%',#{elevatorAddress}),'%')
</if>
<if test="address != null and address != ''">
AND a.region_code like CONCAT(CONCAT('%',#{address}),'%')
......@@ -213,11 +256,75 @@
AND a.alert_status = #{alertStatus}
</if>
</select>
<select id="getTodayEmergencyCount" resultType="java.util.Map">
SELECT
COUNT(alarm_type_code = '960') as sleepyTncidentTotal,
sum(
CASE
WHEN
alarm_type_code = '960'
AND alert_stage_code IN ('861', '862')
THEN
1
ELSE
0
END
) as rescueTotal ,
sum(
CASE
WHEN alarm_type_code = '960'
AND
alert_stage_code in
('864','865','866') THEN
1
ELSE
0
END
) as
rescueComplete
FROM
tz_alert_called where is_delete=0
</select>
<select id="getImportantEventCount" resultType="java.util.Map">
SELECT
count(afv.alert_called_id) as importantEventCount
FROM
tz_alert_called ac
LEFT JOIN (
SELECT
*
FROM
tz_alert_form_value
WHERE
tz_alert_form_value.field_value IS NOT NULL
AND tz_alert_form_value.field_value != ''
AND field_code IN ('injured_num', 'die_num')
and tz_alert_form_value.is_delete=0
) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE
ac.alarm_type_code = '960' and ac.is_delete=0
</select>
<select id="getImportantEventDetail" resultType="java.util.Map">
SELECT
ac.*
FROM
tz_alert_called ac
LEFT JOIN (
SELECT
*
FROM
tz_alert_form_value
WHERE
tz_alert_form_value.field_value IS NOT NULL
AND tz_alert_form_value.field_value != ''
AND field_code IN ('injured_num', 'die_num')
and tz_alert_form_value.is_delete=0
) afv ON ac.sequence_nbr = afv.alert_called_id
WHERE
ac.alarm_type_code = '960' and ac.is_delete=0
</select>
</mapper>
......@@ -36,7 +36,7 @@
<select id="getTaskInfoByTaskId" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto">
select
t.sequence_nbr
t.sequence_nbr,
t.alert_id as alertId,
p.sequence_nbr as paperId,
a.alert_stage as taskStatus,
......
......@@ -103,9 +103,9 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
public List<String> getFirefightersName(String contactName) {
public List<String> getFirefightersName( ) {
return firefightersMapper.getFirefightersName(contactName);
return firefightersMapper.getFirefightersName();
}
......
......@@ -312,7 +312,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
public List<String> getAddress(String address){
return keySiteMapper.getAddress(address);
public List<String> getAddress(){
return keySiteMapper.getAddress();
}
}
......@@ -344,9 +344,9 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAmosId", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报联系人模糊查询", notes = "警情填报联系人模糊查询")
public List<String> getContact (String contactName) {
public ResponseModel< List<String>> getContact ( ) {
return iAlertCalledService.getContactName(contactName);
return ResponseHelper.buildResponse(iAlertCalledService.getContactName());
}
/**
......@@ -358,9 +358,9 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getAddress", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "警情填报地址模糊查询", notes = "警情填报地址模糊查询")
public List<String> getAddress (String address) {
public ResponseModel<List<String>> getAddress () {
return iAlertCalledService.getCalledAddress(address);
return ResponseHelper.buildResponse(iAlertCalledService.getCalledAddress());
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -783,17 +779,19 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return resultList;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 开始*/
public List<String> getContactName(String contactName){
List<String> firefightersName = firefightersService.getFirefightersName(contactName);
List<String> contactNames = alertCalledMapper.getContactName(contactName);
public List<String> getContactName( ){
List<String> firefightersName = firefightersService.getFirefightersName();
List<String> contactNames = alertCalledMapper.getContactName();
firefightersName.addAll(contactNames);
return firefightersName;
}
public List<String> getCalledAddress(String address){
List<String> keyAddress = keySiteService.getAddress(address);
List<String> alertAddress = alertCalledMapper.getAddress(address);
public List<String> getCalledAddress( ){
List<String> keyAddress = keySiteService.getAddress();
List<String> alertAddress = alertCalledMapper.getAddress();
keyAddress.addAll(alertAddress);
return keyAddress;
}
/*2304 地址 联系人模糊查询缺失 陈召 2021-09-23 结束*/
......
......@@ -10,6 +10,7 @@ import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.DependsOn;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
import org.springframework.data.elasticsearch.core.SearchHit;
......@@ -37,6 +38,7 @@ import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
* @version $Id: ESAlertCalledService.java, v 0.1 2021年6月19日 下午5:12:01 gwb Exp $
*/
@Service
@DependsOn("liquibase")
public class ESAlertCalledService {
@Autowired
......
......@@ -74,12 +74,6 @@
<artifactId>poi-scratchpad</artifactId>
<version>3.15</version>
</dependency>
<dependency>
<groupId>fr.opensagres.xdocreport</groupId>
<artifactId>xdocreport</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
......@@ -103,5 +97,4 @@
<artifactId>jpush-client</artifactId>
</dependency>
</dependencies>
</project>
......@@ -69,12 +69,19 @@ public class HiddenDangerController extends AbstractBaseController {
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@ApiOperation(value = "下载模板")
@GetMapping("/download/template")
public void downloadTemplate(HttpServletResponse response) {
iHiddenDangerService.templateExport(response);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导入隐患", notes = "导入隐患")
@RequestMapping(value = "/import", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public ResponseModel importDanger(
@RequestParam(value = "planId") Long planId,
@RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "导入数据文件", required = true) @RequestBody MultipartFile file) {
String fileName = file.getOriginalFilename();
assert fileName != null;
......@@ -82,7 +89,7 @@ public class HiddenDangerController extends AbstractBaseController {
throw new RuntimeException("文件格式不正确");
}
List<HiddenDangerImportDto> list = FileHelper.importExcel(file, 0, 1, HiddenDangerImportDto.class);
iHiddenDangerService.importDanger(planId, pointId, list);
iHiddenDangerService.importDanger(planId, list);
return ResponseHelper.buildResponse("导入成功");
}
......
package com.yeejoin.amos.supervision.business.controller;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.supervision.business.vo.DangerTimeAxisVo;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.bo.RoleBo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.supervision.business.dto.DangerExecuteSubmitDto;
import com.yeejoin.amos.supervision.business.param.LatentDangerExcuteParam;
import com.yeejoin.amos.supervision.business.param.LatentDangerListParam;
import com.yeejoin.amos.supervision.business.param.LatentDangerNormalParam;
import com.yeejoin.amos.supervision.business.param.LatentDangerPatrolParam;
import com.yeejoin.amos.supervision.business.param.PageParam;
import com.yeejoin.amos.supervision.business.service.intfc.ILatentDangerService;
import com.yeejoin.amos.supervision.business.util.CommonResponse;
import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
import com.yeejoin.amos.supervision.business.util.FileHelper;
import com.yeejoin.amos.supervision.common.enums.DictTypeEnum;
import com.yeejoin.amos.supervision.core.common.response.DangerListResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@RestController
@RequestMapping(value = "/api/latent/danger")
@Api(tags = "隐患接口api")
public class LatentDangerController extends AbstractBaseController {
private final Logger logger = LoggerFactory.getLogger(LatentDangerController.class);
@Autowired
private ILatentDangerService iLatentDangerService;
@ApiOperation(value = "创建无码无计划隐患", notes = "创建无码无计划隐患")
@PostMapping(value = "/normal/save")
public CommonResponse saveNormal(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerNormalParam latentDangerParam) {
CommonResponse commonResponse = new CommonResponse();
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
String dangerLevelStr = String.valueOf(latentDangerParam.getDangerLevel());
if (iLatentDangerService.getDangerLevelJsonObject(dangerLevelStr, getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode()) == null) {
return CommonResponseUtil.failure("隐患等级有误");
}
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String deptId = getDepartmentId(reginParams);
String companyId = getCompanyId(reginParams);
String departmentName = getDepartmentName(reginParams);
RoleBo role = reginParams.getRole();
return iLatentDangerService.saveNormal(latentDangerParam, user.getUserId(),
user.getRealName(), deptId, departmentName, companyId, loginOrgCode, role);
} catch (Exception e) {
logger.error("创建普通隐患异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "创建巡检隐患", notes = "创建巡检隐患")
@PostMapping(value = "/patrol/save")
public CommonResponse savePatrol(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerPatrolParam latentDangerPatrolParam) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String deptId = getDepartmentId(reginParams);
String companyId = getCompanyId(reginParams);
String departmentName = getDepartmentName(reginParams);
RoleBo role = reginParams.getRole();
return iLatentDangerService.savePatrol(latentDangerPatrolParam, user.getUserId(),
user.getRealName(), deptId, departmentName, companyId, loginOrgCode, role);
} catch (Exception e) {
logger.error("创建巡检隐患异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "隐患列表", notes = "隐患列表")
@PostMapping(value = "/list")
public CommonResponse list(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerListParam latentDangerListParam) {
Date startDate = new Date();
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String deptId = null;
return iLatentDangerService.list(getToken(), getProduct(), getAppKey(), latentDangerListParam, user, loginOrgCode, deptId);
} catch (Exception e) {
logger.error("隐患列表异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}finally {
Date endDate = new Date();
logger.info("-------------------------隐患列表时间" +(endDate.getTime()-startDate.getTime()));
}
}
@ApiOperation(value = "隐患详情", notes = "隐患详情")
@GetMapping(value = "/detail")
public CommonResponse detail(@ApiParam(value = "任务Id", required = true) @RequestParam String id,
@ApiParam(value = "是否完成", required = true) @RequestParam boolean isFinish) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
return iLatentDangerService.detail(id, user.getUserId(),isFinish);
} catch (Exception e) {
logger.error("隐患详情异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "隐患执行记录", notes = "隐患执行记录")
@GetMapping(value = "/listFlowRecord")
public CommonResponse listFlowRecord(@ApiParam(value = "隐患编号", required = true) @RequestParam Long id) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
return iLatentDangerService.listFlowRecord(getToken(), getProduct(), getAppKey(), id);
} catch (Exception e) {
logger.error("隐患执行记录异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "流程执行", notes = "流程执行")
@PostMapping(value = "/excute")
public CommonResponse excute(@ApiParam(value = "隐患对象", required = true) @RequestBody LatentDangerExcuteParam latentDangerExcuteParam) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
ReginParams reginParams = getSelectedOrgInfo();
String deptId = getDepartmentId(reginParams);
String departmentName = getDepartmentName(reginParams);
String userRealName = user.getRealName();
String userId = user.getUserId();
RoleBo role = reginParams.getRole();
DangerExecuteSubmitDto executeSubmitDto = iLatentDangerService.execute(latentDangerExcuteParam, userId,
userRealName, deptId, departmentName, role);
// iLatentDangerService.freshRiskJudgmentLangerCount(latentDangerExcuteParam);//更新统计
if (executeSubmitDto.getIsOk()) {
if (!StringUtils.isEmpty(executeSubmitDto.getPointOriginalId())) {
iLatentDangerService.sendLatentDangerExcuteResult(executeSubmitDto);
}
return CommonResponseUtil.success();
} else {
return CommonResponseUtil.failure(executeSubmitDto.getMsg());
}
} catch (Exception e) {
logger.error("流程执行异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "根据流程实例编号获取隐患信息", notes = "根据流程实例编号获取隐患信息")
@GetMapping(value = "/getByInstanceId")
public CommonResponse getByInstanceId(@ApiParam(value = "流程实例编号", required = true) @RequestParam String instanceId) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
return iLatentDangerService.getByInstanceId(instanceId);
} catch (Exception e) {
logger.error("根据流程实例编号获取隐患信息异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "隐患按错计划流程执行回调", notes = "隐患按错计划流程执行回调")
@PostMapping(value = "/plan/flow/excuteCallBack")
public CommonResponse excuteCallBack(@ApiParam(value = "隐患按错计划流程执行回调对象") @RequestBody JSONObject json) {
try {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
String instanceId = json.getString("instanceId");
Integer actionType = json.getInteger("actionType");
String remark = json.getString("remark");
ReginParams reginParams = getSelectedOrgInfo();
String deptId = getDepartmentId(reginParams);
String departmentName = getDepartmentName(reginParams);
DangerExecuteSubmitDto executeSubmitDto = iLatentDangerService.excuteCallBack(instanceId, actionType, remark,
getToken(), user.getUserId(), user.getRealName(), deptId, departmentName);
if (executeSubmitDto.getIsOk()) {
if (!StringUtils.isEmpty(executeSubmitDto.getPointOriginalId())) {
iLatentDangerService.sendLatentDangerExcuteResult(executeSubmitDto);
}
return CommonResponseUtil.success();
} else {
return CommonResponseUtil.failure(executeSubmitDto.getMsg());
}
} catch (Exception e) {
logger.error("隐患按错计划流程执行回调异常", e.getMessage());
return CommonResponseUtil.failure("系统繁忙,请稍后再试");
}
}
@ApiOperation(value = "获取隐患等级", notes = "获取隐患等级")
@GetMapping(value = "/dangerLevel")
public CommonResponse getDangerLevel() {
return CommonResponseUtil.success(iLatentDangerService.getDangerLevel(getToken(), getProduct(), getAppKey(), DictTypeEnum.DANGERLEVEL.getCode()));
}
@ApiOperation(value = "获取隐患评审信息", notes = "获取隐患评审信息")
@GetMapping(value = "/review/info")
public CommonResponse getDangerReviewInfo(@ApiParam(value = "隐患id", required = true) @RequestParam Long dangerId) {
return CommonResponseUtil.success(iLatentDangerService.getReviewInfo(dangerId));
}
/**
* 隐患清单
*/
@ApiOperation(value = "隐患清单", notes = "隐患清单")
@PostMapping(value = "/page/list")
public CommonResponse listDanger(@ApiParam(value = "查询条件", required = true) @RequestBody PageParam pageParam) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
Page<DangerListResponse> result = iLatentDangerService.listDanger(pageParam);
return CommonResponseUtil.success(result);
}
/**
* 导出隐患清单
*/
@ApiOperation(value = "导出隐患清单", notes = "导出隐患清单")
@PostMapping(value = "/export")
public void exportDangerList(@ApiParam(value = "查询条件") @RequestBody PageParam pageParam,
HttpServletResponse response) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
throw new RuntimeException("用户session过期");
}
pageParam.setPageSize(Integer.MAX_VALUE);
List<DangerListResponse> list = iLatentDangerService.export(pageParam);
String fileName = "隐患清单" + new Date().getTime();
FileHelper.exportExcel(list, "隐患清单", "隐患清单", DangerListResponse.class, fileName + ".xls", response);
}
/**
* <pre>
* @Description: 查询隐患日志
* </pre>
*
* @MethodName:
* @Param: [userId, date]
* @Return: CommonResponse
* @Throws
* @Author keyong
* @Date 2021/3/11 11:42
*/
@ApiOperation(value = "隐患日志", notes = "查询隐患节点信息")
@GetMapping(value = "/listDangerTimeAxis")
public CommonResponse listTimeAxis(@ApiParam(value = "时间") @RequestParam(required = false) Integer dateTime) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
throw new RuntimeException("用户session过期");
}
try {
List<DangerTimeAxisVo> result = iLatentDangerService.queryExecuteLog(dateTime);
return CommonResponseUtil.success(result);
} catch (Exception e) {
return CommonResponseUtil.failure(e.getMessage());
}
}
}
package com.yeejoin.amos.supervision.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanAuditService;
import com.yeejoin.amos.supervision.business.util.CommonResponse;
import com.yeejoin.amos.supervision.business.util.CommonResponseUtil;
......@@ -33,7 +32,6 @@ public class PlanAuditController extends AbstractBaseController {
@ApiParam(value = "工作流流水实例", required = true) @RequestBody PlanAuditLog planAuditLog,
@ApiParam(value = "执行控制条件", required = true) @RequestParam String condition) {
try {
AgencyUserModel userInfo = getUserInfo();
ReginParams reginParams = getSelectedOrgInfo();
return CommonResponseUtil.success(planAuditService.auditWorkFlow(planAuditLog, condition, reginParams));
} catch (Exception e) {
......
......@@ -11,6 +11,7 @@ import com.yeejoin.amos.supervision.business.param.PointImportQueryParam;
import com.yeejoin.amos.supervision.business.vo.LeavelMovePointVo;
import com.yeejoin.amos.supervision.business.vo.PointInputItemVo;
import com.yeejoin.amos.supervision.business.vo.PointVo;
import com.yeejoin.amos.supervision.dao.entity.Point;
import com.yeejoin.amos.supervision.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Param;
......@@ -163,4 +164,11 @@ public interface PointMapper extends BaseMapper {
* 查询点id,name
*/
List<Map<String, Object>> getPlanExecuteTeams();
/**
* 查询计划下的单位信息
* @param planId
* @return
*/
List<Point> getPointByPlanId(String planId);
}
......@@ -30,7 +30,7 @@ public class HiddenDangerExportDto {
* 治理方式
*/
@Excel(name = "治理方式", orderNum = "3")
private String governWayName;
private String reformType;
/**
* 整改期限
......
package com.yeejoin.amos.supervision.business.dto;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class HiddenDangerImportDto {
......@@ -11,37 +11,32 @@ public class HiddenDangerImportDto {
/**
* 隐患名称
*/
@Excel(name = "隐患名称", orderNum = "1")
private String name;
/**
* 检查项记录id
*/
private Long bizId;
/**
* 隐患级别
* 隐患级别名称
*/
private String dangerLevel;
@Excel(name = "隐患级别名称", orderNum = "2")
private String dangerLevelName;
/**
* 治理方式
*/
private String governWay;
/**
* 业务类型(不同业务创建的隐患以此区分:巡检隐患、防火监督隐患、其他隐患。。。)
*/
private String bizType;
@Excel(name = "治理方式", orderNum = "3")
private String reformTypeName;
/**
* 整改期限
*/
@Excel(name = "整改期限", orderNum = "4")
private Date reformLimitDate;
/**
* 检查类型:1-自行检查 ;2计划检查
* 责任单位
*/
private String checkMode;
@Excel(name = "责任单位", orderNum = "5")
private String pointName;
}
package com.yeejoin.amos.supervision.business.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yeejoin.amos.boot.biz.common.excel.CommonExplicitConstraint;
import com.yeejoin.amos.boot.biz.common.excel.ExplicitConstraint;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author DELL
*/
@Data
public class HiddenDangerTemplateDto implements Serializable {
/**
* 隐患名称
*/
@ExcelProperty(value = "隐患名称", index = 0)
private String name;
/**
* 检查项名称
*/
@ExcelIgnore
@ExcelProperty(value = "检查项", index = 1)
private String inputItemName;
/**
* 隐患级别
*/
@ExcelProperty(value = "隐患级别", index = 2)
@ExplicitConstraint(sourceClass = CommonExplicitConstraint.class, method = "getDangerLevelData")
private String dangerLevelName;
/**
* 治理方式
*/
@ExcelProperty(value = "治理方式", index = 3)
@ExplicitConstraint(sourceClass = CommonExplicitConstraint.class, method = "getReformTypeData")
private String reformTypeName;
/**
* 整改期限
*/
@ExcelProperty(value = "整改期限", index = 4)
private Date reformLimitDate;
/**
* 检查时间
*/
@ExcelIgnore
@ExcelProperty(value = "检查时间", index = 5)
private String checkTime;
/**
* 2470 49 2052
* 检查人员名称
*/
@ExcelIgnore
@ExcelProperty(value = "检查人员名称", index = 6)
private String checkUserName;
/**
* 责任单位
*/
@ExcelProperty(value = "责任单位", index = 7)
@ExplicitConstraint(sourceClass = CommonExplicitConstraint.class, method = "getCompanyData")
private String pointName;
/**
* 状态
*/
@ExcelIgnore
@ExcelProperty(value = "状态", index = 8)
private String stateName;
/**
* 隐患来源
*/
@ExcelIgnore
@ExcelProperty(value = "隐患来源", index = 9)
private String dangerTypeName;
}
......@@ -4,36 +4,40 @@ package com.yeejoin.amos.supervision.business.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author DELL
*/
@FeignClient(value = "API-DANGER-API", path = "danger")
@FeignClient(value = "AMOS-LATENT-DANGER", path = "latentDanger/api/latent/danger", configuration = FeignConfiguration.class)
public interface DangerFeignClient {
/**
* 隐患详情
*
* @param sequenceNbr 隐患主键
* @param id 隐患主键
* @return FeignClientResult
*/
@GetMapping(value = "/{sequenceNbr}/detail")
FeignClientResult<DangerDto> getOne(@PathVariable Long sequenceNbr);
@GetMapping(value = "/detail")
FeignClientResult<DangerDto> getOne(@RequestParam Long id);
/**
* 隐患的创建或者更新
*
* @param danger 隐患对象数组
* @param latentDangerDtoList 隐患对象数组
* @return FeignClientResult
*/
@PostMapping(value = "/saveOrUpdateBatch")
FeignClientResult<List<DangerDto>> saveOrUpdateBatch(@RequestBody List<DangerDto> danger);
@PostMapping(value = "/patrol/save")
FeignClientResult<List<DangerDto>> saveOrUpdateBatch(@RequestBody List<DangerDto> latentDangerDtoList);
/**
* 隐患分页查询
......@@ -44,7 +48,7 @@ public interface DangerFeignClient {
* @param dangerState 隐患状态
* @return FeignClientResult
*/
@GetMapping(value = "/page-list")
@GetMapping(value = "/page/list")
FeignClientResult<IPage<DangerDto>> pageList(Page page, @RequestParam String ids, @RequestParam(required = false) String dangerLevel, @RequestParam(required = false) String dangerState);
......@@ -58,4 +62,21 @@ public interface DangerFeignClient {
*/
@GetMapping(value = "/list-all")
FeignClientResult<List<DangerDto>> listAll(@RequestParam String ids, @RequestParam(required = false) String dangerLevel, @RequestParam(required = false) String dangerState);
/**
* 隐患等级
*
* @return List<Object>
*/
@GetMapping(value = "/dangerLevel")
FeignClientResult<List<DictionarieValueModel>> getDangerLevelData();
/**
* 治理方式
*
* @return List<Object>
*/
@GetMapping(value = "/dangerGovernance")
FeignClientResult<List<DictionarieValueModel>> getDangerGovernanceData();
}
package com.yeejoin.amos.supervision.business.feign;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
public class FeignConfiguration {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters));
}
@Bean
public FeignBasicAuthRequestInterceptor basicAuthRequestInterceptor() {
return new FeignBasicAuthRequestInterceptor();
......
package com.yeejoin.amos.supervision.business.service.impl;
import com.yeejoin.amos.boot.biz.common.excel.DataSources;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.supervision.business.dao.mapper.PointMapper;
import com.yeejoin.amos.supervision.business.feign.DangerFeignClient;
import com.yeejoin.amos.supervision.dao.entity.Point;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author DELL
*/
@Service
public class DataSourcesImpl implements DataSources {
@Autowired
HttpServletRequest request;
@Autowired
DangerFeignClient dangerFeignClient;
@Autowired
PointMapper pointMapper;
@Override
public String[] selectList(String type, String method) {
String[] str = {};
FeignClientResult<List<DictionarieValueModel>> feignClientResult;
List<DictionarieValueModel> models;
switch (method) {
//隐患级别
case "getDangerLevelData":
feignClientResult = dangerFeignClient.getDangerLevelData();
models = feignClientResult.getResult();
str = models.stream().map(p -> p.getDictDataValue() + "@" + p.getDictCode()).toArray(String[]::new);
break;
//治理方式
case "getReformTypeData":
feignClientResult = dangerFeignClient.getDangerGovernanceData();
models = feignClientResult.getResult();
str = models.stream().map(p -> p.getDictDataValue() + "@" + p.getDictCode()).toArray(String[]::new);
break;
//责任单位
case "getCompanyData":
Map<String, String> param = getRequestParamMap();
List<Point> points = pointMapper.getPointByPlanId(param.get("planId"));
str = points.stream().map(p -> p.getName() + "@" + p.getId()).toArray(String[]::new);
break;
default:
break;
}
return str;
}
private Map<String, String> getRequestParamMap() {
Map<String, String[]> parameterMap = request.getParameterMap();
Map<String, String[]> localMap = new HashMap<>();
localMap.putAll(parameterMap);
localMap.remove("current");
localMap.remove("size");
Map<String, String> params = new HashMap<>();
if (!ValidationUtil.isEmpty(localMap)) {
for (String key : localMap.keySet()) {
if (!ValidationUtil.isEmpty(localMap.get(key))) {
params.put(key, localMap.get(key)[0]);
}
}
}
return params;
}
}
......@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.excel.DataSources;
import com.yeejoin.amos.boot.biz.common.excel.ExcelUtil;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.supervision.business.dao.mapper.HiddenDangerMapper;
import com.yeejoin.amos.supervision.business.dao.repository.IHiddenDangerDao;
......@@ -22,6 +24,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import javax.servlet.http.HttpServletResponse;
import java.util.Collections;
import java.util.Date;
import java.util.List;
......@@ -44,12 +47,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
@Autowired
HiddenDangerMapper hiddenDangerMapper;
@Value("${spring.application.name}")
private String applicationName;
@Value("${server.servlet.context-path}")
private String contextPath;
@Autowired
Sequence sequence;
@Autowired
DataSources dataSources;
@Override
public List<HiddenDangerExportDto> listAll(String planId, Long pointId, String level, String status) {
//1.查询指定计划和公司的关联隐患数据
......@@ -119,13 +125,19 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
}
@Override
public void importDanger(Long planId, Long pointId, List<HiddenDangerImportDto> list) {
public void importDanger(Long planId, List<HiddenDangerImportDto> list) {
//1.调用创建隐患
List<DangerDto> dtoList = list.stream().map(s -> {
String[] dangerArray = s.getDangerLevelName().split("@");
String[] reformTypeArray = s.getReformTypeName().split("@");
DangerDto dangerDto = new DangerDto();
Bean.copyExistPropertis(s, dangerDto);
dangerDto.setBizType(applicationName);
dangerDto.setBizType(contextPath);
dangerDto.setBizId(sequence.nextId());
dangerDto.setDangerLevel(dangerArray.length > 1 ? dangerArray[1] : "");
dangerDto.setDangerLevelName(dangerArray.length > 1 ? dangerArray[0] : "");
dangerDto.setReformType(reformTypeArray.length > 1 ? reformTypeArray[1] : "");
dangerDto.setReformTypeName(reformTypeArray.length > 1 ? reformTypeArray[0] : "");
//自行检查
dangerDto.setCheckMode("1");
return dangerDto;
......@@ -137,7 +149,6 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
HiddenDanger hiddenDanger = new HiddenDanger();
hiddenDanger.setCreateBy(RequestContext.getExeUserId());
hiddenDanger.setPlanId(planId);
hiddenDanger.setPointId(pointId);
hiddenDanger.setLatentDangerId(d.getId());
hiddenDanger.setCheckInputId(d.getBizId());
hiddenDanger.setDangerType("1");
......@@ -145,6 +156,15 @@ public class HiddenDangerServiceImpl implements IHiddenDangerService {
hiddenDanger.setCreateDate(new Date());
return hiddenDanger;
}).collect(Collectors.toList());
for (int i = 0; i <= hiddenDangers.size(); i++) {
String[] pointArray = list.get(i).getPointName().split("@");
hiddenDangers.get(i).setPointId(pointArray.length > 1 ? Long.parseLong(pointArray[1]) : null);
}
iHiddenDangerDao.saveAll(hiddenDangers);
}
@Override
public void templateExport(HttpServletResponse response) {
ExcelUtil.createTemplate(response, "隐患清单", "隐患清单", null, HiddenDangerExportDto.class, dataSources, true);
}
}
......@@ -36,12 +36,12 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
PlanAudit planAudit = planAuditDao.findByPlanId(planAuditLog.getPlanId());
if (ObjectUtils.isNotEmpty(planAudit)) {
String instanceId = planAudit.getProcessInstanceId();
Map<String, Object> taskAuthMap = workflowExcuteService.checkTaskAuthMap(instanceId);
Map<String, Object> taskAuthMap = workflowExcuteService.checkTaskAuthMap(instanceId, reginParams);
if (taskAuthMap != null && !taskAuthMap.isEmpty()) {
String taskId = taskAuthMap.get("taskId").toString();
String name = taskAuthMap.get("name").toString();
String taskId = taskAuthMap.get("taskId") == null ? null : taskAuthMap.get("taskId").toString();
String name = taskAuthMap.get("name") == null ? null : taskAuthMap.get("name").toString();
String roleName = reginParams.getRole().getRoleName();
boolean b = workflowExcuteService.CompleteTask(instanceId, condition);
boolean b = workflowExcuteService.CompleteTask(instanceId, condition, reginParams);
if (b) {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
workflowExcuteService.setTaskAssign(instanceId, personIdentity.getPersonSeq());
......
......@@ -142,7 +142,7 @@ public class PlanServiceImpl implements IPlanService {
if ("1".equals(checkTypeId)) {
processInstanceId = workflowExcuteService.startAndComplete(processDefinitionKey, CheckTypeSuEnum.SUPERVISED.getCondition());
} else if ("2".equals(checkTypeId)) {
processInstanceId = workflowExcuteService.startAndComplete(processDefinitionKey, CheckTypeSuEnum.SUPERVISED.getCondition());
processInstanceId = workflowExcuteService.startAndComplete(processDefinitionKey, CheckTypeSuEnum.DAILY.getCondition());
}
PlanAudit audit = new PlanAudit();
audit.setPlanId(param.getId());
......
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.supervision.business.dto.HiddenDangerExportDto;
import com.yeejoin.amos.supervision.business.dto.HiddenDangerImportDto;
import com.yeejoin.amos.supervision.core.common.dto.DangerDto;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
......@@ -56,8 +57,13 @@ public interface IHiddenDangerService {
/**
* 导入
* @param planId 计划id
* @param pointId 点id
* @param list 数据
*/
void importDanger(Long planId, Long pointId, List<HiddenDangerImportDto> list);
void importDanger(Long planId, List<HiddenDangerImportDto> list);
/**
* 下载模板
* @param response 输出
*/
void templateExport(HttpServletResponse response);
}
......@@ -101,11 +101,11 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "新增警情接警填报记录", notes = "新增警情接警填报记录")
public ResponseModel<AlertCalledDto> save(@RequestBody AlertCalledObjsDto alertCalledObjsDto) {
if (ValidationUtil.isEmpty(alertCalledObjsDto)
|| ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalledDto())){
|| ValidationUtil.isEmpty(alertCalledObjsDto.getAlertCalledDto())) {
throw new BadRequest("参数校验失败.");
}
ReginParams reginParams =getSelectedOrgInfo();
alertCalledObjsDto =iAlertCalledService.createAlertCalled(alertCalledObjsDto,reginParams.getUserModel());
ReginParams reginParams = getSelectedOrgInfo();
alertCalledObjsDto = iAlertCalledService.createAlertCalled(alertCalledObjsDto, reginParams.getUserModel());
return ResponseHelper.buildResponse(alertCalledObjsDto.getAlertCalledDto());
}
......@@ -117,24 +117,25 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/saveMobile")
@ApiOperation(httpMethod = "POST", value = "新增警情接警填报记录", notes = "新增警情接警填报记录")
public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto, @RequestParam String phone) {
if (ValidationUtil.isEmpty(alertCalledDto)){
public ResponseModel<AlertCalledDto> saveMobile(@RequestBody AlertCalledDto alertCalledDto,
@RequestParam String phone) {
if (ValidationUtil.isEmpty(alertCalledDto)) {
throw new BadRequest("参数校验失败.");
}
// 校验手机号 是否存在
LambdaQueryWrapper<WechatRelation> queryWrapper = new LambdaQueryWrapper();
queryWrapper.eq(WechatRelation::getPhone,phone);
queryWrapper.eq(WechatRelation::getPhone, phone);
WechatRelation wechatRelation = wechatRelationService.getOne(queryWrapper);
if(null == wechatRelation) {
if (null == wechatRelation) {
throw new BadRequest("手机号未注册");
}
// 校验电梯id是否正确
LambdaQueryWrapper<Elevator> queryWrapper1 = new LambdaQueryWrapper();
queryWrapper1.eq(Elevator::getSequenceNbr,Long.valueOf(alertCalledDto.getEquipmentId()));
queryWrapper1.eq(Elevator::getSequenceNbr, Long.valueOf(alertCalledDto.getEquipmentId()));
Elevator elevator = elevatorServiceImpl.getOne(queryWrapper1);
if(null == elevator) {
if (null == elevator) {
throw new BadRequest("电梯不存在");
}
// 将电梯地址设置到警情地址
......@@ -163,10 +164,8 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "相似警情分页查询")
@PostMapping(value = "/page/similar")
public ResponseModel<Page<ESAlertCalledDto>> pageBySimilar(
@RequestBody ESAlertCalledRequestDto alertCalledVo,
@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception {
public ResponseModel<Page<ESAlertCalledDto>> pageBySimilar(@RequestBody ESAlertCalledRequestDto alertCalledVo,
@RequestParam(value = "current") int current, @RequestParam(value = "size") int size) throws Exception {
Page<ESAlertCalledDto> esAlertCalledDtoPage = eSAlertCalledService.queryByKeys(alertCalledVo, current, size);
return ResponseHelper.buildResponse(esAlertCalledDtoPage);
......@@ -180,7 +179,7 @@ public class AlertCalledController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{id}")
@ApiOperation(httpMethod = "GET",value = "根据id查询单个警情接警填报记录", notes = "根据id查询单个警情接警填报记录")
@ApiOperation(httpMethod = "GET", value = "根据id查询单个警情接警填报记录", notes = "根据id查询单个警情接警填报记录")
public ResponseModel<Object> selectOne(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledById(id));
}
......@@ -192,11 +191,11 @@ public class AlertCalledController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getWorkOderNumber")
@ApiOperation(httpMethod = "GET",value = "生成工单编号报警人及报警时间", notes = "生成工单编号报警人及报警时间")
@ApiOperation(httpMethod = "GET", value = "生成工单编号报警人及报警时间", notes = "生成工单编号报警人及报警时间")
public ResponseModel<AlertCallInfoDto> selectOne() throws ParseException {
String workOrderNumber = nextId();
AlertCallInfoDto alertCallInfoDto = new AlertCallInfoDto();
alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss "));
alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss "));
alertCallInfoDto.setWorkOrderNumber(workOrderNumber);
alertCallInfoDto.setRecUserId(getUserInfo().getUserId());
alertCallInfoDto.setRecUserName(getUserInfo().getRealName());
......@@ -210,19 +209,21 @@ public class AlertCalledController extends BaseController {
*/
public synchronized String nextId() throws ParseException {
String number = DateUtils.stampToDate(SystemClock.now(),"yyyy-MM-dd HH:mm:ss SSS");
String newNumber = number.replace("-","").replace(" ","").replace(":","");
ReginParams reginParams =getSelectedOrgInfo();
String number = DateUtils.stampToDate(SystemClock.now(), "yyyy-MM-dd HH:mm:ss SSS");
String newNumber = number.replace("-", "").replace(" ", "").replace(":", "");
ReginParams reginParams = getSelectedOrgInfo();
AgencyUserModel user = reginParams.getUserModel();
String orgCode = ValidationUtil.isEmpty(user.getCompanys()) ? null : user.getCompanys().get(0).getOrgCode();
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),
DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),orgCode,
Map<String, Object> map = iAlertCalledService.getAlertInfoList(
DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_TIME_PATTERN),
DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_TIME_PATTERN), orgCode,
user.getUserId());
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(newNumber);
String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1" : String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString() ;
String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1"
: String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString();
return workOrderNumber;
}
......@@ -233,50 +234,57 @@ public class AlertCalledController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/alertStatistics")
@ApiOperation(httpMethod = "GET",value = "警情统计", notes = "警情统计")
@ApiOperation(httpMethod = "GET", value = "警情统计", notes = "警情统计")
public ResponseModel<AlarmStatisticsDto> alertStatistics() {
ReginParams reginParams =getSelectedOrgInfo();
ReginParams reginParams = getSelectedOrgInfo();
//我的待办数量
// 我的待办数量
QueryWrapper<AlertCalled> todoNumQueryWrapper = new QueryWrapper<>();
//全部待办数量
// 全部待办数量
QueryWrapper<AlertCalled> allNumQueryWrapper = new QueryWrapper<>();
AlarmStatisticsDto alarmStatisticsDto = new AlarmStatisticsDto();
todoNumQueryWrapper.eq("alert_status",false);
allNumQueryWrapper.eq("alert_status",false);
if(null != reginParams) {
todoNumQueryWrapper.eq("rec_user_id",reginParams.getUserModel().getUserId());
todoNumQueryWrapper.eq("alert_status", false);
allNumQueryWrapper.eq("alert_status", false);
if (null != reginParams) {
todoNumQueryWrapper.eq("rec_user_id", reginParams.getUserModel().getUserId());
todoNumQueryWrapper.or(true);
todoNumQueryWrapper.eq("org_code",reginParams.getCompany().getOrgCode());
todoNumQueryWrapper.eq("org_code", reginParams.getCompany().getOrgCode());
alarmStatisticsDto.setTodoNum(iAlertCalledService.list(todoNumQueryWrapper).size());
alarmStatisticsDto.setAllNum(iAlertCalledService.list(allNumQueryWrapper).size());
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN),null,
Map<String, Object> map = iAlertCalledService.getAlertInfoList(
DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), 1).getTime(), DateUtils.DATE_PATTERN), null,
getUserInfo().getUserId());
// 当天接警
alarmStatisticsDto.setTodayAlarmNum(map.get("calledCount") == null ? 0 : Integer.valueOf(map.get("calledCount").toString())) ;
//当天提交
alarmStatisticsDto.setSubmitNum(map.get("majorAlertCount") == null ? 0 : Integer.valueOf(map.get("majorAlertCount").toString())) ;
//投诉咨询数量
alarmStatisticsDto.setSuggestions(map.get("suggestionsCount") == null ? 0 : Integer.valueOf(map.get("suggestionsCount").toString())) ;
//故障维修数量
alarmStatisticsDto.setFaultRescue(map.get("faultRescueCount") == null ? 0 : Integer.valueOf(map.get("faultRescueCount").toString())) ;
//困人救援数量
alarmStatisticsDto.setSleepyIncident(map.get("sleepyIncidentCount") == null ? 0 : Integer.valueOf(map.get("sleepyIncidentCount").toString())) ;
LinkedHashMap<String,Integer> recordMap = new LinkedHashMap<>();
alarmStatisticsDto.setTodayAlarmNum(
map.get("calledCount") == null ? 0 : Integer.valueOf(map.get("calledCount").toString()));
// 当天提交
alarmStatisticsDto.setSubmitNum(
map.get("majorAlertCount") == null ? 0 : Integer.valueOf(map.get("majorAlertCount").toString()));
// 投诉咨询数量
alarmStatisticsDto.setSuggestions(
map.get("suggestionsCount") == null ? 0 : Integer.valueOf(map.get("suggestionsCount").toString()));
// 故障维修数量
alarmStatisticsDto.setFaultRescue(
map.get("faultRescueCount") == null ? 0 : Integer.valueOf(map.get("faultRescueCount").toString()));
// 困人救援数量
alarmStatisticsDto.setSleepyIncident(map.get("sleepyIncidentCount") == null ? 0
: Integer.valueOf(map.get("sleepyIncidentCount").toString()));
LinkedHashMap<String, Integer> recordMap = new LinkedHashMap<>();
// 近七天办理数量
Map<String, Object> nearlySevenDaysMap = iAlertCalledService.getNearlyInfo(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN),null,
Map<String, Object> nearlySevenDaysMap = iAlertCalledService.getNearlyInfo(
DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), 1).getTime(), DateUtils.DATE_PATTERN), null,
getUserInfo().getUserId());
for(int i = 0; i<nearlySevenDaysMap.size()/2;i++) {
recordMap.put(DateUtils.dateToString(nearlySevenDaysMap.get("dateTime"+i).toString()), Integer.parseInt(nearlySevenDaysMap.get("majorAlertCount"+i).toString()));
for (int i = 0; i < nearlySevenDaysMap.size() / 2; i++) {
recordMap.put(DateUtils.dateToString(nearlySevenDaysMap.get("dateTime" + i).toString()),
Integer.parseInt(nearlySevenDaysMap.get("majorAlertCount" + i).toString()));
}
alarmStatisticsDto.setNearlySevenDaysNum(recordMap);
}
......@@ -292,14 +300,15 @@ public class AlertCalledController extends BaseController {
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET",value = "警情接警填报记录分页查询", notes = "警情接警填报记录分页查询")
public ResponseModel<IPage<AlertCalledDto>> queryForPage(String pageNum, String pageSize,String sort, AlertCalledDto alertCalledDto) {
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledDto,AlertCalled.class);
@ApiOperation(httpMethod = "GET", value = "警情接警填报记录分页查询", notes = "警情接警填报记录分页查询")
public ResponseModel<IPage<AlertCalledDto>> queryForPage(String pageNum, String pageSize, String sort,
AlertCalledDto alertCalledDto) {
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledDto, AlertCalled.class);
Page<AlertCalled> pageBean;
IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort);
setQueryWrapper(alertCalledQueryWrapper, alertCalled, sort);
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
pageBean = new Page<>(0, Long.MAX_VALUE);
......@@ -311,35 +320,37 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(calledVoIPage);
}
private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled,String sort){
private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled,
String sort) {
queryWrapper.eq("is_delete", 0);
queryWrapper.orderByDesc("call_time");
if(!ValidationUtil.isEmpty(alertCalled.getIsAuxiliaryScreen())) {
if(!ValidationUtil.isEmpty(alertCalled.getCallTimeStart()) && !ValidationUtil.isEmpty(alertCalled.getCallTimeEnd())) {
if (!ValidationUtil.isEmpty(alertCalled.getIsAuxiliaryScreen())) {
if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())
&& !ValidationUtil.isEmpty(alertCalled.getCallTimeEnd())) {
queryWrapper.between("call_time", alertCalled.getCallTimeStart(),
alertCalled.getCallTimeEnd().getTime());
}
} else {
queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(), DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(), 1).getTime(), DateUtils.DATE_PATTERN));
}
if (alertCalled.getIsFatherAlert()) { // 0:接警;1:处警
queryWrapper.isNull("father_alert");
}
if(!ValidationUtil.isEmpty(alertCalled.getType())) {
queryWrapper.eq("type",alertCalled.getType());
if (!ValidationUtil.isEmpty(alertCalled.getType())) {
queryWrapper.eq("type", alertCalled.getType());
}
if(!ValidationUtil.isEmpty(alertCalled.getAlarmType())) {
queryWrapper.eq("alarm_type",alertCalled.getAlarmType());
if (!ValidationUtil.isEmpty(alertCalled.getAlarmType())) {
queryWrapper.eq("alarm_type", alertCalled.getAlarmType());
}
if(!ValidationUtil.isEmpty(alertCalled.getAlertSource())) {
queryWrapper.eq("alert_source",alertCalled.getAlertSource());
if (!ValidationUtil.isEmpty(alertCalled.getAlertSource())) {
queryWrapper.eq("alert_source", alertCalled.getAlertSource());
}
return queryWrapper;
}
......@@ -348,27 +359,24 @@ public class AlertCalledController extends BaseController {
@ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录")
@GetMapping("/selectRecord")
public ResponseModel<Page<AlertCalledQueryDto>> queryAlertCalledByPager(AlertCalledQueryDto alertCalledQueryDto,
@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize) {
@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize") int pageSize) {
Page<AlertCalledQueryDto> page = new Page<AlertCalledQueryDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
Page<AlertCalledQueryDto> pageBean = iAlertCalledService.queryAlertListByQueryDto(
page,
alertCalledQueryDto.getWorkOrderNumber(),
alertCalledQueryDto.getCreator(),
Page<AlertCalledQueryDto> pageBean = iAlertCalledService.queryAlertListByQueryDto(page,
alertCalledQueryDto.getWorkOrderNumber(), alertCalledQueryDto.getCreator(),
alertCalledQueryDto.getEmergency(),
alertCalledQueryDto.getEmergencyTimeStart() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeStart()),
alertCalledQueryDto.getEmergencyTimeEnd() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeEnd()),
alertCalledQueryDto.getEmergencyCall(),
alertCalledQueryDto.getDeviceId(),
alertCalledQueryDto.getElevatorAddress(),
alertCalledQueryDto.getAlertType(),
alertCalledQueryDto.getAlertSource(),
alertCalledQueryDto.getAlertStage(),
alertCalledQueryDto.getEmergencyTimeStart() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeStart()),
alertCalledQueryDto.getEmergencyTimeEnd() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeEnd()),
alertCalledQueryDto.getEmergencyCall(), alertCalledQueryDto.getDeviceId(),
alertCalledQueryDto.getElevatorAddress(), alertCalledQueryDto.getAlertType(),
alertCalledQueryDto.getAlertSource(), alertCalledQueryDto.getAlertStage(),
alertCalledQueryDto.getAlertStatus());
Page<AlertCalledQueryDto> result = new Page<AlertCalledQueryDto>(alertCalledQueryDto.getPageNum(), alertCalledQueryDto.getPageSize());
Page<AlertCalledQueryDto> result = new Page<AlertCalledQueryDto>(alertCalledQueryDto.getPageNum(),
alertCalledQueryDto.getPageSize());
long totle = pageBean.getTotal();
result.setRecords(pageBean.getRecords());
result.setTotal(totle);
......@@ -381,29 +389,26 @@ public class AlertCalledController extends BaseController {
public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
Page<AlertCalledQueryDto> page = new Page<AlertCalledQueryDto>();
Page<AlertCalledQueryDto> pageBean = iAlertCalledService.queryAlertListByQueryDto(
page,
alertCalledQueryDto.getWorkOrderNumber(),
alertCalledQueryDto.getCreator(),
Page<AlertCalledQueryDto> pageBean = iAlertCalledService.queryAlertListByQueryDto(page,
alertCalledQueryDto.getWorkOrderNumber(), alertCalledQueryDto.getCreator(),
alertCalledQueryDto.getEmergency(),
alertCalledQueryDto.getEmergencyTimeStart() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeStart()),
alertCalledQueryDto.getEmergencyTimeEnd() == null ? null : DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeEnd()),
alertCalledQueryDto.getEmergencyCall(),
alertCalledQueryDto.getDeviceId(),
alertCalledQueryDto.getElevatorAddress(),
alertCalledQueryDto.getAlertType(),
alertCalledQueryDto.getAlertSource(),
alertCalledQueryDto.getAlertStage(),
alertCalledQueryDto.getEmergencyTimeStart() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeStart()),
alertCalledQueryDto.getEmergencyTimeEnd() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getEmergencyTimeEnd()),
alertCalledQueryDto.getEmergencyCall(), alertCalledQueryDto.getDeviceId(),
alertCalledQueryDto.getElevatorAddress(), alertCalledQueryDto.getAlertType(),
alertCalledQueryDto.getAlertSource(), alertCalledQueryDto.getAlertStage(),
alertCalledQueryDto.getAlertStatus());
List<AlertCalledQueryDto> list = pageBean.getRecords();
String fileName = "警情事件记录" + System.currentTimeMillis();
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list,
AlertCalledQueryDto.class, null, false);
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list, AlertCalledQueryDto.class, null, false);
}
/**
* 冻结工单-维修
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -411,18 +416,19 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "冻结工单-维修", notes = "冻结工单-维修")
public ResponseModel<Boolean> forzenAlertById(@RequestBody AlertCalledDto alertCalledDto) {
if (ValidationUtil.isEmpty(alertCalledDto.getSequenceNbr())
|| ValidationUtil.isEmpty(alertCalledDto.getForzenResult())){
|| ValidationUtil.isEmpty(alertCalledDto.getForzenResult())) {
throw new BadRequest("参数校验失败.");
}
LambdaUpdateWrapper<AlertCalled> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(AlertCalled::getForzenResult,alertCalledDto.getForzenResult());
updateWrapper.set(AlertCalled::getAlertStatus,true);
updateWrapper.eq(AlertCalled::getSequenceNbr,alertCalledDto.getSequenceNbr());
updateWrapper.set(AlertCalled::getForzenResult, alertCalledDto.getForzenResult());
updateWrapper.set(AlertCalled::getAlertStatus, true);
updateWrapper.eq(AlertCalled::getSequenceNbr, alertCalledDto.getSequenceNbr());
return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper));
}
/**
* 工单结案-投诉
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -430,14 +436,46 @@ public class AlertCalledController extends BaseController {
@ApiOperation(httpMethod = "POST", value = "工单结案-投诉", notes = "工单结案-投诉")
public ResponseModel<Boolean> finishAlertById(@RequestBody AlertCalledDto alertCalledDto) {
if (ValidationUtil.isEmpty(alertCalledDto.getFinalReason())
|| ValidationUtil.isEmpty(alertCalledDto.getSequenceNbr())){
|| ValidationUtil.isEmpty(alertCalledDto.getSequenceNbr())) {
throw new BadRequest("参数校验失败.");
}
LambdaUpdateWrapper<AlertCalled> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(AlertCalled::getFinalReason,alertCalledDto.getFinalReason());
updateWrapper.set(AlertCalled::getAlertStatus,true);
updateWrapper.eq(AlertCalled::getSequenceNbr,alertCalledDto.getSequenceNbr());
updateWrapper.set(AlertCalled::getFinalReason, alertCalledDto.getFinalReason());
updateWrapper.set(AlertCalled::getAlertStatus, true);
updateWrapper.eq(AlertCalled::getSequenceNbr, alertCalledDto.getSequenceNbr());
return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper));
}
/**
* 今日应急统计
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTodayEmergencyCount")
@ApiOperation(httpMethod = "GET", value = "今日应急统计", notes = "今日应急统计")
public ResponseModel<Object> getTodayEmergencyCount() {
return ResponseHelper.buildResponse(iAlertCalledService.getTodayEmergencyCount());
}
/**
* 重大事件
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getImportantEventCount")
@ApiOperation(httpMethod = "GET", value = "重要大事件统计", notes = "重要大事件统计")
public ResponseModel<Object> getImportantEventCount() {
return ResponseHelper.buildResponse(iAlertCalledService.getImportantEventCount());
}
/**
* 获取重大事件或者今日应急的统计详情信息
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getImportantEventOrTodayEmergencyCount")
@ApiOperation(httpMethod = "GET", value = "重要大事件统计", notes = "重要大事件统计")
public ResponseModel<Object> getImportantEventOrTodayEmergencyCount(@RequestParam String type) {
return ResponseHelper.buildResponse(iAlertCalledService.getImportantEventOrTodayEmergencyCount(type));
}
}
......@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatDispatchFeedbackDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -84,4 +86,16 @@ public class DispatchTaskController extends BaseController {
List<DispatchTask> list = dispatchTaskServiceImpl.list(queryWrapper);
return ResponseHelper.buildResponse(list);
}
/**
* 微信公众号维修反馈接口
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveWechatFeed")
@ApiOperation(httpMethod = "POST", value = "微信公众号维修反馈接口", notes = "微信公众号维修反馈接口")
public ResponseModel<WechatMyTaskDto> saveWechatFeedBack(@RequestBody WechatDispatchFeedbackDto model) {
return ResponseHelper.buildResponse(dispatchTaskServiceImpl.saveWechatFeedBack(model));
}
}
......@@ -294,23 +294,23 @@ public class ElevatorController extends BaseController {
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getElevatorInfo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取电梯使用单位", notes = "获取电梯使用单位")
@ApiOperation(httpMethod = "GET", value = "根据电梯id或电梯救援识别码获取电梯信息", notes = "根据电梯id或电梯救援识别码获取电梯信息")
public ResponseModel<ElevatorInfoDto> getElevatorInfo(Long sequenceNbr,String rescueCode) {
if(StringUtils.isBlank(rescueCode) && sequenceNbr == null) {
throw new BadRequest("参数错误");
}
Elevator elevator;
ElevatorInfoDto elevatorInfoDto = new ElevatorInfoDto();
if(null != sequenceNbr) {
ElevatorBaseInfoDto baseInfoDto = new ElevatorBaseInfoDto();
Elevator elevator = elevatorService.getById(sequenceNbr);
elevator = elevatorService.getById(sequenceNbr);
Bean.toPo(elevator,baseInfoDto);
elevatorInfoDto.setElevatorBaseInfoDto(baseInfoDto);
} else {
QueryWrapper<Elevator> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("rescue_code",rescueCode);
Elevator elevator = elevatorService.getOne(queryWrapper);
elevator = elevatorService.getOne(queryWrapper);
if(null == elevator) {
throw new BadRequest("电梯应急救援码错误");
}
......@@ -320,7 +320,7 @@ public class ElevatorController extends BaseController {
}
QueryWrapper<MaintainInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("enevator_id", null == sequenceNbr ? rescueCode : String.valueOf(sequenceNbr));
queryWrapper.eq("enevator_id", null == sequenceNbr ? elevator.getSequenceNbr() : String.valueOf(sequenceNbr));
MaintainInfo maintainInfo = maintainInfoService.getOne(queryWrapper);
if(null != maintainInfo) {
ElevatorMaintenanceInfoDto elevatorMaintenanceInfoDto = new ElevatorMaintenanceInfoDto();
......@@ -329,7 +329,7 @@ public class ElevatorController extends BaseController {
}
QueryWrapper<TestInfo> queryWrapper1 = new QueryWrapper<>();
queryWrapper.eq("enevator_id", null == sequenceNbr ? rescueCode : String.valueOf(sequenceNbr));
queryWrapper1.eq("enevator_id", null == sequenceNbr ? elevator.getSequenceNbr() : String.valueOf(sequenceNbr));
TestInfo testInfo = testInfoService.getOne(queryWrapper1);
if(null != testInfo) {
ElevatorTestInfoDto elevatorTestInfoDto = new ElevatorTestInfoDto();
......
......@@ -4,28 +4,27 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto;
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.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService;
import com.yeejoin.amos.boot.module.tzs.api.service.IWechatService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -33,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
......@@ -49,8 +49,8 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
......@@ -67,6 +67,8 @@ public class WechatController extends BaseController {
private final String token = "yeejoin_2021";
private final String WeUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
@Autowired
RedisUtils redisUtils;
......@@ -111,6 +113,41 @@ public class WechatController extends BaseController {
}
/**
* 获取微信签名
* @param timestamp
* @param noncestr
* @param url
* @return
*/
@TycloudOperation(ApiLevel = UserType.ANONYMOUS , needAuth = false)
@GetMapping(value = "/getSignature")
@ApiOperation(httpMethod = "GET", value = "获取微信签名", notes = "获取微信签名")
public String getSignature(@RequestParam String timestamp,@RequestParam String noncestr,@RequestParam String url) {
List<String> params = new ArrayList<String>();
try {
if(!redisUtils.hasKey(RedisKey.WECHAT_TOKEN)){
throw new BadRequest("token不存在或已失效");
}
String token = redisUtils.get(RedisKey.WECHAT_TOKEN).toString();
String result = HttpUtils.doGet(WeUrl+token+"&type=jsapi");
JSONObject jsonObject = JSONObject.parseObject(result);
String ticket = jsonObject.get("ticket").toString();
params.add("jsapi_ticket="+ticket);
params.add(noncestr);
params.add(timestamp);
params.add(url);
Collections.sort(params);
String tokenStr = StringUtils.join(params,"&");
tokenStr = DigestUtils.sha1Hex(tokenStr);
return tokenStr;
} catch (Exception e) {
throw new BadRequest(e.getMessage());
}
}
/**
* 获取微信推送的操作通知
* @param xml
* @param resp
......@@ -618,4 +655,29 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(dispatchTaskService.getTaskListByPhonePager(phone, taskType, currentPage));
}
/**
* 微信端图片上传
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/uploadImage")
@ApiOperation(httpMethod = "POST", value = "微信公众号上传图片", notes = "微信公众号上传图片")
public ResponseModel<String> uploadImage(@ApiParam(value = "图片", required = true)@RequestParam MultipartFile file
) {
if (ValidationUtil.isEmpty(file)){
throw new BadRequest("参数校验失败.");
}
FeignClientResult<Map<String, String>> date = Systemctl.fileStorageClient.updateCommonFile(file);
String urlString="";
if (date != null) {
Map<String, String> map = date.getResult();
Iterator<String> it = map.keySet().iterator();
while (it.hasNext()) {
urlString=it.next();
}
}
return ResponseHelper.buildResponse(urlString);
}
}
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -36,6 +37,7 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -393,4 +395,27 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return result;
}
public Object getTodayEmergencyCount() {
return alertCalledMapper.getTodayEmergencyCount();
}
public Object getImportantEventCount() {
return alertCalledMapper.getImportantEventCount();
}
public Object getImportantEventOrTodayEmergencyCount(String type) {
List<Map<String, Object>> map=null;
LambdaQueryWrapper<AlertCalled> queryWrapper=new LambdaQueryWrapper<AlertCalled>();
queryWrapper.eq(AlertCalled::getIsDelete, 0);
queryWrapper.eq(AlertCalled::getAlarmTypeCode, "960");
if("rescueTotal".equals(type)) {
queryWrapper.in(AlertCalled::getAlertStageCode,Arrays.asList("861","862"));
}else if("rescueComplete".equals(type)) {
queryWrapper.in(AlertCalled::getAlertStageCode,Arrays.asList("864","865","866"));
}
if("importantEventCount".equals(type)) {
return alertCalledMapper.getImportantEventDetail();
}
return this.baseMapper.selectMaps(queryWrapper);
}
}
\ No newline at end of file
......@@ -4,11 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DispatchTaskDto;
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.WechatMyTaskDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
......@@ -31,11 +36,13 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IRescueStationService;
import com.yeejoin.amos.boot.module.tzs.api.service.IUseUnitService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -82,6 +89,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
@Autowired
RescueProcessServiceImpl rescueProcessServiceImpl;
@Autowired
private DataDictionaryServiceImpl iDataDictionaryService;
@Autowired
ISourceFileService ISourceFileService;
/**
* 分页查询
*/
......@@ -243,6 +257,160 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
return baseMapper.getTaskListByPhonePager(phone, typeCode, current*5);
}
@Override
@Transactional
public WechatMyTaskDto saveWechatFeedBack(WechatDispatchFeedbackDto wechatDispatchFeedbackDto) {
// 更新反馈信息
DispatchTask task = this.getById(wechatDispatchFeedbackDto.getTaskId());
DispatchPaper dispatchPaper = dispatchPaperServiceImpl.getById(task.getPaperId());
// 反馈方式
dispatchPaper.setFeedbackCode("856");
dispatchPaper.setFeedbackType("主动反馈");
// 反馈时间
dispatchPaper.setFeedbackFinishTime(new Date());
dispatchPaper.setFeedbackTime(new Date());
// 反馈人信息
dispatchPaper.setFeedbackUid(task.getResponseUserId() + "");
dispatchPaper.setFeedbackUname(task.getResponseUserName());
dispatchPaper.setRepairUser(task.getResponseUserName());
// 保存照片
Map<String, List<AttachmentDto>> attachmentMap = new HashMap<>();
attachmentMap.put("imgs",wechatDispatchFeedbackDto.getImgs());
ISourceFileService.saveAttachments(task.getPaperId(),attachmentMap);
dispatchPaperServiceImpl.updateById(dispatchPaper);
// 动态字段
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,wechatDispatchFeedbackDto.getRemark()).
eq(AlertFormValue::getFieldCode,"fix_remark").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
if (StringUtils.isNotBlank(wechatDispatchFeedbackDto.getFixResult())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.WXJG).eq(DataDictionary::getCode, wechatDispatchFeedbackDto.getFixResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,fixResult.getName()).
set(AlertFormValue::getFieldValueCode,fixResult.getCode()).
eq(AlertFormValue::getFieldCode,"fix_result").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
}
if (StringUtils.isNotBlank(wechatDispatchFeedbackDto.getErrorResult())) {
LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(DataDictionary::getType, TzsCommonParam.GZYY).eq(DataDictionary::getCode, wechatDispatchFeedbackDto.getErrorResult());
DataDictionary fixResult = iDataDictionaryService.getOne(queryWrapper);
iAlertFormValueService.update(new LambdaUpdateWrapper<AlertFormValue>().
set(AlertFormValue::getFieldValue,fixResult.getName()).
set(AlertFormValue::getFieldValueCode,fixResult.getCode()).
eq(AlertFormValue::getFieldCode,"error_result").
eq(AlertFormValue::getAlertCalledId,task.getPaperId()));
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(task.getAlertId(),TzsCommonParam.WXFK,task.getSequenceNbr(),null);
WechatMyTaskDto temp = this.getTaskInfoByTaskId(wechatDispatchFeedbackDto.getTaskId());
List<AlertFormValue> paperList = 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);
}
});
// 预留照片处理
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);
}
});
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;
}
@Transactional
@Override
public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) {
......
......@@ -1481,6 +1481,30 @@
</sql>
</changeSet>
<changeSet author="tw" id="2021-09-24-0001">
<preConditions onFail="MARK_RAN">
<tableExists tableName="jc_alert_called"/>
</preConditions>
<comment>警情来源系统</comment>
<sql>
ALTER TABLE `jc_alert_called` add system_source varchar(255) COMMENT '来源系统';
ALTER TABLE `jc_alert_called` add system_source_code varchar(255) COMMENT '系统来源code';
</sql>
</changeSet>
<changeSet author="tw" id="2021-09-24-0002">
<preConditions onFail="MARK_RAN">
<tableExists tableName="cb_data_dictionary" />
<primaryKeyExists primaryKeyName="sequence_nbr" tableName="cb_data_dictionary"/>
</preConditions>
<comment>add data jc_alert_form</comment>
<sql>
INSERT INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1242, '1242', '融合调度系统', 'SOURCE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1243, '1243', '消防物联系统', 'SOURCE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
INSERT INTO `cb_data_dictionary`(`sequence_nbr`, `code`, `name`, `type`, `type_desc`, `parent`, `rec_user_name`, `rec_user_id`, `rec_date`, `is_delete`, `sort_num`) VALUES (1244, '1244', '119接处警系统', 'SOURCE', NULL, NULL, NULL, NULL, NULL, b'0', 1);
</sql>
</changeSet>
</databaseChangeLog>
#DB properties:
spring.datasource.url = jdbc:mysql://172.16.11.20:3306/amos-supervision_v1.0?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username= root
spring.datasource.password= root_123
## eureka properties:
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
security.password=a1234560
security.loginId=jc_wjk006
security.productWeb=STUDIO_APP_WEB
security.productApp=STUDIO_APP_MOBILE
security.appKey=studio_normalapp_3168830
#redis 配置
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10
spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=1000
#巡检计划定时任务
jobs.cron = 0 0/1 22-23 * * ?
#jpush 推送配置项
params.isPush = false
params.work.flow.normalProcessDefinitionKey=normalHazardManagement
params.work.flow.processDefinitionKey=hazardManagement
params.work.flow.address=http://172.16.10.80:30040
params.spc.address=http://172.16.3.89:9001
#websocket
params.remoteWebsocketUrl=http://39.100.241.164:8080/
#websocket send message url
params.remoteWebSocketSendMsgUrl=http://39.100.241.164:10601/
#上传文件配置
spring.http.multipart.maxFileSize = 80480000
spring.http.multipart.MaxRequestSize = 80480000
windows.img.path = D:\\
linux.img.path = /
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
emqx.max-inflight=1000
file.url=http://39.98.45.134:9000/
\ No newline at end of file
......@@ -1175,5 +1175,17 @@
FROM
p_point
</select>
<select id="getPointByPlanId" resultType="com.yeejoin.amos.supervision.dao.entity.Point">
select
*
from p_point po
where EXISTS
(SELECT
DISTINCT rp.point_id FROM
p_plan pl,
p_route_point rp
where pl.route_id = rp.route_id
and pl.id = #{planId}
and po.id = rp.point_id)
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property name="LOG_HOME" value="log" />
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/maintenance.log.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>30</MaxHistory>
<!--日志文件大小-->
<MaxFileSize>30mb</MaxFileSize>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- 控制台输出 -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>
<!-- show parameters for hibernate sql 专为 Hibernate 定制
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
<logger name="org.hibernate.type.descriptor.sql.BasicExtractor" level="DEBUG" />
<logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.engine.QueryParameters" level="DEBUG" />
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="DEBUG" />
-->
<!--myibatis log configure-->
<logger name="com.apache.ibatis" level="DEBUG"/>
<logger name="org.mybatis" level="DEBUG" />
<logger name="java.sql.Connection" level="DEBUG"/>
<logger name="java.sql.Statement" level="DEBUG"/>
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
<logger name="org.springframework" level="DEBUG"/>
<!-- 日志输出级别 -->
<root level="DEBUG">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
</configuration>
\ No newline at end of file
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