计算销售报表-经营指标完成情况-添加后缀过滤
经营指标完成情况对象-添加注释
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
|
||||
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.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* 报表-系统首页-单表
|
||||
*/
|
||||
@Component("jyzbwcqkPlugin")
|
||||
public class jyzbwcqkPlugin implements ReportAfterAdvicePlugin {
|
||||
|
||||
@Override
|
||||
public void execute(EnhanceReportContext enhanceContext) {
|
||||
List<Map<String, Object>> records = enhanceContext.getResult().getRecords();
|
||||
if (Func.isEmpty(records)) {
|
||||
return;
|
||||
}
|
||||
if (!enhanceContext.getParam().getParams().containsKey("useyear")){
|
||||
return;
|
||||
}
|
||||
String useyear = enhanceContext.getParam().getParams().get("useyear").toString();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
String currentYear = Integer.toString(now.getYear());
|
||||
int currentMonth = now.getMonthValue();
|
||||
if (!useyear.equals(currentYear)) {
|
||||
return;
|
||||
}
|
||||
Set<String> monthSet = IntStream.rangeClosed(currentMonth + 1, 12)
|
||||
.mapToObj(i -> "monthreal" + i)
|
||||
.collect(Collectors.toSet());
|
||||
Set<String> yearSet = IntStream.rangeClosed(currentMonth + 1, 12)
|
||||
.mapToObj(i -> "yearreal" + i)
|
||||
.collect(Collectors.toSet());
|
||||
for(Map<String, Object> record : records){
|
||||
for (String key : monthSet){
|
||||
record.remove( key);
|
||||
}
|
||||
for (String key : yearSet){
|
||||
record.remove( key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -40,18 +37,33 @@ public class GrBiFsBusinessReal implements Serializable {
|
||||
@TableField(value = "ITEMORDER")
|
||||
private String itemOrder;
|
||||
|
||||
/**
|
||||
* 月度完成情况
|
||||
*/
|
||||
@TableField(value = "MONTH_REAL")
|
||||
private String monthReal;
|
||||
|
||||
/**
|
||||
* 年度完成情况
|
||||
*/
|
||||
@TableField(value = "YEAR_REAL")
|
||||
private String yearReal;
|
||||
|
||||
/**
|
||||
* 月度差标情况(万)
|
||||
*/
|
||||
@TableField(value = "MONTH_DIFF")
|
||||
private String monthDiff;
|
||||
|
||||
/**
|
||||
* 全年指标(万)
|
||||
*/
|
||||
@TableField(value = "YEAR_PLAN")
|
||||
private String yearPlan;
|
||||
|
||||
/**
|
||||
* 年度达成率
|
||||
*/
|
||||
@TableField(value = "YEAR_RATE")
|
||||
private String yearRate;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user