diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/jyzbwcqkPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/jyzbwcqkPlugin.java new file mode 100644 index 0000000..b71099c --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/xtsy/jyzbwcqkPlugin.java @@ -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> 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 monthSet = IntStream.rangeClosed(currentMonth + 1, 12) + .mapToObj(i -> "monthreal" + i) + .collect(Collectors.toSet()); + Set yearSet = IntStream.rangeClosed(currentMonth + 1, 12) + .mapToObj(i -> "yearreal" + i) + .collect(Collectors.toSet()); + for(Map record : records){ + for (String key : monthSet){ + record.remove( key); + } + for (String key : yearSet){ + record.remove( key); + } + } + + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java index 6c4bab7..52d1701 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/GrBiFsBusinessReal.java @@ -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;