package com.usky.fire.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usky.common.core.exception.BusinessException;
import com.usky.common.core.util.Arith;
import com.usky.common.core.util.DateUtils;
import com.usky.common.mybatis.core.AbstractCrudService;
import com.usky.fire.domain.*;
import com.usky.fire.mapper.BscLawTrendMapper;
import com.usky.fire.service.*;
import com.usky.fire.service.enums.BsSaOneCode;
import com.usky.fire.service.enums.BsSaTwoCode;
import com.usky.fire.service.util.OnlineMethod;
import com.usky.fire.service.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;

/**
 * <p>
 * 消防执法动态大屏统计 服务实现类
 * </p>
 *
 * @author JCB
 * @since 2022-10-13
 */
@Service
public class BscLawTrendServiceImpl extends AbstractCrudService<BscLawTrendMapper, BscLawTrend> implements BscLawTrendService {

    @Autowired
    private DemLawStatisticsService demLawStatisticsService;

    @Autowired
    private DemEnforceReportComplaintService demEnforceReportComplaintService;

    @Autowired
    private DemEnforceReportAttachService demEnforceReportAttachService;

    @Autowired
    private BaseCompanyService baseCompanyService;

    @Autowired
    private DemFireStatisticsService demFireStatisticsService;

    @Autowired
    private DemFireStatisticsAttachService demFireStatisticsAttachService;

    @Autowired
    private DemAtlInspectVoucherService demAtlInspectVoucherService;

    @Autowired
    private DemAtlInspectCertificateService demAtlInspectCertificateService;

    @Autowired
    private DemAtlDisagreeService demAtlDisagreeService;

    @Autowired
    private DemEnforceProjectAllService demEnforceProjectAllService;

    @Autowired
    private DemEnforceInspectRecordService demEnforceInspectRecordService;

    @Override
    public Object lawTrendList(String moduleType, String startDate, String endDate) {
        LambdaQueryWrapper<BscLawTrend> queryWrapper = Wrappers.lambdaQuery();
        switch (moduleType) {
            case "monthLaw":
                queryWrapper.select(BscLawTrend::getMonthLaw);
                break;
            case "adstraLicense":
                queryWrapper.select(BscLawTrend::getAdstraLicense);
                break;
            case "reportComplaint":
                queryWrapper.select(BscLawTrend::getReportComplaint);
                break;
            case "complaintHandle":
                queryWrapper.select(BscLawTrend::getComplaintHandle);
                break;
            case "enforceReportComplaint":
                queryWrapper.select(BscLawTrend::getEnforceReportComplaint);
                break;
            default:
                throw new BusinessException("参数错误");
        }
        queryWrapper.between(StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate),  BscLawTrend::getCreateTime, startDate, endDate)
                .orderByDesc(BscLawTrend::getId)
                .last(" limit 1");
        List<BscLawTrend> list = this.list(queryWrapper);
        String data = null;
        JSONArray jsonArray = new JSONArray();
        JSONObject jsonObject = new JSONObject();
        switch (moduleType) {
            case "monthLaw":
                data = list.get(0).getMonthLaw();
                jsonArray = JSONObject.parseArray(data);
                break;
            case "adstraLicense":
                data = list.get(0).getAdstraLicense();
                jsonObject = JSONObject.parseObject(data);
                break;
            case "reportComplaint":
                data = list.get(0).getReportComplaint();
                jsonArray = JSONObject.parseArray(data);
                break;
            case "complaintHandle":
                data = list.get(0).getComplaintHandle();
                jsonArray = JSONObject.parseArray(data);
                break;
            case "enforceReportComplaint":
                data = list.get(0).getEnforceReportComplaint();
                jsonObject = JSONObject.parseObject(data);
                break;
            default:
                throw new BusinessException("参数错误");
        }
        if (CollectionUtils.isNotEmpty(jsonArray)) {
            return jsonArray;
        } else if (CollectionUtils.isNotEmpty(jsonObject)) {
            return jsonObject;
        } else {
            return jsonArray;
        }
    }

    @Override
    public List<Map<String, Object>> companyData(String companyId, String companyName) {
        List<Map<String, Object>> list3 = new ArrayList<>();
        LambdaQueryWrapper<BaseCompany> queryWrapper = Wrappers.lambdaQuery();
        queryWrapper.select(BaseCompany::getId, BaseCompany::getCompanyName, BaseCompany::getCompanyId, BaseCompany::getCompanyCode,
                BaseCompany::getAddress, BaseCompany::getLinkPerson, BaseCompany::getLinkPhone)
                .eq(BaseCompany::getCompanyId, companyId)
                .eq(BaseCompany::getEnable, 0);
        List<BaseCompany> companylist = baseCompanyService.list(queryWrapper);
        if (CollectionUtils.isNotEmpty(companylist)) {
            LambdaQueryWrapper<DemLawStatistics> queryWrapper1 = Wrappers.lambdaQuery();
            queryWrapper1.eq(DemLawStatistics::getCompanyCode, companylist.get(0).getCompanyCode())
                    .eq(DemLawStatistics::getDeleteFlag, 0);
            int count = demLawStatisticsService.count(queryWrapper1);

            LambdaQueryWrapper<DemFireStatistics> queryWrapper2 = Wrappers.lambdaQuery();
            queryWrapper2.eq(DemFireStatistics::getCompanyCode, companylist.get(0).getCompanyCode());
            int count1 = demFireStatisticsService.count(queryWrapper2);

            LambdaQueryWrapper<DemEnforceInspectRecord> queryWrapper5 = Wrappers.lambdaQuery();
            queryWrapper5.select(DemEnforceInspectRecord::getEnforceInspectPerson, DemEnforceInspectRecord::getInspectDescript,
                    DemEnforceInspectRecord::getInspectQualified,DemEnforceInspectRecord::getCreateTime)
                    .eq(DemEnforceInspectRecord::getCompanyName, companyName)
                    .orderByDesc(DemEnforceInspectRecord::getId)
                    .last(" limit 1");
            List<DemEnforceInspectRecord> list4 = demEnforceInspectRecordService.list(queryWrapper5);

            LambdaQueryWrapper<DemFireStatistics> queryWrapper3 = Wrappers.lambdaQuery();
            queryWrapper3.select(DemFireStatistics::getFireTime, DemFireStatistics::getBurnedArea, DemFireStatistics::getFireGrade,
                    DemFireStatistics::getFireNumber)
                    .eq(DemFireStatistics::getCompanyCode, companylist.get(0).getCompanyCode())
                    .orderByDesc(DemFireStatistics::getId)
                    .last(" limit 1");
            List<DemFireStatistics> list1 = demFireStatisticsService.list(queryWrapper3);
            List<DemFireStatisticsAttach> list2 = new ArrayList<>();
            if (CollectionUtils.isNotEmpty(list1)) {
                LambdaQueryWrapper<DemFireStatisticsAttach> queryWrapper4 = Wrappers.lambdaQuery();
                queryWrapper4.select(DemFireStatisticsAttach::getInitialFuelType1)
                        .eq(DemFireStatisticsAttach::getFireNumber, list1.get(0).getFireNumber());
                list2 = demFireStatisticsAttachService.list(queryWrapper4);
            }

            QueryWrapper<DemLawStatistics> query = Wrappers.query();
            query.select("COALESCE(sum(inspect_company)) as inspectCompany", "COALESCE(sum(fire_hazard)) as fireHazard",
                    "COALESCE(sum(rectificate_fire_hazard)) as rectificateFireHazard", "COALESCE(sum(penalty_amount)) as penaltyAmount",
                    "COALESCE(sum(correction_notice)) as correctionNotice", "COALESCE(sum(punishment_decision)) as punishmentDecision",
                    "COALESCE(sum(order_three_stops)) as orderThreeStops", "COALESCE(sum(temporary_seizure)) as temporarySeizure")
                    .eq("delete_flag", 0).eq("company_code", companylist.get(0).getCompanyCode());
            List<Map<String, Object>> list = demLawStatisticsService.listMaps(query);
            Map<String, Object> map = new HashMap<>();
            String sponsor = null;
            String coOrganizer = null;
            String enforceInspectPerson = null;
            String inspectDescript = null;
            int inspectQualified = 0;
            LocalDateTime createTime = null;
            if (CollectionUtils.isNotEmpty(list4)) {
                enforceInspectPerson = list4.get(0).getEnforceInspectPerson();
                inspectDescript = list4.get(0).getInspectDescript();
                inspectQualified = list4.get(0).getInspectQualified();
                createTime = list4.get(0).getCreateTime();
                if (StringUtils.isNotBlank(enforceInspectPerson)) {
                    sponsor = enforceInspectPerson.split("、")[0];
                    coOrganizer = enforceInspectPerson.split("、")[1];
                }
            }
            map.put("enforceInspectPerson", enforceInspectPerson);
            map.put("sponsor", sponsor);
            map.put("coOrganizer", coOrganizer);
            map.put("inspectDescript", inspectDescript);
            map.put("inspectQualified", inspectQualified);
            map.put("createTime", createTime);
            map.put("companyAddress", companylist.get(0).getAddress());
            map.put("linkPerson", companylist.get(0).getLinkPerson());
            map.put("linkPhone", companylist.get(0).getLinkPhone());
            map.put("censorCount", count);
            map.put("fireCount", count1);
            map.put("processDate", null);
            map.put("carefullyCheckDate", null);
            map.put("securityCheckDate", null);
            map.put("inspectCompany", 0);
            map.put("fireHazard", 0);
            map.put("rectificateFireHazard", 0);
            map.put("penaltyAmount", 0);
            map.put("correctionNotice", 0);
            map.put("punishmentDecision", 0);
            map.put("orderThreeStops", 0);
            map.put("temporarySeizure", 0);
            map.put("fireTime", null);
            map.put("disposalDuration", null);
            map.put("burnedArea", null);
            map.put("fireGrade", null);
            map.put("mobilizeVehicles", 0);
            map.put("squadron", null);
            map.put("status", null);
            map.put("initialFuelType1", null);
            if (CollectionUtils.isNotEmpty(list1)) {
                map.put("fireTime", list1.get(0).getFireTime());
                map.put("burnedArea", list1.get(0).getBurnedArea());
                map.put("fireGrade", list1.get(0).getFireGrade());
                if (CollectionUtils.isNotEmpty(list2)) {
                    map.put("initialFuelType1", list2.get(0).getInitialFuelType1());
                }
            }
            if (CollectionUtils.isNotEmpty(list)) {
                if (CollectionUtils.isNotEmpty(list.get(0))) {
                    map.put("inspectCompany", list.get(0).get("inspectCompany"));
                    map.put("fireHazard", list.get(0).get("fireHazard"));
                    map.put("rectificateFireHazard", list.get(0).get("rectificateFireHazard"));
                    map.put("penaltyAmount", list.get(0).get("penaltyAmount"));
                    map.put("correctionNotice", list.get(0).get("correctionNotice"));
                    map.put("punishmentDecision", list.get(0).get("punishmentDecision"));
                    map.put("orderThreeStops", list.get(0).get("orderThreeStops"));
                    map.put("temporarySeizure", list.get(0).get("temporarySeizure"));
                }
            }
            list3.add(map);
        }
        return list3;
    }

    @Override
    public void lawEnforcement() {
        List<SiAeAllVO> siAeAllVOS = this.monthLaw();
        AlFsdAllVO alFsdAllVO = this.adstraLicense();
        List<StreetTownComplaintVO> reportComplaintVOS = this.reportComplaint();
        ReportStatisticsVO reportStatisticsVO = this.enforceReportComplaintOne();
        BscLawTrend bscLawTrend = new BscLawTrend();
        bscLawTrend.setMonthLaw(JSON.toJSONString(siAeAllVOS));
        bscLawTrend.setAdstraLicense(JSON.toJSONString(alFsdAllVO));
        bscLawTrend.setReportComplaint(JSON.toJSONString(reportComplaintVOS));
        bscLawTrend.setComplaintHandle(JSON.toJSONString(reportComplaintVOS));
        bscLawTrend.setEnforceReportComplaint(JSON.toJSONString(reportStatisticsVO));
        bscLawTrend.setCreateTime(LocalDateTime.now());
        this.save(bscLawTrend);
    }

    @Override
    public List<SiAeAllVO> monthLaw() {
        Date startTime = null;
        Date endTime = null;
        List<SiAeAllVO> allVoS = new ArrayList<>();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date();
        Calendar calendar = new GregorianCalendar();
        calendar.setTime(date);
        //获得本月第一天
        calendar.add(Calendar.MONTH, 0);
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        String firstDay = sdf.format(calendar.getTime());
        //获得本月最后一天
        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
        String lastDay = sdf.format(calendar.getTime());
        try {
            startTime = simpleDateFormat.parse(firstDay + " 00:00:00");
            endTime = simpleDateFormat.parse(lastDay + " 23:59:59");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        Optional.ofNullable(startTime).orElseThrow(() -> new BusinessException("开始时间不能为空"));
        Optional.ofNullable(endTime).orElseThrow(() -> new BusinessException("结束时间不能为空"));
        Map<String, Object> aeAllCollect = demLawStatisticsService.lawStatistics(startTime, endTime);
        //获取同比
        Date upStartTime = DateUtils.addYears(startTime, -1);
        Date upEndTime = DateUtils.addYears(endTime, -1);
        Map<String, Object> upAllCollect = demLawStatisticsService.lawStatistics(upStartTime, upEndTime);
        //获取环比
        //获取两个时间天数之差
        int distanceOfTwoDate = DateUtils.getDistanceOfTwoDateNew(startTime, endTime);
        Date linkEndTime = DateUtils.addDays(startTime, -1);
        Date linkStartTime = DateUtils.addDays(linkEndTime, -distanceOfTwoDate);
        Map<String, Object> linkAllCollect = demLawStatisticsService.lawStatistics(linkStartTime, linkEndTime);

        Optional.ofNullable(aeAllCollect).ifPresent(aeAll -> {
            for (String type : aeAll.keySet()) {
                SiAeAllVO siAeAllVO = new SiAeAllVO();
                siAeAllVO.setCheckType(type);
                Double radio = Double.parseDouble(aeAll.get(type).toString());
                siAeAllVO.setNumber(radio);
                Double upRadio = 0.00;
                Double linkRadio = 0.00;
                if (0 != radio) {
                    upRadio = Optional.ofNullable(upAllCollect).map(up -> Double.parseDouble(up.get(type).toString())).orElse(0.0);
                    siAeAllVO.setSameRatio(Arith.div(upRadio, radio));
                    linkRadio = Optional.ofNullable(linkAllCollect).map(link -> Double.parseDouble(link.get(type).toString())).orElse(0.0);
                    siAeAllVO.setLinkRelativeRatio(Arith.div(linkRadio, radio));
                } else {
                    siAeAllVO.setSameRatio(0.00);
                    siAeAllVO.setLinkRelativeRatio(0.00);
                }
                if (radio.equals(upRadio)) {
                    siAeAllVO.setSameStatus(0);
                } else if (radio > upRadio) {
                    siAeAllVO.setSameStatus(1);
                } else {
                    siAeAllVO.setSameStatus(2);
                }
                if (radio.equals(linkRadio)) {
                    siAeAllVO.setLinkRelativeStatus(0);
                } else if (radio > linkRadio) {
                    siAeAllVO.setLinkRelativeStatus(1);
                } else {
                    siAeAllVO.setLinkRelativeStatus(2);
                }
                allVoS.add(siAeAllVO);
            }
        });
        return allVoS;
    }

    @Override
    public AlFsdAllVO adstraLicense() {
        AlFsdAllVO alFsdAllVo = new AlFsdAllVO();
        alFsdAllVo.setAcceptNumber(demAtlInspectVoucherService.AtlInspectVoucherCount());
        alFsdAllVo.setCheckNumber(demEnforceProjectAllService.enforceProjectAllCount(BsSaOneCode.SAFETY_CHECK.getLetter(), BsSaTwoCode.C_S.getLetter(), null, null, null, null));
        //行政许可安全检查合格证
        Integer seqCount = demAtlInspectCertificateService.atlInspectCertificateCount();
        //行政许可-消防安检申报不同意
        Integer disagreeCount = demAtlDisagreeService.atlDisagreeCount();
        alFsdAllVo.setArticleNumber(seqCount + disagreeCount);
        alFsdAllVo.setQualifiedRadio(Arith.div(seqCount, seqCount + disagreeCount));
        return alFsdAllVo;
    }

    @Override
    public List<StreetTownComplaintVO> reportComplaint() {
        LambdaQueryWrapper<DemEnforceReportComplaint> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(DemEnforceReportComplaint::getEnable, 0);
        List<DemEnforceReportComplaint> lt = demEnforceReportComplaintService.list(wrapper);
        if(CollectionUtils.isNotEmpty(lt)){
            for (int i = 0; i < lt.size(); i++) {
                if(StringUtils.isBlank(lt.get(i).getStreetTown())){
                    String longitude = lt.get(i).getLongitude();
                    String latitude = lt.get(i).getLatitude();
                    String location = longitude + "," + latitude;
                    String streetTown2 = OnlineMethod.getStreetTown(location);

                    lt.get(i).setStreetTown(streetTown2);
                    demEnforceReportComplaintService.updateById(lt.get(i));
                }
            }
        }

        List<StreetTownComplaintVO> list = new ArrayList<>();
        List<String> streetTownList = new ArrayList<>();
        streetTownList.add("华漕镇");
        streetTownList.add("新虹街道");
        streetTownList.add("七宝镇");
        streetTownList.add("虹桥镇");
        streetTownList.add("古美路街道");
        streetTownList.add("莘庄镇");
        streetTownList.add("梅陇镇");
        streetTownList.add("颛桥镇");
        streetTownList.add("马桥镇");
        streetTownList.add("江川路街道");
        streetTownList.add("吴泾镇");
        streetTownList.add("浦锦街道");
        streetTownList.add("浦江镇");
//        List<String> strings = this.enforceReportList();
        List<String> siteNameList = new ArrayList<>();
        siteNameList.add("居民");
        siteNameList.add("餐饮");
        siteNameList.add("商场");

        streetTownList.stream().forEach(town -> {
            StreetTownComplaintVO streetTownComplaintVO = new StreetTownComplaintVO();
            streetTownComplaintVO.setStreetTown(town);

            LambdaQueryWrapper<DemEnforceReportComplaint> queryWrapper1 = Wrappers.lambdaQuery();
            queryWrapper1.select(DemEnforceReportComplaint::getReportId).eq(DemEnforceReportComplaint::getEnable, 0)
                    .eq(DemEnforceReportComplaint::getStreetTown,town);
            List<DemEnforceReportComplaint> list1 = demEnforceReportComplaintService.list(queryWrapper1);
            if (CollectionUtils.isNotEmpty(list1)) {
                List<String> reportIdList = new ArrayList<>();
                for (int i = 0; i < list1.size(); i++) {
                    reportIdList.add(list1.get(i).getReportId());
                }
                List<ReportComplaintVO> reportComplaintVOList = new ArrayList<>();
                LambdaQueryWrapper<DemEnforceReportAttach> queryWrapper = Wrappers.lambdaQuery();
                queryWrapper.in(DemEnforceReportAttach::getReportId, reportIdList)
                        .ne(DemEnforceReportAttach::getHazardSiteName, "");
                List<DemEnforceReportAttach> list2 = demEnforceReportAttachService.list(queryWrapper);
                int siteComplaintCount = demEnforceReportAttachService.count(queryWrapper);
                if (CollectionUtils.isNotEmpty(list2)) {
                    int count1 = 0;
                    for (int j = 0; j < siteNameList.size(); j++) {
                        ReportComplaintVO reportComplaintVo = new ReportComplaintVO();
                        reportComplaintVo.setType(siteNameList.get(j));
                        int count = 0;
                        for (int i = 0; i < list2.size(); i++) {
                            if(list2.get(i).getHazardSiteName().contains(siteNameList.get(j))){
                                count++;
                                count1++;
                            }
                        }
                        reportComplaintVo.setNumber(count);

                        reportComplaintVOList.add(reportComplaintVo);

                    }
                    ReportComplaintVO reportComplaintVo = new ReportComplaintVO();
                    reportComplaintVo.setType("其他");
                    int otherCount = siteComplaintCount - count1;
                    reportComplaintVo.setNumber(otherCount);
                    reportComplaintVOList.add(reportComplaintVo);

                    streetTownComplaintVO.setComplaintVOList(reportComplaintVOList);
                }


            }
            list.add(streetTownComplaintVO);
        });
        return list;
    }

    @Override
    public int enforceReportCount(String hazardSiteName) {
        int count = 0;
        List<DemEnforceReportComplaint> list1 = this.enforceReportComplaint();
        if (CollectionUtils.isNotEmpty(list1)) {
            List<String> reportIdList = new ArrayList<>();
            for (int i = 0; i < list1.size(); i++) {
                reportIdList.add(list1.get(i).getReportId());
            }
            LambdaQueryWrapper<DemEnforceReportAttach> queryWrapper = Wrappers.lambdaQuery();
            queryWrapper.in(DemEnforceReportAttach::getReportId, reportIdList)
                    .ne(DemEnforceReportAttach::getWorkOrderStatusName, "已撤销")
                    .eq(StringUtils.isNotBlank(hazardSiteName), DemEnforceReportAttach::getHazardSiteName, hazardSiteName);
            count = demEnforceReportAttachService.count(queryWrapper);
        }
        return count;
    }

    @Override
    public List<String> enforceReportList() {
        List<String> HazardSiteNameList = new ArrayList<>();
        List<DemEnforceReportComplaint> list1 = this.enforceReportComplaint();
        if (CollectionUtils.isNotEmpty(list1)) {
            List<String> reportIdList = new ArrayList<>();
            for (int i = 0; i < list1.size(); i++) {
                reportIdList.add(list1.get(i).getReportId());
            }
            LambdaQueryWrapper<DemEnforceReportAttach> queryWrapper = Wrappers.lambdaQuery();
            queryWrapper.select(DemEnforceReportAttach::getHazardSiteName)
                    .in(DemEnforceReportAttach::getReportId, reportIdList)
                    .ne(DemEnforceReportAttach::getHazardSiteName, "")
                    .groupBy(DemEnforceReportAttach::getHazardSiteName);
            List<DemEnforceReportAttach> list = demEnforceReportAttachService.list(queryWrapper);
            if (CollectionUtils.isNotEmpty(list)) {
                for (int i = 0; i < list.size(); i++) {
                    HazardSiteNameList.add(list.get(i).getHazardSiteName());
                }
            }
        }
        return HazardSiteNameList;
    }

    @Override
    public List<DemEnforceReportComplaint> enforceReportComplaint() {
        LambdaQueryWrapper<DemEnforceReportComplaint> queryWrapper1 = Wrappers.lambdaQuery();
        queryWrapper1.select(DemEnforceReportComplaint::getReportId).eq(DemEnforceReportComplaint::getEnable, 0);
        List<DemEnforceReportComplaint> list1 = demEnforceReportComplaintService.list(queryWrapper1);
        return list1;
    }

    @Override
    public ReportStatisticsVO enforceReportComplaintOne() {
        //办结数 = 已处理+已归档 处理数 = 总-办结数
        ReportStatisticsVO reportStatisticsVo = new ReportStatisticsVO();
        //总数
        Integer count = demEnforceReportAttachService.enforceReportAttachCount(null, null);
        reportStatisticsVo.setComplaintNumber(count);
        Integer fireCount = demEnforceReportAttachService.enforceReportAttachCount("已归档", null);
        Integer concludeCount = demEnforceReportAttachService.enforceReportAttachCount("已办结", null);
        reportStatisticsVo.setConcludeNumber(fireCount + concludeCount);
        reportStatisticsVo.setCheckNumber(count - fireCount - concludeCount);
        Integer satisfactionRateNumber = demEnforceReportAttachService.enforceReportAttachCount(null, "3");
        reportStatisticsVo.setSatisfactionRate(Arith.div(satisfactionRateNumber, count, 2));
        return reportStatisticsVo;
    }

}
