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 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; @GetMapping(value = "/listTotal") public Result 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 gcBidpublicityQueryWrapperSum = new QueryWrapper(); 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 bidpublicityQueryWrapperSum = new QueryWrapper(); 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 zrzyTdBidwinnoticeQuerySum = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapperSum = new QueryWrapper(); zrzyTdBidwinnoticeQueryWrapperSum.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll "); ZrzyTkqBidwinnotice zrzyTkqBidwinnoticeSum = zrzyTkqBidwinnoticeService.getOne(zrzyTdBidwinnoticeQueryWrapperSum); /*ZRZY_CKQ_BIDWINNOTICE*/ QueryWrapper zrzyCkqBidwinnoticeQueryWrapperSum = new QueryWrapper(); zrzyCkqBidwinnoticeQueryWrapperSum.select("sum(cast(QT_PUBLIC_PRICE as decimal(9,2)) * 10000) as sumAll "); ZrzyCkqBidwinnotice zrzyCkqBidwinnoticeSum = zrzyCkqBidwinnoticeService.getOne(zrzyCkqBidwinnoticeQueryWrapperSum); /*ZRZY_DK_BIDWIN_NOTICE*/ QueryWrapper zrzyDkBinwinNoticeQueryWrapperSum = new QueryWrapper(); zrzyDkBinwinNoticeQueryWrapperSum.select("sum(cast(ZB_PRICE as decimal(9,2)) * 10000) as sumAll "); ZrzyDkBinwinNotice zrzyDkBinwinNoticeSum = zrzyDkBinwinNoticeService.getOne(zrzyDkBinwinNoticeQueryWrapperSum); /*ZRZY_BG_BIDWIN_NOTICE*/ QueryWrapper zrzyBgBidwinNoticeQueryWrapperSum = new QueryWrapper(); zrzyBgBidwinNoticeQueryWrapperSum.select("sum(cast(WIN_BID_PRICE as decimal(9,2)) * 10000) as sumAll "); ZrzyBgBidwinNotice zrzyBgBidwinNoticeSum = zrzyBgBidwinNoticeService.getOne(zrzyBgBidwinNoticeQueryWrapperSum); /*ZRZY_JYZB_BIDWIN_NOTICE*/ QueryWrapper zrzyJyzbBidwinNoticeQueryWrapperSum = new QueryWrapper(); zrzyJyzbBidwinNoticeQueryWrapperSum.select("sum(WIN_BID_PRICE) as sumAll"); ZrzyJyzbBidwinNotice zrzyJyzbBidwinNoticeSum = zrzyJyzbBidwinNoticeService.getOne(zrzyJyzbBidwinNoticeQueryWrapperSum); /*CQ_SW_BARGAIN_RESULT*/ QueryWrapper cqSwBargainResultQueryWrapperSum = new QueryWrapper(); 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 cqGqBargainResultQueryWrapperSum = new QueryWrapper(); 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 cityTradeDataList = new ArrayList(); //查询盟市列表 QueryWrapper tRegionQueryWrapper = new QueryWrapper(); tRegionQueryWrapper.eq("parent_code","150000"); tRegionQueryWrapper.orderByAsc("order_num"); List list = tRegionService.list(tRegionQueryWrapper); for (TRegion tRegion : list) { String code = tRegion.getCode(); QueryWrapper platformQueryWrapper = new QueryWrapper(); platformQueryWrapper.eq("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 GcBidpublicityQueryWrapperIn = new QueryWrapper(); GcBidpublicityQueryWrapperIn.eq("PLATFORM_CODE",platformCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity + gcBidpublicityService.count(GcBidpublicityQueryWrapperIn); QueryWrapper zcBidpublicityQueryWrapperIn = new QueryWrapper(); zcBidpublicityQueryWrapperIn.eq("PLATFORM_CODE",platformCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity + zcBidpublicityService.count(zcBidpublicityQueryWrapperIn); QueryWrapper zrzyTdBidwinnoticeQueryWrapperIn = new QueryWrapper(); zrzyTdBidwinnoticeQueryWrapperIn.likeRight("region_code",regionCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyTdBidwinnoticeService.count(zrzyTdBidwinnoticeQueryWrapperIn); QueryWrapper zrzyTkqBidwinnoticeQueryWrapperIn = new QueryWrapper(); zrzyTkqBidwinnoticeQueryWrapperIn.likeRight("region_code",regionCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyTkqBidwinnoticeService.count(zrzyTkqBidwinnoticeQueryWrapperIn); QueryWrapper zrzyCkqBidwinnoticeQueryWrapperIn = new QueryWrapper(); zrzyCkqBidwinnoticeQueryWrapperIn.likeRight("region_code",regionCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyCkqBidwinnoticeService.count(zrzyCkqBidwinnoticeQueryWrapperIn); QueryWrapper zrzyDkBinwinNoticeQueryWrapperIn = new QueryWrapper(); zrzyDkBinwinNoticeQueryWrapperIn.likeRight("zone",regionCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyDkBinwinNoticeService.count(zrzyDkBinwinNoticeQueryWrapperIn); QueryWrapper zrzyBgBidwinNoticeQueryWrapperIn = new QueryWrapper(); zrzyBgBidwinNoticeQueryWrapperIn.eq("PLATFORM_CODE",platformCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyBgBidwinNoticeService.countNoticeByRegionCode(regionCode); QueryWrapper zrzyJyzbBidwinNoticeQueryWrapperIn = new QueryWrapper(); zrzyJyzbBidwinNoticeQueryWrapperIn.eq("PLATFORM_CODE",platformCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +zrzyJyzbBidwinNoticeService.countNoticeByRegionCode(regionCode); QueryWrapper GcBidpublicityQueryWrapperSelfIn = new QueryWrapper(); GcBidpublicityQueryWrapperSelfIn.eq("PLATFORM_CODE",platformCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity +cqSwBargainResultService.countByRegionCode(regionCode); QueryWrapper cqGqBargainResultWrapperSelfIn = new QueryWrapper(); cqGqBargainResultWrapperSelfIn.likeRight("region_code",regionCode); totalBusinessTotalDataCity = totalBusinessTotalDataCity + cqGqBargainResultService.count(cqGqBargainResultWrapperSelfIn); cityTradeData.setBusinessTotalData( totalBusinessTotalDataCity ); QueryWrapper ztLegalinfoQueryWrapperIn = new QueryWrapper(); ztLegalinfoQueryWrapperIn.likeRight("REGION_CODE",regionCode); cityTradeData.setSubTotalData(ztLegalinfoService.count(ztLegalinfoQueryWrapperIn)); QueryWrapper gcBidpublicityQueryWrapperSumInIn = new QueryWrapper(); 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 bidpublicityQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyTdBidwinnoticeQuerySumInIn = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyCkqBidwinnoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyDkBinwinNoticeQueryWrapperSumInIn = new QueryWrapper(); 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 cqGqBargainResultQueryWrapperSumInIn = new QueryWrapper(); 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)); } } cityTradeData.setTotalTransactionVolume( bigTotal.toString() ); QueryWrapper gcBidpublicityQueryWrapperInCount = new QueryWrapper(); gcBidpublicityQueryWrapperInCount.eq("PLATFORM_CODE",platformCode); int count = gcBidpublicityService.count(gcBidpublicityQueryWrapperInCount); if(!ObjectUtils.isEmpty(count)){ cityTradeData.setTotalNumberTransactions(count); } 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 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 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 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 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 platformQueryWrapper = new QueryWrapper(); 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 gcNoticeandfileQueryWrapper = new QueryWrapper(); gcNoticeandfileQueryWrapper.gt("NOTICE_SEND_TIME",formatStartTime); gcNoticeandfileQueryWrapper.le("NOTICE_SEND_TIME",formatDateEnd); int countGcNoticeandfile = gcNoticeandfileService.count(gcNoticeandfileQueryWrapper); QueryWrapper gcNoticeandfileQueryWrapperPlatformCode = new QueryWrapper(); 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 zcPurchaseBulletinQueryWrapper = new QueryWrapper(); zcPurchaseBulletinQueryWrapper.gt("CREATE_TIME",formatStartTime); zcPurchaseBulletinQueryWrapper.le("CREATE_TIME",formatDateEnd); int countZcPurchaseBulletin = zcProjectService.count(zcPurchaseBulletinQueryWrapper); QueryWrapper zcPurchaseBulletinQueryWrapperSelf = new QueryWrapper(); zcPurchaseBulletinQueryWrapperSelf.gt("CREATE_TIME",formatStartTime); zcPurchaseBulletinQueryWrapperSelf.le("CREATE_TIME",formatDateEnd); zcPurchaseBulletinQueryWrapperSelf.eq("PLATFORM_CODE",platformCode); int countZcPurchaseBulletinSelf = zcProjectService.count(zcPurchaseBulletinQueryWrapperSelf); categoryDataZf.setTotalAssemble(countZcPurchaseBulletin); categoryDataZf.setTotalSelf(countZcPurchaseBulletinSelf); categoryData.setCategoryDataZf(categoryDataZf); /* * 政府采购-结束 */ /* * 土地矿权-开始 */ CategoryDataTd categoryDataTd= new CategoryDataTd(); QueryWrapper zrzyTdCedeNoticeQueryWrapper = new QueryWrapper(); zrzyTdCedeNoticeQueryWrapper.gt("PUBLISHING_TIME",formatStartTime); zrzyTdCedeNoticeQueryWrapper.le("PUBLISHING_TIME",formatDateEnd); int countZrzyTdCedeNotice = zrzyTdCedeNoticeService.count(zrzyTdCedeNoticeQueryWrapper); try { /*Zrzy_Tkq_Notice*/ QueryWrapper zrzyTkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyCkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyDkNoticeQueryWrapper = new QueryWrapper(); 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 zrzyBgNoticeQueryWrapper = new QueryWrapper(); 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 zrzyJyzbNoticeQueryWrapper = new QueryWrapper(); zrzyJyzbNoticeQueryWrapper.gt("ISSUE_TIME",formatStartTime); zrzyJyzbNoticeQueryWrapper.le("ISSUE_TIME",formatDateEnd); int countZrzyCkqNotice = zrzyJyzbNoticeService.count(zrzyJyzbNoticeQueryWrapper); countZrzyTdCedeNotice = countZrzyTdCedeNotice + countZrzyCkqNotice; }catch (Exception e){ e.printStackTrace(); } QueryWrapper zrzyTdCedeNoticeQueryWrapperSelf = new QueryWrapper(); 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 zrzyTkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyCkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyDkNoticeQueryWrapper = new QueryWrapper(); 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 zrzyBgNoticeQueryWrapper = new QueryWrapper(); 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 zrzyJyzbNoticeQueryWrapper = new QueryWrapper(); 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 cqSwIssueBulletinQueryWrapper = new QueryWrapper(); cqSwIssueBulletinQueryWrapper.gt("PUBLISH_DATE",formatStartTime.substring(0,8)); cqSwIssueBulletinQueryWrapper.le("PUBLISH_DATE",formatDateEnd.substring(0,8)); int countSwIssueBulletin = cqSwIssueBulletinService.count(cqSwIssueBulletinQueryWrapper); QueryWrapper cqSwIssueBulletinQueryWrapperSelf = new QueryWrapper(); 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 cqGqIssueBulletinQueryWrapper = new QueryWrapper(); cqGqIssueBulletinQueryWrapper.gt("PUBLISH_DATE",formatStartTime.substring(0,8)); cqGqIssueBulletinQueryWrapper.le("PUBLISH_DATE",formatDateEnd.substring(0,8)); int countSwIssueBulletGQin = cqGqIssueBulletinService.count(cqGqIssueBulletinQueryWrapper); QueryWrapper cqGqIssueBulletinQueryWrapperSelf = new QueryWrapper(); 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 categoryDataQtQueryWrapper = new QueryWrapper(); categoryDataQtQueryWrapper.gt("PUBLISHING_TIME",formatStartTime); categoryDataQtQueryWrapper.le("PUBLISHING_TIME",formatDateEnd); int countQtjyNotice = qtjyNoticeService.count(categoryDataQtQueryWrapper); QueryWrapper otherTradePubInfoQueryWrapper = new QueryWrapper(); otherTradePubInfoQueryWrapper.ge("PUBLISHING_TIME",formatStartTime); otherTradePubInfoQueryWrapper.le("PUBLISHING_TIME",formatDateEnd); int countOtherTrade = otherTradePubInfoService.count(otherTradePubInfoQueryWrapper); QueryWrapper categoryDataQtQueryWrapperSelf = new QueryWrapper(); categoryDataQtQueryWrapperSelf.gt("PUBLISHING_TIME",formatStartTime); categoryDataQtQueryWrapperSelf.le("PUBLISHING_TIME",formatDateEnd); categoryDataQtQueryWrapperSelf.likeRight("region_code",regionCode); QueryWrapper otherTradePubInfoQueryWrapperSelf = new QueryWrapper(); 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> publishingCategoryDataList( @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode ) throws ParseException { List 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(); } //获取区域编码对应的国标编码 AreaPlatform areaPlatform = null; try { QueryWrapper platformQueryWrapper = new QueryWrapper(); 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 gcBidpublicityQueryWrapper = new QueryWrapper(); gcBidpublicityQueryWrapper.eq("PLATFORM_CODE",platformCode); int countGcBidpublicity = gcBidpublicityService.count(gcBidpublicityQueryWrapper); quantityStatisticsEngineeringConstruction.setTotalAssemble(countGcBidpublicity); quantityStatisticsEngineeringConstruction.setTitle("工程建设"); statisticsAssembles.add(quantityStatisticsEngineeringConstruction); /*工程建设结束*/ /*政府采购-开始*/ QuantityStatisticsAssemble quantityStatisticsGovernmentProcurement = new QuantityStatisticsAssemble(); QueryWrapper zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapper = new QueryWrapper(); zrzyTdBidwinnoticeQueryWrapper.eq("PLATFORM_CODE",platformCode); int countZrzyTdBidwinnotice = zrzyTdBidwinnoticeService.count(zrzyTdBidwinnoticeQueryWrapper); try { /*Zrzy_Tkq_Notice*/ QueryWrapper zrzyTkqNoticeQueryWrapper = new QueryWrapper(); zrzyTkqNoticeQueryWrapper.likeRight("region_code",regionCode); int countZrzyTkqNotice = zrzyTkqNoticeService.count(zrzyTkqNoticeQueryWrapper); countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyTkqNotice; }catch (Exception e){ e.printStackTrace(); } try { /*ZRZY_CKQ_NOTICE*/ QueryWrapper zrzyCkqNoticeQueryWrapper = new QueryWrapper(); zrzyCkqNoticeQueryWrapper.likeRight("region_code",regionCode); int countZrzyCkqNotice = zrzyCkqNoticeService.count(zrzyCkqNoticeQueryWrapper); countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice; }catch (Exception e){ e.printStackTrace(); } try { /*ZRZY_DK_NOTICE*/ QueryWrapper zrzyDkNoticeQueryWrapper = new QueryWrapper(); zrzyDkNoticeQueryWrapper.likeRight("zone",regionCode); int countZrzyCkqNotice = zrzyDkNoticeService.count(zrzyDkNoticeQueryWrapper); countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice; }catch (Exception e){ e.printStackTrace(); } try { /*ZRZY_BG_NOTICE*/ QueryWrapper zrzyBgNoticeQueryWrapper = new QueryWrapper(); zrzyBgNoticeQueryWrapper.likeRight("zone",regionCode); int countZrzyCkqNotice = zrzyBgNoticeService.count(zrzyBgNoticeQueryWrapper); countZrzyTdBidwinnotice = countZrzyTdBidwinnotice + countZrzyCkqNotice; }catch (Exception e){ e.printStackTrace(); } try { /*ZRZY_JYZB_NOTICE*/ QueryWrapper zrzyJyzbNoticeQueryWrapper = new QueryWrapper(); 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 cqGqBargainResultQueryWrapper = new QueryWrapper(); 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 tradePubInfoQueryWrapper = new QueryWrapper(); 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> publishingCategoryMoneyList( @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode ) throws ParseException { List 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(); } //获取区域编码对应的国标编码 AreaPlatform areaPlatform = null; try { QueryWrapper platformQueryWrapper = new QueryWrapper(); 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 gcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapper = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyCkqBidwinnoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyDkBinwinNoticeQueryWrapperSumInIn = new QueryWrapper(); 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 cqGqBargainResultQueryWrapper = new QueryWrapper(); 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 bidpublicityQueryWrapper = new QueryWrapper(); 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 otherTradeResultInfoQueryWrapperIn = new QueryWrapper(); 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> publishingCategoryMoneyYueList( @RequestParam(name="platformCode", defaultValue="121500004600236091") String platformCode ) throws ParseException { List 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(); } //获取区域编码对应的国标编码 AreaPlatform areaPlatform = null; try { QueryWrapper platformQueryWrapper = new QueryWrapper(); 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 gcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapper = new QueryWrapper(); 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 zrzyTdBidwinnoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyCkqBidwinnoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyDkBinwinNoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyBgBidwinNoticeQueryWrapperSumInIn = new QueryWrapper(); 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 zrzyJyzbBidwinNoticeQueryWrapperSumInIn = new QueryWrapper(); 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 cqGqBargainResultQueryWrapperSumInIn = new QueryWrapper(); 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 qtjyBidpublicityQueryWrapper = new QueryWrapper(); 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 otherTradeResultInfoQueryWrapperIn = new QueryWrapper(); 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 result = new ArrayList(); 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 gcPackageQueryWrapper = new QueryWrapper(); 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 zcPurchaseBulletinQueryWrapper = new QueryWrapper(); 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 zrzyTdCedeInfoQueryWrapper = new QueryWrapper(); 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 zrzyTkqProjectInfoQueryWrapper = new QueryWrapper(); 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 zrzyTkqProjectInfoQueryWrapper = new QueryWrapper(); 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 zrzyTkqProjectInfoQueryWrapper = new QueryWrapper(); 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 zrzyTkqProjectInfoQueryWrapper = new QueryWrapper(); 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 zrzyTkqProjectInfoQueryWrapper = new QueryWrapper(); 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 gcProjectQueryWrapper = new QueryWrapper(); 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 gcProjectQueryWrapper = new QueryWrapper(); 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 gcProjectQueryWrapper = new QueryWrapper(); gcProjectQueryWrapper.ge("BID_OPENING_TIME",resultStartTime); gcProjectQueryWrapper.le("BID_OPENING_TIME",resultEndTime); 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 gcProjectQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcPurchaseBulletinQueryWrapper = new QueryWrapper(); 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 zrzyTdCedeNoticeQueryWrapper = new QueryWrapper(); 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 zrzyTkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyTkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyTkqNoticeQueryWrapper = new QueryWrapper(); 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 zrzyBgNoticeQueryWrapper = new QueryWrapper(); 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 zrzyBgNoticeQueryWrapper = new QueryWrapper(); 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 cqSwIssueBulletinQueryWrapper = new QueryWrapper(); 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 cqSwIssueBulletinQueryWrapper = new QueryWrapper(); 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 gcProjectQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 zcBidpublicityQueryWrapper = new QueryWrapper(); 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 gcProjectQueryWrapper = new QueryWrapper(); 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 gcProjectQueryWrapper = new QueryWrapper(); 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; } }