bug 处理, 产品可销库存 和 库存产品占比表 排序和显示'-'冲突问题处理,

This commit is contained in:
king
2026-04-16 10:16:52 +08:00
parent fd85567f30
commit 25873076c6
3 changed files with 84 additions and 2 deletions

View File

@@ -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<String, Object> params = FuncWeb.getParameterBodyMap(req);
Page<Object> page = PageHelper.startPage(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()));
zhxsqkPlugin.setMonthOrderBy(params, page);
ZhxsqkPlugin.setMonthOrderBy(params, page);
List<NewGrBiSaAgg> newGrBiSaAggList = newGrBiSaAggService.selectNewGrBiSaAggList(params);
PageInfo<NewGrBiSaAgg> pageInfo = new PageInfo<>(newGrBiSaAggList);
List<Map<String, Object>> list = newGrBiSaAggList.stream().map(BeanUtil::beanToMap).collect(Collectors.toList());

View File

@@ -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<Map<String, Object>> records = enhanceContext.getResult().getRecords();
if (Func.isEmpty(records)) {
return;
}
for(Map<String, Object> 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","-");
}
}
}
}

View File

@@ -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<Map<String, Object>> records = enhanceContext.getResult().getRecords();
if (Func.isEmpty(records)) {
return;
}
for(Map<String, Object> 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","-");
}
}
}
}