Browse Source

优化

master
dimengzhe 1 year ago
parent
commit
d72b1a7954
  1. 26
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalescustomer/LoanSecondarySalesCustomerService.java

26
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansecondarysalescustomer/LoanSecondarySalesCustomerService.java

@ -6,16 +6,24 @@ import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp;
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign;
import com.yxt.anrui.crm.api.crmcustomertemp.CustomerSecondSalesDto;
import com.yxt.anrui.riskcenter.api.loansecondarysalesapply.LoanSecondarySalesApply;
import com.yxt.anrui.riskcenter.api.loansecondarysalescost.LoanSecondarySalesCost;
import com.yxt.anrui.riskcenter.api.loansecondarysalescustomer.LoanSecondarySalesCustomer;
import com.yxt.anrui.riskcenter.api.loansecondarysalescustomer.LoanSecondarySalesCustomerDto;
import com.yxt.anrui.riskcenter.api.loansecondarysalescustomer.SalesInitVo;
import com.yxt.anrui.riskcenter.api.loansecondarysalesveh.LoanSecondarySalesVehVo;
import com.yxt.anrui.riskcenter.biz.loansecondarysalesapply.LoanSecondarySalesApplyService;
import com.yxt.anrui.riskcenter.biz.loansecondarysalescost.LoanSecondarySalesCostMapper;
import com.yxt.anrui.riskcenter.biz.loansecondarysalescost.LoanSecondarySalesCostService;
import com.yxt.anrui.riskcenter.biz.loansecondarysalesveh.LoanSecondarySalesVehService;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.StringUtils;
import com.yxt.common.core.result.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* @description:
* @author: dimengzhe
@ -28,6 +36,10 @@ public class LoanSecondarySalesCustomerService extends MybatisBaseService<LoanSe
private CrmCustomerTempFeign crmCustomerTempFeign;
@Autowired
private LoanSecondarySalesApplyService loanSecondarySalesApplyService;
@Autowired
private LoanSecondarySalesVehService loanSecondarySalesVehService;
@Autowired
private LoanSecondarySalesCostMapper loanSecondarySalesCostMapper;
public ResultBean saveSalesCustomer(LoanSecondarySalesCustomerDto dto) {
ResultBean rb = ResultBean.fireFail();
@ -78,6 +90,20 @@ public class LoanSecondarySalesCustomerService extends MybatisBaseService<LoanSe
} else {
salesInitVo.setMainSid(sid);
}
List<LoanSecondarySalesVehVo> loanSecondarySalesVehVoList = loanSecondarySalesVehService.selectByMainSid(sid);
loanSecondarySalesVehVoList.removeAll(Collections.singleton(null));
if (!loanSecondarySalesVehVoList.isEmpty()) {
salesInitVo.setLoanSecondarySalesVehVoList(loanSecondarySalesVehVoList);
}
LoanSecondarySalesApply loanSecondarySalesApply = loanSecondarySalesApplyService.fetchBySid(sid);
if (!"已办结".equals(loanSecondarySalesApply.getNodeState())) {
return rb.setMsg("该申请未办结");
}
salesInitVo.setMainSid(sid);
salesInitVo.setCreateDept(loanSecondarySalesApply.getCreateDept());
salesInitVo.setSaleDate(loanSecondarySalesApply.getCloseDate());
LoanSecondarySalesCost loanSecondarySalesCost = loanSecondarySalesCostMapper.selectMainSid(sid);
salesInitVo.setSalePrice(loanSecondarySalesCost.getVehPrice().toString());
return rb.success().setData(salesInitVo);
}
}

Loading…
Cancel
Save