|
|
|
@ -81,6 +81,7 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private CaseInvestmentPlanSelectMapper caseInvestmentPlanSelectMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void insertSynthesisPlanClient(CaseInfo newCase) {
|
|
|
|
|
SynthesisPlanClient synthesisPlanClient = new SynthesisPlanClient();
|
|
|
|
|
|
|
|
|
@ -141,6 +142,224 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
synthesisPlanClientMapper.insert(synthesisPlanClient);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity<HttpStatus> insertComprehensivePlanCase(StuCaseDto stuCaseDto) {
|
|
|
|
|
CaseInfo caseInfo = stuCaseDto.getCaseInfo();
|
|
|
|
|
//新增 综合规划表 和 客户案例信息表 包含修改
|
|
|
|
|
adminOrTeaInsert("master", caseInfo);
|
|
|
|
|
|
|
|
|
|
//财务分析现金流量表
|
|
|
|
|
if (stuCaseDto.getCaseCashFlow() != null) {
|
|
|
|
|
CaseCashFlow caseCashFlow = stuCaseDto.getCaseCashFlow();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseCashFlow.getCaseCashFlowId())) {
|
|
|
|
|
caseCashFlow.setCaseCashFlowId(IdUtil.randomUUID());
|
|
|
|
|
caseCashFlowMapper.insert(caseCashFlow);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseCashFlow.getCaseCashFlowId())) {
|
|
|
|
|
caseCashFlowMapper.updateByPrimaryKeySelective(caseCashFlow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例现金规划表
|
|
|
|
|
if (stuCaseDto.getCaseCashPlan() != null) {
|
|
|
|
|
CaseCashPlan caseCashPlan = stuCaseDto.getCaseCashPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseCashPlan.getCaseCashPlanId())) {
|
|
|
|
|
caseCashPlan.setCaseCashPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseCashPlanMapper.insert(caseCashPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseCashPlan.getCaseCashPlanId())) {
|
|
|
|
|
caseCashPlanMapper.updateByPrimaryKeySelective(caseCashPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//生涯规划-消费规划表
|
|
|
|
|
if (stuCaseDto.getCaseConsumptionPlan() != null) {
|
|
|
|
|
CaseConsumptionPlan caseConsumptionPlan = stuCaseDto.getCaseConsumptionPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseConsumptionPlan.getCaseConsumptionPlanId())) {
|
|
|
|
|
caseConsumptionPlan.setCaseConsumptionPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseConsumptionPlanMapper.insert(caseConsumptionPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseConsumptionPlan.getCaseConsumptionPlanId())) {
|
|
|
|
|
caseConsumptionPlanMapper.updateByPrimaryKeySelective(caseConsumptionPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财产分配表
|
|
|
|
|
if (stuCaseDto.getCaseDistributionOfProperty() != null) {
|
|
|
|
|
CaseDistributionOfPropertyWithBLOBs caseDistributionOfProperty = stuCaseDto.getCaseDistributionOfProperty();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseDistributionOfProperty.getCaseDistributionOfPropertyId())) {
|
|
|
|
|
caseDistributionOfProperty.setCaseDistributionOfPropertyId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyMapper.insert(caseDistributionOfProperty);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseDistributionOfProperty.getCaseDistributionOfPropertyId())) {
|
|
|
|
|
caseDistributionOfPropertyMapper.updateByPrimaryKeySelective(caseDistributionOfProperty);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财产分配家庭结构记录表
|
|
|
|
|
if (stuCaseDto.getCaseDistributionOfPropertyFamilyRecords() != null) {
|
|
|
|
|
CaseDistributionOfPropertyFamilyRecords caseDistributionOfPropertyFamilyRecords = stuCaseDto.getCaseDistributionOfPropertyFamilyRecords();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseDistributionOfPropertyFamilyRecords.getCaseDistributionOfPropertyFamilyRecordsId())) {
|
|
|
|
|
caseDistributionOfPropertyFamilyRecords.setCaseDistributionOfPropertyFamilyRecordsId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyFamilyRecordsMapper.insert(caseDistributionOfPropertyFamilyRecords);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseDistributionOfPropertyFamilyRecords.getCaseDistributionOfPropertyFamilyRecordsId())) {
|
|
|
|
|
caseDistributionOfPropertyFamilyRecordsMapper.updateByPrimaryKeySelective(caseDistributionOfPropertyFamilyRecords);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//财务分析-资产负债表
|
|
|
|
|
if (stuCaseDto.getCaseFinanceLiability() != null) {
|
|
|
|
|
CaseFinanceLiability caseFinanceLiability = stuCaseDto.getCaseFinanceLiability();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseFinanceLiability.getCaseFinanceLiabilityId())) {
|
|
|
|
|
caseFinanceLiability.setCaseFinanceLiabilityId(IdUtil.randomUUID());
|
|
|
|
|
caseFinanceLiabilityMapper.insert(caseFinanceLiability);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseFinanceLiability.getCaseFinanceLiabilityId())) {
|
|
|
|
|
caseFinanceLiabilityMapper.updateByPrimaryKeySelective(caseFinanceLiability);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财务分析财务比率分析表
|
|
|
|
|
if (stuCaseDto.getCaseFinancialRatios() != null) {
|
|
|
|
|
CaseFinancialRatiosWithBLOBs caseFinancialRatios = stuCaseDto.getCaseFinancialRatios();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseFinancialRatios.getCaseFinancialRatiosId())) {
|
|
|
|
|
caseFinancialRatios.setCaseFinancialRatiosId(IdUtil.randomUUID());
|
|
|
|
|
caseFinancialRatiosMapper.insert(caseFinancialRatios);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseFinancialRatios.getCaseFinancialRatiosId())) {
|
|
|
|
|
caseFinancialRatiosMapper.updateByPrimaryKeySelective(caseFinancialRatios);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例遗产传承表
|
|
|
|
|
if (stuCaseDto.getCaseHeritage() != null) {
|
|
|
|
|
CaseHeritageWithBLOBs caseHeritage = stuCaseDto.getCaseHeritage();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseHeritage.getCaseHeritageId())) {
|
|
|
|
|
caseHeritage.setCaseHeritageId(IdUtil.randomUUID());
|
|
|
|
|
caseHeritageMapper.insert(caseHeritage);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseHeritage.getCaseHeritageId())) {
|
|
|
|
|
caseHeritageMapper.updateByPrimaryKeySelective(caseHeritage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财务分析收支储蓄表
|
|
|
|
|
if (stuCaseDto.getCaseIncomeAndExpenses() != null) {
|
|
|
|
|
CaseIncomeAndExpenses caseIncomeAndExpenses = stuCaseDto.getCaseIncomeAndExpenses();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseIncomeAndExpenses.getCaseIncomeAndExpensesId())) {
|
|
|
|
|
caseIncomeAndExpenses.setCaseIncomeAndExpensesId(IdUtil.randomUUID());
|
|
|
|
|
caseIncomeAndExpensesMapper.insert(caseIncomeAndExpenses);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseIncomeAndExpenses.getCaseIncomeAndExpensesId())) {
|
|
|
|
|
caseIncomeAndExpensesMapper.updateByPrimaryKeySelective(caseIncomeAndExpenses);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//投资规划案例表
|
|
|
|
|
if (stuCaseDto.getCaseInvestmentPlan() != null) {
|
|
|
|
|
CaseInvestmentPlan caseInvestmentPlan = stuCaseDto.getCaseInvestmentPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseInvestmentPlan.getCaseInvestmentPlanId())) {
|
|
|
|
|
caseInvestmentPlan.setCaseInvestmentPlanId(IdUtil.randomUUID());
|
|
|
|
|
investmentPlanMapper.insert(caseInvestmentPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseInvestmentPlan.getCaseInvestmentPlanId())) {
|
|
|
|
|
investmentPlanMapper.updateByPrimaryKeySelective(caseInvestmentPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划保险规划表
|
|
|
|
|
if (stuCaseDto.getCaseInsurancePlan() != null) {
|
|
|
|
|
CaseInsurancePlan caseInsurancePlan = stuCaseDto.getCaseInsurancePlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseInsurancePlan.getCaseInsurancePlanId())) {
|
|
|
|
|
caseInsurancePlan.setCaseInsurancePlanId(IdUtil.randomUUID());
|
|
|
|
|
caseInsurancePlanMapper.insert(caseInsurancePlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseInsurancePlan.getCaseInsurancePlanId())) {
|
|
|
|
|
caseInsurancePlanMapper.updateByPrimaryKeySelective(caseInsurancePlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划教育规划表
|
|
|
|
|
if (stuCaseDto.getCaseLifeEducationPlan() != null) {
|
|
|
|
|
CaseLifeEducationPlan caseLifeEducationPlan = stuCaseDto.getCaseLifeEducationPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseLifeEducationPlan.getCaseLifeEducationPlanId())) {
|
|
|
|
|
caseLifeEducationPlan.setCaseLifeEducationPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseLifeEducationPlanMapper.insert(caseLifeEducationPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseLifeEducationPlan.getCaseLifeEducationPlanId())) {
|
|
|
|
|
caseLifeEducationPlanMapper.updateByPrimaryKeySelective(caseLifeEducationPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划退休规划表
|
|
|
|
|
if (stuCaseDto.getCaseRetirementPlan() != null) {
|
|
|
|
|
CaseRetirementPlan caseRetirementPlan = stuCaseDto.getCaseRetirementPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseRetirementPlan.getCaseRetirementPlanId())) {
|
|
|
|
|
caseRetirementPlan.setCaseRetirementPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseRetirementPlanMapper.insert(caseRetirementPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseRetirementPlan.getCaseRetirementPlanId())) {
|
|
|
|
|
caseRetirementPlanMapper.updateByPrimaryKeySelective(caseRetirementPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//风险测评-风险指标表
|
|
|
|
|
if (stuCaseDto.getCaseRiskIndex() != null) {
|
|
|
|
|
CaseRiskIndex caseRiskIndex = stuCaseDto.getCaseRiskIndex();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseRiskIndex.getCaseRiskIndexId())) {
|
|
|
|
|
caseRiskIndex.setCaseRiskIndexId(IdUtil.randomUUID());
|
|
|
|
|
caseRiskIndexMapper.insert(caseRiskIndex);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseRiskIndex.getCaseRiskIndexId())) {
|
|
|
|
|
caseRiskIndexMapper.updateByPrimaryKeySelective(caseRiskIndex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划创业规划表
|
|
|
|
|
if (stuCaseDto.getCaseStartAnUndertakingPlan() != null) {
|
|
|
|
|
CaseStartAnUndertakingPlan caseStartAnUndertakingPlan = stuCaseDto.getCaseStartAnUndertakingPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseStartAnUndertakingPlan.getCaseStartAnUndertakingPlanId())) {
|
|
|
|
|
caseStartAnUndertakingPlan.setCaseStartAnUndertakingPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseStartAnUndertakingPlanMapper.insert(caseStartAnUndertakingPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseStartAnUndertakingPlan.getCaseStartAnUndertakingPlanId())) {
|
|
|
|
|
caseStartAnUndertakingPlanMapper.updateByPrimaryKeySelective(caseStartAnUndertakingPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例税务筹划表
|
|
|
|
|
if (stuCaseDto.getCaseTaxPlan() != null) {
|
|
|
|
|
CaseTaxPlan caseTaxPlan = stuCaseDto.getCaseTaxPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseTaxPlan.getCaseTaxPlanId())) {
|
|
|
|
|
caseTaxPlan.setCaseTaxPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseTaxPlanMapper.insert(caseTaxPlan);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isNotBlank(caseTaxPlan.getCaseTaxPlanId())) {
|
|
|
|
|
caseTaxPlanMapper.updateByPrimaryKeySelective(caseTaxPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity<HttpStatus> insertCase(String caseInfo, String json, String operator, String type) {
|
|
|
|
|
Gson gson = new Gson();
|
|
|
|
@ -632,6 +851,7 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.OK, "操作成功!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ResultEntity<HttpStatus> teaOrAdminUpdateOrInsertInvestmentPlan(CaseInvestmentPlanDto caseInvestmentPlanDto) {
|
|
|
|
|
CaseInvestmentPlan investmentPlan = caseInvestmentPlanDto.getInvestmentPlan();
|
|
|
|
|
|
|
|
|
@ -1699,10 +1919,10 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
example.createCriteria().andCaseidEqualTo(caseID);
|
|
|
|
|
List<ComCase> comCases = comCaseMapper.selectByExample(example);
|
|
|
|
|
|
|
|
|
|
SynthesisPlanClientExample example1 =new SynthesisPlanClientExample();
|
|
|
|
|
SynthesisPlanClientExample example1 = new SynthesisPlanClientExample();
|
|
|
|
|
example1.createCriteria().andUseridEqualTo(userId).andCaseidEqualTo(caseID);
|
|
|
|
|
List<SynthesisPlanClient> synthesisPlanClientList = synthesisPlanClientMapper.selectByExample(example1);
|
|
|
|
|
if (synthesisPlanClientList!=null && !synthesisPlanClientList.isEmpty()){
|
|
|
|
|
if (synthesisPlanClientList != null && !synthesisPlanClientList.isEmpty()) {
|
|
|
|
|
SynthesisPlanClient synthesisPlanClient = synthesisPlanClientList.get(0);
|
|
|
|
|
synthesisPlanClient.setSubmitStatus("未审核");
|
|
|
|
|
synthesisPlanClientMapper.updateByPrimaryKey(synthesisPlanClient);
|
|
|
|
|