修改综合规划下方展示类型接口

修改投资规划案例表,产品选择表,实物黄金等五张产品表的学生提交实训,新增,编辑的逻辑
修改综合规划案例表编辑逻辑
master
xiaoCJ 5 months ago
parent 2b1a937f63
commit 1f4697e9dc

@ -100,15 +100,14 @@ public class CaseController {
@PostMapping("/ZHGHType")
@ApiOperation("综合规划下方展示类型")
@AnonymousAccess
private ResultEntity<List<String>> editDropDown(@RequestParam String caseID) {
private ResultEntity<String> editDropDown(@RequestParam String caseID) {
ComCaseExample example = new ComCaseExample();
example.createCriteria().andCaseidEqualTo(caseID);
List<ComCase> comCases = comCaseMapper.selectByExample(example);
if (comCases.isEmpty()) {
return null;
}
List<String> typeList = comCases.stream().map(ComCase::getManageMoneyMattersType).collect(Collectors.toList());
return new ResultEntity<>(typeList);
return new ResultEntity<>(comCases.get(0).getManageMoneyMattersType());
}
@AnonymousAccess

@ -65,9 +65,15 @@ public class StatisticsController {
stuStatisticsDto.setScore(scoreRank.getTotalScore());
//获取客户案例时长
Integer khanTime=stuTrainingMapper.selectTotalTrainingTimeByUserId(userId);
if (khanTime==null){
khanTime = 0;
}
stuStatisticsDto.setKhalTime(khanTime);
//获取综合规划时间
Integer zhghTime=synthesisPlanClientMapper.getTotalUseTime(userId);
if (zhghTime==null){
zhghTime = 0;
}
stuStatisticsDto.setZhghTime(zhghTime);
//获取考试中心时间
StuTheoryRecord stuTheoryRecord = stuTheoryRecordMapper.selectByPrimaryKey(userId);

@ -525,7 +525,6 @@ public class CaseServiceImpl implements CaseService {
newCase.setCaseid(IdUtil.randomUUID());
newCase.setAddTime(new Date());
caseInfoMapper.insert(newCase);
//综合规划需要额外新增一张表
if (newCase.getModel().equals("综合规划")) {
ComCase comCase = new ComCase();
@ -540,6 +539,16 @@ public class CaseServiceImpl implements CaseService {
//修改案例信息表
caseInfoMapper.updateByPrimaryKeySelective(newCase);
//修改实训类型
if (newCase.getModel().equals("综合规划")) {
ComCaseExample example1 = new ComCaseExample();
example1.createCriteria().andCaseidEqualTo(newCase.getCaseid());
List<ComCase> comCases = comCaseMapper.selectByExample(example1);
ComCase comCase = comCases.get(0);
comCase.setManageMoneyMattersType(newCase.getManageMoneyMattersType());
comCaseMapper.updateByPrimaryKeySelective(comCase);
}
//同时修改综合综合规划客户表
SynthesisPlanClient synthesisPlanClient = new SynthesisPlanClient();
synthesisPlanClient.setName(newCase.getCustomerName());
@ -1309,7 +1318,39 @@ public class CaseServiceImpl implements CaseService {
CaseInvestmentPlan investmentPlan = caseInvestmentPlanDto.getInvestmentPlan();
//投资规划-产品选择表和其余五张表是一对多关系
//提交功能 主表必定不为空,把老数据查出来删掉
CaseInvestmentPlanExample example = new CaseInvestmentPlanExample();
example.createCriteria().andCaseIdEqualTo(investmentPlan.getCaseId()).andUserIdEqualTo(investmentPlan.getUserId()).andIsAnswerEqualTo("学生答案");
List<CaseInvestmentPlan> caseInvestmentPlans = investmentPlanMapper.selectByExampleWithBLOBs(example);
//删除老数据
if (caseInvestmentPlans != null && !caseInvestmentPlans.isEmpty()) {
CaseInvestmentPlan caseInvestmentPlan = caseInvestmentPlans.get(0);
CaseInvestmentPlanSelectExample planSelectExample = new CaseInvestmentPlanSelectExample();
planSelectExample.createCriteria().andCaseInvestmentPlanIdEqualTo(caseInvestmentPlan.getCaseInvestmentPlanId());
List<CaseInvestmentPlanSelect> investmentPlanSelectsDataList = caseInvestmentPlanSelectMapper.selectByExampleWithBLOBs(planSelectExample);
if (investmentPlanSelectsDataList != null && !investmentPlanSelectsDataList.isEmpty()) {
CaseInvestmentPlanSelect investmentPlanSelectsData = investmentPlanSelectsDataList.get(0);
String productSelectId = investmentPlanSelectsData.getProductSelectId();
caseInvestmentPlanSelectMapper.deleteByPrimaryKey(productSelectId);
caseInvestmentPlanSelectMapper.deleteByPrimaryKey(productSelectId);
investmentPlanFundProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanBankProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanInsuranceProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanP2PProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanRealGoldProductInfoMapper.deleteByPrimaryKey(productSelectId);
}
investmentPlanMapper.deleteByPrimaryKey(caseInvestmentPlan.getCaseInvestmentPlanId());
}
//新增主表
String newCaseInvestmentPlanId = IdUtil.randomUUID();
investmentPlan.setCaseInvestmentPlanId(newCaseInvestmentPlanId);
investmentPlanMapper.insert(investmentPlan);
//投资规划-产品选择表和其余五张表是一对多关系 //下面都为新增操作
if (caseInvestmentPlanDto.getCaseInvestmentPlanSelectDtos() != null
&& !caseInvestmentPlanDto.getCaseInvestmentPlanSelectDtos().isEmpty()) {
List<CaseInvestmentPlanSelectDto> investmentPlanSelects = caseInvestmentPlanDto.getCaseInvestmentPlanSelectDtos();
@ -1319,38 +1360,6 @@ public class CaseServiceImpl implements CaseService {
CaseInvestmentPlanSelect caseInvestmentPlanSelect = investmentPlanSelect.getCaseInvestmentPlanSelect(); //产品选择表
String selectId = IdUtil.randomUUID();
//提交功能 主表必定不为空,把老数据查出来删掉
CaseInvestmentPlanExample example = new CaseInvestmentPlanExample();
example.createCriteria().andCaseIdEqualTo(investmentPlan.getCaseId()).andUserIdEqualTo(investmentPlan.getUserId()).andIsAnswerEqualTo("学生答案");
List<CaseInvestmentPlan> caseInvestmentPlans = investmentPlanMapper.selectByExampleWithBLOBs(example);
//删除老数据
if (caseInvestmentPlans != null) {
CaseInvestmentPlan caseInvestmentPlan = caseInvestmentPlans.get(0);
CaseInvestmentPlanSelectExample planSelectExample = new CaseInvestmentPlanSelectExample();
planSelectExample.createCriteria().andCaseInvestmentPlanIdEqualTo(caseInvestmentPlan.getCaseInvestmentPlanId());
List<CaseInvestmentPlanSelect> investmentPlanSelectsDataList = caseInvestmentPlanSelectMapper.selectByExampleWithBLOBs(planSelectExample);
if (investmentPlanSelectsDataList != null) {
CaseInvestmentPlanSelect investmentPlanSelectsData = investmentPlanSelectsDataList.get(0);
String productSelectId = investmentPlanSelectsData.getProductSelectId();
caseInvestmentPlanSelectMapper.deleteByPrimaryKey(productSelectId);
caseInvestmentPlanSelectMapper.deleteByPrimaryKey(productSelectId);
investmentPlanFundProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanBankProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanInsuranceProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanP2PProductInfoMapper.deleteByPrimaryKey(productSelectId);
investmentPlanRealGoldProductInfoMapper.deleteByPrimaryKey(productSelectId);
}
investmentPlanMapper.deleteByPrimaryKey(caseInvestmentPlan.getCaseInvestmentPlanId());
}
//新增主表
String newCaseInvestmentPlanId = IdUtil.randomUUID();
investmentPlan.setCaseInvestmentPlanId(newCaseInvestmentPlanId);
investmentPlanMapper.insert(investmentPlan);
//下面都为新增操作
if (caseInvestmentPlanSelect != null) {
caseInvestmentPlanSelect.setProductSelectId(selectId);
caseInvestmentPlanSelect.setCaseInvestmentPlanId(newCaseInvestmentPlanId);

Loading…
Cancel
Save