|
|
@ -362,7 +362,7 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
public ResultBean<AppCrmVehicledemandDetailsVo> initVisitDemands(String intentionSid) { |
|
|
|
ResultBean<AppCrmVehicledemandDetailsVo> rb = ResultBean.fireFail(); |
|
|
|
AppCrmVehicledemandDetailsVo appCrmVehicledemandDetailsVo = baseMapper.selectBySid(intentionSid); |
|
|
|
if(!"1".equals(appCrmVehicledemandDetailsVo.getFinancePlan())){ |
|
|
|
if (!"1".equals(appCrmVehicledemandDetailsVo.getFinancePlan())) { |
|
|
|
ResultBean<SolutionssVo> resultBean = loanSolutionsFeign.selectDetails3(intentionSid); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
AppCrmSolutions finNormal = new AppCrmSolutions(); |
|
|
@ -407,6 +407,7 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(finNormal, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
solutionsDto.setShowMore(false); |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
entity.setTypeKey("1"); |
|
|
|
entity.setType("资方常规"); |
|
|
@ -420,6 +421,7 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(finNormal, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
solutionsDto.setShowMore(true); |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
entity.setTypeKey("1"); |
|
|
|
entity.setType("资方常规"); |
|
|
@ -450,7 +452,7 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
public ResultBean<AppCrmVehicleDemandParticularsVo> intendedModel(String sid) { |
|
|
|
ResultBean<AppCrmVehicleDemandParticularsVo> rb = ResultBean.fireFail(); |
|
|
|
AppCrmVehicleDemandParticularsVo appCrmVehicleDemandParticularsVo = baseMapper.intendedModel(sid); |
|
|
|
if(!"1".equals(appCrmVehicleDemandParticularsVo.getFinancePlan())){ |
|
|
|
if (!"1".equals(appCrmVehicleDemandParticularsVo.getFinancePlan())) { |
|
|
|
ResultBean<SolutionssVo> resultBean = loanSolutionsFeign.selectDetails3(sid); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
AppCrmSolutions finNormal = new AppCrmSolutions(); |
|
|
@ -600,25 +602,48 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
BeanUtil.copyProperties(dto, crmVehicledemand, "sid"); |
|
|
|
crmVehicledemand.setCustomerSid(crmCustomerTemp.getSid()); |
|
|
|
crmVehicledemand.setStates("1"); |
|
|
|
//新增客户的金融方案
|
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
|
CrmSolutions crmSolutions = dto.getCrmSolutions(); |
|
|
|
if (crmSolutions != null) { |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(crmSolutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
if ("2".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(false); |
|
|
|
} else if ("3".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(true); |
|
|
|
} else if ("4".equals(dto.getFinancePlan())) { |
|
|
|
if ("1".equals(dto.getPurchaseMethod())) { |
|
|
|
if ("2".equals(dto.getFinancePlan())) {//三方金融
|
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
|
CrmSolutions crmSolutions = dto.getCrmSolutions(); |
|
|
|
if (crmSolutions != null) { |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(crmSolutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
if ("2".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(false); |
|
|
|
} |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
//新增客户的金融方案
|
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
|
CrmSolutions crmSolutions = dto.getCrmSolutions(); |
|
|
|
if (crmSolutions != null) { |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(crmSolutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
solutionsDto.setShowMore(true); |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} else {//定制金融
|
|
|
|
} |
|
|
|
SolutionsDetailsVo loanSolutions = loanSolutionsFeign.selectDetailss(sid).getData(); |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) { |
|
|
|
crmVehicledemand.setFinancePlan("4");//担保
|
|
|
|
crmVehicledemand.setFinancePlanValue("担保");//担保
|
|
|
|
} else { |
|
|
|
crmVehicledemand.setFinancePlan("3");//自营非担保
|
|
|
|
crmVehicledemand.setFinancePlanValue("自营非担保");//自营非担保
|
|
|
|
} |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} else {//定制金融
|
|
|
|
} |
|
|
|
baseMapper.insert(crmVehicledemand); |
|
|
|
|
|
|
@ -629,9 +654,27 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, crmVehicledemand, "sid"); |
|
|
|
crmVehicledemand.setCustomerSid(crmCustomerTemp.getSid()); |
|
|
|
if ("1".equals(dto.getFinancePlan())) { |
|
|
|
//删除金融方案
|
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
|
if ("1".equals(dto.getPurchaseMethod())) { |
|
|
|
if ("2".equals(dto.getFinancePlan())) {//三方金融
|
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
|
CrmSolutions crmSolutions = dto.getCrmSolutions(); |
|
|
|
if (crmSolutions != null) { |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(crmSolutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
if ("2".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(false); |
|
|
|
} |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
crmVehicledemand.setType(null); |
|
|
|
crmVehicledemand.setTypeKey(null); |
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//新增客户的金融方案
|
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
@ -640,18 +683,25 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(crmSolutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(sid); |
|
|
|
if ("2".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(false); |
|
|
|
} else if ("3".equals(dto.getFinancePlan()) || "4".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(true); |
|
|
|
} |
|
|
|
solutionsDto.setShowMore(true); |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
}else{ |
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
|
|
|
|
} else {//定制金融
|
|
|
|
} |
|
|
|
SolutionsDetailsVo loanSolutions = loanSolutionsFeign.selectDetailss(sid).getData(); |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) { |
|
|
|
crmVehicledemand.setFinancePlan("4");//担保
|
|
|
|
crmVehicledemand.setFinancePlanValue("担保");//担保
|
|
|
|
} else { |
|
|
|
crmVehicledemand.setFinancePlan("3");//自营非担保
|
|
|
|
crmVehicledemand.setFinancePlanValue("自营非担保");//自营非担保
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
baseMapper.updateById(crmVehicledemand); |
|
|
|
} |
|
|
|