From 80aa982911a4f17be020ee8a42f0e42d2fd0e110 Mon Sep 17 00:00:00 2001 From: cabbage <281119120@qq.com> Date: Thu, 29 May 2025 09:56:32 +0800 Subject: [PATCH] =?UTF-8?q?##=20=E6=95=B0=E6=8D=AE=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=86=99=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CuLianchuangDataStatController.java | 295 ++---- .../mapper/CuLianchuangDataStatMapper.java | 42 +- .../service/ICuLianchuangDataStatService.java | 99 +- .../impl/CuLianchuangDataStatServiceImpl.java | 92 +- .../member/vo/CuLianchuangDataStatVO.java | 42 +- .../report/CuLianchuangDataStatMapper.xml | 993 +++++++++--------- .../com/hzs/common/core/enums/ESheetType.java | 10 +- .../report/stat/CuLianchuangDataStat.java | 9 +- 8 files changed, 675 insertions(+), 907 deletions(-) diff --git a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/controller/manage/CuLianchuangDataStatController.java b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/controller/manage/CuLianchuangDataStatController.java index e4e50d30..b39c32d2 100644 --- a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/controller/manage/CuLianchuangDataStatController.java +++ b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/controller/manage/CuLianchuangDataStatController.java @@ -2,7 +2,7 @@ package com.hzs.report.member.controller.manage; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hzs.common.core.annotation.Log; import com.hzs.common.core.constant.CountryConstants; import com.hzs.common.core.constant.TableNameConstants; @@ -28,14 +28,11 @@ import com.hzs.report.member.vo.CuLianchuangDataStatVO; import com.hzs.report.member.vo.HomeDataStatVO; import com.hzs.system.base.ICurrencyServiceApi; import com.hzs.system.base.dto.CurrencyDTO; -import javafx.util.Pair; -import org.apache.catalina.security.SecurityUtil; import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.math.BigDecimal; import java.time.temporal.ChronoUnit; import java.util.*; @@ -44,30 +41,23 @@ import java.util.stream.Collectors; /** * 联创报表统计 前端控制器 - * - * @author zhangjing - * @since 2023-10-19 */ @RestController @RequestMapping("/manager/cu-lianchuang-data-stat") public class CuLianchuangDataStatController extends BaseController { @Autowired - private ICuLianchuangDataStatService lcStatService; + private ICuLianchuangDataStatService iCuLianchuangDataStatService; @DubboReference IMemberServiceApi iMemberServiceApi; @DubboReference - ICurrencyServiceApi currencyServiceApi; + ICurrencyServiceApi iCurrencyServiceApi; @DubboReference - ICuMemberSettlePeriodServiceApi cuMemberSettlePeriodService; + ICuMemberSettlePeriodServiceApi iCuMemberSettlePeriodServiceApi; /** - * @description: 查询联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:02 - * @param: [lcVO] - * @return: com.hzs.common.core.web.page.TableDataInfo + * 查询联创数据报表 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.SELECT) @GetMapping("/oldList") @@ -77,13 +67,13 @@ public class CuLianchuangDataStatController extends BaseController { Date date = DateUtils.currentDate(); lcVO.setPayTime(DateUtils.parseDateTimeToStr(DateUtils.YYYY_MM_DD, DateUtils.beforeDate(1, ChronoUnit.DAYS, date))); } - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("TYPE", ESheetType.COMBINE.getValue()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.COMBINE.getValue()); if (StringUtils.isNotEmpty(lcVO.getVertexCode())) { - queryWrapper.eq("VERTEX_CODE", lcVO.getVertexCode()); + queryWrapper.eq(CuLianchuangDataStat::getVertexCode, lcVO.getVertexCode()); } - queryWrapper.orderByAsc("CREATION_TIME"); - List lcList = lcStatService.list(queryWrapper); + queryWrapper.orderByAsc(CuLianchuangDataStat::getCreationTime); + List lcList = iCuLianchuangDataStatService.list(queryWrapper); String orderBusinessStr = "2,7,3"; if (CollectionUtil.isNotEmpty(lcList)) { lcList.forEach(itm -> { @@ -114,7 +104,7 @@ public class CuLianchuangDataStatController extends BaseController { //多线程 orderBusinessList.parallelStream().forEach(orderType -> { List orderTypeList = EOrderBusiness.getOrderTypeList(orderType); - List sonList = lcStatService.lcStatListByOrdeType(orderTypeList, orderType, itm); + List sonList = iCuLianchuangDataStatService.lcStatListByOrdeType(orderTypeList, orderType, itm); if (CollectionUtil.isNotEmpty(sonList)) { for (CuLianchuangDataStatVO co : sonList) { switch (EOrderBusiness.getEnumByValue(co.getOrderType())) { @@ -144,7 +134,7 @@ public class CuLianchuangDataStatController extends BaseController { }); }); if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); if (CollectionUtil.isNotEmpty(list)) { list.forEach(itm -> { BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); @@ -163,11 +153,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 查询联创数据报表(优化后) - * @author: zhang jing - * @date: 2024/7/17 13:56 - * @param: [lcVO] - * @return: com.hzs.common.core.web.page.TableDataInfo + * 查询联创数据报表(优化后) **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.SELECT) @GetMapping("/list") @@ -178,13 +164,15 @@ public class CuLianchuangDataStatController extends BaseController { Date date = DateUtils.currentDate(); lcVO.setPayTime(DateUtils.parseDateTimeToStr(DateUtils.YYYY_MM_DD, DateUtils.beforeDate(1, ChronoUnit.DAYS, date))); } - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("TYPE", ESheetType.COMBINE.getValue()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.COMBINE.getValue()); if (StringUtils.isNotEmpty(lcVO.getVertexCode())) { - queryWrapper.eq("VERTEX_CODE", lcVO.getVertexCode()); + queryWrapper.eq(CuLianchuangDataStat::getVertexCode, lcVO.getVertexCode()); } - queryWrapper.orderByAsc("CREATION_TIME"); - List lcList = lcStatService.list(queryWrapper); + queryWrapper.orderByAsc(CuLianchuangDataStat::getCreationTime); + queryWrapper.eq(CuLianchuangDataStat::getVertexCode, "BD31581237"); + + List lcList = iCuLianchuangDataStatService.list(queryWrapper); List lcMemberStr = new ArrayList<>(); if (CollectionUtil.isNotEmpty(lcList)) { lcList.forEach(itm -> { @@ -207,7 +195,7 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkCountry(SecurityUtils.getPkCountry()); //多线程 uniqueList.parallelStream().forEach(itm -> { - List sonList = lcStatService.newLcStatListByOrdeType(lcVO, itm); + List sonList = iCuLianchuangDataStatService.newLcStatListByOrdeType(lcVO, itm); allList.addAll(sonList); }); //按照会员ID进行分组 @@ -234,20 +222,19 @@ public class CuLianchuangDataStatController extends BaseController { calculateAmount(clos, allListstMap); } } - if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); - if (CollectionUtil.isNotEmpty(list)) { - list.forEach(itm -> { - BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); - itm.setFirstPurchasePv(itm.getFirstPurchasePv().multiply(inExchangeRate)); - itm.setRepurchaseOrderPv(itm.getRepurchaseOrderPv().multiply(inExchangeRate)); - itm.setRepurchasePv(itm.getRepurchasePv().multiply(inExchangeRate)); - itm.setFirstPurchaseSumPv(itm.getFirstPurchaseSumPv().multiply(inExchangeRate)); - itm.setRepurchaseOrderSumPv(itm.getRepurchaseOrderSumPv().multiply(inExchangeRate)); - itm.setRepurchaseSumPv(itm.getRepurchaseSumPv().multiply(inExchangeRate)); - }); - } + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + if (CollectionUtil.isNotEmpty(list)) { + list.forEach(itm -> { + BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); + itm.setFirstPurchasePv(itm.getFirstPurchasePv().multiply(inExchangeRate)); + itm.setRepurchaseOrderPv(itm.getRepurchaseOrderPv().multiply(inExchangeRate)); + itm.setRepurchasePv(itm.getRepurchasePv().multiply(inExchangeRate)); + itm.setFirstPurchaseSumPv(itm.getFirstPurchaseSumPv().multiply(inExchangeRate)); + itm.setRepurchaseOrderSumPv(itm.getRepurchaseOrderSumPv().multiply(inExchangeRate)); + itm.setRepurchaseSumPv(itm.getRepurchaseSumPv().multiply(inExchangeRate)); + }); } + return getDataTable(list); } @@ -329,11 +316,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 查询联创数据报表(历史数据) - * @author: zhang jing - * @date: 2024/5/31 17:00 - * @param: [lcVO] - * @return: com.hzs.common.core.web.page.TableDataInfo + * 查询联创数据报表(历史数据) **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.SELECT) @GetMapping("/listHistory") @@ -351,14 +334,14 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkCountry(SecurityUtils.getPkCountry()); //设置表名和期数 setTableNames(lcVO); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("TYPE", ESheetType.COMBINE.getValue()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.COMBINE.getValue()); if (StringUtils.isNotEmpty(lcVO.getVertexCode())) { - queryWrapper.eq("VERTEX_CODE", lcVO.getVertexCode()); + queryWrapper.eq(CuLianchuangDataStat::getVertexCode, lcVO.getVertexCode()); } - queryWrapper.orderByAsc("CREATION_TIME"); - List lcList = lcStatService.list(queryWrapper); - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + queryWrapper.orderByAsc(CuLianchuangDataStat::getCreationTime); + List lcList = iCuLianchuangDataStatService.list(queryWrapper); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); if (CollectionUtil.isNotEmpty(lcList)) { //多线程操作 @@ -369,13 +352,13 @@ public class CuLianchuangDataStatController extends BaseController { processRegions(itm); CuLianchuangDataStatVO cdsVO = BeanUtil.copyProperties(itm, CuLianchuangDataStatVO.class); // 查询首购新增复购新增 - List sonList = lcStatService.lcStatOrdeHistoryList(lcVO, itm); + List sonList = iCuLianchuangDataStatService.lcStatOrdeHistoryList(lcVO, itm); cdsVO.setFirstPurchaseMo(getStatistic(sonList, CuLianchuangDataStatVO::getFirstPurchaseMo)); cdsVO.setFirstPurchasePv(getStatistic(sonList, CuLianchuangDataStatVO::getFirstPurchasePv)); cdsVO.setRepurchaseMo(getStatistic(sonList, CuLianchuangDataStatVO::getRepurchaseMo)); cdsVO.setRepurchasePv(getStatistic(sonList, CuLianchuangDataStatVO::getRepurchasePv)); // 查询首购新增复购累计 - List sonSumList = lcStatService.lcStatOrderHistorySumList(lcVO, itm); + List sonSumList = iCuLianchuangDataStatService.lcStatOrderHistorySumList(lcVO, itm); cdsVO.setFirstPurchaseSumMo(getStatistic(sonSumList, CuLianchuangDataStatVO::getFirstPurchaseSumMo)); cdsVO.setFirstPurchaseSumPv(getStatistic(sonSumList, CuLianchuangDataStatVO::getFirstPurchaseSumPv)); cdsVO.setRepurchaseSumMo(getStatistic(sonSumList, CuLianchuangDataStatVO::getRepurchaseSumMo)); @@ -394,11 +377,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 导出联创数据报表(历史数据) - * @author: zhang jing - * @date: 2023/10/19 16:08 - * @param: [response, lcVO] - * @return: void + * 导出联创数据报表(历史数据) **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.EXPORT) @PostMapping("/exportHistory") @@ -416,14 +395,14 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkCountry(SecurityUtils.getPkCountry()); //设置表名和期数 setTableNames(lcVO); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("TYPE", ESheetType.COMBINE.getValue()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.COMBINE.getValue()); if (StringUtils.isNotEmpty(lcVO.getVertexCode())) { - queryWrapper.eq("VERTEX_CODE", lcVO.getVertexCode()); + queryWrapper.eq(CuLianchuangDataStat::getVertexCode, lcVO.getVertexCode()); } - queryWrapper.orderByAsc("CREATION_TIME"); - List lcList = lcStatService.list(queryWrapper); - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + queryWrapper.orderByAsc(CuLianchuangDataStat::getCreationTime); + List lcList = iCuLianchuangDataStatService.list(queryWrapper); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); if (CollectionUtil.isNotEmpty(lcList)) { //多线程操作 @@ -434,13 +413,13 @@ public class CuLianchuangDataStatController extends BaseController { processRegions(itm); CuLianchuangDataStatHistoryVO cdsVO = BeanUtil.copyProperties(itm, CuLianchuangDataStatHistoryVO.class); // 查询首购新增复购新增 - List sonList = lcStatService.lcStatOrdeHistoryList(lcVO, itm); + List sonList = iCuLianchuangDataStatService.lcStatOrdeHistoryList(lcVO, itm); cdsVO.setFirstPurchaseMo(getStatistic(sonList, CuLianchuangDataStatVO::getFirstPurchaseMo)); cdsVO.setFirstPurchasePv(getStatistic(sonList, CuLianchuangDataStatVO::getFirstPurchasePv)); cdsVO.setRepurchaseMo(getStatistic(sonList, CuLianchuangDataStatVO::getRepurchaseMo)); cdsVO.setRepurchasePv(getStatistic(sonList, CuLianchuangDataStatVO::getRepurchasePv)); // 查询首购新增复购累计 - List sonSumList = lcStatService.lcStatOrderHistorySumList(lcVO, itm); + List sonSumList = iCuLianchuangDataStatService.lcStatOrderHistorySumList(lcVO, itm); cdsVO.setFirstPurchaseSumMo(getStatistic(sonSumList, CuLianchuangDataStatVO::getFirstPurchaseSumMo)); cdsVO.setFirstPurchaseSumPv(getStatistic(sonSumList, CuLianchuangDataStatVO::getFirstPurchaseSumPv)); cdsVO.setRepurchaseSumMo(getStatistic(sonSumList, CuLianchuangDataStatVO::getRepurchaseSumMo)); @@ -480,11 +459,11 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setSettleTableNameSta(TableNameConstants.CU_MEMBER_TREE + startDateMonth); lcVO.setSettleTableNameBefore(TableNameConstants.CU_MEMBER_TREE + beforeDateMonth); lcVO.setSettleTableNameEnd(TableNameConstants.CU_MEMBER_TREE + endDateMonth); - lcVO.setPeriodSta(cuMemberSettlePeriodService.getCuMemberSettlePeriodByDate( + lcVO.setPeriodSta(iCuMemberSettlePeriodServiceApi.getCuMemberSettlePeriodByDate( DateUtils.parseDateToStr(lcVO.getStartDate())).getData().getPkId()); - lcVO.setPeriodBefore(cuMemberSettlePeriodService.getCuMemberSettlePeriodByDate( + lcVO.setPeriodBefore(iCuMemberSettlePeriodServiceApi.getCuMemberSettlePeriodByDate( DateUtils.parseDateToStr(lcVO.getBeforeDate())).getData().getPkId()); - lcVO.setPeriodEnd(cuMemberSettlePeriodService.getCuMemberSettlePeriodByDate( + lcVO.setPeriodEnd(iCuMemberSettlePeriodServiceApi.getCuMemberSettlePeriodByDate( DateUtils.parseDateToStr(lcVO.getEndDate())).getData().getPkId()); } @@ -507,11 +486,7 @@ public class CuLianchuangDataStatController extends BaseController { /** - * @description: 查询国内联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:02 - * @param: [lcVO] - * @return: com.hzs.common.core.web.page.TableDataInfo + * 查询国内联创数据报表 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_HOME_DATA_STAT, method = EOperationMethod.SELECT) @GetMapping("/home-list") @@ -523,12 +498,11 @@ public class CuLianchuangDataStatController extends BaseController { } //查询联创数据报表条件表 - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("TYPE", ESheetType.HOME.getValue()); - queryWrapper.orderByAsc("PK_ID"); - List lcList = lcStatService.list(queryWrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.HOME.getValue()); + queryWrapper.orderByAsc(CuLianchuangDataStat::getPkId); + List lcList = iCuLianchuangDataStatService.list(queryWrapper); if (CollectionUtil.isNotEmpty(lcList)) { - List finalList = list; lcList.forEach(itm -> { itm.setEndDate(lcVO.getPayTime()); itm.setStartDate(DateUtils.currentMonthFirstDateStr(DateUtils.parseStringToDate(lcVO.getPayTime()))); @@ -538,11 +512,11 @@ public class CuLianchuangDataStatController extends BaseController { .collect(Collectors.toList()); itm.setAddRegionList(addRegionList); } - List sonList = lcStatService.lcStatList(Arrays.asList(itm)); - finalList.addAll(sonList); + List sonList = iCuLianchuangDataStatService.lcStatList(Arrays.asList(itm)); + list.addAll(sonList); }); if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); if (CollectionUtil.isNotEmpty(list)) { list.forEach(itm -> { itm.setFirstPurchasePv(itm.getFirstPurchasePv().multiply(currency.getData().getInExchangeRate())); @@ -559,11 +533,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 查询国外联创数据报表 - * @author: zhang jing - * @date: 2023/12/4 10:07 - * @param: [lcVO] - * @return: com.hzs.common.core.web.page.TableDataInfo + * 查询国外联创数据报表 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_ABROAD_DATA_STAT, method = EOperationMethod.SELECT) @GetMapping("/abroad-list") @@ -575,12 +545,12 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setStartDate(DateUtils.currentMonthFirstDateStr(DateUtils.parseStringToDate(lcVO.getPayTime()))); lcVO.setEndDate(lcVO.getPayTime()); //查询国家列表 - List pkCountryList = lcStatService.countryList(); + List pkCountryList = iCuLianchuangDataStatService.countryList(); startPage(); - List list = lcStatService.abroadStatList(pkCountryList, lcVO.getStartDate(), lcVO.getEndDate()); + List list = iCuLianchuangDataStatService.abroadStatList(pkCountryList, lcVO.getStartDate(), lcVO.getEndDate()); //中国汇率 if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { - R currency = currencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); + R currency = iCurrencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); if (CollectionUtil.isNotEmpty(list)) { list.forEach(itm -> { pkCountryList.forEach(itmm -> { @@ -612,11 +582,7 @@ public class CuLianchuangDataStatController extends BaseController { /** - * @description: 导出联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:08 - * @param: [response, lcVO] - * @return: void + * 导出联创数据报表 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.EXPORT) @PostMapping("/export") @@ -627,13 +593,13 @@ public class CuLianchuangDataStatController extends BaseController { Date date = DateUtils.currentDate(); lcVO.setPayTime(DateUtils.parseDateTimeToStr(DateUtils.YYYY_MM_DD, DateUtils.beforeDate(1, ChronoUnit.DAYS, date))); } - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("TYPE", ESheetType.COMBINE.getValue()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.COMBINE.getValue()); if (StringUtils.isNotEmpty(lcVO.getVertexCode())) { - queryWrapper.eq("VERTEX_CODE", lcVO.getVertexCode()); + queryWrapper.eq(CuLianchuangDataStat::getVertexCode, lcVO.getVertexCode()); } - queryWrapper.orderByAsc("CREATION_TIME"); - List lcList = lcStatService.list(queryWrapper); + queryWrapper.orderByAsc(CuLianchuangDataStat::getCreationTime); + List lcList = iCuLianchuangDataStatService.list(queryWrapper); List lcMemberStr = new ArrayList<>(); if (CollectionUtil.isNotEmpty(lcList)) { lcList.forEach(itm -> { @@ -656,7 +622,7 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkCountry(SecurityUtils.getPkCountry()); //多线程 uniqueList.parallelStream().forEach(itm -> { - List sonList = lcStatService.newLcStatListByOrdeType(lcVO, itm); + List sonList = iCuLianchuangDataStatService.newLcStatListByOrdeType(lcVO, itm); allList.addAll(sonList); }); //按照会员ID进行分组 @@ -684,7 +650,7 @@ public class CuLianchuangDataStatController extends BaseController { } } if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); if (CollectionUtil.isNotEmpty(list)) { list.forEach(itm -> { BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); @@ -702,11 +668,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 导出国内联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:08 - * @param: [response, lcVO] - * @return: void + * 导出国内联创数据报表 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_HOME_DATA_STAT, method = EOperationMethod.EXPORT) @PostMapping("/home-export") @@ -718,12 +680,11 @@ public class CuLianchuangDataStatController extends BaseController { } //查询联创数据报表条件表 - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("TYPE", ESheetType.HOME.getValue()); - queryWrapper.orderByAsc("PK_ID"); - List lcList = lcStatService.list(queryWrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(CuLianchuangDataStat::getType, ESheetType.HOME.getValue()); + queryWrapper.orderByAsc(CuLianchuangDataStat::getPkId); + List lcList = iCuLianchuangDataStatService.list(queryWrapper); if (CollectionUtil.isNotEmpty(lcList)) { - List finalList = list; lcList.forEach(itm -> { itm.setEndDate(lcVO.getPayTime()); itm.setStartDate(DateUtils.currentMonthFirstDateStr(DateUtils.parseStringToDate(lcVO.getPayTime()))); @@ -733,13 +694,13 @@ public class CuLianchuangDataStatController extends BaseController { .collect(Collectors.toList()); itm.setAddRegionList(addRegionList); } - List sonList = lcStatService.lcStatList(Arrays.asList(itm)); - finalList.addAll(sonList); + List sonList = iCuLianchuangDataStatService.lcStatList(Arrays.asList(itm)); + list.addAll(sonList); }); } if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); if (CollectionUtil.isNotEmpty(list)) { list.forEach(itm -> { itm.setFirstPurchasePv(itm.getFirstPurchasePv().multiply(currency.getData().getInExchangeRate())); @@ -758,11 +719,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 导出国外联创数据报表 - * @author: zhang jing - * @date: 2023/12/4 10:13 - * @param: [response, lcVO] - * @return: void + * 导出国外联创数据报表 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_ABROAD_DATA_STAT, method = EOperationMethod.EXPORT) @PostMapping("/abroad-export") @@ -775,11 +732,11 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setStartDate(DateUtils.currentMonthFirstDateStr(DateUtils.parseStringToDate(lcVO.getPayTime()))); lcVO.setEndDate(lcVO.getPayTime()); //查询国家列表 - List pkCountryList = lcStatService.countryList(); - List list = lcStatService.abroadStatList(pkCountryList, lcVO.getStartDate(), lcVO.getEndDate()); + List pkCountryList = iCuLianchuangDataStatService.countryList(); + List list = iCuLianchuangDataStatService.abroadStatList(pkCountryList, lcVO.getStartDate(), lcVO.getEndDate()); if (SecurityUtils.getPkCountry().equals(CountryConstants.CHINA_COUNTRY)) { //中国汇率 - R currency = currencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); + R currency = iCurrencyServiceApi.getCurrency(CountryConstants.CHINA_COUNTRY); if (CollectionUtil.isNotEmpty(list)) { list.forEach(itm -> { pkCountryList.forEach(itmm -> { @@ -811,11 +768,7 @@ public class CuLianchuangDataStatController extends BaseController { } /** - * @description: 新增联创查询条件 - * @author: zhang jing - * @date: 2023/10/19 16:17 - * @param: [lcVO] - * @return: com.hzs.common.core.web.domain.AjaxResult + * 新增联创查询条件 **/ @Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.INSERT) @PostMapping("/save") @@ -828,8 +781,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getAddRegion())) { String[] addCodeArray = lcVO.getAddRegion().split(","); if (addCodeArray.length > 0) { - for (int i = 0; i < addCodeArray.length; i++) { - R member = iMemberServiceApi.getMember(addCodeArray[i]); + for (String s : addCodeArray) { + R member = iMemberServiceApi.getMember(s); addRegion.append(member.getData().getPkId()).append(","); } } @@ -838,8 +791,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getReduceRegion())) { String[] reduceCodeArray = lcVO.getReduceRegion().split(","); if (reduceCodeArray.length > 0) { - for (int i = 0; i < reduceCodeArray.length; i++) { - R member = iMemberServiceApi.getMember(reduceCodeArray[i]); + for (String s : reduceCodeArray) { + R member = iMemberServiceApi.getMember(s); reduceRegion.append(member.getData().getPkId()).append(","); } } @@ -849,15 +802,11 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkCreator(userId); lcVO.setCreationTime(date); CuLianchuangDataStat cld = BeanUtil.copyProperties(lcVO, CuLianchuangDataStat.class); - return AjaxResult.success(lcStatService.save(cld)); + return AjaxResult.success(iCuLianchuangDataStatService.save(cld)); } /** - * @description: 国内数据报表查询 - * @author: zhang jing - * @date: 2023/12/4 9:57 - * @param: [lcVO] - * @return: com.hzs.common.core.web.domain.AjaxResult + * 国内数据报表查询 **/ @Log(module = EOperationModule.LEVEL_CONFIG, business = EOperationBusiness.LIANCHUANG_HOME_DATA_STAT, method = EOperationMethod.INSERT) @PostMapping("/home-save") @@ -879,8 +828,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getAddRegion())) { String[] addCodeArray = lcVO.getAddRegion().split(","); if (addCodeArray.length > 0) { - for (int i = 0; i < addCodeArray.length; i++) { - R member = iMemberServiceApi.getMember(addCodeArray[i]); + for (String s : addCodeArray) { + R member = iMemberServiceApi.getMember(s); addRegion.append(member.getData().getPkId()).append(","); } } @@ -890,16 +839,12 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkCreator(userId); lcVO.setCreationTime(date); CuLianchuangDataStat cld = BeanUtil.copyProperties(lcVO, CuLianchuangDataStat.class); - return AjaxResult.success(lcStatService.save(cld)); + return AjaxResult.success(iCuLianchuangDataStatService.save(cld)); } /** - * @description: 修改联创数据报表查询条件 - * @author: zhang jing - * @date: 2023/10/19 17:03 - * @param: [lcVO] - * @return: com.hzs.common.core.web.domain.AjaxResult + * 修改联创数据报表查询条件 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.UPDATE) @PostMapping("/update") @@ -921,8 +866,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getAddRegion())) { String[] addCodeArray = lcVO.getAddRegion().split(","); if (addCodeArray.length > 0) { - for (int i = 0; i < addCodeArray.length; i++) { - R member = iMemberServiceApi.getMember(addCodeArray[i]); + for (String s : addCodeArray) { + R member = iMemberServiceApi.getMember(s); addRegion.append(member.getData().getPkId()).append(","); } } @@ -933,8 +878,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getReduceRegion())) { String[] reduceCodeArray = lcVO.getReduceRegion().split(","); if (reduceCodeArray.length > 0) { - for (int i = 0; i < reduceCodeArray.length; i++) { - R member = iMemberServiceApi.getMember(reduceCodeArray[i]); + for (String s : reduceCodeArray) { + R member = iMemberServiceApi.getMember(s); reduceRegion.append(member.getData().getPkId()).append(","); } } @@ -946,15 +891,11 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkModified(userId); lcVO.setModifiedTime(date); CuLianchuangDataStat cld = BeanUtil.copyProperties(lcVO, CuLianchuangDataStat.class); - return AjaxResult.success(lcStatService.updateById(cld)); + return AjaxResult.success(iCuLianchuangDataStatService.updateById(cld)); } /** - * @description:修改国内联创数据报表查询条件 - * @author: zhang jing - * @date: 2023/12/4 9:59 - * @param: [lcVO] - * @return: com.hzs.common.core.web.domain.AjaxResult + * 修改国内联创数据报表查询条件 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_HOME_DATA_STAT, method = EOperationMethod.UPDATE) @PostMapping("/home-update") @@ -967,8 +908,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getAddRegion())) { String[] addCodeArray = lcVO.getAddRegion().split(","); if (addCodeArray.length > 0) { - for (int i = 0; i < addCodeArray.length; i++) { - R member = iMemberServiceApi.getMember(addCodeArray[i]); + for (String s : addCodeArray) { + R member = iMemberServiceApi.getMember(s); addRegion.append(member.getData().getPkId()).append(","); } } @@ -980,29 +921,25 @@ public class CuLianchuangDataStatController extends BaseController { lcVO.setPkModified(userId); lcVO.setModifiedTime(date); CuLianchuangDataStat cld = BeanUtil.copyProperties(lcVO, CuLianchuangDataStat.class); - return AjaxResult.success(lcStatService.updateById(cld)); + return AjaxResult.success(iCuLianchuangDataStatService.updateById(cld)); } /** - * @description: 查询单条联创数据报表查询条件 - * @author: zhang jing - * @date: 2023/10/19 17:18 - * @param: [pkId] - * @return: com.hzs.common.core.web.domain.AjaxResult + * 查询单条联创数据报表查询条件 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.SELECT) @GetMapping("/getOne/{pkId}") public AjaxResult getOne(@PathVariable Long pkId) { - CuLianchuangDataStat cld = lcStatService.getById(pkId); + CuLianchuangDataStat cld = iCuLianchuangDataStatService.getById(pkId); CuLianchuangDataStatVO lcVO = BeanUtil.copyProperties(cld, CuLianchuangDataStatVO.class); StringBuilder addRegion = new StringBuilder(); StringBuilder reduceRegion = new StringBuilder(); if (StringUtils.isNotEmpty(lcVO.getAddRegion())) { String[] addCodeArray = lcVO.getAddRegion().split(","); if (addCodeArray.length > 0) { - for (int i = 0; i < addCodeArray.length; i++) { - int pkMember = Integer.parseInt(addCodeArray[i]); + for (String s : addCodeArray) { + int pkMember = Integer.parseInt(s); R member = iMemberServiceApi.getMember((long) pkMember); addRegion.append(member.getData().getMemberCode()).append(","); } @@ -1012,8 +949,8 @@ public class CuLianchuangDataStatController extends BaseController { if (StringUtils.isNotEmpty(lcVO.getReduceRegion())) { String[] reduceCodeArray = lcVO.getReduceRegion().split(","); if (reduceCodeArray.length > 0) { - for (int i = 0; i < reduceCodeArray.length; i++) { - int pkMember = Integer.parseInt(reduceCodeArray[i]); + for (String s : reduceCodeArray) { + int pkMember = Integer.parseInt(s); R member = iMemberServiceApi.getMember((long) pkMember); reduceRegion.append(member.getData().getMemberCode()).append(","); } @@ -1025,17 +962,13 @@ public class CuLianchuangDataStatController extends BaseController { /** - * @description: 删除联创数据报表查询条件 - * @author: zhang jing - * @date: 2023/10/19 17:02 - * @param: [pkId] - * @return: com.hzs.common.core.web.domain.AjaxResult + * 删除联创数据报表查询条件 **/ @Log(module = EOperationModule.STATISTIC_ANALYSIS, business = EOperationBusiness.LIANCHUANG_DATA_STAT, method = EOperationMethod.DELETE) @PostMapping("/delete-lcStat") public AjaxResult delete(@RequestBody CuLianchuangDataStatVO lcVO) { if (CollectionUtil.isNotEmpty(lcVO.getPkIdList())) { - lcStatService.deleteLcStat(lcVO.getPkIdList()); + iCuLianchuangDataStatService.deleteLcStat(lcVO.getPkIdList()); } return AjaxResult.success(); } diff --git a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/mapper/CuLianchuangDataStatMapper.java b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/mapper/CuLianchuangDataStatMapper.java index 1604d136..7a0f8b5c 100644 --- a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/mapper/CuLianchuangDataStatMapper.java +++ b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/mapper/CuLianchuangDataStatMapper.java @@ -1,6 +1,5 @@ package com.hzs.report.member.mapper; - import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hzs.common.domain.report.stat.CuLianchuangDataStat; import com.hzs.report.member.vo.AbroadDataStatVO; @@ -10,21 +9,12 @@ import org.apache.ibatis.annotations.Param; import java.util.List; /** - *

* 联创报表统计 Mapper 接口 - *

- * - * @author zhangjing - * @since 2023-10-19 */ public interface CuLianchuangDataStatMapper extends BaseMapper { /** - * @description: 查询联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:01 - * @param: [lcVO] - * @return: java.util.List + * 查询联创数据报表 **/ List lcStatList(@Param("lcList") List lcList); @@ -33,54 +23,34 @@ public interface CuLianchuangDataStatMapper extends BaseMapper + * 联创数据查询(优化后) **/ List newLcStatListByOrdeType(@Param("lcDate") CuLianchuangDataStatVO lcDate, @Param("pkMember") Long pkMember); /** - * @description: 数据报表-联创统计历史业绩数据 - * @author: zhang jing - * @date: 2024/5/30 10:15 - * @param: [orderTypeList, orderType, lcDate] - * @return: java.util.List + * 数据报表-联创统计历史业绩数据 **/ List lcStatOrdeHistoryList(@Param("cds") CuLianchuangDataStatVO cds, @Param("lcDate") CuLianchuangDataStat lcDate); /** - * @description: 数据报表-联创统计历史业绩累计数据 - * @author: zhang jing - * @date: 2024/5/31 11:33 - * @param: [cds, lcDate] - * @return: java.util.List + * 数据报表-联创统计历史业绩累计数据 **/ List lcStatOrderHistorySumList(@Param("cds") CuLianchuangDataStatVO cds, @Param("lcDate") CuLianchuangDataStat lcDate); /** - * @description: 查询国外数据报表 - * @author: zhang jing - * @date: 2023/12/5 10:38 - * @param: [pkCountryList, startDate, endDate] - * @return: java.util.List + * 查询国外数据报表 **/ List abroadStatList(@Param("pkCountryList") List pkCountryList, @Param("startDate") String startDate, @Param("endDate") String endDate); /** - * @description: 国家列表 - * @author: zhang jing - * @date: 2023/12/5 11:23 - * @param: [] - * @return: java.util.List + * 国家列表 **/ List countryList(); diff --git a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/ICuLianchuangDataStatService.java b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/ICuLianchuangDataStatService.java index 9d13be56..99a75bbe 100644 --- a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/ICuLianchuangDataStatService.java +++ b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/ICuLianchuangDataStatService.java @@ -1,93 +1,52 @@ package com.hzs.report.member.service; - import com.baomidou.mybatisplus.extension.service.IService; import com.hzs.common.domain.report.stat.CuLianchuangDataStat; import com.hzs.report.member.vo.AbroadDataStatVO; import com.hzs.report.member.vo.CuLianchuangDataStatVO; -import org.apache.ibatis.annotations.Param; import java.util.List; /** - *

* 联创报表统计 服务类 - *

- * - * @author zhangjing - * @since 2023-10-19 */ public interface ICuLianchuangDataStatService extends IService { - /** - * @description: 查询联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:02 - * @param: [lcVO] - * @return: java.util.List - **/ - List lcStatList(List lcList); + /** + * 查询联创数据报表 + **/ + List lcStatList(List lcList); - List lcStatListByOrdeType(List orderTypeList,Integer orderType,CuLianchuangDataStat lcDate); + List lcStatListByOrdeType(List orderTypeList, Integer orderType, CuLianchuangDataStat lcDate); - /** - * @description: 联创数据查询 - * @author: zhang jing - * @date: 2024/7/17 16:40 - * @param: [orderTypeList, orderType, lcDate] - * @return: java.util.List - **/ - List newLcStatListByOrdeType(CuLianchuangDataStatVO lcDate,Long pkMember); + /** + * 联创数据查询 + **/ + List newLcStatListByOrdeType(CuLianchuangDataStatVO lcDate, Long pkMember); - /** - * @description: 数据报表-联创统计历史业绩数据 - * @author: zhang jing - * @date: 2024/5/30 10:16 - * @param: [orderTypeList, orderType, lcDate] - * @return: java.util.List - **/ - List lcStatOrdeHistoryList(CuLianchuangDataStatVO cds,CuLianchuangDataStat lcDate); - /** - * @description:数据报表-联创统计历史业绩累计数据 - * @author: zhang jing - * @date: 2024/5/31 11:34 - * @param: [cds, lcDate] - * @return: java.util.List - **/ - List lcStatOrderHistorySumList(CuLianchuangDataStatVO cds,CuLianchuangDataStat lcDate); + /** + * 数据报表-联创统计历史业绩数据 + **/ + List lcStatOrdeHistoryList(CuLianchuangDataStatVO cds, CuLianchuangDataStat lcDate); + /** + * 数据报表-联创统计历史业绩累计数据 + **/ + List lcStatOrderHistorySumList(CuLianchuangDataStatVO cds, CuLianchuangDataStat lcDate); + /** + * 查询国外数据报表 + **/ + List abroadStatList(List pkCountryList, String startDate, String endDate); + /** + * 国家列表 + **/ + List countryList(); + /** + * 删除查询联创数据报表条件 + **/ + boolean deleteLcStat(List pkIdList); - - - /** - * @description: 查询国外数据报表 - * @author: zhang jing - * @date: 2023/12/5 10:37 - * @param: [pkCountryList, startDate, endDate] - * @return: java.util.List - **/ - List abroadStatList(List pkCountryList, String startDate, String endDate); - - /** - * @description: 国家列表 - * @author: zhang jing - * @date: 2023/12/5 11:22 - * @param: [] - * @return: java.util.List - **/ - List countryList(); - - - - /** - * @description: 删除查询联创数据报表条件 - * @author: zhang jing - * @date: 2023/10/20 9:45 - * @param: [pkIdList] - * @return: boolean - **/ - boolean deleteLcStat(List pkIdList); } diff --git a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/impl/CuLianchuangDataStatServiceImpl.java b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/impl/CuLianchuangDataStatServiceImpl.java index 6a22fcc4..1ae08785 100644 --- a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/impl/CuLianchuangDataStatServiceImpl.java +++ b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/service/impl/CuLianchuangDataStatServiceImpl.java @@ -1,6 +1,6 @@ package com.hzs.report.member.service.impl; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hzs.common.core.enums.EDelFlag; import com.hzs.common.domain.report.stat.CuLianchuangDataStat; @@ -9,7 +9,6 @@ import com.hzs.report.member.mapper.CuLianchuangDataStatMapper; import com.hzs.report.member.service.ICuLianchuangDataStatService; import com.hzs.report.member.vo.AbroadDataStatVO; import com.hzs.report.member.vo.CuLianchuangDataStatVO; -import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -17,81 +16,36 @@ import java.util.Date; import java.util.List; /** - *

* 联创报表统计 服务实现类 - *

- * - * @author zhangjing - * @since 2023-10-19 */ @Service public class CuLianchuangDataStatServiceImpl extends ServiceImpl implements ICuLianchuangDataStatService { - /** - * @description: 查询联创数据报表 - * @author: zhang jing - * @date: 2023/10/19 16:01 - * @param: [lcVO] - * @return: java.util.List - **/ @Override public List lcStatList(List lcList) { return baseMapper.lcStatList(lcList); } + @Override - public List lcStatListByOrdeType(List orderTypeList,Integer orderType,CuLianchuangDataStat lcDate) { - return baseMapper.lcStatListByOrdeType(orderTypeList,orderType,lcDate); + public List lcStatListByOrdeType(List orderTypeList, Integer orderType, CuLianchuangDataStat lcDate) { + return baseMapper.lcStatListByOrdeType(orderTypeList, orderType, lcDate); } - /** - * @description: 联创数据查询 - * @author: zhang jing - * @date: 2024/7/17 16:40 - * @param: [orderTypeList, orderType, lcDate] - * @return: java.util.List - **/ @Override - public List newLcStatListByOrdeType(CuLianchuangDataStatVO lcDate,Long pkMember) { - return baseMapper.newLcStatListByOrdeType(lcDate,pkMember); + public List newLcStatListByOrdeType(CuLianchuangDataStatVO lcDate, Long pkMember) { + return baseMapper.newLcStatListByOrdeType(lcDate, pkMember); } - /** - * @description: 数据报表-联创统计历史业绩数据 - * @author: zhang jing - * @date: 2024/5/30 10:16 - * @param: [orderTypeList, orderType, lcDate] - * @return: java.util.List - **/ @Override - public List lcStatOrdeHistoryList(CuLianchuangDataStatVO cds,CuLianchuangDataStat lcDate) { - return baseMapper.lcStatOrdeHistoryList(cds,lcDate); + public List lcStatOrdeHistoryList(CuLianchuangDataStatVO cds, CuLianchuangDataStat lcDate) { + return baseMapper.lcStatOrdeHistoryList(cds, lcDate); } - /** - * @description:数据报表-联创统计历史业绩累计数据 - * @author: zhang jing - * @date: 2024/5/31 11:34 - * @param: [cds, lcDate] - * @return: java.util.List - **/ @Override - public List lcStatOrderHistorySumList(CuLianchuangDataStatVO cds,CuLianchuangDataStat lcDate) { - return baseMapper.lcStatOrderHistorySumList(cds,lcDate); + public List lcStatOrderHistorySumList(CuLianchuangDataStatVO cds, CuLianchuangDataStat lcDate) { + return baseMapper.lcStatOrderHistorySumList(cds, lcDate); } - - - - - - - /** - * @description: 查询国外数据报表 - * @author: zhang jing - * @date: 2023/12/5 10:38 - * @param: [pkCountryList, startDate, endDate] - * @return: java.util.List - **/ @Override public List abroadStatList(List pkCountryList, String startDate, @@ -99,36 +53,20 @@ public class CuLianchuangDataStatServiceImpl extends ServiceImpl - **/ @Override public List countryList() { return baseMapper.countryList(); } - - - /** - * @description: 删除查询联创数据报表条件 - * @author: zhang jing - * @date: 2023/10/20 9:46 - * @param: [pkIdList] - * @return: boolean - **/ @Transactional(rollbackFor = Exception.class) @Override public boolean deleteLcStat(List pkIdList) { for (Long l : pkIdList) { - UpdateWrapper updateWrapper = new UpdateWrapper(); - updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue()); - updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId()); - updateWrapper.set("MODIFIED_TIME", new Date()); - updateWrapper.eq("PK_ID", l); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(CuLianchuangDataStat::getDelFlag, EDelFlag.DELETE.getValue()); + updateWrapper.set(CuLianchuangDataStat::getPkModified, SecurityUtils.getUserId()); + updateWrapper.set(CuLianchuangDataStat::getModifiedTime, new Date()); + updateWrapper.eq(CuLianchuangDataStat::getPkId, l); baseMapper.update(null, updateWrapper); } return true; diff --git a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/vo/CuLianchuangDataStatVO.java b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/vo/CuLianchuangDataStatVO.java index b59153d9..5e3b3b87 100644 --- a/bd-business/bd-business-report/src/main/java/com/hzs/report/member/vo/CuLianchuangDataStatVO.java +++ b/bd-business/bd-business-report/src/main/java/com/hzs/report/member/vo/CuLianchuangDataStatVO.java @@ -11,12 +11,7 @@ import java.util.Date; import java.util.List; /** - *

* 联创报表统计VO - *

- * - * @author zhangjing - * @since 2023-10-19 */ @Data public class CuLianchuangDataStatVO { @@ -50,37 +45,37 @@ public class CuLianchuangDataStatVO { /** * 首购新增金额(¥) */ - @Excel(name = "首购新增金额(¥)",scale = 2) + @Excel(name = "首购新增金额(¥)", scale = 2) @BigDecimalFormat private BigDecimal firstPurchaseMo; /** * 首购新增业绩(PV) */ - @Excel(name = "首购新增业绩(PV)",scale = 2) + @Excel(name = "首购新增业绩(PV)", scale = 2) @BigDecimalFormat private BigDecimal firstPurchasePv; /** * 复购专区新增金额(¥) */ - @Excel(name = "复购专区新增金额(¥)",scale = 2) + @Excel(name = "复购专区新增金额(¥)", scale = 2) @BigDecimalFormat private BigDecimal repurchaseOrderMo; /** * 复购专区新增业绩(PV) */ - @Excel(name = "复购专区新增业绩(PV)",scale = 2) + @Excel(name = "复购专区新增业绩(PV)", scale = 2) @BigDecimalFormat private BigDecimal repurchaseOrderPv; /** * 复购新增金额(¥) */ - @Excel(name = "复购新增金额(¥)",scale = 2) + @Excel(name = "复购新增金额(¥)", scale = 2) @BigDecimalFormat private BigDecimal repurchaseMo; /** * 复购新增业绩(PV) */ - @Excel(name = "复购新增业绩(PV)",scale = 2) + @Excel(name = "复购新增业绩(PV)", scale = 2) @BigDecimalFormat private BigDecimal repurchasePv; /** @@ -98,44 +93,44 @@ public class CuLianchuangDataStatVO { /** * 首购累计金额(¥) */ - @Excel(name = "首购累计金额(¥)",scale = 2) + @Excel(name = "首购累计金额(¥)", scale = 2) @BigDecimalFormat private BigDecimal firstPurchaseSumMo; /** * 首购累计业绩(PV) */ - @Excel(name = "首购累计业绩(PV)",scale = 2) + @Excel(name = "首购累计业绩(PV)", scale = 2) @BigDecimalFormat private BigDecimal firstPurchaseSumPv; /** * 复购专区累计金额(¥) */ - @Excel(name = "复购专区累计金额(¥)",scale = 2) + @Excel(name = "复购专区累计金额(¥)", scale = 2) @BigDecimalFormat - private BigDecimal repurchaseOrderSumMo; + private BigDecimal repurchaseOrderSumMo; /** * 复购专区累计业绩(PV) */ - @Excel(name = "复购专区累计业绩(PV)",scale = 2) + @Excel(name = "复购专区累计业绩(PV)", scale = 2) @BigDecimalFormat private BigDecimal repurchaseOrderSumPv; /** * 复购累计金额(¥) */ - @Excel(name = "复购累计金额(¥)",scale = 2) + @Excel(name = "复购累计金额(¥)", scale = 2) @BigDecimalFormat - private BigDecimal repurchaseSumMo; + private BigDecimal repurchaseSumMo; /** * 复购累计业绩(PV) */ - @Excel(name = "复购累计业绩(PV)",scale = 2) + @Excel(name = "复购累计业绩(PV)", scale = 2) @BigDecimalFormat private BigDecimal repurchaseSumPv; /** * 三方累计金额(¥) */ @Excel(name = "三方累计金额(¥)") - private BigDecimal thirdOrderSumMo; + private BigDecimal thirdOrderSumMo; /** * 三方累计业绩(PV) */ @@ -170,7 +165,7 @@ public class CuLianchuangDataStatVO { /** * 订单日期 */ - @Excel(name = "订单日期",dateFormat = "yyyy-MM-dd") + @Excel(name = "订单日期", dateFormat = "yyyy-MM-dd") private String payTime; /** @@ -287,9 +282,4 @@ public class CuLianchuangDataStatVO { private List reduceRegionList; - - - - - } diff --git a/bd-business/bd-business-report/src/main/resources/mapper/report/report/CuLianchuangDataStatMapper.xml b/bd-business/bd-business-report/src/main/resources/mapper/report/report/CuLianchuangDataStatMapper.xml index 2c7beafd..28a56d15 100644 --- a/bd-business/bd-business-report/src/main/resources/mapper/report/report/CuLianchuangDataStatMapper.xml +++ b/bd-business/bd-business-report/src/main/resources/mapper/report/report/CuLianchuangDataStatMapper.xml @@ -4,35 +4,24 @@ - - - - - - - - - - - + + + + + + + + + + + - - - DEL_FLAG, - CREATION_TIME, - MODIFIED_TIME, - PK_COUNTRY, - PK_CREATOR, - PK_MODIFIED, - PK_ID, VERTEX_CODE, VERTEX_NAME, ADD_REGION, REDUCE_REGION - - - + - + - - + - + diff --git a/bd-common/bd-common-core/src/main/java/com/hzs/common/core/enums/ESheetType.java b/bd-common/bd-common-core/src/main/java/com/hzs/common/core/enums/ESheetType.java index 08181b84..36a3b48a 100644 --- a/bd-common/bd-common-core/src/main/java/com/hzs/common/core/enums/ESheetType.java +++ b/bd-common/bd-common-core/src/main/java/com/hzs/common/core/enums/ESheetType.java @@ -5,11 +5,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; /** - * @Description: 数据报表类型 - * @Author: zhangjing - * @Time: 2023/11/4 14:11 - * @Classname: ESheetType - * @PackageName: com.hzs.common.core.enums + * 数据报表类型 */ @AllArgsConstructor @Getter @@ -18,12 +14,12 @@ public enum ESheetType { /** * 数据报表(综合) */ - COMBINE(1, "数据报表", 0,EnumsPrefixConstants.SHEET_TYPE + "1"), + COMBINE(1, "数据报表", 0, EnumsPrefixConstants.SHEET_TYPE + "1"), /** * 国内数据报表 */ - HOME(2, "国内数据报表", 0,EnumsPrefixConstants.SHEET_TYPE + "2"), + HOME(2, "国内数据报表", 0, EnumsPrefixConstants.SHEET_TYPE + "2"), ; diff --git a/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/report/stat/CuLianchuangDataStat.java b/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/report/stat/CuLianchuangDataStat.java index 4248f1bd..cf941bbd 100644 --- a/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/report/stat/CuLianchuangDataStat.java +++ b/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/report/stat/CuLianchuangDataStat.java @@ -10,12 +10,7 @@ import org.apache.ibatis.type.JdbcType; import java.util.List; /** - *

* 联创报表统计 - *

- * - * @author zhangjing - * @since 2023-10-19 */ @Data @EqualsAndHashCode(callSuper = true) @@ -47,13 +42,13 @@ public class CuLianchuangDataStat extends BaseEntity { /** * 加区 */ - @TableField(value = "ADD_REGION", jdbcType = JdbcType.VARCHAR,updateStrategy = FieldStrategy.IGNORED) + @TableField(value = "ADD_REGION", jdbcType = JdbcType.VARCHAR, updateStrategy = FieldStrategy.IGNORED) private String addRegion; /** * 减区 */ - @TableField(value = "REDUCE_REGION", jdbcType = JdbcType.VARCHAR,updateStrategy = FieldStrategy.IGNORED) + @TableField(value = "REDUCE_REGION", jdbcType = JdbcType.VARCHAR, updateStrategy = FieldStrategy.IGNORED) private String reduceRegion;