diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/NewGrBiSaAggMonthCountController.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/NewGrBiSaAggMonthCountController.java index ca1dd86..9c28b96 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/NewGrBiSaAggMonthCountController.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/NewGrBiSaAggMonthCountController.java @@ -4,7 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import com.lideeyunji.core.framework.enhance.example.report.xtsy.zhxsqkPlugin; +import com.lideeyunji.core.framework.enhance.example.report.xtsy.ZhxsqkPlugin; import com.lideeyunji.core.framework.entity.NewGrBiSaAgg; import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount; import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount; @@ -123,7 +123,7 @@ public class NewGrBiSaAggMonthCountController extends BaseController { Map params = FuncWeb.getParameterBodyMap(req); Page page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString())); - zhxsqkPlugin.setMonthOrderBy(params, page); + ZhxsqkPlugin.setMonthOrderBy(params, page); List newGrBiSaAggList = newGrBiSaAggService.selectNewGrBiSaAggList(params); PageInfo pageInfo = new PageInfo<>(newGrBiSaAggList); List> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList()); diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/KcqmltjPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/KcqmltjPlugin.java new file mode 100644 index 0000000..b2eb843 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/KcqmltjPlugin.java @@ -0,0 +1,55 @@ + +package com.lideeyunji.core.framework.enhance.example.report.xtsy; + +import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; +import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAfterAdvicePlugin; +import com.lideeyunji.core.framework.utils.Func; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * 报表-库存全品种统计表-插件 + */ +@Slf4j +@Component("kcqmltjPlugin") +public class KcqmltjPlugin implements ReportAfterAdvicePlugin { + + @Override + public void execute(EnhanceReportContext enhanceContext) { + List> records = enhanceContext.getResult().getRecords(); + if (Func.isEmpty(records)) { + return; + } + + for(Map record : records){ + if(!record.containsKey("remmoney")){ + record.put("remmoney","-"); + } + if(!record.containsKey("monthsamoney")){ + record.put("monthsamoney","-"); + } + if(!record.containsKey("sksa")){ + record.put("sksa","-"); + } + if(!record.containsKey("thissamoney")){ + record.put("thissamoney","-"); + } + if(!record.containsKey("thisprofit")){ + record.put("thisprofit","-"); + } + if(!record.containsKey("thisprofitrate")){ + record.put("thisprofitrate","-"); + } + if(!record.containsKey("maxage")){ + record.put("maxage","-"); + } + if(!record.containsKey("goodsid")){ + record.put("goodsid","-"); + } + } + + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ProuctAvlPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ProuctAvlPlugin.java new file mode 100644 index 0000000..a627662 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ProuctAvlPlugin.java @@ -0,0 +1,41 @@ + +package com.lideeyunji.core.framework.enhance.example.report.xtsy; + +import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; +import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAfterAdvicePlugin; +import com.lideeyunji.core.framework.utils.Func; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * 产品可销库存表- 增强 + */ +@Component("prouctAvlPlugin") +public class ProuctAvlPlugin implements ReportAfterAdvicePlugin { + + @Override + public void execute(EnhanceReportContext enhanceContext) { + List> records = enhanceContext.getResult().getRecords(); + if (Func.isEmpty(records)) { + return; + } + + for(Map record : records){ + if(!record.containsKey("rem")){ + record.put("rem","-"); + } + if(!record.containsKey("thismonthout")){ + record.put("thismonthout","-"); + } + if(!record.containsKey("lastmonthout")){ + record.put("lastmonthout","-"); + } + if(!record.containsKey("thisyearout")){ + record.put("thisyearout","-"); + } + } + + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ProuctPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ProuctPlugin.java new file mode 100644 index 0000000..5cd2f77 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ProuctPlugin.java @@ -0,0 +1,41 @@ + +package com.lideeyunji.core.framework.enhance.example.report.xtsy; + +import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; +import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAfterAdvicePlugin; +import com.lideeyunji.core.framework.utils.Func; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * 库存产品占比表- 增强 + */ +@Component("prouctPlugin") +public class ProuctPlugin implements ReportAfterAdvicePlugin { + + @Override + public void execute(EnhanceReportContext enhanceContext) { + List> records = enhanceContext.getResult().getRecords(); + if (Func.isEmpty(records)) { + return; + } + + for(Map record : records){ + if(!record.containsKey("money_prop")){ + record.put("money_prop","-"); + } + if(!record.containsKey("money")){ + record.put("money","-"); + } + if(!record.containsKey("qty")){ + record.put("qty","-"); + } + if(!record.containsKey("qty_prop")){ + record.put("qty_prop","-"); + } + } + + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkLineReportEnhance.java similarity index 99% rename from lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java rename to lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkLineReportEnhance.java index 8b05546..e532d41 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkLineReportEnhance.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkLineReportEnhance.java @@ -18,7 +18,7 @@ import java.util.Map; */ @Slf4j @Component("zhxsqkLineReportEnhance") -public class zhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin { +public class ZhxsqkLineReportEnhance implements ReportBeforeAdvicePlugin { @Override public void execute(EnhanceReportContext enhanceContext) { diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPlugin.java similarity index 99% rename from lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPlugin.java rename to lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPlugin.java index b6d7279..ed5bdd1 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPlugin.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPlugin.java @@ -29,7 +29,7 @@ import java.util.stream.Collectors; */ @Slf4j @Component("zhxsqkPlugin") -public class zhxsqkPlugin implements ReportAroundAdvicePlugin { +public class ZhxsqkPlugin implements ReportAroundAdvicePlugin { @Resource INewGrBiSaAggService newGrBiSaAggService; diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginJx.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginJx.java new file mode 100644 index 0000000..f8c136a --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginJx.java @@ -0,0 +1,109 @@ + +package com.lideeyunji.core.framework.enhance.example.report.xtsy; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.ListUtil; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; +import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAroundAdvicePlugin; +import com.lideeyunji.core.framework.entity.NewGrBiSaAggMonthCount; +import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount; +import com.lideeyunji.core.framework.service.INewGrBiSaAggMonthCountService; +import com.lideeyunji.core.framework.service.INewGrBiSaAggYearCountService; +import com.lideeyunji.tool.framework.yunji.model.ResultDataModel; +import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.NotNull; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static com.lideeyunji.core.framework.enhance.example.report.xtsy.ZhxsqkPlugin.setMonthOrderBy; + +/** + * 报表-综合销售表_剂型-插件 + */ +@Slf4j +@Component("zhxsqkPluginJx") +public class ZhxsqkPluginJx implements ReportAroundAdvicePlugin { + + @Resource + INewGrBiSaAggYearCountService newGrBiSaAggYearCountService; + + @Resource + INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService; + + @Override + public ResultDataModel executeAround(EnhanceReportContext enhanceContext) { + log.info("进入=======>zhxsqkPluginJx=======>execute"); + List groupFieldList = ListUtil.toList("useYear","dosageName"); + return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService, newGrBiSaAggMonthCountService); + } + + @NotNull + static ResultDataModel zhxsqkFun(EnhanceReportContext enhanceContext, List groupFieldList, INewGrBiSaAggYearCountService newGrBiSaAggYearCountService, INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService) { + Map params = enhanceContext.getParam().getParams(); + if(params.containsKey("useMonth")){ + groupFieldList.add("useMonth"); + params.put("useMonthStart", params.get("useMonth")); + params.put("useMonthEnd", params.get("useMonth")); + } + if(params.containsKey("useYear")){ + params.put("useYearStart", params.get("useYear")); + params.put("useYearEnd", params.get("useYear")); + } + Page page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString())); + if(groupFieldList.contains("useMonth") || params.containsKey("useMonth")){ + setMonthOrderBy(params, page); + List newGrBiSaAggList = newGrBiSaAggMonthCountService.selectNewGrBiSaAggGroupMonthList(params, groupFieldList); + PageInfo pageInfo = new PageInfo<>(newGrBiSaAggList); + List> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList()); + return ResultDataModel.fomat(pageInfo.getTotal(),list); + }else{ + if(params.containsKey("column")){ + String orderBy = ""; + if ("thisYearSaQty".equals(params.get("column"))) { + orderBy = "this_year_sa_qty " + params.get("order").toString(); + } + if ("saqty_yoy".equals(params.get("column"))) { + orderBy = "CAST(TRIM(REGEXP_SUBSTR(saqty_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); + } + if ("thisYearSaMoney".equals(params.get("column"))) { + orderBy = "this_year_sa_money " + params.get("order").toString(); + } + if ("samoney_yoy".equals(params.get("column"))) { + orderBy = "CAST(TRIM(REGEXP_SUBSTR(samoney_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); + } + if ("thisYearProfit".equals(params.get("column"))) { + orderBy = "this_year_profit " + params.get("order").toString(); + } + if ("profit_yoy".equals(params.get("column"))) { + orderBy = "CAST(TRIM(REGEXP_SUBSTR(profit_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); + } + if ("thisYearCost".equals(params.get("column"))) { + orderBy = "this_year_cost " + params.get("order").toString(); + } + if ("thisYearSaMoneyShare".equals(params.get("column"))) { + orderBy = "this_year_sa_money_share " + params.get("order").toString(); + } + if ("thisprofitshare".equals(params.get("column"))) { + orderBy = "thisprofitshare " + params.get("order").toString(); + } + if ("thisYearSaMoneyGrowth".equals(params.get("column"))) { + orderBy = "CAST(TRIM(REGEXP_SUBSTR(this_year_sa_money_growth, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); + } + page.setUnsafeOrderBy(orderBy); + } + List newGrBiSaAggList = newGrBiSaAggYearCountService.selectNewGrBiSaAggGroupYearList(params, groupFieldList); + PageInfo pageInfo = new PageInfo<>(newGrBiSaAggList); + List> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList()); + return ResultDataModel.fomat(pageInfo.getTotal(),list); + } + + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginLxfl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginLxfl.java similarity index 69% rename from lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginLxfl.java rename to lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginLxfl.java index ceab523..ecef607 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginLxfl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginLxfl.java @@ -1,33 +1,38 @@ package com.lideeyunji.core.framework.enhance.example.report.xtsy; +import cn.hutool.core.collection.ListUtil; import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAroundAdvicePlugin; +import com.lideeyunji.core.framework.service.INewGrBiSaAggMonthCountService; import com.lideeyunji.core.framework.service.INewGrBiSaAggYearCountService; import com.lideeyunji.tool.framework.yunji.model.ResultDataModel; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.Arrays; import java.util.List; -import static com.lideeyunji.core.framework.enhance.example.report.xtsy.zhxsqkPluginJx.zhxsqkFun; +import static com.lideeyunji.core.framework.enhance.example.report.xtsy.ZhxsqkPluginJx.zhxsqkFun; /** * 报表-综合销售表_剂型-插件 */ @Slf4j @Component("zhxsqkPluginLxfl") -public class zhxsqkPluginLxfl implements ReportAroundAdvicePlugin { +public class ZhxsqkPluginLxfl implements ReportAroundAdvicePlugin { @Resource INewGrBiSaAggYearCountService newGrBiSaAggYearCountService; + @Resource + INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService; + + @Override public ResultDataModel executeAround(EnhanceReportContext enhanceContext) { log.info("进入=======>zhxsqkPluginLxfl=======>execute"); - List groupFieldList = Arrays.asList("useYear","effectName"); - return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService); + List groupFieldList = ListUtil.toList("useYear","effectName"); + return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService, newGrBiSaAggMonthCountService); } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginXslx.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginXslx.java similarity index 69% rename from lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginXslx.java rename to lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginXslx.java index 92b0953..79026d1 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginXslx.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/ZhxsqkPluginXslx.java @@ -1,33 +1,38 @@ package com.lideeyunji.core.framework.enhance.example.report.xtsy; +import cn.hutool.core.collection.ListUtil; import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAroundAdvicePlugin; +import com.lideeyunji.core.framework.service.INewGrBiSaAggMonthCountService; import com.lideeyunji.core.framework.service.INewGrBiSaAggYearCountService; import com.lideeyunji.tool.framework.yunji.model.ResultDataModel; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.Arrays; import java.util.List; -import static com.lideeyunji.core.framework.enhance.example.report.xtsy.zhxsqkPluginJx.zhxsqkFun; +import static com.lideeyunji.core.framework.enhance.example.report.xtsy.ZhxsqkPluginJx.zhxsqkFun; /** * 报表-综合销售表_剂型-插件 */ @Slf4j @Component("zhxsqkPluginXslx") -public class zhxsqkPluginXslx implements ReportAroundAdvicePlugin { +public class ZhxsqkPluginXslx implements ReportAroundAdvicePlugin { @Resource INewGrBiSaAggYearCountService newGrBiSaAggYearCountService; + @Resource + INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService; + + @Override public ResultDataModel executeAround(EnhanceReportContext enhanceContext) { log.info("进入=======>zhxsqkPluginXslx=======>execute"); - List groupFieldList = Arrays.asList("useYear","saleTypeName"); - return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService); + List groupFieldList = ListUtil.toList("useYear","saleTypeName"); + return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService, newGrBiSaAggMonthCountService); } } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginJx.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginJx.java deleted file mode 100644 index e58c141..0000000 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/zhxsqkPluginJx.java +++ /dev/null @@ -1,83 +0,0 @@ - -package com.lideeyunji.core.framework.enhance.example.report.xtsy; - -import cn.hutool.core.bean.BeanUtil; -import com.github.pagehelper.Page; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.lideeyunji.core.framework.config.aspect.enhancereport.model.EnhanceReportContext; -import com.lideeyunji.core.framework.config.aspect.enhancereport.plugin.ReportAroundAdvicePlugin; -import com.lideeyunji.core.framework.entity.NewGrBiSaAggYearCount; -import com.lideeyunji.core.framework.service.INewGrBiSaAggYearCountService; -import com.lideeyunji.tool.framework.yunji.model.ResultDataModel; -import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * 报表-综合销售表_剂型-插件 - */ -@Slf4j -@Component("zhxsqkPluginJx") -public class zhxsqkPluginJx implements ReportAroundAdvicePlugin { - - @Resource - INewGrBiSaAggYearCountService newGrBiSaAggYearCountService; - - @Override - public ResultDataModel executeAround(EnhanceReportContext enhanceContext) { - log.info("进入=======>zhxsqkPluginJx=======>execute"); - List groupFieldList = Arrays.asList("useYear","dosageName"); - return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService); - } - - @NotNull - static ResultDataModel zhxsqkFun(EnhanceReportContext enhanceContext, List groupFieldList, INewGrBiSaAggYearCountService newGrBiSaAggYearCountService) { - Map params = enhanceContext.getParam().getParams(); - Page page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString())); - if(params.containsKey("column")){ - String orderBy = ""; - if ("thisYearSaQty".equals(params.get("column"))) { - orderBy = "this_year_sa_qty " + params.get("order").toString(); - } - if ("saqty_yoy".equals(params.get("column"))) { - orderBy = "CAST(TRIM(REGEXP_SUBSTR(saqty_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); - } - if ("thisYearSaMoney".equals(params.get("column"))) { - orderBy = "this_year_sa_money " + params.get("order").toString(); - } - if ("samoney_yoy".equals(params.get("column"))) { - orderBy = "CAST(TRIM(REGEXP_SUBSTR(samoney_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); - } - if ("thisYearProfit".equals(params.get("column"))) { - orderBy = "this_year_profit " + params.get("order").toString(); - } - if ("profit_yoy".equals(params.get("column"))) { - orderBy = "CAST(TRIM(REGEXP_SUBSTR(profit_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); - } - if ("thisYearCost".equals(params.get("column"))) { - orderBy = "this_year_cost " + params.get("order").toString(); - } - if ("thisYearSaMoneyShare".equals(params.get("column"))) { - orderBy = "this_year_sa_money_share " + params.get("order").toString(); - } - if ("thisprofitshare".equals(params.get("column"))) { - orderBy = "thisprofitshare " + params.get("order").toString(); - } - if ("thisYearSaMoneyGrowth".equals(params.get("column"))) { - orderBy = "CAST(TRIM(REGEXP_SUBSTR(this_year_sa_money_growth, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString(); - } - page.setUnsafeOrderBy(orderBy); - } - List newGrBiSaAggList = newGrBiSaAggYearCountService.selectNewGrBiSaAggGroupYearList(params, groupFieldList); - PageInfo pageInfo = new PageInfo<>(newGrBiSaAggList); - List> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList()); - return ResultDataModel.fomat(pageInfo.getTotal(),list); - } -} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/NewGrBiSaAggServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/NewGrBiSaAggServiceImpl.java index cc52dfc..75c4f76 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/NewGrBiSaAggServiceImpl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/NewGrBiSaAggServiceImpl.java @@ -1,6 +1,7 @@ package com.lideeyunji.core.framework.service.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -100,6 +101,24 @@ public class NewGrBiSaAggServiceImpl extends ServiceImpl 0, 100, 0) ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END), 2)) + ELSE '0.00' END AS monthsaqty_yoy, CASE WHEN (CASE WHEN yoy_month.yoy_month_sa_money = 0 THEN IF(current_month.this_month_sa_money > 0, 100, 0) @@ -657,6 +658,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" current_month.dosage_id, current_month.dosage_name, + + current_month.effect_id, + current_month.effect_name, + current_month.std_goods_name, @@ -680,6 +685,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END)<0 THEN CONCAT('🔴 ', ROUND((CASE WHEN yoy_month.yoy_month_sa_qty = 0 THEN IF(current_month.this_month_sa_qty > 0, 100, 0) ELSE (current_month.this_month_sa_qty - yoy_month.yoy_month_sa_qty) / yoy_month.yoy_month_sa_qty * 100 END), 2)) + ELSE '0.00' END AS monthsaqty_yoy, CASE WHEN (CASE WHEN yoy_month.yoy_month_sa_money = 0 THEN IF(current_month.this_month_sa_money > 0, 100, 0) @@ -754,7 +760,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dosage_id, dosage_name, - + + effect_id, + effect_name, + saler_id, saler_name, @@ -797,6 +806,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{name} + and effect_name in + + #{name} + + and goods_name in #{name} @@ -844,6 +858,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dosage_id, dosage_name, + + effect_id, + effect_name, + saler_id, saler_name, @@ -871,6 +889,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dosage_id, + + effect_id, + saler_id, @@ -900,6 +921,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dosage_id, + + effect_id, + saler_id, @@ -924,6 +948,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND current_month.dosage_id = last_month_data.dosage_id + + AND current_month.effect_id = last_month_data.effect_id + AND current_month.saler_id = last_month_data.saler_id @@ -948,6 +975,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dosage_id, + + effect_id, + saler_id, @@ -979,6 +1009,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{name} + and effect_name in + + #{name} + + and goods_name in #{name} @@ -1022,6 +1057,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dosage_id, + + effect_id, + saler_id, @@ -1048,6 +1086,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND yoy_month.dosage_id = current_month.dosage_id + + AND yoy_month.effect_id = current_month.effect_id + AND yoy_month.saler_id = current_month.saler_id @@ -1089,6 +1130,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{name} + and current_month.effect_name in + + #{name} + + and current_month.goods_name in #{name}