|
|
@ -54,6 +54,7 @@ import com.yxt.anrui.fin.api.finpaymentapply.FinPaymentapply; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplydetails.FinPaymentapplyDetails; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplydetailsbelow.FinPaymentapplyDetailsBelow; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplydetailsbeloweve.FinPaymentapplyDetailsBelowEve; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplyeve.FinPaymentapplyEve; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentapplyvehicle.FinPaymentapplyVehicleVo; |
|
|
|
import com.yxt.anrui.fin.api.finpaymentrecord.*; |
|
|
|
import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailedjr.FinUncollectedReceivablesDetailedJR; |
|
|
@ -64,6 +65,7 @@ import com.yxt.anrui.fin.biz.finpaymentapply.FinPaymentapplyService; |
|
|
|
import com.yxt.anrui.fin.biz.finpaymentapplydetails.FinPaymentapplyDetailsService; |
|
|
|
import com.yxt.anrui.fin.biz.finpaymentapplydetailsbelow.FinPaymentapplyDetailsBelowService; |
|
|
|
import com.yxt.anrui.fin.biz.finpaymentapplydetailsbeloweve.FinPaymentapplyDetailsBelowEveService; |
|
|
|
import com.yxt.anrui.fin.biz.finpaymentapplyeve.FinPaymentapplyEveService; |
|
|
|
import com.yxt.anrui.fin.biz.finpaymentapplyvehicle.FinPaymentapplyVehicleService; |
|
|
|
import com.yxt.anrui.fin.biz.finuncollectedreceivablesdetailedjr.FinUncollectedReceivablesDetailedJRService; |
|
|
|
import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; |
|
|
@ -186,7 +188,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
@Autowired |
|
|
|
private VoucherService voucherService; |
|
|
|
@Autowired |
|
|
|
private SysMappingFeign sysMappingFeign; |
|
|
|
private FinPaymentapplyEveService finPaymentapplyEveService; |
|
|
|
@Autowired |
|
|
|
private DictCommonFeign dictCommonFeign; |
|
|
|
@Autowired |
|
|
@ -1692,16 +1694,18 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
|
} else if (StringUtils.isBlank(finPaymentrecord.getCostTitleKey())) {//平仓款
|
|
|
|
//查询平仓总付款金额
|
|
|
|
FinPaymentapplyDetailsBelowEve finPaymentapplyDetailsBelowEve = finPaymentapplyDetailsBelowEveService.fetchBySid(finPaymentrecord.getBusSid()); |
|
|
|
BigDecimal exePayPriceTotal = finPaymentapplyDetailsBelowEveService.selExePayByMainSid(finPaymentapplyDetailsBelowEve.getDetailSid()); |
|
|
|
FinPaymentapplyEve finPaymentapplyEve = finPaymentapplyEveService.fetchBySid(finPaymentrecord.getBusSid()); |
|
|
|
BigDecimal exePayPriceTotal = finPaymentapplyEveService.fetchExePriceByMainSid(finPaymentapplyEve.getApplySid()); |
|
|
|
//查询保证金
|
|
|
|
FinPaymentapplyDetailsBelow finPaymentapplyDetailsBelow = finPaymentapplyDetailsBelowService.fetchBySid(finPaymentapplyDetailsBelowEve.getDetailSid()); |
|
|
|
BigDecimal payAccount = finPaymentapplyDetailsBelow.getPayAccount(); |
|
|
|
BigDecimal bzj = finPaymentapplyDetailsBelowService.fetchBzj(finPaymentapplyEve.getApplySid()); |
|
|
|
if (bzj == null){ |
|
|
|
bzj = BigDecimal.ZERO; |
|
|
|
} |
|
|
|
//查询已付款平仓款金额
|
|
|
|
BigDecimal payPriceTotal = baseMapper.selPayPrice(finPaymentrecord.getApplySid()); |
|
|
|
if (payPriceTotal.compareTo(exePayPriceTotal) == -1) { |
|
|
|
//借方
|
|
|
|
voucherResultDetailDtoJF.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
|
voucherResultDetailDtoJF.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyEve.getOpenDate()); |
|
|
|
voucherResultDetailDtoJF.setSubjectNo("1009.03"); |
|
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
|
voucherResultDetailDtoJF.setDimensionDept(deptVo.getOrgCode()); |
|
|
@ -1710,29 +1714,29 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
voucherResultDetailDtoJF.setDebit(finPaymentrecord.getCost().toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
|
//贷方
|
|
|
|
voucherResultDetailDtoDf.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
|
voucherResultDetailDtoDf.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyEve.getOpenDate()); |
|
|
|
voucherResultDetailDtoDf.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
|
voucherResultDetailDtoDf.setCredit(finPaymentrecord.getCost().toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
|
} else { |
|
|
|
//借方
|
|
|
|
voucherResultDetailDtoJF.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
|
voucherResultDetailDtoJF.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyEve.getOpenDate()); |
|
|
|
voucherResultDetailDtoJF.setSubjectNo("2111"); |
|
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
|
voucherResultDetailDtoJF.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
String key = dictCommonFeign.selectKeyByValue(finPaymentrecord.getReceiveBank(),"bank").getData(); |
|
|
|
voucherResultDetailDtoJF.setBank(key); |
|
|
|
voucherResultDetailDtoJF.setDebit(exePayPriceTotal.add(payAccount).toString()); |
|
|
|
voucherResultDetailDtoJF.setDebit(exePayPriceTotal.add(bzj).toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
|
//贷方1
|
|
|
|
voucherResultDetailDtoDf.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
|
voucherResultDetailDtoDf.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyEve.getOpenDate()); |
|
|
|
voucherResultDetailDtoDf.setSubjectNo("1009.03"); |
|
|
|
voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); |
|
|
|
voucherResultDetailDtoDf.setBank(key); |
|
|
|
voucherResultDetailDtoDf.setCredit(payPriceTotal.add(payAccount).subtract(finPaymentrecord.getCost()).toString()); |
|
|
|
voucherResultDetailDtoDf.setCredit(payPriceTotal.add(bzj).subtract(finPaymentrecord.getCost()).toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
|
//贷方2
|
|
|
|
voucherResultDetailDtoDf2.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
|
voucherResultDetailDtoDf2.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyEve.getOpenDate()); |
|
|
|
voucherResultDetailDtoDf2.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
|
voucherResultDetailDtoDf2.setCredit(finPaymentrecord.getCost().toString()); |
|
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf2); |
|
|
|