From 1e269eb149d05fd13f0c7ddb8d71368c6a8fa907 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 27 Feb 2024 09:38:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E7=AB=AF=E9=A5=BC=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceImpl/tea/ClassScoreServiceImpl.java | 2 ++ .../java/com/sztzjy/fund_investment/task/Task.java | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 8b6d979..bc72c82 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -128,6 +128,8 @@ public class ClassScoreServiceImpl implements ClassScoreService { teaClassScoreDto.setSchoolGoodCount(schoolGoodCount); teaClassScoreDto.setSchoolGeneralCount(schoolGeneralCount); teaClassScoreDto.setSchoolFailCount(schoolFailCount); + teaClassScoreDto.setSchoolMaxScore(maxScoreBySchoolId); + teaClassScoreDto.setSchoolMinScore(minScoreBySchoolId); if (teaClassScores.size() > 0) { BigDecimal finalAVGScore = avgScoreBySchoolId.divide(BigDecimal.valueOf(teaClassScores.size()), 2, RoundingMode.HALF_UP); teaClassScoreDto.setClassAverageScore(finalAVGScore); diff --git a/src/main/java/com/sztzjy/fund_investment/task/Task.java b/src/main/java/com/sztzjy/fund_investment/task/Task.java index 5f32e6f..10e1431 100644 --- a/src/main/java/com/sztzjy/fund_investment/task/Task.java +++ b/src/main/java/com/sztzjy/fund_investment/task/Task.java @@ -38,7 +38,7 @@ public class Task { // 查到单个班级下所有的已经在投资报告页面提交过的学生的总成绩 // 算平均值,存表 //查出所有数据 - List classIdList = performanceScoreMapper.selectClassId(); + List classIdList = performanceScoreMapper.selectClassId(); for (String classId : classIdList) { BigDecimal avgScore = BigDecimal.ZERO; BigDecimal count = BigDecimal.ZERO; @@ -53,12 +53,12 @@ public class Task { gradeCounts.put("fail", 0); BigDecimal classMaxScore = BigDecimal.ZERO; // 最高分,默认为0 BigDecimal classMinScore = null; // 最低分,默认为null - String schoolId =""; + String schoolId = ""; for (PerformanceScore score : performanceScores2) { //第一个比较对象 BigDecimal totalScore = score.getTotalScore(); - if (totalScore==null){ - totalScore=BigDecimal.ZERO; + if (totalScore == null) { + totalScore = BigDecimal.ZERO; } schoolId = score.getSchoolId(); //没提交报告的 算0分跳过 @@ -105,14 +105,14 @@ public class Task { teaClassScore.setGeneralCount(gradeCounts.get("general")); teaClassScore.setFailCount(gradeCounts.get("fail")); teaClassScore.setClassId(classId); - UserExample userTableExample =new UserExample(); + UserExample userTableExample = new UserExample(); userTableExample.createCriteria().andSchoolIdEqualTo(schoolId).andClassIdEqualTo(classId).andRoleIdEqualTo(4); List userTables = userMapper.selectByExample(userTableExample); User userTable = userTables.get(0); teaClassScore.setClassName(userTable.getClassName()); - if (count.compareTo(BigDecimal.ZERO)==0){ + if (count.compareTo(BigDecimal.ZERO) == 0) { teaClassScore.setClassAverageScore(BigDecimal.ZERO); - }else { + } else { BigDecimal divideScore = avgScore.divide(count, 2, RoundingMode.HALF_UP); teaClassScore.setClassAverageScore(divideScore); } From 338a9521b0efd3a1e3540937307fe01809a1b240 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 27 Feb 2024 10:23:40 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E7=AB=AF=E9=A5=BC=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/serviceImpl/tea/ClassScoreServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index bc72c82..3e1144a 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -87,6 +87,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { public TeaClassScoreDto getClassScoreCount(String schoolId, String classId, Date time) { TeaClassScoreExample teaClassScoreExample = new TeaClassScoreExample(); TeaClassScoreExample.Criteria criteria = teaClassScoreExample.createCriteria(); + Date startTime = null; //班级框为空 统计学校下的所有数据返回 if (classId == null && schoolId != null) { criteria.andSchoolIdEqualTo(schoolId).andStartTimeEqualTo(time); @@ -122,6 +123,7 @@ public class ClassScoreServiceImpl implements ClassScoreService { } //所有班级平均分累加 avgScoreBySchoolId = avgScoreBySchoolId.add(teaClassScore.getClassAverageScore()).setScale(2, RoundingMode.HALF_UP); + startTime = teaClassScore.getStartTime(); } TeaClassScoreDto teaClassScoreDto = new TeaClassScoreDto(); teaClassScoreDto.setSchoolExcellentCount(schoolExcellentCount); @@ -130,9 +132,10 @@ public class ClassScoreServiceImpl implements ClassScoreService { teaClassScoreDto.setSchoolFailCount(schoolFailCount); teaClassScoreDto.setSchoolMaxScore(maxScoreBySchoolId); teaClassScoreDto.setSchoolMinScore(minScoreBySchoolId); + teaClassScoreDto.setStartTime(startTime); if (teaClassScores.size() > 0) { BigDecimal finalAVGScore = avgScoreBySchoolId.divide(BigDecimal.valueOf(teaClassScores.size()), 2, RoundingMode.HALF_UP); - teaClassScoreDto.setClassAverageScore(finalAVGScore); + teaClassScoreDto.setSchoolAverageScore(finalAVGScore); } return teaClassScoreDto; } else { //选中某个班级返回 From 7b3e3df4b74e5788ef1fdfb5558de3680f2470a2 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 27 Feb 2024 16:08:06 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E7=AB=AF=E9=A5=BC=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/tea/TeaTopicManageController.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java index 3f7cd6a..da1c8e3 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java @@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.controller.tea; import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.annotation.AnonymousAccess; +import com.sztzjy.fund_investment.entity.QuestionAnswerExample; import com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs; import com.sztzjy.fund_investment.entity.TopicsWithBLOBs; import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto; @@ -111,7 +112,15 @@ public class TeaTopicManageController { @GetMapping("/getQuestionById") @ApiOperation("互动答疑/获取单条互动数据") public ResultEntity getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) { - return new ResultEntity(questionAnswerMapper.selectByPrimaryKey(questionId)); +// QuestionAnswerWithBLOBs questionAnswerWithBLOBs = questionAnswerMapper.selectByPrimaryKey(questionId); + QuestionAnswerExample answerExample = new QuestionAnswerExample(); + answerExample.createCriteria().andIdEqualTo(questionId); + List questionAnswerWithBLOBs = questionAnswerMapper.selectByExampleWithBLOBs(answerExample); + if (!questionAnswerWithBLOBs.isEmpty()){ + QuestionAnswerWithBLOBs questionAnswerWithBLOBs1 = questionAnswerWithBLOBs.get(0); + return new ResultEntity<>(questionAnswerWithBLOBs1); + } + return new ResultEntity<>(new QuestionAnswerWithBLOBs()); } @AnonymousAccess From a925ecdc7a07bcee39216b3ee28f1cb5de7b6365 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 27 Feb 2024 16:33:38 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=81=E5=B8=88?= =?UTF-8?q?=E7=AB=AF=E9=A5=BC=E7=8A=B6=E5=9B=BE=E6=8E=A5=E5=8F=A3=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/tea/TeaTopicManageController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java index da1c8e3..4d1c1f0 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/TeaTopicManageController.java @@ -127,14 +127,15 @@ public class TeaTopicManageController { @PostMapping("/addQuestion") @ApiOperation("互动答疑/学生提问") public ResultEntity getQuestionById(@ApiParam("传flowId,提问内容,学校ID") @RequestBody QuestionAnswerWithBLOBs questionAnswerWithBLOBs) { - questionAnswerWithBLOBs.setId(IdUtil.simpleUUID()); + String simpleUUID = IdUtil.simpleUUID(); + questionAnswerWithBLOBs.setId(simpleUUID); questionAnswerWithBLOBs.setQuestionTime(new Date()); try { questionAnswerMapper.insert(questionAnswerWithBLOBs); }catch (Exception e){ return new ResultEntity<>(HttpStatus.BAD_REQUEST,"提问失败,数据缺失!"); } - return new ResultEntity<>(HttpStatus.OK,"提问成功!"); + return new ResultEntity<>(HttpStatus.OK,"提问成功!",simpleUUID); } } From 1674feb72362666f5b5d855ae900acc288de67a0 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Thu, 29 Feb 2024 14:07:22 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=B6=E7=9B=8A?= =?UTF-8?q?=E5=88=86=E9=85=8D=E5=92=8C=E8=80=81=E5=B8=88=E7=AB=AFBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/tea/ClassScoreController.java | 4 ++-- .../serviceImpl/ProfitDistributionServiceImpl.java | 3 ++- .../service/serviceImpl/tea/ClassScoreServiceImpl.java | 8 ++++---- .../fund_investment/service/tea/ClassScoreService.java | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java b/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java index 2cb9606..2146eaf 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/tea/ClassScoreController.java @@ -75,8 +75,8 @@ public class ClassScoreController { @AnonymousAccess @GetMapping("/importExcel") @ApiOperation("成绩管理/导出") //目前只导出提交了报告的学生的数据 - public void importExcel(HttpServletResponse response, @RequestParam String schoolId) { - classScoreService.importExcel(response, schoolId); + public void importExcel(HttpServletResponse response, @RequestParam String classId) { + classScoreService.importExcel(response, classId); } @AnonymousAccess diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java index bc148fd..e0fb605 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java @@ -483,8 +483,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService // 第一轮归还劣后级LP本金和银行利息 profitDistribution.setRoundSubordinatedLp(subordinatedLp); + profitDistribution.setRoundOwnFunds(rightOwnFunds); profitDistribution.setRoundBankLoan(rightBankLoan); - residualIncome = residualIncome.subtract(subordinatedLp).subtract(rightBankLoan); //剩余收益 + residualIncome = residualIncome.subtract(subordinatedLp).subtract(rightBankLoan).subtract(rightOwnFunds); //剩余收益 //2.剩余收益分配比例为,自有资金25%,优先级LP 30%,劣后级LP 45% BigDecimal twoRightOwnFunds = residualIncome.multiply(BigDecimal.valueOf(0.25)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 BigDecimal twoRightFundraisingAmount = residualIncome.multiply(BigDecimal.valueOf(0.3)).setScale(2, RoundingMode.HALF_UP);//剩余自有资金 diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 3e1144a..0204c46 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -213,9 +213,9 @@ public class ClassScoreServiceImpl implements ClassScoreService { * @Date 2023/11/27 */ @Override - public void importExcel(HttpServletResponse response, String schoolId) { + public void importExcel(HttpServletResponse response, String classId) { UserExample userTableExample = new UserExample(); - userTableExample.createCriteria().andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4); + userTableExample.createCriteria().andClassIdEqualTo(classId).andRoleIdEqualTo(4); List userTables = userMapper.selectByExample(userTableExample); List userDtoList = new ArrayList<>(); for (User userTable : userTables) { @@ -224,10 +224,10 @@ public class ClassScoreServiceImpl implements ClassScoreService { Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid()); String flowId = flow.getFlowId(); TrainingReportExample trainingReportExample = new TrainingReportExample(); - trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andSchoolIdEqualTo(schoolId); + trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG); List trainingReports = reportMapper.selectByExample(trainingReportExample); PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); - performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId).andSchoolIdEqualTo(schoolId); + performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId).andClassIdEqualTo(classId); List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); if (performanceScores.isEmpty()) { continue; diff --git a/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java b/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java index 4686e10..f9928dc 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java +++ b/src/main/java/com/sztzjy/fund_investment/service/tea/ClassScoreService.java @@ -23,7 +23,7 @@ public interface ClassScoreService { PageInfo getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName); - void importExcel(HttpServletResponse response, String schoolId); + void importExcel(HttpServletResponse response, String classId); ResultEntity autoScore(String schoolId); From 654f780445a8661fff21550a5bcaa266aadf5fc0 Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Fri, 1 Mar 2024 13:28:46 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E5=BE=97=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProfitDistributionServiceImpl.java | 36 +++++++++---------- .../tea/ClassScoreServiceImpl.java | 6 +++- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java index e0fb605..b3750a9 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/ProfitDistributionServiceImpl.java @@ -203,9 +203,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService //算分 if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightAvailableFunds.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } if (subtract.compareTo(rightOwnFunds) <= 0 && subtract.compareTo(BigDecimal.ZERO) >= 0) { //如果可用资金 - 优先级LP <= 需要分配的自有资金剩余金额全部给 自有资金,第二轮都为0 @@ -215,9 +215,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService //判断算分 if (subtract.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } profitDistribution.setRoundOwnFunds(rightOwnFunds); @@ -231,10 +231,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService //算分 共五分,可用资金1分,其他共4分,错一个不得分 if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); - performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } else if (type == 2) { //2:自有资金/优先级LP/劣后级LP if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) { @@ -260,9 +259,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightAvailableFunds.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } profitDistribution.setRoundPreferredLp(rightFundraisingAmount); //下面的情况优先级LP都足够 @@ -274,9 +273,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && subtract.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } //分配完优劣LP后剩余的钱 @@ -290,8 +289,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) { performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); + performanceScore.setProfitDistributionTime(new Date()); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } // 第一轮归还劣后级LP本金 @@ -316,11 +315,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 && userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } } - performanceScore.setProfitDistributionTime(new Date()); - performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } else if (type == 3) { //3:银行借款/自有资金/优先级LP if (profitDistribution.getUserRoundBankLoan() == null) { @@ -346,9 +344,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightAvailableFunds.compareTo(userRoundBankLoan) == 0 && BigDecimal.ZERO.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够 @@ -360,9 +358,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 && subtractBankLoan.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } //分配完优先级LP后剩余的钱给自有资金 @@ -375,9 +373,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (subtractRoundOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } profitDistribution.setRoundPreferredLp(rightFundraisingAmount); @@ -392,10 +390,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); - performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } else { //4:银行借款/优先级LP/劣后级LP/自有资金 if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) { @@ -428,9 +425,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService BigDecimal.ZERO.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } profitDistribution.setRoundBankLoan(rightBankLoan); //下面的情况优先级银行贷款都足够 @@ -443,9 +440,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService subtractBankLoan.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } //分配完优先级LP后剩余的钱给劣后级LP @@ -458,9 +455,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService if (subtractSubordinatedLp.compareTo(userRoundOwnFunds) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } @@ -475,9 +472,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && subordinatedLp.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } @@ -498,10 +495,9 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0 && rightBankLoan.compareTo(userRoundBankLoan) == 0 && userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) { + performanceScore.setProfitDistributionTime(new Date()); performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId); } - performanceScore.setProfitDistributionTime(new Date()); - performanceScoreMapper.updateByPrimaryKey(performanceScore); return new ResultEntity<>(HttpStatus.OK, "分配完成!"); } } diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index 0204c46..7885175 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -505,7 +505,11 @@ public class ClassScoreServiceImpl implements ClassScoreService { performanceTrainingScoreDto.setPracticalCognitionScore(Optional.ofNullable(performanceScore.getPracticalCognitionScore()).orElse(BigDecimal.ZERO)); performanceTrainingScoreDto.setKnowledgeAssessmentScore(Optional.ofNullable(performanceScore.getKnowledgeAssessmentScore()).orElse(BigDecimal.ZERO)); performanceTrainingScoreDto.setFundraisingScore(Optional.ofNullable(performanceScore.getFundraisingScore()).orElse(BigDecimal.ZERO)); - performanceTrainingScoreDto.setProjectSearchScore(Optional.ofNullable(performanceScore.getProjectSearchScore()).map(score -> score.add(Optional.ofNullable(performanceScore.getProjectSearchReportScore()).orElse(BigDecimal.ZERO))).orElse(BigDecimal.ZERO)); + performanceTrainingScoreDto.setProjectSearchScore( + (performanceScore.getProjectSearchScore() != null ? performanceScore.getProjectSearchScore() : BigDecimal.ZERO).add( + (performanceScore.getProjectSearchReportScore() != null ? performanceScore.getProjectSearchReportScore() : BigDecimal.ZERO) + ) + ); performanceTrainingScoreDto.setProjectDueDiligenceScore( Optional.ofNullable(performanceScore.getProjectDueDiligenceScore()).map(score -> score.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceFinanceReportScore()).orElse(BigDecimal.ZERO)) From 45a14b72298f53ffcab60e292eb408d6c1efb2be Mon Sep 17 00:00:00 2001 From: "@t2652009480" <2652009480@qq.com> Date: Fri, 1 Mar 2024 14:31:02 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E8=AF=A2=E4=BB=B7=E5=8F=91=E8=A1=8C--?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InquiryIssuanceController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sztzjy/fund_investment/controller/InquiryIssuanceController.java b/src/main/java/com/sztzjy/fund_investment/controller/InquiryIssuanceController.java index 1cdf348..f803b36 100644 --- a/src/main/java/com/sztzjy/fund_investment/controller/InquiryIssuanceController.java +++ b/src/main/java/com/sztzjy/fund_investment/controller/InquiryIssuanceController.java @@ -44,6 +44,8 @@ public class InquiryIssuanceController { PerformanceScoreMapper performanceScoreMapper; @Resource PerformanceScoreService performanceScoreService; + @Resource + IssuanceParameterInput issuanceParameterInput; @AnonymousAccess @GetMapping("/queryInquiryInvestors") @ApiOperation("询价投资者查看") @@ -107,6 +109,8 @@ public class InquiryIssuanceController { } catch (Exception e) { e.printStackTrace(); } + //写入分数 + performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 1, issuanceParameterInput.getFlowId()); } @AnonymousAccess @GetMapping("/queryInitiatePreliminaryInquiry") @@ -196,6 +200,8 @@ public class InquiryIssuanceController { } catch (Exception e) { e.printStackTrace(); } + //写入分数 + performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 2, issuanceParameterInput.getFlowId()); } @AnonymousAccess @@ -221,7 +227,7 @@ public class InquiryIssuanceController { @AnonymousAccess @GetMapping("/exportInquiryResults") - @ApiOperation("投资者参与询价--询价结果") + @ApiOperation("投资者参与询价--询价结果导出") public void exportInquiryResults(HttpServletResponse response, @RequestParam String flowId) { //导出的表名 String title = IdUtil.simpleUUID(); @@ -238,6 +244,8 @@ public class InquiryIssuanceController { } catch (Exception e) { e.printStackTrace(); } + //写入分数 + performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 1, issuanceParameterInput.getFlowId()); } @AnonymousAccess