综合销售 处理查询调整 添加疗效分类
This commit is contained in:
@@ -2,12 +2,15 @@
|
||||
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;
|
||||
@@ -20,6 +23,8 @@ 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;
|
||||
|
||||
/**
|
||||
* 报表-综合销售表_剂型-插件
|
||||
*/
|
||||
@@ -30,17 +35,36 @@ public class ZhxsqkPluginJx implements ReportAroundAdvicePlugin {
|
||||
@Resource
|
||||
INewGrBiSaAggYearCountService newGrBiSaAggYearCountService;
|
||||
|
||||
@Resource
|
||||
INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService;
|
||||
|
||||
@Override
|
||||
public ResultDataModel executeAround(EnhanceReportContext enhanceContext) {
|
||||
log.info("进入=======>zhxsqkPluginJx=======>execute");
|
||||
List<String> groupFieldList = Arrays.asList("useYear","dosageName");
|
||||
return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService);
|
||||
List<String> groupFieldList = ListUtil.toList("useYear","dosageName");
|
||||
return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService, newGrBiSaAggMonthCountService);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static ResultDataModel zhxsqkFun(EnhanceReportContext enhanceContext, List<String> groupFieldList, INewGrBiSaAggYearCountService newGrBiSaAggYearCountService) {
|
||||
static ResultDataModel zhxsqkFun(EnhanceReportContext enhanceContext, List<String> groupFieldList, INewGrBiSaAggYearCountService newGrBiSaAggYearCountService, INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService) {
|
||||
Map<String, Object> 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<Object> 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<NewGrBiSaAggMonthCount> newGrBiSaAggList = newGrBiSaAggMonthCountService.selectNewGrBiSaAggGroupMonthList(params, groupFieldList);
|
||||
PageInfo<NewGrBiSaAggMonthCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
||||
List<Map<String, Object>> 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"))) {
|
||||
@@ -80,4 +104,6 @@ public class ZhxsqkPluginJx implements ReportAroundAdvicePlugin {
|
||||
List<Map<String, Object>> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList());
|
||||
return ResultDataModel.fomat(pageInfo.getTotal(),list);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
|
||||
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;
|
||||
@@ -24,10 +25,14 @@ public class ZhxsqkPluginLxfl implements ReportAroundAdvicePlugin {
|
||||
@Resource
|
||||
INewGrBiSaAggYearCountService newGrBiSaAggYearCountService;
|
||||
|
||||
@Resource
|
||||
INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService;
|
||||
|
||||
|
||||
@Override
|
||||
public ResultDataModel executeAround(EnhanceReportContext enhanceContext) {
|
||||
log.info("进入=======>zhxsqkPluginLxfl=======>execute");
|
||||
List<String> groupFieldList = Arrays.asList("useYear","effectName");
|
||||
return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService);
|
||||
List<String> groupFieldList = ListUtil.toList("useYear","effectName");
|
||||
return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService, newGrBiSaAggMonthCountService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
|
||||
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;
|
||||
@@ -24,10 +25,14 @@ public class ZhxsqkPluginXslx implements ReportAroundAdvicePlugin {
|
||||
@Resource
|
||||
INewGrBiSaAggYearCountService newGrBiSaAggYearCountService;
|
||||
|
||||
@Resource
|
||||
INewGrBiSaAggMonthCountService newGrBiSaAggMonthCountService;
|
||||
|
||||
|
||||
@Override
|
||||
public ResultDataModel executeAround(EnhanceReportContext enhanceContext) {
|
||||
log.info("进入=======>zhxsqkPluginXslx=======>execute");
|
||||
List<String> groupFieldList = Arrays.asList("useYear","saleTypeName");
|
||||
return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService);
|
||||
List<String> groupFieldList = ListUtil.toList("useYear","saleTypeName");
|
||||
return zhxsqkFun(enhanceContext, groupFieldList, newGrBiSaAggYearCountService, newGrBiSaAggMonthCountService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -658,6 +658,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
current_month.dosage_id,
|
||||
current_month.dosage_name,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
current_month.effect_id,
|
||||
current_month.effect_name,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('stdGoodsName') || params.containsKey('stdGoodsName')">
|
||||
current_month.std_goods_name,
|
||||
</if>
|
||||
@@ -756,7 +760,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
dosage_id,
|
||||
dosage_name,
|
||||
</if>
|
||||
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
effect_id,
|
||||
effect_name,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
saler_id,
|
||||
saler_name,
|
||||
@@ -799,6 +806,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.effectName != null and saAggParam.effectName != ''"> and effect_name in
|
||||
<foreach collection="saAggParam.effectName" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.goodsName != null and saAggParam.goodsName != ''"> and goods_name in
|
||||
<foreach collection="saAggParam.goodsName" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
@@ -846,6 +858,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
dosage_id,
|
||||
dosage_name,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
effect_id,
|
||||
effect_name,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
saler_id,
|
||||
saler_name,
|
||||
@@ -873,6 +889,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||
dosage_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
effect_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
saler_id,
|
||||
</if>
|
||||
@@ -902,6 +921,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||
dosage_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
effect_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
saler_id,
|
||||
</if>
|
||||
@@ -926,6 +948,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||
AND current_month.dosage_id = last_month_data.dosage_id
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
AND current_month.effect_id = last_month_data.effect_id
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
AND current_month.saler_id = last_month_data.saler_id
|
||||
</if>
|
||||
@@ -950,6 +975,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||
dosage_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
effect_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
saler_id,
|
||||
</if>
|
||||
@@ -981,6 +1009,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.effectName != null and saAggParam.effectName != ''"> and effect_name in
|
||||
<foreach collection="saAggParam.effectName" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.goodsName != null and saAggParam.goodsName != ''"> and goods_name in
|
||||
<foreach collection="saAggParam.goodsName" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
@@ -1024,6 +1057,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||
dosage_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
effect_id,
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
saler_id,
|
||||
</if>
|
||||
@@ -1050,6 +1086,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="groupFieldList.contains('dosageName') || params.containsKey('dosageName')">
|
||||
AND yoy_month.dosage_id = current_month.dosage_id
|
||||
</if>
|
||||
<if test="groupFieldList.contains('effectName') || params.containsKey('effectName')">
|
||||
AND yoy_month.effect_id = current_month.effect_id
|
||||
</if>
|
||||
<if test="groupFieldList.contains('salerName') || params.containsKey('salerName')">
|
||||
AND yoy_month.saler_id = current_month.saler_id
|
||||
</if>
|
||||
@@ -1091,6 +1130,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.effectName != null and saAggParam.effectName != ''"> and current_month.effect_name in
|
||||
<foreach collection="saAggParam.effectName" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="saAggParam.goodsName != null and saAggParam.goodsName != ''"> and current_month.goods_name in
|
||||
<foreach collection="saAggParam.goodsName" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
|
||||
Reference in New Issue
Block a user