修改规划报告提交接口,修改理论考试相关接口中list转sting带[]的bug

master
xiaoCJ 7 months ago
parent a361b23a85
commit 621821f038

@ -93,7 +93,7 @@ public class SynthesisPlanController {
@AnonymousAccess
@ApiOperation("目标客户跟踪")
@PostMapping("TrackDownTargetCustomer")
public Boolean TrackDownTargetCustomer(@RequestParam String userId, @RequestParam String stuClientId,@RequestParam String schoolId) {
public Boolean TrackDownTargetCustomer(@RequestParam String userId, @RequestParam String stuClientId, @RequestParam String schoolId) {
SynthesisPlanClient synthesisPlanClient = synthesisPlanClientMapper.selectByPrimaryKey(stuClientId);
synthesisPlanClient.setStuClientId(String.valueOf(UUID.randomUUID()));
synthesisPlanClient.setGetStatus("true");
@ -106,22 +106,22 @@ public class SynthesisPlanController {
CaseFinanceLiabilityExample example = new CaseFinanceLiabilityExample();
example.createCriteria().andUserIdEqualTo(userId).andCaseIdEqualTo(synthesisPlanClient.getCaseid());
List<CaseFinanceLiability> caseFinanceLiabilitieList = caseFinanceLiabilityMapper.selectByExample(example);
if(caseFinanceLiabilitieList.isEmpty()){
if (caseFinanceLiabilitieList.isEmpty()) {
return i == 1;
}
CaseFinanceLiability caseFinanceLiability = caseFinanceLiabilitieList.get(0);
BigDecimal totalNet = caseFinanceLiability.getTotalNet()==null?BigDecimal.ZERO:caseFinanceLiability.getTotalNet();
if(totalNet.compareTo(BigDecimal.valueOf(6000000))>=0){ //高净值用户
BigDecimal totalNet = caseFinanceLiability.getTotalNet() == null ? BigDecimal.ZERO : caseFinanceLiability.getTotalNet();
if (totalNet.compareTo(BigDecimal.valueOf(6000000)) >= 0) { //高净值用户
//先判断 是否创建用户统计对象
UserStatistics userStatistics = userStatisticsMapper.selectByPrimaryKey(userId);
if(userStatistics==null){
if (userStatistics == null) {
UserStatistics createUserStatistics = new UserStatistics();
createUserStatistics.setUserid(userId);
createUserStatistics.setHighNetClientHaveCount(0);
createUserStatistics.setHighNetClientLatentCount(1);
userStatisticsMapper.insert(createUserStatistics);
}else { //存在这个统计对象
userStatistics.setHighNetClientLatentCount(userStatistics.getHighNetClientLatentCount()+1);
} else { //存在这个统计对象
userStatistics.setHighNetClientLatentCount(userStatistics.getHighNetClientLatentCount() + 1);
userStatisticsMapper.updateByPrimaryKey(userStatistics);
}
@ -232,20 +232,22 @@ public class SynthesisPlanController {
@ApiOperation("规划报告提交")
@PostMapping("submitPlanningReport")
@Transactional
public ResultEntity submitPlanningReport(@RequestParam String stuClientId,
@RequestParam String userId,
@RequestParam String caseId ) {
public ResultEntity<HttpStatus> submitPlanningReport(@RequestParam String stuClientId,
@RequestParam String userId,
@RequestParam String caseId) {
SynthesisPlanClient synthesisPlanClient = synthesisPlanClientMapper.selectByPrimaryKey(stuClientId);
// if(synthesisPlanClient.getUserid().equals(userId) && synthesisPlanClient.getSubmitStatus().equals("未提交")){
if (synthesisPlanClient.getUserid().equals(userId) && synthesisPlanClient.getSubmitStatus().equals("未提交")) {
//提交完成 设置用户统计 高净值已有客户总数
//增加成绩方法 计算成绩方法
synthesisPlanService.getScore(userId,caseId);
ResultEntity<HttpStatus> score = synthesisPlanService.getScore(userId, caseId);
if (!score.getStatusCode().equals(HttpStatus.OK)) {
return score;
}
synthesisPlanClient.setSubmitStatus("未审核");
return new ResultEntity<>(HttpStatus.OK, "规划报告提交成功!");
// }
// return new ResultEntity<>(HttpStatus.BAD_REQUEST, "规划报告提交失败!提交状态错误");
}
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "规划报告提交失败!提交状态错误");
}
//已有客户、规划报告删除

@ -154,7 +154,7 @@ public class TopicController {
@PostMapping("/commitObjectiveAnswer")
@ApiOperation("学习测评/提交")
@AnonymousAccess
private void commitObjectiveAnswer(@RequestParam List<ObjectiveQuestionDto> dtoList,
private void commitObjectiveAnswer(@RequestBody List<ObjectiveQuestionDto> dtoList,
@RequestParam String userId,
@RequestParam String chapterId) {
objectiveQuestionService.commitObjectiveAnswer(dtoList, userId, chapterId);

@ -1,5 +1,8 @@
package com.sztzjy.money_management.service;
import com.sztzjy.money_management.util.ResultEntity;
import org.springframework.http.HttpStatus;
import java.math.BigDecimal;
import java.util.Map;
@ -10,5 +13,5 @@ import java.util.Map;
public interface SynthesisPlanService {
Map<String, String> adviseInvestmentProductAllot(BigDecimal raiScore, BigDecimal rciScore);
void getScore(String userId, String caseId);
ResultEntity<HttpStatus> getScore(String userId, String caseId);
}

@ -174,8 +174,7 @@ public class CaseServiceImpl implements CaseService {
}
}
//判断是哪种考核点 增加相关表
ResultEntity resultEntity = addCorrelationTable(type, json, gson, operator);
return resultEntity;
return addCorrelationTable(type, json, gson, operator);
}
@ -199,7 +198,7 @@ public class CaseServiceImpl implements CaseService {
}
//添加或编辑相关类型表
public ResultEntity addCorrelationTable(String type, String json, Gson gson, String operator) {
public ResultEntity<HttpStatus> addCorrelationTable(String type, String json, Gson gson, String operator) {
try {
if (StringUtils.isNotBlank(json)) {
if (type.equals("风险测评-风险指标")) {
@ -1691,7 +1690,7 @@ public class CaseServiceImpl implements CaseService {
}
ComCase comCase = comCases.get(0);
List<String> typeList = Arrays.asList(comCase.getManageMoneyMattersType().split(","));
List<String> typeList = Arrays.asList(comCase.getManageMoneyMattersType().split(", "));
for (String allType : typeList) {
if (allType.equals("风险测评-风险指标")) {
CaseRiskIndex caseRiskIndices = getCaseRiskIndices(caseID, userId, isAnswer);

@ -12,6 +12,7 @@ import com.sztzjy.money_management.service.ObjectiveQuestionService;
import com.sztzjy.money_management.util.ResultEntity;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.hibernate.event.spi.SaveOrUpdateEvent;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@ -158,12 +159,15 @@ public class ObjectiveQuestionServiceImpl implements ObjectiveQuestionService {
//两个参数都为空说明第一次提交,进行算分
if (StringUtils.isBlank(dataTraining.getLearningEvalIdList())
&& StringUtils.isBlank(dataTraining.getLearningEvalAnswer())) {
dataTraining.setLearningEvalAnswer(String.valueOf(answerList));
dataTraining.setLearningEvalIdList(String.valueOf(ids));
dataTraining.setLearningEvalCompleteStatus(count);
stuTrainingMapper.updateByPrimaryKeySelective(dataTraining);
}
//去掉第一条和最后一条的[]括号
String answers = String.valueOf(answerList).replace("[", "").replace("]", "");
String idList = String.valueOf(ids).replace("[", "").replace("]", "");
dataTraining.setLearningEvalIdList(idList);
dataTraining.setLearningEvalAnswer(answers);
stuTrainingMapper.updateByPrimaryKeySelective(dataTraining);
}
}
@ -182,8 +186,8 @@ public class ObjectiveQuestionServiceImpl implements ObjectiveQuestionService {
String learningEvalIdList = stuTrainingWithBLOBs.getLearningEvalIdList(); //学生作答题目ID
String learningEvalAnswer = stuTrainingWithBLOBs.getLearningEvalAnswer(); //学生提交答案
List<String> idList = Arrays.asList(learningEvalIdList.split(","));
List<String> stuAnswerList = Arrays.asList(learningEvalAnswer.split(","));
List<String> idList = Arrays.asList(learningEvalIdList.split(", "));
List<String> stuAnswerList = Arrays.asList(learningEvalAnswer.split(", "));
// 确保 idList 和 stuAnswerList 大小相同且顺序匹配
if (idList.size() != stuAnswerList.size()) {
@ -209,7 +213,7 @@ public class ObjectiveQuestionServiceImpl implements ObjectiveQuestionService {
// 获取对应题目的答案并设置
String userAnswer = answerMap.get(objectiveQuestionWithBLOBs.getObjectiveId());
objectiveQuestionDto.setUserAnswer(userAnswer);
list.add(objectiveQuestionDto);
resultList.add(objectiveQuestionDto);
}
return resultList;
}

@ -4,7 +4,9 @@ import cn.hutool.core.util.IdUtil;
import com.sztzjy.money_management.entity.*;
import com.sztzjy.money_management.mapper.*;
import com.sztzjy.money_management.service.SynthesisPlanService;
import com.sztzjy.money_management.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -211,164 +213,280 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
@Override
public void getScore(String userId, String caseID) {
//先取出所有的考核点和学生提交的进行对比
//风险测评-风险指标
CaseRiskIndexExample example = new CaseRiskIndexExample();
example.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUseridIsNull();
List<CaseRiskIndex> caseRiskIndices = caseRiskIndexMapper.selectByExample(example);
CaseRiskIndexExample stuExample = new CaseRiskIndexExample();
stuExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUseridEqualTo(userId);
List<CaseRiskIndex> stuCaseRiskIndices = caseRiskIndexMapper.selectByExample(stuExample);
//财务分析-资产负债表
CaseFinanceLiabilityExample caseFinanceLiabilityExample = new CaseFinanceLiabilityExample();
caseFinanceLiabilityExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseFinanceLiability> rightCaseFinanceLiabilities = caseFinanceLiabilityMapper.selectByExample(caseFinanceLiabilityExample);
CaseFinanceLiabilityExample stuCaseFinanceLiabilityExample = new CaseFinanceLiabilityExample();
stuCaseFinanceLiabilityExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseFinanceLiability> stuCaseFinanceLiabilities = caseFinanceLiabilityMapper.selectByExample(stuCaseFinanceLiabilityExample);
//财务分析-收支储蓄表
CaseIncomeAndExpensesExample caseIncomeAndExpensesExample = new CaseIncomeAndExpensesExample();
caseIncomeAndExpensesExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseIncomeAndExpenses> rightCaseIncomeAndExpenses = caseIncomeAndExpensesMapper.selectByExample(caseIncomeAndExpensesExample);
CaseIncomeAndExpensesExample stuCaseIncomeAndExpensesExample = new CaseIncomeAndExpensesExample();
stuCaseIncomeAndExpensesExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseIncomeAndExpenses> stuCaseIncomeAndExpenses = caseIncomeAndExpensesMapper.selectByExample(stuCaseIncomeAndExpensesExample);
//财务分析-现金流量表
CaseCashFlowExample caseCashFlowExample = new CaseCashFlowExample();
caseCashFlowExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseCashFlow> rightCashFlows = caseCashFlowMapper.selectByExample(caseCashFlowExample);
CaseCashFlowExample stuCashFlowExample = new CaseCashFlowExample();
stuCashFlowExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseCashFlow> stuCaseCashFlows = caseCashFlowMapper.selectByExample(stuCashFlowExample);
//财务分析-财务比例分析
CaseFinancialRatiosExample caseFinancialRatiosExample = new CaseFinancialRatiosExample();
caseFinancialRatiosExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseFinancialRatiosWithBLOBs> rightCaseFinancialRatiosWithBLOBs = caseFinancialRatiosMapper.selectByExampleWithBLOBs(caseFinancialRatiosExample);
CaseFinancialRatiosExample stuCaseFinancialRatiosExample = new CaseFinancialRatiosExample();
stuCaseFinancialRatiosExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseFinancialRatiosWithBLOBs> stuCaseFinancialRatiosWithBLOBs = caseFinancialRatiosMapper.selectByExampleWithBLOBs(stuCaseFinancialRatiosExample);
//现金规划
CaseCashPlanExample caseCashPlanExample = new CaseCashPlanExample();
caseCashPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseCashPlan> rightCaseCashPlans = caseCashPlanMapper.selectByExampleWithBLOBs(caseCashPlanExample);
CaseCashPlanExample stuCaseCashPlanExample = new CaseCashPlanExample();
stuCaseCashPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseCashPlan> stuCaseCashPlans = caseCashPlanMapper.selectByExampleWithBLOBs(stuCaseCashPlanExample);
//生涯规划-教育规划
CaseLifeEducationPlanExample caseLifeEducationPlanExample = new CaseLifeEducationPlanExample();
caseLifeEducationPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseLifeEducationPlan> rightCaseLifeEducationPlans = caseLifeEducationPlanMapper.selectByExampleWithBLOBs(caseLifeEducationPlanExample);
CaseLifeEducationPlanExample stuCaseLifeEducationPlanExample = new CaseLifeEducationPlanExample();
stuCaseLifeEducationPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseLifeEducationPlan> stuCaseLifeEducationPlans = caseLifeEducationPlanMapper.selectByExampleWithBLOBs(stuCaseLifeEducationPlanExample);
//生涯规划-消费规划
CaseConsumptionPlanExample caseConsumptionPlanExample = new CaseConsumptionPlanExample();
caseConsumptionPlanExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseConsumptionPlan> rightCaseConsumptionPlans = caseConsumptionPlanMapper.selectByExampleWithBLOBs(caseConsumptionPlanExample);
CaseConsumptionPlanExample stuCaseConsumptionPlanExample = new CaseConsumptionPlanExample();
stuCaseConsumptionPlanExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseConsumptionPlan> stuCaseConsumptionPlans = caseConsumptionPlanMapper.selectByExampleWithBLOBs(stuCaseConsumptionPlanExample);
//生涯规划-创业规划
CaseStartAnUndertakingPlanExample caseStartAnUndertakingPlanExample = new CaseStartAnUndertakingPlanExample();
caseStartAnUndertakingPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseStartAnUndertakingPlan> rightCaseStartAnUndertakingPlans = caseStartAnUndertakingPlanMapper.selectByExampleWithBLOBs(caseStartAnUndertakingPlanExample);
CaseStartAnUndertakingPlanExample stuCaseStartAnUndertakingPlanExample = new CaseStartAnUndertakingPlanExample();
stuCaseStartAnUndertakingPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseStartAnUndertakingPlan> stuCaseStartAnUndertakingPlans = caseStartAnUndertakingPlanMapper.selectByExampleWithBLOBs(stuCaseStartAnUndertakingPlanExample);
//生涯规划-退休规划
CaseRetirementPlanExample caseRetirementPlanExample = new CaseRetirementPlanExample();
caseRetirementPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseRetirementPlan> rightCaseRetirementPlans = caseRetirementPlanMapper.selectByExampleWithBLOBs(caseRetirementPlanExample);
CaseRetirementPlanExample stuCaseRetirementPlanExample = new CaseRetirementPlanExample();
stuCaseRetirementPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseRetirementPlan> stuCaseRetirementPlans = caseRetirementPlanMapper.selectByExampleWithBLOBs(stuCaseRetirementPlanExample);
//生涯规划-保险规划
CaseInsurancePlanExample caseInsurancePlanExample = new CaseInsurancePlanExample();
caseInsurancePlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseInsurancePlan> rightCaseInsurancePlans = caseInsurancePlanMapper.selectByExampleWithBLOBs(caseInsurancePlanExample);
CaseInsurancePlanExample stuCaseInsurancePlanExample = new CaseInsurancePlanExample();
stuCaseInsurancePlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseInsurancePlan> stuCaseInsurancePlans = caseInsurancePlanMapper.selectByExampleWithBLOBs(stuCaseInsurancePlanExample);
//投资规划
// todo 表暂时没有
//税务筹划
CaseTaxPlanExample caseTaxPlanExample = new CaseTaxPlanExample();
caseTaxPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseTaxPlan> rightCaseTaxPlans = caseTaxPlanMapper.selectByExampleWithBLOBs(caseTaxPlanExample);
CaseTaxPlanExample stuCaseTaxPlanExample = new CaseTaxPlanExample();
stuCaseTaxPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseTaxPlan> stuCaseTaxPlans = caseTaxPlanMapper.selectByExampleWithBLOBs(stuCaseTaxPlanExample);
//财产分配
CaseDistributionOfPropertyExample caseDistributionOfPropertyExample = new CaseDistributionOfPropertyExample();
caseDistributionOfPropertyExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseDistributionOfPropertyWithBLOBs> rightCaseDistributionOfPropertyWithBLOBs = caseDistributionOfPropertyMapper.selectByExampleWithBLOBs(caseDistributionOfPropertyExample);
CaseDistributionOfPropertyExample stuCaseDistributionOfPropertyExample = new CaseDistributionOfPropertyExample();
stuCaseDistributionOfPropertyExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseDistributionOfPropertyWithBLOBs> stuCaseDistributionOfPropertyWithBLOBs = caseDistributionOfPropertyMapper.selectByExampleWithBLOBs(stuCaseDistributionOfPropertyExample);
//财产传承
CaseHeritageExample caseHeritageExample = new CaseHeritageExample();
caseHeritageExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseHeritageWithBLOBs> rightCaseHeritageWithBLOBs = caseHeritageMapper.selectByExampleWithBLOBs(caseHeritageExample);
CaseHeritageExample stuCaseHeritageExample = new CaseHeritageExample();
stuCaseHeritageExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseHeritageWithBLOBs> stuCaseHeritageWithBLOBs = caseHeritageMapper.selectByExampleWithBLOBs(stuCaseHeritageExample);
List<SynthesisPlanScoreWithBLOBs> list = new ArrayList<>();
caseRiskIndex(userId, caseID, caseRiskIndices, stuCaseRiskIndices, list);
caseFinanceLiabilities(userId, caseID, rightCaseFinanceLiabilities, stuCaseFinanceLiabilities, list);
caseIncomeAndExpenses(userId, caseID, rightCaseIncomeAndExpenses, stuCaseIncomeAndExpenses, list);
cashFlows(userId, caseID, rightCashFlows, stuCaseCashFlows, list);
caseFinancialRatios(userId, caseID, rightCaseFinancialRatiosWithBLOBs, stuCaseFinancialRatiosWithBLOBs, list);
caseCashPlans(userId, caseID, rightCaseCashPlans, stuCaseCashPlans, list);
caseLifeEducationPlans(userId, caseID, rightCaseLifeEducationPlans, stuCaseLifeEducationPlans, list);
caseConsumptionPlans(userId, caseID, rightCaseConsumptionPlans, stuCaseConsumptionPlans, list);
caseStartAnUndertakingPlans(userId, caseID, rightCaseStartAnUndertakingPlans, stuCaseStartAnUndertakingPlans, list);
caseRetirementPlans(userId, caseID, rightCaseRetirementPlans, stuCaseRetirementPlans, list);
caseInsurancePlans(userId, caseID, rightCaseInsurancePlans, stuCaseInsurancePlans, list);
//todo 投资规划 表暂无
caseTaxPlans(userId, caseID, rightCaseTaxPlans, stuCaseTaxPlans, list);
caseDistributionOfProperty(userId, caseID, rightCaseDistributionOfPropertyWithBLOBs, stuCaseDistributionOfPropertyWithBLOBs, list);
caseHeritageWithBLOBs(userId, caseID, rightCaseHeritageWithBLOBs, stuCaseHeritageWithBLOBs, list);
int i = synthesisPlanScoreMapper.batchInsert(list);
if (i <= 0) {
throw new RuntimeException("新增失败");
public ResultEntity<HttpStatus> getScore(String userId, String caseID) {
CaseInfo caseInfo = caseInfoMapper.selectByPrimaryKey(caseID);
List<String> typeList = new ArrayList<>();
if ("综合规划".equals(caseInfo.getManageMoneyMattersType())) {
ComCaseExample comCaseExample = new ComCaseExample();
comCaseExample.createCriteria().andCaseidEqualTo(caseID);
List<ComCase> comCaseList = comCaseMapper.selectByExample(comCaseExample);
for (int j = 0; j < comCaseList.size(); j++) {
String manageMoneyMattersType = comCaseList.get(j).getManageMoneyMattersType();
typeList.add(manageMoneyMattersType);
}
} else {
typeList.add(caseInfo.getManageMoneyMattersType());
}
for (String type : typeList) {
List<SynthesisPlanScoreWithBLOBs> list = new ArrayList<>();
if (type.equals("风险测评-风险指标")) {
//风险测评-风险指标
CaseRiskIndexExample example = new CaseRiskIndexExample();
example.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUseridIsNull();
List<CaseRiskIndex> caseRiskIndices = caseRiskIndexMapper.selectByExample(example);
CaseRiskIndexExample stuExample = new CaseRiskIndexExample();
stuExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUseridEqualTo(userId);
List<CaseRiskIndex> stuCaseRiskIndices = caseRiskIndexMapper.selectByExample(stuExample);
//为空的话返回报错提示
if (stuCaseRiskIndices == null || stuCaseRiskIndices.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseRiskIndex(userId, caseID, caseRiskIndices, stuCaseRiskIndices, list);
}
if (type.equals("财务分析-资产负债表")) {
//财务分析-资产负债表
CaseFinanceLiabilityExample caseFinanceLiabilityExample = new CaseFinanceLiabilityExample();
caseFinanceLiabilityExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseFinanceLiability> rightCaseFinanceLiabilities = caseFinanceLiabilityMapper.selectByExample(caseFinanceLiabilityExample);
CaseFinanceLiabilityExample stuCaseFinanceLiabilityExample = new CaseFinanceLiabilityExample();
stuCaseFinanceLiabilityExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseFinanceLiability> stuCaseFinanceLiabilities = caseFinanceLiabilityMapper.selectByExample(stuCaseFinanceLiabilityExample);
//为空的话返回报错提示
if (stuCaseFinanceLiabilities == null || stuCaseFinanceLiabilities.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseFinanceLiabilities(userId, caseID, rightCaseFinanceLiabilities, stuCaseFinanceLiabilities, list);
}
if (type.equals("财务分析-收支储蓄表")) {
//财务分析-收支储蓄表
CaseIncomeAndExpensesExample caseIncomeAndExpensesExample = new CaseIncomeAndExpensesExample();
caseIncomeAndExpensesExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseIncomeAndExpenses> rightCaseIncomeAndExpenses = caseIncomeAndExpensesMapper.selectByExample(caseIncomeAndExpensesExample);
CaseIncomeAndExpensesExample stuCaseIncomeAndExpensesExample = new CaseIncomeAndExpensesExample();
stuCaseIncomeAndExpensesExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseIncomeAndExpenses> stuCaseIncomeAndExpenses = caseIncomeAndExpensesMapper.selectByExample(stuCaseIncomeAndExpensesExample);
//为空的话返回报错提示
if (stuCaseIncomeAndExpenses == null || stuCaseIncomeAndExpenses.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseIncomeAndExpenses(userId, caseID, rightCaseIncomeAndExpenses, stuCaseIncomeAndExpenses, list);
}
if (type.equals("财务分析-现金流量表")) {
//财务分析-现金流量表
CaseCashFlowExample caseCashFlowExample = new CaseCashFlowExample();
caseCashFlowExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseCashFlow> rightCashFlows = caseCashFlowMapper.selectByExample(caseCashFlowExample);
CaseCashFlowExample stuCashFlowExample = new CaseCashFlowExample();
stuCashFlowExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseCashFlow> stuCaseCashFlows = caseCashFlowMapper.selectByExample(stuCashFlowExample);
//为空的话返回报错提示
if (stuCaseCashFlows == null || stuCaseCashFlows.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
cashFlows(userId, caseID, rightCashFlows, stuCaseCashFlows, list);
}
if (type.equals("财务分析-财务比例分析")) {
//财务分析-财务比例分析
CaseFinancialRatiosExample caseFinancialRatiosExample = new CaseFinancialRatiosExample();
caseFinancialRatiosExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseFinancialRatiosWithBLOBs> rightCaseFinancialRatiosWithBLOBs = caseFinancialRatiosMapper.selectByExampleWithBLOBs(caseFinancialRatiosExample);
CaseFinancialRatiosExample stuCaseFinancialRatiosExample = new CaseFinancialRatiosExample();
stuCaseFinancialRatiosExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseFinancialRatiosWithBLOBs> stuCaseFinancialRatiosWithBLOBs = caseFinancialRatiosMapper.selectByExampleWithBLOBs(stuCaseFinancialRatiosExample);
//为空的话返回报错提示
if (stuCaseFinancialRatiosWithBLOBs == null || stuCaseFinancialRatiosWithBLOBs.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseFinancialRatios(userId, caseID, rightCaseFinancialRatiosWithBLOBs, stuCaseFinancialRatiosWithBLOBs, list);
}
if (type.equals("现金规划")) {
//现金规划
CaseCashPlanExample caseCashPlanExample = new CaseCashPlanExample();
caseCashPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseCashPlan> rightCaseCashPlans = caseCashPlanMapper.selectByExampleWithBLOBs(caseCashPlanExample);
CaseCashPlanExample stuCaseCashPlanExample = new CaseCashPlanExample();
stuCaseCashPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseCashPlan> stuCaseCashPlans = caseCashPlanMapper.selectByExampleWithBLOBs(stuCaseCashPlanExample);
//为空的话返回报错提示
if (stuCaseCashPlans == null || stuCaseCashPlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseCashPlans(userId, caseID, rightCaseCashPlans, stuCaseCashPlans, list);
}
if (type.equals("生涯规划-教育规划")) {
//生涯规划-教育规划
CaseLifeEducationPlanExample caseLifeEducationPlanExample = new CaseLifeEducationPlanExample();
caseLifeEducationPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseLifeEducationPlan> rightCaseLifeEducationPlans = caseLifeEducationPlanMapper.selectByExampleWithBLOBs(caseLifeEducationPlanExample);
CaseLifeEducationPlanExample stuCaseLifeEducationPlanExample = new CaseLifeEducationPlanExample();
stuCaseLifeEducationPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseLifeEducationPlan> stuCaseLifeEducationPlans = caseLifeEducationPlanMapper.selectByExampleWithBLOBs(stuCaseLifeEducationPlanExample);
//为空的话返回报错提示
if (stuCaseLifeEducationPlans == null || stuCaseLifeEducationPlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseLifeEducationPlans(userId, caseID, rightCaseLifeEducationPlans, stuCaseLifeEducationPlans, list);
}
if (type.equals("生涯规划-消费规划")) {
//生涯规划-消费规划
CaseConsumptionPlanExample caseConsumptionPlanExample = new CaseConsumptionPlanExample();
caseConsumptionPlanExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseConsumptionPlan> rightCaseConsumptionPlans = caseConsumptionPlanMapper.selectByExampleWithBLOBs(caseConsumptionPlanExample);
CaseConsumptionPlanExample stuCaseConsumptionPlanExample = new CaseConsumptionPlanExample();
stuCaseConsumptionPlanExample.createCriteria().andCaseIdEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseConsumptionPlan> stuCaseConsumptionPlans = caseConsumptionPlanMapper.selectByExampleWithBLOBs(stuCaseConsumptionPlanExample);
//为空的话返回报错提示
if (stuCaseConsumptionPlans == null || stuCaseConsumptionPlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseConsumptionPlans(userId, caseID, rightCaseConsumptionPlans, stuCaseConsumptionPlans, list);
}
if (type.equals("生涯规划-创业规划")) {
//生涯规划-创业规划
CaseStartAnUndertakingPlanExample caseStartAnUndertakingPlanExample = new CaseStartAnUndertakingPlanExample();
caseStartAnUndertakingPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseStartAnUndertakingPlan> rightCaseStartAnUndertakingPlans = caseStartAnUndertakingPlanMapper.selectByExampleWithBLOBs(caseStartAnUndertakingPlanExample);
CaseStartAnUndertakingPlanExample stuCaseStartAnUndertakingPlanExample = new CaseStartAnUndertakingPlanExample();
stuCaseStartAnUndertakingPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseStartAnUndertakingPlan> stuCaseStartAnUndertakingPlans = caseStartAnUndertakingPlanMapper.selectByExampleWithBLOBs(stuCaseStartAnUndertakingPlanExample);
//为空的话返回报错提示
if (stuCaseStartAnUndertakingPlans == null || stuCaseStartAnUndertakingPlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseStartAnUndertakingPlans(userId, caseID, rightCaseStartAnUndertakingPlans, stuCaseStartAnUndertakingPlans, list);
}
if (type.equals("生涯规划-退休规划")) {
//生涯规划-退休规划
CaseRetirementPlanExample caseRetirementPlanExample = new CaseRetirementPlanExample();
caseRetirementPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseRetirementPlan> rightCaseRetirementPlans = caseRetirementPlanMapper.selectByExampleWithBLOBs(caseRetirementPlanExample);
CaseRetirementPlanExample stuCaseRetirementPlanExample = new CaseRetirementPlanExample();
stuCaseRetirementPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseRetirementPlan> stuCaseRetirementPlans = caseRetirementPlanMapper.selectByExampleWithBLOBs(stuCaseRetirementPlanExample);
//为空的话返回报错提示
if (stuCaseRetirementPlans == null || stuCaseRetirementPlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseRetirementPlans(userId, caseID, rightCaseRetirementPlans, stuCaseRetirementPlans, list);
}
if (type.equals("生涯规划-保险规划")) {
//生涯规划-保险规划
CaseInsurancePlanExample caseInsurancePlanExample = new CaseInsurancePlanExample();
caseInsurancePlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseInsurancePlan> rightCaseInsurancePlans = caseInsurancePlanMapper.selectByExampleWithBLOBs(caseInsurancePlanExample);
CaseInsurancePlanExample stuCaseInsurancePlanExample = new CaseInsurancePlanExample();
stuCaseInsurancePlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseInsurancePlan> stuCaseInsurancePlans = caseInsurancePlanMapper.selectByExampleWithBLOBs(stuCaseInsurancePlanExample);
//为空的话返回报错提示
if (stuCaseInsurancePlans == null || stuCaseInsurancePlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseInsurancePlans(userId, caseID, rightCaseInsurancePlans, stuCaseInsurancePlans, list);
}
if (type.equals("投资规划")) {
// todo 表暂时没有
}
if (type.equals("税务筹划")) {
//税务筹划
CaseTaxPlanExample caseTaxPlanExample = new CaseTaxPlanExample();
caseTaxPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseTaxPlan> rightCaseTaxPlans = caseTaxPlanMapper.selectByExampleWithBLOBs(caseTaxPlanExample);
CaseTaxPlanExample stuCaseTaxPlanExample = new CaseTaxPlanExample();
stuCaseTaxPlanExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseTaxPlan> stuCaseTaxPlans = caseTaxPlanMapper.selectByExampleWithBLOBs(stuCaseTaxPlanExample);
//为空的话返回报错提示
if (stuCaseTaxPlans == null || stuCaseTaxPlans.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseTaxPlans(userId, caseID, rightCaseTaxPlans, stuCaseTaxPlans, list);
}
if (type.equals("财产分配")) {
//财产分配
CaseDistributionOfPropertyExample caseDistributionOfPropertyExample = new CaseDistributionOfPropertyExample();
caseDistributionOfPropertyExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseDistributionOfPropertyWithBLOBs> rightCaseDistributionOfPropertyWithBLOBs = caseDistributionOfPropertyMapper.selectByExampleWithBLOBs(caseDistributionOfPropertyExample);
CaseDistributionOfPropertyExample stuCaseDistributionOfPropertyExample = new CaseDistributionOfPropertyExample();
stuCaseDistributionOfPropertyExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseDistributionOfPropertyWithBLOBs> stuCaseDistributionOfPropertyWithBLOBs = caseDistributionOfPropertyMapper.selectByExampleWithBLOBs(stuCaseDistributionOfPropertyExample);
//为空的话返回报错提示
if (stuCaseDistributionOfPropertyWithBLOBs == null || stuCaseDistributionOfPropertyWithBLOBs.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseDistributionOfProperty(userId, caseID, rightCaseDistributionOfPropertyWithBLOBs, stuCaseDistributionOfPropertyWithBLOBs, list);
}
if (type.equals("财产分配")) {
//财产传承
CaseHeritageExample caseHeritageExample = new CaseHeritageExample();
caseHeritageExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("题目答案").andUserIdIsNull();
List<CaseHeritageWithBLOBs> rightCaseHeritageWithBLOBs = caseHeritageMapper.selectByExampleWithBLOBs(caseHeritageExample);
CaseHeritageExample stuCaseHeritageExample = new CaseHeritageExample();
stuCaseHeritageExample.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo("学生答案").andUserIdEqualTo(userId);
List<CaseHeritageWithBLOBs> stuCaseHeritageWithBLOBs = caseHeritageMapper.selectByExampleWithBLOBs(stuCaseHeritageExample);
//为空的话返回报错提示
if (stuCaseHeritageWithBLOBs == null || stuCaseHeritageWithBLOBs.isEmpty()) {
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, type + "还未填写!");
}
//计算对错
caseHeritageWithBLOBs(userId, caseID, rightCaseHeritageWithBLOBs, stuCaseHeritageWithBLOBs, list);
}
int i = synthesisPlanScoreMapper.batchInsert(list);
if (i <= 0) {
throw new RuntimeException("新增失败");
}
}
return new ResultEntity<HttpStatus>(HttpStatus.OK,"");
}
private void caseHeritageWithBLOBs(String userId, String caseID, List<CaseHeritageWithBLOBs> rightCaseHeritageWithBLOBs,
private void caseHeritageWithBLOBs(String userId, String
caseID, List<CaseHeritageWithBLOBs> rightCaseHeritageWithBLOBs,
List<CaseHeritageWithBLOBs> stuCaseHeritageWithBLOBs, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseHeritageWithBLOBs != null && !rightCaseHeritageWithBLOBs.isEmpty())
&& (stuCaseHeritageWithBLOBs != null && !stuCaseHeritageWithBLOBs.isEmpty())) {
@ -528,7 +646,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
//todo 投资规划 表暂无
private void caseInsurancePlans(String userId, String caseID, List<CaseInsurancePlan> rightCaseInsurancePlans,
private void caseInsurancePlans(String userId, String
caseID, List<CaseInsurancePlan> rightCaseInsurancePlans,
List<CaseInsurancePlan> stuCaseInsurancePlans, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseInsurancePlans != null && !rightCaseInsurancePlans.isEmpty())
&& (stuCaseInsurancePlans != null && !stuCaseInsurancePlans.isEmpty())) {
@ -616,7 +735,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
}
private void caseRetirementPlans(String userId, String caseID, List<CaseRetirementPlan> rightCaseRetirementPlans,
private void caseRetirementPlans(String userId, String
caseID, List<CaseRetirementPlan> rightCaseRetirementPlans,
List<CaseRetirementPlan> stuCaseRetirementPlans, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseRetirementPlans != null && !rightCaseRetirementPlans.isEmpty())
&& (stuCaseRetirementPlans != null && !stuCaseRetirementPlans.isEmpty())) {
@ -673,7 +793,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
}
private void caseStartAnUndertakingPlans(String userId, String caseID, List<CaseStartAnUndertakingPlan> rightCaseStartAnUndertakingPlans,
private void caseStartAnUndertakingPlans(String userId, String
caseID, List<CaseStartAnUndertakingPlan> rightCaseStartAnUndertakingPlans,
List<CaseStartAnUndertakingPlan> stuCaseStartAnUndertakingPlans, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseStartAnUndertakingPlans != null && !rightCaseStartAnUndertakingPlans.isEmpty())
&& (stuCaseStartAnUndertakingPlans != null && !stuCaseStartAnUndertakingPlans.isEmpty())) {
@ -719,7 +840,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
}
private void caseConsumptionPlans(String userId, String caseID, List<CaseConsumptionPlan> rightCaseConsumptionPlans,
private void caseConsumptionPlans(String userId, String
caseID, List<CaseConsumptionPlan> rightCaseConsumptionPlans,
List<CaseConsumptionPlan> stuCaseConsumptionPlans, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseConsumptionPlans != null && !rightCaseConsumptionPlans.isEmpty())
&& (stuCaseConsumptionPlans != null && !stuCaseConsumptionPlans.isEmpty())) {
@ -776,7 +898,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
}
private void caseLifeEducationPlans(String userId, String caseID, List<CaseLifeEducationPlan> rightCaseLifeEducationPlans,
private void caseLifeEducationPlans(String userId, String
caseID, List<CaseLifeEducationPlan> rightCaseLifeEducationPlans,
List<CaseLifeEducationPlan> stuCaseLifeEducationPlans, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseLifeEducationPlans != null && !rightCaseLifeEducationPlans.isEmpty())
&& (stuCaseLifeEducationPlans != null && !stuCaseLifeEducationPlans.isEmpty())) {
@ -897,7 +1020,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
private void caseFinancialRatios(String userId, String caseID, List<CaseFinancialRatiosWithBLOBs> rightCaseFinancialRatiosWithBLOBs,
private void caseFinancialRatios(String userId, String
caseID, List<CaseFinancialRatiosWithBLOBs> rightCaseFinancialRatiosWithBLOBs,
List<CaseFinancialRatiosWithBLOBs> stuCaseFinancialRatiosWithBLOBs, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseFinancialRatiosWithBLOBs != null && !rightCaseFinancialRatiosWithBLOBs.isEmpty())
&& (stuCaseFinancialRatiosWithBLOBs != null && !stuCaseFinancialRatiosWithBLOBs.isEmpty())) {
@ -929,7 +1053,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
}
private void cashFlows(String userId, String caseID, List<CaseCashFlow> rightCashFlows, List<CaseCashFlow> stuCaseCashFlows,
private void cashFlows(String userId, String
caseID, List<CaseCashFlow> rightCashFlows, List<CaseCashFlow> stuCaseCashFlows,
List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCashFlows != null && !rightCashFlows.isEmpty())
&& (stuCaseCashFlows != null && !stuCaseCashFlows.isEmpty())) {
@ -973,7 +1098,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
}
private void caseIncomeAndExpenses(String userId, String caseID, List<CaseIncomeAndExpenses> rightCaseIncomeAndExpenses,
private void caseIncomeAndExpenses(String userId, String
caseID, List<CaseIncomeAndExpenses> rightCaseIncomeAndExpenses,
List<CaseIncomeAndExpenses> stuCaseIncomeAndExpenses, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseIncomeAndExpenses != null && !rightCaseIncomeAndExpenses.isEmpty())
&& (stuCaseIncomeAndExpenses != null && !stuCaseIncomeAndExpenses.isEmpty())) {
@ -1028,7 +1154,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
private void caseFinanceLiabilities(String userId, String caseID, List<CaseFinanceLiability> rightCaseFinanceLiabilities,
private void caseFinanceLiabilities(String userId, String
caseID, List<CaseFinanceLiability> rightCaseFinanceLiabilities,
List<CaseFinanceLiability> stuCaseFinanceLiabilities, List<SynthesisPlanScoreWithBLOBs> list) {
if ((rightCaseFinanceLiabilities != null && !rightCaseFinanceLiabilities.isEmpty())
@ -1095,7 +1222,8 @@ public class SynthesisPlanServiceImpl implements SynthesisPlanService {
}
private void caseRiskIndex(String userId, String caseID, List<CaseRiskIndex> caseRiskIndices, List<CaseRiskIndex> stuCaseRiskIndices, List<SynthesisPlanScoreWithBLOBs> list) {
private void caseRiskIndex(String userId, String
caseID, List<CaseRiskIndex> caseRiskIndices, List<CaseRiskIndex> stuCaseRiskIndices, List<SynthesisPlanScoreWithBLOBs> list) {
if ((stuCaseRiskIndices != null && !stuCaseRiskIndices.isEmpty()) && (caseRiskIndices != null && !caseRiskIndices.isEmpty())) {
CaseRiskIndex stuCaseRiskIndex = stuCaseRiskIndices.get(0);
CaseRiskIndex caseRiskIndex = caseRiskIndices.get(0);

@ -57,10 +57,18 @@ public class TheoryTestServiceImpl implements TheoryTestService {
list.addAll(theoryTestDto.getSingleErrorIds());
list.addAll(theoryTestDto.getMultipleErrorIds());
list.addAll(theoryTestDto.getJudgeErrorIds());
stuTheoryExam.setSingleStuAnswer(String.valueOf(theoryTestDto.getSingleStuAnswer()));
stuTheoryExam.setMultipleStuAnswer(String.valueOf(theoryTestDto.getMultipleStuAnswer()));
stuTheoryExam.setJudgeStuAnswer(String.valueOf(theoryTestDto.getJudgeStuAnswer()));
stuTheoryExam.setErrorIds(list.toString());
String singleStuAnswer = String.valueOf(theoryTestDto.getSingleStuAnswer()).replace("[", "").replace("]", "");
stuTheoryExam.setSingleStuAnswer(singleStuAnswer);
String multipleStuAnswer = String.valueOf(theoryTestDto.getMultipleStuAnswer()).replace("[", "").replace("]", "");
stuTheoryExam.setMultipleStuAnswer(multipleStuAnswer);
String judgeStuAnswer = String.valueOf(theoryTestDto.getJudgeStuAnswer()).replace("[", "").replace("]", "");
stuTheoryExam.setJudgeStuAnswer(judgeStuAnswer);
String stingList = String.valueOf(list.toString()).replace("[", "").replace("]", "");
stuTheoryExam.setErrorIds(stingList);
stuTheoryExam.setAnswered(true);
stuTheoryExam.setSource(theoryTestDto.getSource());
int i = theoryExamMapper.updateByPrimaryKeyWithBLOBs(stuTheoryExam);
@ -74,9 +82,15 @@ public class TheoryTestServiceImpl implements TheoryTestService {
StuErrorWithBLOBs stuError = new StuErrorWithBLOBs();
stuError.setErrorId(IdUtil.randomUUID());
stuError.setUserId(theoryTestDto.getUserId());
stuError.setSingleIds(String.valueOf(theoryTestDto.getSingleErrorIds()));
stuError.setMultipleIds(String.valueOf(theoryTestDto.getMultipleErrorIds()));
stuError.setJudgeIds(String.valueOf(theoryTestDto.getJudgeErrorIds()));
String singleError = String.valueOf(theoryTestDto.getSingleErrorIds()).replace("[", "").replace("]", "");
stuError.setSingleIds(singleError);
String multipleError = String.valueOf(theoryTestDto.getMultipleErrorIds()).replace("[", "").replace("]", "");
stuError.setMultipleIds(multipleError);
String judgeError = String.valueOf(theoryTestDto.getJudgeErrorIds()).replace("[", "").replace("]", "");
stuError.setJudgeIds(judgeError);
errorMapper.insert(stuError);
} else {
StuErrorWithBLOBs stuError = stuErrors.get(0);
@ -88,9 +102,11 @@ public class TheoryTestServiceImpl implements TheoryTestService {
combinedList.addAll(singleErrorIds);
Set<String> uniqueSet = new HashSet<>(combinedList);
List<String> uniqueList = new ArrayList<>(uniqueSet);
stuError.setSingleIds(String.valueOf(uniqueList));
String stringUnique = String.valueOf(uniqueList).replace("[", "").replace("]", "");
stuError.setSingleIds(stringUnique);
} else {
stuError.setSingleIds(String.valueOf(theoryTestDto.getSingleErrorIds()));
String stringError = String.valueOf(theoryTestDto.getSingleErrorIds()).replace("[", "").replace("]", "");
stuError.setSingleIds(stringError);
}
if (stuError.getMultipleIds() != null) {
List<String> stringList = Arrays.asList(stuError.getMultipleIds().substring(1, stuError.getMultipleIds().length() - 1).split(", "));
@ -100,9 +116,11 @@ public class TheoryTestServiceImpl implements TheoryTestService {
combinedList.addAll(multipleErrorIds);
Set<String> uniqueSet = new HashSet<>(combinedList);
List<String> uniqueList = new ArrayList<>(uniqueSet);
stuError.setMultipleIds(String.valueOf(uniqueList));
String stringUnique = String.valueOf(uniqueList).replace("[", "").replace("]", "");
stuError.setMultipleIds(stringUnique);
} else {
stuError.setMultipleIds(String.valueOf(theoryTestDto.getMultipleErrorIds()));
String stringMultipleError = String.valueOf(theoryTestDto.getMultipleErrorIds()).replace("[", "").replace("]", "");
stuError.setMultipleIds(stringMultipleError);
}
if (stuError.getJudgeIds() != null) {
List<String> stringList = Arrays.asList(stuError.getJudgeIds().substring(1, stuError.getJudgeIds().length() - 1).split(", "));
@ -111,9 +129,11 @@ public class TheoryTestServiceImpl implements TheoryTestService {
combinedList.addAll(judgeErrorIds);
Set<String> uniqueSet = new HashSet<>(combinedList);
List<String> uniqueList = new ArrayList<>(uniqueSet);
stuError.setJudgeIds(String.valueOf(uniqueList));
String stringUnique = String.valueOf(uniqueList).replace("[", "").replace("]", "");
stuError.setJudgeIds(stringUnique);
} else {
stuError.setJudgeIds(String.valueOf(theoryTestDto.getJudgeErrorIds()));
String stringJudgeError = String.valueOf(theoryTestDto.getJudgeErrorIds()).replace("[", "").replace("]", "");
stuError.setJudgeIds(stringJudgeError);
}
errorMapper.updateByPrimaryKeySelective(stuError);
}
@ -122,7 +142,6 @@ public class TheoryTestServiceImpl implements TheoryTestService {
return i;
}
public void UpdateTheoryRecord(String userId, BigDecimal score, Integer examDuration) {
StuTheoryRecord record = theoryRecordMapper.selectByPrimaryKey(userId);
if (record != null) {
@ -185,7 +204,9 @@ public class TheoryTestServiceImpl implements TheoryTestService {
}
/**
/**
*
*
* @author xcj
* @Date 2024/8/26
*/
@ -195,9 +216,9 @@ public class TheoryTestServiceImpl implements TheoryTestService {
StuTheoryExamWithBLOBs data = theoryExamMapper.selectByPrimaryKey(theoryExamId);
BeanUtils.copyProperties(data, dto);
String source = data.getSource();
int singleSize = data.getSingleIds().split(",").length;
int multipleSize = data.getMultipleIds().split(",").length;
int judgeSize = data.getJudgeIds().split(",").length;
int singleSize = data.getSingleIds().split(", ").length;
int multipleSize = data.getMultipleIds().split(", ").length;
int judgeSize = data.getJudgeIds().split(", ").length;
String name = userMapper.selectByPrimaryKey(data.getUserId()).getName();
int totalSize = singleSize + multipleSize + judgeSize;
List<CalcAuthScore> list = new ArrayList<>();
@ -212,7 +233,7 @@ public class TheoryTestServiceImpl implements TheoryTestService {
int multipleCount = 0;
int judgeCount = 0;
if (!StringUtils.isBlank(data.getErrorIds())) {
List<String> errorList = Arrays.asList(data.getErrorIds().split(","));
List<String> errorList = Arrays.asList(data.getErrorIds().split(", "));
ObjectiveQuestionExample example = new ObjectiveQuestionExample();
example.createCriteria().andObjectiveIdIn(errorList);
List<ObjectiveQuestionWithBLOBs> dataErrors = objectiveQuestionMapper.selectByExampleWithBLOBs(example);
@ -628,17 +649,20 @@ public class TheoryTestServiceImpl implements TheoryTestService {
}
}
StuTheoryExamWithBLOBs stuTheoryExam = new StuTheoryExamWithBLOBs();
stuTheoryExam.setTheoryExamId(String.valueOf(UUID.randomUUID()));
stuTheoryExam.setTheoryExamId(IdUtil.randomUUID());
stuTheoryExam.setUserId(userId);
stuTheoryExam.setExamTime(new Date());
stuTheoryExam.setExamDuration(120);
stuTheoryExam.setAnswered(false);
stuTheoryExam.setSingleIds(String.valueOf(singleIdList));
String singleList = String.valueOf(singleIdList).replace("[", "").replace("]", "");
stuTheoryExam.setSingleIds(singleList);
if (!manyIdList.isEmpty()) {
stuTheoryExam.setMultipleIds(String.valueOf(manyIdList));
String manyList = String.valueOf(manyIdList).replace("[", "").replace("]", "");
stuTheoryExam.setMultipleIds(manyList);
}
if (!judgeIdList.isEmpty()) {
stuTheoryExam.setMultipleIds(String.valueOf(judgeIdList));
String judgeList = String.valueOf(manyIdList).replace("[", "").replace("]", "");
stuTheoryExam.setMultipleIds(judgeList);
}
stuTheoryExam.setSource(source);
theoryExamMapper.insert(stuTheoryExam);
@ -733,7 +757,8 @@ public class TheoryTestServiceImpl implements TheoryTestService {
error.setSingleIds(null);
} else {
List<String> list = new ArrayList<>(set);
error.setSingleIds(String.valueOf(list));
String singleId = String.valueOf(list).replace("[", "").replace("]", "");
error.setSingleIds(singleId);
}
}
if (1 == type) {
@ -743,7 +768,8 @@ public class TheoryTestServiceImpl implements TheoryTestService {
error.setMultipleIds(null);
} else {
List<String> list = new ArrayList<>(set);
error.setMultipleIds(String.valueOf(list));
String multipleId = String.valueOf(list).replace("[", "").replace("]", "");
error.setMultipleIds(multipleId);
}
}
if (2 == type) {
@ -753,7 +779,8 @@ public class TheoryTestServiceImpl implements TheoryTestService {
error.setJudgeIds(null);
} else {
List<String> list = new ArrayList<>(set);
error.setJudgeIds(String.valueOf(list));
String judgeId = String.valueOf(list).replace("[", "").replace("]", "");
error.setJudgeIds(judgeId);
}
}
int i = errorMapper.updateByPrimaryKeyWithBLOBs(error);

@ -351,10 +351,10 @@
<select id="getCaseInfoList" resultMap="ResultMapWithBLOBs">
select * from case_info
<where>
<if test="keyWord !=null">
<if test="keyWord !=null and keyWord !=''">
customer_name like CONCAT ('%',#{keyWord},'%') or id_card like CONCAT ('%',#{keyWord},'%')
</if>
<if test="type !=null">
<if test="type !=null and type !=''">
and manage_money_matters_type = #{type}
</if>
</where>

Loading…
Cancel
Save