综合销售情况表,标准品名、客户名称、业务员、区域添加排序
This commit is contained in:
@@ -60,6 +60,17 @@ public class ZhxsqkPlugin implements ReportAroundAdvicePlugin {
|
|||||||
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
||||||
if(!groupFieldList.contains("useMonth") && !groupFieldList.contains("useYear")){
|
if(!groupFieldList.contains("useMonth") && !groupFieldList.contains("useYear")){
|
||||||
setMonthOrderBy(params, page);
|
setMonthOrderBy(params, page);
|
||||||
|
if(!params.containsKey("column")){
|
||||||
|
page.setUnsafeOrderBy(params.get("Group by").toString()
|
||||||
|
.replace("useYear", "use_year desc")
|
||||||
|
.replace("useMonth", "use_month desc")
|
||||||
|
.replace("stdGoodsName", "std_goods_name")
|
||||||
|
.replace("customName", "custom_name")
|
||||||
|
.replace("zoneName", "zone_name")
|
||||||
|
.replace("salerName", "saler_name")
|
||||||
|
.replace("dosageName", "dosage_name")
|
||||||
|
.replace("saleTypeName", "sale_type_name"));
|
||||||
|
}
|
||||||
if(params.get("useYearStart").toString() .equals(params.get("useYearEnd").toString())){
|
if(params.get("useYearStart").toString() .equals(params.get("useYearEnd").toString())){
|
||||||
params.put("isOneYear", true);
|
params.put("isOneYear", true);
|
||||||
}else{
|
}else{
|
||||||
@@ -72,6 +83,17 @@ public class ZhxsqkPlugin implements ReportAroundAdvicePlugin {
|
|||||||
}
|
}
|
||||||
if(groupFieldList.contains("useMonth") || params.containsKey("useMonth")){
|
if(groupFieldList.contains("useMonth") || params.containsKey("useMonth")){
|
||||||
setMonthOrderBy(params, page);
|
setMonthOrderBy(params, page);
|
||||||
|
if(!params.containsKey("column")){
|
||||||
|
page.setUnsafeOrderBy(params.get("Group by").toString()
|
||||||
|
.replace("useYear", "use_year desc")
|
||||||
|
.replace("useMonth", "use_month desc")
|
||||||
|
.replace("stdGoodsName", "std_goods_name")
|
||||||
|
.replace("customName", "custom_name")
|
||||||
|
.replace("zoneName", "zone_name")
|
||||||
|
.replace("salerName", "saler_name")
|
||||||
|
.replace("dosageName", "dosage_name")
|
||||||
|
.replace("saleTypeName", "sale_type_name"));
|
||||||
|
}
|
||||||
List<NewGrBiSaAggMonthCount> newGrBiSaAggList = newGrBiSaAggMonthCountService.selectNewGrBiSaAggGroupMonthList(params, groupFieldList);
|
List<NewGrBiSaAggMonthCount> newGrBiSaAggList = newGrBiSaAggMonthCountService.selectNewGrBiSaAggGroupMonthList(params, groupFieldList);
|
||||||
PageInfo<NewGrBiSaAggMonthCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
PageInfo<NewGrBiSaAggMonthCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
||||||
List<Map<String, Object>> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList());
|
List<Map<String, Object>> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList());
|
||||||
@@ -109,16 +131,17 @@ public class ZhxsqkPlugin implements ReportAroundAdvicePlugin {
|
|||||||
if ("thisYearSaMoneyGrowth".equals(params.get("column"))) {
|
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();
|
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();
|
||||||
}
|
}
|
||||||
if("stdGoodsName".equals(params.get("column"))){
|
commonOrder(params, page, orderBy);
|
||||||
orderBy = "std_goods_name " + params.get("order").toString();
|
}else{
|
||||||
}
|
page.setUnsafeOrderBy(params.get("Group by").toString()
|
||||||
if("customName".equals(params.get("column"))){
|
.replace("useYear", "use_year desc")
|
||||||
orderBy = "custom_name " + params.get("order").toString();
|
.replace("useMonth", "use_month desc")
|
||||||
}
|
.replace("stdGoodsName", "std_goods_name")
|
||||||
if("salerName".equals(params.get("column"))){
|
.replace("customName", "custom_name")
|
||||||
orderBy = "saler_name " + params.get("order").toString();
|
.replace("zoneName", "zone_name")
|
||||||
}
|
.replace("salerName", "saler_name")
|
||||||
page.setUnsafeOrderBy(orderBy);
|
.replace("dosageName", "dosage_name")
|
||||||
|
.replace("saleTypeName", "sale_type_name"));
|
||||||
}
|
}
|
||||||
List<NewGrBiSaAggYearCount> newGrBiSaAggList = newGrBiSaAggYearCountService.selectNewGrBiSaAggGroupYearList(params, groupFieldList);
|
List<NewGrBiSaAggYearCount> newGrBiSaAggList = newGrBiSaAggYearCountService.selectNewGrBiSaAggGroupYearList(params, groupFieldList);
|
||||||
PageInfo<NewGrBiSaAggYearCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
PageInfo<NewGrBiSaAggYearCount> pageInfo = new PageInfo<>(newGrBiSaAggList);
|
||||||
@@ -169,6 +192,12 @@ public class ZhxsqkPlugin implements ReportAroundAdvicePlugin {
|
|||||||
if ("lastMonthSaMoney_yoy".equals(params.get("column"))) {
|
if ("lastMonthSaMoney_yoy".equals(params.get("column"))) {
|
||||||
orderBy = "CAST(TRIM(REGEXP_SUBSTR(lastMonthSaMoney_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString();
|
orderBy = "CAST(TRIM(REGEXP_SUBSTR(lastMonthSaMoney_yoy, '-?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)')) AS DECIMAL(10,2)) " + params.get("order").toString();
|
||||||
}
|
}
|
||||||
|
commonOrder(params, page, orderBy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static void commonOrder(Map<String, Object> params, Page<Object> page, String orderBy) {
|
||||||
if("stdGoodsName".equals(params.get("column"))){
|
if("stdGoodsName".equals(params.get("column"))){
|
||||||
orderBy = "std_goods_name " + params.get("order").toString();
|
orderBy = "std_goods_name " + params.get("order").toString();
|
||||||
}
|
}
|
||||||
@@ -178,7 +207,30 @@ public class ZhxsqkPlugin implements ReportAroundAdvicePlugin {
|
|||||||
if("salerName".equals(params.get("column"))){
|
if("salerName".equals(params.get("column"))){
|
||||||
orderBy = "saler_name " + params.get("order").toString();
|
orderBy = "saler_name " + params.get("order").toString();
|
||||||
}
|
}
|
||||||
|
if("useYear".equals(params.get("column"))){
|
||||||
|
orderBy = "use_year " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("useMonth".equals(params.get("column"))){
|
||||||
|
orderBy = "use_month " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("stdGoodsName".equals(params.get("column"))){
|
||||||
|
orderBy = "std_goods_name " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("customName".equals(params.get("column"))){
|
||||||
|
orderBy = "custom_name " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("zoneName".equals(params.get("column"))){
|
||||||
|
orderBy = "zone_name " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("salerName".equals(params.get("column"))){
|
||||||
|
orderBy = "saler_name " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("dosageName".equals(params.get("column"))){
|
||||||
|
orderBy = "dosage_name " + params.get("order").toString();
|
||||||
|
}
|
||||||
|
if("saleTypeName".equals(params.get("column"))){
|
||||||
|
orderBy = "sale_type_name " + params.get("order").toString();
|
||||||
|
}
|
||||||
page.setUnsafeOrderBy(orderBy);
|
page.setUnsafeOrderBy(orderBy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user