From eea5bc9be7deb06106d6274abeb29ebe4b83af44 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期二, 30 四月 2024 13:40:35 +0800 Subject: [PATCH] 考核结果指标详情页面 --- ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml | 117 ++ ycl-common/src/main/java/constant/CheckConstants.java | 10 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java | 354 ++++++ ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java | 12 ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java | 3 ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java | 62 + ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java | 7 ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java | 36 ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml | 167 +++ ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java | 62 + ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java | 96 + ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java | 62 + ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckScoreIndexDTO.java | 9 ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java | 96 + ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java | 96 + ycl-common/src/main/java/enumeration/general/CheckScoreType.java | 39 ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java | 62 + ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java | 62 + ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java | 62 + ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java | 3 ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml | 107 + ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java | 198 +++ /dev/null | 98 - ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java | 233 ++++ ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java | 24 ycl-common/src/main/java/pojo/ExcelExp.java | 48 ycl-common/src/main/java/utils/poi/ExcelUtilManySheet.java | 894 ++++++++++++++++ ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java | 72 + ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java | 157 ++ ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java | 34 30 files changed, 3,108 insertions(+), 174 deletions(-) diff --git a/ycl-common/src/main/java/constant/CheckConstants.java b/ycl-common/src/main/java/constant/CheckConstants.java index c0a5099..ad105a6 100644 --- a/ycl-common/src/main/java/constant/CheckConstants.java +++ b/ycl-common/src/main/java/constant/CheckConstants.java @@ -4,12 +4,12 @@ * 鑰冩牳甯搁噺 */ public class CheckConstants { - //杞﹁締瑙勫垯 - public static final Short Rule_Category_Car = 1; - //浜鸿劯瑙勫垯 - public static final Short Rule_Category_Face = 2; //瑙嗛瑙勫垯 - public static final Short Rule_Category_Video = 0; + public static final Short Rule_Category_Video = 1; + //杞﹁締瑙勫垯 + public static final Short Rule_Category_Car = 2; + //浜鸿劯瑙勫垯 + public static final Short Rule_Category_Face = 3; public static final String Delete = "1"; diff --git a/ycl-common/src/main/java/enumeration/general/CheckScoreType.java b/ycl-common/src/main/java/enumeration/general/CheckScoreType.java new file mode 100644 index 0000000..61131af --- /dev/null +++ b/ycl-common/src/main/java/enumeration/general/CheckScoreType.java @@ -0,0 +1,39 @@ +package enumeration.general; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import com.fasterxml.jackson.annotation.JsonValue; + +public enum CheckScoreType { + CHECK_SCORE_TYPE_VIDEO(1, "瑙嗛鑰冩牳"), + CHECK_SCORE_TYPE_CAR(2, "杞﹁締鑰冩牳"), + CHECK_SCORE_TYPE_FACE(3, "浜鸿劯鑰冩牳"); + + @EnumValue + private final Integer value; + + @JsonValue // 鏍囨槑鍦ㄨ浆JSON鏃朵娇鐢ㄨ瀛楁 + private final String desc; + + CheckScoreType(Integer value, String desc) { + this.value = value; + this.desc = desc; + } + + public Short getValue() { + return Short.valueOf(value+""); + } + + public String getDesc() { + return desc; + } + + // 鏍规嵁value杩斿洖瀵瑰簲鐨勬灇涓惧疄渚� + public static CheckScoreType fromValue(int value) { + for (CheckScoreType type : CheckScoreType.values()) { + if (type.getValue() == value) { + return type; + } + } + throw new IllegalArgumentException("娌℃湁鏋氫妇鍊硷細 " + value); + } +} \ No newline at end of file diff --git a/ycl-common/src/main/java/pojo/ExcelExp.java b/ycl-common/src/main/java/pojo/ExcelExp.java new file mode 100644 index 0000000..2872426 --- /dev/null +++ b/ycl-common/src/main/java/pojo/ExcelExp.java @@ -0,0 +1,48 @@ +package pojo; + +import java.util.List; + +public class ExcelExp { + + private String fileName;// sheet鐨勫悕绉� + private String[] handers;// sheet閲岀殑鏍囬 + private List dataset;// sheet閲岀殑鏁版嵁闆� + private Class clazz; + public ExcelExp(String fileName, List dataset, Class clazz) { + this.fileName = fileName; + this.dataset = dataset; + this.clazz = clazz; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String[] getHanders() { + return handers; + } + + public void setHanders(String[] handers) { + this.handers = handers; + } + + public List getDataset() { + return dataset; + } + + public void setDataset(List dataset) { + this.dataset = dataset; + } + + public Class getClazz() { + return clazz; + } + + public void setClazz(Class clazz) { + this.clazz = clazz; + } +} diff --git a/ycl-common/src/main/java/utils/poi/ExcelUtilManySheet.java b/ycl-common/src/main/java/utils/poi/ExcelUtilManySheet.java new file mode 100644 index 0000000..674403a --- /dev/null +++ b/ycl-common/src/main/java/utils/poi/ExcelUtilManySheet.java @@ -0,0 +1,894 @@ +package utils.poi; + +import annotation.Excel; +import annotation.Excels; +import jakarta.servlet.http.HttpServletResponse; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddressList; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFClientAnchor; +import org.apache.poi.xssf.usermodel.XSSFDataValidation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import pojo.ExcelExp; +import utils.DateUtils; +import utils.StringUtils; +import utils.file.FileTypeUtils; +import utils.file.ImageUtils; +import utils.reflect.ReflectUtils; +import utils.text.Convert; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * Excel鐩稿叧澶勭悊 + * + * @author ruoyi + */ +public class ExcelUtilManySheet<T> { + private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class); + + /** + * Excel sheet鏈�澶ц鏁帮紝榛樿65536 + */ + public static final int sheetSize = 65536; + + /** + * 宸ヤ綔琛ㄥ悕绉� + */ + private String sheetName; + + /** + * 瀵煎嚭绫诲瀷锛圗XPORT:瀵煎嚭鏁版嵁锛汭MPORT锛氬鍏ユā鏉匡級 + */ + private Excel.Type type; + + /** + * 宸ヤ綔钖勫璞� + */ + private Workbook wb; + + /** + * 宸ヤ綔琛ㄥ璞� + */ + private Sheet sheet; + + /** + * 鏍峰紡鍒楄〃 + */ + private Map<String, CellStyle> styles; + + /** + * 瀵煎叆瀵煎嚭鏁版嵁鍒楄〃 + */ + private List<T> list; + + /** + * 娉ㄨВ鍒楄〃 + */ + private List<Object[]> fields; + + /** + * 鏈�澶ч珮搴� + */ + private short maxHeight; + + /** + * 缁熻鍒楄〃 + */ + private Map<Integer, Double> statistics = new HashMap<Integer, Double>(); + + /** + * 鏁板瓧鏍煎紡 + */ + private static final DecimalFormat DOUBLE_FORMAT = new DecimalFormat("######0.00"); + + /** + * 瀹炰綋瀵硅薄 + */ + public Class<T> clazz; + + public List<ExcelExp> clazzlist; + + public ExcelUtilManySheet(List<ExcelExp> clazzlist) { + this.clazzlist = clazzlist; + } + + public void init(List<T> list, String sheetName, Excel.Type type) { + if (list == null) { + list = new ArrayList<T>(); + } + this.list = list; + this.sheetName = sheetName; + this.type = type; + createExcelField(); + } + + /** + * 瀵筫xcel琛ㄥ崟榛樿绗竴涓储寮曞悕杞崲鎴恖ist + * + * @param is 杈撳叆娴� + * @return 杞崲鍚庨泦鍚� + */ + public List<T> importExcel(InputStream is) throws Exception { + return importExcel(StringUtils.EMPTY, is); + } + + /** + * 瀵筫xcel琛ㄥ崟鎸囧畾琛ㄦ牸绱㈠紩鍚嶈浆鎹㈡垚list + * + * @param sheetName 琛ㄦ牸绱㈠紩鍚� + * @param is 杈撳叆娴� + * @return 杞崲鍚庨泦鍚� + */ + public List<T> importExcel(String sheetName, InputStream is) throws Exception { + this.type = Excel.Type.IMPORT; + this.wb = WorkbookFactory.create(is); + List<T> list = new ArrayList<T>(); + Sheet sheet = null; + if (StringUtils.isNotEmpty(sheetName)) { + // 濡傛灉鎸囧畾sheet鍚�,鍒欏彇鎸囧畾sheet涓殑鍐呭. + sheet = wb.getSheet(sheetName); + } else { + // 濡傛灉浼犲叆鐨剆heet鍚嶄笉瀛樺湪鍒欓粯璁ゆ寚鍚戠1涓猻heet. + sheet = wb.getSheetAt(0); + } + + if (sheet == null) { + throw new IOException("鏂囦欢sheet涓嶅瓨鍦�"); + } + + int rows = sheet.getPhysicalNumberOfRows(); + + if (rows > 0) { + // 瀹氫箟涓�涓猰ap鐢ㄤ簬瀛樻斁excel鍒楃殑搴忓彿鍜宖ield. + Map<String, Integer> cellMap = new HashMap<String, Integer>(); + // 鑾峰彇琛ㄥご + Row heard = sheet.getRow(0); + for (int i = 0; i < heard.getPhysicalNumberOfCells(); i++) { + Cell cell = heard.getCell(i); + if (StringUtils.isNotNull(cell)) { + String value = this.getCellValue(heard, i).toString(); + cellMap.put(value, i); + } else { + cellMap.put(null, i); + } + } + // 鏈夋暟鎹椂鎵嶅鐞� 寰楀埌绫荤殑鎵�鏈塮ield. + Field[] allFields = clazz.getDeclaredFields(); + // 瀹氫箟涓�涓猰ap鐢ㄤ簬瀛樻斁鍒楃殑搴忓彿鍜宖ield. + Map<Integer, Field> fieldsMap = new HashMap<Integer, Field>(); + for (int col = 0; col < allFields.length; col++) { + Field field = allFields[col]; + Excel attr = field.getAnnotation(Excel.class); + if (attr != null && (attr.type() == Excel.Type.ALL || attr.type() == type)) { + // 璁剧疆绫荤殑绉佹湁瀛楁灞炴�у彲璁块棶. + field.setAccessible(true); + Integer column = cellMap.get(attr.name()); + if (column != null) { + fieldsMap.put(column, field); + } + } + } + for (int i = 1; i < rows; i++) { + // 浠庣2琛屽紑濮嬪彇鏁版嵁,榛樿绗竴琛屾槸琛ㄥご. + Row row = sheet.getRow(i); + T entity = null; + for (Map.Entry<Integer, Field> entry : fieldsMap.entrySet()) { + Object val = this.getCellValue(row, entry.getKey()); + + // 濡傛灉涓嶅瓨鍦ㄥ疄渚嬪垯鏂板缓. + entity = (entity == null ? clazz.newInstance() : entity); + // 浠巑ap涓緱鍒板搴斿垪鐨刦ield. + Field field = fieldsMap.get(entry.getKey()); + // 鍙栧緱绫诲瀷,骞舵牴鎹璞$被鍨嬭缃��. + Class<?> fieldType = field.getType(); + if (String.class == fieldType) { + String s = Convert.toStr(val); + if (StringUtils.endsWith(s, ".0")) { + val = StringUtils.substringBefore(s, ".0"); + } else { + String dateFormat = field.getAnnotation(Excel.class).dateFormat(); + if (StringUtils.isNotEmpty(dateFormat)) { + val = DateUtils.parseDateToStr(dateFormat, (Date) val); + } else { + val = Convert.toStr(val); + } + } + } else if ((Integer.TYPE == fieldType || Integer.class == fieldType) && StringUtils.isNumeric(Convert.toStr(val))) { + val = Convert.toInt(val); + } else if (Long.TYPE == fieldType || Long.class == fieldType) { + val = Convert.toLong(val); + } else if (Double.TYPE == fieldType || Double.class == fieldType) { + val = Convert.toDouble(val); + } else if (Float.TYPE == fieldType || Float.class == fieldType) { + val = Convert.toFloat(val); + } else if (BigDecimal.class == fieldType) { + val = Convert.toBigDecimal(val); + } else if (Date.class == fieldType) { + if (val instanceof String) { + val = DateUtils.parseDate(val); + } else if (val instanceof Double) { + val = DateUtil.getJavaDate((Double) val); + } + } else if (Boolean.TYPE == fieldType || Boolean.class == fieldType) { + val = Convert.toBool(val, false); + } + if (StringUtils.isNotNull(fieldType)) { + Excel attr = field.getAnnotation(Excel.class); + String propertyName = field.getName(); + if (StringUtils.isNotEmpty(attr.targetAttr())) { + propertyName = field.getName() + "." + attr.targetAttr(); + } else if (StringUtils.isNotEmpty(attr.readConverterExp())) { + val = reverseByExp(Convert.toStr(val), attr.readConverterExp(), attr.separator()); + } + ReflectUtils.invokeSetter(entity, propertyName, val); + } + } + list.add(entity); + } + } + return list; + } + + /** + * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 + * + * @param response 杩斿洖鏁版嵁 + * @param list 瀵煎嚭鏁版嵁闆嗗悎 + * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О + * @return 缁撴灉 + * @throws IOException + */ + public void exportExcel(HttpServletResponse response, List<T> list, String sheetName) throws IOException { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + this.init(list, sheetName, Excel.Type.EXPORT); + exportExcel(response.getOutputStream()); + } + + /** + * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 + * + * @param response 杩斿洖鏁版嵁 + * @param list 瀵煎嚭鏁版嵁闆嗗悎 + * @return 缁撴灉 + * @throws IOException + */ + public void exportExcelManySheet(HttpServletResponse response, List<ExcelExp> list) throws IOException { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + try { + createWorkbook(); + for (int index = 0; index <list.size(); index++) { + this.clazz = list.get(index).getClazz(); + this.init(list.get(index).getDataset(), list.get(index).getFileName(), Excel.Type.EXPORT); + // 鍙栧嚭涓�鍏辨湁澶氬皯涓猻heet. +// double sheetNo = Math.ceil(list.size() / sheetSize); + createSheetManySheet(index); + // 浜х敓涓�琛� + Row row = sheet.createRow(0); + int column = 0; + // 鍐欏叆鍚勪釜瀛楁鐨勫垪澶村悕绉� + for (Object[] os : fields) { + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++); + } + if (Excel.Type.EXPORT.equals(type)) { + fillExcelData(index, row); + addStatisticsRow(); + } + } + wb.write(response.getOutputStream()); + } catch (IOException e) { + log.error("瀵煎嚭Excel寮傚父{}", e.getMessage()); + } finally { + if (wb != null) { + try { + wb.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + if (response.getOutputStream() != null) { + try { + response.getOutputStream().close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + } +// exportExcel(response.getOutputStream()); + } + + /** + * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 + * + * @param sheetName 宸ヤ綔琛ㄧ殑鍚嶇О + * @return 缁撴灉 + */ + public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException { + response.setContentType("application/vnd.ms-excel"); + response.setCharacterEncoding("utf-8"); + this.init(null, sheetName, Excel.Type.IMPORT); + exportExcel(response.getOutputStream()); + } + + /** + * 瀵筶ist鏁版嵁婧愬皢鍏堕噷闈㈢殑鏁版嵁瀵煎叆鍒癳xcel琛ㄥ崟 + * + * @return 缁撴灉 + */ + public void exportExcel(OutputStream outputStream) { + try { + // 鍙栧嚭涓�鍏辨湁澶氬皯涓猻heet. + double sheetNo = Math.ceil(list.size() / sheetSize); + for (int index = 0; index <= sheetNo; index++) { + createSheet(sheetNo, index); + + // 浜х敓涓�琛� + Row row = sheet.createRow(0); + int column = 0; + // 鍐欏叆鍚勪釜瀛楁鐨勫垪澶村悕绉� + for (Object[] os : fields) { + Excel excel = (Excel) os[1]; + this.createCell(excel, row, column++); + } + if (Excel.Type.EXPORT.equals(type)) { + fillExcelData(index, row); + addStatisticsRow(); + } + } + wb.write(outputStream); + } catch (Exception e) { + log.error("瀵煎嚭Excel寮傚父{}", e.getMessage()); + } finally { + if (wb != null) { + try { + wb.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + } + } + + /** + * 濉厖excel鏁版嵁 + * + * @param index 搴忓彿 + * @param row 鍗曞厓鏍艰 + */ + public void fillExcelData(int index, Row row) { +// int startNo = index * sheetSize; +// int endNo = Math.min(startNo + sheetSize, list.size()); + for (int i = 0; i < list.size(); i++) { + row = sheet.createRow(i + 1 ); + // 寰楀埌瀵煎嚭瀵硅薄. + T vo = (T) list.get(i); + int column = 0; + for (Object[] os : fields) { + Field field = (Field) os[0]; + Excel excel = (Excel) os[1]; + // 璁剧疆瀹炰綋绫荤鏈夊睘鎬у彲璁块棶 + field.setAccessible(true); + this.addCell(excel, row, vo, field, column++); + } + } + } + + /** + * 鍒涘缓琛ㄦ牸鏍峰紡 + * + * @param wb 宸ヤ綔钖勫璞� + * @return 鏍峰紡鍒楄〃 + */ + private Map<String, CellStyle> createStyles(Workbook wb) { + // 鍐欏叆鍚勬潯璁板綍,姣忔潯璁板綍瀵瑰簲excel琛ㄤ腑鐨勪竴琛� + Map<String, CellStyle> styles = new HashMap<String, CellStyle>(); + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setBorderRight(BorderStyle.THIN); + style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderLeft(BorderStyle.THIN); + style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderTop(BorderStyle.THIN); + style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setBorderBottom(BorderStyle.THIN); + style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex()); + Font dataFont = wb.createFont(); + dataFont.setFontName("Arial"); + dataFont.setFontHeightInPoints((short) 10); + style.setFont(dataFont); + styles.put("data", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); + style.setFillPattern(FillPatternType.SOLID_FOREGROUND); + Font headerFont = wb.createFont(); + headerFont.setFontName("Arial"); + headerFont.setFontHeightInPoints((short) 10); + headerFont.setBold(true); + headerFont.setColor(IndexedColors.WHITE.getIndex()); + style.setFont(headerFont); + styles.put("header", style); + + style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + style.setVerticalAlignment(VerticalAlignment.CENTER); + Font totalFont = wb.createFont(); + totalFont.setFontName("Arial"); + totalFont.setFontHeightInPoints((short) 10); + style.setFont(totalFont); + styles.put("total", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.LEFT); + styles.put("data1", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.CENTER); + styles.put("data2", style); + + style = wb.createCellStyle(); + style.cloneStyleFrom(styles.get("data")); + style.setAlignment(HorizontalAlignment.RIGHT); + styles.put("data3", style); + + return styles; + } + + /** + * 鍒涘缓鍗曞厓鏍� + */ + public Cell createCell(Excel attr, Row row, int column) { + // 鍒涘缓鍒� + Cell cell = row.createCell(column); + // 鍐欏叆鍒椾俊鎭� + cell.setCellValue(attr.name()); + setDataValidation(attr, row, column); + cell.setCellStyle(styles.get("header")); + return cell; + } + + /** + * 璁剧疆鍗曞厓鏍间俊鎭� + * + * @param value 鍗曞厓鏍煎�� + * @param attr 娉ㄨВ鐩稿叧 + * @param cell 鍗曞厓鏍间俊鎭� + */ + public void setCellVo(Object value, Excel attr, Cell cell) { + if (Excel.ColumnType.STRING == attr.cellType()) { + cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : value + attr.suffix()); + } else if (Excel.ColumnType.NUMERIC == attr.cellType()) { + cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); + } else if (Excel.ColumnType.IMAGE == attr.cellType()) { + ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 1), + cell.getRow().getRowNum() + 1); + String imagePath = Convert.toStr(value); + if (StringUtils.isNotEmpty(imagePath)) { + byte[] data = ImageUtils.getImage(imagePath); + getDrawingPatriarch(cell.getSheet()).createPicture(anchor, + cell.getSheet().getWorkbook().addPicture(data, getImageType(data))); + } + } + } + + /** + * 鑾峰彇鐢诲竷 + */ + public static Drawing<?> getDrawingPatriarch(Sheet sheet) { + if (sheet.getDrawingPatriarch() == null) { + sheet.createDrawingPatriarch(); + } + return sheet.getDrawingPatriarch(); + } + + /** + * 鑾峰彇鍥剧墖绫诲瀷,璁剧疆鍥剧墖鎻掑叆绫诲瀷 + */ + public int getImageType(byte[] value) { + String type = FileTypeUtils.getFileExtendName(value); + if ("JPG".equalsIgnoreCase(type)) { + return Workbook.PICTURE_TYPE_JPEG; + } else if ("PNG".equalsIgnoreCase(type)) { + return Workbook.PICTURE_TYPE_PNG; + } + return Workbook.PICTURE_TYPE_JPEG; + } + + /** + * 鍒涘缓琛ㄦ牸鏍峰紡 + */ + public void setDataValidation(Excel attr, Row row, int column) { + if (attr.name().indexOf("娉細") >= 0) { + sheet.setColumnWidth(column, 6000); + } else { + // 璁剧疆鍒楀 + sheet.setColumnWidth(column, (int) ((attr.width() + 0.72) * 256)); + } + // 濡傛灉璁剧疆浜嗘彁绀轰俊鎭垯榧犳爣鏀句笂鍘绘彁绀�. + if (StringUtils.isNotEmpty(attr.prompt())) { + // 杩欓噷榛樿璁句簡2-101鍒楁彁绀�. + setXSSFPrompt(sheet, "", attr.prompt(), 1, 100, column, column); + } + // 濡傛灉璁剧疆浜哻ombo灞炴�у垯鏈垪鍙兘閫夋嫨涓嶈兘杈撳叆 + if (attr.combo().length > 0) { + // 杩欓噷榛樿璁句簡2-101鍒楀彧鑳介�夋嫨涓嶈兘杈撳叆. + setXSSFValidation(sheet, attr.combo(), 1, 100, column, column); + } + } + + /** + * 娣诲姞鍗曞厓鏍� + */ + public Cell addCell(Excel attr, Row row, T vo, Field field, int column) { + Cell cell = null; + try { + // 璁剧疆琛岄珮 + row.setHeight(maxHeight); + // 鏍规嵁Excel涓缃儏鍐靛喅瀹氭槸鍚﹀鍑�,鏈変簺鎯呭喌闇�瑕佷繚鎸佷负绌�,甯屾湜鐢ㄦ埛濉啓杩欎竴鍒�. + if (attr.isExport()) { + // 鍒涘缓cell + cell = row.createCell(column); + int align = attr.align().getCode(); + cell.setCellStyle(styles.get("data" + (align >= 1 && align <= 3 ? align : ""))); + + // 鐢ㄤ簬璇诲彇瀵硅薄涓殑灞炴�� + Object value = getTargetValue(vo, field, attr); + String dateFormat = attr.dateFormat(); + String readConverterExp = attr.readConverterExp(); + String separator = attr.separator(); + if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value)) { + cell.setCellValue(DateUtils.parseDateToStr(dateFormat, (Date) value)); + } else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value)) { + cell.setCellValue(convertByExp(Convert.toStr(value), readConverterExp, separator)); + } else if (value instanceof BigDecimal && -1 != attr.scale()) { + cell.setCellValue((((BigDecimal) value).setScale(attr.scale(), attr.roundingMode())).toString()); + } else { + // 璁剧疆鍒楃被鍨� + setCellVo(value, attr, cell); + } + addStatisticsData(column, Convert.toStr(value), attr); + } + } catch (Exception e) { + log.error("瀵煎嚭Excel澶辫触{}", e); + } + return cell; + } + + /** + * 璁剧疆 POI XSSFSheet 鍗曞厓鏍兼彁绀� + * + * @param sheet 琛ㄥ崟 + * @param promptTitle 鎻愮ず鏍囬 + * @param promptContent 鎻愮ず鍐呭 + * @param firstRow 寮�濮嬭 + * @param endRow 缁撴潫琛� + * @param firstCol 寮�濮嬪垪 + * @param endCol 缁撴潫鍒� + */ + public void setXSSFPrompt(Sheet sheet, String promptTitle, String promptContent, int firstRow, int endRow, + int firstCol, int endCol) { + DataValidationHelper helper = sheet.getDataValidationHelper(); + DataValidationConstraint constraint = helper.createCustomConstraint("DD1"); + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + DataValidation dataValidation = helper.createValidation(constraint, regions); + dataValidation.createPromptBox(promptTitle, promptContent); + dataValidation.setShowPromptBox(true); + sheet.addValidationData(dataValidation); + } + + /** + * 璁剧疆鏌愪簺鍒楃殑鍊煎彧鑳借緭鍏ラ鍒剁殑鏁版嵁,鏄剧ず涓嬫媺妗�. + * + * @param sheet 瑕佽缃殑sheet. + * @param textlist 涓嬫媺妗嗘樉绀虹殑鍐呭 + * @param firstRow 寮�濮嬭 + * @param endRow 缁撴潫琛� + * @param firstCol 寮�濮嬪垪 + * @param endCol 缁撴潫鍒� + * @return 璁剧疆濂界殑sheet. + */ + public void setXSSFValidation(Sheet sheet, String[] textlist, int firstRow, int endRow, int firstCol, int endCol) { + DataValidationHelper helper = sheet.getDataValidationHelper(); + // 鍔犺浇涓嬫媺鍒楄〃鍐呭 + DataValidationConstraint constraint = helper.createExplicitListConstraint(textlist); + // 璁剧疆鏁版嵁鏈夋晥鎬у姞杞藉湪鍝釜鍗曞厓鏍间笂,鍥涗釜鍙傛暟鍒嗗埆鏄細璧峰琛屻�佺粓姝㈣銆佽捣濮嬪垪銆佺粓姝㈠垪 + CellRangeAddressList regions = new CellRangeAddressList(firstRow, endRow, firstCol, endCol); + // 鏁版嵁鏈夋晥鎬у璞� + DataValidation dataValidation = helper.createValidation(constraint, regions); + // 澶勭悊Excel鍏煎鎬ч棶棰� + if (dataValidation instanceof XSSFDataValidation) { + dataValidation.setSuppressDropDownArrow(true); + dataValidation.setShowErrorBox(true); + } else { + dataValidation.setSuppressDropDownArrow(false); + } + + sheet.addValidationData(dataValidation); + } + + /** + * 瑙f瀽瀵煎嚭鍊� 0=鐢�,1=濂�,2=鏈煡 + * + * @param propertyValue 鍙傛暟鍊� + * @param converterExp 缈昏瘧娉ㄨВ + * @param separator 鍒嗛殧绗� + * @return 瑙f瀽鍚庡�� + */ + public static String convertByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(","); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(separator, propertyValue)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[0].equals(value)) { + propertyString.append(itemArray[1] + separator); + break; + } + } + } else { + if (itemArray[0].equals(propertyValue)) { + return itemArray[1]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 鍙嶅悜瑙f瀽鍊� 鐢�=0,濂�=1,鏈煡=2 + * + * @param propertyValue 鍙傛暟鍊� + * @param converterExp 缈昏瘧娉ㄨВ + * @param separator 鍒嗛殧绗� + * @return 瑙f瀽鍚庡�� + */ + public static String reverseByExp(String propertyValue, String converterExp, String separator) { + StringBuilder propertyString = new StringBuilder(); + String[] convertSource = converterExp.split(","); + for (String item : convertSource) { + String[] itemArray = item.split("="); + if (StringUtils.containsAny(separator, propertyValue)) { + for (String value : propertyValue.split(separator)) { + if (itemArray[1].equals(value)) { + propertyString.append(itemArray[0] + separator); + break; + } + } + } else { + if (itemArray[1].equals(propertyValue)) { + return itemArray[0]; + } + } + } + return StringUtils.stripEnd(propertyString.toString(), separator); + } + + /** + * 鍚堣缁熻淇℃伅 + */ + private void addStatisticsData(Integer index, String text, Excel entity) { + if (entity != null && entity.isStatistics()) { + Double temp = 0D; + if (!statistics.containsKey(index)) { + statistics.put(index, temp); + } + try { + temp = Double.valueOf(text); + } catch (NumberFormatException e) { + } + statistics.put(index, statistics.get(index) + temp); + } + } + + /** + * 鍒涘缓缁熻琛� + */ + public void addStatisticsRow() { + if (statistics.size() > 0) { + Cell cell = null; + Row row = sheet.createRow(sheet.getLastRowNum() + 1); + Set<Integer> keys = statistics.keySet(); + cell = row.createCell(0); + cell.setCellStyle(styles.get("total")); + cell.setCellValue("鍚堣"); + + for (Integer key : keys) { + cell = row.createCell(key); + cell.setCellStyle(styles.get("total")); + cell.setCellValue(DOUBLE_FORMAT.format(statistics.get(key))); + } + statistics.clear(); + } + } + + /** + * 鑾峰彇bean涓殑灞炴�у�� + * + * @param vo 瀹炰綋瀵硅薄 + * @param field 瀛楁 + * @param excel 娉ㄨВ + * @return 鏈�缁堢殑灞炴�у�� + * @throws Exception + */ + private Object getTargetValue(T vo, Field field, Excel excel) throws Exception { + Object o = field.get(vo); + if (StringUtils.isNotEmpty(excel.targetAttr())) { + String target = excel.targetAttr(); + if (target.indexOf(".") > -1) { + String[] targets = target.split("[.]"); + for (String name : targets) { + o = getValue(o, name); + } + } else { + o = getValue(o, target); + } + } + return o; + } + + /** + * 浠ョ被鐨勫睘鎬х殑get鏂规硶鏂规硶褰㈠紡鑾峰彇鍊� + * + * @param o + * @param name + * @return value + * @throws Exception + */ + private Object getValue(Object o, String name) throws Exception { + if (StringUtils.isNotNull(o) && StringUtils.isNotEmpty(name)) { + Class<?> clazz = o.getClass(); + Field field = clazz.getDeclaredField(name); + field.setAccessible(true); + o = field.get(o); + } + return o; + } + + /** + * 寰楀埌鎵�鏈夊畾涔夊瓧娈� + */ + private void createExcelField() { + this.fields = new ArrayList<Object[]>(); + List<Field> tempFields = new ArrayList<>(); + tempFields.addAll(Arrays.asList(clazz.getSuperclass().getDeclaredFields())); + tempFields.addAll(Arrays.asList(clazz.getDeclaredFields())); + for (Field field : tempFields) { + // 鍗曟敞瑙� + if (field.isAnnotationPresent(Excel.class)) { + putToField(field, field.getAnnotation(Excel.class)); + } + + // 澶氭敞瑙� + if (field.isAnnotationPresent(Excels.class)) { + Excels attrs = field.getAnnotation(Excels.class); + Excel[] excels = attrs.value(); + for (Excel excel : excels) { + putToField(field, excel); + } + } + } + this.fields = this.fields.stream().sorted(Comparator.comparing(objects -> ((Excel) objects[1]).sort())).collect(Collectors.toList()); + this.maxHeight = getRowHeight(); + } + + /** + * 鏍规嵁娉ㄨВ鑾峰彇鏈�澶ц楂� + */ + public short getRowHeight() { + double maxHeight = 0; + for (Object[] os : this.fields) { + Excel excel = (Excel) os[1]; + maxHeight = maxHeight > excel.height() ? maxHeight : excel.height(); + } + return (short) (maxHeight * 20); + } + + /** + * 鏀惧埌瀛楁闆嗗悎涓� + */ + private void putToField(Field field, Excel attr) { + if (attr != null && (attr.type() == Excel.Type.ALL || attr.type() == type)) { + this.fields.add(new Object[]{field, attr}); + } + } + + /** + * 鍒涘缓涓�涓伐浣滅翱 + */ + public void createWorkbook() { + this.wb = new SXSSFWorkbook(500); + } + + /** + * 鍒涘缓宸ヤ綔琛� + * + * @param sheetNo sheet鏁伴噺 + * @param index 搴忓彿 + */ + public void createSheet(double sheetNo, int index) { + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + // 璁剧疆宸ヤ綔琛ㄧ殑鍚嶇О. + if (sheetNo == 0) { + wb.setSheetName(index, sheetName); + } else { + wb.setSheetName(index, sheetName + index); + } + } + /** + * 鍒涘缓宸ヤ綔琛� + * + * @param index 搴忓彿 + */ + public void createSheetManySheet( int index) { + this.sheet = wb.createSheet(); + this.styles = createStyles(wb); + wb.setSheetName(index, sheetName); + } + /** + * 鑾峰彇鍗曞厓鏍煎�� + * + * @param row 鑾峰彇鐨勮 + * @param column 鑾峰彇鍗曞厓鏍煎垪鍙� + * @return 鍗曞厓鏍煎�� + */ + public Object getCellValue(Row row, int column) { + if (row == null) { + return row; + } + Object val = ""; + try { + Cell cell = row.getCell(column); + if (StringUtils.isNotNull(cell)) { + if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA) { + val = cell.getNumericCellValue(); + if (DateUtil.isCellDateFormatted(cell)) { + val = DateUtil.getJavaDate((Double) val); // POI Excel 鏃ユ湡鏍煎紡杞崲 + } else { + if ((Double) val % 1 != 0) { + val = new BigDecimal(val.toString()); + } else { + val = new DecimalFormat("0").format(val); + } + } + } else if (cell.getCellType() == CellType.STRING) { + val = cell.getStringCellValue(); + } else if (cell.getCellType() == CellType.BOOLEAN) { + val = cell.getBooleanCellValue(); + } else if (cell.getCellType() == CellType.ERROR) { + val = cell.getErrorCellValue(); + } + + } + } catch (Exception e) { + return val; + } + return val; + } +} + diff --git a/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java b/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java new file mode 100644 index 0000000..b6485cc --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/base/CheckIndex.java @@ -0,0 +1,72 @@ +package com.ycl.platform.base; + +import annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +public abstract class CheckIndex { + public Long id; + //鏌ヨ鏉′欢锛屾棩鏈� + public String date; + + @Excel(name = "鏃ユ湡",dateFormat = "yyyy-MM-dd") + public Date createTime; + + public Long deptId; + @Excel(name = "鍖哄幙") + public String deptName; + + /** 鑰冩牳鏍囩锛堢渷鍘�/甯傚眬锛� */ + @Excel(name = "鑰冩牳鏍囩", dictType = "platform_examine_tag") + public Long examineTag; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public Long getExamineTag() { + return examineTag; + } + + public void setExamineTag(Long examineTag) { + this.examineTag = examineTag; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckScoreIndexDTO.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckScoreIndexDTO.java new file mode 100644 index 0000000..05c3213 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/dto/CheckScoreIndexDTO.java @@ -0,0 +1,9 @@ +package com.ycl.platform.domain.dto; + +import lombok.Data; + +@Data +public class CheckScoreIndexDTO { + private Long id; + private String date; +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java new file mode 100644 index 0000000..224f9e3 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexCar.java @@ -0,0 +1,233 @@ +package com.ycl.platform.domain.entity; + +import annotation.Excel; +import com.ycl.platform.base.CheckIndex; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 杞﹁締鎸囨爣姒傜巼鏁版嵁瀵硅薄 t_check_index_car + * + * @author ruoyi + * @date 2024-04-29 + */ + +public class CheckIndexCar extends CheckIndex +{ + private static final long serialVersionUID = 1L; + + + /** 瑙嗗浘搴撳鎺ョǔ瀹氭�� */ + @Excel(name = "瑙嗗浘搴撳鎺ョǔ瀹氭��") + private BigDecimal viewConnectStability; + + /** 鐐逛綅鍦ㄧ嚎鐜� */ + @Excel(name = "鐐逛綅鍦ㄧ嚎鐜�") + private BigDecimal siteOnline; + + /** 鑱旂綉鍗″彛璁惧鐩綍涓�鑷寸巼 */ + @Excel(name = "鑱旂綉鍗″彛璁惧鐩綍涓�鑷寸巼",width = 25) + private BigDecimal deviceDirectoryConsistent; + + /** 杞﹁締鍗″彛淇℃伅閲囬泦鍑嗙‘鐜� */ + @Excel(name = "杞﹁締鍗″彛淇℃伅閲囬泦鍑嗙‘鐜�",width = 25) + private BigDecimal vehicleInformationCollectionAccuracy; + + /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁瀹屾暣鎬� */ + @Excel(name = "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁瀹屾暣鎬�",width = 25) + private BigDecimal vehicleCaptureIntegrity; + + /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁鍑嗙‘鎬� */ + @Excel(name = "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁鍑嗙‘鎬�",width = 25) + private BigDecimal vehicleCaptureAccuracy; + + /** 杞﹁締鍗″彛璁惧鏃堕挓鍑嗙‘鎬� */ + @Excel(name = "杞﹁締鍗″彛璁惧鏃堕挓鍑嗙‘鎬�",width = 25) + private BigDecimal vehicleTimingAccuracy; + + /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁涓婁紶鍙婃椂鎬� */ + @Excel(name = "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁涓婁紶鍙婃椂鎬�",width = 25) + private BigDecimal vehicleUploadTimeliness; + + /** 杞﹁締鍗″彛璁惧url鍙敤鎬� */ + @Excel(name = "杞﹁締鍗″彛璁惧url鍙敤鎬�",width = 25) + private BigDecimal vehicleUrlAvailability; + + /** 杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬� */ + @Excel(name = "杞﹁締鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬�",width = 25) + private BigDecimal vehiclePictureAvailability; + + @Override + public Long getId() { + return super.getId(); + } + + @Override + public void setId(Long id) { + super.setId(id); + } + + @Override + public String getDate() { + return super.getDate(); + } + + @Override + public void setDate(String date) { + super.setDate(date); + } + + @Override + public Date getCreateTime() { + return super.getCreateTime(); + } + + @Override + public void setCreateTime(Date createTime) { + super.setCreateTime(createTime); + } + + @Override + public Long getDeptId() { + return super.getDeptId(); + } + + @Override + public void setDeptId(Long deptId) { + super.setDeptId(deptId); + } + + @Override + public String getDeptName() { + return super.getDeptName(); + } + + @Override + public void setDeptName(String deptName) { + super.setDeptName(deptName); + } + + @Override + public Long getExamineTag() { + return super.getExamineTag(); + } + + @Override + public void setExamineTag(Long examineTag) { + super.setExamineTag(examineTag); + } + public void setViewConnectStability(BigDecimal viewConnectStability) + { + this.viewConnectStability = viewConnectStability; + } + + public BigDecimal getViewConnectStability() + { + return viewConnectStability; + } + public void setSiteOnline(BigDecimal siteOnline) + { + this.siteOnline = siteOnline; + } + + public BigDecimal getSiteOnline() + { + return siteOnline; + } + public void setDeviceDirectoryConsistent(BigDecimal deviceDirectoryConsistent) + { + this.deviceDirectoryConsistent = deviceDirectoryConsistent; + } + + public BigDecimal getDeviceDirectoryConsistent() + { + return deviceDirectoryConsistent; + } + public void setVehicleInformationCollectionAccuracy(BigDecimal vehicleInformationCollectionAccuracy) + { + this.vehicleInformationCollectionAccuracy = vehicleInformationCollectionAccuracy; + } + + public BigDecimal getVehicleInformationCollectionAccuracy() + { + return vehicleInformationCollectionAccuracy; + } + public void setVehicleCaptureIntegrity(BigDecimal vehicleCaptureIntegrity) + { + this.vehicleCaptureIntegrity = vehicleCaptureIntegrity; + } + + public BigDecimal getVehicleCaptureIntegrity() + { + return vehicleCaptureIntegrity; + } + public void setVehicleCaptureAccuracy(BigDecimal vehicleCaptureAccuracy) + { + this.vehicleCaptureAccuracy = vehicleCaptureAccuracy; + } + + public BigDecimal getVehicleCaptureAccuracy() + { + return vehicleCaptureAccuracy; + } + public void setVehicleTimingAccuracy(BigDecimal vehicleTimingAccuracy) + { + this.vehicleTimingAccuracy = vehicleTimingAccuracy; + } + + public BigDecimal getVehicleTimingAccuracy() + { + return vehicleTimingAccuracy; + } + public void setVehicleUploadTimeliness(BigDecimal vehicleUploadTimeliness) + { + this.vehicleUploadTimeliness = vehicleUploadTimeliness; + } + + public BigDecimal getVehicleUploadTimeliness() + { + return vehicleUploadTimeliness; + } + public void setVehicleUrlAvailability(BigDecimal vehicleUrlAvailability) + { + this.vehicleUrlAvailability = vehicleUrlAvailability; + } + + public BigDecimal getVehicleUrlAvailability() + { + return vehicleUrlAvailability; + } + public void setVehiclePictureAvailability(BigDecimal vehiclePictureAvailability) + { + this.vehiclePictureAvailability = vehiclePictureAvailability; + } + + + public BigDecimal getVehiclePictureAvailability() + { + return vehiclePictureAvailability; + } + + @Override + public String toString() { + return "CheckIndexCar{" + + "id=" + id + + ", date='" + date + '\'' + + ", createTime=" + createTime + + ", deptId=" + deptId + + ", deptName='" + deptName + '\'' + + ", examineTag=" + examineTag + + ", viewConnectStability=" + viewConnectStability + + ", siteOnline=" + siteOnline + + ", deviceDirectoryConsistent=" + deviceDirectoryConsistent + + ", vehicleInformationCollectionAccuracy=" + vehicleInformationCollectionAccuracy + + ", vehicleCaptureIntegrity=" + vehicleCaptureIntegrity + + ", vehicleCaptureAccuracy=" + vehicleCaptureAccuracy + + ", vehicleTimingAccuracy=" + vehicleTimingAccuracy + + ", vehicleUploadTimeliness=" + vehicleUploadTimeliness + + ", vehicleUrlAvailability=" + vehicleUrlAvailability + + ", vehiclePictureAvailability=" + vehiclePictureAvailability + + '}'; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java new file mode 100644 index 0000000..299a991 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexFace.java @@ -0,0 +1,198 @@ +package com.ycl.platform.domain.entity; + +import annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ycl.platform.base.CheckIndex; +import com.ycl.system.entity.BaseEntity; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 浜鸿劯鎸囨爣姒傜巼鏁版嵁瀵硅薄 t_check_index_face + * + * @author ruoyi + * @date 2024-04-29 + */ +public class CheckIndexFace extends CheckIndex +{ + private static final long serialVersionUID = 1L; + + /** 瑙嗗浘搴撳鎺ョǔ瀹氭�� */ + @Excel(name = "瑙嗗浘搴撳鎺ョǔ瀹氭��") + private BigDecimal viewConnectStability; + + /** 鐐逛綅鍦ㄧ嚎鐜� */ + @Excel(name = "鐐逛綅鍦ㄧ嚎鐜�") + private BigDecimal siteOnline; + + /** 璁惧鐩綍涓�鑷寸巼 */ + @Excel(name = " 璁惧鐩綍涓�鑷寸巼") + private BigDecimal deviceDirectoryConsistent; + + /** 浜鸿劯鍗″彛淇℃伅閲囬泦鍑嗙‘鐜� */ + @Excel(name = "浜鸿劯鍗″彛淇℃伅閲囬泦鍑嗙‘鐜�",width = 25) + private BigDecimal faceInformationCollectionAccuracy; + + /** 璁惧鎶撴媿鍥剧墖鍚堟牸鎬� */ + @Excel(name = "璁惧鎶撴媿鍥剧墖鍚堟牸鎬�") + private BigDecimal facePictureQualification; + + /** 璁惧鎶撴媿鍥剧墖鏃堕挓鍑嗙‘鎬� */ + @Excel(name = "璁惧鎶撴媿鍥剧墖鏃堕挓鍑嗙‘鎬�",width = 25) + private BigDecimal faceTimingAccuracy; + + /** 鎶撴媿浜鸿劯鏁版嵁涓婁紶鍙婃椂鎬� */ + @Excel(name = "鎶撴媿浜鸿劯鏁版嵁涓婁紶鍙婃椂鎬�",width = 25) + private BigDecimal faceUploadTimeliness; + + /** 浜鸿劯鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬� */ + @Excel(name = "浜鸿劯鍗″彛璁惧鎶撴媿鏁版嵁澶у浘鍙敤鎬�",width = 25) + private BigDecimal facePictureAvailability; + + public BigDecimal getViewConnectStability() { + return viewConnectStability; + } + + public void setViewConnectStability(BigDecimal viewConnectStability) { + this.viewConnectStability = viewConnectStability; + } + + public BigDecimal getSiteOnline() { + return siteOnline; + } + + public void setSiteOnline(BigDecimal siteOnline) { + this.siteOnline = siteOnline; + } + + public BigDecimal getDeviceDirectoryConsistent() { + return deviceDirectoryConsistent; + } + + public void setDeviceDirectoryConsistent(BigDecimal deviceDirectoryConsistent) { + this.deviceDirectoryConsistent = deviceDirectoryConsistent; + } + + public BigDecimal getFaceInformationCollectionAccuracy() { + return faceInformationCollectionAccuracy; + } + + public void setFaceInformationCollectionAccuracy(BigDecimal faceInformationCollectionAccuracy) { + this.faceInformationCollectionAccuracy = faceInformationCollectionAccuracy; + } + + public BigDecimal getFacePictureQualification() { + return facePictureQualification; + } + + public void setFacePictureQualification(BigDecimal facePictureQualification) { + this.facePictureQualification = facePictureQualification; + } + + public BigDecimal getFaceTimingAccuracy() { + return faceTimingAccuracy; + } + + public void setFaceTimingAccuracy(BigDecimal faceTimingAccuracy) { + this.faceTimingAccuracy = faceTimingAccuracy; + } + + public BigDecimal getFaceUploadTimeliness() { + return faceUploadTimeliness; + } + + public void setFaceUploadTimeliness(BigDecimal faceUploadTimeliness) { + this.faceUploadTimeliness = faceUploadTimeliness; + } + + public BigDecimal getFacePictureAvailability() { + return facePictureAvailability; + } + + public void setFacePictureAvailability(BigDecimal facePictureAvailability) { + this.facePictureAvailability = facePictureAvailability; + } + + @Override + public Long getId() { + return super.getId(); + } + + @Override + public void setId(Long id) { + super.setId(id); + } + + @Override + public String getDate() { + return super.getDate(); + } + + @Override + public void setDate(String date) { + super.setDate(date); + } + + @Override + public Date getCreateTime() { + return super.getCreateTime(); + } + + @Override + public void setCreateTime(Date createTime) { + super.setCreateTime(createTime); + } + + @Override + public Long getDeptId() { + return super.getDeptId(); + } + + @Override + public void setDeptId(Long deptId) { + super.setDeptId(deptId); + } + + @Override + public String getDeptName() { + return super.getDeptName(); + } + + @Override + public void setDeptName(String deptName) { + super.setDeptName(deptName); + } + + @Override + public Long getExamineTag() { + return super.getExamineTag(); + } + + @Override + public void setExamineTag(Long examineTag) { + super.setExamineTag(examineTag); + } + + @Override + public String toString() { + return "CheckIndexFace{" + + "id=" + id + + ", date='" + date + '\'' + + ", createTime=" + createTime + + ", deptId=" + deptId + + ", deptName='" + deptName + '\'' + + ", examineTag=" + examineTag + + ", viewConnectStability=" + viewConnectStability + + ", siteOnline=" + siteOnline + + ", deviceDirectoryConsistent=" + deviceDirectoryConsistent + + ", faceInformationCollectionAccuracy=" + faceInformationCollectionAccuracy + + ", facePictureQualification=" + facePictureQualification + + ", faceTimingAccuracy=" + faceTimingAccuracy + + ", faceUploadTimeliness=" + faceUploadTimeliness + + ", facePictureAvailability=" + facePictureAvailability + + '}'; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java new file mode 100644 index 0000000..2d41919 --- /dev/null +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckIndexVideo.java @@ -0,0 +1,354 @@ +package com.ycl.platform.domain.entity; + +import annotation.Excel; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ycl.platform.base.CheckIndex; +import com.ycl.system.entity.BaseEntity; +import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang.builder.ToStringStyle; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 瑙嗛鎸囨爣姒傜巼鏁版嵁瀵硅薄 t_check_index_video + * + * @author ruoyi + * @date 2024-04-29 + */ +public class CheckIndexVideo extends CheckIndex +{ + private static final long serialVersionUID = 1L; + + /** 骞冲彴鍦ㄧ嚎鐜� */ + @Excel(name = "骞冲彴鍦ㄧ嚎鐜�") + private BigDecimal platformOnline; + + /** 涓�鏈轰竴妗e悎鏍肩巼 */ + @Excel(name = "涓�鏈轰竴妗e悎鏍肩巼") + private BigDecimal monitorQualification; + + /** 妗f鑰冩牳姣� */ + @Excel(name = "涓�鏈轰竴妗f敞鍐岀巼") + private BigDecimal monitorRegistration; + + /** 妗f鑰冩牳姣� */ + @Excel(name = "妗f鑰冩牳姣�") + private BigDecimal archivesRate; + + /** 鐐逛綅鍦ㄧ嚎鐜� */ + @Excel(name = "鐐逛綅鍦ㄧ嚎鐜�") + private BigDecimal siteOnline; + + /** 褰曡薄鍙敤鐜� */ + @Excel(name = "褰曡薄鍙敤鐜�") + private BigDecimal videoAvailable; + + /** 鏍囨敞姝g‘鐜� */ + @Excel(name = "鏍囨敞姝g‘鐜�") + private BigDecimal annotationAccuracy; + + /** 鏍℃椂鍑嗙‘鐜� */ + @Excel(name = "鏍℃椂鍑嗙‘鐜�") + private BigDecimal timingAccuracy; + + /** 閲嶇偣鐐逛綅鍦ㄧ嚎鐜� */ + @Excel(name = "閲嶇偣鐐逛綅鍦ㄧ嚎鐜�") + private BigDecimal keySiteOnline; + + /** 閲嶇偣鐐逛綅褰曡薄鍙敤鐜� */ + @Excel(name = "閲嶇偣鐐逛綅褰曡薄鍙敤鐜�",width = 25) + private BigDecimal keyVideoAvailable; + + /** 閲嶇偣鐐逛綅鏍囨敞姝g‘鐜� */ + @Excel(name = "閲嶇偣鐐逛綅鏍囨敞姝g‘鐜�",width = 25) + private BigDecimal keyAnnotationAccuracy; + + /** 閲嶇偣鐐逛綅鎸夋椂姝g‘鐜� */ + @Excel(name = "閲嶇偣鐐逛綅鎸夋椂姝g‘鐜�",width = 25) + private BigDecimal keyTimingAccuracy; + + /** 閲嶇偣鎸囨尌鍥惧儚鍏畨閮ㄥ贰妫�缁撴灉 */ + @Excel(name = "閲嶇偣鎸囨尌鍥惧儚鍏畨閮ㄥ贰妫�缁撴灉",width = 25) + private BigDecimal keyCommandImageInspection; + + /** 閲嶇偣鎸囨尌鍥惧儚鐩綍鏍� */ + @Excel(name = "閲嶇偣鎸囨尌鍥惧儚鐩綍鏍�",width = 25) + private BigDecimal keyCommandImageDirectoryTree; + + /** 鍦ㄧ嚎妫�鏌ュ钩鍙伴儴缃插強杩愯鐜� */ + @Excel(name = "鍦ㄧ嚎妫�鏌ュ钩鍙伴儴缃插強杩愯鐜�",width = 25) + private BigDecimal onlineInspectionPlatform; + + /** 瑙嗛浼犺緭缃戣祫浜у噯纭巼 */ + @Excel(name = "瑙嗛浼犺緭缃戣祫浜у噯纭巼",width = 25) + private BigDecimal videoTransmissionAssetsAccuracy; + + /** 瑙嗛浼犺緭缃戣祫浜у急鍙d护寰楀垎姣旂巼 */ + @Excel(name = "瑙嗛浼犺緭缃戣祫浜у急鍙d护寰楀垎姣旂巼",width = 25) + private BigDecimal videoTransmissionAssetsWeakPasswordScore; + + /** 瑙嗛浼犺緭缃戝嵄闄╄祫浜у緱鍒嗘瘮閲� */ + @Excel(name = "瑙嗛浼犺緭缃戝嵄闄╄祫浜у緱鍒嗘瘮閲�",width = 25) + private BigDecimal videoTransmissionDangerousAssetsScore; + + /** 瑙嗛浼犺緭缃戣竟鐣屽畬鏁存�ф娴嬫墸鍒嗛」 */ + @Excel(name = "瑙嗛浼犺緭缃戣竟鐣屽畬鏁存�ф娴嬫墸鍒嗛」",width = 25) + private BigDecimal videoTransmissionBoundaryIntegrityDetection; + + /** 鏈堣繍琛岀巼 */ + @Excel(name = "鏈堣繍琛岀巼") + private BigDecimal operatingRate; + + public BigDecimal getPlatformOnline() { + return platformOnline; + } + + public void setPlatformOnline(BigDecimal platformOnline) { + this.platformOnline = platformOnline; + } + + public BigDecimal getMonitorQualification() { + return monitorQualification; + } + + public void setMonitorQualification(BigDecimal monitorQualification) { + this.monitorQualification = monitorQualification; + } + + public BigDecimal getMonitorRegistration() { + return monitorRegistration; + } + + public void setMonitorRegistration(BigDecimal monitorRegistration) { + this.monitorRegistration = monitorRegistration; + } + + public BigDecimal getArchivesRate() { + return archivesRate; + } + + public void setArchivesRate(BigDecimal archivesRate) { + this.archivesRate = archivesRate; + } + + public BigDecimal getSiteOnline() { + return siteOnline; + } + + public void setSiteOnline(BigDecimal siteOnline) { + this.siteOnline = siteOnline; + } + + public BigDecimal getVideoAvailable() { + return videoAvailable; + } + + public void setVideoAvailable(BigDecimal videoAvailable) { + this.videoAvailable = videoAvailable; + } + + public BigDecimal getAnnotationAccuracy() { + return annotationAccuracy; + } + + public void setAnnotationAccuracy(BigDecimal annotationAccuracy) { + this.annotationAccuracy = annotationAccuracy; + } + + public BigDecimal getTimingAccuracy() { + return timingAccuracy; + } + + public void setTimingAccuracy(BigDecimal timingAccuracy) { + this.timingAccuracy = timingAccuracy; + } + + public BigDecimal getKeySiteOnline() { + return keySiteOnline; + } + + public void setKeySiteOnline(BigDecimal keySiteOnline) { + this.keySiteOnline = keySiteOnline; + } + + public BigDecimal getKeyVideoAvailable() { + return keyVideoAvailable; + } + + public void setKeyVideoAvailable(BigDecimal keyVideoAvailable) { + this.keyVideoAvailable = keyVideoAvailable; + } + + public BigDecimal getKeyAnnotationAccuracy() { + return keyAnnotationAccuracy; + } + + public void setKeyAnnotationAccuracy(BigDecimal keyAnnotationAccuracy) { + this.keyAnnotationAccuracy = keyAnnotationAccuracy; + } + + public BigDecimal getKeyTimingAccuracy() { + return keyTimingAccuracy; + } + + public void setKeyTimingAccuracy(BigDecimal keyTimingAccuracy) { + this.keyTimingAccuracy = keyTimingAccuracy; + } + + public BigDecimal getKeyCommandImageInspection() { + return keyCommandImageInspection; + } + + public void setKeyCommandImageInspection(BigDecimal keyCommandImageInspection) { + this.keyCommandImageInspection = keyCommandImageInspection; + } + + public BigDecimal getKeyCommandImageDirectoryTree() { + return keyCommandImageDirectoryTree; + } + + public void setKeyCommandImageDirectoryTree(BigDecimal keyCommandImageDirectoryTree) { + this.keyCommandImageDirectoryTree = keyCommandImageDirectoryTree; + } + + public BigDecimal getOnlineInspectionPlatform() { + return onlineInspectionPlatform; + } + + public void setOnlineInspectionPlatform(BigDecimal onlineInspectionPlatform) { + this.onlineInspectionPlatform = onlineInspectionPlatform; + } + + public BigDecimal getVideoTransmissionAssetsAccuracy() { + return videoTransmissionAssetsAccuracy; + } + + public void setVideoTransmissionAssetsAccuracy(BigDecimal videoTransmissionAssetsAccuracy) { + this.videoTransmissionAssetsAccuracy = videoTransmissionAssetsAccuracy; + } + + public BigDecimal getVideoTransmissionAssetsWeakPasswordScore() { + return videoTransmissionAssetsWeakPasswordScore; + } + + public void setVideoTransmissionAssetsWeakPasswordScore(BigDecimal videoTransmissionAssetsWeakPasswordScore) { + this.videoTransmissionAssetsWeakPasswordScore = videoTransmissionAssetsWeakPasswordScore; + } + + public BigDecimal getVideoTransmissionDangerousAssetsScore() { + return videoTransmissionDangerousAssetsScore; + } + + public void setVideoTransmissionDangerousAssetsScore(BigDecimal videoTransmissionDangerousAssetsScore) { + this.videoTransmissionDangerousAssetsScore = videoTransmissionDangerousAssetsScore; + } + + public BigDecimal getVideoTransmissionBoundaryIntegrityDetection() { + return videoTransmissionBoundaryIntegrityDetection; + } + + public void setVideoTransmissionBoundaryIntegrityDetection(BigDecimal videoTransmissionBoundaryIntegrityDetection) { + this.videoTransmissionBoundaryIntegrityDetection = videoTransmissionBoundaryIntegrityDetection; + } + + public BigDecimal getOperatingRate() { + return operatingRate; + } + + public void setOperatingRate(BigDecimal operatingRate) { + this.operatingRate = operatingRate; + } + + @Override + public Long getId() { + return super.getId(); + } + + @Override + public void setId(Long id) { + super.setId(id); + } + + @Override + public String getDate() { + return super.getDate(); + } + + @Override + public void setDate(String date) { + super.setDate(date); + } + + @Override + public Date getCreateTime() { + return super.getCreateTime(); + } + + @Override + public void setCreateTime(Date createTime) { + super.setCreateTime(createTime); + } + + @Override + public Long getDeptId() { + return super.getDeptId(); + } + + @Override + public void setDeptId(Long deptId) { + super.setDeptId(deptId); + } + + @Override + public String getDeptName() { + return super.getDeptName(); + } + + @Override + public void setDeptName(String deptName) { + super.setDeptName(deptName); + } + + @Override + public Long getExamineTag() { + return super.getExamineTag(); + } + + @Override + public void setExamineTag(Long examineTag) { + super.setExamineTag(examineTag); + } + + @Override + public String toString() { + return "CheckIndexVideo{" + + "id=" + id + + ", date='" + date + '\'' + + ", createTime=" + createTime + + ", deptId=" + deptId + + ", deptName='" + deptName + '\'' + + ", examineTag=" + examineTag + + ", platformOnline=" + platformOnline + + ", monitorQualification=" + monitorQualification + + ", monitorRegistration=" + monitorRegistration + + ", archivesRate=" + archivesRate + + ", siteOnline=" + siteOnline + + ", videoAvailable=" + videoAvailable + + ", annotationAccuracy=" + annotationAccuracy + + ", timingAccuracy=" + timingAccuracy + + ", keySiteOnline=" + keySiteOnline + + ", keyVideoAvailable=" + keyVideoAvailable + + ", keyAnnotationAccuracy=" + keyAnnotationAccuracy + + ", keyTimingAccuracy=" + keyTimingAccuracy + + ", keyCommandImageInspection=" + keyCommandImageInspection + + ", keyCommandImageDirectoryTree=" + keyCommandImageDirectoryTree + + ", onlineInspectionPlatform=" + onlineInspectionPlatform + + ", videoTransmissionAssetsAccuracy=" + videoTransmissionAssetsAccuracy + + ", videoTransmissionAssetsWeakPasswordScore=" + videoTransmissionAssetsWeakPasswordScore + + ", videoTransmissionDangerousAssetsScore=" + videoTransmissionDangerousAssetsScore + + ", videoTransmissionBoundaryIntegrityDetection=" + videoTransmissionBoundaryIntegrityDetection + + ", operatingRate=" + operatingRate + + '}'; + } +} diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java index 17b08cf..97ca2bb 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java @@ -1,6 +1,8 @@ package com.ycl.platform.domain.entity; import annotation.Excel; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.ycl.system.entity.BaseEntity; import lombok.Data; @@ -18,11 +20,13 @@ * @date 2024-04-22 */ @Data +@TableName("t_check_score") public class CheckScore { private static final long serialVersionUID = 1L; /** */ + private Long id; /** 鍒嗗�� */ @@ -43,7 +47,7 @@ /** 鑰冩牳绫诲瀷(杞﹁締/浜鸿劯/瑙嗛) */ @Excel(name = "鑰冩牳绫诲瀷(杞﹁締/浜鸿劯/瑙嗛)") - private Integer examineCategory; + private Short examineCategory; /** 淇敼鏃堕棿 */ @Excel(name = "淇敼鏃堕棿") private Date updateTime; @@ -60,5 +64,6 @@ private String publish; //鎶樼嚎鍥炬棩鏈熷弬鏁� + @TableField(exist = false) private String date; } diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckResultController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckResultController.java deleted file mode 100644 index 527c258..0000000 --- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckResultController.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.ycl.platform.controller; - -import annotation.Log; -import com.ycl.platform.domain.entity.CheckResult; -import com.ycl.platform.service.ICheckResultService; -import com.ycl.system.AjaxResult; -import com.ycl.system.controller.BaseController; -import com.ycl.system.page.TableDataInfo; -import com.ycl.utils.poi.ExcelUtil; -import enumeration.BusinessType; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - -/** - * 鑰冩牳缁撴灉Controller - * - * @author ruoyi - * @date 2024-04-01 - */ -@RestController -@RequestMapping("/check/result") -public class CheckResultController extends BaseController -{ - @Autowired - private ICheckResultService checkResultService; - - /** - * 鏌ヨ鑰冩牳缁撴灉鍒楄〃 - */ - @PreAuthorize("@ss.hasPermi('system:result:list')") - @GetMapping("/list") - public TableDataInfo list(CheckResult checkResult) - { - startPage(); - List<CheckResult> list = checkResultService.selectCheckResultList(checkResult); - return getDataTable(list); - } - - /** - * 瀵煎嚭鑰冩牳缁撴灉鍒楄〃 - */ - @PreAuthorize("@ss.hasPermi('system:result:export')") - @Log(title = "鑰冩牳缁撴灉", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, CheckResult checkResult) - { - List<CheckResult> list = checkResultService.selectCheckResultList(checkResult); - ExcelUtil<CheckResult> util = new ExcelUtil<CheckResult>(CheckResult.class); - util.exportExcel(response, list, "鑰冩牳缁撴灉鏁版嵁"); - } - - /** - * 鑾峰彇鑰冩牳缁撴灉璇︾粏淇℃伅 - */ - @PreAuthorize("@ss.hasPermi('system:result:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(checkResultService.selectCheckResultById(id)); - } - - /** - * 鏂板鑰冩牳缁撴灉 - */ - @PreAuthorize("@ss.hasPermi('system:result:add')") - @Log(title = "鑰冩牳缁撴灉", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody CheckResult checkResult) - { - return toAjax(checkResultService.insertCheckResult(checkResult)); - } - - /** - * 淇敼鑰冩牳缁撴灉 - */ - @PreAuthorize("@ss.hasPermi('system:result:edit')") - @Log(title = "鑰冩牳缁撴灉", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody CheckResult checkResult) - { - return toAjax(checkResultService.updateCheckResult(checkResult)); - } - - /** - * 鍒犻櫎鑰冩牳缁撴灉 - */ - @PreAuthorize("@ss.hasPermi('system:result:remove')") - @Log(title = "鑰冩牳缁撴灉", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(checkResultService.deleteCheckResultByIds(ids)); - } -} diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java index f001700..f3e736c 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckScoreController.java @@ -2,16 +2,20 @@ import annotation.Log; import com.ycl.platform.domain.dto.CheckScoreDTO; +import com.ycl.platform.domain.dto.CheckScoreIndexDTO; import com.ycl.platform.domain.entity.CheckScore; import com.ycl.platform.service.ICheckScoreService; import com.ycl.system.AjaxResult; import com.ycl.system.controller.BaseController; import com.ycl.system.page.TableDataInfo; +import com.ycl.utils.poi.ExcelUtil; import enumeration.BusinessType; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -53,20 +57,21 @@ /** - * 鑾峰彇鑰冩牳绉垎璇︾粏淇℃伅 + * 鑾峰彇鑰冩牳鎸囨爣璇︾粏淇℃伅 */ @PreAuthorize("@ss.hasPermi('check:score:query')") - @GetMapping(value = "/detail/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) + @GetMapping(value = "/detail/index") + public AjaxResult getIndex(CheckScoreIndexDTO checkScoreIndexDTO) { - return success(checkScoreService.selectCheckScoreById(id)); + + return success(checkScoreService.selectCheckScoreById(checkScoreIndexDTO)); } /** * 鍙戝竷鑰冩牳绉垎 */ @PreAuthorize("@ss.hasPermi('check:score:edit')") - @Log(title = "鑰冩牳绉垎", businessType = BusinessType.UPDATE) + @Log(title = "鍙戝竷鑰冩牳绉垎", businessType = BusinessType.UPDATE) @PutMapping("/publish") public AjaxResult edit(@RequestBody CheckScoreDTO checkScoreDTO) { @@ -74,6 +79,15 @@ return toAjax(checkScoreService.publishCheckScore(checkScoreDTO)); } + /** + * 瀵煎嚭鑰冩牳绉垎鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('check:score:export')") + @Log(title = "瀵煎嚭鑰冩牳绉垎", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CheckScore checkScore) throws IOException { + checkScoreService.exportIndex(response,checkScore); + } // /** // * 鏂板鑰冩牳绉垎 // */ @@ -97,16 +111,4 @@ // } -// /** -// * 瀵煎嚭鑰冩牳绉垎鍒楄〃 -// */ -// @PreAuthorize("@ss.hasPermi('check:score:export')") -// @Log(title = "鑰冩牳绉垎", businessType = BusinessType.EXPORT) -// @PostMapping("/export") -// public void export(HttpServletResponse response, CheckScore checkScore) -// { -// List<CheckScore> list = checkScoreService.selectCheckScoreList(checkScore); -// ExcelUtil<CheckScore> util = new ExcelUtil<CheckScore>(CheckScore.class); -// util.exportExcel(response, list, "鑰冩牳绉垎鏄庣粏鏁版嵁"); -// } } diff --git a/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java b/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java index 8f6248c..46aae35 100644 --- a/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java +++ b/ycl-server/src/main/java/com/ycl/platform/controller/CheckTemplateController.java @@ -2,7 +2,9 @@ import annotation.Log; import com.ycl.platform.domain.entity.CheckTemplate; +import com.ycl.platform.domain.entity.CheckTemplateRule; import com.ycl.platform.domain.query.CheckTemplateQuery; +import com.ycl.platform.service.ICheckTemplateRuleService; import com.ycl.platform.service.ICheckTemplateService; import com.ycl.system.AjaxResult; import com.ycl.system.Result; @@ -30,6 +32,8 @@ @Autowired private ICheckTemplateService checkTemplateService; + @Autowired + private ICheckTemplateRuleService checkTemplateRuleService; /** * 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */ @@ -57,7 +61,7 @@ * 鏂板鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:add')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.INSERT) + @Log(title = "鏂板鑰冩牳妯℃澘", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody @Validated CheckTemplateQuery checkTemplateDTO) { @@ -69,7 +73,7 @@ * 澶嶅埗鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:copy')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.INSERT) + @Log(title = "澶嶅埗鑰冩牳妯℃澘", businessType = BusinessType.INSERT) @PostMapping("/copy") public AjaxResult copy(@RequestBody CheckTemplateQuery checkTemplateDTO) { @@ -80,18 +84,28 @@ * 淇敼鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:edit')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.UPDATE) + @Log(title = "淇敼鑰冩牳妯℃澘", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody CheckTemplateQuery checkTemplateDTO) { - return toAjax(checkTemplateService.updateCheckTemplate(checkTemplateDTO)); + return checkTemplateService.updateCheckTemplate(checkTemplateDTO); } + /** + * 淇敼鑰冩牳妯℃澘鏉冮噸 + */ + @PreAuthorize("@ss.hasPermi('check:template:edit')") + @Log(title = "淇敼鑰冩牳妯℃澘鏉冮噸", businessType = BusinessType.UPDATE) + @PutMapping("/weight") + public AjaxResult editWeight(@RequestBody CheckTemplateRule checkTemplateRule) + { + return toAjax(checkTemplateRuleService.updateCheckTemplateRule(checkTemplateRule)); + } /** * 鍒犻櫎鑰冩牳妯℃澘 */ @PreAuthorize("@ss.hasPermi('check:template:remove')") - @Log(title = "鑰冩牳妯℃澘", businessType = BusinessType.DELETE) + @Log(title = "鍒犻櫎鑰冩牳妯℃澘", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") public AjaxResult remove(@PathVariable String id) { diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java new file mode 100644 index 0000000..7e50c1c --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexCarMapper.java @@ -0,0 +1,62 @@ +package com.ycl.platform.mapper; + +import com.ycl.platform.domain.entity.CheckIndexCar; + +import java.util.List; + +/** + * 杞﹁締鎸囨爣姒傜巼鏁版嵁Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2024-04-29 + */ +public interface CheckIndexCarMapper +{ + /** + * 鏌ヨ杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param id 杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 杞﹁締鎸囨爣姒傜巼鏁版嵁 + */ + public CheckIndexCar selectCheckIndexCarById(Long id); + + /** + * 鏌ヨ杞﹁締鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 杞﹁締鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + public List<CheckIndexCar> selectCheckIndexCarList(CheckIndexCar checkIndexCar); + + /** + * 鏂板杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int insertCheckIndexCar(CheckIndexCar checkIndexCar); + + /** + * 淇敼杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int updateCheckIndexCar(CheckIndexCar checkIndexCar); + + /** + * 鍒犻櫎杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param id 杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + public int deleteCheckIndexCarById(Long id); + + /** + * 鎵归噺鍒犻櫎杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteCheckIndexCarByIds(Long[] ids); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java new file mode 100644 index 0000000..6fb00bf --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexFaceMapper.java @@ -0,0 +1,62 @@ +package com.ycl.platform.mapper; + +import com.ycl.platform.domain.entity.CheckIndexFace; + +import java.util.List; + +/** + * 浜鸿劯鎸囨爣姒傜巼鏁版嵁Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2024-04-29 + */ +public interface CheckIndexFaceMapper +{ + /** + * 鏌ヨ浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param id 浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + */ + public CheckIndexFace selectCheckIndexFaceById(Long id); + + /** + * 鏌ヨ浜鸿劯鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 浜鸿劯鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + public List<CheckIndexFace> selectCheckIndexFaceList(CheckIndexFace checkIndexFace); + + /** + * 鏂板浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int insertCheckIndexFace(CheckIndexFace checkIndexFace); + + /** + * 淇敼浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int updateCheckIndexFace(CheckIndexFace checkIndexFace); + + /** + * 鍒犻櫎浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param id 浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + public int deleteCheckIndexFaceById(Long id); + + /** + * 鎵归噺鍒犻櫎浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteCheckIndexFaceByIds(Long[] ids); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java new file mode 100644 index 0000000..ae674d8 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckIndexVideoMapper.java @@ -0,0 +1,62 @@ +package com.ycl.platform.mapper; + +import com.ycl.platform.domain.entity.CheckIndexVideo; + +import java.util.List; + +/** + * 瑙嗛鎸囨爣姒傜巼鏁版嵁Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2024-04-29 + */ +public interface CheckIndexVideoMapper +{ + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param id 瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁 + */ + public CheckIndexVideo selectCheckIndexVideoById(Long id); + + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + public List<CheckIndexVideo> selectCheckIndexVideoList(CheckIndexVideo checkIndexVideo); + + /** + * 鏂板瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int insertCheckIndexVideo(CheckIndexVideo checkIndexVideo); + + /** + * 淇敼瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int updateCheckIndexVideo(CheckIndexVideo checkIndexVideo); + + /** + * 鍒犻櫎瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param id 瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + public int deleteCheckIndexVideoById(Long id); + + /** + * 鎵归噺鍒犻櫎瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteCheckIndexVideoByIds(Long[] ids); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java index 09d9ad8..59510a7 100644 --- a/ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java +++ b/ycl-server/src/main/java/com/ycl/platform/mapper/CheckScoreMapper.java @@ -1,6 +1,7 @@ package com.ycl.platform.mapper; import annotation.AutoFill; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.ycl.platform.domain.dto.CheckScoreDTO; import com.ycl.platform.domain.entity.CheckScore; import enumeration.OperationType; @@ -14,7 +15,7 @@ * @author ruoyi * @date 2024-04-22 */ -public interface CheckScoreMapper +public interface CheckScoreMapper extends BaseMapper<CheckScore> { /** * 鏌ヨ鑰冩牳绉垎鏄庣粏 diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java new file mode 100644 index 0000000..bf6443f --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexCarService.java @@ -0,0 +1,62 @@ +package com.ycl.platform.service; + +import com.ycl.platform.domain.entity.CheckIndexCar; + +import java.util.List; + +/** + * 杞﹁締鎸囨爣姒傜巼鏁版嵁Service鎺ュ彛 + * + * @author ruoyi + * @date 2024-04-29 + */ +public interface ICheckIndexCarService +{ + /** + * 鏌ヨ杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param id 杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 杞﹁締鎸囨爣姒傜巼鏁版嵁 + */ + public CheckIndexCar selectCheckIndexCarById(Long id); + + /** + * 鏌ヨ杞﹁締鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 杞﹁締鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + public List<CheckIndexCar> selectCheckIndexCarList(CheckIndexCar checkIndexCar); + + /** + * 鏂板杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int insertCheckIndexCar(CheckIndexCar checkIndexCar); + + /** + * 淇敼杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int updateCheckIndexCar(CheckIndexCar checkIndexCar); + + /** + * 鎵归噺鍒犻櫎杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteCheckIndexCarByIds(Long[] ids); + + /** + * 鍒犻櫎杞﹁締鎸囨爣姒傜巼鏁版嵁淇℃伅 + * + * @param id 杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + public int deleteCheckIndexCarById(Long id); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java new file mode 100644 index 0000000..b9acecc --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexFaceService.java @@ -0,0 +1,62 @@ +package com.ycl.platform.service; + +import com.ycl.platform.domain.entity.CheckIndexFace; + +import java.util.List; + +/** + * 浜鸿劯鎸囨爣姒傜巼鏁版嵁Service鎺ュ彛 + * + * @author ruoyi + * @date 2024-04-29 + */ +public interface ICheckIndexFaceService +{ + /** + * 鏌ヨ浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param id 浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + */ + public CheckIndexFace selectCheckIndexFaceById(Long id); + + /** + * 鏌ヨ浜鸿劯鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 浜鸿劯鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + public List<CheckIndexFace> selectCheckIndexFaceList(CheckIndexFace checkIndexFace); + + /** + * 鏂板浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int insertCheckIndexFace(CheckIndexFace checkIndexFace); + + /** + * 淇敼浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int updateCheckIndexFace(CheckIndexFace checkIndexFace); + + /** + * 鎵归噺鍒犻櫎浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteCheckIndexFaceByIds(Long[] ids); + + /** + * 鍒犻櫎浜鸿劯鎸囨爣姒傜巼鏁版嵁淇℃伅 + * + * @param id 浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + public int deleteCheckIndexFaceById(Long id); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java new file mode 100644 index 0000000..2f7e32c --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckIndexVideoService.java @@ -0,0 +1,62 @@ +package com.ycl.platform.service; + +import com.ycl.platform.domain.entity.CheckIndexVideo; + +import java.util.List; + +/** + * 瑙嗛鎸囨爣姒傜巼鏁版嵁Service鎺ュ彛 + * + * @author ruoyi + * @date 2024-04-29 + */ +public interface ICheckIndexVideoService +{ + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param id 瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁 + */ + public CheckIndexVideo selectCheckIndexVideoById(Long id); + + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁闆嗗悎 + */ + public List<CheckIndexVideo> selectCheckIndexVideoList(CheckIndexVideo checkIndexVideo); + + /** + * 鏂板瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int insertCheckIndexVideo(CheckIndexVideo checkIndexVideo); + + /** + * 淇敼瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + public int updateCheckIndexVideo(CheckIndexVideo checkIndexVideo); + + /** + * 鎵归噺鍒犻櫎瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteCheckIndexVideoByIds(Long[] ids); + + /** + * 鍒犻櫎瑙嗛鎸囨爣姒傜巼鏁版嵁淇℃伅 + * + * @param id 瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + public int deleteCheckIndexVideoById(Long id); +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java index c5ba652..588183b 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckScoreService.java @@ -1,9 +1,13 @@ package com.ycl.platform.service; +import com.baomidou.mybatisplus.extension.service.IService; import com.ycl.platform.domain.dto.CheckScoreDTO; +import com.ycl.platform.domain.dto.CheckScoreIndexDTO; import com.ycl.platform.domain.entity.CheckScore; import com.ycl.platform.domain.vo.CheckScoreDetailVO; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -13,15 +17,15 @@ * @author ruoyi * @date 2024-04-22 */ -public interface ICheckScoreService +public interface ICheckScoreService extends IService<CheckScore> { /** * 鏌ヨ鑰冩牳绉垎鏄庣粏 * - * @param id 鑰冩牳绉垎鏄庣粏涓婚敭 + * @param * @return 鑰冩牳绉垎鏄庣粏 */ - public CheckScoreDetailVO selectCheckScoreById(Long id); + public CheckScoreDetailVO selectCheckScoreById(CheckScoreIndexDTO checkScoreIndexDTO); /** * 鏌ヨ鑰冩牳绉垎鏄庣粏鍒楄〃 @@ -66,4 +70,6 @@ int publishCheckScore(CheckScoreDTO checkScoreDTO); List<CheckScore> page(CheckScore checkScore); + + void exportIndex(HttpServletResponse response,CheckScore checkScore) throws IOException; } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java b/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java index eeeaee6..0415e69 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/ICheckTemplateService.java @@ -3,6 +3,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.ycl.platform.domain.entity.CheckTemplate; import com.ycl.platform.domain.query.CheckTemplateQuery; +import com.ycl.system.AjaxResult; import com.ycl.system.Result; import java.util.List; @@ -45,7 +46,7 @@ * @param checkTemplateDTO 鑰冩牳妯℃澘 * @return 缁撴灉 */ - public int updateCheckTemplate(CheckTemplateQuery checkTemplateDTO); + public AjaxResult updateCheckTemplate(CheckTemplateQuery checkTemplateDTO); /** * 鎵归噺鍒犻櫎鑰冩牳妯℃澘 diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java new file mode 100644 index 0000000..c01bf8b --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexCarServiceImpl.java @@ -0,0 +1,96 @@ +package com.ycl.platform.service.impl; + +import com.ycl.platform.domain.entity.CheckIndexCar; +import com.ycl.platform.mapper.CheckIndexCarMapper; +import com.ycl.platform.service.ICheckIndexCarService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import utils.DateUtils; + +import java.util.List; + +/** + * 杞﹁締鎸囨爣姒傜巼鏁版嵁Service涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-04-29 + */ +@Service +public class CheckIndexCarServiceImpl implements ICheckIndexCarService +{ + @Autowired + private CheckIndexCarMapper checkIndexCarMapper; + + /** + * 鏌ヨ杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param id 杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 杞﹁締鎸囨爣姒傜巼鏁版嵁 + */ + @Override + public CheckIndexCar selectCheckIndexCarById(Long id) + { + return checkIndexCarMapper.selectCheckIndexCarById(id); + } + + /** + * 鏌ヨ杞﹁締鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 杞﹁締鎸囨爣姒傜巼鏁版嵁 + */ + @Override + public List<CheckIndexCar> selectCheckIndexCarList(CheckIndexCar checkIndexCar) + { + return checkIndexCarMapper.selectCheckIndexCarList(checkIndexCar); + } + + /** + * 鏂板杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + @Override + public int insertCheckIndexCar(CheckIndexCar checkIndexCar) + { + checkIndexCar.setCreateTime(DateUtils.getNowDate()); + return checkIndexCarMapper.insertCheckIndexCar(checkIndexCar); + } + + /** + * 淇敼杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexCar 杞﹁締鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + @Override + public int updateCheckIndexCar(CheckIndexCar checkIndexCar) + { + return checkIndexCarMapper.updateCheckIndexCar(checkIndexCar); + } + + /** + * 鎵归噺鍒犻櫎杞﹁締鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteCheckIndexCarByIds(Long[] ids) + { + return checkIndexCarMapper.deleteCheckIndexCarByIds(ids); + } + + /** + * 鍒犻櫎杞﹁締鎸囨爣姒傜巼鏁版嵁淇℃伅 + * + * @param id 杞﹁締鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteCheckIndexCarById(Long id) + { + return checkIndexCarMapper.deleteCheckIndexCarById(id); + } +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java new file mode 100644 index 0000000..6065faa --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexFaceServiceImpl.java @@ -0,0 +1,96 @@ +package com.ycl.platform.service.impl; + +import com.ycl.platform.domain.entity.CheckIndexFace; +import com.ycl.platform.mapper.CheckIndexFaceMapper; +import com.ycl.platform.service.ICheckIndexFaceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import utils.DateUtils; + +import java.util.List; + +/** + * 浜鸿劯鎸囨爣姒傜巼鏁版嵁Service涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-04-29 + */ +@Service +public class CheckIndexFaceServiceImpl implements ICheckIndexFaceService +{ + @Autowired + private CheckIndexFaceMapper checkIndexFaceMapper; + + /** + * 鏌ヨ浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param id 浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + */ + @Override + public CheckIndexFace selectCheckIndexFaceById(Long id) + { + return checkIndexFaceMapper.selectCheckIndexFaceById(id); + } + + /** + * 鏌ヨ浜鸿劯鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + */ + @Override + public List<CheckIndexFace> selectCheckIndexFaceList(CheckIndexFace checkIndexFace) + { + return checkIndexFaceMapper.selectCheckIndexFaceList(checkIndexFace); + } + + /** + * 鏂板浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + @Override + public int insertCheckIndexFace(CheckIndexFace checkIndexFace) + { + checkIndexFace.setCreateTime(DateUtils.getNowDate()); + return checkIndexFaceMapper.insertCheckIndexFace(checkIndexFace); + } + + /** + * 淇敼浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexFace 浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + @Override + public int updateCheckIndexFace(CheckIndexFace checkIndexFace) + { + return checkIndexFaceMapper.updateCheckIndexFace(checkIndexFace); + } + + /** + * 鎵归噺鍒犻櫎浜鸿劯鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteCheckIndexFaceByIds(Long[] ids) + { + return checkIndexFaceMapper.deleteCheckIndexFaceByIds(ids); + } + + /** + * 鍒犻櫎浜鸿劯鎸囨爣姒傜巼鏁版嵁淇℃伅 + * + * @param id 浜鸿劯鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteCheckIndexFaceById(Long id) + { + return checkIndexFaceMapper.deleteCheckIndexFaceById(id); + } +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java new file mode 100644 index 0000000..c0b1492 --- /dev/null +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckIndexVideoServiceImpl.java @@ -0,0 +1,96 @@ +package com.ycl.platform.service.impl; + +import com.ycl.platform.domain.entity.CheckIndexVideo; +import com.ycl.platform.mapper.CheckIndexVideoMapper; +import com.ycl.platform.service.ICheckIndexVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import utils.DateUtils; + +import java.util.List; + +/** + * 瑙嗛鎸囨爣姒傜巼鏁版嵁Service涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2024-04-29 + */ +@Service +public class CheckIndexVideoServiceImpl implements ICheckIndexVideoService +{ + @Autowired + private CheckIndexVideoMapper checkIndexVideoMapper; + + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param id 瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁 + */ + @Override + public CheckIndexVideo selectCheckIndexVideoById(Long id) + { + return checkIndexVideoMapper.selectCheckIndexVideoById(id); + } + + /** + * 鏌ヨ瑙嗛鎸囨爣姒傜巼鏁版嵁鍒楄〃 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 瑙嗛鎸囨爣姒傜巼鏁版嵁 + */ + @Override + public List<CheckIndexVideo> selectCheckIndexVideoList(CheckIndexVideo checkIndexVideo) + { + return checkIndexVideoMapper.selectCheckIndexVideoList(checkIndexVideo); + } + + /** + * 鏂板瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + @Override + public int insertCheckIndexVideo(CheckIndexVideo checkIndexVideo) + { + checkIndexVideo.setCreateTime(DateUtils.getNowDate()); + return checkIndexVideoMapper.insertCheckIndexVideo(checkIndexVideo); + } + + /** + * 淇敼瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param checkIndexVideo 瑙嗛鎸囨爣姒傜巼鏁版嵁 + * @return 缁撴灉 + */ + @Override + public int updateCheckIndexVideo(CheckIndexVideo checkIndexVideo) + { + return checkIndexVideoMapper.updateCheckIndexVideo(checkIndexVideo); + } + + /** + * 鎵归噺鍒犻櫎瑙嗛鎸囨爣姒傜巼鏁版嵁 + * + * @param ids 闇�瑕佸垹闄ょ殑瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteCheckIndexVideoByIds(Long[] ids) + { + return checkIndexVideoMapper.deleteCheckIndexVideoByIds(ids); + } + + /** + * 鍒犻櫎瑙嗛鎸囨爣姒傜巼鏁版嵁淇℃伅 + * + * @param id 瑙嗛鎸囨爣姒傜巼鏁版嵁涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteCheckIndexVideoById(Long id) + { + return checkIndexVideoMapper.deleteCheckIndexVideoById(id); + } +} diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java index b9a135e..b1568b9 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java @@ -1,32 +1,45 @@ package com.ycl.platform.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ycl.platform.base.BaseSelect; +import com.ycl.platform.base.CheckIndex; import com.ycl.platform.domain.dto.CheckScoreDTO; -import com.ycl.platform.domain.entity.CheckRule; -import com.ycl.platform.domain.entity.CheckScore; -import com.ycl.platform.domain.entity.CheckTemplate; -import com.ycl.platform.domain.entity.CheckTemplateRule; +import com.ycl.platform.domain.dto.CheckScoreIndexDTO; +import com.ycl.platform.domain.entity.*; import com.ycl.platform.domain.vo.CheckScoreDetailVO; import com.ycl.platform.mapper.CheckRuleMapper; import com.ycl.platform.mapper.CheckScoreMapper; import com.ycl.platform.mapper.CheckTemplateMapper; import com.ycl.platform.mapper.CheckTemplateRuleMapper; +import com.ycl.platform.service.ICheckIndexCarService; +import com.ycl.platform.service.ICheckIndexFaceService; +import com.ycl.platform.service.ICheckIndexVideoService; import com.ycl.platform.service.ICheckScoreService; +import com.ycl.system.Result; import com.ycl.system.entity.SysRole; +import com.ycl.system.service.ISysDeptService; import com.ycl.utils.SecurityUtils; +import com.ycl.utils.StringUtils; +import com.ycl.utils.poi.ExcelUtil; +import constant.CheckConstants; +import enumeration.general.CheckScoreType; import enumeration.general.PublishType; +import jakarta.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import pojo.ExcelExp; import utils.DateUtils; +import utils.poi.ExcelUtilManySheet; +import java.io.IOException; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * 鑰冩牳绉垎鏄庣粏Service涓氬姟灞傚鐞� @@ -36,7 +49,7 @@ */ @Service @Slf4j -public class CheckScoreServiceImpl implements ICheckScoreService +public class CheckScoreServiceImpl extends ServiceImpl<CheckScoreMapper, CheckScore> implements ICheckScoreService { @Autowired private CheckScoreMapper scoreMapper; @@ -46,6 +59,14 @@ private CheckTemplateRuleMapper templateRuleMapper; @Autowired private CheckRuleMapper ruleMapper; + @Autowired + private ICheckIndexCarService indexCarService; + @Autowired + private ICheckIndexFaceService indexFaceService; + @Autowired + private ICheckIndexVideoService indexVideoService; + @Autowired + private ISysDeptService deptService; /** * 鏌ヨ鑰冩牳绉垎 * @@ -53,39 +74,36 @@ * @return 鑰冩牳绉垎 */ @Override - public CheckScoreDetailVO selectCheckScoreById(Long id) + public CheckScoreDetailVO selectCheckScoreById(CheckScoreIndexDTO checkScoreIndexDTO) { + Long checkScoreId = checkScoreIndexDTO.getId(); + CheckScoreDetailVO checkScoreDetailVO = new CheckScoreDetailVO(); //鏍规嵁id璇诲彇score - CheckScore checkScore = scoreMapper.selectCheckScoreById(id); + CheckScore checkScore = scoreMapper.selectCheckScoreById(checkScoreId); //璇诲彇瑙勫垯浠ュ強鏉冮噸 List<CheckTemplateRule> templateRuleList = templateRuleMapper.selectListByTemplateId(checkScore.getTemplateId()); - //checkRules娣诲姞鑰冩牳瀵硅薄鍜岃�冩牳鏃堕棿 List<CheckRule> checkRules = new ArrayList<>(); - CheckRule checkRule1 = new CheckRule(); - checkRule1.setRuleName("鑰冩牳鏃堕棿"); - checkRule1.setRuleIndex("create_time"); - CheckRule checkRule2 = new CheckRule(); - checkRule2.setRuleName("鑰冩牳瀵硅薄"); - checkRule2.setRuleIndex("deptId"); //璇诲彇妯℃澘瀵瑰簲鎵�鏈夎鍒� Map<String,Object> scoreMap = new HashMap<>(); List<Integer> ruleIds = templateRuleList.stream().map(checkTemplateRule -> checkTemplateRule.getCheckRuleId()) .collect(Collectors.toList()); List<CheckRule> ruleIndex = ruleMapper.selectBatchIds(ruleIds); -// checkRules.add(checkRule1); -// checkRules.add(checkRule2); checkRules.addAll(ruleIndex); //鏍规嵁examineCategory 璇诲彇涓嶅悓index琛� - Integer examineCategory = checkScore.getExamineCategory(); - String[] indexTableArr ={"t_check_index_car","t_check_index_face","t_check_index_video"}; + Short examineCategory = checkScore.getExamineCategory(); + String[] indexTableArr ={"","t_check_index_video","t_check_index_car","t_check_index_face"}; String tableName = indexTableArr[examineCategory]; - //TODO:鑾峰彇褰撳墠鏈堜唤 - LocalDate now = LocalDate.now(); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); - String date = formatter.format(now); + //鑾峰綋鏈堜唤 + String date = checkScoreIndexDTO.getDate(); + if(StringUtils.isEmpty(date)){ + //濡傛灉鏌ヨ鏉′欢涓嶅惈鍙傛暟锛屾煡璇㈢Н鍒嗗搴斿垱寤烘椂闂� + Date createTime = checkScore.getCreateTime(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); + date = formatter.format(createTime); + } List<Map> map = scoreMapper.selectScoreIndex(tableName,checkScore.getDeptId(),date); scoreMap.put("tableData",checkRules); @@ -109,6 +127,17 @@ //TODO:鏁版嵁鏉冮檺 //鏌ヨ鎴愮哗 + String date = checkScore.getDate(); + if(StringUtils.isEmpty(date)){ + //濡傛灉涓虹┖鏌ユ湰鏈堢殑鏁版嵁 + Calendar now = Calendar.getInstance(); + //鍙栨槰澶� + now.add(Calendar.DATE, -1); + Date yesterday = now.getTime(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + date = simpleDateFormat.format(yesterday); + checkScore.setDate(date); + } List<CheckScore> checkScores = scoreMapper.selectCheckScoreList(checkScore); Map<Long, List<CheckScore>> deptMap = checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId)); return deptMap; @@ -124,6 +153,8 @@ //TODO:鏁版嵁鏉冮檺 return scoreMapper.selectCheckScoreList(checkScore); } + + /** * 鏂板鑰冩牳绉垎 * @@ -188,7 +219,6 @@ try { publishType = PublishType.valueOf(checkScoreDTO.getPublish()); } catch (IllegalArgumentException e) { - log.error("鍙傛暟绫诲瀷涓嶅尮閰�"); throw new IllegalArgumentException("鍙傛暟绫诲瀷涓嶅尮閰�"); } String code = publishType.getCode(); @@ -197,5 +227,78 @@ return scoreMapper.publishCheckScore(checkScoreDTO); } + /** + * 瀵煎嚭鎸囨爣 + * + * @param checkScore 鑰冩牳绉垎 + * @return 鑰冩牳绉垎 + */ + @Override + public void exportIndex(HttpServletResponse response,CheckScore checkScoreDTO) throws IOException { + String date = checkScoreDTO.getDate(); + //濡傛灉璇锋眰鍙傛暟鏃堕棿涓虹┖锛屾煡杩欐潯璁板綍鐨勬椂闂� + if(StringUtils.isEmpty(date)) { + CheckScore checkScore = getById(checkScoreDTO.getId()); + Date createTime = checkScore.getCreateTime(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); + date = simpleDateFormat.format(createTime); + } + /** 瀵间笁寮爏heet */ + //杞﹁締 + CheckIndexCar checkIndexCar = new CheckIndexCar(); + checkIndexCar.setDate(date); + List<CheckIndexCar> checkIndexCars = indexCarService.selectCheckIndexCarList(checkIndexCar); + ExcelExp e1 = new ExcelExp("杞﹁締鑰冩牳鎸囨爣鏁版嵁",checkIndexCars,CheckIndexCar.class); + //浜鸿劯 + CheckIndexFace checkIndexFace = new CheckIndexFace(); + checkIndexFace.setDate(date); + List<CheckIndexFace> checkIndexFaces = indexFaceService.selectCheckIndexFaceList(checkIndexFace); + ExcelExp e2 = new ExcelExp("浜鸿劯鑰冩牳鎸囨爣鏁版嵁",checkIndexFaces,CheckIndexFace.class); + //瑙嗛 + CheckIndexVideo checkIndexVideo = new CheckIndexVideo(); + checkIndexVideo.setDate(date); + List<CheckIndexVideo> checkIndexVideos = indexVideoService.selectCheckIndexVideoList(checkIndexVideo); + ExcelExp e3 = new ExcelExp("瑙嗛鑰冩牳鎸囨爣鏁版嵁",checkIndexVideos,CheckIndexVideo.class); + + List<ExcelExp> mysheet = new ArrayList<>(); + mysheet.add(e1); + mysheet.add(e2); + mysheet.add(e3); + ExcelUtilManySheet<List<ExcelExp>> util = new ExcelUtilManySheet<>(mysheet); + util.exportExcelManySheet(response,mysheet); + + //瀵煎崟sheet鐨勬柟寮� +// switch (CheckScoreType.fromValue(examineCategory)){ +// case CHECK_SCORE_TYPE_CAR: +// //鏌ヨ溅杈� +// List<CheckIndexCar> checkIndexCars = indexCarService.selectCheckIndexCarList(new CheckIndexCar()); +// export(response, depts, checkIndexCars,CheckIndexCar.class); +// break; +// case CHECK_SCORE_TYPE_FACE: +// // 鏌ヤ汉鑴� +// List<CheckIndexFace> checkIndexFaces = indexFaceService.selectCheckIndexFaceList(new CheckIndexFace()); +// export(response, depts, checkIndexFaces,CheckIndexFace.class); +// break; +// case CHECK_SCORE_TYPE_VIDEO: +// // 鏌ヨ棰� +// List<CheckIndexVideo> checkIndexVideos = indexVideoService.selectCheckIndexVideoList(new CheckIndexVideo()); +// export(response, depts, checkIndexVideos,CheckIndexVideo.class); +// break; +// } + } + + private <T extends CheckIndex> void export(HttpServletResponse response, List<BaseSelect> depts, List<T> checkIndexes,Class<T> checkIndexClass) { + //鏆傛椂娌$敤锛屽鏋滄暟鎹繃澶э紝鍦╯erver灞傜炕璇戯紝閬垮厤杩炶〃 + checkIndexes.forEach(checkIndex->{ + Optional<BaseSelect> first = depts.stream().filter(baseSelect -> checkIndex.getDeptId().equals(Long.valueOf(baseSelect.getId()+""))).findFirst(); + if(first.isPresent()){ + checkIndex.setDeptName(first.get().getValue()); + } + }); + + ExcelUtil<T> util = new ExcelUtil<T>(checkIndexClass); + util.exportExcel(response, checkIndexes, "鑰冩牳绉垎鏄庣粏鏁版嵁"); + + } } diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java index 96a0be0..09f29b9 100644 --- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java +++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckTemplateServiceImpl.java @@ -11,6 +11,7 @@ import com.ycl.platform.mapper.CheckTemplateRuleMapper; import com.ycl.platform.service.ICheckTemplateRuleService; import com.ycl.platform.service.ICheckTemplateService; +import com.ycl.system.AjaxResult; import com.ycl.system.Result; import com.ycl.system.entity.SysDept; import com.ycl.system.service.ISysDeptService; @@ -36,13 +37,14 @@ * @date 2024-04-01 */ @Service -public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateMapper,CheckTemplate> implements ICheckTemplateService { +public class CheckTemplateServiceImpl extends ServiceImpl<CheckTemplateMapper, CheckTemplate> implements ICheckTemplateService { @Autowired private CheckTemplateMapper checkTemplateMapper; @Autowired private ICheckTemplateRuleService templateRuleServicee; @Autowired private CheckTemplateRuleMapper checkTemplateRuleMapper; + /** * 鏌ヨ鑰冩牳妯℃澘 * @@ -56,15 +58,15 @@ BeanUtils.copyProperties(checkTemplate, checkTemplateQuery); List<Integer> deptIds = JSONArray.parseArray(checkTemplate.getDeptId(), Integer.class); checkTemplateQuery.setDeptId(deptIds) - .setAdjustCoefficient(checkTemplate.getAdjustCoefficient()+"") - .setAlarmScore(checkTemplate.getAlarmScore()+""); + .setAdjustCoefficient(checkTemplate.getAdjustCoefficient() + "") + .setAlarmScore(checkTemplate.getAlarmScore() + ""); //鏌ヨ瑙勫垯鏉冮噸 List<CheckTemplateRule> templateRuleList = checkTemplateRuleMapper.selectListByTemplateId(checkTemplate.getId()); - List<Map<String,Object>> list = new ArrayList<>(); + List<Map<String, Object>> list = new ArrayList<>(); for (CheckTemplateRule checkTemplateRule : templateRuleList) { - Map<String,Object> map = new HashMap<>(); - map.put("ruleId",checkTemplateRule.getCheckRuleId()); - map.put("weight",checkTemplateRule.getWeight()); + Map<String, Object> map = new HashMap<>(); + map.put("ruleId", checkTemplateRule.getCheckRuleId()); + map.put("weight", checkTemplateRule.getWeight()); list.add(map); } checkTemplateQuery.setRuleFormList(list); @@ -90,7 +92,7 @@ CheckTemplateQuery checkTemplateQuery = new CheckTemplateQuery(); BeanUtils.copyProperties(template, checkTemplateQuery); checkTemplateQuery.setDeptId(deptIds) - .setAdjustCoefficient(template.getAdjustCoefficient()+""); + .setAdjustCoefficient(template.getAdjustCoefficient() + ""); checkTemplateList.add(checkTemplateQuery); } @@ -120,15 +122,16 @@ checkTemplate.setDeptId(JSONArray.toJSONString(deptId)) .setUpdateUserName(username) .setCreateUserName(username) - .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient()+"")) + .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient() + "")) //涓嶅~鎶ヨ鍒嗘暟---->闆跺垎---->涓嶆姤璀� - .setAlarmScore(new BigDecimal(checkTemplateDTO.getAlarmScore() == null? "":checkTemplateDTO.getAlarmScore())); + .setAlarmScore(new BigDecimal(checkTemplateDTO.getAlarmScore() == null ? "" : checkTemplateDTO.getAlarmScore())); int i = checkTemplateMapper.insertCheckTemplate(checkTemplate); /** t_template_rule鏂板鏉冮噸 */ insertTemlpateRule(checkTemplateDTO, checkTemplate); return i; } + /** * 澶嶅埗鑰冩牳妯℃澘 * @@ -164,15 +167,16 @@ */ @Override @Transactional(rollbackFor = Exception.class) - public int updateCheckTemplate(CheckTemplateQuery checkTemplateDTO) { + public AjaxResult updateCheckTemplate(CheckTemplateQuery checkTemplateDTO) { CheckTemplate checkTemplate = new CheckTemplate(); BeanUtils.copyProperties(checkTemplateDTO, checkTemplate); checkTemplate.setUpdateUserName(SecurityUtils.getUsername()); List<Integer> deptId = checkTemplateDTO.getDeptId(); Collections.sort(deptId); checkTemplate.setDeptId(JSONArray.toJSONString(deptId)) - .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient()+"")); - int i = checkTemplateMapper.updateCheckTemplate(checkTemplate); + .setAdjustCoefficient(new BigDecimal(checkTemplateDTO.getAdjustCoefficient() + "")); + checkTemplateMapper.updateCheckTemplate(checkTemplate); + /** t_template_rule淇敼鏉冮噸 */ //鍏堝垹闄ゅ師鏁版嵁 checkTemplateRuleMapper.deleteByTemplateId(checkTemplate.getId()); @@ -180,8 +184,7 @@ insertTemlpateRule(checkTemplateDTO, checkTemplate); //TODO:鍒ゆ柇鐘舵�佹槸鍚︿慨鏀癸紝璋冩暣job琛ㄩ噷鐨勭姸鎬� - - return i; + return AjaxResult.success(); } /** @@ -216,7 +219,6 @@ return Result.ok().data(checkTemplates); } - private void insertTemlpateRule(CheckTemplateQuery checkTemplateDTO, CheckTemplate checkTemplate) { diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml new file mode 100644 index 0000000..42f8fe4 --- /dev/null +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml @@ -0,0 +1,117 @@ +<?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.ycl.platform.mapper.CheckIndexCarMapper"> + + <resultMap type="com.ycl.platform.domain.entity.CheckIndexCar" id="CheckIndexCarResult"> + <result property="id" column="id" /> + <result property="deptId" column="dept_id" /> + <result property="examineTag" column="examine_tag" /> + <result property="createTime" column="create_time" /> + <result property="viewConnectStability" column="view_connect_stability" /> + <result property="siteOnline" column="site_online" /> + <result property="deviceDirectoryConsistent" column="device_directory_consistent" /> + <result property="vehicleInformationCollectionAccuracy" column="vehicle_information_collection_accuracy" /> + <result property="vehicleCaptureIntegrity" column="vehicle_capture_integrity" /> + <result property="vehicleCaptureAccuracy" column="vehicle_capture_accuracy" /> + <result property="vehicleTimingAccuracy" column="vehicle_timing_accuracy" /> + <result property="vehicleUploadTimeliness" column="vehicle_upload_timeliness" /> + <result property="vehicleUrlAvailability" column="vehicle_url_availability" /> + <result property="vehiclePictureAvailability" column="vehicle_picture_availability" /> + </resultMap> + + <sql id="selectCheckIndexCarVo"> + select id, dept_id ,examine_tag, create_time, view_connect_stability, site_online, device_directory_consistent, vehicle_information_collection_accuracy, vehicle_capture_integrity, vehicle_capture_accuracy, vehicle_timing_accuracy, vehicle_upload_timeliness, vehicle_url_availability, vehicle_picture_availability from t_check_index_car + </sql> + + <select id="selectCheckIndexCarList" resultMap="CheckIndexCarResult"> + select tcic.*,sd.dept_name + from t_check_index_car tcic left join sys_dept sd on tcic.dept_id = sd.dept_id + <where> + <if test="deptId != null "> and dept_id = #{deptId}</if> + <if test="examineTag != null "> and examine_tag = #{examineTag}</if> + <if test="date != null "> and date_format(tcic.create_time,'%Y-%m') = #{date}</if> + <if test="viewConnectStability != null "> and view_connect_stability = #{viewConnectStability}</if> + <if test="siteOnline != null "> and site_online = #{siteOnline}</if> + <if test="deviceDirectoryConsistent != null "> and device_directory_consistent = #{deviceDirectoryConsistent}</if> + <if test="vehicleInformationCollectionAccuracy != null "> and vehicle_information_collection_accuracy = #{vehicleInformationCollectionAccuracy}</if> + <if test="vehicleCaptureIntegrity != null "> and vehicle_capture_integrity = #{vehicleCaptureIntegrity}</if> + <if test="vehicleCaptureAccuracy != null "> and vehicle_capture_accuracy = #{vehicleCaptureAccuracy}</if> + <if test="vehicleTimingAccuracy != null "> and vehicle_timing_accuracy = #{vehicleTimingAccuracy}</if> + <if test="vehicleUploadTimeliness != null "> and vehicle_upload_timeliness = #{vehicleUploadTimeliness}</if> + <if test="vehicleUrlAvailability != null "> and vehicle_url_availability = #{vehicleUrlAvailability}</if> + <if test="vehiclePictureAvailability != null "> and vehicle_picture_availability = #{vehiclePictureAvailability}</if> + </where> + </select> + + <select id="selectCheckIndexCarById" resultMap="CheckIndexCarResult"> + <include refid="selectCheckIndexCarVo"/> + where id = #{id} + </select> + + <insert id="insertCheckIndexCar" useGeneratedKeys="true" keyProperty="id"> + insert into t_check_index_car + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="deptId != null">dept_id,</if> + <if test="examineTag != null">examine_tag,</if> + <if test="createTime != null">create_time,</if> + <if test="viewConnectStability != null">view_connect_stability,</if> + <if test="siteOnline != null">site_online,</if> + <if test="deviceDirectoryConsistent != null">device_directory_consistent,</if> + <if test="vehicleInformationCollectionAccuracy != null">vehicle_information_collection_accuracy,</if> + <if test="vehicleCaptureIntegrity != null">vehicle_capture_integrity,</if> + <if test="vehicleCaptureAccuracy != null">vehicle_capture_accuracy,</if> + <if test="vehicleTimingAccuracy != null">vehicle_timing_accuracy,</if> + <if test="vehicleUploadTimeliness != null">vehicle_upload_timeliness,</if> + <if test="vehicleUrlAvailability != null">vehicle_url_availability,</if> + <if test="vehiclePictureAvailability != null">vehicle_picture_availability,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="deptId != null">#{deptId},</if> + <if test="examineTag != null">#{examineTag},</if> + <if test="createTime != null">#{createTime},</if> + <if test="viewConnectStability != null">#{viewConnectStability},</if> + <if test="siteOnline != null">#{siteOnline},</if> + <if test="deviceDirectoryConsistent != null">#{deviceDirectoryConsistent},</if> + <if test="vehicleInformationCollectionAccuracy != null">#{vehicleInformationCollectionAccuracy},</if> + <if test="vehicleCaptureIntegrity != null">#{vehicleCaptureIntegrity},</if> + <if test="vehicleCaptureAccuracy != null">#{vehicleCaptureAccuracy},</if> + <if test="vehicleTimingAccuracy != null">#{vehicleTimingAccuracy},</if> + <if test="vehicleUploadTimeliness != null">#{vehicleUploadTimeliness},</if> + <if test="vehicleUrlAvailability != null">#{vehicleUrlAvailability},</if> + <if test="vehiclePictureAvailability != null">#{vehiclePictureAvailability},</if> + </trim> + </insert> + + <update id="updateCheckIndexCar" > + update t_check_index_car + <trim prefix="SET" suffixOverrides=","> + <if test="deptId != null">dept_id = #{deptId},</if> + <if test="examineTag != null">examine_tag = #{examineTag},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="viewConnectStability != null">view_connect_stability = #{viewConnectStability},</if> + <if test="siteOnline != null">site_online = #{siteOnline},</if> + <if test="deviceDirectoryConsistent != null">device_directory_consistent = #{deviceDirectoryConsistent},</if> + <if test="vehicleInformationCollectionAccuracy != null">vehicle_information_collection_accuracy = #{vehicleInformationCollectionAccuracy},</if> + <if test="vehicleCaptureIntegrity != null">vehicle_capture_integrity = #{vehicleCaptureIntegrity},</if> + <if test="vehicleCaptureAccuracy != null">vehicle_capture_accuracy = #{vehicleCaptureAccuracy},</if> + <if test="vehicleTimingAccuracy != null">vehicle_timing_accuracy = #{vehicleTimingAccuracy},</if> + <if test="vehicleUploadTimeliness != null">vehicle_upload_timeliness = #{vehicleUploadTimeliness},</if> + <if test="vehicleUrlAvailability != null">vehicle_url_availability = #{vehicleUrlAvailability},</if> + <if test="vehiclePictureAvailability != null">vehicle_picture_availability = #{vehiclePictureAvailability},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteCheckIndexCarById"> + delete from t_check_index_car where id = #{id} + </delete> + + <delete id="deleteCheckIndexCarByIds"> + delete from t_check_index_car where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> \ No newline at end of file diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml new file mode 100644 index 0000000..37b36f7 --- /dev/null +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml @@ -0,0 +1,107 @@ +<?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.ycl.platform.mapper.CheckIndexFaceMapper"> + + <resultMap type="com.ycl.platform.domain.entity.CheckIndexFace" id="CheckIndexFaceResult"> + <result property="id" column="id" /> + <result property="deptId" column="dept_id" /> + <result property="examineTag" column="examine_tag" /> + <result property="createTime" column="create_time" /> + <result property="viewConnectStability" column="view_connect_stability" /> + <result property="siteOnline" column="site_online" /> + <result property="deviceDirectoryConsistent" column="device_directory_consistent" /> + <result property="faceInformationCollectionAccuracy" column="face_information_collection_accuracy" /> + <result property="facePictureQualification" column="face_picture_qualification" /> + <result property="faceTimingAccuracy" column="face_timing_accuracy" /> + <result property="faceUploadTimeliness" column="face_upload_timeliness" /> + <result property="facePictureAvailability" column="face_picture_availability" /> + </resultMap> + + <sql id="selectCheckIndexFaceVo"> + select id, dept_id, examine_tag, create_time, view_connect_stability, site_online, device_directory_consistent, face_information_collection_accuracy, face_picture_qualification, face_timing_accuracy, face_upload_timeliness, face_picture_availability from t_check_index_face + </sql> + + <select id="selectCheckIndexFaceList" resultMap="CheckIndexFaceResult"> + select tcif.*,sd.dept_name + from t_check_index_face tcif left join sys_dept sd on tcif.dept_id = sd.dept_id + <where> + <if test="deptId != null "> and dept_id = #{deptId}</if> + <if test="examineTag != null "> and examine_tag = #{examineTag}</if> + <if test="date != null "> and date_format(tcif.create_time,'%Y-%m') = #{date}</if> + <if test="viewConnectStability != null "> and view_connect_stability = #{viewConnectStability}</if> + <if test="siteOnline != null "> and site_online = #{siteOnline}</if> + <if test="deviceDirectoryConsistent != null "> and device_directory_consistent = #{deviceDirectoryConsistent}</if> + <if test="faceInformationCollectionAccuracy != null "> and face_information_collection_accuracy = #{faceInformationCollectionAccuracy}</if> + <if test="facePictureQualification != null "> and face_picture_qualification = #{facePictureQualification}</if> + <if test="faceTimingAccuracy != null "> and face_timing_accuracy = #{faceTimingAccuracy}</if> + <if test="faceUploadTimeliness != null "> and face_upload_timeliness = #{faceUploadTimeliness}</if> + <if test="facePictureAvailability != null "> and face_picture_availability = #{facePictureAvailability}</if> + </where> + </select> + + <select id="selectCheckIndexFaceById" resultMap="CheckIndexFaceResult"> + <include refid="selectCheckIndexFaceVo"/> + where id = #{id} + </select> + + <insert id="insertCheckIndexFace" useGeneratedKeys="true" keyProperty="id"> + insert into t_check_index_face + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="deptId != null">dept_id,</if> + <if test="examineTag != null">examine_tag,</if> + <if test="createTime != null">create_time,</if> + <if test="viewConnectStability != null">view_connect_stability,</if> + <if test="siteOnline != null">site_online,</if> + <if test="deviceDirectoryConsistent != null">device_directory_consistent,</if> + <if test="faceInformationCollectionAccuracy != null">face_information_collection_accuracy,</if> + <if test="facePictureQualification != null">face_picture_qualification,</if> + <if test="faceTimingAccuracy != null">face_timing_accuracy,</if> + <if test="faceUploadTimeliness != null">face_upload_timeliness,</if> + <if test="facePictureAvailability != null">face_picture_availability,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="deptId != null">#{deptId},</if> + <if test="examineTag != null">#{examineTag},</if> + <if test="createTime != null">#{createTime},</if> + <if test="viewConnectStability != null">#{viewConnectStability},</if> + <if test="siteOnline != null">#{siteOnline},</if> + <if test="deviceDirectoryConsistent != null">#{deviceDirectoryConsistent},</if> + <if test="faceInformationCollectionAccuracy != null">#{faceInformationCollectionAccuracy},</if> + <if test="facePictureQualification != null">#{facePictureQualification},</if> + <if test="faceTimingAccuracy != null">#{faceTimingAccuracy},</if> + <if test="faceUploadTimeliness != null">#{faceUploadTimeliness},</if> + <if test="facePictureAvailability != null">#{facePictureAvailability},</if> + </trim> + </insert> + + <update id="updateCheckIndexFace"> + update t_check_index_face + <trim prefix="SET" suffixOverrides=","> + <if test="deptId != null">dept_id = #{deptId},</if> + <if test="examineTag != null">examine_tag = #{examineTag},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="viewConnectStability != null">view_connect_stability = #{viewConnectStability},</if> + <if test="siteOnline != null">site_online = #{siteOnline},</if> + <if test="deviceDirectoryConsistent != null">device_directory_consistent = #{deviceDirectoryConsistent},</if> + <if test="faceInformationCollectionAccuracy != null">face_information_collection_accuracy = #{faceInformationCollectionAccuracy},</if> + <if test="facePictureQualification != null">face_picture_qualification = #{facePictureQualification},</if> + <if test="faceTimingAccuracy != null">face_timing_accuracy = #{faceTimingAccuracy},</if> + <if test="faceUploadTimeliness != null">face_upload_timeliness = #{faceUploadTimeliness},</if> + <if test="facePictureAvailability != null">face_picture_availability = #{facePictureAvailability},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteCheckIndexFaceById" > + delete from t_check_index_face where id = #{id} + </delete> + + <delete id="deleteCheckIndexFaceByIds" > + delete from t_check_index_face where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> \ No newline at end of file diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml new file mode 100644 index 0000000..9279f6a --- /dev/null +++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml @@ -0,0 +1,167 @@ +<?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.ycl.platform.mapper.CheckIndexVideoMapper"> + + <resultMap type="com.ycl.platform.domain.entity.CheckIndexVideo" id="CheckIndexVideoResult"> + <result property="id" column="id" /> + <result property="deptId" column="dept_id" /> + <result property="createTime" column="create_time" /> + <result property="examineTag" column="examine_tag" /> + <result property="platformOnline" column="platform_online" /> + <result property="monitorQualification" column="monitor_qualification" /> + <result property="monitorRegistration" column="monitor_registration" /> + <result property="archivesRate" column="archives_rate" /> + <result property="siteOnline" column="site_online" /> + <result property="videoAvailable" column="video_available" /> + <result property="annotationAccuracy" column="annotation_accuracy" /> + <result property="timingAccuracy" column="timing_accuracy" /> + <result property="keySiteOnline" column="key_site_online" /> + <result property="keyVideoAvailable" column="key_video_available" /> + <result property="keyAnnotationAccuracy" column="key_annotation_accuracy" /> + <result property="keyTimingAccuracy" column="key_timing_accuracy" /> + <result property="keyCommandImageInspection" column="key_command_image_inspection" /> + <result property="keyCommandImageDirectoryTree" column="key_command_image_directory_tree" /> + <result property="onlineInspectionPlatform" column="online_inspection_platform" /> + <result property="videoTransmissionAssetsAccuracy" column="video_transmission_assets_accuracy" /> + <result property="videoTransmissionAssetsWeakPasswordScore" column="video_transmission_assets_weak_password_score" /> + <result property="videoTransmissionDangerousAssetsScore" column="video_transmission_dangerous_assets_score" /> + <result property="videoTransmissionBoundaryIntegrityDetection" column="video_transmission_boundary_integrity_detection" /> + <result property="operatingRate" column="operating_rate" /> + </resultMap> + + <sql id="selectCheckIndexVideoVo"> + select id, dept_id, create_time, examine_tag, platform_online, monitor_qualification, monitor_registration, archives_rate, site_online, video_available, annotation_accuracy, timing_accuracy, key_site_online, key_video_available, key_annotation_accuracy, key_timing_accuracy, key_command_image_inspection, key_command_image_directory_tree, online_inspection_platform, video_transmission_assets_accuracy, video_transmission_assets_weak_password_score, video_transmission_dangerous_assets_score, video_transmission_boundary_integrity_detection, operating_rate from t_check_index_video + </sql> + + <select id="selectCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult"> + select tciv.*,sd.dept_name + from t_check_index_video tciv left join sys_dept sd on tciv.dept_id = sd.dept_id + <where> + <if test="deptId != null "> and dept_id = #{deptId}</if> + <if test="examineTag != null "> and examine_tag = #{examineTag}</if> + <if test="date != null "> and date_format(tciv.create_time,'%Y-%m') = #{date}</if> + <if test="platformOnline != null "> and platform_online = #{platformOnline}</if> + <if test="monitorQualification != null "> and monitor_qualification = #{monitorQualification}</if> + <if test="monitorRegistration != null "> and monitor_registration = #{monitorRegistration}</if> + <if test="archivesRate != null "> and archives_rate = #{archivesRate}</if> + <if test="siteOnline != null "> and site_online = #{siteOnline}</if> + <if test="videoAvailable != null "> and video_available = #{videoAvailable}</if> + <if test="annotationAccuracy != null "> and annotation_accuracy = #{annotationAccuracy}</if> + <if test="timingAccuracy != null "> and timing_accuracy = #{timingAccuracy}</if> + <if test="keySiteOnline != null "> and key_site_online = #{keySiteOnline}</if> + <if test="keyVideoAvailable != null "> and key_video_available = #{keyVideoAvailable}</if> + <if test="keyAnnotationAccuracy != null "> and key_annotation_accuracy = #{keyAnnotationAccuracy}</if> + <if test="keyTimingAccuracy != null "> and key_timing_accuracy = #{keyTimingAccuracy}</if> + <if test="keyCommandImageInspection != null "> and key_command_image_inspection = #{keyCommandImageInspection}</if> + <if test="keyCommandImageDirectoryTree != null "> and key_command_image_directory_tree = #{keyCommandImageDirectoryTree}</if> + <if test="onlineInspectionPlatform != null "> and online_inspection_platform = #{onlineInspectionPlatform}</if> + <if test="videoTransmissionAssetsAccuracy != null "> and video_transmission_assets_accuracy = #{videoTransmissionAssetsAccuracy}</if> + <if test="videoTransmissionAssetsWeakPasswordScore != null "> and video_transmission_assets_weak_password_score = #{videoTransmissionAssetsWeakPasswordScore}</if> + <if test="videoTransmissionDangerousAssetsScore != null "> and video_transmission_dangerous_assets_score = #{videoTransmissionDangerousAssetsScore}</if> + <if test="videoTransmissionBoundaryIntegrityDetection != null "> and video_transmission_boundary_integrity_detection = #{videoTransmissionBoundaryIntegrityDetection}</if> + <if test="operatingRate != null "> and operating_rate = #{operatingRate}</if> + </where> + </select> + + <select id="selectCheckIndexVideoById" resultMap="CheckIndexVideoResult"> + <include refid="selectCheckIndexVideoVo"/> + where id = #{id} + </select> + + <insert id="insertCheckIndexVideo" useGeneratedKeys="true" keyProperty="id"> + insert into t_check_index_video + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="deptId != null">dept_id,</if> + <if test="createTime != null">create_time,</if> + <if test="examineTag != null">examine_tag,</if> + <if test="platformOnline != null">platform_online,</if> + <if test="monitorQualification != null">monitor_qualification,</if> + <if test="monitorRegistration != null">monitor_registration,</if> + <if test="archivesRate != null">archives_rate,</if> + <if test="siteOnline != null">site_online,</if> + <if test="videoAvailable != null">video_available,</if> + <if test="annotationAccuracy != null">annotation_accuracy,</if> + <if test="timingAccuracy != null">timing_accuracy,</if> + <if test="keySiteOnline != null">key_site_online,</if> + <if test="keyVideoAvailable != null">key_video_available,</if> + <if test="keyAnnotationAccuracy != null">key_annotation_accuracy,</if> + <if test="keyTimingAccuracy != null">key_timing_accuracy,</if> + <if test="keyCommandImageInspection != null">key_command_image_inspection,</if> + <if test="keyCommandImageDirectoryTree != null">key_command_image_directory_tree,</if> + <if test="onlineInspectionPlatform != null">online_inspection_platform,</if> + <if test="videoTransmissionAssetsAccuracy != null">video_transmission_assets_accuracy,</if> + <if test="videoTransmissionAssetsWeakPasswordScore != null">video_transmission_assets_weak_password_score,</if> + <if test="videoTransmissionDangerousAssetsScore != null">video_transmission_dangerous_assets_score,</if> + <if test="videoTransmissionBoundaryIntegrityDetection != null">video_transmission_boundary_integrity_detection,</if> + <if test="operatingRate != null">operating_rate,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="deptId != null">#{deptId},</if> + <if test="createTime != null">#{createTime},</if> + <if test="examineTag != null">#{examineTag},</if> + <if test="platformOnline != null">#{platformOnline},</if> + <if test="monitorQualification != null">#{monitorQualification},</if> + <if test="monitorRegistration != null">#{monitorRegistration},</if> + <if test="archivesRate != null">#{archivesRate},</if> + <if test="siteOnline != null">#{siteOnline},</if> + <if test="videoAvailable != null">#{videoAvailable},</if> + <if test="annotationAccuracy != null">#{annotationAccuracy},</if> + <if test="timingAccuracy != null">#{timingAccuracy},</if> + <if test="keySiteOnline != null">#{keySiteOnline},</if> + <if test="keyVideoAvailable != null">#{keyVideoAvailable},</if> + <if test="keyAnnotationAccuracy != null">#{keyAnnotationAccuracy},</if> + <if test="keyTimingAccuracy != null">#{keyTimingAccuracy},</if> + <if test="keyCommandImageInspection != null">#{keyCommandImageInspection},</if> + <if test="keyCommandImageDirectoryTree != null">#{keyCommandImageDirectoryTree},</if> + <if test="onlineInspectionPlatform != null">#{onlineInspectionPlatform},</if> + <if test="videoTransmissionAssetsAccuracy != null">#{videoTransmissionAssetsAccuracy},</if> + <if test="videoTransmissionAssetsWeakPasswordScore != null">#{videoTransmissionAssetsWeakPasswordScore},</if> + <if test="videoTransmissionDangerousAssetsScore != null">#{videoTransmissionDangerousAssetsScore},</if> + <if test="videoTransmissionBoundaryIntegrityDetection != null">#{videoTransmissionBoundaryIntegrityDetection},</if> + <if test="operatingRate != null">#{operatingRate},</if> + </trim> + </insert> + + <update id="updateCheckIndexVideo" > + update t_check_index_video + <trim prefix="SET" suffixOverrides=","> + <if test="deptId != null">dept_id = #{deptId},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="examineTag != null">examine_tag = #{examineTag},</if> + <if test="platformOnline != null">platform_online = #{platformOnline},</if> + <if test="monitorQualification != null">monitor_qualification = #{monitorQualification},</if> + <if test="monitorRegistration != null">monitor_registration = #{monitorRegistration},</if> + <if test="archivesRate != null">archives_rate = #{archivesRate},</if> + <if test="siteOnline != null">site_online = #{siteOnline},</if> + <if test="videoAvailable != null">video_available = #{videoAvailable},</if> + <if test="annotationAccuracy != null">annotation_accuracy = #{annotationAccuracy},</if> + <if test="timingAccuracy != null">timing_accuracy = #{timingAccuracy},</if> + <if test="keySiteOnline != null">key_site_online = #{keySiteOnline},</if> + <if test="keyVideoAvailable != null">key_video_available = #{keyVideoAvailable},</if> + <if test="keyAnnotationAccuracy != null">key_annotation_accuracy = #{keyAnnotationAccuracy},</if> + <if test="keyTimingAccuracy != null">key_timing_accuracy = #{keyTimingAccuracy},</if> + <if test="keyCommandImageInspection != null">key_command_image_inspection = #{keyCommandImageInspection},</if> + <if test="keyCommandImageDirectoryTree != null">key_command_image_directory_tree = #{keyCommandImageDirectoryTree},</if> + <if test="onlineInspectionPlatform != null">online_inspection_platform = #{onlineInspectionPlatform},</if> + <if test="videoTransmissionAssetsAccuracy != null">video_transmission_assets_accuracy = #{videoTransmissionAssetsAccuracy},</if> + <if test="videoTransmissionAssetsWeakPasswordScore != null">video_transmission_assets_weak_password_score = #{videoTransmissionAssetsWeakPasswordScore},</if> + <if test="videoTransmissionDangerousAssetsScore != null">video_transmission_dangerous_assets_score = #{videoTransmissionDangerousAssetsScore},</if> + <if test="videoTransmissionBoundaryIntegrityDetection != null">video_transmission_boundary_integrity_detection = #{videoTransmissionBoundaryIntegrityDetection},</if> + <if test="operatingRate != null">operating_rate = #{operatingRate},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteCheckIndexVideoById" > + delete from t_check_index_video where id = #{id} + </delete> + + <delete id="deleteCheckIndexVideoByIds" > + delete from t_check_index_video where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> \ No newline at end of file -- Gitblit v1.8.0