|
|
@ -20,6 +20,7 @@ import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeig |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusVinStateSetQuery; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.bdcustomer.BdCustomer; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.stkmiscellaneous.StkMiscellaneous; |
|
|
|
import com.yxt.anrui.fin.api.kingdee.voucher.Voucher; |
|
|
|
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
|
|
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; |
|
|
@ -610,6 +611,11 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
//TOdO:
|
|
|
|
pushRiskToFin(finalLoanReturnInboundApply); |
|
|
|
}); |
|
|
|
Future future2 = pool.submit(() -> { |
|
|
|
//推送其他入库单
|
|
|
|
//TOdO:
|
|
|
|
pushStkIn(finalLoanReturnInboundApply); |
|
|
|
}); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
@ -698,17 +704,15 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
//应收贷款车欠款_到期欠款_本金
|
|
|
|
BigDecimal bjMoney = BigDecimal.ZERO; |
|
|
|
String lq = loanRepaymentPlanDetailsService.getYqLq(loanReturnInboundApply.getBusVinSid()); |
|
|
|
lqMoney = lqMoney.add(new BigDecimal(StringUtils.isBlank(lq)? "0" :lq)); |
|
|
|
lqMoney = lqMoney.add(new BigDecimal(StringUtils.isBlank(lq) ? "0" : lq)); |
|
|
|
//未到期欠款
|
|
|
|
String wdq = alrepaidAndArrVo.getUnexpiredMoney(); |
|
|
|
wdqMoney = wdqMoney.add(new BigDecimal(StringUtils.isBlank(wdq)?"0":wdq)); |
|
|
|
wdqMoney = wdqMoney.add(new BigDecimal(StringUtils.isBlank(wdq) ? "0" : wdq)); |
|
|
|
String bj = loanRepaymentPlanDetailsService.getBj(loanReturnInboundApply.getBusVinSid()); |
|
|
|
bjMoney = bjMoney.add(new BigDecimal(StringUtils.isBlank(bj)?"0":bj)); |
|
|
|
bjMoney = bjMoney.add(new BigDecimal(StringUtils.isBlank(bj) ? "0" : bj)); |
|
|
|
all = lqMoney.add(wdqMoney).add(bjMoney); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>(); |
|
|
|
//借方
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJf = new Voucher.VoucherResultDetailDto(); |
|
|
@ -718,7 +722,7 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf3 = new Voucher.VoucherResultDetailDto(); |
|
|
|
|
|
|
|
//-------------------------------------------应收贷款车欠款_待处理欠款_扣回车辆
|
|
|
|
if(all.compareTo(BigDecimal.ZERO) != 0){ |
|
|
|
if (all.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
voucherResultDetailDtoJf.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoJf.setSubjectNo("1201.03.01"); |
|
|
|
//核算部门
|
|
|
@ -730,7 +734,7 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
} |
|
|
|
|
|
|
|
//---------------------------------------------应收贷款车欠款_到期欠款_累欠
|
|
|
|
if(lqMoney.compareTo(BigDecimal.ZERO) != 0){ |
|
|
|
if (lqMoney.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
voucherResultDetailDtoDf1.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoDf1.setSubjectNo("1201.02.03"); |
|
|
|
//核算部门
|
|
|
@ -742,7 +746,7 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
} |
|
|
|
|
|
|
|
//--------------------------------------------应收贷款车欠款_未到期欠款_未到期欠款
|
|
|
|
if(wdqMoney.compareTo(BigDecimal.ZERO) != 0){ |
|
|
|
if (wdqMoney.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
voucherResultDetailDtoDf2.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoDf2.setSubjectNo("1201.01.00"); |
|
|
|
//核算部门
|
|
|
@ -754,7 +758,7 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
} |
|
|
|
|
|
|
|
//-------------------------------------------应收贷款车欠款_到期欠款_本金
|
|
|
|
if(bjMoney.compareTo(BigDecimal.ZERO) != 0){ |
|
|
|
if (bjMoney.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
voucherResultDetailDtoDf3.setSummary("扣回车辆入库"); |
|
|
|
voucherResultDetailDtoDf3.setSubjectNo("1201.02.01"); |
|
|
|
//核算部门
|
|
|
@ -764,13 +768,34 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
voucherResultDetailDtoDf3.setCredit(bjMoney.toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf3); |
|
|
|
} |
|
|
|
if(!voucherResultDetailDtos.isEmpty()){ |
|
|
|
if (!voucherResultDetailDtos.isEmpty()) { |
|
|
|
voucher.setResultDetails(voucherResultDetailDtos); |
|
|
|
finKingDeeFeign.saveVoucher(voucher); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void pushStkIn(LoanReturnInboundApply loanReturnInboundApply) { |
|
|
|
SysOrganizationVo sysOrg = sysOrganizationFeign.fetchBySid(loanReturnInboundApply.getUseOrgSid()).getData(); |
|
|
|
StkMiscellaneous stkMiscellaneous = new StkMiscellaneous(); |
|
|
|
List<StkMiscellaneous.StkMiscellaneousEntry> stkMiscellaneousEntryList = new ArrayList<>(); |
|
|
|
SysOrganizationVo sysOrgDept = sysOrganizationFeign.fetchBySid(loanReturnInboundApply.getCreateDeptSid()).getData(); |
|
|
|
stkMiscellaneous.setFStockOrgId(sysOrg.getOrgCode()); |
|
|
|
stkMiscellaneous.setFDEPTID(sysOrgDept.getOrgCode()); |
|
|
|
stkMiscellaneous.setFNOTE(""); |
|
|
|
stkMiscellaneous.setFDate(DateUtil.today()); |
|
|
|
stkMiscellaneous.setFOwnerIdHead(sysOrg.getOrgCode()); |
|
|
|
StkMiscellaneous.StkMiscellaneousEntry stkMiscellaneousEntry = new StkMiscellaneous.StkMiscellaneousEntry(); |
|
|
|
stkMiscellaneousEntry.setFMATERIALID(loanReturnInboundApply.getVinNo()); |
|
|
|
stkMiscellaneousEntry.setFUnitID("liang"); |
|
|
|
stkMiscellaneousEntry.setFSTOCKID("ARZSCK"); |
|
|
|
stkMiscellaneousEntry.setFOWNERID(sysOrg.getOrgCode()); |
|
|
|
stkMiscellaneousEntryList.add(stkMiscellaneousEntry); |
|
|
|
stkMiscellaneous.setStkMiscellaneousEntry(stkMiscellaneousEntryList); |
|
|
|
ResultBean resultBean = finKingDeeFeign.draftStkMiscellaneous(stkMiscellaneous); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private int submitBusinessData(SubmitReturnInbondApplyDto dto, LoanReturnInboundApply loanReturnInboundApply) { |
|
|
|
int r = 0; |
|
|
|
if (StringUtils.isBlank(dto.getSid())) { |
|
|
|