|
|
|
@ -1248,18 +1248,22 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
CaseRiskIndexExample caseRiskIndexExample = new CaseRiskIndexExample();
|
|
|
|
|
caseRiskIndexExample.createCriteria().andIsAnswerEqualTo("学生答案").andUseridEqualTo(stuRiskIndex.getUserid()).andCaseidEqualTo(stuRiskIndex.getCaseid());
|
|
|
|
|
List<CaseRiskIndex> caseRiskIndices = caseRiskIndexMapper.selectByExample(caseRiskIndexExample);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//有数据,只删除原数据 修改学生答案 不算分
|
|
|
|
|
if (!caseRiskIndices.isEmpty()) {
|
|
|
|
|
for (CaseRiskIndex caseRiskIndex : caseRiskIndices) {
|
|
|
|
|
caseRiskIndexMapper.deleteByPrimaryKey(caseRiskIndex.getCaseRiskIndexId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getRiskIndexWrongCount(wrongCount, stuRiskIndex);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//新增对象
|
|
|
|
|
stuRiskIndex.setCaseRiskIndexId(IdUtil.randomUUID());
|
|
|
|
|
stuRiskIndex.setUpdateDate(new Date());
|
|
|
|
|
caseRiskIndexMapper.insert(stuRiskIndex);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getRiskIndexWrongCount(wrongCount, stuRiskIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("财务分析-资产负债表")) {
|
|
|
|
@ -1272,13 +1276,13 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseFinanceLiability caseFinanceLiability : caseFinanceLiabilities) {
|
|
|
|
|
caseFinanceLiabilityMapper.deleteByPrimaryKey(caseFinanceLiability.getCaseFinanceLiabilityId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseFinanceLiabilityWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuData.setCaseFinanceLiabilityId(IdUtil.randomUUID());
|
|
|
|
|
caseFinanceLiabilityMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseFinanceLiabilityWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("财务分析-收支储蓄表")) {
|
|
|
|
@ -1291,13 +1295,13 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseIncomeAndExpenses caseIncomeAndExpenses : caseFinanceLiabilities) {
|
|
|
|
|
caseIncomeAndExpensesMapper.deleteByPrimaryKey(caseIncomeAndExpenses.getCaseIncomeAndExpensesId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
wrongCount = getCaseIncomeAndExpensesWrongCount(wrongCount, stuData);
|
|
|
|
|
//比较正确答案
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuData.setCaseIncomeAndExpensesId(IdUtil.randomUUID());
|
|
|
|
|
caseIncomeAndExpensesMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseIncomeAndExpensesWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("财务分析-现金流量表")) {
|
|
|
|
@ -1310,13 +1314,14 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseCashFlow caseCashFlow : caseCashFlows) {
|
|
|
|
|
caseCashFlowMapper.deleteByPrimaryKey(caseCashFlow.getCaseCashFlowId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseCashFlowWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
stuData.setCaseCashFlowId(IdUtil.randomUUID());
|
|
|
|
|
caseCashFlowMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseCashFlowWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("财务分析-财务比例分析")) {
|
|
|
|
@ -1346,13 +1351,14 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseCashPlan caseCashPlan : caseCashFlows) {
|
|
|
|
|
caseCashPlanMapper.deleteByPrimaryKey(caseCashPlan.getCaseCashPlanId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseCashPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuData.setCaseCashPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseCashPlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseCashPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("生涯规划-教育规划")) {
|
|
|
|
@ -1365,13 +1371,14 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseLifeEducationPlan caseLifeEducationPlan : caseLifeEducationPlans) {
|
|
|
|
|
caseLifeEducationPlanMapper.deleteByPrimaryKey(caseLifeEducationPlan.getCaseLifeEducationPlanId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseLifeEducationPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
stuData.setCaseLifeEducationPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseLifeEducationPlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseLifeEducationPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("生涯规划-消费规划")) {
|
|
|
|
@ -1384,13 +1391,14 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseConsumptionPlan caseConsumptionPlan : caseConsumptionPlans) {
|
|
|
|
|
caseConsumptionPlanMapper.deleteByPrimaryKey(caseConsumptionPlan.getCaseConsumptionPlanId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseConsumptionPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
stuData.setCaseConsumptionPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseConsumptionPlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseConsumptionPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("生涯规划-创业规划")) {
|
|
|
|
@ -1403,13 +1411,13 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseStartAnUndertakingPlan caseStartAnUndertakingPlan : caseLifeEducationPlans) {
|
|
|
|
|
caseStartAnUndertakingPlanMapper.deleteByPrimaryKey(caseStartAnUndertakingPlan.getCaseStartAnUndertakingPlanId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseStartAnUndertakingPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuData.setCaseStartAnUndertakingPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseStartAnUndertakingPlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseStartAnUndertakingPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("生涯规划-退休规划")) {
|
|
|
|
@ -1422,13 +1430,13 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseRetirementPlan caseRetirementPlan : caseRetirementPlans) {
|
|
|
|
|
caseRetirementPlanMapper.deleteByPrimaryKey(caseRetirementPlan.getCaseRetirementPlanId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseRetirementPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuData.setCaseRetirementPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseRetirementPlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseRetirementPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("生涯规划-保险规划")) {
|
|
|
|
@ -1441,33 +1449,16 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseInsurancePlan caseInsurancePlan : caseRetirementPlans) {
|
|
|
|
|
caseInsurancePlanMapper.deleteByPrimaryKey(caseInsurancePlan.getCaseInsurancePlanId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseInsurancePlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
stuData.setCaseInsurancePlanId(IdUtil.randomUUID());
|
|
|
|
|
caseInsurancePlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseInsurancePlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (type.equals("投资规划")) {
|
|
|
|
|
// CaseInvestmentPlan stuInvestmentPlan = gson.fromJson(json, CaseInvestmentPlan.class);
|
|
|
|
|
// CaseInvestmentPlanExample caseInvestmentPlanExample = new CaseInvestmentPlanExample();
|
|
|
|
|
// caseInvestmentPlanExample.createCriteria().andIsAnswerEqualTo("学生答案").andUserIdEqualTo(stuInvestmentPlan.getUserId()).andCaseIdEqualTo(stuInvestmentPlan.getCaseId());
|
|
|
|
|
// List<CaseInvestmentPlan> caseInvestmentPlans = investmentPlanMapper.selectByExampleWithBLOBs(caseInvestmentPlanExample);
|
|
|
|
|
// if (!caseInvestmentPlans.isEmpty()) {
|
|
|
|
|
// for (CaseInvestmentPlan caseInvestmentPlan : caseInvestmentPlans) {
|
|
|
|
|
// investmentPlanMapper.deleteByPrimaryKey(caseInvestmentPlan.getCaseInvestmentPlanId());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// stuInvestmentPlan.setCaseInvestmentPlanId(IdUtil.randomUUID());
|
|
|
|
|
// investmentPlanMapper.insert(stuInvestmentPlan);
|
|
|
|
|
//
|
|
|
|
|
// //比较正确答案
|
|
|
|
|
// wrongCount = getCaseInvestmentPlan(wrongCount, stuInvestmentPlan);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//先查询一次
|
|
|
|
|
if (type.equals("投资规划")) {
|
|
|
|
|
CaseInvestmentPlanDto caseInvestmentPlanDto = gson.fromJson(json, CaseInvestmentPlanDto.class);
|
|
|
|
@ -1498,6 +1489,11 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
investmentPlanRealGoldProductInfoMapper.deleteByPrimaryKey(productSelectId);
|
|
|
|
|
}
|
|
|
|
|
investmentPlanMapper.deleteByPrimaryKey(caseInvestmentPlan.getCaseInvestmentPlanId());
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseInvestmentPlan(wrongCount, investmentPlan);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//新增主表
|
|
|
|
@ -1596,8 +1592,6 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseInvestmentPlan(wrongCount, investmentPlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("税务筹划")) {
|
|
|
|
@ -1610,13 +1604,13 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseTaxPlan caseTaxPlan : caseTaxPlans) {
|
|
|
|
|
caseTaxPlanMapper.deleteByPrimaryKey(caseTaxPlan.getCaseTaxPlanId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseTaxPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuData.setCaseTaxPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseTaxPlanMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseTaxPlanWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (type.equals("财产分配")) {
|
|
|
|
@ -1652,7 +1646,6 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
|
|
|
|
|
if (type.equals("财产传承")) {
|
|
|
|
|
CaseHeritageWithBLOBs stuData = gson.fromJson(json, CaseHeritageWithBLOBs.class);
|
|
|
|
|
stuData.setCaseHeritageId(IdUtil.randomUUID());
|
|
|
|
|
|
|
|
|
|
CaseHeritageExample caseHeritageExample = new CaseHeritageExample();
|
|
|
|
|
caseHeritageExample.createCriteria().andIsAnswerEqualTo("学生答案").andUserIdEqualTo(stuData.getUserId()).andCaseidEqualTo(stuData.getCaseid());
|
|
|
|
@ -1661,11 +1654,13 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
for (CaseHeritageWithBLOBs distributionOfPropertyWithBLOBs : caseHeritageWithBLOBs) {
|
|
|
|
|
caseHeritageMapper.deleteByPrimaryKey(distributionOfPropertyWithBLOBs.getCaseHeritageId());
|
|
|
|
|
}
|
|
|
|
|
} else { //没数据 算分
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseHeritageWrongCount(wrongCount, stuData);
|
|
|
|
|
setCount(stuTrainingWithBLOBs, wrongCount);
|
|
|
|
|
}
|
|
|
|
|
stuData.setCaseHeritageId(IdUtil.randomUUID());
|
|
|
|
|
caseHeritageMapper.insert(stuData);
|
|
|
|
|
|
|
|
|
|
//比较正确答案
|
|
|
|
|
wrongCount = getCaseHeritageWrongCount(wrongCount, stuData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} catch (
|
|
|
|
@ -1673,13 +1668,17 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
throw new RuntimeException("实训提交失败");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//第一次添加时设置值 重新实训不提交
|
|
|
|
|
private void setCount(StuTrainingWithBLOBs stuTrainingWithBLOBs, int wrongCount) {
|
|
|
|
|
if (stuTrainingWithBLOBs.getExpTrainingCompleteStatus() == null) {
|
|
|
|
|
stuTrainingWithBLOBs.setExpTrainingCompleteStatus(wrongCount);
|
|
|
|
|
stuTrainingMapper.updateByPrimaryKeySelective(stuTrainingWithBLOBs);
|
|
|
|
|
} else {
|
|
|
|
|
Integer expTrainingCompleteStatus = stuTrainingWithBLOBs.getExpTrainingCompleteStatus();
|
|
|
|
|
expTrainingCompleteStatus += wrongCount;
|
|
|
|
|
stuTrainingWithBLOBs.setExpTrainingCompleteStatus(expTrainingCompleteStatus);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stuTrainingMapper.updateByPrimaryKeySelective(stuTrainingWithBLOBs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int getCaseInvestmentPlan(int wrongCount, CaseInvestmentPlan stuInvestmentPlan) {
|
|
|
|
@ -2786,7 +2785,8 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
return caseCashPlans.get(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private CaseFinancialRatiosWithBLOBs getCaseFinancialRatiosWithBLOBs(String caseID, String userId, String isAnswer) {
|
|
|
|
|
private CaseFinancialRatiosWithBLOBs getCaseFinancialRatiosWithBLOBs(String caseID, String userId, String
|
|
|
|
|
isAnswer) {
|
|
|
|
|
CaseFinancialRatiosExample example = new CaseFinancialRatiosExample();
|
|
|
|
|
CaseFinancialRatiosExample.Criteria criteria = example.createCriteria().andCaseidEqualTo(caseID).andIsAnswerEqualTo(isAnswer);
|
|
|
|
|
if (StringUtils.isBlank(userId)) {
|
|
|
|
|