|
|
|
@ -151,219 +151,223 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
String caseId = adminOrTeaInsert("master", caseInfo);
|
|
|
|
|
|
|
|
|
|
//为null代表上一步报错了
|
|
|
|
|
if ("false".equals(caseId)){
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST,"系统已存在该身份证,请重试!");
|
|
|
|
|
if ("false".equals(caseId)) {
|
|
|
|
|
return new ResultEntity<HttpStatus>(HttpStatus.BAD_REQUEST, "系统已存在该身份证,请重试!");
|
|
|
|
|
}
|
|
|
|
|
//财务分析现金流量表
|
|
|
|
|
CaseCashFlow caseCashFlow = new CaseCashFlow();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (stuCaseDto.getCaseCashFlow() != null) {
|
|
|
|
|
|
|
|
|
|
caseCashFlow = stuCaseDto.getCaseCashFlow();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseCashFlow.getCaseid())) {
|
|
|
|
|
caseCashFlow.setCaseid(caseId);
|
|
|
|
|
caseCashFlow.setCaseCashFlowId(IdUtil.randomUUID());
|
|
|
|
|
caseCashFlowMapper.insert(caseCashFlow);
|
|
|
|
|
} else {
|
|
|
|
|
caseCashFlowMapper.updateByPrimaryKeySelective(caseCashFlow);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(caseCashFlow.getCaseCashFlowId())) {
|
|
|
|
|
caseCashFlow.setCaseid(caseId);
|
|
|
|
|
caseCashFlow.setCaseCashFlowId(IdUtil.randomUUID());
|
|
|
|
|
caseCashFlowMapper.insert(caseCashFlow);
|
|
|
|
|
} else {
|
|
|
|
|
caseCashFlowMapper.updateByPrimaryKeySelective(caseCashFlow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例现金规划表
|
|
|
|
|
CaseCashPlan caseCashPlan = new CaseCashPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (stuCaseDto.getCaseCashPlan() != null) {
|
|
|
|
|
caseCashPlan = stuCaseDto.getCaseCashPlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseCashPlan.getCaseid())) {
|
|
|
|
|
caseCashPlan.setCaseid(caseId);
|
|
|
|
|
caseCashPlan.setCaseCashPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseCashPlanMapper.insert(caseCashPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseCashPlanMapper.updateByPrimaryKeySelective(caseCashPlan);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(caseCashPlan.getCaseCashPlanId())) {
|
|
|
|
|
caseCashPlan.setCaseid(caseId);
|
|
|
|
|
caseCashPlan.setCaseCashPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseCashPlanMapper.insert(caseCashPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseCashPlanMapper.updateByPrimaryKeySelective(caseCashPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//生涯规划-消费规划表
|
|
|
|
|
CaseConsumptionPlan caseConsumptionPlan = new CaseConsumptionPlan();
|
|
|
|
|
if (stuCaseDto.getCaseConsumptionPlan() != null) {
|
|
|
|
|
caseConsumptionPlan = stuCaseDto.getCaseConsumptionPlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseConsumptionPlan.getCaseId())) {
|
|
|
|
|
caseConsumptionPlan.setCaseId(caseId);
|
|
|
|
|
caseConsumptionPlan.setCaseConsumptionPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseConsumptionPlanMapper.insert(caseConsumptionPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseConsumptionPlanMapper.updateByPrimaryKeySelective(caseConsumptionPlan);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseConsumptionPlan.getCaseConsumptionPlanId())) {
|
|
|
|
|
caseConsumptionPlan.setCaseId(caseId);
|
|
|
|
|
caseConsumptionPlan.setCaseConsumptionPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseConsumptionPlanMapper.insert(caseConsumptionPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseConsumptionPlanMapper.updateByPrimaryKeySelective(caseConsumptionPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财产分配表
|
|
|
|
|
CaseDistributionOfPropertyWithBLOBs caseDistributionOfProperty = new CaseDistributionOfPropertyWithBLOBs();
|
|
|
|
|
if (stuCaseDto.getCaseDistributionOfProperty() != null) {
|
|
|
|
|
caseDistributionOfProperty = stuCaseDto.getCaseDistributionOfProperty();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseDistributionOfProperty.getCaseid())) {
|
|
|
|
|
caseDistributionOfProperty.setCaseid(caseId);
|
|
|
|
|
caseDistributionOfProperty.setCaseDistributionOfPropertyId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyMapper.insert(caseDistributionOfProperty);
|
|
|
|
|
} else {
|
|
|
|
|
caseDistributionOfPropertyMapper.updateByPrimaryKeySelective(caseDistributionOfProperty);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseDistributionOfProperty.getCaseDistributionOfPropertyId())) {
|
|
|
|
|
caseDistributionOfProperty.setCaseid(caseId);
|
|
|
|
|
caseDistributionOfProperty.setCaseDistributionOfPropertyId(IdUtil.randomUUID());
|
|
|
|
|
caseDistributionOfPropertyMapper.insert(caseDistributionOfProperty);
|
|
|
|
|
} else {
|
|
|
|
|
caseDistributionOfPropertyMapper.updateByPrimaryKeySelective(caseDistributionOfProperty);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//财务分析-资产负债表
|
|
|
|
|
CaseFinanceLiability caseFinanceLiability = new CaseFinanceLiability();
|
|
|
|
|
if (stuCaseDto.getCaseFinanceLiability() != null) {
|
|
|
|
|
caseFinanceLiability = stuCaseDto.getCaseFinanceLiability();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseFinanceLiability.getCaseId())) {
|
|
|
|
|
caseFinanceLiability.setCaseId(caseId);
|
|
|
|
|
caseFinanceLiability.setCaseFinanceLiabilityId(IdUtil.randomUUID());
|
|
|
|
|
caseFinanceLiabilityMapper.insert(caseFinanceLiability);
|
|
|
|
|
} else {
|
|
|
|
|
caseFinanceLiabilityMapper.updateByPrimaryKeySelective(caseFinanceLiability);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseFinanceLiability.getCaseFinanceLiabilityId())) {
|
|
|
|
|
caseFinanceLiability.setCaseId(caseId);
|
|
|
|
|
caseFinanceLiability.setCaseFinanceLiabilityId(IdUtil.randomUUID());
|
|
|
|
|
caseFinanceLiabilityMapper.insert(caseFinanceLiability);
|
|
|
|
|
} else {
|
|
|
|
|
caseFinanceLiabilityMapper.updateByPrimaryKeySelective(caseFinanceLiability);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财务分析财务比率分析表
|
|
|
|
|
CaseFinancialRatiosWithBLOBs caseFinancialRatios = new CaseFinancialRatiosWithBLOBs();
|
|
|
|
|
if (stuCaseDto.getCaseFinancialRatios() != null) {
|
|
|
|
|
caseFinancialRatios = stuCaseDto.getCaseFinancialRatios();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseFinancialRatios.getCaseid())) {
|
|
|
|
|
caseFinancialRatios.setCaseFinancialRatiosId(IdUtil.randomUUID());
|
|
|
|
|
caseFinancialRatios.setCaseid(caseId);
|
|
|
|
|
caseFinancialRatiosMapper.insert(caseFinancialRatios);
|
|
|
|
|
} else {
|
|
|
|
|
caseFinancialRatiosMapper.updateByPrimaryKeySelective(caseFinancialRatios);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseFinancialRatios.getCaseFinancialRatiosId())) {
|
|
|
|
|
caseFinancialRatios.setCaseFinancialRatiosId(IdUtil.randomUUID());
|
|
|
|
|
caseFinancialRatios.setCaseid(caseId);
|
|
|
|
|
caseFinancialRatiosMapper.insert(caseFinancialRatios);
|
|
|
|
|
} else {
|
|
|
|
|
caseFinancialRatiosMapper.updateByPrimaryKeySelective(caseFinancialRatios);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例遗产传承表
|
|
|
|
|
CaseHeritageWithBLOBs caseHeritage = new CaseHeritageWithBLOBs();
|
|
|
|
|
if (stuCaseDto.getCaseHeritage() != null) {
|
|
|
|
|
caseHeritage = stuCaseDto.getCaseHeritage();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseHeritage.getCaseid())) {
|
|
|
|
|
caseHeritage.setCaseHeritageId(IdUtil.randomUUID());
|
|
|
|
|
caseHeritage.setCaseid(caseId);
|
|
|
|
|
caseHeritageMapper.insert(caseHeritage);
|
|
|
|
|
} else {
|
|
|
|
|
caseHeritageMapper.updateByPrimaryKeySelective(caseHeritage);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseHeritage.getCaseHeritageId())) {
|
|
|
|
|
caseHeritage.setCaseHeritageId(IdUtil.randomUUID());
|
|
|
|
|
caseHeritage.setCaseid(caseId);
|
|
|
|
|
caseHeritageMapper.insert(caseHeritage);
|
|
|
|
|
} else {
|
|
|
|
|
caseHeritageMapper.updateByPrimaryKeySelective(caseHeritage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例财务分析收支储蓄表
|
|
|
|
|
CaseIncomeAndExpenses caseIncomeAndExpenses = new CaseIncomeAndExpenses();
|
|
|
|
|
if (stuCaseDto.getCaseIncomeAndExpenses() != null) {
|
|
|
|
|
caseIncomeAndExpenses = stuCaseDto.getCaseIncomeAndExpenses();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseIncomeAndExpenses.getCaseid())) {
|
|
|
|
|
caseIncomeAndExpenses.setCaseIncomeAndExpensesId(IdUtil.randomUUID());
|
|
|
|
|
caseIncomeAndExpenses.setCaseid(caseId);
|
|
|
|
|
caseIncomeAndExpensesMapper.insert(caseIncomeAndExpenses);
|
|
|
|
|
} else {
|
|
|
|
|
caseIncomeAndExpensesMapper.updateByPrimaryKeySelective(caseIncomeAndExpenses);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseIncomeAndExpenses.getCaseIncomeAndExpensesId())) {
|
|
|
|
|
caseIncomeAndExpenses.setCaseIncomeAndExpensesId(IdUtil.randomUUID());
|
|
|
|
|
caseIncomeAndExpenses.setCaseid(caseId);
|
|
|
|
|
caseIncomeAndExpensesMapper.insert(caseIncomeAndExpenses);
|
|
|
|
|
} else {
|
|
|
|
|
caseIncomeAndExpensesMapper.updateByPrimaryKeySelective(caseIncomeAndExpenses);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//投资规划案例表
|
|
|
|
|
CaseInvestmentPlan caseInvestmentPlan = new CaseInvestmentPlan();
|
|
|
|
|
if (stuCaseDto.getCaseInvestmentPlan() != null) {
|
|
|
|
|
caseInvestmentPlan = stuCaseDto.getCaseInvestmentPlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseInvestmentPlan.getCaseId())) {
|
|
|
|
|
caseInvestmentPlan.setCaseInvestmentPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseInvestmentPlan.setCaseId(caseId);
|
|
|
|
|
investmentPlanMapper.insert(caseInvestmentPlan);
|
|
|
|
|
} else {
|
|
|
|
|
investmentPlanMapper.updateByPrimaryKeySelective(caseInvestmentPlan);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseInvestmentPlan.getCaseInvestmentPlanId())) {
|
|
|
|
|
caseInvestmentPlan.setCaseInvestmentPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseInvestmentPlan.setCaseId(caseId);
|
|
|
|
|
investmentPlanMapper.insert(caseInvestmentPlan);
|
|
|
|
|
} else {
|
|
|
|
|
investmentPlanMapper.updateByPrimaryKeySelective(caseInvestmentPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划保险规划表
|
|
|
|
|
CaseInsurancePlan caseInsurancePlan = new CaseInsurancePlan();
|
|
|
|
|
if (stuCaseDto.getCaseInsurancePlan() != null) {
|
|
|
|
|
caseInsurancePlan = stuCaseDto.getCaseInsurancePlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseInsurancePlan.getCaseid())) {
|
|
|
|
|
caseInsurancePlan.setCaseInsurancePlanId(IdUtil.randomUUID());
|
|
|
|
|
caseInsurancePlan.setCaseid(caseId);
|
|
|
|
|
caseInsurancePlanMapper.insert(caseInsurancePlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseInsurancePlanMapper.updateByPrimaryKeySelective(caseInsurancePlan);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseInsurancePlan.getCaseInsurancePlanId())) {
|
|
|
|
|
caseInsurancePlan.setCaseInsurancePlanId(IdUtil.randomUUID());
|
|
|
|
|
caseInsurancePlan.setCaseid(caseId);
|
|
|
|
|
caseInsurancePlanMapper.insert(caseInsurancePlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseInsurancePlanMapper.updateByPrimaryKeySelective(caseInsurancePlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划教育规划表
|
|
|
|
|
CaseLifeEducationPlan caseLifeEducationPlan = new CaseLifeEducationPlan();
|
|
|
|
|
if (stuCaseDto.getCaseLifeEducationPlan() != null) {
|
|
|
|
|
caseLifeEducationPlan = stuCaseDto.getCaseLifeEducationPlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseLifeEducationPlan.getCaseid())) {
|
|
|
|
|
caseLifeEducationPlan.setCaseLifeEducationPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseLifeEducationPlan.setCaseid(caseId);
|
|
|
|
|
caseLifeEducationPlanMapper.insert(caseLifeEducationPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseLifeEducationPlanMapper.updateByPrimaryKeySelective(caseLifeEducationPlan);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseLifeEducationPlan.getCaseLifeEducationPlanId())) {
|
|
|
|
|
caseLifeEducationPlan.setCaseLifeEducationPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseLifeEducationPlan.setCaseid(caseId);
|
|
|
|
|
caseLifeEducationPlanMapper.insert(caseLifeEducationPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseLifeEducationPlanMapper.updateByPrimaryKeySelective(caseLifeEducationPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划退休规划表
|
|
|
|
|
CaseRetirementPlan caseRetirementPlan = new CaseRetirementPlan();
|
|
|
|
|
if (stuCaseDto.getCaseRetirementPlan() != null) {
|
|
|
|
|
caseRetirementPlan = stuCaseDto.getCaseRetirementPlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseRetirementPlan.getCaseid())) {
|
|
|
|
|
caseRetirementPlan.setCaseRetirementPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseRetirementPlan.setCaseid(caseId);
|
|
|
|
|
caseRetirementPlanMapper.insert(caseRetirementPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseRetirementPlanMapper.updateByPrimaryKeySelective(caseRetirementPlan);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseRetirementPlan.getCaseRetirementPlanId())) {
|
|
|
|
|
caseRetirementPlan.setCaseRetirementPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseRetirementPlan.setCaseid(caseId);
|
|
|
|
|
caseRetirementPlanMapper.insert(caseRetirementPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseRetirementPlanMapper.updateByPrimaryKeySelective(caseRetirementPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//风险测评-风险指标表
|
|
|
|
|
CaseRiskIndex caseRiskIndex = new CaseRiskIndex();
|
|
|
|
|
if (stuCaseDto.getCaseRiskIndex() != null) {
|
|
|
|
|
caseRiskIndex = stuCaseDto.getCaseRiskIndex();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseRiskIndex.getCaseid())) {
|
|
|
|
|
caseRiskIndex.setCaseRiskIndexId(IdUtil.randomUUID());
|
|
|
|
|
caseRiskIndex.setUpdateDate(new Date());
|
|
|
|
|
caseRiskIndex.setCaseid(caseId);
|
|
|
|
|
caseRiskIndexMapper.insert(caseRiskIndex);
|
|
|
|
|
} else {
|
|
|
|
|
caseRiskIndexMapper.updateByPrimaryKeySelective(caseRiskIndex);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseRiskIndex.getCaseRiskIndexId())) {
|
|
|
|
|
caseRiskIndex.setCaseRiskIndexId(IdUtil.randomUUID());
|
|
|
|
|
caseRiskIndex.setUpdateDate(new Date());
|
|
|
|
|
caseRiskIndex.setCaseid(caseId);
|
|
|
|
|
caseRiskIndexMapper.insert(caseRiskIndex);
|
|
|
|
|
} else {
|
|
|
|
|
caseRiskIndexMapper.updateByPrimaryKeySelective(caseRiskIndex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例生涯规划创业规划表
|
|
|
|
|
CaseStartAnUndertakingPlan caseStartAnUndertakingPlan = new CaseStartAnUndertakingPlan();
|
|
|
|
|
if (stuCaseDto.getCaseStartAnUndertakingPlan() != null) {
|
|
|
|
|
caseStartAnUndertakingPlan = stuCaseDto.getCaseStartAnUndertakingPlan();
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseStartAnUndertakingPlan.getCaseid())) {
|
|
|
|
|
caseStartAnUndertakingPlan.setCaseStartAnUndertakingPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseStartAnUndertakingPlan.setCaseid(caseId);
|
|
|
|
|
caseStartAnUndertakingPlanMapper.insert(caseStartAnUndertakingPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseStartAnUndertakingPlanMapper.updateByPrimaryKeySelective(caseStartAnUndertakingPlan);
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseStartAnUndertakingPlan.getCaseStartAnUndertakingPlanId())) {
|
|
|
|
|
caseStartAnUndertakingPlan.setCaseStartAnUndertakingPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseStartAnUndertakingPlan.setCaseid(caseId);
|
|
|
|
|
caseStartAnUndertakingPlanMapper.insert(caseStartAnUndertakingPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseStartAnUndertakingPlanMapper.updateByPrimaryKeySelective(caseStartAnUndertakingPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//案例税务筹划表
|
|
|
|
|
CaseTaxPlan caseTaxPlan = new CaseTaxPlan();
|
|
|
|
|
if (stuCaseDto.getCaseTaxPlan() != null) {
|
|
|
|
|
caseTaxPlan = stuCaseDto.getCaseTaxPlan();
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseTaxPlan.getCaseTaxPlanId())) {
|
|
|
|
|
caseTaxPlan.setCaseTaxPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseTaxPlan.setCaseid(caseId);
|
|
|
|
|
caseTaxPlanMapper.insert(caseTaxPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseTaxPlanMapper.updateByPrimaryKeySelective(caseTaxPlan);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//ID为空新增,不为空编辑
|
|
|
|
|
if (StringUtils.isBlank(caseTaxPlan.getCaseid())) {
|
|
|
|
|
caseTaxPlan.setCaseTaxPlanId(IdUtil.randomUUID());
|
|
|
|
|
caseTaxPlan.setCaseid(caseId);
|
|
|
|
|
caseTaxPlanMapper.insert(caseTaxPlan);
|
|
|
|
|
} else {
|
|
|
|
|
caseTaxPlanMapper.updateByPrimaryKeySelective(caseTaxPlan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -525,8 +529,61 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
example.createCriteria().andIdCardEqualTo(newCase.getIdCard());
|
|
|
|
|
List<CaseInfo> list = caseInfoMapper.selectByExampleWithBLOBs(example);
|
|
|
|
|
|
|
|
|
|
//判断身份证号是否存在,不存在才新增 客户信息 和综合规划客户表
|
|
|
|
|
if (list == null || list.isEmpty()) {
|
|
|
|
|
// //判断身份证号是否存在,不存在才新增 客户信息 和综合规划客户表
|
|
|
|
|
// if (list == null || list.isEmpty()) {
|
|
|
|
|
// //前端没传主键ID为新增
|
|
|
|
|
// newCase.setCaseid(IdUtil.randomUUID());
|
|
|
|
|
// newCase.setAddTime(new Date());
|
|
|
|
|
// caseInfoMapper.insert(newCase);
|
|
|
|
|
// //综合规划需要额外新增一张表
|
|
|
|
|
// if (newCase.getModel().equals("综合规划")) {
|
|
|
|
|
// ComCase comCase = new ComCase();
|
|
|
|
|
// comCase.setCaseid(newCase.getCaseid());
|
|
|
|
|
// comCase.setComCaseId(IdUtil.randomUUID());
|
|
|
|
|
// comCase.setManageMoneyMattersType(newCase.getManageMoneyMattersType());
|
|
|
|
|
// comCaseMapper.insert(comCase);
|
|
|
|
|
// }
|
|
|
|
|
// insertSynthesisPlanClient(newCase);
|
|
|
|
|
// return newCase.getCaseid();
|
|
|
|
|
// } else {
|
|
|
|
|
// //修改案例信息表
|
|
|
|
|
//
|
|
|
|
|
// //传了相同的身份证,系统判定是编辑,但是没传CaseId,直接return
|
|
|
|
|
// if (StringUtils.isBlank(newCase.getCaseid())) {
|
|
|
|
|
// return "false";
|
|
|
|
|
// }
|
|
|
|
|
// 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());
|
|
|
|
|
// synthesisPlanClient.setIdcard(newCase.getIdCard());
|
|
|
|
|
// synthesisPlanClient.setManageMoneyMattersType(newCase.getManageMoneyMattersType());
|
|
|
|
|
// synthesisPlanClient.setAge(newCase.getAge());
|
|
|
|
|
// synthesisPlanClientMapper.updateByPrimaryKeySelective(synthesisPlanClient);
|
|
|
|
|
// return newCase.getCaseid();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return null;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增
|
|
|
|
|
if (StringUtils.isBlank(newCase.getCaseid())) {
|
|
|
|
|
if (list != null && !list.isEmpty()) { //身份证号码不允许重复
|
|
|
|
|
return "false";
|
|
|
|
|
}
|
|
|
|
|
//前端没传主键ID为新增
|
|
|
|
|
newCase.setCaseid(IdUtil.randomUUID());
|
|
|
|
|
newCase.setAddTime(new Date());
|
|
|
|
|
caseInfoMapper.insert(newCase);
|
|
|
|
@ -542,11 +599,18 @@ public class CaseServiceImpl implements CaseService {
|
|
|
|
|
return newCase.getCaseid();
|
|
|
|
|
} else {
|
|
|
|
|
//修改案例信息表
|
|
|
|
|
CaseInfo caseInfo = caseInfoMapper.selectByPrimaryKey(newCase.getCaseid());
|
|
|
|
|
String idCard = caseInfo.getIdCard(); //老的身份证号码
|
|
|
|
|
|
|
|
|
|
//传了相同的身份证,系统判定是编辑,但是没传CaseId,直接return
|
|
|
|
|
if (StringUtils.isBlank(newCase.getCaseid())) {
|
|
|
|
|
return "false";
|
|
|
|
|
if (!idCard.equals(newCase.getIdCard())) { //身份证号码改变了,需要判断新的是否存在
|
|
|
|
|
if (list != null && !list.isEmpty()) { //身份证号码不允许重复
|
|
|
|
|
return "false";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// //传了相同的身份证,系统判定是编辑,但是没传CaseId,直接return
|
|
|
|
|
// if (StringUtils.isBlank(newCase.getCaseid())) {
|
|
|
|
|
// return "false";
|
|
|
|
|
// }
|
|
|
|
|
caseInfoMapper.updateByPrimaryKeySelective(newCase);
|
|
|
|
|
|
|
|
|
|
//修改实训类型
|
|
|
|
|