|
|
@ -8,7 +8,6 @@ import com.yxt.anrui.base.api.basevehiclemodel.BaseVehicleModelFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehmodelconfig.AppModelVeDetailVo; |
|
|
|
import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelConfigFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.OrderSolutionVo; |
|
|
|
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp; |
|
|
|
import com.yxt.anrui.crm.api.crmfindemand.CrmFindemand; |
|
|
|
import com.yxt.anrui.crm.api.crmfindemand.CrmFindemandDto; |
|
|
@ -415,7 +414,7 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
} |
|
|
|
entity.setTypeKey("1"); |
|
|
|
entity.setType("资方常规"); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
boolean isShowMore = finNormal.isShowMore(); |
|
|
|
if (isShowMore) { |
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
@ -622,57 +621,11 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
BeanUtil.copyProperties(dto, crmVehicledemand, "sid"); |
|
|
|
crmVehicledemand.setCustomerSid(crmCustomerTemp.getSid()); |
|
|
|
crmVehicledemand.setStates("1"); |
|
|
|
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); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} |
|
|
|
} |
|
|
|
ResultBean<CrmVehicledemand> resultBean = getCrmDemand(dto, crmVehicledemand); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} else { |
|
|
|
//新增客户的金融方案
|
|
|
|
if(StringUtils.isNotBlank(dto.getTypeKey())){ |
|
|
|
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); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
} |
|
|
|
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("自营非担保");//自营非担保
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
crmVehicledemand = resultBean.getData(); |
|
|
|
} |
|
|
|
baseMapper.insert(crmVehicledemand); |
|
|
|
|
|
|
@ -683,71 +636,81 @@ public class CrmVehicledemandService extends MybatisBaseService<CrmVehicledemand |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, crmVehicledemand, "sid"); |
|
|
|
crmVehicledemand.setCustomerSid(crmCustomerTemp.getSid()); |
|
|
|
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); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
ResultBean<CrmVehicledemand> resultBean = getCrmDemand(dto, crmVehicledemand); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} else { |
|
|
|
crmVehicledemand = resultBean.getData(); |
|
|
|
} |
|
|
|
baseMapper.updateById(crmVehicledemand); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<CrmVehicledemand> getCrmDemand(CrmVehicledemandsDto dto, CrmVehicledemand crmVehicledemand) { |
|
|
|
ResultBean<CrmVehicledemand> rb = ResultBean.fireFail(); |
|
|
|
//如果是全款且自有资金的,需要删除金融方案
|
|
|
|
String purchaseMethod = dto.getPurchaseMethod(); |
|
|
|
if ("1".equals(purchaseMethod)) {//全款
|
|
|
|
if ("1".equals(dto.getFinancePlan())) {//自有资金
|
|
|
|
crmVehicledemand.setType(null); |
|
|
|
crmVehicledemand.setTypeKey(null); |
|
|
|
loanSolutionsFeign.deleteByOrderSid(crmVehicledemand.getSid()); |
|
|
|
} else {//三方金融
|
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
|
CrmSolutions solutions = dto.getCrmSolutions(); |
|
|
|
if (solutions != null) { |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(solutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(crmVehicledemand.getSid()); |
|
|
|
if ("2".equals(dto.getFinancePlan())) { |
|
|
|
solutionsDto.setShowMore(false); |
|
|
|
} |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
crmVehicledemand.setType(null); |
|
|
|
crmVehicledemand.setTypeKey(null); |
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} |
|
|
|
} else {//贷款
|
|
|
|
//新增客户的金融方案
|
|
|
|
if(StringUtils.isNotBlank(dto.getTypeKey())){ |
|
|
|
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); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
|
} |
|
|
|
|
|
|
|
} else {//贷款
|
|
|
|
if (StringUtils.isNotBlank(dto.getTypeKey())) { |
|
|
|
if ("1".equals(dto.getTypeKey())) {//资方常规
|
|
|
|
CrmSolutions crmSolutions = dto.getCrmSolutions(); |
|
|
|
if (crmSolutions != null) { |
|
|
|
SolutionssDto solutionsDto = new SolutionssDto(); |
|
|
|
BeanUtil.copyProperties(crmSolutions, solutionsDto, "sid"); |
|
|
|
solutionsDto.setSaleOrderSid(crmVehicledemand.getSid()); |
|
|
|
solutionsDto.setShowMore(true); |
|
|
|
ResultBean resultBean = loanSolutionsFeign.save2(solutionsDto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
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("自营非担保");//自营非担保
|
|
|
|
} |
|
|
|
crmVehicledemand.setTypeKey("1"); |
|
|
|
crmVehicledemand.setType("资方常规"); |
|
|
|
} else {//定制金融
|
|
|
|
} |
|
|
|
SolutionsDetailsVo loanSolutions = loanSolutionsFeign.selectDetailss(crmVehicledemand.getSid()).getData(); |
|
|
|
if (loanSolutions != null) { |
|
|
|
if (StringUtils.isBlank(loanSolutions.getTypeKey())) { |
|
|
|
crmVehicledemand.setFinancePlan("4");//担保
|
|
|
|
crmVehicledemand.setFinancePlanValue("担保");//担保
|
|
|
|
} else { |
|
|
|
crmVehicledemand.setFinancePlan("3");//自营非担保
|
|
|
|
crmVehicledemand.setFinancePlanValue("自营非担保");//自营非担保
|
|
|
|
} |
|
|
|
}else{ |
|
|
|
loanSolutionsFeign.deleteByOrderSid(sid); |
|
|
|
crmVehicledemand.setTypeKey(null); |
|
|
|
crmVehicledemand.setType(null); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
loanSolutionsFeign.deleteByOrderSid(crmVehicledemand.getSid()); |
|
|
|
crmVehicledemand.setTypeKey(null); |
|
|
|
crmVehicledemand.setType(null); |
|
|
|
} |
|
|
|
baseMapper.updateById(crmVehicledemand); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
return rb.success().setData(crmVehicledemand); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<CrmVehicledemandsVo> details(String sid) { |
|
|
|