fuliqi
2024-07-29 a8f5761841bcf481eb2f2a7c535dbac145d2a468
Merge remote-tracking branch 'origin/master'

# Conflicts:
# ycl-server/src/main/java/com/ycl/web/HKClient.java
17个文件已修改
6个文件已添加
844 ■■■■ 已修改文件
ycl-common/src/main/java/constant/PointConfigConstants.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/enumeration/ContractRule.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/enumeration/OvertimeStatus.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/YwPointJobVO.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/handler/CommentWriteHandler.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/ContractScoreServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/task/WorkOrderTask.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/utils/DateUtils.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/web/HKClient.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/web/UYClient.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/application-dev.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/application-prod.yml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/application.yml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/constant/PointConfigConstants.java
New file
@@ -0,0 +1,33 @@
package constant;
/**
 * @author:xp
 * @date:2024/7/25 14:27
 */
public class PointConfigConstants {
    /**
     * 普通点位配置的key
     *
     */
    public final static String NORMAL = "normal.workorder.time";
    /**
     * 普通点位告警配置的key
     *
     */
    public final static String NORMAL_ALARM = "normal.wordkorder.alarm.time";
    /**
     * 重点点位配置的key
     *
     */
    public final static String IMPORTANT = "important.wordkorder.time";
    /**
     * 重点点位告警配置的key
     *
     */
    public final static String IMPORTANT_ALARM = "important.wordkorder.alarm.time";
}
ycl-common/src/main/java/enumeration/ContractRule.java
New file
@@ -0,0 +1,59 @@
package enumeration;
import lombok.Getter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @author gonghl
 * @since 2024/7/25 上午 10:50
 */
@Getter
public enum ContractRule {
    CONTRACT_RULE_1("视频平均在线率", Arrays.asList("CONTRACT_RULE_2", "CONTRACT_RULE_3", "CONTRACT_RULE_4", "CONTRACT_RULE_5")),
    CONTRACT_RULE_2("≥98%", Collections.EMPTY_LIST),
    CONTRACT_RULE_3("95%≤视频平均在线率<98%", Collections.EMPTY_LIST),
    CONTRACT_RULE_4("90%≤视频平均在线率<95%", Collections.EMPTY_LIST),
    CONTRACT_RULE_5("<90%", Collections.EMPTY_LIST),
    CONTRACT_RULE_6("前端感知源治理工作", Arrays.asList("CONTRACT_RULE_7", "CONTRACT_RULE_8", "CONTRACT_RULE_9")),
    CONTRACT_RULE_7("时钟同步(超过±3秒为不合格)", Collections.EMPTY_LIST),
    CONTRACT_RULE_8("OSD标识", Collections.EMPTY_LIST),
    CONTRACT_RULE_9("一机一档", Collections.EMPTY_LIST),
    CONTRACT_RULE_10("存储故障", Arrays.asList("CONTRACT_RULE_11", "CONTRACT_RULE_12")),
    CONTRACT_RULE_11("因存储设备、云存储软件等引起平台不能正常查看历史图像,须在24小时排除故障", Collections.EMPTY_LIST),
    CONTRACT_RULE_12("因视频或者图片丢失导致重要案事件不能回放或查看", Collections.EMPTY_LIST),
    CONTRACT_RULE_13("对于前端点位异常情况的处理", List.of("CONTRACT_RULE_14")),
    CONTRACT_RULE_14("镜头故障或污染或树枝遮挡或枪机视角偏移正常角度或补光灯应亮未亮", Collections.EMPTY_LIST),
    CONTRACT_RULE_15("建立数据监测维护机制", List.of("CONTRACT_RULE_16")),
    CONTRACT_RULE_16("中标人应当建立数据监测维护机制,当发生数据异常情况时,应在 24 小时内恢复。(数据异常包括实时监控或录像视频拉流失败,图片获取失败、视觉计算解析异常等)。", Collections.EMPTY_LIST),
    CONTRACT_RULE_17("确保录像完整不定期对所有点位录像完整性抽查", Arrays.asList("CONTRACT_RULE_18", "CONTRACT_RULE_19", "CONTRACT_RULE_20", "CONTRACT_RULE_21", "CONTRACT_RULE_22")),
    CONTRACT_RULE_18("每路视频累计丢失10分钟以内", Collections.EMPTY_LIST),
    CONTRACT_RULE_19("丢失10-60 分钟", Collections.EMPTY_LIST),
    CONTRACT_RULE_20("丢失1 小时-4 小时(含)", Collections.EMPTY_LIST),
    CONTRACT_RULE_21("丢失4 小时-12 小时(含)", Collections.EMPTY_LIST),
    CONTRACT_RULE_22("丢失12 小时以上", Collections.EMPTY_LIST),
    CONTRACT_RULE_23("确保图片完整不定期对所有人脸车辆以及智能前端抓拍的图片完整性抽查", List.of("CONTRACT_RULE_24")),
    CONTRACT_RULE_24("发现后台存储不能调取前端设备图片", Collections.EMPTY_LIST),
    ;
    private final String name;
    private final List<String> children;
    ContractRule(String name, List<String> children) {
        this.name = name;
        this.children = children;
    }
    public static List<ContractRule> getParent() {
        return Arrays.stream(ContractRule.values()).filter(contractRule -> !contractRule.getChildren().isEmpty()).toList();
    }
    public static List<ContractRule> getChildren(ContractRule parent) {
        return parent.getChildren().stream().map(ContractRule::valueOf).collect(Collectors.toList());
    }
}
ycl-common/src/main/java/enumeration/OvertimeStatus.java
New file
@@ -0,0 +1,25 @@
package enumeration;
import lombok.Getter;
/**
 * @author:xp
 * @date:2024/7/25 16:54
 */
@Getter
public enum OvertimeStatus {
    NOT(0, "未超时"),
    ALARM(1, "警告"),
    YES(2, "超时"),
    ;
    private final Integer value;
    private final String desc;
    OvertimeStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }
}
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CalculateRule.java
@@ -7,8 +7,6 @@
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ycl.system.domain.TreeEntity;
import com.ycl.system.domain.TreeNode;
import enumeration.converter.RuleDeductCategoryConverter;
import enumeration.general.RuleDeductCategoryEnum;
import lombok.Data;
@@ -25,14 +23,12 @@
@ExcelIgnoreUnannotated
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
@TableName("t_calculate_rule")
public class CalculateRule extends TreeNode {
    private static final long serialVersionUID = 1L;
public class CalculateRule {
    /**
     * 主键
     * id
     */
    @ExcelProperty("序号")
    private Long id;
    private Integer id;
    /**
     * 合同id
@@ -46,23 +42,24 @@
    private String ruleName;
    /**
     * 关联上级id
     */
    private Long parentId;
    /**
     * 规则描述
     */
    @ExcelProperty("评判标准")
    private String ruleDesc;
    /**
     * 规则条件
     */
    @ExcelProperty("考核要求")
    private String ruleCondition;
    /**
     * 违规最小值
     */
    @ExcelProperty("违规最小值")
    private Double min;
    /**
     * 违规最大值
     */
    @ExcelProperty("违规最大值")
    private Double max;
    /**
     * 扣减方式 扣指定分数/分数乘以数量/除以数量后乘以分数
     */
    @ExcelProperty(value = "扣分方式", converter = RuleDeductCategoryConverter.class)
ycl-pojo/src/main/java/com/ycl/platform/domain/entity/WorkOrder.java
@@ -70,7 +70,7 @@
    @TableField("processing_period")
    private Integer processingPeriod;
    @ApiModelProperty("是否超时,0没有 1超时")
    @ApiModelProperty("是否超时,0没有 1警告 2超时")
    @TableField("overtime")
    private Integer overtime;
}
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/WorkOrderVO.java
@@ -5,6 +5,7 @@
import com.ycl.platform.domain.entity.WorkOrder;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import org.springframework.lang.NonNull;
import org.springframework.beans.BeanUtils;
@@ -41,6 +42,13 @@
     */
    private Integer pointId;
    private String pointTag;
    /**
     * 是否重点点位
     */
    private Boolean important;
    /** 故障类型 */
    private String errorType;
@@ -64,6 +72,13 @@
    /** 0未超时 1超时 */
    private Integer overtime;
    /** 下发时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date distributeTime;
    /** 下发人 */
    private String realName;
    public static WorkOrderVO getVoByEntity(@NonNull WorkOrder entity, WorkOrderVO vo) {
        if(vo == null) {
            vo = new WorkOrderVO();
ycl-pojo/src/main/java/com/ycl/platform/domain/vo/YwPointJobVO.java
New file
@@ -0,0 +1,40 @@
package com.ycl.platform.domain.vo;
import com.ycl.platform.base.AbsVo;
import com.ycl.platform.domain.entity.YwPoint;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import org.springframework.lang.NonNull;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
/**
 * 定时任务处理工单时效
 *
 * @author xp
 * @since 2024-03-05
 */
@Data
public class YwPointJobVO {
    private Integer id;
    /** 点位名称 */
    private Date createTime;
    /** 点位标签 */
    private String [] pointTags;
    private String pointTagString;
    public static YwPointJobVO getVoByEntity(@NonNull YwPoint entity, YwPointJobVO vo) {
        if(vo == null) {
            vo = new YwPointJobVO();
        }
        BeanUtils.copyProperties(entity, vo);
        return vo;
    }
}
ycl-server/src/main/java/com/ycl/handler/CommentWriteHandler.java
@@ -24,11 +24,11 @@
            Sheet sheet = context.getWriteSheetHolder().getSheet();
            Drawing<?> drawingPatriarch = sheet.createDrawingPatriarch();
            Comment comment1 = drawingPatriarch.createCellComment(new XSSFClientAnchor(0, 0, 0, 0,  5, 4,  4, 5));
            Comment comment1 = drawingPatriarch.createCellComment(new XSSFClientAnchor(0, 0, 0, 0,  5, 5,  4, 6));
            comment1.setString(new XSSFRichTextString("扣除相关镜头数量*0.1分"));
            sheet.getRow(0).getCell(1).setCellComment(comment1);
            Comment comment2 = drawingPatriarch.createCellComment(new XSSFClientAnchor(0, 0, 0, 0, 5, 7,  7, 8));
            Comment comment2 = drawingPatriarch.createCellComment(new XSSFClientAnchor(0, 0, 0, 0, 5, 8,  7, 9));
            comment2.setString(new XSSFRichTextString("扣2分/12小时"));
            sheet.getRow(0).getCell(1).setCellComment(comment2);
        }
ycl-server/src/main/java/com/ycl/handler/CustomCellWriteHandler.java
New file
@@ -0,0 +1,258 @@
package com.ycl.handler;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.util.BooleanUtils;
import com.alibaba.excel.write.handler.CellWriteHandler;
import com.alibaba.excel.write.handler.context.CellWriteHandlerContext;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.ycl.platform.domain.entity.CalculateRule;
import enumeration.ContractRule;
import enumeration.general.RuleDeductCategoryEnum;
import lombok.Data;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class CustomCellWriteHandler implements CellWriteHandler {
    /**
     * 这个处理器其实可以做很多事情
     * 他能拿到整个 Excel 的 WorkHook
     * 也能拿到当前的 sheet
     * 也能拿到当前的 cell
     * 所以能做的自定义操作很丰富
     */
    // static class CustomCellWriteHandler {
        @Override
        public void afterCellDispose(CellWriteHandlerContext context) {
            // 当前的 cell
            Cell cell = context.getCell();
            // 这里可以对cell进行任何操作
            // 这里就要考虑 你要针对哪一列进行个性化处理  一定要记得加判断  因为每个 cell 都会执行到这里 所以要记得区分
            if (BooleanUtils.isTrue(context.getHead()) && cell.getColumnIndex() == 1) {
                // 1 表示 省那一列 要对省市区进行联动下拉处理
                ExcelAreaUtil.writeAreaInfo(context, 0);
            }
        }
    // }
    public static class ExcelAreaUtil {
        @Data
        static class AreaInfo {
            private String name;
            private List<String> areaList;
            public AreaInfo(String name, List<String> areaList) {
                this.name = name;
                this.areaList = areaList;
            }
        }
        /**
         * @param context    handler 的 上下文
         * @param startIndex 省的列号  从0开始的
         */
        public static void writeAreaInfo(CellWriteHandlerContext context, int startIndex) {
            // 获取到当前的 sheet 后续要给省市区列加下拉
            WriteSheetHolder writeSheetHolder = context.getWriteSheetHolder();
            Sheet sheet = writeSheetHolder.getSheet();
            // 省市区挨着的列号
            int cIndex = startIndex + 1;
            int aIndex = cIndex + 1;
            // 准备点数据
            List<AreaInfo> provinceList = new ArrayList<>();
            for (ContractRule contractRule : ContractRule.getParent()) {
                provinceList.add(new AreaInfo(contractRule.getName(), ContractRule.getChildren(contractRule).stream().map(ContractRule::getName).toList()));
            }
            // 获取到当前的 excel 因为要创建隐藏的 sheet 也就是省市区的实际内容都来自于隐藏的 sheet
            Workbook workbook = context.getWriteSheetHolder().getParentWriteWorkbookHolder().getWorkbook();
            Sheet hideSheet = workbook.createSheet("area");
            workbook.setSheetHidden(workbook.getSheetIndex(hideSheet), true);
            // 写隐藏 sheet 的省市区信息
            int rowId = 0;
            // 设置第一行,存省的信息
            Row provinceRow = hideSheet.createRow(rowId++);
            provinceRow.createCell(0).setCellValue("省列表");
            for (int i = 0; i < provinceList.size(); i++) {
                Cell provinceCell = provinceRow.createCell(i + 1);
                provinceCell.setCellValue(provinceList.get(i).getName());
            }
            for (AreaInfo pro : provinceList) {
                String pName = pro.getName();
                List<String> cList = pro.getAreaList();
                Row cRow = hideSheet.createRow(rowId++);
                cRow.createCell(0).setCellValue(pName);
                for (int j = 0; j < cList.size(); j++) {
                    String cInfo = cList.get(j);
                    Cell cCell = cRow.createCell(j + 1);
                    cCell.setCellValue(cInfo);
                }
                // 添加名称管理器
                String range = getRange(1, rowId, cList.size());
                Name name = workbook.createName();
                // key不可重复
                name.setNameName(pName);
                String formula = "area!" + range;
                name.setRefersToFormula(formula);
            }
            // 给省添加下拉
            int lastRow = 100;
            setDataValidation(sheet, 1, lastRow, startIndex, startIndex);
            // 给市 区 添加下拉
            // 设置第二列和第三列的有效性
            for (int i = 2; i < lastRow; i++) {
                setDataValidation(CellReference.convertNumToColString(startIndex), sheet, i - 1, i - 1, cIndex, cIndex);
                setDataValidation(CellReference.convertNumToColString(cIndex), sheet, i - 1, i - 1, aIndex, aIndex);
            }
        }
        public static void setDataValidation(Sheet sheetPro, int firstRow, int lastRow, int firstCol, int lastCol) {
            DataValidationHelper dvHelper = sheetPro.getDataValidationHelper();
            String formula = getFormula(1, 1, 1, 34);
            // 省规则
            DataValidationConstraint provConstraint = dvHelper.createFormulaListConstraint(formula);
            // 四个参数分别是:起始行、终止行、起始列、终止列
            CellRangeAddressList provRangeAddressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
            DataValidation provinceDataValidation = dvHelper.createValidation(provConstraint, provRangeAddressList);
            // 验证
            provinceDataValidation.createErrorBox("error", "请选择正确的省份");
            provinceDataValidation.setShowErrorBox(true);
            provinceDataValidation.setSuppressDropDownArrow(true);
            sheetPro.addValidationData(provinceDataValidation);
        }
        public static void setDataValidation(String offset, Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) {
            DataValidationHelper dvHelper = sheet.getDataValidationHelper();
            String formulaString = String.format("INDIRECT($%s%s)", offset, firstRow + 1);
            DataValidation dataValidation = getDataValidationByFormula(formulaString, dvHelper, firstRow, lastRow, firstCol, lastCol);
            sheet.addValidationData(dataValidation);
        }
        private static DataValidation getDataValidationByFormula(String formulaString, DataValidationHelper dvHelper,
                                                                 int firstRow, int lastRow, int firstCol, int lastCol) {
            // 加载下拉列表内容
            // 举例:若formulaString = "INDIRECT($A$2)" 表示规则数据会从名称管理器中获取key与单元格 A2 值相同的数据,
            // 如果A2是江苏省,那么此处就是江苏省下的市信息。
            DataValidationConstraint dvConstraint = dvHelper.createFormulaListConstraint(formulaString);
            // 设置数据有效性加载在哪个单元格上。
            // 四个参数分别是:起始行、终止行、起始列、终止列
            CellRangeAddressList regions = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
            // 绑定 数据有效性对象
            XSSFDataValidation dataValidation = (XSSFDataValidation) dvHelper.createValidation(dvConstraint, regions);
            dataValidation.setEmptyCellAllowed(true);
            dataValidation.setSuppressDropDownArrow(true);
            dataValidation.setShowErrorBox(true);
            // 设置输入错误提示信息
            dataValidation.createErrorBox("选择错误提示", "你输入的值未在备选列表中,请下拉选择合适的值!");
            return dataValidation;
        }
        private static String getFormula(int firstRow, int lastRow, int firstCol, int lastCol) {
            String ss = String.format("$%s$%s:$%s$%s", CellReference.convertNumToColString(firstCol), firstRow,
                    CellReference.convertNumToColString(lastCol), lastRow);
            return String.format("=%s!%s", "area", ss);
        }
        private static String getRange(int offset, int rowId, int colCount) {
            String columnLetter1 = CellReference.convertNumToColString(offset);
            String columnLetter2 = CellReference.convertNumToColString(offset + colCount - 1);
            return String.format("$%s$%s:$%s$%s", columnLetter1, rowId, columnLetter2, rowId);
        }
    }
    public static void main(String[] args) {
        EasyExcel.write("test.xlsx", CalculateRule.class)
                // 自适应列宽
                .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
                // 下拉框
                .registerWriteHandler(new CustomSheetWriteHandler(Arrays.asList("扣指定分数", "分数乘以数量", "除以数量后乘以分数")))
                .registerWriteHandler(new CustomCellWriteHandler())
                // 标注
                .registerWriteHandler(new CommentWriteHandler())
                .sheet("合同导入模板")
                .doWrite(getExcelData());
    }
    private static List<CalculateRule> getExcelData() {
        ArrayList<CalculateRule> list = new ArrayList<>();
        CalculateRule calculateRule1 = new CalculateRule();
        calculateRule1.setId(1);
        calculateRule1.setRuleName("视频平均在线率");
        calculateRule1.setRuleCondition("≥98%");
        calculateRule1.setMax(98D);
        calculateRule1.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule1.setCalcFraction(0.00);
        list.add(calculateRule1);
        CalculateRule calculateRule2 = new CalculateRule();
        calculateRule2.setRuleName("视频平均在线率");
        calculateRule2.setRuleCondition("95%≤视频平均在线率<98%");
        calculateRule2.setMax(97D);
        calculateRule2.setMin(95D);
        calculateRule2.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule2.setCalcFraction(5.00);
        list.add(calculateRule2);
        CalculateRule calculateRule3 = new CalculateRule();
        calculateRule3.setRuleName("视频平均在线率");
        calculateRule3.setRuleCondition("90%≤视频平均在线率<95%");
        calculateRule3.setMax(94D);
        calculateRule3.setMin(90D);
        calculateRule3.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule3.setCalcFraction(10.00);
        list.add(calculateRule3);
        CalculateRule calculateRule33 = new CalculateRule();
        calculateRule33.setRuleName("视频平均在线率");
        calculateRule33.setRuleCondition("<90%");
        calculateRule33.setMin(89D);
        calculateRule33.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule33.setCalcFraction(10.00);
        list.add(calculateRule33);
        CalculateRule calculateRule4 = new CalculateRule();
        calculateRule4.setId(2);
        calculateRule4.setRuleName("前端感知源治理工作");
        calculateRule4.setRuleCondition("时钟同步(超过±3秒为不合格)");
        calculateRule4.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
        calculateRule4.setCalcFraction(0.1);
        list.add(calculateRule4);
        CalculateRule calculateRule7 = new CalculateRule();
        calculateRule7.setRuleName("前端感知源治理工作");
        calculateRule7.setRuleCondition("OSD标识");
        list.add(calculateRule7);
        CalculateRule calculateRule6 = new CalculateRule();
        calculateRule6.setRuleName("前端感知源治理工作");
        calculateRule6.setRuleCondition("一机一档");
        list.add(calculateRule6);
        CalculateRule calculateRule5 = new CalculateRule();
        calculateRule5.setId(3);
        calculateRule5.setRuleName("后台系统的保障");
        calculateRule5.setRuleCondition("单次故障时长若超出72小时不足144小时的,每超出12小时(不足12小时按12小时计)");
        calculateRule5.setMax(144D);
        calculateRule5.setMin(72D);
        calculateRule5.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_AFTER_DIVIDING_QUANTITY);
        calculateRule5.setCalcFraction(2.00);
        calculateRule5.setCalcUnit(12);
        list.add(calculateRule5);
        return list;
    }
}
ycl-server/src/main/java/com/ycl/platform/mapper/WorkOrderMapper.java
@@ -10,6 +10,7 @@
import java.util.List;
import com.ycl.platform.domain.vo.WorkOrderYwConditionRecordVO;
import com.ycl.platform.domain.vo.YwPointJobVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -26,4 +27,10 @@
    IPage<WorkOrderVO> distributePage(IPage page, @Param("query") DistributeWorkOrderQuery query);
    /**
     * 处理中的工单
     *
     * @return
     */
    List<YwPointJobVO> handlingWorkOrderList();
}
ycl-server/src/main/java/com/ycl/platform/service/ICalculateRuleService.java
@@ -2,9 +2,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.platform.domain.entity.CalculateRule;
import com.ycl.platform.domain.entity.TContract;
import com.ycl.platform.domain.vo.CalculateRuleCascaderVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -62,13 +60,6 @@
     * @return 结果
     */
    public int deleteDefaultRuleById(Long id);
    /**
     * 读取Excel数据
     *
     * @param file      文件
     */
    List<CalculateRule> readExcel(MultipartFile file);
    /**
     * 根据合同id查询规则
ycl-server/src/main/java/com/ycl/platform/service/impl/CalculateRuleServiceImpl.java
@@ -1,12 +1,8 @@
package com.ycl.platform.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.platform.domain.entity.CalculateRule;
import com.ycl.platform.domain.entity.TContract;
import com.ycl.platform.domain.vo.CalculateRuleCascaderVO;
import com.ycl.platform.mapper.CalculateRuleMapper;
import com.ycl.platform.mapper.TContractMapper;
@@ -14,11 +10,8 @@
import com.ycl.system.domain.TreeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import utils.DateUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
@@ -102,44 +95,11 @@
        return calculateRuleMapper.deleteDefaultRuleById(id);
    }
    /**
     * 获取合同Excel规则
     *
     * @param file 合同Excel文件
     * @return 规则
     */
    @Override
    public List<CalculateRule> readExcel(MultipartFile file) {
        List<CalculateRule> calculateRuleList = new ArrayList<>();
        try {
            EasyExcel.read(file.getInputStream(), CalculateRule.class, new ReadListener<CalculateRule>() {
                        @Override
                        public void invoke(CalculateRule calculateRule, AnalysisContext analysisContext) {
                            calculateRule.setId(null);
                            calculateRuleList.add(calculateRule);
                        }
                        @Override
                        public void doAfterAllAnalysed(AnalysisContext analysisContext) {
                        }
                    })
                    .head(CalculateRule.class)
                    .sheet()
                    .doRead();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        return calculateRuleList;
    }
    @Override
    public List<CalculateRule> getRuleListByContractId(Integer contractId) {
        List<CalculateRule> list = new LambdaQueryChainWrapper<>(calculateRuleMapper)
        return new LambdaQueryChainWrapper<>(calculateRuleMapper)
                .eq(CalculateRule::getContractId, contractId)
                .list();
        return TreeUtils.build(list, 0L);
    }
    @Override
ycl-server/src/main/java/com/ycl/platform/service/impl/ContractScoreServiceImpl.java
@@ -10,10 +10,8 @@
import com.ycl.platform.mapper.YwUnitMapper;
import com.ycl.platform.service.IContractScoreService;
import com.ycl.system.entity.SysUser;
import com.ycl.utils.DateUtils;
import com.ycl.utils.SecurityUtils;
import enumeration.general.AuditingStatus;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -66,7 +64,7 @@
        contractScore.setRuleIds(Arrays.stream(contractScore.getRuleIdsArray()).map(String::valueOf).collect(Collectors.joining(",")));
        contractScore.setRuleIdsArray(Arrays.stream(contractScore.getRuleIds().split(",")).map(Long::parseLong).toArray(Long[]::new));
        List<CalculateRule> list = new LambdaQueryChainWrapper<>(calculateRuleMapper).in(CalculateRule::getId, contractScore.getRuleIdsArray()).list();
        contractScore.setRuleName(String.join(" / ", new String[]{list.get(0).getRuleName(), list.get(1).getRuleDesc(), list.get(2).getRuleCondition()}));
        contractScore.setRuleName(String.join(" / ", new String[]{list.get(0).getRuleName(), list.get(2).getRuleCondition()}));
        return super.save(contractScore);
    }
ycl-server/src/main/java/com/ycl/platform/service/impl/TContractServiceImpl.java
@@ -1,13 +1,14 @@
package com.ycl.platform.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.merge.LoopMergeStrategy;
import com.alibaba.excel.read.listener.PageReadListener;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ycl.handler.CommentWriteHandler;
import com.ycl.handler.CustomCellWriteHandler;
import com.ycl.handler.CustomSheetWriteHandler;
import com.ycl.platform.domain.entity.CalculateMoneyRule;
import com.ycl.platform.domain.entity.CalculateRule;
@@ -26,6 +27,7 @@
import enumeration.general.RuleDeductCategoryEnum;
import jakarta.servlet.http.HttpServletResponse;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -35,6 +37,7 @@
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@@ -51,33 +54,24 @@
    private final ICalculateRuleService calculateRuleService;
    private final CalculateMoneyRuleServiceImpl calculateMoneyRuleService;
    private final YwUnitServiceImpl ywUnitService;
    @Override
    public void importTemplate(HttpServletResponse response) {
        try {
            List<CalculateRule> list = getExcelData();
            ArrayList<String> arrayList = new ArrayList<>();
            arrayList.add("扣指定分数");
            arrayList.add("分数乘以数量");
            arrayList.add("除以数量后乘以分数");
            response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
            response.setCharacterEncoding("utf-8");
            String fileName = URLEncoder.encode("导入合同模板", StandardCharsets.UTF_8).replace("\\+", "%20");
            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
            // 第一列、第二列上下合并3行
            LoopMergeStrategy loopMergeStrategy1 = new LoopMergeStrategy(3, 0);
            LoopMergeStrategy loopMergeStrategy2 = new LoopMergeStrategy(3, 1);
            EasyExcel.write(response.getOutputStream(), CalculateRule.class)
                    .registerWriteHandler(loopMergeStrategy1)
                    .registerWriteHandler(loopMergeStrategy2)
                    // 自适应列宽
                    .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
                    // 下拉框
                    .registerWriteHandler(new CustomSheetWriteHandler(arrayList))
                    .registerWriteHandler(new CustomSheetWriteHandler(Arrays.asList("扣指定分数", "分数乘以数量", "除以数量后乘以分数")))
                    .registerWriteHandler(new CustomCellWriteHandler())
                    // 标注
                    .registerWriteHandler(new CommentWriteHandler())
                    .sheet("合同导入模板").doWrite(list);
                    .sheet("合同导入模板")
                    .doWrite(getExcelData());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
@@ -86,46 +80,61 @@
    private List<CalculateRule> getExcelData() {
        ArrayList<CalculateRule> list = new ArrayList<>();
        CalculateRule calculateRule1 = new CalculateRule();
        calculateRule1.setId(1L);
        calculateRule1.setId(1);
        calculateRule1.setRuleName("视频平均在线率");
        calculateRule1.setRuleDesc("(1)视频在线率=视频在线数量÷前端服务配置数(应扣除不可抗力或与中标人服务无关造成的掉线除外。)");
        calculateRule1.setRuleCondition("≥98%");
        calculateRule1.setMax(98D);
        calculateRule1.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule1.setCalcFraction(0.00);
        list.add(calculateRule1);
        CalculateRule calculateRule2 = new CalculateRule();
        calculateRule2.setRuleDesc("(2)视频平均在线率:当月每日视频在线率的平均值。");
        calculateRule2.setRuleName("视频平均在线率");
        calculateRule2.setRuleCondition("95%≤视频平均在线率<98%");
        calculateRule2.setMax(97D);
        calculateRule2.setMin(95D);
        calculateRule2.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule2.setCalcFraction(5.00);
        list.add(calculateRule2);
        CalculateRule calculateRule3 = new CalculateRule();
        calculateRule3.setRuleDesc("(3)视频在线率保留整数并且向下取整。");
        calculateRule3.setRuleName("视频平均在线率");
        calculateRule3.setRuleCondition("90%≤视频平均在线率<95%");
        calculateRule3.setMax(94D);
        calculateRule3.setMin(90D);
        calculateRule3.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule3.setCalcFraction(10.00);
        list.add(calculateRule3);
        CalculateRule calculateRule33 = new CalculateRule();
        calculateRule33.setRuleName("视频平均在线率");
        calculateRule33.setRuleCondition("<90%");
        calculateRule33.setMin(89D);
        calculateRule33.setDeductCategory(RuleDeductCategoryEnum.DEDUCT_POINTS);
        calculateRule33.setCalcFraction(10.00);
        list.add(calculateRule33);
        CalculateRule calculateRule4 = new CalculateRule();
        calculateRule4.setId(2L);
        calculateRule4.setId(2);
        calculateRule4.setRuleName("前端感知源治理工作");
        calculateRule4.setRuleDesc("时钟同步(超过±3秒为不合格)");
        calculateRule4.setRuleCondition("视频监控摄像机时钟不同步,24小时内未修复的");
        calculateRule4.setRuleCondition("时钟同步(超过±3秒为不合格)");
        calculateRule4.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
        calculateRule4.setCalcFraction(0.1);
        list.add(calculateRule4);
        CalculateRule calculateRule7 = new CalculateRule();
        calculateRule7.setRuleDesc("…………");
        calculateRule7.setRuleCondition("…………");
        calculateRule7.setRuleName("前端感知源治理工作");
        calculateRule7.setRuleCondition("OSD标识");
        calculateRule7.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
        calculateRule7.setCalcFraction(0.1);
        list.add(calculateRule7);
        CalculateRule calculateRule6 = new CalculateRule();
        calculateRule6.setRuleDesc("…………");
        calculateRule6.setRuleCondition("…………");
        calculateRule6.setRuleName("前端感知源治理工作");
        calculateRule6.setRuleCondition("一机一档");
        calculateRule6.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_BY_QUANTITY);
        calculateRule6.setCalcFraction(0.1);
        list.add(calculateRule6);
        CalculateRule calculateRule5 = new CalculateRule();
        calculateRule5.setId(3L);
        calculateRule5.setId(3);
        calculateRule5.setRuleName("后台系统的保障");
        calculateRule5.setRuleDesc("在个别设备故障但不影响该功能模块整体应用情况下,须在72小时以内排除故障。");
        calculateRule5.setRuleCondition("单次故障时长若超出144小时以后,每超出12小时(不足12小时按12小时计)");
        calculateRule5.setRuleCondition("单次故障时长若超出72小时不足144小时的,每超出12小时(不足12小时按12小时计)");
        calculateRule5.setMax(144D);
        calculateRule5.setMin(72D);
        calculateRule5.setDeductCategory(RuleDeductCategoryEnum.MULTIPLY_POINTS_AFTER_DIVIDING_QUANTITY);
        calculateRule5.setCalcFraction(2.00);
        calculateRule5.setCalcUnit(12);
@@ -135,17 +144,18 @@
    @Override
    @Transactional
    @SneakyThrows
    public AjaxResult importData(MultipartFile file, TContract tContract) {
        // 保存合同
        tContract.setCreateTime(DateUtils.getNowDate());
        save(tContract);
        List<CalculateRule> list = calculateRuleService.readExcel(file);
        // 获取合同Excel规则
        List<CalculateRule> list = new ArrayList<>();
        EasyExcel.read(file.getInputStream(), CalculateRule.class, new PageReadListener<CalculateRule>(list::addAll)).sheet().doRead();
        // 遍历父子关系
        List<CalculateRule> calculateRulesToSave = new ArrayList<>();
        CalculateRule fu1 = new CalculateRule();
        CalculateRule fu2 = new CalculateRule();
        boolean fuNew = true;
        for (CalculateRule calculateRule : list) {
            // 判断数据完整性
            if (ObjectUtils.isEmpty(calculateRule.getDeductCategory())) {
@@ -160,35 +170,13 @@
                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                return AjaxResult.warn("请填写" + calculateRule.getRuleName() + calculateRule.getRuleCondition() + "扣分数值");
            }
            // 保存父规则获取父id
            // 保存规则
            if (StringUtils.isNotBlank(calculateRule.getRuleName())) {
                CalculateRule one = new CalculateRule();
                one.setParentId(0L);
                one.setContractId(tContract.getId().intValue());
                one.setRuleName(calculateRule.getRuleName());
                one.setCreateTime(DateUtils.getNowDate());
                one.setDeleted(0);
                calculateRuleService.save(one);
                fu1 = one;
                fuNew = true;
                calculateRule.setContractId(tContract.getId().intValue());
                calculateRule.setCreateTime(DateUtils.getNowDate());
                calculateRule.setUpdateTime(DateUtils.getNowDate());
                calculateRulesToSave.add(calculateRule);
            }
            // 保存第二层父规则获取第二层父id
            if (StringUtils.isNotBlank(calculateRule.getRuleDesc())) {
                CalculateRule two = new CalculateRule();
                two.setContractId(tContract.getId().intValue());
                two.setParentId(fu1.getId());
                two.setRuleDesc(calculateRule.getRuleDesc());
                two.setCreateTime(DateUtils.getNowDate());
                two.setDeleted(0);
                calculateRuleService.save(two);
                fu2 = two;
                fuNew = false;
            }
            calculateRule.setContractId(tContract.getId().intValue());
            calculateRule.setCreateTime(DateUtils.getNowDate());
            calculateRule.setDeleted(0);
            calculateRule.setParentId(fuNew ? fu1.getId() : fu2.getId());
            calculateRulesToSave.add(calculateRule);
        }
        // 批量保存规则
        calculateRuleService.saveBatch(calculateRulesToSave);
ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
@@ -24,6 +24,7 @@
import com.ycl.utils.SecurityUtils;
import com.ycl.utils.redis.RedisCache;
import com.ycl.utils.uuid.IdUtils;
import constant.PointConfigConstants;
import enumeration.general.*;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ArrayUtils;
@@ -63,6 +64,7 @@
    private final WorkOrderDistributeRecordMapper workOrderDistributeRecordMapper;
    private final String DISTRIBUTE_LOCK_KEY = "distributeLock";
    private final static String IMPORTANT = "important";
    @Autowired
    private RedisCache redisCache;
@@ -257,8 +259,12 @@
    @Override
    public Result distributePage(DistributeWorkOrderQuery query) {
        IPage<WorkOrderVO> page = PageUtil.getPage(query, WorkOrderVO.class);
        // todo 关键词搜索
        baseMapper.distributePage(page, query);
        page.getRecords().stream().forEach(workOrder -> {
            if (StringUtils.hasText(workOrder.getPointTag()) && workOrder.getPointTag().contains(IMPORTANT)) {
                workOrder.setImportant(Boolean.TRUE);
            }
        });
        return Result.ok().data(page).total(page.getTotal());
    }
ycl-server/src/main/java/com/ycl/task/WorkOrderTask.java
New file
@@ -0,0 +1,77 @@
package com.ycl.task;
import com.ycl.platform.domain.entity.WorkOrder;
import com.ycl.platform.domain.vo.YwPointJobVO;
import com.ycl.platform.mapper.WorkOrderMapper;
import com.ycl.system.domain.SysConfig;
import com.ycl.system.mapper.SysConfigMapper;
import com.ycl.utils.DateUtils;
import constant.PointConfigConstants;
import enumeration.OvertimeStatus;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.Date;
import java.util.List;
/**
 * @author:xp
 * @date:2024/7/25 13:36
 */
@Slf4j
@RequiredArgsConstructor
@Component("workOrderTask")
public class WorkOrderTask {
    private final WorkOrderMapper workOrderMapper;
    private final SysConfigMapper configMapper;
    private final static String IMPORTANT = "important";
    private final static String NORMAL = "normal";
    /**
     * 处理工单有效时间,超时状态
     *
     */
    public void handleTime() {
        List<YwPointJobVO> handlingWorkOrderList = workOrderMapper.handlingWorkOrderList();
        SysConfig config = new SysConfig();
        config.setConfigKey(PointConfigConstants.IMPORTANT);
        Integer importantTime = Integer.valueOf(configMapper.selectConfig(config).getConfigValue());
        config.setConfigKey(PointConfigConstants.NORMAL);
        Integer normalTime = Integer.valueOf(configMapper.selectConfig(config).getConfigValue());
        config.setConfigKey(PointConfigConstants.NORMAL_ALARM);
        Integer normalAlarmTime = Integer.valueOf(configMapper.selectConfig(config).getConfigValue());
        config.setConfigKey(PointConfigConstants.IMPORTANT_ALARM);
        Integer importantAlarmTime = Integer.valueOf(configMapper.selectConfig(config).getConfigValue());
        Date now = new Date();
        handlingWorkOrderList.stream().forEach(workOrder -> {
            int diffHours = DateUtils.differentHoursByMillisecond(now, workOrder.getCreateTime());
            if (StringUtils.hasText(workOrder.getPointTagString()) && workOrder.getPointTagString().contains(IMPORTANT)) {
                this.handleOverTime(workOrder.getId(), diffHours, importantTime, importantAlarmTime);
            } else {
                this.handleOverTime(workOrder.getId(), diffHours, normalTime, normalAlarmTime);
            }
        });
        log.info("工单超时状态任务执行完成");
    }
    private void handleOverTime(Integer id, Integer diffHours, Integer time, Integer alarmTime) {
        if (diffHours <= time) {
            if (time - diffHours < alarmTime) {
                WorkOrder wo = new WorkOrder();
                wo.setId(id);
                wo.setOvertime(OvertimeStatus.ALARM.getValue());
                workOrderMapper.updateById(wo);
            }
        } else {
            WorkOrder wo = new WorkOrder();
            wo.setId(id);
            wo.setOvertime(OvertimeStatus.YES.getValue());
            workOrderMapper.updateById(wo);
        }
    }
}
ycl-server/src/main/java/com/ycl/utils/DateUtils.java
@@ -145,6 +145,14 @@
    }
    /**
     * 计算相差小时
     */
    public static int differentHoursByMillisecond(Date date1, Date date2)
    {
        return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600)));
    }
    /**
     * 计算时间差
     *
     * @param endDate 最后时间
ycl-server/src/main/java/com/ycl/web/HKClient.java
@@ -7,6 +7,7 @@
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
 * @author gonghl
@@ -29,7 +30,7 @@
     * @return 按区域统计经纬度异常设备或卡口
     */
    @PostMapping("/dqd/service/rs/v1/device/coordinateExpInfo/query")
    JSONObject coordinateByArea(CoordinateByAreaParam param);
    JSONObject coordinateByArea(@RequestBody CoordinateByAreaParam param);
    /**
     * 按区域统计编码异常设备或卡口
@@ -43,7 +44,7 @@
     * @return 按区域统计编码异常设备或卡口
     */
    @PostMapping("/dqd/service/rs/v1/device/gbCodeExpInfo/query")
    JSONObject codeByArea(CodeByAreaParam param);
    JSONObject codeByArea(@RequestBody CodeByAreaParam param);
    /**
     * 按区域统计人脸数据监测指标项
@@ -64,7 +65,7 @@
     * @return 按区域统计人脸数据监测指标项
     */
    @PostMapping("/dqd/service/rs/v2/data/faceDetect/query")
    JSONObject faceDetectByArea(FaceDetectParam param);
    JSONObject faceDetectByArea(@RequestBody FaceDetectParam param);
    /**
     * 按区域统计车辆数据监测指标项
@@ -86,7 +87,7 @@
     * @return 按区域统计车辆数据监测指标项
     */
    @PostMapping("/dqd/service/rs/v2/data/passDetect/query")
    JSONObject carDetectByArea(CarDetectParam param);
    JSONObject carDetectByArea(@RequestBody CarDetectParam param);
    /**
     * 采集设备属性监测结果
@@ -96,7 +97,7 @@
     * @return 采集设备属性监测结果
     */
    @PostMapping("/dqd/service/rs/v1/device/cameraExpDetailInfo/query")
    JSONObject monitorDetail(MonitoringDetailParam param);
    JSONObject monitorDetail(@RequestBody MonitoringDetailParam param);
    /**
     * 卡口属性监测结果
@@ -106,7 +107,7 @@
     * @return 卡口属性监测结果
     */
    @PostMapping("/dqd/service/rs/v1/device/crossExpDetailInfo/query")
    JSONObject crossDetail(CrossDetailParam param);
    JSONObject crossDetail(@RequestBody CrossDetailParam param);
    /**
     * 抓拍数据量监测结果
@@ -127,7 +128,7 @@
     * @return 抓拍数据量监测结果
     */
    @PostMapping("/dqd/service/rs/v1/data/snapCountDetail/query")
    JSONObject SnapshotDataMonitor(SnapshotDataMonitorParam param);
    JSONObject SnapshotDataMonitor(@RequestBody SnapshotDataMonitorParam param);
    /**
     * 抓拍数据时延监测结果
@@ -143,7 +144,7 @@
     * @return 抓拍数据时延监测结果
     */
    @PostMapping("/dqd/service/rs/v1/data/snapAgingDetail/query")
    JSONObject SnapshotDelayMonitor(SnapshotDelayMonitorParam param);
    JSONObject SnapshotDelayMonitor(@RequestBody SnapshotDelayMonitorParam param);
    /**
     * 图片访问监测结果
@@ -154,7 +155,7 @@
     * @return 图片访问监测结果
     */
    @PostMapping("/dqd/service/rs/v1/data/picAccessDetail/query")
    JSONObject PicAccessMonitor(PicAccessParam param);
    JSONObject PicAccessMonitor(@RequestBody PicAccessParam param);
    /**
     * 属性识别准确监测结果
@@ -164,7 +165,7 @@
     * @return 属性识别准确监测结果
     */
    @PostMapping("/dqd/service/rs/v1/data/attributeRecognition/query")
    JSONObject AttrRecognitionMonitor(AttrRecognitionParam param);
    JSONObject AttrRecognitionMonitor(@RequestBody AttrRecognitionParam param);
    /**
     * 数据完整性监测结果
@@ -178,7 +179,7 @@
     * @return 数据完整性监测结果
     */
    @PostMapping("/dqd/service/rs/v1/data/attributeIntegrity/query")
    JSONObject DataIntegrityMonitoring(DataIntegrityMonitoringParam param);
    JSONObject DataIntegrityMonitoring(@RequestBody DataIntegrityMonitoringParam param);
    /**
     * 人脸设备全检指标监测结果
@@ -189,7 +190,7 @@
     * @return 人脸设备全检指标监测结果
     */
    @PostMapping("/dqd/service/rs/v2/data/faceFullAmount/query")
    JSONObject FaceDeviceInspection(FaceDeviceInspectionParam param);
    JSONObject FaceDeviceInspection(@RequestBody FaceDeviceInspectionParam param);
    /**
     * 人脸设备抽检指标监测结果
@@ -200,7 +201,7 @@
     * @return 人脸设备抽检指标监测结果
     */
    @PostMapping("/dqd/service/rs/v2/data/faceSampleAmount/query")
    JSONObject FaceDeviceSampling(FaceDeviceSamplingParam param);
    JSONObject FaceDeviceSampling(@RequestBody FaceDeviceSamplingParam param);
    /**
     * 车辆设备全检指标监测结果
@@ -211,7 +212,7 @@
     * @return 车辆设备全检指标监测结果
     */
    @PostMapping("/dqd/service/rs/v2/data/vehFullAmount/query")
    JSONObject VehicleDeviceInspection(VehicleDeviceInspectionParam param);
    JSONObject VehicleDeviceInspection(@RequestBody VehicleDeviceInspectionParam param);
    /**
     * 车辆设备抽检指标监测结果
@@ -222,7 +223,7 @@
     * @return 车辆设备抽检指标监测结果
     */
    @PostMapping("/dqd/service/rs/v2/data/vehSampleAmount/query")
    JSONObject VehicleDeviceSampling(VehicleDeviceSamplingParam param);
    JSONObject VehicleDeviceSampling(@RequestBody VehicleDeviceSamplingParam param);
    /**
     * 关注监测资源查询
@@ -231,7 +232,7 @@
     * @return 关注监测资源查询
     */
    @PostMapping("/dqd/service/rs/v1/alarm/monitorResource/query")
    JSONObject monitorResource(MonitorResourceParam param);
    JSONObject monitorResource(@RequestBody MonitorResourceParam param);
    /**
     * 指标配置信息查询
@@ -247,5 +248,5 @@
     * @return 组织树查询
     */
    @PostMapping("/dqd/service/rs/v1/orgInfo/standard/query")
    JSONObject OrganizationTree(OrganizationTreeParam param);
    JSONObject OrganizationTree(@RequestBody OrganizationTreeParam param);
}
ycl-server/src/main/java/com/ycl/web/UYClient.java
@@ -9,6 +9,8 @@
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
/**
 * @author gonghl
@@ -26,7 +28,7 @@
     * @return 查询摄像机清单集合
     */
    @GetMapping("/VIID/Cameras")
    JSONObject cameraList(CameraParam cameraParam);
    JSONObject cameraList(@RequestParam CameraParam cameraParam);
    /**
     * 点位在线
@@ -35,7 +37,7 @@
     * @return 查询在线统计列表
     */
    @GetMapping("/openapi/v1/report/online/list")
    JSONObject onlineList(OnlineParam onlineParam);
    JSONObject onlineList(@RequestParam OnlineParam onlineParam);
    /**
     * 录像可用
@@ -44,7 +46,7 @@
     * @return 查询满足条件的录像汇总信息
     */
    @PostMapping("/report/recordMetaDSum/list")
    JSONObject recordMetaDSumList(RecordMetaDSumParam recordMetaDSumParam);
    JSONObject recordMetaDSumList(@RequestBody RecordMetaDSumParam recordMetaDSumParam);
    @GetMapping("/api/v1/app/osdMonitor/list")
    JSONObject osdMonitorList();
ycl-server/src/main/resources/application-dev.yml
@@ -7,7 +7,7 @@
  # 版权年份
  copyrightYear: 2024
  # 文件路径 示例( Windows配置D:/zgyw/uploadPath,Linux配置 /home/zgyw/uploadPath)
  profile: D:/zgyw/uploadPath
  profile: E:/ycl/zgyw/uploadPath
  # 获取ip地址开关
  addressEnabled: false
  # 验证码类型 math 数字计算 char 字符验证
@@ -17,7 +17,7 @@
# 开发环境配置
server:
  # 服务器的HTTP端口,默认为8080
  port: 8080
  port: 8085
  servlet:
    # 应用的访问路径
    context-path: /
@@ -36,7 +36,7 @@
spring:
  # 数据源配置
  datasource:
    url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
    username: root
    password: ycl@202466
    type: com.alibaba.druid.pool.DruidDataSource
@@ -126,3 +126,9 @@
      username: admin
      password: ycl@202466
# 拉取数据请求配置
request:
  retry: 4 # 最大重试次数
  youYunDomain: 123.123.123.5 # 优云地址
  haiKangDomain: 123.123.123.1 # 海康地址
ycl-server/src/main/resources/application-prod.yml
@@ -36,7 +36,7 @@
spring:
  # 数据源配置
  datasource:
    url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    url: jdbc:mysql://101.35.247.188:3306/zgyw?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
    username: root
    password: ycl@202466
    type: com.alibaba.druid.pool.DruidDataSource
@@ -120,3 +120,8 @@
  pathMapping: /prod-api
# 拉取数据请求配置
request:
  retry: 4 # 最大重试次数
  youYunDomain: 123.123.123.5 # 优云地址
  haiKangDomain: 123.123.123.1 # 海康地址
ycl-server/src/main/resources/application.yml
@@ -108,8 +108,3 @@
  # 匹配链接
  urlPatterns: /system/*,/monitor/*,/tool/*
# 拉取数据请求配置
request:
  retry: 4 # 最大重试次数
  youYunDomain: 123.123.123.5 # 优云地址
  haiKangDomain: 123.123.123.1 # 海康地址
ycl-server/src/main/resources/mapper/zgyw/WorkOrderMapper.xml
@@ -44,22 +44,41 @@
    <select id="distributePage" resultType="com.ycl.platform.domain.vo.WorkOrderVO">
        SELECT
        wo.*,
        u.unit_name,
        p.yw_person_name
            wo.*,
            u.unit_name,
            p.yw_person_name,
            yp.point_tag,
            odr.create_time as distributeTime,
            su.nick_name as realName
        FROM
        t_work_order wo
        LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = 0
        LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = 0
        where
        wo.deleted = 0
        <if test="query.unitId != null">
            AND wo.unit_id = #{query.unitId}
        </if>
        <if test="query.status != null and query.status != ''">
            AND wo.status = #{query.status}
        </if>
            t_work_order wo
                LEFT JOIN t_yw_unit u ON wo.unit_id = u.id and u.deleted = 0
                LEFT JOIN t_yw_people p ON wo.yw_people_id = p.id and p.deleted = 0
                INNER JOIN t_yw_point yp ON yp.id = wo.point_id AND yp.deleted = 0
                LEFT JOIN t_work_order_distribute_record odr ON odr.work_order_id = wo.id AND odr.deleted = 0
                LEFT JOIN sys_user su ON su.user_id = odr.user_id
        WHERE
            wo.deleted = 0
            <if test="query.unitId != null">
                AND wo.unit_id = #{query.unitId}
            </if>
            <if test="query.status != null and query.status != ''">
                AND wo.status = #{query.status}
            </if>
        ORDER BY wo.create_time DESC
    </select>
    <select id="handlingWorkOrderList" resultType="com.ycl.platform.domain.vo.YwPointJobVO">
        SELECT
             wo.id,
             wod.create_time,
             yp.point_tag
        FROM
             t_work_order wo
                INNER JOIN t_yw_point yp ON yp.id = wo.point_id AND yp.deleted = 0
                INNER JOIN t_work_order_distribute_record wod ON wod.work_order_id = wo.id
        WHERE
             wo.status = 'DISTRIBUTED' AND wo.deleted = 0
    </select>
</mapper>