Commit fd467a0a by zhangkb

修改报表3数据生成

parent b72b2864
...@@ -54,7 +54,7 @@ public class IndicatorReportCtrl { ...@@ -54,7 +54,7 @@ public class IndicatorReportCtrl {
@ApiOperation(value = "整合考核指标报表数据3", notes = "整合考核指标报表数据3") @ApiOperation(value = "整合考核指标报表数据3", notes = "整合考核指标报表数据3")
@PostMapping(value = "/dealDriveReportThree") @PostMapping(value = "/dealDriveReportThree")
public String dealDriveReportThree(@RequestBody List<CompareUnitDef> compareUnitList, public String dealDriveReportThree(@RequestBody List<CompareUnitDef> compareUnitList,
@RequestParam String code) { @RequestParam String code) throws Exception{
Map<String,String> compareObjMap = new HashMap<>(); Map<String,String> compareObjMap = new HashMap<>();
Integer date = null; Integer date = null;
for(CompareUnitDef unitDef : compareUnitList) { for(CompareUnitDef unitDef : compareUnitList) {
......
...@@ -59,7 +59,7 @@ public class IndicatorsReportService { ...@@ -59,7 +59,7 @@ public class IndicatorsReportService {
return reportTwoData.getId(); return reportTwoData.getId();
} }
public synchronized void batchSaveOrUpdateReportThree(List<IndicatorsReportThree> reportThreeDatas) { public void batchSaveOrUpdateReportThree(List<IndicatorsReportThree> reportThreeDatas) {
List<IndicatorsReportThree> addList = new ArrayList<>(); List<IndicatorsReportThree> addList = new ArrayList<>();
List<IndicatorsReportThree> updateList = new ArrayList<>(); List<IndicatorsReportThree> updateList = new ArrayList<>();
for(IndicatorsReportThree reportThreeData : reportThreeDatas) { for(IndicatorsReportThree reportThreeData : reportThreeDatas) {
...@@ -133,7 +133,7 @@ public class IndicatorsReportService { ...@@ -133,7 +133,7 @@ public class IndicatorsReportService {
} }
public void dealDriveIndReportThreeData(String compareId,List<String> indIds, public void dealDriveIndReportThreeData(String compareId,List<String> indIds,
Integer date,String code) { Integer date,String code) throws Exception{
List<IndicatorsReportThree> dataList = new ArrayList<>(); List<IndicatorsReportThree> dataList = new ArrayList<>();
String type = this.getCompareType(date); String type = this.getCompareType(date);
for(String indId : indIds) { for(String indId : indIds) {
...@@ -153,6 +153,7 @@ public class IndicatorsReportService { ...@@ -153,6 +153,7 @@ public class IndicatorsReportService {
findByIndIdAndDateAndCompareIdAndSort(indId, date, compareId,code); findByIndIdAndDateAndCompareIdAndSort(indId, date, compareId,code);
if(!calResults.isEmpty()) { if(!calResults.isEmpty()) {
for(DriveIndCalResultDef calResult : calResults) { for(DriveIndCalResultDef calResult : calResults) {
//判断是否存在
IndicatorsReportThree indReportData = reportThreeMapper.getByParam( IndicatorsReportThree indReportData = reportThreeMapper.getByParam(
calResult.getCompareObj(), date, type, code); calResult.getCompareObj(), date, type, code);
if(indReportData == null) { if(indReportData == null) {
...@@ -231,7 +232,6 @@ public class IndicatorsReportService { ...@@ -231,7 +232,6 @@ public class IndicatorsReportService {
} }
//算提升前三末三指标个数 //算提升前三末三指标个数
if(!improveValue.isEmpty()) { if(!improveValue.isEmpty()) {
logger.info("进来提升前三末三程序");
Map<String,Integer> resultRank = new HashMap<>(); Map<String,Integer> resultRank = new HashMap<>();
resultRank = CalculateUtils.rankValue(improveValue, indRule); resultRank = CalculateUtils.rankValue(improveValue, indRule);
//提升前三 //提升前三
...@@ -249,6 +249,7 @@ public class IndicatorsReportService { ...@@ -249,6 +249,7 @@ public class IndicatorsReportService {
dataList = this.fillImproveHeadAndAfterCount(resultRank, dataList, 1, code); dataList = this.fillImproveHeadAndAfterCount(resultRank, dataList, 1, code);
this.batchSaveOrUpdateReportThree(dataList); this.batchSaveOrUpdateReportThree(dataList);
} }
Thread.sleep(2000);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment