1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083 |
- 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<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);
- for (TRegion tRegion : list) {
- String code = tRegion.getCode();
- QueryWrapper<AreaPlatform> platformQueryWrapper = new QueryWrapper<AreaPlatform>();
- 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<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);
- cityTradeData.setBusinessTotalData(
- totalBusinessTotalDataCity
- );
- 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));
- }
- }
- 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);
- }
- 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);
- 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);
- 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;
- }
- }
|