package com.trs.ggzyexchange.datacentercontroller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.trs.ggzyexchange.api.vo.Result;
import com.trs.ggzyexchange.entity.*;
import com.trs.ggzyexchange.entity.pagedata.*;
import com.trs.ggzyexchange.enums.CommonConstant;
import com.trs.ggzyexchange.service.*;
import com.trs.ggzyexchange.utils.DateUtils;
import com.trs.ggzyexchange.utils.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;

/*
* 数据中心接口          地图的方法
* */
@Slf4j
@RestController
@RequestMapping("/data-controller")
public class DataController {


    @Autowired
    private GcNoticeandfileService gcNoticeandfileService;

    @Autowired
    private AreaPlatformService areaPlatformService;

    @Autowired
    private GcPubContractService gcPubContractService;

    @Autowired
    private GcBidpublicityService gcBidpublicityService;

    @Autowired
    private ZtLegalinfoService ztLegalinfoService;

    @Autowired
    private TRegionService tRegionService;

    @Autowired
    private GcTenderprojectService gcTenderprojectService;
    @Autowired
    private ZrzyTdCedeNoticeService zrzyTdCedeNoticeService;

    @Autowired
    private CqSwIssueBulletinService cqSwIssueBulletinService;

    @Autowired
    private ZcPurchaseBulletinService zcPurchaseBulletinService;

    @Autowired
    private ZfcgGongaoService zfcgGongaoService;

    @Autowired
    private QtjyNoticeService qtjyNoticeService;

    @Autowired
    private ZcBidpublicityService zcBidpublicityService;

    @Autowired
    private ZrzyTdBidwinnoticeService zrzyTdBidwinnoticeService;

    @Autowired
    private CqSwBargainResultService cqSwBargainResultService;

    @Autowired
    private CqGqIssueBulletinService cqGqIssueBulletinService;

    @Autowired
    private CqGqBargainResultService cqGqBargainResultService;


    @Autowired
    private QtjyBidpublicityService qtjyBidpublicityService;

    @Autowired
    private ZcProjectService zcProjectService;

    @Autowired
    private ZrzyTdCedeInfoService zrzyTdCedeInfoService;

    @Autowired
    private ZrzyTkqProjectInfoService zrzyTkqProjectInfoService;

    @Autowired
    private ZrzyCkqProjectInfoService zrzyCkqProjectInfoService;

    @Autowired
    private ZrzyDkProjectService zrzyDkProjectService;

    @Autowired
    private ZrzyBgStockIndexService zrzyBgStockIndexService;

    @Autowired
    private ZrzyJyzbStockIndexService zrzyJyzbStockIndexService;
    @Autowired
    private QtjyTenderProjectService qtjyTenderProjectService;

    @Autowired
    private QtjyBidopenrecordService qtjyBidopenrecordService;

    @Autowired
    private ZcBidopenrecordService zcBidopenrecordService;

    @Autowired
    private GcProjectService gcProjectService;

    @Autowired
    private OtherTradeResultInfoService otherTradeResultInfoService;

    @Autowired
    private OtherTradePubInfoService otherTradePubInfoService;

    @Autowired
    private ZrzyTdCedeResultService zrzyTdCedeResultService;

    @Autowired
    private GcPackageService gcPackageService;

    @Autowired
    private ZrzyTkqBidwinnoticeService zrzyTkqBidwinnoticeService;

    @Autowired
    private ZrzyCkqBidwinnoticeService zrzyCkqBidwinnoticeService;

    @Autowired
    private ZrzyDkBinwinNoticeService zrzyDkBinwinNoticeService;


    @Autowired
    private ZrzyDkNoticeService zrzyDkNoticeService;

    @Autowired
    private ZrzyBgNoticeService zrzyBgNoticeService;

    @Autowired
    private ZrzyJyzbNoticeService zrzyJyzbNoticeService;

    @Autowired
    private ZrzyBgBidwinNoticeService zrzyBgBidwinNoticeService;

    @Autowired
    private ZrzyJyzbBidwinNoticeService zrzyJyzbBidwinNoticeService;

    @Autowired
    private ZrzyTkqNoticeService zrzyTkqNoticeService;

    @Autowired
    private ZrzyCkqNoticeService zrzyCkqNoticeService;

    @Autowired
    private JgFieldApplyService jgFieldApplyService;

    @Autowired
    private YcNoticeService ycNoticeService;



    @Autowired
    private RedisUtil redisUtil;

    @Autowired
    private DataEmploy dataEmploy;

    @Autowired
    private CqGqProjectService cqGqProjectService;

    @Autowired
    private CqSwProjectService cqSwProjectService;

    @GetMapping(value = "/listTotal")
    public Result<FirstPageData> queryPageListTotal() {
        FirstPageData firstPageData = null;
        Object firstPageDataObj = redisUtil.get(CommonConstant.LIST_TOTAL);
        if(!ObjectUtils.isEmpty(firstPageDataObj)){
            firstPageData = JSONObject.parseObject(firstPageDataObj.toString(),FirstPageData.class);
            return Result.OK(firstPageData);
        }else{
            firstPageData = new FirstPageData();
        }
        HomePageDataCenter homePageDataCenter = dataEmploy.queryHomePageDataCenter();
        TotalEntryData totalEntryData = homePageDataCenter.getTotalEntryData();
        //内蒙古自治区：121500004600236091
        /*
         * 总数
         * */
        DataStatistics dataStatistics = new DataStatistics();
        try {
            dataStatistics.setTotalData(totalEntryData.getTotal());
            dataStatistics.setAutonomousTotalData(totalEntryData.getTotalzzq());
            dataStatistics.setMengShiTotalData(totalEntryData.getTotalms());
        }catch (Exception e){
            e.printStackTrace();
        }
        TotalTransactionData totalTransactionData = homePageDataCenter.getTotalTransactionData();
        /*
        * 入场数据总量
        * */
        BusinessDataStatistics businessDataStatistics = new BusinessDataStatistics();
        try {
            businessDataStatistics.setBusinessTotalData(totalTransactionData.getTotal());
            businessDataStatistics.setBusinessAutonomousTotalData(totalTransactionData.getTotalzzq());
            businessDataStatistics.setBusinessMengShiTotalData(totalTransactionData.getTotalms());
        }catch (Exception e){
            e.printStackTrace();
        }
        /*
        *主体数量
        */
        TotalAmountTransactionData totalAmountTransactionData = homePageDataCenter.getTotalAmountTransactionData();
        SubDataStatistics subDataStatistics = new SubDataStatistics();
        try {
            subDataStatistics.setName(totalAmountTransactionData.getName());
            subDataStatistics.setIntraRegional(totalAmountTransactionData.getTotalzzq());
            subDataStatistics.setOutOfRegion(totalAmountTransactionData.getTotalms());
        }catch (Exception e){
            e.printStackTrace();
        }

        /*
        * 交易额总量
        * */
        QueryWrapper<GcBidpublicity> gcBidpublicityQueryWrapperSum = new QueryWrapper<GcBidpublicity>();
        gcBidpublicityQueryWrapperSum.select("sum( case when PRICE_UNIT = 0 then BID_AMOUNT when PRICE_UNIT = 1 then BID_AMOUNT*10000 else BID_AMOUNT end) as sumAll");
        GcBidpublicity gcBidpublicity = gcBidpublicityService.getOne(gcBidpublicityQueryWrapperSum);

        QueryWrapper<ZcBidpublicity> bidpublicityQueryWrapperSum = new QueryWrapper<ZcBidpublicity>();
        bidpublicityQueryWrapperSum.select("sum( case when PRICE_UNIT = 0 then WIN_BID_PRICE when PRICE_UNIT = 1 then WIN_BID_PRICE*10000 else WIN_BID_PRICE end) as sumAll");
        ZcBidpublicity zcBidpublicitySum = zcBidpublicityService.getOne(bidpublicityQueryWrapperSum);

        /*ZRZY_TD_BIDWINNOTICE*/
        QueryWrapper<ZrzyTdBidwinnotice> zrzyTdBidwinnoticeQuerySum = new QueryWrapper<ZrzyTdBidwinnotice>();
        zrzyTdBidwinnoticeQuerySum.select("sum( case when PRICE_UNIT = 0 then DEAL_PRICE when PRICE_UNIT = 1 then DEAL_PRICE*10000 else DEAL_PRICE end) as sumAll");

        ZrzyTdBidwinnotice zrzyTdBidwinnoticeSum = zrzyTdBidwinnoticeService.getOne(zrzyTdBidwinnoticeQuerySum);

        /*ZRZY_TKQ_BIDWINNOTICE*/
        QueryWrapper<ZrzyTkqBidwinnotice> zrzyTdBidwinnoticeQueryWrapperSum = new QueryWrapper<ZrzyTkqBidwinnotice>();
        zrzyTdBidwinnoticeQueryWrapperSum.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll ");
        ZrzyTkqBidwinnotice zrzyTkqBidwinnoticeSum = zrzyTkqBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapperSum);

        /*ZRZY_CKQ_BIDWINNOTICE*/
        QueryWrapper<ZrzyCkqBidwinnotice> zrzyCkqBidwinnoticeQueryWrapperSum = new QueryWrapper<ZrzyCkqBidwinnotice>();
        zrzyCkqBidwinnoticeQueryWrapperSum.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll ");
        ZrzyCkqBidwinnotice zrzyCkqBidwinnoticeSum = zrzyCkqBidwinnoticeService.getOne(zrzyCkqBidwinnoticeQueryWrapperSum);

        /*ZRZY_DK_BIDWIN_NOTICE*/
        QueryWrapper<ZrzyDkBinwinNotice> zrzyDkBinwinNoticeQueryWrapperSum = new QueryWrapper<ZrzyDkBinwinNotice>();
        zrzyDkBinwinNoticeQueryWrapperSum.select("sum(cast(ZB_PRICE as decimal(9,2)) * 10000) as sumAll ");
        ZrzyDkBinwinNotice zrzyDkBinwinNoticeSum = zrzyDkBinwinNoticeService.getOne(zrzyDkBinwinNoticeQueryWrapperSum);

        /*ZRZY_BG_BIDWIN_NOTICE*/
        QueryWrapper<ZrzyBgBidwinNotice> zrzyBgBidwinNoticeQueryWrapperSum = new QueryWrapper<ZrzyBgBidwinNotice>();
        zrzyBgBidwinNoticeQueryWrapperSum.select("sum(cast(WIN_BID_PRICE as decimal(9,2)) * 10000) as sumAll ");
        ZrzyBgBidwinNotice zrzyBgBidwinNoticeSum = zrzyBgBidwinNoticeService.getOne(zrzyBgBidwinNoticeQueryWrapperSum);

        /*ZRZY_JYZB_BIDWIN_NOTICE*/
        QueryWrapper<ZrzyJyzbBidwinNotice> zrzyJyzbBidwinNoticeQueryWrapperSum = new QueryWrapper<ZrzyJyzbBidwinNotice>();
        zrzyJyzbBidwinNoticeQueryWrapperSum.select("sum(WIN_BID_PRICE) as sumAll");
        ZrzyJyzbBidwinNotice zrzyJyzbBidwinNoticeSum = zrzyJyzbBidwinNoticeService.getOne(zrzyJyzbBidwinNoticeQueryWrapperSum);

        /*CQ_SW_BARGAIN_RESULT*/
        QueryWrapper<CqSwBargainResult> cqSwBargainResultQueryWrapperSum = new QueryWrapper<CqSwBargainResult>();
        cqSwBargainResultQueryWrapperSum.select("sum( case when PRICE_UNIT = 0 then TRADE_VALUE when PRICE_UNIT = 1 then TRADE_VALUE*10000 else TRADE_VALUE end) as sumAll");
        CqSwBargainResult cqSwBargainResultSum = cqSwBargainResultService.getOne(cqSwBargainResultQueryWrapperSum);

        /*CQ_GQ_BARGAIN_RESULT*/
        QueryWrapper<CqGqBargainResult> cqGqBargainResultQueryWrapperSum = new QueryWrapper<CqGqBargainResult>();
        cqGqBargainResultQueryWrapperSum.select("sum( case when PRICE_UNIT = 0 then TRADE_VALUE when PRICE_UNIT = 1 then TRADE_VALUE*10000 else TRADE_VALUE end) as sumAll");
        CqGqBargainResult cqGqBargainResultSum = cqGqBargainResultService.getOne(cqGqBargainResultQueryWrapperSum);


        BigDecimal noticeSum = new BigDecimal(0);
        if(!ObjectUtils.isEmpty(gcBidpublicity)){
            String sumAllGcBidpublicity = gcBidpublicity.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllGcBidpublicity) && sumAllGcBidpublicity != ""){
                noticeSum = noticeSum.add(new BigDecimal(sumAllGcBidpublicity));
            }
        }
        if(!ObjectUtils.isEmpty(zcBidpublicitySum)){
            String sumAllZcBidpublicitySum = zcBidpublicitySum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllZcBidpublicitySum) && sumAllZcBidpublicitySum != ""){
                noticeSum = noticeSum.add(new BigDecimal(sumAllZcBidpublicitySum));
            }
        }
        if(!ObjectUtils.isEmpty(zrzyTdBidwinnoticeSum)){
            String sumAllZrzyTdBidwinnoticeSum = zrzyTdBidwinnoticeSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllZrzyTdBidwinnoticeSum) && sumAllZrzyTdBidwinnoticeSum != ""){
                noticeSum =  noticeSum.add(new BigDecimal(sumAllZrzyTdBidwinnoticeSum));
            }
        }
        if(!ObjectUtils.isEmpty(zrzyTkqBidwinnoticeSum)){
            String sumAllZrzyTkqBidwinnoticeSum = zrzyTkqBidwinnoticeSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllZrzyTkqBidwinnoticeSum) && sumAllZrzyTkqBidwinnoticeSum != ""){
                noticeSum = noticeSum.add(new BigDecimal(sumAllZrzyTkqBidwinnoticeSum));
            }
        }
        if(!ObjectUtils.isEmpty(zrzyCkqBidwinnoticeSum)){
            String sumAllZrzyCkqBidwinnoticeSum = zrzyCkqBidwinnoticeSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllZrzyCkqBidwinnoticeSum) && sumAllZrzyCkqBidwinnoticeSum != ""){
                noticeSum =  noticeSum.add(new BigDecimal(sumAllZrzyCkqBidwinnoticeSum));
            }
        }

        if(!ObjectUtils.isEmpty(zrzyDkBinwinNoticeSum)){
            String sumAllZrzyDkBinwinNoticeSum = zrzyDkBinwinNoticeSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllZrzyDkBinwinNoticeSum) && sumAllZrzyDkBinwinNoticeSum != ""){
                noticeSum =   noticeSum.add(new BigDecimal(sumAllZrzyDkBinwinNoticeSum));
            }
        }
        if(!ObjectUtils.isEmpty(zrzyBgBidwinNoticeSum)){
            String sumAllzrzyBgBidwinNoticeSum = zrzyBgBidwinNoticeSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllzrzyBgBidwinNoticeSum) && sumAllzrzyBgBidwinNoticeSum != ""){
                noticeSum =  noticeSum.add(new BigDecimal(sumAllzrzyBgBidwinNoticeSum));
            }
        }
        if(!ObjectUtils.isEmpty(zrzyJyzbBidwinNoticeSum)){
            String sumAllzrzyJyzbBidwinNoticeSum = zrzyJyzbBidwinNoticeSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllzrzyJyzbBidwinNoticeSum) && sumAllzrzyJyzbBidwinNoticeSum != ""){
                noticeSum =  noticeSum.add(new BigDecimal(sumAllzrzyJyzbBidwinNoticeSum));
            }
        }
        if(!ObjectUtils.isEmpty(cqSwBargainResultSum)){
            String sumAllcqSwBargainResultSum = cqSwBargainResultSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllcqSwBargainResultSum) && sumAllcqSwBargainResultSum != ""){
                noticeSum =  noticeSum.add(new BigDecimal(sumAllcqSwBargainResultSum));
            }
        }
        if(!ObjectUtils.isEmpty(cqGqBargainResultSum)){
            String sumAllcqGqBargainResultSum = cqGqBargainResultSum.getSumAll();
            if(!ObjectUtils.isEmpty(sumAllcqGqBargainResultSum) && sumAllcqGqBargainResultSum != ""){
                noticeSum =  noticeSum.add(new BigDecimal(sumAllcqGqBargainResultSum));
            }
        }
         /*
        交易额总数
        */
        firstPageData.setTotalTransactionVolume(noticeSum.toString());
        /*
        成交宗数宗量
        */
        firstPageData.setTotalNumberTransactions(
                gcBidpublicityService.count()+
                        zcBidpublicityService.count()+
                        zrzyTdBidwinnoticeService.count()+
                        zrzyTkqBidwinnoticeService.count()+
                        zrzyCkqBidwinnoticeService.count()+
                        zrzyDkBinwinNoticeService.count()+
                        zrzyBgBidwinNoticeService.count()+
                        zrzyJyzbBidwinNoticeService.count()+
                        cqSwBargainResultService.count()+
                        cqGqBargainResultService.count()
        );
        List<CityTradeData> cityTradeDataList = new ArrayList<CityTradeData>();
        //查询盟市列表
        QueryWrapper<TRegion> tRegionQueryWrapper = new QueryWrapper<TRegion>();
        tRegionQueryWrapper.eq("parent_code","150000");
        tRegionQueryWrapper.orderByAsc("order_num");

        List<TRegion> list = tRegionService.list(tRegionQueryWrapper);

        TRegion tRegionzzq = new TRegion();
        tRegionzzq.setName("内蒙古自治区");
        tRegionzzq.setCode("150000");
        tRegionzzq.setCodePram("");
        list.add(tRegionzzq);

        for (TRegion tRegion : list) {
            String code = tRegion.getCode();
            QueryWrapper<AreaPlatform> platformQueryWrapper = new QueryWrapper<AreaPlatform>();
            platformQueryWrapper.likeRight("AREA_CODE",code);
            AreaPlatform areaPlatform = areaPlatformService.getOne(platformQueryWrapper);
            if(!ObjectUtils.isEmpty(areaPlatform)){

                tRegion.setCode(tRegion.getCode().substring(0,4));
                tRegion.setCodePram(areaPlatform.getPlatformCode());
                CityTradeData cityTradeData = new CityTradeData();
                cityTradeData.setCityName(tRegion.getName());
                cityTradeData.setRegionCode(tRegion.getCode());
                cityTradeData.setPlatformCode(areaPlatform.getPlatformCode());
                String regionCode = areaPlatform.getAreaCode().substring(0,4);
                String platformCode = cityTradeData.getPlatformCode();

                Integer totalBusinessTotalDataCity = 0;

                /*QueryWrapper<GcBidpublicity> GcBidpublicityQueryWrapperIn = new QueryWrapper<GcBidpublicity>();
                GcBidpublicityQueryWrapperIn.eq("PLATFORM_CODE",platformCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity + gcBidpublicityService.count(GcBidpublicityQueryWrapperIn);

                QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapperIn = new QueryWrapper<ZcBidpublicity>();
                zcBidpublicityQueryWrapperIn.eq("PLATFORM_CODE",platformCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity + zcBidpublicityService.count(zcBidpublicityQueryWrapperIn);

                QueryWrapper<ZrzyTdBidwinnotice> zrzyTdBidwinnoticeQueryWrapperIn = new QueryWrapper<ZrzyTdBidwinnotice>();
                zrzyTdBidwinnoticeQueryWrapperIn.likeRight("region_code",regionCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyTdBidwinnoticeService.count(zrzyTdBidwinnoticeQueryWrapperIn);

                QueryWrapper<ZrzyTkqBidwinnotice> zrzyTkqBidwinnoticeQueryWrapperIn = new QueryWrapper<ZrzyTkqBidwinnotice>();
                zrzyTkqBidwinnoticeQueryWrapperIn.likeRight("region_code",regionCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyTkqBidwinnoticeService.count(zrzyTkqBidwinnoticeQueryWrapperIn);

                QueryWrapper<ZrzyCkqBidwinnotice> zrzyCkqBidwinnoticeQueryWrapperIn = new QueryWrapper<ZrzyCkqBidwinnotice>();
                zrzyCkqBidwinnoticeQueryWrapperIn.likeRight("region_code",regionCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyCkqBidwinnoticeService.count(zrzyCkqBidwinnoticeQueryWrapperIn);

                QueryWrapper<ZrzyDkBinwinNotice> zrzyDkBinwinNoticeQueryWrapperIn = new QueryWrapper<ZrzyDkBinwinNotice>();
                zrzyDkBinwinNoticeQueryWrapperIn.likeRight("zone",regionCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyDkBinwinNoticeService.count(zrzyDkBinwinNoticeQueryWrapperIn);

                QueryWrapper<ZrzyBgBidwinNotice> zrzyBgBidwinNoticeQueryWrapperIn = new QueryWrapper<ZrzyBgBidwinNotice>();
                zrzyBgBidwinNoticeQueryWrapperIn.eq("PLATFORM_CODE",platformCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyBgBidwinNoticeService.countNoticeByRegionCode(regionCode);

                QueryWrapper<ZrzyJyzbBidwinNotice> zrzyJyzbBidwinNoticeQueryWrapperIn = new QueryWrapper<ZrzyJyzbBidwinNotice>();
                zrzyJyzbBidwinNoticeQueryWrapperIn.eq("PLATFORM_CODE",platformCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyJyzbBidwinNoticeService.countNoticeByRegionCode(regionCode);

                QueryWrapper<CqSwBargainResult> GcBidpublicityQueryWrapperSelfIn = new QueryWrapper<CqSwBargainResult>();
                GcBidpublicityQueryWrapperSelfIn.eq("PLATFORM_CODE",platformCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity +cqSwBargainResultService.countByRegionCode(regionCode);

                QueryWrapper<CqGqBargainResult> cqGqBargainResultWrapperSelfIn = new QueryWrapper<CqGqBargainResult>();
                cqGqBargainResultWrapperSelfIn.likeRight("region_code",regionCode);
                totalBusinessTotalDataCity = totalBusinessTotalDataCity + cqGqBargainResultService.count(cqGqBargainResultWrapperSelfIn);*/

                int total = 0;
                int totalGCJS = 0;
                int totalZFCG = 0;
                int totalZRZY = 0;
                int totalGYCQ = 0;

                try {
                    QueryWrapper<GcPackage> gcProjectQueryWrapper = new QueryWrapper<GcPackage>();
                    gcProjectQueryWrapper.eq("PLATFORM_CODE",platformCode);
                    int countGcProject = gcPackageService.count(gcProjectQueryWrapper);
                    totalGCJS =  totalGCJS + countGcProject;
                    total = total + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*政府采购*/
                try {
                    QueryWrapper<ZcProject> zcPurchaseBulletinQueryWrapper = new QueryWrapper<ZcProject>();
                    zcPurchaseBulletinQueryWrapper.eq("PLATFORM_CODE",platformCode);
                    int countZcPurchaseBulletin = zcProjectService.count(zcPurchaseBulletinQueryWrapper);
                    QueryWrapper<ZfcgGongao> zcPurchaseBulletinQueryWrapperSelf = new QueryWrapper<ZfcgGongao>();
                    zcPurchaseBulletinQueryWrapperSelf.likeRight("REGION_CODE",regionCode).in("NOTICE_TYPE","001011","001012","001013","001014","001015","001016","001019");
                    int countZcPurchaseBulletin2 = zfcgGongaoService.count(zcPurchaseBulletinQueryWrapperSelf);
                    totalZFCG = totalZFCG + countZcPurchaseBulletin +countZcPurchaseBulletin2;
                    total = total + countZcPurchaseBulletin +countZcPurchaseBulletin2;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*土地矿权*/
                /*ZRZY_TD_CEDE_INFO*/
                try {
                    QueryWrapper<ZrzyTdCedeInfo> zrzyTdCedeInfoQueryWrapper = new QueryWrapper<ZrzyTdCedeInfo>();
                    zrzyTdCedeInfoQueryWrapper.likeRight("region_code",regionCode);
                    int countZrzyTdCedeNotice = zrzyTdCedeInfoService.count(zrzyTdCedeInfoQueryWrapper);
                    totalZRZY =   totalZRZY + countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*ZRZY_TKQ_PROJECT_INFO*/
                try {
                    QueryWrapper<ZrzyTkqProjectInfo> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyTkqProjectInfo>();
                    zrzyTkqProjectInfoQueryWrapper.likeRight("region_code",regionCode);
                    int countZrzyTdCedeNotice = zrzyTkqProjectInfoService.count(zrzyTkqProjectInfoQueryWrapper);
                    totalZRZY =   totalZRZY +  countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*ZRZY_CKQ_PROJECT_INFO*/
                try {
                    QueryWrapper<ZrzyCkqProjectInfo> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyCkqProjectInfo>();
                    zrzyTkqProjectInfoQueryWrapper.likeRight("region_code",regionCode);
                    int countZrzyTdCedeNotice = zrzyCkqProjectInfoService.count(zrzyTkqProjectInfoQueryWrapper);
                    totalZRZY =   totalZRZY + countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }
                if(platformCode.equals("121500004600236091")){
                    try {
                        QueryWrapper<ZrzyDkProject> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyDkProject>();
                        int countZrzyTdCedeNotice = zrzyDkProjectService.count(zrzyTkqProjectInfoQueryWrapper);
                        totalZRZY =   totalZRZY + countZrzyTdCedeNotice;
                        total = total + countZrzyTdCedeNotice;
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                }
                /*ZRZY_BG_STOCK_INDEX*/
                try {
                    QueryWrapper<ZrzyBgStockIndex> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyBgStockIndex>();
                    zrzyTkqProjectInfoQueryWrapper.likeRight("zone",regionCode);
                    int countZrzyTdCedeNotice = zrzyBgStockIndexService.count(zrzyTkqProjectInfoQueryWrapper);
                    totalZRZY =   totalZRZY + countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*ZRZY_JYZB_STOCK_INDEX*/
                try {
                    QueryWrapper<ZrzyJyzbStockIndex> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyJyzbStockIndex>();
                    zrzyTkqProjectInfoQueryWrapper.likeRight("zone",regionCode);
                    int countZrzyTdCedeNotice = zrzyJyzbStockIndexService.count(zrzyTkqProjectInfoQueryWrapper);
                    totalZRZY =   totalZRZY + countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }

                /*CQ_GQ_PROJECT*/
                try {
                    QueryWrapper<CqGqProject> cqGqProjectQueryWrapper = new QueryWrapper<CqGqProject>();
                    cqGqProjectQueryWrapper.likeRight("PROJECT_DISTRICT",regionCode);
                    int countZrzyTdCedeNotice = cqGqProjectService.count(cqGqProjectQueryWrapper);
                    totalGYCQ = totalGYCQ + countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*CQ_SW_PROJECT*/
                try {
                    QueryWrapper<CqSwProject> cqGqProjectQueryWrapper = new QueryWrapper<CqSwProject>();
                    cqGqProjectQueryWrapper.eq("zone",regionCode);
                    int countZrzyTdCedeNotice = cqSwProjectService.count(cqGqProjectQueryWrapper);
                    totalGYCQ = totalGYCQ + countZrzyTdCedeNotice;
                    total = total + countZrzyTdCedeNotice;
                }catch (Exception e){
                    e.printStackTrace();
                }
                cityTradeData.setBusinessTotalData(
                        total//进场数据总量
                );

                /*cityTradeData.setBusinessTotalData(
                        totalBusinessTotalDataCity//进场数据总量
                );*/
                if(platformCode.equals("121500004600236091")){
                    QueryWrapper<ZtLegalinfo> ztLegalinfoQueryWrapperIn = new QueryWrapper<ZtLegalinfo>();
                    ztLegalinfoQueryWrapperIn.likeRight("REGION_CODE","15");
                    cityTradeData.setSubTotalData(ztLegalinfoService.count(ztLegalinfoQueryWrapperIn));
                }else{
                    QueryWrapper<ZtLegalinfo> ztLegalinfoQueryWrapperIn = new QueryWrapper<ZtLegalinfo>();
                    ztLegalinfoQueryWrapperIn.likeRight("REGION_CODE",regionCode);
                    cityTradeData.setSubTotalData(ztLegalinfoService.count(ztLegalinfoQueryWrapperIn));
                }


                /*QueryWrapper<ZtLegalinfo> ztLegalinfoQueryWrapperIn = new QueryWrapper<ZtLegalinfo>();
                ztLegalinfoQueryWrapperIn.likeRight("REGION_CODE",regionCode);
                cityTradeData.setSubTotalData(ztLegalinfoService.count(ztLegalinfoQueryWrapperIn));*/

                QueryWrapper<GcBidpublicity> gcBidpublicityQueryWrapperSumInIn = new QueryWrapper<GcBidpublicity>();
                gcBidpublicityQueryWrapperSumInIn.select("sum( case when PRICE_UNIT = 0 then BID_AMOUNT when PRICE_UNIT = 1 then BID_AMOUNT*10000 else BID_AMOUNT end) as sumAll");
                gcBidpublicityQueryWrapperSumInIn.eq("PLATFORM_CODE",platformCode);
                GcBidpublicity gcBidpublicitySumInIn = gcBidpublicityService.getOne(gcBidpublicityQueryWrapperSumInIn);

                QueryWrapper<ZcBidpublicity> bidpublicityQueryWrapperSumInIn = new QueryWrapper<ZcBidpublicity>();
                bidpublicityQueryWrapperSumInIn.select("sum( case when PRICE_UNIT = 0 then WIN_BID_PRICE when PRICE_UNIT = 1 then WIN_BID_PRICE*10000 else WIN_BID_PRICE end) as sumAll");
                bidpublicityQueryWrapperSumInIn.eq("PLATFORM_CODE",platformCode);
                ZcBidpublicity zcBidpublicitySumInIn = zcBidpublicityService.getOne(bidpublicityQueryWrapperSumInIn);

                /*ZRZY_TD_BIDWINNOTICE*/
                QueryWrapper<ZrzyTdBidwinnotice> zrzyTdBidwinnoticeQuerySumInIn = new QueryWrapper<ZrzyTdBidwinnotice>();
                zrzyTdBidwinnoticeQuerySumInIn.select("sum( case when PRICE_UNIT = 0 then DEAL_PRICE when PRICE_UNIT = 1 then DEAL_PRICE*10000 else DEAL_PRICE end) as sumAll");
                zrzyTdBidwinnoticeQuerySumInIn.likeRight("region_code",regionCode);
                ZrzyTdBidwinnotice zrzyTdBidwinnoticeSumInIn = zrzyTdBidwinnoticeService.getOne(zrzyTdBidwinnoticeQuerySumInIn);

                /*ZRZY_TKQ_BIDWINNOTICE*/
                QueryWrapper<ZrzyTkqBidwinnotice> zrzyTdBidwinnoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyTkqBidwinnotice>();
                zrzyTdBidwinnoticeQueryWrapperSumInIn.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
                zrzyTdBidwinnoticeQueryWrapperSumInIn.likeRight("region_code",regionCode);
                ZrzyTkqBidwinnotice zrzyTkqBidwinnoticeSumInIn = zrzyTkqBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapperSumInIn);

                /*ZRZY_CKQ_BIDWINNOTICE*/

                QueryWrapper<ZrzyCkqBidwinnotice> zrzyCkqBidwinnoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyCkqBidwinnotice>();
                zrzyCkqBidwinnoticeQueryWrapperSumInIn.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
                zrzyCkqBidwinnoticeQueryWrapperSumInIn.likeRight("region_code",regionCode);
                ZrzyCkqBidwinnotice zrzyCkqBidwinnoticeSumInIn = zrzyCkqBidwinnoticeService.getOne(zrzyCkqBidwinnoticeQueryWrapperSumInIn);

                /*ZRZY_DK_BINWIN_NOTICE*/
                QueryWrapper<ZrzyDkBinwinNotice> zrzyDkBinwinNoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyDkBinwinNotice>();
                zrzyDkBinwinNoticeQueryWrapperSumInIn.select("sum(cast(ZB_PRICE as decimal(9,2)) * 10000) as sumAll");
                zrzyDkBinwinNoticeQueryWrapperSumInIn.likeRight("zone",regionCode);
                ZrzyDkBinwinNotice zrzyDkBinwinNoticeSumInIn = zrzyDkBinwinNoticeService.getOne(zrzyDkBinwinNoticeQueryWrapperSumInIn);

                /*ZRZY_BG_BIDWIN_NOTICE*/
                ZrzyBgBidwinNotice zrzyBgBidwinNoticeSumInIn = zrzyBgBidwinNoticeService.getSumMoneyByRegionCode(regionCode);

                /*ZRZY_JYZB_BIDWIN_NOTICE*/
                ZrzyJyzbBidwinNotice zrzyJyzbBidwinNoticeSumInIn = zrzyJyzbBidwinNoticeService.getSumMoneyByRegionCode(regionCode);

                /*CQ_SW_BARGAIN_RESULT*/
                CqSwBargainResult cqSwBargainResultSumInIn = cqSwBargainResultService.getSumMoneyByRegionCode(regionCode);

                /*CQ_GQ_BARGAIN_RESULT*/
                QueryWrapper<CqGqBargainResult> cqGqBargainResultQueryWrapperSumInIn = new QueryWrapper<CqGqBargainResult>();
                cqGqBargainResultQueryWrapperSumInIn.select("sum( case when PRICE_UNIT = 0 then TRADE_VALUE when PRICE_UNIT = 1 then TRADE_VALUE*10000 else TRADE_VALUE end) as sumAll");
                cqGqBargainResultQueryWrapperSumInIn.likeRight("region_code",regionCode);
                CqGqBargainResult cqGqBargainResultSumInIn = cqGqBargainResultService.getOne(cqGqBargainResultQueryWrapperSumInIn);


                BigDecimal bigTotal = new BigDecimal(0);
                if(!ObjectUtils.isEmpty(gcBidpublicitySumInIn)){
                    String sumAll = gcBidpublicitySumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zcBidpublicitySumInIn)){
                    String sumAll = zcBidpublicitySumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zrzyTdBidwinnoticeSumInIn)){
                    String sumAll = zrzyTdBidwinnoticeSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zrzyTkqBidwinnoticeSumInIn)){
                    String sumAll = zrzyTkqBidwinnoticeSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zrzyCkqBidwinnoticeSumInIn)){
                    String sumAll = zrzyCkqBidwinnoticeSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zrzyDkBinwinNoticeSumInIn)){
                    String sumAll = zrzyDkBinwinNoticeSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zrzyBgBidwinNoticeSumInIn)){
                    String sumAll = zrzyBgBidwinNoticeSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(zrzyJyzbBidwinNoticeSumInIn)){
                    String sumAll = zrzyJyzbBidwinNoticeSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(cqSwBargainResultSumInIn)){
                    String sumAll = cqSwBargainResultSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                if(!ObjectUtils.isEmpty(cqGqBargainResultSumInIn)){
                    String sumAll = cqGqBargainResultSumInIn.getSumAll();
                    if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                        bigTotal =  bigTotal.add(new BigDecimal(sumAll));
                    }
                }
                int totalTransaction = 0;

                /*GC_BIDPUBLICITY*/
                try {
                    QueryWrapper<GcBidpublicity> gcProjectQueryWrapper = new QueryWrapper<GcBidpublicity>();
                    gcProjectQueryWrapper.eq("PLATFORM_CODE",platformCode);
                    int countGcProject = gcBidpublicityService.count(gcProjectQueryWrapper);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                try {
                    QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapper = new QueryWrapper<ZcBidpublicity>();
                    zcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
                    int countGcProject = zcBidpublicityService.count(zcBidpublicityQueryWrapper);
                    QueryWrapper<ZfcgGongao> zcPurchaseBulletinQueryWrapperSelf = new QueryWrapper<ZfcgGongao>();
                    zcPurchaseBulletinQueryWrapperSelf.likeRight("REGION_CODE",regionCode).in("NOTICE_TYPE","001021","001022","001023","001024","001025","001026","001029");
                    int countGcProject2 = zfcgGongaoService.count(zcPurchaseBulletinQueryWrapperSelf);

                    totalTransaction = totalTransaction + countGcProject +countGcProject2;
                }catch (Exception e){
                    e.printStackTrace();
                }


                /*ZRZY_TD_BIDWINNOTICE*/
                try {
                    QueryWrapper<ZrzyTdBidwinnotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyTdBidwinnotice>();
                    zcBidpublicityQueryWrapper.likeRight("REGION_CODE",regionCode);
                    int countGcProject = zrzyTdBidwinnoticeService.count(zcBidpublicityQueryWrapper);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }

                /*ZRZY_TKQ_BIDWINNOTICE*/
                try {
                    QueryWrapper<ZrzyTkqBidwinnotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyTkqBidwinnotice>();
                    zcBidpublicityQueryWrapper.likeRight("REGION_CODE",regionCode);
                    int countGcProject = zrzyTkqBidwinnoticeService.count(zcBidpublicityQueryWrapper);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*ZRZY_CKQ_BIDWINNOTICE*/
                try {
                    QueryWrapper<ZrzyCkqBidwinnotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyCkqBidwinnotice>();
                    zcBidpublicityQueryWrapper.likeRight("REGION_CODE",regionCode);
                    int countGcProject = zrzyCkqBidwinnoticeService.count(zcBidpublicityQueryWrapper);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*Zrzy_Dk_Binwin_Notice*/
                try {
                    QueryWrapper<ZrzyDkBinwinNotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyDkBinwinNotice>();
                    zcBidpublicityQueryWrapper.likeRight("zone",regionCode);
                    int countGcProject = zrzyDkBinwinNoticeService.count(zcBidpublicityQueryWrapper);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*ZRZY_BG_BIDWIN_NOTICE*/
                try {
                    int countGcProject = zrzyBgBidwinNoticeService.countNoticeByRegionCode(regionCode);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*ZRZY_JYZB_BIDWIN_NOTICE*/
                try {
                    int countGcProject = zrzyJyzbBidwinNoticeService.countNoticeByRegionCode(regionCode);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }

                /*CQ_SW_BARGAIN_RESULT*/
                try {
                    int countGcProject = cqSwBargainResultService.countByRegionCode(regionCode);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                /*CQ_GQ_BARGAIN_RESULT*/
                try {
                    QueryWrapper<CqGqBargainResult> gcProjectQueryWrapper = new QueryWrapper<CqGqBargainResult>();
                    gcProjectQueryWrapper.likeRight("REGION_CODE",regionCode);
                    int countGcProject = cqGqBargainResultService.count(gcProjectQueryWrapper);
                    totalTransaction = totalTransaction + countGcProject;
                }catch (Exception e){
                    e.printStackTrace();
                }
                cityTradeData.setTotalNumberTransactions(totalTransaction);


                cityTradeData.setTotalTransactionVolume(
                        bigTotal.toString()
                );
                /*QueryWrapper<GcBidpublicity> gcBidpublicityQueryWrapperInCount = new QueryWrapper<GcBidpublicity>();
                gcBidpublicityQueryWrapperInCount.eq("PLATFORM_CODE",platformCode);
                int count = gcBidpublicityService.count(gcBidpublicityQueryWrapperInCount);
                if(!ObjectUtils.isEmpty(count)){
                    cityTradeData.setTotalNumberTransactions(count);
                }*/






                // ================== 新增：当年各分类交易额统计 ==================
                // 获取当前年份的开始和结束时间（例如 2026-01-01 00:00:00 到 2026-12-31 23:59:59）
                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
                Calendar cal = Calendar.getInstance();
                cal.set(Calendar.MONTH, Calendar.JANUARY);
                cal.set(Calendar.DAY_OF_MONTH, 1);
                cal.set(Calendar.HOUR_OF_DAY, 0);
                cal.set(Calendar.MINUTE, 0);
                cal.set(Calendar.SECOND, 0);
                cal.set(Calendar.MILLISECOND, 0);
                String yearStart = sdf.format(cal.getTime());
                cal.set(Calendar.MONTH, Calendar.DECEMBER);
                cal.set(Calendar.DAY_OF_MONTH, 31);
                cal.set(Calendar.HOUR_OF_DAY, 23);
                cal.set(Calendar.MINUTE, 59);
                cal.set(Calendar.SECOND, 59);
                String yearEnd = sdf.format(cal.getTime());

                // 1. 政府采购交易额（当年）
                QueryWrapper<ZcBidpublicity> zcYearQuery = new QueryWrapper<>();
                zcYearQuery.select("sum(case when PRICE_UNIT = 0 then WIN_BID_PRICE when PRICE_UNIT = 1 then WIN_BID_PRICE*10000 else WIN_BID_PRICE end) as sumAll");
//                zcYearQuery.eq("PLATFORM_CODE", platformCode);
                zcYearQuery.likeRight("region_code",regionCode);
                zcYearQuery.ge("WIN_BID_BULLETIN_START_TIME", yearStart);
                zcYearQuery.le("WIN_BID_BULLETIN_START_TIME", yearEnd);
                ZcBidpublicity zcYearSum = zcBidpublicityService.getOne(zcYearQuery);
                String zcYearAmount = "0";
                if (!ObjectUtils.isEmpty(zcYearSum) && !ObjectUtils.isEmpty(zcYearSum.getSumAll())) {
                    zcYearAmount = zcYearSum.getSumAll();
                }
                cityTradeData.setZcTransactionVolume(zcYearAmount);

                // 2. 自然资源交易额（当年）
                BigDecimal zrzyYearAmount = BigDecimal.ZERO;
                // ZRZY_TD_BIDWINNOTICE
                QueryWrapper<ZrzyTdBidwinnotice> tdYearQuery = new QueryWrapper<>();
                tdYearQuery.select("sum(case when PRICE_UNIT = 0 then DEAL_PRICE when PRICE_UNIT = 1 then DEAL_PRICE*10000 else DEAL_PRICE end) as sumAll");
//                tdYearQuery.eq("PLATFORM_CODE", platformCode);
                tdYearQuery.likeRight("region_code",regionCode);
                tdYearQuery.ge("PUBLISHING_TIME", yearStart);
                tdYearQuery.le("PUBLISHING_TIME", yearEnd);
                ZrzyTdBidwinnotice tdYearSum = zrzyTdBidwinnoticeService.getOne(tdYearQuery);
                if (!ObjectUtils.isEmpty(tdYearSum) && !ObjectUtils.isEmpty(tdYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(tdYearSum.getSumAll()));
                }
                // ZRZY_TKQ_BIDWINNOTICE
                QueryWrapper<ZrzyTkqBidwinnotice> tkqYearQuery = new QueryWrapper<>();
                tkqYearQuery.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
//                tkqYearQuery.eq("PLATFORM_CODE", platformCode);

                tkqYearQuery.likeRight("region_code", regionCode);
                tkqYearQuery.ge("PUBLISHING_TIME", yearStart);
                tkqYearQuery.le("PUBLISHING_TIME", yearEnd);
                ZrzyTkqBidwinnotice tkqYearSum = zrzyTkqBidwinnoticeService.getOne(tkqYearQuery);
                if (!ObjectUtils.isEmpty(tkqYearSum) && !ObjectUtils.isEmpty(tkqYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(tkqYearSum.getSumAll()));
                }
                // ZRZY_CKQ_BIDWINNOTICE
                QueryWrapper<ZrzyCkqBidwinnotice> ckqYearQuery = new QueryWrapper<>();
                ckqYearQuery.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
//                ckqYearQuery.eq("PLATFORM_CODE", platformCode);

                ckqYearQuery.likeRight("region_code", regionCode);
                ckqYearQuery.ge("PUBLISHING_TIME", yearStart);
                ckqYearQuery.le("PUBLISHING_TIME", yearEnd);
                ZrzyCkqBidwinnotice ckqYearSum = zrzyCkqBidwinnoticeService.getOne(ckqYearQuery);
                if (!ObjectUtils.isEmpty(ckqYearSum) && !ObjectUtils.isEmpty(ckqYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(ckqYearSum.getSumAll()));
                }
                // ZRZY_DK_BINWIN_NOTICE
                QueryWrapper<ZrzyDkBinwinNotice> dkYearQuery = new QueryWrapper<>();
                dkYearQuery.select("sum(cast(ZB_PRICE as decimal(9,2)) * 10000) as sumAll");
//                dkYearQuery.eq("PLATFORM_CODE", platformCode);

                dkYearQuery.likeRight("zone", regionCode);
                dkYearQuery.ge("SUBMITS_TIME", yearStart);
                dkYearQuery.le("SUBMITS_TIME", yearEnd);
                ZrzyDkBinwinNotice dkYearSum = zrzyDkBinwinNoticeService.getOne(dkYearQuery);
                if (!ObjectUtils.isEmpty(dkYearSum) && !ObjectUtils.isEmpty(dkYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(dkYearSum.getSumAll()));
                }


                // ZRZY_BG_BIDWIN_NOTICE
                /*QueryWrapper<ZrzyBgBidwinNotice> bgYearQuery = new QueryWrapper<>();
                bgYearQuery.select("sum(cast(WIN_BID_PRICE as decimal(9,2)) * 10000) as sumAll");
//                bgYearQuery.likeRight("zone", regionCode);//mi
                bgYearQuery.eq("PLATFORM_CODE", platformCode);

                bgYearQuery.ge("ISSUE_TIME", yearStart);
                bgYearQuery.le("ISSUE_TIME", yearEnd);
                ZrzyBgBidwinNotice bgYearSum = zrzyBgBidwinNoticeService.getOne(bgYearQuery);
                if (!ObjectUtils.isEmpty(bgYearSum) && !ObjectUtils.isEmpty(bgYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(bgYearSum.getSumAll()));
                }*/

                ZrzyBgBidwinNotice bgYearSum = zrzyBgBidwinNoticeService.getSumMoneyByRegionCode2(regionCode,yearStart,yearEnd);
                if (!ObjectUtils.isEmpty(bgYearSum) && !ObjectUtils.isEmpty(bgYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(bgYearSum.getSumAll()));
                }


                // ZRZY_JYZB_BIDWIN_NOTICE
                QueryWrapper<ZrzyJyzbBidwinNotice> jyzbYearQuery = new QueryWrapper<>();
                jyzbYearQuery.select("sum(WIN_BID_PRICE) as sumAll");
//                jyzbYearQuery.likeRight("zone", regionCode);
//                jyzbYearQuery.eq("PLATFORM_CODE", platformCode);
                if("121500004600236091".equals(platformCode)){
                    jyzbYearQuery.eq("SOURCE_DATA_CODE", "2070");
                }else{
                    jyzbYearQuery.eq("SOURCE_DATA_CODE", "20700000");//只有自治区有
                }
                jyzbYearQuery.ge("ISSUE_TIME", yearStart);
                jyzbYearQuery.le("ISSUE_TIME", yearEnd);
                ZrzyJyzbBidwinNotice jyzbYearSum = zrzyJyzbBidwinNoticeService.getOne(jyzbYearQuery);
                if (!ObjectUtils.isEmpty(jyzbYearSum) && !ObjectUtils.isEmpty(jyzbYearSum.getSumAll())) {
                    zrzyYearAmount = zrzyYearAmount.add(new BigDecimal(jyzbYearSum.getSumAll()));
                }
                cityTradeData.setZrzyTransactionVolume(zrzyYearAmount.toString());

                // 3. 工程建设交易额（当年）
                QueryWrapper<GcBidpublicity> gcYearQuery = new QueryWrapper<>();
                gcYearQuery.select("sum(case when PRICE_UNIT = 0 then BID_AMOUNT when PRICE_UNIT = 1 then BID_AMOUNT*10000 else BID_AMOUNT end) as sumAll");
                if("152901".equals(platformCode)){
                    gcYearQuery.in("PLATFORM_CODE", "152901", "12152900085184725H");
                }else{
                    gcYearQuery.eq("PLATFORM_CODE", platformCode);
                }
                gcYearQuery.ge("NOTICE_SEND_TIME", yearStart);
                gcYearQuery.le("NOTICE_SEND_TIME", yearEnd);
                GcBidpublicity gcYearSum = gcBidpublicityService.getOne(gcYearQuery);
                String gcYearAmount = "0";
                if (!ObjectUtils.isEmpty(gcYearSum) && !ObjectUtils.isEmpty(gcYearSum.getSumAll())) {
                    gcYearAmount = gcYearSum.getSumAll();
                }
                cityTradeData.setGcTransactionVolume(gcYearAmount);

                // ================== 新增结束 ==================



                cityTradeDataList.add(cityTradeData);
            }
        }
        firstPageData.setCityTradeDataList(cityTradeDataList);
        firstPageData.setSubDataStatistics(subDataStatistics);
        firstPageData.setBusinessDataStatistics(businessDataStatistics);
        firstPageData.setDataStatistics(dataStatistics);
        redisUtil.set(CommonConstant.LIST_TOTAL, JSONObject.toJSONString(firstPageData),CommonConstant.REDIS_SAVE_TIME);
        return Result.OK(firstPageData);
    }

    @GetMapping(value = "/quantityStatisticsDayList")
    public Result<QuantityStatisticsAll> getQuantityStatisticsDayList(){
        QuantityStatisticsAll quantityStatisticsAll = null;
        Object quantityStatisticsAllObj = redisUtil.get(CommonConstant.STATISTICS_DAY);
        if(!ObjectUtils.isEmpty(quantityStatisticsAllObj)){
            quantityStatisticsAll = JSONObject.parseObject(quantityStatisticsAllObj.toString(),QuantityStatisticsAll.class);
            return Result.OK(quantityStatisticsAll);
        }else{
            quantityStatisticsAll = new QuantityStatisticsAll();
        }
        Date startTimeOfCurrentDay = DateUtils.getStartTimeOfCurrentDay(new Date());
        Date endTimeOfCurrentDay = DateUtils.getEndTimeOfCurrentDay(new Date());

        ProjectAdmission projectAdmission = new ProjectAdmission();
        projectAdmission.setTotal(getGcProjectTotal(startTimeOfCurrentDay,endTimeOfCurrentDay));
        projectAdmission.setTitle("项目入场");
        quantityStatisticsAll.setProjectAdmission(projectAdmission);

        BidOpeningTimes bidOpeningTimes = new BidOpeningTimes();
        bidOpeningTimes.setTitle("开标场次");
        bidOpeningTimes.setTotal(getFieldApplyByTime(startTimeOfCurrentDay,endTimeOfCurrentDay));
        quantityStatisticsAll.setBidOpeningTimes(bidOpeningTimes);

        NumberOfTransactions numberOfTransactions = new NumberOfTransactions();
        numberOfTransactions.setTitle("成交宗数");
        numberOfTransactions.setTotal(getGcBidpublicityTotal(startTimeOfCurrentDay,endTimeOfCurrentDay));
        quantityStatisticsAll.setNumberOfTransactions(numberOfTransactions);

        AnnouncementRelease announcementRelease = new AnnouncementRelease();
        announcementRelease.setTitle("公告发布");
        announcementRelease.setTotal(getGcNoticeandfileTotalByNoticeSendTime(startTimeOfCurrentDay,endTimeOfCurrentDay));
        quantityStatisticsAll.setAnnouncementRelease(announcementRelease);

        redisUtil.set(CommonConstant.STATISTICS_DAY, JSONObject.toJSONString(quantityStatisticsAll),CommonConstant.REDIS_SAVE_TIME_TEN_MINUTES);
        return Result.OK(quantityStatisticsAll);
    }

    @GetMapping(value = "/quantityStatisticsMoonList")
    public Result<QuantityStatisticsAll> getQuantityStatisticsMoonList(){

        QuantityStatisticsAll quantityStatisticsAll =  null;
        Object quantityStatisticsAllObj = redisUtil.get(CommonConstant.STATISTICS_MOON);
        if(!ObjectUtils.isEmpty(quantityStatisticsAllObj)){
            quantityStatisticsAll = JSONObject.parseObject(quantityStatisticsAllObj.toString(),QuantityStatisticsAll.class);
            return Result.OK(quantityStatisticsAll);
        }else{
            quantityStatisticsAll = new QuantityStatisticsAll();
        }
        Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(new Date());
        Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(new Date());

        ProjectAdmission projectAdmission = new ProjectAdmission();
        projectAdmission.setTotal(getGcProjectTotal(startTimeOfCurrentMonth,endTimeOfCurrentMonth));
        projectAdmission.setTitle("项目入场");
        quantityStatisticsAll.setProjectAdmission(projectAdmission);

        BidOpeningTimes bidOpeningTimes = new BidOpeningTimes();
        bidOpeningTimes.setTitle("开标场次");
        bidOpeningTimes.setTotal(getFieldApplyByTime(startTimeOfCurrentMonth,endTimeOfCurrentMonth));
        quantityStatisticsAll.setBidOpeningTimes(bidOpeningTimes);

        NumberOfTransactions numberOfTransactions = new NumberOfTransactions();
        numberOfTransactions.setTitle("成交宗数");
        numberOfTransactions.setTotal(getGcBidpublicityTotal(startTimeOfCurrentMonth,endTimeOfCurrentMonth));
        quantityStatisticsAll.setNumberOfTransactions(numberOfTransactions);

        AnnouncementRelease announcementRelease = new AnnouncementRelease();
        announcementRelease.setTitle("公告发布");
        announcementRelease.setTotal(getGcNoticeandfileTotalByNoticeSendTime(startTimeOfCurrentMonth,endTimeOfCurrentMonth));
        quantityStatisticsAll.setAnnouncementRelease(announcementRelease);

        redisUtil.set(CommonConstant.STATISTICS_MOON, JSONObject.toJSONString(quantityStatisticsAll),CommonConstant.REDIS_SAVE_TIME_TEN_MINUTES);
        return Result.OK(quantityStatisticsAll);
    }

    @GetMapping(value = "/quantityStatisticsYearList")
    public Result<QuantityStatisticsAll> getQuantityStatisticsYearList(){
        QuantityStatisticsAll quantityStatisticsAll = new QuantityStatisticsAll();
        Object quantityStatisticsAllObj = redisUtil.get(CommonConstant.STATISTICS_YEAR);
        if(!ObjectUtils.isEmpty(quantityStatisticsAllObj)){
            quantityStatisticsAll = JSONObject.parseObject(quantityStatisticsAllObj.toString(),QuantityStatisticsAll.class);
            return Result.OK(quantityStatisticsAll);
        }else{
            quantityStatisticsAll = new QuantityStatisticsAll();
        }
        Date startTimeOfCurrentYear = DateUtils.getStartTimeOfCurrentYear(new Date());
        Date endTimeOfCurrentYear = DateUtils.getEndTimeOfCurrentYear(new Date());

        ProjectAdmission projectAdmission = new ProjectAdmission();
        projectAdmission.setTotal(getGcProjectTotal(startTimeOfCurrentYear,endTimeOfCurrentYear));
        projectAdmission.setTitle("项目入场");
        quantityStatisticsAll.setProjectAdmission(projectAdmission);

        BidOpeningTimes bidOpeningTimes = new BidOpeningTimes();
        bidOpeningTimes.setTitle("开标场次");
        bidOpeningTimes.setTotal(getFieldApplyByTime(startTimeOfCurrentYear,endTimeOfCurrentYear));
        quantityStatisticsAll.setBidOpeningTimes(bidOpeningTimes);

        NumberOfTransactions numberOfTransactions = new NumberOfTransactions();
        numberOfTransactions.setTitle("成交宗数");
        numberOfTransactions.setTotal(getGcBidpublicityTotal(startTimeOfCurrentYear,endTimeOfCurrentYear));
        quantityStatisticsAll.setNumberOfTransactions(numberOfTransactions);

        AnnouncementRelease announcementRelease = new AnnouncementRelease();
        announcementRelease.setTitle("公告发布");
        announcementRelease.setTotal(getGcNoticeandfileTotalByNoticeSendTime(startTimeOfCurrentYear,endTimeOfCurrentYear));
        quantityStatisticsAll.setAnnouncementRelease(announcementRelease);

        redisUtil.set(CommonConstant.STATISTICS_YEAR, JSONObject.toJSONString(quantityStatisticsAll),CommonConstant.REDIS_SAVE_TIME_TEN_MINUTES);
        return Result.OK(quantityStatisticsAll);

    }

    /*数据中心-公告发布数量*/
    @GetMapping(value = "/publishingCategoryData")
    public  Result<CategoryData> publishingCategoryData(
            @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode,
            @RequestParam("startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate stratDate,
            @RequestParam("endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate
    ) throws ParseException {
        try {
            String startTime = stratDate.toString()+" 00:00:00";
            String endTime = endDate.toString()+" 23:59:59";
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
            Date dateStart = sdf.parse(startTime); // 将字符串转换为日期
            Date dateEnd = sdf.parse(endTime); // 将字符串转换为日期
            AreaPlatform areaPlatform = null;
            //获取区域编码对应的国标编码
            try {
                QueryWrapper<AreaPlatform> platformQueryWrapper = new QueryWrapper<AreaPlatform>();
                platformQueryWrapper.eq("PLATFORM_CODE",platformCode);
                areaPlatform = areaPlatformService.getOne(platformQueryWrapper);
                if(ObjectUtils.isEmpty(areaPlatform)){
                    return Result.error("传入参数错误");
                }
            }catch (Exception e){
                e.printStackTrace();
                return Result.error("传入参数错误");
            }
            String areaCode = areaPlatform.getAreaCode();
            String formatStartTime = simpleDateFormat.format(dateStart);
            String formatDateEnd = simpleDateFormat.format(dateEnd);
            log.info("开始时间格式转换："+formatStartTime);
            log.info("结束时间格式转换："+formatDateEnd);
            log.info("区域编码："+platformCode);
            try {
                areaCode = areaCode.substring(0,4);
                log.info("区域国标编码："+areaCode);
            }catch (Exception e){
                e.printStackTrace();
                areaCode = "";
                log.info("区域国标编码："+areaCode);
            }

            String regionCode = areaCode;
            CategoryData categoryData = new CategoryData();
            CategoryDataGc categoryDataGc = new CategoryDataGc();
            /*
            * 工程建设-开始
            * */
            QueryWrapper<GcNoticeandfile> gcNoticeandfileQueryWrapper = new QueryWrapper<GcNoticeandfile>();
            gcNoticeandfileQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
            gcNoticeandfileQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
            int countGcNoticeandfile = gcNoticeandfileService.count(gcNoticeandfileQueryWrapper);
            QueryWrapper<GcNoticeandfile> gcNoticeandfileQueryWrapperPlatformCode = new QueryWrapper<GcNoticeandfile>();
            gcNoticeandfileQueryWrapperPlatformCode.eq("PLATFORM_CODE",platformCode);
            gcNoticeandfileQueryWrapperPlatformCode.gt("NOTICE_SEND_TIME",formatStartTime);
            gcNoticeandfileQueryWrapperPlatformCode.le("NOTICE_SEND_TIME",formatDateEnd);
            int countGcNoticeandfileSelf = gcNoticeandfileService.count(gcNoticeandfileQueryWrapperPlatformCode);
            categoryDataGc.setTotalAssemble(countGcNoticeandfile);
            categoryDataGc.setTotalSelf(countGcNoticeandfileSelf);
            categoryData.setCategoryDataGc(categoryDataGc);
            /*
             * 工程建设-结束
             */
            /*
            * 政府采购-开始
            */
            CategoryDataZf categoryDataZf = new CategoryDataZf();

/*            QueryWrapper<ZcProject> zcPurchaseBulletinQueryWrapper = new QueryWrapper<ZcProject>();
            zcPurchaseBulletinQueryWrapper.gt("CREATE_TIME",formatStartTime);
            zcPurchaseBulletinQueryWrapper.le("CREATE_TIME",formatDateEnd);
            int countZcPurchaseBulletin = zcProjectService.count(zcPurchaseBulletinQueryWrapper);

            QueryWrapper<ZcProject> zcPurchaseBulletinQueryWrapperSelf = new QueryWrapper<ZcProject>();
            zcPurchaseBulletinQueryWrapperSelf.gt("CREATE_TIME",formatStartTime);
            zcPurchaseBulletinQueryWrapperSelf.le("CREATE_TIME",formatDateEnd);
            zcPurchaseBulletinQueryWrapperSelf.eq("PLATFORM_CODE",platformCode);
            int countZcPurchaseBulletinSelf = zcProjectService.count(zcPurchaseBulletinQueryWrapperSelf);*/

            QueryWrapper<ZfcgGongao> zcPurchaseBulletinQueryWrapper = new QueryWrapper<ZfcgGongao>();
            zcPurchaseBulletinQueryWrapper.gt("NOTICE_TIME",dateStart.getTime());
            zcPurchaseBulletinQueryWrapper.le("NOTICE_TIME",dateEnd.getTime());
            zcPurchaseBulletinQueryWrapper.in("NOTICE_TYPE","001011","001012","001013","001014","001015","001016","001019");
            int countZcPurchaseBulletin = zfcgGongaoService.count(zcPurchaseBulletinQueryWrapper);

            QueryWrapper<ZfcgGongao> zcPurchaseBulletinQueryWrapperSelf = new QueryWrapper<ZfcgGongao>();
            zcPurchaseBulletinQueryWrapperSelf.gt("NOTICE_TIME",dateStart.getTime());
            zcPurchaseBulletinQueryWrapperSelf.le("NOTICE_TIME",dateEnd.getTime());
            zcPurchaseBulletinQueryWrapperSelf.in("NOTICE_TYPE","001011","001012","001013","001014","001015","001016","001019");
            zcPurchaseBulletinQueryWrapperSelf.likeRight("REGION_CODE",regionCode);
            int countZcPurchaseBulletinSelf = zfcgGongaoService.count(zcPurchaseBulletinQueryWrapperSelf);

            categoryDataZf.setTotalAssemble(countZcPurchaseBulletin);
            categoryDataZf.setTotalSelf(countZcPurchaseBulletinSelf);
            categoryData.setCategoryDataZf(categoryDataZf);
            /*
             * 政府采购-结束
             */
            /*
             * 土地矿权-开始
             */
            CategoryDataTd categoryDataTd= new CategoryDataTd();
            QueryWrapper<ZrzyTdCedeNotice> zrzyTdCedeNoticeQueryWrapper = new QueryWrapper<ZrzyTdCedeNotice>();
            zrzyTdCedeNoticeQueryWrapper.gt("PUBLISHING_TIME",formatStartTime);
            zrzyTdCedeNoticeQueryWrapper.le("PUBLISHING_TIME",formatDateEnd);
            int countZrzyTdCedeNotice = zrzyTdCedeNoticeService.count(zrzyTdCedeNoticeQueryWrapper);

            try {
                /*Zrzy_Tkq_Notice*/
                QueryWrapper<ZrzyTkqNotice> zrzyTkqNoticeQueryWrapper = new QueryWrapper<ZrzyTkqNotice>();
                zrzyTkqNoticeQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
                zrzyTkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
                int countZrzyTkqNotice = zrzyTkqNoticeService.count(zrzyTkqNoticeQueryWrapper);
                countZrzyTdCedeNotice = countZrzyTdCedeNotice + countZrzyTkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_CKQ_NOTICE*/
                QueryWrapper<ZrzyCkqNotice> zrzyCkqNoticeQueryWrapper = new QueryWrapper<ZrzyCkqNotice>();
                zrzyCkqNoticeQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
                zrzyCkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
                int countZrzyCkqNotice = zrzyCkqNoticeService.count(zrzyCkqNoticeQueryWrapper);
                countZrzyTdCedeNotice = countZrzyTdCedeNotice + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_DK_NOTICE*/
                QueryWrapper<ZrzyDkNotice> zrzyDkNoticeQueryWrapper = new QueryWrapper<ZrzyDkNotice>();
                zrzyDkNoticeQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
                zrzyDkNoticeQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
                int countZrzyCkqNotice = zrzyDkNoticeService.count(zrzyDkNoticeQueryWrapper);
                countZrzyTdCedeNotice = countZrzyTdCedeNotice + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {

                /*ZRZY_BG_NOTICE*/
                QueryWrapper<ZrzyBgNotice> zrzyBgNoticeQueryWrapper = new QueryWrapper<ZrzyBgNotice>();
                zrzyBgNoticeQueryWrapper.gt("ISSUE_TIME",formatStartTime);
                zrzyBgNoticeQueryWrapper.le("ISSUE_TIME",formatDateEnd);
                int countZrzyCkqNotice = zrzyBgNoticeService.count(zrzyBgNoticeQueryWrapper);
                countZrzyTdCedeNotice = countZrzyTdCedeNotice + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_JYZB_NOTICE*/
                QueryWrapper<ZrzyJyzbNotice> zrzyJyzbNoticeQueryWrapper = new QueryWrapper<ZrzyJyzbNotice>();
                zrzyJyzbNoticeQueryWrapper.gt("ISSUE_TIME",formatStartTime);
                zrzyJyzbNoticeQueryWrapper.le("ISSUE_TIME",formatDateEnd);
                int countZrzyCkqNotice = zrzyJyzbNoticeService.count(zrzyJyzbNoticeQueryWrapper);
                countZrzyTdCedeNotice = countZrzyTdCedeNotice + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }

            QueryWrapper<ZrzyTdCedeNotice> zrzyTdCedeNoticeQueryWrapperSelf = new QueryWrapper<ZrzyTdCedeNotice>();
            zrzyTdCedeNoticeQueryWrapperSelf.gt("PUBLISHING_TIME",formatStartTime);
            zrzyTdCedeNoticeQueryWrapperSelf.le("PUBLISHING_TIME",formatDateEnd);
            zrzyTdCedeNoticeQueryWrapperSelf.likeRight("LAND_DISTRICT",regionCode);
            int countZrzyTdCedeNoticeSelf = zrzyTdCedeNoticeService.count(zrzyTdCedeNoticeQueryWrapperSelf);
            try {
                /*Zrzy_Tkq_Notice*/
                QueryWrapper<ZrzyTkqNotice> zrzyTkqNoticeQueryWrapper = new QueryWrapper<ZrzyTkqNotice>();
                zrzyTkqNoticeQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
                zrzyTkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
                zrzyTkqNoticeQueryWrapper.likeRight("region_code",regionCode);
                int countZrzyTkqNotice = zrzyTkqNoticeService.count(zrzyTkqNoticeQueryWrapper);
                countZrzyTdCedeNoticeSelf = countZrzyTdCedeNoticeSelf + countZrzyTkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_CKQ_NOTICE*/
                QueryWrapper<ZrzyCkqNotice> zrzyCkqNoticeQueryWrapper = new QueryWrapper<ZrzyCkqNotice>();
                zrzyCkqNoticeQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
                zrzyCkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
                zrzyCkqNoticeQueryWrapper.likeRight("region_code",regionCode);
                int countZrzyCkqNotice = zrzyCkqNoticeService.count(zrzyCkqNoticeQueryWrapper);
                countZrzyTdCedeNoticeSelf = countZrzyTdCedeNoticeSelf + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_DK_NOTICE*/
                QueryWrapper<ZrzyDkNotice> zrzyDkNoticeQueryWrapper = new QueryWrapper<ZrzyDkNotice>();
                zrzyDkNoticeQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime);
                zrzyDkNoticeQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd);
                zrzyDkNoticeQueryWrapper.likeRight("zone",regionCode);
                int countZrzyCkqNotice = zrzyDkNoticeService.count(zrzyDkNoticeQueryWrapper);
                countZrzyTdCedeNoticeSelf = countZrzyTdCedeNoticeSelf + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_BG_NOTICE*/
                QueryWrapper<ZrzyBgNotice> zrzyBgNoticeQueryWrapper = new QueryWrapper<ZrzyBgNotice>();
                zrzyBgNoticeQueryWrapper.gt("ISSUE_TIME",formatStartTime);
                zrzyBgNoticeQueryWrapper.le("ISSUE_TIME",formatDateEnd);
                zrzyBgNoticeQueryWrapper.likeRight("zone",regionCode);
                int countZrzyCkqNotice = zrzyBgNoticeService.count(zrzyBgNoticeQueryWrapper);
                countZrzyTdCedeNoticeSelf = countZrzyTdCedeNoticeSelf + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }
            try {
                /*ZRZY_JYZB_NOTICE*/
                QueryWrapper<ZrzyJyzbNotice> zrzyJyzbNoticeQueryWrapper = new QueryWrapper<ZrzyJyzbNotice>();
                zrzyJyzbNoticeQueryWrapper.gt("ISSUE_TIME",formatStartTime);
                zrzyJyzbNoticeQueryWrapper.le("ISSUE_TIME",formatDateEnd);
                zrzyJyzbNoticeQueryWrapper.likeRight("zone",regionCode);
                int countZrzyCkqNotice = zrzyJyzbNoticeService.count(zrzyJyzbNoticeQueryWrapper);
                countZrzyTdCedeNoticeSelf = countZrzyTdCedeNoticeSelf + countZrzyCkqNotice;
            }catch (Exception e){
                e.printStackTrace();
            }

            categoryDataTd.setTotalAssemble(countZrzyTdCedeNotice);
            categoryDataTd.setTotalSelf(countZrzyTdCedeNoticeSelf);
            categoryData.setCategoryDataTd(categoryDataTd);

            /*
             * 土地矿权-结束
             * */
            /*
             * 国有资产-开始
             * */
            CategoryDataGy categoryDataGy = new CategoryDataGy();
            QueryWrapper<CqSwIssueBulletin> cqSwIssueBulletinQueryWrapper = new QueryWrapper<CqSwIssueBulletin>();
            cqSwIssueBulletinQueryWrapper.gt("PUBLISH_DATE",formatStartTime.substring(0,8));
            cqSwIssueBulletinQueryWrapper.le("PUBLISH_DATE",formatDateEnd.substring(0,8));
            int countSwIssueBulletin = cqSwIssueBulletinService.count(cqSwIssueBulletinQueryWrapper);

            QueryWrapper<CqSwIssueBulletin> cqSwIssueBulletinQueryWrapperSelf = new QueryWrapper<CqSwIssueBulletin>();
            cqSwIssueBulletinQueryWrapperSelf.gt("PUBLISH_DATE",formatStartTime.substring(0,8));
            cqSwIssueBulletinQueryWrapperSelf.le("PUBLISH_DATE",formatDateEnd.substring(0,8));
            cqSwIssueBulletinQueryWrapperSelf.likeRight("region_code",regionCode);
            int countSwIssueBulletinSelf = cqSwIssueBulletinService.count(cqSwIssueBulletinQueryWrapperSelf);

            QueryWrapper<CqGqIssueBulletin> cqGqIssueBulletinQueryWrapper = new QueryWrapper<CqGqIssueBulletin>();
            cqGqIssueBulletinQueryWrapper.gt("PUBLISH_DATE",formatStartTime.substring(0,8));
            cqGqIssueBulletinQueryWrapper.le("PUBLISH_DATE",formatDateEnd.substring(0,8));
            int countSwIssueBulletGQin = cqGqIssueBulletinService.count(cqGqIssueBulletinQueryWrapper);

            QueryWrapper<CqGqIssueBulletin> cqGqIssueBulletinQueryWrapperSelf = new QueryWrapper<CqGqIssueBulletin>();
            cqGqIssueBulletinQueryWrapperSelf.gt("PUBLISH_DATE",formatStartTime.substring(0,8));
            cqGqIssueBulletinQueryWrapperSelf.le("PUBLISH_DATE",formatDateEnd.substring(0,8));
            cqGqIssueBulletinQueryWrapperSelf.likeRight("region_code",regionCode);
            int countSwIssueBulletGQinSelf = cqGqIssueBulletinService.count(cqGqIssueBulletinQueryWrapper);

            categoryDataGy.setTotalAssemble(countSwIssueBulletin+countSwIssueBulletGQin);
            categoryDataGy.setTotalSelf(countSwIssueBulletinSelf+countSwIssueBulletGQinSelf);
            categoryData.setCategoryDataGy(categoryDataGy);
            /*
             * 国有资产-结束
             * */
            /*
             * 疫苗交易-开始
             * */
            CategoryDataYm categoryDataYm = new CategoryDataYm();
            categoryData.setCategoryDataYm(categoryDataYm);
            /*
             * 疫苗交易-结束
             * */

            /*
            药采交易-开始
            * */
           int countYc = ycNoticeService.count();
            CategoryDataYc categoryDataYc = new CategoryDataYc();
            categoryDataYc.setTotalAssemble(countYc);
            categoryData.setCategoryDataYc(categoryDataYc);

             /*
            药采交易-结束
            * */

            /*
             * 其他交易-开始
             * */
            CategoryDataQt categoryDataQt = new CategoryDataQt();
            QueryWrapper<QtjyNotice> categoryDataQtQueryWrapper = new QueryWrapper<QtjyNotice>();
            categoryDataQtQueryWrapper.gt("PUBLISHING_TIME",formatStartTime);
            categoryDataQtQueryWrapper.le("PUBLISHING_TIME",formatDateEnd);
            int countQtjyNotice = qtjyNoticeService.count(categoryDataQtQueryWrapper);

            QueryWrapper<OtherTradePubInfo> otherTradePubInfoQueryWrapper = new QueryWrapper<OtherTradePubInfo>();
            otherTradePubInfoQueryWrapper.ge("PUBLISHING_TIME",formatStartTime);
            otherTradePubInfoQueryWrapper.le("PUBLISHING_TIME",formatDateEnd);
            int countOtherTrade = otherTradePubInfoService.count(otherTradePubInfoQueryWrapper);

            QueryWrapper<QtjyNotice> categoryDataQtQueryWrapperSelf = new QueryWrapper<QtjyNotice>();
            categoryDataQtQueryWrapperSelf.gt("PUBLISHING_TIME",formatStartTime);
            categoryDataQtQueryWrapperSelf.le("PUBLISHING_TIME",formatDateEnd);
            categoryDataQtQueryWrapperSelf.likeRight("region_code",regionCode);

            QueryWrapper<OtherTradePubInfo> otherTradePubInfoQueryWrapperSelf = new QueryWrapper<OtherTradePubInfo>();
            otherTradePubInfoQueryWrapperSelf.ge("PUBLISHING_TIME",formatStartTime);
            otherTradePubInfoQueryWrapperSelf.le("PUBLISHING_TIME",formatDateEnd);
            otherTradePubInfoQueryWrapperSelf.likeRight("region_code",regionCode);
            int countotherTradeSelf = otherTradePubInfoService.count(otherTradePubInfoQueryWrapperSelf);

            int countQtjyNoticeSelf = qtjyNoticeService.count(categoryDataQtQueryWrapperSelf);
            categoryDataQt.setTotalAssemble(countQtjyNotice+countOtherTrade);
            categoryDataQt.setTotalSelf(countQtjyNoticeSelf+countotherTradeSelf);
            /*categoryData.setCategoryDataQt(categoryDataQt);*/
            /*
             * 其他交易-结束
             * */
            return Result.OK(categoryData);
        }catch (Exception e){
            e.printStackTrace();
            return Result.error("传入参数错误");
        }
    }

    //各交易类别发布类别数据:交易宗数
    @GetMapping(value = "/publishingCategoryDataList")
    public  Result<List<QuantityStatisticsAssemble>> publishingCategoryDataList(
            @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode

    ) throws ParseException {
        List<QuantityStatisticsAssemble> statisticsAssembles = null;
        Object firstPageDataObj = redisUtil.get(CommonConstant.PUBLISHING_CATEGORY_DATA_LIST+platformCode);
        if(!ObjectUtils.isEmpty(firstPageDataObj)){
            statisticsAssembles = JSONArray.parseArray(firstPageDataObj.toString(),QuantityStatisticsAssemble.class);
            return Result.OK(statisticsAssembles);
        }else{
            statisticsAssembles = new ArrayList<QuantityStatisticsAssemble>();
        }
        //获取区域编码对应的国标编码
        AreaPlatform areaPlatform = null;
        try {
            QueryWrapper<AreaPlatform> platformQueryWrapper = new QueryWrapper<AreaPlatform>();
            platformQueryWrapper.eq("PLATFORM_CODE",platformCode);
            areaPlatform = areaPlatformService.getOne(platformQueryWrapper);
            if(ObjectUtils.isEmpty(areaPlatform)){
                return Result.error("传入参数错误");
            }
        }catch (Exception e){
            e.printStackTrace();
            return Result.error("传入参数错误");
        }
        String areaCode = areaPlatform.getAreaCode();
        log.info("区域编码："+platformCode);
        try {
            areaCode = areaCode.substring(0,4);
            log.info("区域国标编码："+areaCode);
        }catch (Exception e){
            e.printStackTrace();
            areaCode = "";
            log.info("区域国标编码："+areaCode);
        }
        /*工程建设开始*/
        String regionCode = areaCode;

        QuantityStatisticsAssemble quantityStatisticsEngineeringConstruction = new QuantityStatisticsAssemble();
        QueryWrapper<GcBidpublicity> gcBidpublicityQueryWrapper = new QueryWrapper<GcBidpublicity>();
        gcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
        int countGcBidpublicity = gcBidpublicityService.count(gcBidpublicityQueryWrapper);
        quantityStatisticsEngineeringConstruction.setTotalAssemble(countGcBidpublicity);
        quantityStatisticsEngineeringConstruction.setTitle("工程建设");
        statisticsAssembles.add(quantityStatisticsEngineeringConstruction);

        /*工程建设结束*/
        /*政府采购-开始*/
        QuantityStatisticsAssemble quantityStatisticsGovernmentProcurement = new QuantityStatisticsAssemble();
        QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapper = new QueryWrapper<ZcBidpublicity>();
        zcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
        int countZcBidpublicity = zcBidpublicityService.count(zcBidpublicityQueryWrapper);
        quantityStatisticsGovernmentProcurement.setTitle("政府采购");
        quantityStatisticsGovernmentProcurement.setTotalAssemble(countZcBidpublicity);
        statisticsAssembles.add(quantityStatisticsGovernmentProcurement);
        /*政府采购-结束*/

        /*土地矿业开始*/
        QuantityStatisticsAssemble quantityStatisticsLandMineral  = new QuantityStatisticsAssemble();
        quantityStatisticsLandMineral.setTitle("土地矿权");
        QueryWrapper<ZrzyTdBidwinnotice> zrzyTdBidwinnoticeQueryWrapper = new QueryWrapper<ZrzyTdBidwinnotice>();
        zrzyTdBidwinnoticeQueryWrapper.eq("PLATFORM_CODE",platformCode);
        int countZrzyTdBidwinnotice = zrzyTdBidwinnoticeService.count(zrzyTdBidwinnoticeQueryWrapper);

        try {
            /*Zrzy_Tkq_Notice*/
            QueryWrapper<ZrzyTkqNotice> zrzyTkqNoticeQueryWrapper = new QueryWrapper<ZrzyTkqNotice>();
            zrzyTkqNoticeQueryWrapper.likeRight("region_code",regionCode);
            int countZrzyTkqNotice = zrzyTkqNoticeService.count(zrzyTkqNoticeQueryWrapper);
            countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyTkqNotice;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_CKQ_NOTICE*/
            QueryWrapper<ZrzyCkqNotice> zrzyCkqNoticeQueryWrapper = new QueryWrapper<ZrzyCkqNotice>();
            zrzyCkqNoticeQueryWrapper.likeRight("region_code",regionCode);
            int countZrzyCkqNotice = zrzyCkqNoticeService.count(zrzyCkqNoticeQueryWrapper);
            countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_DK_NOTICE*/
            QueryWrapper<ZrzyDkNotice> zrzyDkNoticeQueryWrapper = new QueryWrapper<ZrzyDkNotice>();
            zrzyDkNoticeQueryWrapper.likeRight("zone",regionCode);
            int countZrzyCkqNotice = zrzyDkNoticeService.count(zrzyDkNoticeQueryWrapper);
            countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_BG_NOTICE*/
            QueryWrapper<ZrzyBgNotice> zrzyBgNoticeQueryWrapper = new QueryWrapper<ZrzyBgNotice>();
            zrzyBgNoticeQueryWrapper.likeRight("zone",regionCode);
            int countZrzyCkqNotice = zrzyBgNoticeService.count(zrzyBgNoticeQueryWrapper);
            countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_JYZB_NOTICE*/
            QueryWrapper<ZrzyJyzbNotice> zrzyJyzbNoticeQueryWrapper = new QueryWrapper<ZrzyJyzbNotice>();
            zrzyJyzbNoticeQueryWrapper.likeRight("zone",regionCode);
            int countZrzyCkqNotice = zrzyJyzbNoticeService.count(zrzyJyzbNoticeQueryWrapper);
            countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice;
        }catch (Exception e){
            e.printStackTrace();
        }

        quantityStatisticsLandMineral.setTotalAssemble(countZrzyTdBidwinnotice);
        statisticsAssembles.add(quantityStatisticsLandMineral);
        /*土地矿业结束*/

        /*国有资产-开始*/
        QuantityStatisticsAssemble quantityStatisticsStateOwnedProperty = new QuantityStatisticsAssemble();
        quantityStatisticsStateOwnedProperty.setTitle("国有产权");
        int countCqSwBargainResult = cqSwBargainResultService.countByRegionCode(regionCode);

        QueryWrapper<CqGqBargainResult> cqGqBargainResultQueryWrapper = new QueryWrapper<CqGqBargainResult>();
        cqGqBargainResultQueryWrapper.likeRight("REGION_CODE",regionCode);
        int countCqGqBargainResult = cqGqBargainResultService.count(cqGqBargainResultQueryWrapper);

        quantityStatisticsStateOwnedProperty.setTotalAssemble(countCqSwBargainResult+countCqGqBargainResult);
        statisticsAssembles.add(quantityStatisticsStateOwnedProperty);
        /*国有资产-结束*/

        QuantityStatisticsAssemble quantityStatisticsVaccineTrading = new QuantityStatisticsAssemble();
        quantityStatisticsVaccineTrading.setTitle("疫苗交易");
        quantityStatisticsVaccineTrading.setTotalSelf(0);
        statisticsAssembles.add(quantityStatisticsVaccineTrading);

        /*其他交易-开始*/

        QuantityStatisticsAssemble quantityStatisticsGovernmentOrther = new QuantityStatisticsAssemble();
        quantityStatisticsGovernmentOrther.setTitle("其他交易");
        QueryWrapper<OtherTradePubInfo> tradePubInfoQueryWrapper = new QueryWrapper<OtherTradePubInfo>();
        tradePubInfoQueryWrapper.likeRight("REGION_CODE",regionCode);
        int count = otherTradePubInfoService.count(tradePubInfoQueryWrapper);
        quantityStatisticsGovernmentOrther.setTotalAssemble(count);
        statisticsAssembles.add(quantityStatisticsGovernmentOrther);

        /*其他交易-结束*/
        redisUtil.set(CommonConstant.PUBLISHING_CATEGORY_DATA_LIST, JSONArray.toJSONString(statisticsAssembles),CommonConstant.REDIS_SAVE_TIME);
        return Result.OK(statisticsAssembles);
    }

    //各交易类别发布类别数据:交易金额
    @GetMapping(value = "/publishingCategoryMoneyList")
    public  Result<List<QuantityStatisticsAssemble>> publishingCategoryMoneyList(
            @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode

    ) throws ParseException {

        List<QuantityStatisticsAssemble> statisticsAssembles = null;

        Object firstPageDataObj = redisUtil.get(CommonConstant.PUBLISHING_CATEGORY_MONEY_LIST+platformCode);
        if(!ObjectUtils.isEmpty(firstPageDataObj)){
            statisticsAssembles = JSONArray.parseArray(firstPageDataObj.toString(),QuantityStatisticsAssemble.class);
            return Result.OK(statisticsAssembles);
        }else{
            statisticsAssembles = new ArrayList<QuantityStatisticsAssemble>();
        }
        //获取区域编码对应的国标编码
        AreaPlatform areaPlatform = null;
        try {
            QueryWrapper<AreaPlatform> platformQueryWrapper = new QueryWrapper<AreaPlatform>();
            platformQueryWrapper.eq("PLATFORM_CODE",platformCode);
            areaPlatform = areaPlatformService.getOne(platformQueryWrapper);
            if(ObjectUtils.isEmpty(areaPlatform)){
                return Result.error("传入参数错误");
            }
        }catch (Exception e){
            e.printStackTrace();
            return Result.error("传入参数错误");
        }
        String areaCode = areaPlatform.getAreaCode();
        log.info("区域编码："+platformCode);
        try {
            areaCode = areaCode.substring(0,4);
            log.info("区域国标编码："+areaCode);
        }catch (Exception e){
            e.printStackTrace();
            areaCode = "";
            log.info("区域国标编码："+areaCode);
        }
        String regionCode = areaCode;

        /*工程建设开始*/
        QuantityStatisticsAssemble quantityStatisticsEngineeringConstruction = new QuantityStatisticsAssemble();

        QueryWrapper<GcBidpublicity> gcBidpublicityQueryWrapper = new QueryWrapper<GcBidpublicity>();
        gcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
        gcBidpublicityQueryWrapper.select("sum( case when PRICE_UNIT = 0 then BID_AMOUNT when PRICE_UNIT = 1 then BID_AMOUNT*10000 else BID_AMOUNT end) as sumAll");
        GcBidpublicity gcBidpublicityServiceOne = gcBidpublicityService.getOne(gcBidpublicityQueryWrapper);
        if(!ObjectUtils.isEmpty(gcBidpublicityServiceOne)){
            quantityStatisticsEngineeringConstruction.setMoney(new BigDecimal(gcBidpublicityServiceOne.getSumAll()));
        }else{
            quantityStatisticsEngineeringConstruction.setMoney(new BigDecimal(0));
        }
        quantityStatisticsEngineeringConstruction.setTitle("工程建设");
        statisticsAssembles.add(quantityStatisticsEngineeringConstruction);
        /*工程建设结束*/

        /*政府采购-开始*/
        QuantityStatisticsAssemble quantityStatisticsGovernmentProcurement = new QuantityStatisticsAssemble();
        QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapper = new QueryWrapper<ZcBidpublicity>();
        zcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
        zcBidpublicityQueryWrapper.select("sum( case when PRICE_UNIT = 0 then WIN_BID_PRICE when PRICE_UNIT = 1 then WIN_BID_PRICE*10000 else WIN_BID_PRICE end) as sumAll");

        ZcBidpublicity zcBidpublicityOne = zcBidpublicityService.getOne(zcBidpublicityQueryWrapper);
        if(!ObjectUtils.isEmpty(zcBidpublicityOne)){
            quantityStatisticsGovernmentProcurement.setMoney(new BigDecimal(zcBidpublicityOne.getSumAll()));
        }else{
            quantityStatisticsGovernmentProcurement.setMoney(new BigDecimal(0));
        }
        quantityStatisticsGovernmentProcurement.setTitle("政府采购");
        statisticsAssembles.add(quantityStatisticsGovernmentProcurement);
        /*政府采购-结束*/

        /*土地矿业开始*/
        QuantityStatisticsAssemble quantityStatisticsLandMineral  = new QuantityStatisticsAssemble();
        quantityStatisticsLandMineral.setTitle("自然资源");


        BigDecimal quantityStatisticsLandMineralTotal = new BigDecimal(0);

        QueryWrapper<ZrzyTdBidwinnotice> zrzyTdBidwinnoticeQueryWrapper = new QueryWrapper<ZrzyTdBidwinnotice>();
        zrzyTdBidwinnoticeQueryWrapper.eq("PLATFORM_CODE",platformCode);

        zrzyTdBidwinnoticeQueryWrapper.select("sum( case when PRICE_UNIT = 0 then DEAL_PRICE when PRICE_UNIT = 1 then DEAL_PRICE*10000 else DEAL_PRICE end) as sumAll");
        ZrzyTdBidwinnotice zrzyTdBidwinnoticeServiceOne = zrzyTdBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapper);
        if(!ObjectUtils.isEmpty(zrzyTdBidwinnoticeServiceOne)){
            String sumAll = zrzyTdBidwinnoticeServiceOne.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                quantityStatisticsLandMineralTotal = quantityStatisticsLandMineralTotal.add(new BigDecimal(sumAll));
            }
        }


        /*ZRZY_TKQ_BIDWINNOTICE*/
        QueryWrapper<ZrzyTkqBidwinnotice> zrzyTdBidwinnoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyTkqBidwinnotice>();
        zrzyTdBidwinnoticeQueryWrapperSumInIn.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
        zrzyTdBidwinnoticeQueryWrapperSumInIn.likeRight("region_code",regionCode);
        ZrzyTkqBidwinnotice zrzyTkqBidwinnoticeSumInIn = zrzyTkqBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapperSumInIn);
        if(!ObjectUtils.isEmpty(zrzyTkqBidwinnoticeSumInIn)){
            String sumAll = zrzyTkqBidwinnoticeSumInIn.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                quantityStatisticsLandMineralTotal =quantityStatisticsLandMineralTotal.add(new BigDecimal(sumAll));
            }
        }

        /*ZRZY_CKQ_BIDWINNOTICE*/
        QueryWrapper<ZrzyCkqBidwinnotice> zrzyCkqBidwinnoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyCkqBidwinnotice>();
        zrzyCkqBidwinnoticeQueryWrapperSumInIn.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
        zrzyCkqBidwinnoticeQueryWrapperSumInIn.likeRight("region_code",regionCode);
        ZrzyCkqBidwinnotice zrzyCkqBidwinnoticeSumInIn = zrzyCkqBidwinnoticeService.getOne(zrzyCkqBidwinnoticeQueryWrapperSumInIn);
        if(!ObjectUtils.isEmpty(zrzyCkqBidwinnoticeSumInIn)){
            String sumAll = zrzyCkqBidwinnoticeSumInIn.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                quantityStatisticsLandMineralTotal = quantityStatisticsLandMineralTotal.add(new BigDecimal(sumAll));
            }
        }

        /*ZRZY_DK_BINWIN_NOTICE*/
        QueryWrapper<ZrzyDkBinwinNotice> zrzyDkBinwinNoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyDkBinwinNotice>();
        zrzyDkBinwinNoticeQueryWrapperSumInIn.select("sum(cast(ZB_PRICE as decimal(9,2)) * 10000) as sumAll");
        zrzyDkBinwinNoticeQueryWrapperSumInIn.likeRight("zone",regionCode);
        ZrzyDkBinwinNotice zrzyDkBinwinNoticeSumInIn = zrzyDkBinwinNoticeService.getOne(zrzyDkBinwinNoticeQueryWrapperSumInIn);
        if(!ObjectUtils.isEmpty(zrzyDkBinwinNoticeSumInIn)){
            String sumAll = zrzyDkBinwinNoticeSumInIn.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                quantityStatisticsLandMineralTotal = quantityStatisticsLandMineralTotal.add(new BigDecimal(sumAll));
            }
        }
        /*ZRZY_BG_BIDWIN_NOTICE*/
        ZrzyBgBidwinNotice zrzyBgBidwinNoticeSumInIn = zrzyBgBidwinNoticeService.getSumMoneyByRegionCode(regionCode);
        if(!ObjectUtils.isEmpty(zrzyBgBidwinNoticeSumInIn)){
            String sumAll = zrzyBgBidwinNoticeSumInIn.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                quantityStatisticsLandMineralTotal =  quantityStatisticsLandMineralTotal.add(new BigDecimal(sumAll));
            }
        }

        /*ZRZY_JYZB_BIDWIN_NOTICE*/
        ZrzyJyzbBidwinNotice zrzyJyzbBidwinNoticeSumInIn = zrzyJyzbBidwinNoticeService.getSumMoneyByRegionCode(regionCode);
        if(!ObjectUtils.isEmpty(zrzyJyzbBidwinNoticeSumInIn)){
            String sumAll = zrzyJyzbBidwinNoticeSumInIn.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                quantityStatisticsLandMineralTotal =   quantityStatisticsLandMineralTotal.add(new BigDecimal(sumAll));
            }
        }

        quantityStatisticsLandMineral.setMoney(quantityStatisticsLandMineralTotal);
        statisticsAssembles.add(quantityStatisticsLandMineral);
        /*土地矿业结束*/

        /*国有资产-开始*/
        QuantityStatisticsAssemble quantityStatisticsStateOwnedProperty = new QuantityStatisticsAssemble();
        quantityStatisticsStateOwnedProperty.setTitle("国有产权");
        CqSwBargainResult countCqSwBargainResult = cqSwBargainResultService.getSumMoneyByRegionCode(regionCode);

        QueryWrapper<CqGqBargainResult> cqGqBargainResultQueryWrapper = new QueryWrapper<CqGqBargainResult>();
        cqGqBargainResultQueryWrapper.likeRight("REGION_CODE",regionCode);
        cqGqBargainResultQueryWrapper.select("sum( case when PRICE_UNIT = 0 then TRADE_VALUE when PRICE_UNIT = 1 then TRADE_VALUE*10000 else TRADE_VALUE end) as sumAll");
        CqGqBargainResult cqGqBargainResult = cqGqBargainResultService.getOne(cqGqBargainResultQueryWrapper);

        BigDecimal bigDecimal = new BigDecimal("0");
        if(!ObjectUtils.isEmpty(countCqSwBargainResult)){
            bigDecimal = bigDecimal.add(new BigDecimal(countCqSwBargainResult.getSumAll()));
        }
        if(!ObjectUtils.isEmpty(cqGqBargainResult)){
            bigDecimal = bigDecimal.add(new BigDecimal(cqGqBargainResult.getSumAll()));
        }
        quantityStatisticsStateOwnedProperty.setMoney(
                bigDecimal
        );
        statisticsAssembles.add(quantityStatisticsStateOwnedProperty);
        /*国有资产-结束*/

        /*疫苗交易-开始*/
        QuantityStatisticsAssemble quantityStatisticsVaccineTrading = new QuantityStatisticsAssemble();
        quantityStatisticsVaccineTrading.setTitle("疫苗交易");
        quantityStatisticsVaccineTrading.setMoney(new BigDecimal(0));
        statisticsAssembles.add(quantityStatisticsVaccineTrading);
        /*疫苗交易-结束*/

        /*其他交易-开始*/
        QuantityStatisticsAssemble quantityStatisticsGovernmentOrther = new QuantityStatisticsAssemble();
        quantityStatisticsGovernmentOrther.setTitle("其他交易");
        QueryWrapper<QtjyBidpublicity> bidpublicityQueryWrapper = new QueryWrapper<QtjyBidpublicity>();
        bidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
        bidpublicityQueryWrapper.select("sum(BID_AMOUNT) as sumAll");
        QtjyBidpublicity qtjyBidpublicity = qtjyBidpublicityService.getOne(bidpublicityQueryWrapper);
        if(!ObjectUtils.isEmpty(qtjyBidpublicity)){
            String sumAll = qtjyBidpublicity.getSumAll();
            if(!ObjectUtils.isEmpty(sumAll)){
                BigDecimal bigDecimal1 = new BigDecimal(sumAll);
                try {
                    QueryWrapper<OtherTradeResultInfo> otherTradeResultInfoQueryWrapperIn = new QueryWrapper<OtherTradeResultInfo>();
                    otherTradeResultInfoQueryWrapperIn.select("sum(BID_AMOUNT) as sumAll");
                    otherTradeResultInfoQueryWrapperIn.likeRight("REGION_CODE",areaCode);
                    OtherTradeResultInfo otherTradeResultInfoIn = otherTradeResultInfoService.getOne(otherTradeResultInfoQueryWrapperIn);
                    if(!ObjectUtils.isEmpty(otherTradeResultInfoIn)){
                        String sumAll1 = otherTradeResultInfoIn.getSumAll();
                        if(!ObjectUtils.isEmpty(sumAll1)){
                            BigDecimal bigDecimalsum = new BigDecimal(sumAll1);
                            bigDecimal1 = bigDecimal1.add(bigDecimalsum);
                        }
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
                quantityStatisticsGovernmentOrther.setMoney(bigDecimal1);
            }else{
                quantityStatisticsGovernmentOrther.setMoney(new BigDecimal(0));
            }
        }else{
            quantityStatisticsGovernmentOrther.setMoney(new BigDecimal(0));
        }
        statisticsAssembles.add(quantityStatisticsGovernmentOrther);
        /*其他交易-结束*/

        redisUtil.set(CommonConstant.PUBLISHING_CATEGORY_MONEY_LIST, JSONArray.toJSONString(statisticsAssembles),CommonConstant.REDIS_SAVE_TIME);

        return Result.OK(statisticsAssembles);

    }


    //各交易类别发布类别数据:折线图
    @GetMapping(value = "/publishingCategoryMoneyYueList")
    public  Result<List<LineChartData>> publishingCategoryMoneyYueList(
            @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode
    ) throws ParseException {

        List<LineChartData> dataDataDataList = null;

        Object firstPageDataObj = redisUtil.get(CommonConstant.PUBLISHING_CATEGORY_MONEY_YUE_LIST+platformCode);
        if(!ObjectUtils.isEmpty(firstPageDataObj)){
            dataDataDataList = JSONArray.parseArray(firstPageDataObj.toString(),LineChartData.class);
            return Result.OK(dataDataDataList);
        }else{
            dataDataDataList = new ArrayList<LineChartData>();
        }
        //获取区域编码对应的国标编码
        AreaPlatform areaPlatform = null;
        try {
            QueryWrapper<AreaPlatform> platformQueryWrapper = new QueryWrapper<AreaPlatform>();
            platformQueryWrapper.eq("PLATFORM_CODE",platformCode);
            areaPlatform = areaPlatformService.getOne(platformQueryWrapper);
            if(ObjectUtils.isEmpty(areaPlatform)){
                return Result.error("传入参数错误");
            }
        }catch (Exception e){
            e.printStackTrace();
            return Result.error("传入参数错误");
        }
        String areaCode = areaPlatform.getAreaCode();
        ;
        log.info("区域编码："+platformCode);
        try {
            areaCode = areaCode.substring(0,4);
            log.info("区域国标编码："+areaCode);
        }catch (Exception e){
            e.printStackTrace();
            areaCode = "";
            log.info("区域国标编码："+areaCode);
        }
        String regionCode = areaCode;
        /*工程建设开始*/
        //获取当前时间前6 个月的时间
        LineChartData lineChartDataGc = new LineChartData();
        lineChartDataGc.setName("工程建设");
        lineChartDataGc.setDate(get6Month());
        String lineChartDataGcValue[] = new String[7];
        int iValue = 0;
        for (String date : lineChartDataGc.getDate()) {
            //开始时间
            SimpleDateFormat formatyyyylMM = new SimpleDateFormat("yyyy-MM");
            SimpleDateFormat formatyyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
            Date parse = formatyyyylMM.parse(date);

            Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(parse);
            String formatStart = formatyyyyMMddHHmmss.format(startTimeOfCurrentMonth);

            Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(parse);
            String formatEnd = formatyyyyMMddHHmmss.format(endTimeOfCurrentMonth);

            //结束时间
            QueryWrapper<GcBidpublicity> gcBidpublicityQueryWrapper = new QueryWrapper<GcBidpublicity>();
            gcBidpublicityQueryWrapper.gt("NOTICE_SEND_TIME",formatStart);
            gcBidpublicityQueryWrapper.le("NOTICE_SEND_TIME",formatEnd);
            gcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
            gcBidpublicityQueryWrapper.select("sum( case when PRICE_UNIT = 0 then BID_AMOUNT when PRICE_UNIT = 1 then BID_AMOUNT*10000 else BID_AMOUNT end) as sumAll");
            GcBidpublicity gcBidpublicityServiceOne = gcBidpublicityService.getOne(gcBidpublicityQueryWrapper);

            if(!ObjectUtils.isEmpty(gcBidpublicityServiceOne)){
                String sumAll = gcBidpublicityServiceOne.getSumAll();
                lineChartDataGcValue[iValue] = sumAll;
            }else{
                lineChartDataGcValue[iValue] = "0";
            }
            iValue++;
        }
        lineChartDataGc.setValue(lineChartDataGcValue);
        dataDataDataList.add(lineChartDataGc);
        /*工程建设结束*/

        /*政府采购，开始*/
        LineChartData lineChartDataZc = new LineChartData();
        lineChartDataZc.setName("政府采购");
        lineChartDataZc.setDate(get6Month());
        String lineChartDataZcValue[] = new String[7];
        int ilineChartDataZcValue = 0;
        for (String date : lineChartDataZc.getDate()) {
            //开始时间
            SimpleDateFormat formatyyyylMM = new SimpleDateFormat("yyyy-MM");
            SimpleDateFormat formatyyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
            Date parse = formatyyyylMM.parse(date);

            Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(parse);
            String formatStart = formatyyyyMMddHHmmss.format(startTimeOfCurrentMonth);

            Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(parse);
            String formatEnd = formatyyyyMMddHHmmss.format(endTimeOfCurrentMonth);

            QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapper = new QueryWrapper<ZcBidpublicity>();
            zcBidpublicityQueryWrapper.gt("WIN_BID_BULLETIN_START_TIME",formatStart);
            zcBidpublicityQueryWrapper.le("WIN_BID_BULLETIN_START_TIME",formatEnd);
            zcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
            zcBidpublicityQueryWrapper.select("sum( case when PRICE_UNIT = 0 then WIN_BID_PRICE when PRICE_UNIT = 1 then WIN_BID_PRICE*10000 else WIN_BID_PRICE end) as sumAll");
            ZcBidpublicity zcBidpublicity = zcBidpublicityService.getOne(zcBidpublicityQueryWrapper);
            if(!ObjectUtils.isEmpty(zcBidpublicity)){
                String sumAll = zcBidpublicity.getSumAll();
                lineChartDataZcValue[ilineChartDataZcValue] = sumAll;
            }else{
                lineChartDataZcValue[ilineChartDataZcValue] = "0";
            }
            ilineChartDataZcValue++;
        }
        lineChartDataZc.setValue(lineChartDataZcValue);
        dataDataDataList.add(lineChartDataZc);
        /*政府采购，结束*/

        /*土地矿权开始*/
        LineChartData lineChartDataTd = new LineChartData();
        lineChartDataTd.setName("自然资源");
        lineChartDataTd.setDate(get6Month());
        String lineChartDataTdValue[] = new String[7];
        int ilineChartDataTdValue = 0;
        for (String date : lineChartDataTd.getDate()) {
            //开始时间
            SimpleDateFormat formatyyyylMM = new SimpleDateFormat("yyyy-MM");
            SimpleDateFormat formatyyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
            Date parse = formatyyyylMM.parse(date);

            Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(parse);
            String formatStart = formatyyyyMMddHHmmss.format(startTimeOfCurrentMonth);

            Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(parse);
            String formatEnd = formatyyyyMMddHHmmss.format(endTimeOfCurrentMonth);

            BigDecimal zrzyTdTotal = new BigDecimal(0);

            QueryWrapper<ZrzyTdBidwinnotice> zrzyTdBidwinnoticeQueryWrapper = new QueryWrapper<ZrzyTdBidwinnotice>();
            zrzyTdBidwinnoticeQueryWrapper.eq("PLATFORM_CODE",platformCode);
            zrzyTdBidwinnoticeQueryWrapper.gt("PUBLISHING_TIME",formatStart);
            zrzyTdBidwinnoticeQueryWrapper.le("PUBLISHING_TIME",formatEnd);
            zrzyTdBidwinnoticeQueryWrapper.select("sum( case when PRICE_UNIT = 0 then DEAL_PRICE when PRICE_UNIT = 1 then DEAL_PRICE*10000 else DEAL_PRICE end) as sumAll");
            ZrzyTdBidwinnotice zrzyTdBidwinnoticeServiceOne = zrzyTdBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapper);

            if(!ObjectUtils.isEmpty(zrzyTdBidwinnoticeServiceOne)){
                String sumAll = zrzyTdBidwinnoticeServiceOne.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                    zrzyTdTotal = zrzyTdTotal.add(new BigDecimal(sumAll));
                }
            }

            /*ZRZY_TKQ_BIDWINNOTICE*/
            QueryWrapper<ZrzyTkqBidwinnotice> zrzyTdBidwinnoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyTkqBidwinnotice>();
            zrzyTdBidwinnoticeQueryWrapperSumInIn.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
            zrzyTdBidwinnoticeQueryWrapperSumInIn.likeRight("region_code",regionCode);
            zrzyTdBidwinnoticeQueryWrapperSumInIn.gt("PUBLISHING_TIME",formatStart);
            zrzyTdBidwinnoticeQueryWrapperSumInIn.le("PUBLISHING_TIME",formatEnd);
            ZrzyTkqBidwinnotice zrzyTkqBidwinnoticeSumInIn = zrzyTkqBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapperSumInIn);
            if(!ObjectUtils.isEmpty(zrzyTkqBidwinnoticeSumInIn)){
                String sumAll = zrzyTkqBidwinnoticeSumInIn.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                    zrzyTdTotal = zrzyTdTotal.add(new BigDecimal(sumAll));
                }
            }

            /*ZRZY_CKQ_BIDWINNOTICE*/
            QueryWrapper<ZrzyCkqBidwinnotice> zrzyCkqBidwinnoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyCkqBidwinnotice>();
            zrzyCkqBidwinnoticeQueryWrapperSumInIn.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll");
            zrzyCkqBidwinnoticeQueryWrapperSumInIn.likeRight("region_code",regionCode);
            zrzyCkqBidwinnoticeQueryWrapperSumInIn.gt("PUBLISHING_TIME",formatStart);
            zrzyCkqBidwinnoticeQueryWrapperSumInIn.le("PUBLISHING_TIME",formatEnd);
            ZrzyCkqBidwinnotice zrzyCkqBidwinnoticeSumInIn = zrzyCkqBidwinnoticeService.getOne(zrzyCkqBidwinnoticeQueryWrapperSumInIn);
            if(!ObjectUtils.isEmpty(zrzyCkqBidwinnoticeSumInIn)){
                String sumAll = zrzyCkqBidwinnoticeSumInIn.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                    zrzyTdTotal = zrzyTdTotal.add(new BigDecimal(sumAll));
                }
            }

            /*ZRZY_DK_BINWIN_NOTICE*/
            QueryWrapper<ZrzyDkBinwinNotice> zrzyDkBinwinNoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyDkBinwinNotice>();
            zrzyDkBinwinNoticeQueryWrapperSumInIn.select("sum(cast(ZB_PRICE as decimal(9,2)) * 10000) as sumAll");
            zrzyDkBinwinNoticeQueryWrapperSumInIn.likeRight("zone",regionCode);
            zrzyDkBinwinNoticeQueryWrapperSumInIn.gt("SUBMITS_TIME",formatStart);
            zrzyDkBinwinNoticeQueryWrapperSumInIn.le("SUBMITS_TIME",formatEnd);
            ZrzyDkBinwinNotice zrzyDkBinwinNoticeSumInIn = zrzyDkBinwinNoticeService.getOne(zrzyDkBinwinNoticeQueryWrapperSumInIn);
            if(!ObjectUtils.isEmpty(zrzyDkBinwinNoticeSumInIn)){
                String sumAll = zrzyDkBinwinNoticeSumInIn.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                    zrzyTdTotal = zrzyTdTotal.add(new BigDecimal(sumAll));
                }
            }
            /*ZRZY_BG_BIDWIN_NOTICE*/
            QueryWrapper<ZrzyBgBidwinNotice> zrzyBgBidwinNoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyBgBidwinNotice>();
            zrzyBgBidwinNoticeQueryWrapperSumInIn.select("sum(cast(WIN_BID_PRICE as decimal(9,2)) * 10000) as sumAll");
            zrzyBgBidwinNoticeQueryWrapperSumInIn.gt("ISSUE_TIME",formatStart);
            zrzyBgBidwinNoticeQueryWrapperSumInIn.le("ISSUE_TIME",formatEnd);
            ZrzyBgBidwinNotice zrzyBgBidwinNoticeSumInIn = zrzyBgBidwinNoticeService.getOne(zrzyBgBidwinNoticeQueryWrapperSumInIn);
            if(!ObjectUtils.isEmpty(zrzyBgBidwinNoticeSumInIn)){
                String sumAll = zrzyBgBidwinNoticeSumInIn.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                    zrzyTdTotal = zrzyTdTotal.add(new BigDecimal(sumAll));
                }
            }
            /*ZRZY_JYZB_BIDWIN_NOTICE*/
            QueryWrapper<ZrzyJyzbBidwinNotice> zrzyJyzbBidwinNoticeQueryWrapperSumInIn = new QueryWrapper<ZrzyJyzbBidwinNotice>();
            zrzyJyzbBidwinNoticeQueryWrapperSumInIn.select("sum(WIN_BID_PRICE) as sumAll ");
            zrzyJyzbBidwinNoticeQueryWrapperSumInIn.gt("ISSUE_TIME",formatStart);
            zrzyJyzbBidwinNoticeQueryWrapperSumInIn.le("ISSUE_TIME",formatEnd);
            ZrzyJyzbBidwinNotice zrzyJyzbBidwinNoticeSumInIn = zrzyJyzbBidwinNoticeService.getOne(zrzyJyzbBidwinNoticeQueryWrapperSumInIn);
            if(!ObjectUtils.isEmpty(zrzyJyzbBidwinNoticeSumInIn)){
                String sumAll = zrzyJyzbBidwinNoticeSumInIn.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll) && sumAll != ""){
                    zrzyTdTotal =  zrzyTdTotal.add(new BigDecimal(sumAll));
                }
            }
            if(!ObjectUtils.isEmpty(zrzyTdTotal)){
                lineChartDataTdValue[ilineChartDataTdValue] = zrzyTdTotal.toString();
            }
            ilineChartDataTdValue++;
        }
        lineChartDataTd.setValue(lineChartDataTdValue);
        dataDataDataList.add(lineChartDataTd);
        /*土地矿权结束*/
        LineChartData lineChartDataGy = new LineChartData();
        lineChartDataGy.setName("国有产权");
        lineChartDataGy.setDate(get6Month());
        String lineChartDataGyValue[] = new String[7];
        int ilineChartDataGyValue = 0;
        for (String date : lineChartDataGy.getDate()) {
            //开始时间
            SimpleDateFormat formatyyyylMM = new SimpleDateFormat("yyyy-MM");
            SimpleDateFormat formatyyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
            Date parse = formatyyyylMM.parse(date);

            Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(parse);
            String formatStart = formatyyyyMMddHHmmss.format(startTimeOfCurrentMonth);

            Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(parse);
            String formatEnd = formatyyyyMMddHHmmss.format(endTimeOfCurrentMonth);

            /*CQ_SW_BARGAIN_RESULT*/
            CqSwBargainResult cqSwBargainResultSumInIn = null;
            try {
                cqSwBargainResultSumInIn = cqSwBargainResultService.getSumMoneyByRegionCodeAndTime(regionCode,formatStart.substring(0,8),formatEnd.substring(0,8));
            }catch (Exception e){
                e.printStackTrace();
            }
            /*CQ_GQ_BARGAIN_RESULT*/
            QueryWrapper<CqGqBargainResult> cqGqBargainResultQueryWrapperSumInIn = new QueryWrapper<CqGqBargainResult>();
            cqGqBargainResultQueryWrapperSumInIn.gt("TRADE_DATE",formatStart.substring(0,8));
            cqGqBargainResultQueryWrapperSumInIn.le("TRADE_DATE",formatEnd.substring(0,8));
            cqGqBargainResultQueryWrapperSumInIn.select("sum( case when PRICE_UNIT = 0 then TRADE_VALUE when PRICE_UNIT = 1 then TRADE_VALUE*10000 else TRADE_VALUE end) as sumAll");
            cqGqBargainResultQueryWrapperSumInIn.likeRight("region_code",regionCode);
            CqGqBargainResult cqGqBargainResultSumInIn = cqGqBargainResultService.getOne(cqGqBargainResultQueryWrapperSumInIn);

            BigDecimal cqSwBargainTotal = new BigDecimal(0);
            if(!ObjectUtils.isEmpty(cqSwBargainResultSumInIn)){
                String sumAll = cqSwBargainResultSumInIn.getSumAll();
                BigDecimal bigDecimalSumAllValue = new BigDecimal(sumAll);
                cqSwBargainTotal = cqSwBargainTotal.add(bigDecimalSumAllValue);
            }
            if(!ObjectUtils.isEmpty(cqGqBargainResultSumInIn)){
                String sumAllValue = cqGqBargainResultSumInIn.getSumAll();
                BigDecimal bigDecimalSumAllValue = new BigDecimal(sumAllValue);
                cqSwBargainTotal =  cqSwBargainTotal.add(bigDecimalSumAllValue);
            }
            lineChartDataGyValue[ilineChartDataGyValue] = cqSwBargainTotal.toString();
            ilineChartDataGyValue++;
        }
        lineChartDataGy.setValue(lineChartDataGyValue);
        dataDataDataList.add(lineChartDataGy);

        LineChartData lineChartDataYm = new LineChartData();
        lineChartDataYm.setName("疫苗交易");
        lineChartDataYm.setDate(get6Month());
        dataDataDataList.add(lineChartDataYm);

        LineChartData lineChartDataQt = new LineChartData();
        lineChartDataQt.setDate(get6Month());
        String lineChartDataQtValue[] = new String[7];
        int ilineChartDataQtValue = 0;
        for (String date : lineChartDataQt.getDate()) {
            //开始时间
            SimpleDateFormat formatyyyylMM = new SimpleDateFormat("yyyy-MM");
            SimpleDateFormat formatyyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
            Date parse = formatyyyylMM.parse(date);

            Date startTimeOfCurrentMonth = DateUtils.getStartTimeOfCurrentMonth(parse);
            String formatStart = formatyyyyMMddHHmmss.format(startTimeOfCurrentMonth);

            Date endTimeOfCurrentMonth = DateUtils.getEndTimeOfCurrentMonth(parse);
            String formatEnd = formatyyyyMMddHHmmss.format(endTimeOfCurrentMonth);

            QueryWrapper<QtjyBidpublicity> qtjyBidpublicityQueryWrapper = new QueryWrapper<QtjyBidpublicity>();
            qtjyBidpublicityQueryWrapper.gt("PUBLISHING_TIME",formatStart);
            qtjyBidpublicityQueryWrapper.le("PUBLISHING_TIME",formatEnd);
            qtjyBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode);
            qtjyBidpublicityQueryWrapper.select("sum(BID_AMOUNT) as sumAll");
            QtjyBidpublicity qtjyBidpublicity = qtjyBidpublicityService.getOne(qtjyBidpublicityQueryWrapper);
            if(!ObjectUtils.isEmpty(qtjyBidpublicity)){
                String sumAll = qtjyBidpublicity.getSumAll();
                if(!ObjectUtils.isEmpty(sumAll)){
                    BigDecimal bigDecimalsumAll = new BigDecimal(sumAll);
                    try {
                        QueryWrapper<OtherTradeResultInfo> otherTradeResultInfoQueryWrapperIn = new QueryWrapper<OtherTradeResultInfo>();
                        otherTradeResultInfoQueryWrapperIn.gt("PUBLISHING_TIME",formatStart);
                        otherTradeResultInfoQueryWrapperIn.le("PUBLISHING_TIME",formatEnd);
                        otherTradeResultInfoQueryWrapperIn.select("sum(BID_AMOUNT) as sumAll");
                        otherTradeResultInfoQueryWrapperIn.eq("PLATFORM_CODE",platformCode);
                        OtherTradeResultInfo otherTradeResultInfoIn = otherTradeResultInfoService.getOne(otherTradeResultInfoQueryWrapperIn);
                        if(!ObjectUtils.isEmpty(otherTradeResultInfoIn)){
                            String sumAll1 = otherTradeResultInfoIn.getSumAll();
                            if(!ObjectUtils.isEmpty(sumAll1)){
                                BigDecimal bigDecimalsum = new BigDecimal(sumAll1);
                                bigDecimalsumAll = bigDecimalsumAll.add(bigDecimalsum);
                            }
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
                    if(!ObjectUtils.isEmpty(bigDecimalsumAll)){
                        sumAll = bigDecimalsumAll.toString();
                    }
                }
                lineChartDataQtValue[ilineChartDataQtValue] = sumAll;
            }else{
                lineChartDataQtValue[ilineChartDataQtValue] = "0";
            }
            ilineChartDataQtValue++;
        }
        lineChartDataQt.setValue(lineChartDataQtValue);
        lineChartDataQt.setName("其他交易");
        dataDataDataList.add(lineChartDataQt);

        redisUtil.set(CommonConstant.PUBLISHING_CATEGORY_MONEY_YUE_LIST, JSONArray.toJSONString(dataDataDataList),CommonConstant.REDIS_SAVE_TIME);

        return Result.OK(dataDataDataList);
    }


    public String[] get6Month() throws ParseException {
        Calendar c = Calendar.getInstance();
        c.add(Calendar.MONTH, -5);
        String before_six = c.get(Calendar.YEAR) + "-" + c.get(Calendar.MONTH);//六个月前
        ArrayList<String> result = new ArrayList<String>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");// 格式化为年月
        Calendar min = Calendar.getInstance();
        Calendar max = Calendar.getInstance();
        min.setTime(sdf.parse(before_six));
        min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1);
        max.setTime(sdf.parse(sdf.format(new Date())));
        max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2);
        Calendar curr = min;
        while (curr.before(max)) {
            result.add(sdf.format(curr.getTime()));
            curr.add(Calendar.MONTH, 1);
        }
        String date[] = new String[7];
        int i = 0;
        for (String sDate : result) {
            date[i] = sDate;
            i++;
        }
        return date;
    }

    public Integer getGcProjectTotal(Date startTime, Date endTime){
        String strDateFormat = "yyyyMMddHHmmss";
        Long resultStartTime  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormat));
        Long resultEndTime  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormat));
        Integer total = 0;
        try {
            QueryWrapper<GcPackage> gcPackageQueryWrapper = new QueryWrapper<GcPackage>();
            gcPackageQueryWrapper.ge("CREATE_TIME",resultStartTime);
            gcPackageQueryWrapper.le("CREATE_TIME",resultEndTime);
            int countGcProject = gcPackageService.count(gcPackageQueryWrapper);
            total = total + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*政府采购*/
        try {
            QueryWrapper<ZcProject> zcPurchaseBulletinQueryWrapper = new QueryWrapper<ZcProject>();
            zcPurchaseBulletinQueryWrapper.ge("CREATE_TIME",resultStartTime);
            zcPurchaseBulletinQueryWrapper.le("CREATE_TIME",resultEndTime);
            int countZcPurchaseBulletin = zcProjectService.count(zcPurchaseBulletinQueryWrapper);
            total = total + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*土地矿权*/
        /*ZRZY_TD_CEDE_INFO*/
        try {
            QueryWrapper<ZrzyTdCedeInfo> zrzyTdCedeInfoQueryWrapper = new QueryWrapper<ZrzyTdCedeInfo>();
            zrzyTdCedeInfoQueryWrapper.ge("LISTING_START_TIME",resultStartTime);
            zrzyTdCedeInfoQueryWrapper.le("LISTING_START_TIME",resultEndTime);
            int countZrzyTdCedeNoticeSelf = zrzyTdCedeInfoService.count(zrzyTdCedeInfoQueryWrapper);
            total = total + countZrzyTdCedeNoticeSelf;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_TKQ_PROJECT_INFO*/
        try {
            QueryWrapper<ZrzyTkqProjectInfo> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyTkqProjectInfo>();
            zrzyTkqProjectInfoQueryWrapper.ge("LISTING_START_TIME",resultStartTime);
            zrzyTkqProjectInfoQueryWrapper.le("LISTING_START_TIME",resultEndTime);
            int countZrzyTdCedeNoticeSelf = zrzyTkqProjectInfoService.count(zrzyTkqProjectInfoQueryWrapper);
            total = total + countZrzyTdCedeNoticeSelf;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_CKQ_PROJECT_INFO*/
        try {
            QueryWrapper<ZrzyCkqProjectInfo> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyCkqProjectInfo>();
            zrzyTkqProjectInfoQueryWrapper.ge("LISTING_START_TIME",resultStartTime);
            zrzyTkqProjectInfoQueryWrapper.le("LISTING_START_TIME",resultEndTime);
            int countZrzyTdCedeNoticeSelf = zrzyCkqProjectInfoService.count(zrzyTkqProjectInfoQueryWrapper);
            total = total + countZrzyTdCedeNoticeSelf;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_DK_PROJECT*/
        try {
            QueryWrapper<ZrzyDkProject> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyDkProject>();
            zrzyTkqProjectInfoQueryWrapper.ge("NOTICE_SEND_TIME",resultStartTime);
            zrzyTkqProjectInfoQueryWrapper.le("NOTICE_SEND_TIME",resultEndTime);
            int countZrzyTdCedeNoticeSelf = zrzyDkProjectService.count(zrzyTkqProjectInfoQueryWrapper);
            total = total + countZrzyTdCedeNoticeSelf;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_BG_STOCK_INDEX*/
        try {
            QueryWrapper<ZrzyBgStockIndex> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyBgStockIndex>();
            zrzyTkqProjectInfoQueryWrapper.ge("IN_TIME",resultStartTime);
            zrzyTkqProjectInfoQueryWrapper.le("IN_TIME",resultEndTime);
            int countZrzyTdCedeNoticeSelf = zrzyBgStockIndexService.count(zrzyTkqProjectInfoQueryWrapper);
            total = total + countZrzyTdCedeNoticeSelf;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_JYZB_STOCK_INDEX*/
        try {
            QueryWrapper<ZrzyJyzbStockIndex> zrzyTkqProjectInfoQueryWrapper = new QueryWrapper<ZrzyJyzbStockIndex>();
            zrzyTkqProjectInfoQueryWrapper.ge("DATA_TIMESTAMP",resultStartTime);
            zrzyTkqProjectInfoQueryWrapper.le("DATA_TIMESTAMP",resultEndTime);
            int countZrzyTdCedeNoticeSelf = zrzyJyzbStockIndexService.count(zrzyTkqProjectInfoQueryWrapper);
            total = total + countZrzyTdCedeNoticeSelf;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*CQ_SW_BARGAIN_RESULT*/
        try {
            String strDateFormatYyyyMMdd = "yyyyMMdd";
            Long resultStartTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormatYyyyMMdd));
            Long resultEndTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormatYyyyMMdd));
            QueryWrapper<CqSwBargainResult> gcProjectQueryWrapper = new QueryWrapper<CqSwBargainResult>();
            gcProjectQueryWrapper.ge("TRADE_DATE",resultStartTimeYyyyMMdd);
            gcProjectQueryWrapper.le("TRADE_DATE",resultEndTimeYyyyMMdd);
            int countGcProject = cqSwBargainResultService.count(gcProjectQueryWrapper);
            total = total + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*CQ_GQ_BARGAIN_RESULT*/
        try {
            String strDateFormatYyyyMMdd = "yyyyMMdd";
            Long resultStartTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormatYyyyMMdd));
            Long resultEndTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormatYyyyMMdd));
            QueryWrapper<CqGqBargainResult> gcProjectQueryWrapper = new QueryWrapper<CqGqBargainResult>();
            gcProjectQueryWrapper.ge("TRADE_DATE",resultStartTimeYyyyMMdd);
            gcProjectQueryWrapper.le("TRADE_DATE",resultEndTimeYyyyMMdd);
            int countGcProject = cqGqBargainResultService.count(gcProjectQueryWrapper);
            total = total +  countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        return total;
    }

    public Integer getFieldApplyByTime(Date startTime, Date endTime){
        String strDateFormat = "yyyyMMddHHmmss";
        Long resultStartTime  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormat));
        Long resultEndTime  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormat));
        QueryWrapper<JgFieldApply> gcProjectQueryWrapper = new QueryWrapper<JgFieldApply>();
        gcProjectQueryWrapper.ge("BID_OPENING_TIME",resultStartTime);
        gcProjectQueryWrapper.le("BID_OPENING_TIME",resultEndTime);
        gcProjectQueryWrapper.eq("MEETING_TYPE","1");
        int count = jgFieldApplyService.count(gcProjectQueryWrapper);
        return count;
    }
    public Integer getGcNoticeandfileTotalByNoticeSendTime(Date startTime,Date endTime){
        String strDateFormat = "yyyyMMddHHmmss";
        Long resultStartTime  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormat));
        Long resultEndTime  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormat));
        int totalTransaction = 0;
        try {
            QueryWrapper<GcNoticeandfile> gcProjectQueryWrapper = new QueryWrapper<GcNoticeandfile>();
            gcProjectQueryWrapper.ge("NOTICE_SEND_TIME",resultStartTime);
            gcProjectQueryWrapper.le("NOTICE_SEND_TIME",resultEndTime);
            int countGcProject = gcNoticeandfileService.count(gcProjectQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapper = new QueryWrapper<ZcBidpublicity>();
            zcBidpublicityQueryWrapper.ge("WIN_BID_BULLETIN_START_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("WIN_BID_BULLETIN_START_TIME",resultEndTime);
            int countGcProject = zcBidpublicityService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*政府采购*/
        try {
            QueryWrapper<ZcProject> zcPurchaseBulletinQueryWrapper = new QueryWrapper<ZcProject>();
            zcPurchaseBulletinQueryWrapper.ge("CREATE_TIME",resultStartTime);
            zcPurchaseBulletinQueryWrapper.le("CREATE_TIME",resultEndTime);
            int countZcPurchaseBulletin = zcProjectService.count(zcPurchaseBulletinQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_TD_CEDE_NOTIC*/
            QueryWrapper<ZrzyTdCedeNotice> zrzyTdCedeNoticeQueryWrapper = new QueryWrapper<ZrzyTdCedeNotice>();
            zrzyTdCedeNoticeQueryWrapper.ge("PUBLISHING_TIME",resultStartTime);
            zrzyTdCedeNoticeQueryWrapper.le("PUBLISHING_TIME",resultEndTime);
            int countZcPurchaseBulletin = zrzyTdCedeNoticeService.count(zrzyTdCedeNoticeQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_TKQ_NOTICE*/
            QueryWrapper<ZrzyTkqNotice> zrzyTkqNoticeQueryWrapper = new QueryWrapper<ZrzyTkqNotice>();
            zrzyTkqNoticeQueryWrapper.ge("NOTICE_SEND_TIME",resultStartTime);
            zrzyTkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",resultEndTime);
            int countZcPurchaseBulletin = zrzyTkqNoticeService.count(zrzyTkqNoticeQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_CKQ_NOTICE*/
            QueryWrapper<ZrzyCkqNotice> zrzyTkqNoticeQueryWrapper = new QueryWrapper<ZrzyCkqNotice>();
            zrzyTkqNoticeQueryWrapper.ge("NOTICE_SEND_TIME",resultStartTime);
            zrzyTkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",resultEndTime);
            int countZcPurchaseBulletin = zrzyCkqNoticeService.count(zrzyTkqNoticeQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            /*ZRZY_DK_NOTICE*/
            QueryWrapper<ZrzyDkNotice> zrzyTkqNoticeQueryWrapper = new QueryWrapper<ZrzyDkNotice>();
            zrzyTkqNoticeQueryWrapper.ge("NOTICE_SEND_TIME",resultStartTime);
            zrzyTkqNoticeQueryWrapper.le("NOTICE_SEND_TIME",resultEndTime);
            int countZcPurchaseBulletin = zrzyDkNoticeService.count(zrzyTkqNoticeQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }

        try {
            /*ZRZY_BG_NOTICE*/
            QueryWrapper<ZrzyBgNotice> zrzyBgNoticeQueryWrapper = new QueryWrapper<ZrzyBgNotice>();
            zrzyBgNoticeQueryWrapper.ge("ISSUE_TIME",resultStartTime);
            zrzyBgNoticeQueryWrapper.le("ISSUE_TIME",resultEndTime);
            int countZcPurchaseBulletin = zrzyBgNoticeService.count(zrzyBgNoticeQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }

        try {
            /*ZRZY_JYZB_NOTICE*/
            QueryWrapper<ZrzyJyzbNotice> zrzyBgNoticeQueryWrapper = new QueryWrapper<ZrzyJyzbNotice>();
            zrzyBgNoticeQueryWrapper.ge("ISSUE_TIME",resultStartTime);
            zrzyBgNoticeQueryWrapper.le("ISSUE_TIME",resultEndTime);
            int countZcPurchaseBulletin = zrzyJyzbNoticeService.count(zrzyBgNoticeQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }

        try {
            String strDateFormatYyyyMMdd = "yyyyMMdd";
            Long resultStartTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormatYyyyMMdd));
            Long resultEndTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormatYyyyMMdd));
            QueryWrapper<CqSwIssueBulletin> cqSwIssueBulletinQueryWrapper = new QueryWrapper<CqSwIssueBulletin>();
            cqSwIssueBulletinQueryWrapper.ge("PUBLISH_DATE",resultStartTimeYyyyMMdd);
            cqSwIssueBulletinQueryWrapper.le("PUBLISH_DATE",resultEndTimeYyyyMMdd);
            int countZcPurchaseBulletin = cqSwIssueBulletinService.count(cqSwIssueBulletinQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }

        try {
            String strDateFormatYyyyMMdd = "yyyyMMdd";
            Long resultStartTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormatYyyyMMdd));
            Long resultEndTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormatYyyyMMdd));
            QueryWrapper<CqGqIssueBulletin> cqSwIssueBulletinQueryWrapper = new QueryWrapper<CqGqIssueBulletin>();
            cqSwIssueBulletinQueryWrapper.ge("PUBLISH_DATE",resultStartTimeYyyyMMdd);
            cqSwIssueBulletinQueryWrapper.le("PUBLISH_DATE",resultEndTimeYyyyMMdd);
            int countZcPurchaseBulletin = cqGqIssueBulletinService.count(cqSwIssueBulletinQueryWrapper);
            totalTransaction = totalTransaction + countZcPurchaseBulletin;
        }catch (Exception e){
            e.printStackTrace();
        }

        return totalTransaction;
    }
    public Integer getGcBidpublicityTotal(Date startTime,Date endTime){
        String strDateFormat = "yyyyMMddHHmmss";
        Long resultStartTime  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormat));
        Long resultEndTime  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormat));
        int totalTransaction = 0;
        /*GC_BIDPUBLICITY*/
        try {
            QueryWrapper<GcBidpublicity> gcProjectQueryWrapper = new QueryWrapper<GcBidpublicity>();
            gcProjectQueryWrapper.ge("NOTICE_SEND_TIME",resultStartTime);
            gcProjectQueryWrapper.le("NOTICE_SEND_TIME",resultEndTime);
            int countGcProject = gcBidpublicityService.count(gcProjectQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        try {
            QueryWrapper<ZcBidpublicity> zcBidpublicityQueryWrapper = new QueryWrapper<ZcBidpublicity>();
            zcBidpublicityQueryWrapper.ge("WIN_BID_BULLETIN_START_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("WIN_BID_BULLETIN_START_TIME",resultEndTime);
            int countGcProject = zcBidpublicityService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_TD_BIDWINNOTICE*/
        try {
            QueryWrapper<ZrzyTdBidwinnotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyTdBidwinnotice>();
            zcBidpublicityQueryWrapper.ge("PUBLISHING_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("PUBLISHING_TIME",resultEndTime);
            int countGcProject = zrzyTdBidwinnoticeService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_TKQ_BIDWINNOTICE*/
        try {
            QueryWrapper<ZrzyTkqBidwinnotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyTkqBidwinnotice>();
            zcBidpublicityQueryWrapper.ge("PUBLISHING_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("PUBLISHING_TIME",resultEndTime);
            int countGcProject = zrzyTkqBidwinnoticeService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_CKQ_BIDWINNOTICE*/
        try {
            QueryWrapper<ZrzyCkqBidwinnotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyCkqBidwinnotice>();
            zcBidpublicityQueryWrapper.ge("PUBLISHING_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("PUBLISHING_TIME",resultEndTime);
            int countGcProject = zrzyCkqBidwinnoticeService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_DK_BIDWIN_NOTICE*/
        try {
            QueryWrapper<ZrzyDkBinwinNotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyDkBinwinNotice>();
            zcBidpublicityQueryWrapper.ge("SUBMITS_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("SUBMITS_TIME",resultEndTime);
            int countGcProject = zrzyDkBinwinNoticeService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_BG_BIDWIN_NOTICE*/
        try {
            QueryWrapper<ZrzyBgBidwinNotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyBgBidwinNotice>();
            zcBidpublicityQueryWrapper.ge("ISSUE_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("ISSUE_TIME",resultEndTime);
            int countGcProject = zrzyBgBidwinNoticeService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*ZRZY_JYZB_BIDWIN_NOTICE*/
        try {
            QueryWrapper<ZrzyJyzbBidwinNotice> zcBidpublicityQueryWrapper = new QueryWrapper<ZrzyJyzbBidwinNotice>();
            zcBidpublicityQueryWrapper.ge("ISSUE_TIME",resultStartTime);
            zcBidpublicityQueryWrapper.le("ISSUE_TIME",resultEndTime);
            int countGcProject = zrzyJyzbBidwinNoticeService.count(zcBidpublicityQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*CQ_SW_BARGAIN_RESULT*/
        try {
            String strDateFormatYyyyMMdd = "yyyyMMdd";
            Long resultStartTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormatYyyyMMdd));
            Long resultEndTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormatYyyyMMdd));
            QueryWrapper<CqSwBargainResult> gcProjectQueryWrapper = new QueryWrapper<CqSwBargainResult>();
            gcProjectQueryWrapper.ge("TRADE_DATE",resultStartTimeYyyyMMdd);
            gcProjectQueryWrapper.le("TRADE_DATE",resultEndTimeYyyyMMdd);
            int countGcProject = cqSwBargainResultService.count(gcProjectQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        /*CQ_GQ_BARGAIN_RESULT*/
        try {
            String strDateFormatYyyyMMdd = "yyyyMMdd";
            Long resultStartTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(startTime,strDateFormatYyyyMMdd));
            Long resultEndTimeYyyyMMdd  = Long.parseLong(DateFormatUtils.format(endTime,strDateFormatYyyyMMdd));
            QueryWrapper<CqGqBargainResult> gcProjectQueryWrapper = new QueryWrapper<CqGqBargainResult>();
            gcProjectQueryWrapper.ge("TRADE_DATE",resultStartTimeYyyyMMdd);
            gcProjectQueryWrapper.le("TRADE_DATE",resultEndTimeYyyyMMdd);
            int countGcProject = cqGqBargainResultService.count(gcProjectQueryWrapper);
            totalTransaction = totalTransaction + countGcProject;
        }catch (Exception e){
            e.printStackTrace();
        }
        return totalTransaction;
    }
}
