fuliqi
2024-09-19 cf2ca433a7e6ef92b33c1479f60702e97c2cb1bf
ycl-server/src/main/java/com/ycl/task/ContractTask.java
@@ -15,7 +15,9 @@
import com.ycl.platform.domain.vo.WorkOrderVO;
import com.ycl.platform.mapper.*;
import com.ycl.platform.service.IContractScoreService;
import com.ycl.system.mapper.SysConfigMapper;
import com.ycl.utils.DateUtils;
import com.ycl.utils.StringUtils;
import constant.ApiConstants;
import enumeration.ContractRule;
import enumeration.ErrorType;
@@ -56,7 +58,8 @@
    private IContractScoreService contractScoreService;
    @Autowired
    private WorkOrderMapper workOrderMapper;
    @Autowired
    private SysConfigMapper sysConfigMapper;
    private static final Integer Online = 1;
    private static final Integer Offline = -1;
    private static final String AuditStatus_Pass = "1";
@@ -323,8 +326,16 @@
     */
    public void randomDeductPic() {
        Random random = new Random();
        Integer num = randomSize;
        //给定随机范围
        int number = random.nextInt(randomSize);
        String count = sysConfigMapper.checkConfigKeyUnique("check.contract.sample").getConfigValue();
        if (!StringUtils.isEmpty(count)) {
            Integer temp = Integer.valueOf(count);
            if (temp > 0) {
                num = temp;
            }
        }
        int number = random.nextInt(num);
        if (number == 0) {
            log.info("开始抽查图片完整状态");
            //准备批量打分的集合
@@ -346,7 +357,7 @@
            queryWrapper.in("serial_number", serialNumbers);
            //获取公司所运维的设备集合,key为unitId value为设备国标码集合
            Map<Long, List<String>> unitMonitorMap = ywPointMapper.selectList(queryWrapper).stream()
                    .collect(Collectors.groupingBy(YwPoint::getUnitId,
                    .filter(ywPoint -> ywPoint.getUnitId()!=null).collect(Collectors.groupingBy(YwPoint::getUnitId,
                            Collectors.mapping(
                                    YwPoint::getSerialNumber,
                                    Collectors.toList())));
@@ -395,7 +406,16 @@
    public void randomDeductVideo() {
        Random random = new Random();
        //给定随机范围
        int number = random.nextInt(randomSize);
        Integer num = randomSize;
        //给定随机范围
        String count = sysConfigMapper.checkConfigKeyUnique("check.contract.sample").getConfigValue();
        if (!StringUtils.isEmpty(count)) {
            Integer temp = Integer.valueOf(count);
            if (temp > 0) {
                num = temp;
            }
        }
        int number = random.nextInt(num);
        if (number == 0) {
            log.info("开始抽查录像完整状态");
            //准备批量打分的集合
@@ -417,7 +437,7 @@
            queryWrapper.in("serial_number", serialNumbers);
            //获取公司所运维的设备集合,key为unitId value为设备国标码集合
            Map<Long, List<String>> unitMonitorMap = ywPointMapper.selectList(queryWrapper).stream()
                    .collect(Collectors.groupingBy(YwPoint::getUnitId,
                    .filter(ywPoint -> ywPoint.getUnitId()!=null).collect(Collectors.groupingBy(YwPoint::getUnitId,
                            Collectors.mapping(
                                    YwPoint::getSerialNumber,
                                    Collectors.toList())));