|
|
|
@ -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);
|
|
|
|
|