Browse Source

结清申请部分代码

master
dimengzhe 1 year ago
parent
commit
d429d26dac
  1. 2
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansettleapply/LoanSettleApply.java
  2. 7
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansettleapply/LoanSettleApplyDetailsVo.java
  3. 120
      anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansettleapply/SettleApplyAppVo.java
  4. 88
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansettleapply/LoanSettleApplyService.java
  5. 120
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/settleapply/SettleApplyAppVos.java
  6. 8
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/risk/settleapply/SettleApplyService.java

2
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansettleapply/LoanSettleApply.java

@ -76,5 +76,7 @@ public class LoanSettleApply extends BaseEntity {
private String typeStateValue;
@ApiModelProperty("预计结清日期")
private String settingDateBe;
@ApiModelProperty("业务sid")
private String busSid;
}

7
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansettleapply/LoanSettleApplyDetailsVo.java

@ -76,4 +76,11 @@ public class LoanSettleApplyDetailsVo {
@ApiModelProperty("预计结清日期")
private String settingDateBe;
@ApiModelProperty(value = "任务id")
private String taskId;
@ApiModelProperty(value = "流程实例id")
private String procInstId;
private String busSid;
}

120
anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loansettleapply/SettleApplyAppVo.java

@ -1,7 +1,12 @@
package com.yxt.anrui.riskcenter.api.loansettleapply;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: dimengzhe
@ -9,4 +14,119 @@ import lombok.Data;
**/
@Data
public class SettleApplyAppVo {
@ApiModelProperty("申请人")
private String createByName;
@ApiModelProperty("申请部门")
private String createDept;
@ApiModelProperty("申请日期")
private String createTime;
@ApiModelProperty("车架号")
private String vinNo;
@ApiModelProperty("车牌号")
private String vehMark;
@ApiModelProperty("销售订单sid")
private String saleOrderSid;
@ApiModelProperty("客户名称")
private String customerName;
@ApiModelProperty("贷款人")
private String loanName;
@ApiModelProperty("贷款合同编号")
private String loanContractNo;
@ApiModelProperty("资方")
private String bankName;
@ApiModelProperty("资方合同编号")
private String bankContractNo;
@ApiModelProperty("结清日期")
private String settingDate;
@ApiModelProperty("公司当前逾期月还")
private String overdueMonthPrice;
@ApiModelProperty("公司当期未到期月还")
private String currentNotDuePrice;
@ApiModelProperty("公司未到期月还")
private String notDuePrice;
@ApiModelProperty("实例id")
private String procInstId;
@ApiModelProperty("任务id")
private String taskId;
@ApiModelProperty("环节id")
private String taskDefKey;
@ApiModelProperty("是否勾选减免,true勾选,false不勾选")
private boolean trueReduction;
//资方结清费用
@ApiModelProperty("资方逾期月还")
private String price;
@ApiModelProperty("资方当期未到期月还")
private String currentNotDuePriceBank;
@ApiModelProperty("资方未到期金额")
private String notDuePriceBank;
@ApiModelProperty("资方逾期利息")
private String bankInterest;
@ApiModelProperty("资方名义价")
private String bankNominalPrice;
@ApiModelProperty("资方合同违约金")
private String bankContractLiquidated;
@ApiModelProperty("资方其他应收")
private String bankOtherReceivable;
@ApiModelProperty("其他应收说明")
private String otherReceivableRemarks;
@ApiModelProperty("资方结清金额")
private String bankSettlePrice;
@ApiModelProperty("附件")
private List<String> bankFiles = new ArrayList<>();
//公司结清费用
@ApiModelProperty("贷款保证金")
private String loanDeposit;
@ApiModelProperty("公司逾期月还")
private String overduePrice;
@ApiModelProperty("垫资方逾期利息")
private String putBankInterest;
@ApiModelProperty("资金占用费")
private String funfCost;
@ApiModelProperty("资方逾期利息")
private String bankOverInterest;
@ApiModelProperty("公司当期未到期月还")
private String companyCurrentNotPrice;
@ApiModelProperty("资方未到期金额")
private String bankNotPrice;
@ApiModelProperty("贷款保证金扣罚金额")
private String deductionAmount;
@ApiModelProperty("名义价")
private String companyNominalPrice;
@ApiModelProperty("合同违约金")
private String contractLiquidated;
@ApiModelProperty("公司其他费用")
private String companyOtherPrice;
@ApiModelProperty("其他费用说明")
private String otherCostRemarks;
@ApiModelProperty("公司正常结清合计")
private String settleAll;
//减免后
@ApiModelProperty("资金占用费减免")
private String fundPenalty;
@ApiModelProperty("贷款保证金扣罚减免")
private String depositPenalty;
@ApiModelProperty("其他费用减免")
private String otherCost;
@ApiModelProperty("公司减免后结清合计")
private String amountTo;
@ApiModelProperty("结清利润")
private String profit;
@ApiModelProperty("催收记录")
private String csjlSid;
@ApiModelProperty("是否是回购过来的")
private boolean trueHg;
@ApiModelProperty("预计结清日期")
private String settingDateBe;
@ApiModelProperty("截止当前资金占用费")
private String fundAll;
}

88
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loansettleapply/LoanSettleApplyService.java

@ -57,6 +57,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
@ -395,8 +396,8 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
Date d2 = format.parse(DateUtil.today());//毫秒ms
long diff = d2.getTime() - d1.getTime();
long diffDays = diff / (24 * 60 * 60 * 1000);
int i = new Long(diffDays).intValue();
String dks = new BigDecimal(dk).multiply(new BigDecimal(0.0007)).multiply(new BigDecimal(i)).toString();
int i = new Long(diffDays).intValue() + 1;
String dks = new BigDecimal(dk).multiply(new BigDecimal("0.0007")).multiply(new BigDecimal(i)).setScale(2, RoundingMode.HALF_UP).toString();
funfCost = new BigDecimal(funfCost).add(new BigDecimal(dks)).toString();
} catch (ParseException e) {
e.printStackTrace();
@ -500,7 +501,21 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
bv.setOrgSidPath(loanSettleApply.getOrgSidPath());
bv.setBusinessSid(businessSid);
bv.setUserSid(dto.getUserSid());
if (StringUtils.isNotBlank(loanSettleApply.getBusSid())) {
variables.put("orderNames", "提前结清申请");
}
bv.setFormVariables(variables);
List<String> orgPathList = Arrays.asList(dto.getOrgPath().split("/"));
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(orgPathList.get(orgPathList.size() - 1)).getData();
if (sysOrganization == null) {
return rb.setMsg("当前所在的组织机构不存在");
}
if (StringUtils.isBlank(sysOrganization.getManagerSid())) {
// return rb.setMsg("当前所在的组织机构未设置主管人员");
sysOrganization.setManagerSid(ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId());
}
String nextNodeUserSids_ = sysOrganization.getManagerSid();
bv.setNextNodeUserSids(nextNodeUserSids_);
if (r == 1) {
//ToDo:流程定义id
bv.setModelId(ProcDefEnum.LOANSETTLEAPPLY.getProDefId());
@ -581,6 +596,9 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
Map<String, Object> appMap = new HashMap<>();
appMap.put("sid", businessSid);
variables.put("app", appMap);
if (StringUtils.isNotBlank(loanSettleApply.getBusSid())) {
variables.put("orderNames", "提前结清申请");
}
bv.setFormVariables(variables);
bv.setOrgSidPath(loanSettleApply.getOrgSidPath());
bv.setModelId(loanSettleApply.getProcDefId());
@ -669,6 +687,9 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
Map<String, Object> variables = new HashMap<>();
Map<String, Object> appMap = new HashMap<>();
appMap.put("sid", businessSid);
if (StringUtils.isNotBlank(loanSettleApply.getBusSid())) {
variables.put("orderNames", "提前结清申请");
}
variables.put("app", appMap);
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo);
if (!resultBean.getSuccess()) {
@ -780,11 +801,72 @@ public class LoanSettleApplyService extends MybatisBaseService<LoanSettleApplyMa
public ResultBean<SettleApplyAppVo> getAppDetails(String sid) {
ResultBean<SettleApplyAppVo> rb = ResultBean.fireFail();
SettleApplyAppVo settleApplyAppVo = new SettleApplyAppVo();
LoanSettleApply loanSettleApply = fetchBySid(sid);
if (loanSettleApply == null) {
return rb.setMsg("该申请不存在");
}
return null;
BeanUtil.copyProperties(loanSettleApply, settleApplyAppVo);
settleApplyAppVo.setCreateTime(DateUtil.format(loanSettleApply.getCreateTime(), "yyyy-MM-dd"));
LoanSettleBankCost loanSettleBankCost = loanSettleBankCostService.selectByMainSid(sid);
if (loanSettleBankCost != null) {
settleApplyAppVo.setPrice(loanSettleBankCost.getPrice().toString());
settleApplyAppVo.setCurrentNotDuePriceBank(loanSettleBankCost.getCurrentNotDuePrice().toString());
settleApplyAppVo.setNotDuePriceBank(loanSettleBankCost.getNotDuePrice().toString());
settleApplyAppVo.setBankInterest(loanSettleBankCost.getBankInterest().toString());
settleApplyAppVo.setBankNominalPrice(loanSettleBankCost.getBankNominalPrice().toString());
settleApplyAppVo.setBankContractLiquidated(loanSettleBankCost.getBankContractLiquidated().toString());
settleApplyAppVo.setBankOtherReceivable(loanSettleBankCost.getBankOtherReceivable().toString());
settleApplyAppVo.setOtherReceivableRemarks(loanSettleBankCost.getOtherReceivableRemarks());
settleApplyAppVo.setBankSettlePrice(loanSettleBankCost.getBankSettlePrice().toString());
if (StringUtils.isNotBlank(loanSettleBankCost.getFiles())) {
List<String> fileList = Arrays.asList(loanSettleBankCost.getFiles().split(",")).stream().map(c -> fileUploadComponent.getUrlPrefix() + c).collect(Collectors.toList());
fileList.removeAll(Collections.singleton(null));
if (!fileList.isEmpty()) {
settleApplyAppVo.setBankFiles(fileList);
}
}
}
LoanSettleCompanyCost loanSettleCompanyCost = loanSettleCompanyCostService.selectByMainSid(sid);
if (loanSettleCompanyCost != null) {
settleApplyAppVo.setLoanDeposit(loanSettleCompanyCost.getLoanDeposit().toString());
settleApplyAppVo.setOverduePrice(loanSettleCompanyCost.getOverduePrice().toString());
settleApplyAppVo.setPutBankInterest(loanSettleCompanyCost.getPutBankInterest().toString());
settleApplyAppVo.setFunfCost(loanSettleCompanyCost.getFunfCost().toString());
settleApplyAppVo.setBankOverInterest(loanSettleCompanyCost.getBankOverInterest().toString());
settleApplyAppVo.setCompanyCurrentNotPrice(loanSettleCompanyCost.getCompanyCurrentNotPrice().toString());
settleApplyAppVo.setBankNotPrice(loanSettleCompanyCost.getBankNotPrice().toString());
settleApplyAppVo.setDeductionAmount(loanSettleCompanyCost.getDeductionAmount().toString());
settleApplyAppVo.setCompanyNominalPrice(loanSettleCompanyCost.getCompanyNominalPrice().toString());
settleApplyAppVo.setContractLiquidated(loanSettleCompanyCost.getContractLiquidated().toString());
settleApplyAppVo.setCompanyOtherPrice(loanSettleCompanyCost.getCompanyOtherPrice().toString());
settleApplyAppVo.setOtherCostRemarks(loanSettleCompanyCost.getOtherCostRemarks());
settleApplyAppVo.setSettleAll(loanSettleCompanyCost.getSettleAll().toString());
settleApplyAppVo.setFundAll(loanSettleCompanyCost.getFundAll().toString());
}
LoanSettleCompanyReduction loanSettleCompanyReduction = loanSettleCompanyReductionService.selectByMainSid(sid);
if (loanSettleCompanyReduction != null) {
if (loanSettleApply.getTrueReduction() == 0) {//未勾选
settleApplyAppVo.setProfit(loanSettleCompanyReduction.getProfit().toString());
settleApplyAppVo.setTrueReduction(false);
} else {
settleApplyAppVo.setFundPenalty(loanSettleCompanyReduction.getFundPenalty().toString());
settleApplyAppVo.setDepositPenalty(loanSettleCompanyReduction.getDepositPenalty().toString());
settleApplyAppVo.setOtherCost(loanSettleCompanyReduction.getOtherCost().toString());
settleApplyAppVo.setAmountTo(loanSettleCompanyReduction.getAmountTo().toString());
settleApplyAppVo.setProfit(loanSettleCompanyReduction.getProfit().toString());
settleApplyAppVo.setTrueReduction(true);
}
}
settleApplyAppVo.setSaleOrderSid(loanSettleApply.getSaleOrderSid());
settleApplyAppVo.setCsjlSid(loanSettleApply.getBusVinSid());
if (StringUtils.isNotBlank(loanSettleApply.getBusSid())) {
settleApplyAppVo.setTrueHg(true);
} else {
settleApplyAppVo.setTrueHg(false);
}
return rb.success().setData(settleApplyAppVo);
}

120
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/risk/settleapply/SettleApplyAppVos.java

@ -1,7 +1,12 @@
package com.yxt.anrui.terminal.api.risk.settleapply;
import com.yxt.anrui.terminal.api.base.common.CarModelVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* @description:
* @author: dimengzhe
@ -9,4 +14,119 @@ import lombok.Data;
**/
@Data
public class SettleApplyAppVos {
private String publishInfo; // 发起部门-发起人
private CarModelVo jrfa;//金融方案
@ApiModelProperty("申请人")
private String createByName;
@ApiModelProperty("申请部门")
private String createDept;
@ApiModelProperty("申请日期")
private String createTime;
@ApiModelProperty("车架号")
private String vinNo;
@ApiModelProperty("车牌号")
private String vehMark;
@ApiModelProperty("销售订单sid")
private String saleOrderSid;
@ApiModelProperty("客户名称")
private String customerName;
@ApiModelProperty("贷款人")
private String loanName;
@ApiModelProperty("贷款合同编号")
private String loanContractNo;
@ApiModelProperty("资方")
private String bankName;
@ApiModelProperty("资方合同编号")
private String bankContractNo;
@ApiModelProperty("结清日期")
private String settingDate;
@ApiModelProperty("公司当前逾期月还")
private String overdueMonthPrice;
@ApiModelProperty("公司当期未到期月还")
private String currentNotDuePrice;
@ApiModelProperty("公司未到期月还")
private String notDuePrice;
@ApiModelProperty("实例id")
private String procInstId;
@ApiModelProperty("任务id")
private String taskId;
@ApiModelProperty("环节id")
private String taskDefKey;
@ApiModelProperty("是否勾选减免,true勾选,false不勾选")
private boolean trueReduction;
//资方结清费用
@ApiModelProperty("资方逾期月还")
private String price;
@ApiModelProperty("资方当期未到期月还")
private String currentNotDuePriceBank;
@ApiModelProperty("资方未到期金额")
private String notDuePriceBank;
@ApiModelProperty("资方逾期利息")
private String bankInterest;
@ApiModelProperty("资方名义价")
private String bankNominalPrice;
@ApiModelProperty("资方合同违约金")
private String bankContractLiquidated;
@ApiModelProperty("资方其他应收")
private String bankOtherReceivable;
@ApiModelProperty("其他应收说明")
private String otherReceivableRemarks;
@ApiModelProperty("资方结清金额")
private String bankSettlePrice;
@ApiModelProperty("附件")
private List<String> bankFiles = new ArrayList<>();
//公司结清费用
@ApiModelProperty("贷款保证金")
private String loanDeposit;
@ApiModelProperty("公司逾期月还")
private String overduePrice;
@ApiModelProperty("垫资方逾期利息")
private String putBankInterest;
@ApiModelProperty("资金占用费")
private String funfCost;
@ApiModelProperty("资方逾期利息")
private String bankOverInterest;
@ApiModelProperty("公司当期未到期月还")
private String companyCurrentNotPrice;
@ApiModelProperty("资方未到期金额")
private String bankNotPrice;
@ApiModelProperty("贷款保证金扣罚金额")
private String deductionAmount;
@ApiModelProperty("名义价")
private String companyNominalPrice;
@ApiModelProperty("合同违约金")
private String contractLiquidated;
@ApiModelProperty("公司其他费用")
private String companyOtherPrice;
@ApiModelProperty("其他费用说明")
private String otherCostRemarks;
@ApiModelProperty("公司正常结清合计")
private String settleAll;
//减免后
@ApiModelProperty("资金占用费减免")
private String fundPenalty;
@ApiModelProperty("贷款保证金扣罚减免")
private String depositPenalty;
@ApiModelProperty("其他费用减免")
private String otherCost;
@ApiModelProperty("公司减免后结清合计")
private String amountTo;
@ApiModelProperty("结清利润")
private String profit;
@ApiModelProperty("催收记录")
private String csjlSid;
@ApiModelProperty("是否是回购过来的")
private boolean trueHg;
@ApiModelProperty("预计结清日期")
private String settingDateBe;
@ApiModelProperty("截止当前资金占用费")
private String fundAll;
}

8
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/risk/settleapply/SettleApplyService.java

@ -15,6 +15,7 @@ import com.yxt.anrui.terminal.api.risk.settleapply.flowable.SettleApplyDelegateQ
import com.yxt.anrui.terminal.api.risk.settleapply.flowable.SettleApplyDto;
import com.yxt.anrui.terminal.api.risk.settleapply.flowable.SettleApplyQuery;
import com.yxt.anrui.terminal.api.risk.settleapply.flowable.SettleApplyTaskQuery;
import com.yxt.anrui.terminal.biz.base.common.CommonService;
import com.yxt.common.core.result.ResultBean;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -33,6 +34,8 @@ public class SettleApplyService {
@Autowired
private LoanSettleApplyFeign loanSettleApplyFeign;
@Autowired
private CommonService commonService;
public ResultBean agreeSettleApply(SettleApplyDto dto) {
ResultBean rb = ResultBean.fireFail();
@ -115,7 +118,10 @@ public class SettleApplyService {
}
SettleApplyAppVos settleApplyAppVos = new SettleApplyAppVos();
BeanUtil.copyProperties(resultBean.getData(), settleApplyAppVos);
settleApplyAppVos.setPublishInfo(settleApplyAppVos.getCreateDept() + "-" + settleApplyAppVos.getCreateByName());
ResultBean<CarModelVo> getLoanSolution = commonService.getLoanSolution(settleApplyAppVos.getSaleOrderSid());
CarModelVo carModelVo = getLoanSolution.getData();
settleApplyAppVos.setJrfa(carModelVo);
return rb.success().setData(settleApplyAppVos);
}

Loading…
Cancel
Save