|
@ -70,8 +70,12 @@ import com.yxt.anrui.fin.biz.finuncollectedreceivablesdetailedjr.FinUncollectedR |
|
|
import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; |
|
|
import com.yxt.anrui.fin.biz.kingdee.appaybill.ApPayBillService; |
|
|
import com.yxt.anrui.fin.biz.kingdee.voucher.VoucherService; |
|
|
import com.yxt.anrui.fin.biz.kingdee.voucher.VoucherService; |
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
|
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonVo; |
|
|
import com.yxt.anrui.portal.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.portal.api.flow.FlowableFeign; |
|
|
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; |
|
|
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysmapping.SysMappingFeign; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysmapping.SysMappingInfoVo; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysmapping.SysMappingListInfoQuery; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
@ -186,8 +190,8 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
private LoanSettleApplyFeign loanSettleApplyFeign; |
|
|
private LoanSettleApplyFeign loanSettleApplyFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private VoucherService voucherService; |
|
|
private VoucherService voucherService; |
|
|
@Resource |
|
|
@Autowired |
|
|
private FinKingDeeFeign finKingDeeFeign; |
|
|
private SysMappingFeign sysMappingFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DictCommonFeign dictCommonFeign; |
|
|
private DictCommonFeign dictCommonFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -1646,47 +1650,53 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
voucher.setVoucherNo(organizationVo.getOrgCode()); |
|
|
voucher.setVoucherNo(organizationVo.getOrgCode()); |
|
|
} |
|
|
} |
|
|
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>(); |
|
|
List<Voucher.VoucherResultDetailDto> voucherResultDetailDtos = new ArrayList<>(); |
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDto = new Voucher.VoucherResultDetailDto(); |
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoJF = new Voucher.VoucherResultDetailDto(); |
|
|
|
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf = new Voucher.VoucherResultDetailDto(); |
|
|
|
|
|
FinManufacturerBank manufacturerBank = finManufacturerBankService.selOneByBankNo(finPaymentrecord.getPayBankAccount(), finPaymentrecord.getUseOrgSid()).getData(); |
|
|
|
|
|
if (null != manufacturerBank) { |
|
|
|
|
|
if (manufacturerBank.getDueBankKey().equals("02")) { |
|
|
|
|
|
voucherResultDetailDtoDf.setSubjectNo("1002.01.00"); |
|
|
|
|
|
} else if (manufacturerBank.getDueBankKey().equals("01")) { |
|
|
|
|
|
voucherResultDetailDtoDf.setSubjectNo("1002.02.01"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
if ("015".equals(finPaymentrecord.getCostTitleKey())) {//银行保证金
|
|
|
if ("015".equals(finPaymentrecord.getCostTitleKey())) {//银行保证金
|
|
|
//借方
|
|
|
//借方
|
|
|
voucherResultDetailDto.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDtoJF.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDto.setSubjectNo("1009.03"); |
|
|
voucherResultDetailDtoJF.setSubjectNo("1009.03"); |
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
voucherResultDetailDto.setDimensionDept(deptVo.getOrgCode()); |
|
|
voucherResultDetailDtoJF.setDimensionDept(deptVo.getOrgCode()); |
|
|
String key = dictCommonFeign.selectByValue(finPaymentrecord.getReceiveBank()).getData(); |
|
|
String key = dictCommonFeign.selectByValue(finPaymentrecord.getReceiveBank()).getData(); |
|
|
voucherResultDetailDto.setBank(key); |
|
|
voucherResultDetailDtoJF.setBank(key); |
|
|
voucherResultDetailDto.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtoJF.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
//贷方
|
|
|
//贷方
|
|
|
voucherResultDetailDto.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDtoDf.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDto.setSubjectNo("1002.01.00"); |
|
|
voucherResultDetailDtoDf.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDto.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDtoDf.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDto.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
|
|
|
} else if ("016".equals(finPaymentrecord.getCostTitleKey())) {//银行手续费
|
|
|
} else if ("016".equals(finPaymentrecord.getCostTitleKey())) {//银行手续费
|
|
|
//借方
|
|
|
//借方
|
|
|
voucherResultDetailDto.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDtoJF.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDto.setSubjectNo("6603.03.00"); |
|
|
voucherResultDetailDtoJF.setSubjectNo("6603.03.00"); |
|
|
voucherResultDetailDto.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtoJF.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
//贷方
|
|
|
//贷方
|
|
|
voucherResultDetailDto.setSummary("付" + finPaymentrecord.getCostTitleValue()); |
|
|
voucherResultDetailDtoDf.setSummary("付" + finPaymentrecord.getCostTitleValue()); |
|
|
voucherResultDetailDto.setSubjectNo("1002.01.00"); |
|
|
voucherResultDetailDtoDf.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDto.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDtoDf.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDto.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
|
|
|
} else if ("017".equals(finPaymentrecord.getCostTitleKey())) {//金融服务费
|
|
|
} else if ("017".equals(finPaymentrecord.getCostTitleKey())) {//金融服务费
|
|
|
//借方
|
|
|
//借方
|
|
|
voucherResultDetailDto.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDtoJF.setSummary("付" + finPaymentrecord.getCostTitleValue() + finPaymentrecord.getCost()); |
|
|
voucherResultDetailDto.setSubjectNo("6603.03.00"); |
|
|
voucherResultDetailDtoJF.setSubjectNo("6603.03.00"); |
|
|
voucherResultDetailDto.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtoJF.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
//贷方
|
|
|
//贷方
|
|
|
voucherResultDetailDto.setSummary("付" + finPaymentrecord.getCostTitleValue()); |
|
|
voucherResultDetailDtoDf.setSummary("付" + finPaymentrecord.getCostTitleValue()); |
|
|
voucherResultDetailDto.setSubjectNo("1002.01.00"); |
|
|
voucherResultDetailDtoDf.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDto.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDtoDf.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDto.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
|
|
|
} else if (StringUtils.isBlank(finPaymentrecord.getCostTitleKey())) {//平仓款
|
|
|
} else if (StringUtils.isBlank(finPaymentrecord.getCostTitleKey())) {//平仓款
|
|
|
//查询平仓总付款金额
|
|
|
//查询平仓总付款金额
|
|
|
FinPaymentapplyDetailsBelowEve finPaymentapplyDetailsBelowEve = finPaymentapplyDetailsBelowEveService.fetchBySid(finPaymentrecord.getBusSid()); |
|
|
FinPaymentapplyDetailsBelowEve finPaymentapplyDetailsBelowEve = finPaymentapplyDetailsBelowEveService.fetchBySid(finPaymentrecord.getBusSid()); |
|
@ -1698,43 +1708,42 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
BigDecimal payPriceTotal = baseMapper.selPayPrice(finPaymentrecord.getApplySid()); |
|
|
BigDecimal payPriceTotal = baseMapper.selPayPrice(finPaymentrecord.getApplySid()); |
|
|
if (payPriceTotal.add(finPaymentrecord.getCost()).compareTo(exePayPriceTotal) == -1) { |
|
|
if (payPriceTotal.add(finPaymentrecord.getCost()).compareTo(exePayPriceTotal) == -1) { |
|
|
//借方
|
|
|
//借方
|
|
|
voucherResultDetailDto.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDtoJF.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDto.setSubjectNo("1009.03"); |
|
|
voucherResultDetailDtoJF.setSubjectNo("1009.03"); |
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
voucherResultDetailDto.setDimensionDept(deptVo.getOrgCode()); |
|
|
voucherResultDetailDtoJF.setDimensionDept(deptVo.getOrgCode()); |
|
|
String key = dictCommonFeign.selectByValue(finPaymentrecord.getReceiveBank()).getData(); |
|
|
String key = dictCommonFeign.selectByValue(finPaymentrecord.getReceiveBank()).getData(); |
|
|
voucherResultDetailDto.setBank(key); |
|
|
voucherResultDetailDtoJF.setBank(key); |
|
|
voucherResultDetailDto.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtoJF.setDebit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
//贷方
|
|
|
//贷方
|
|
|
voucherResultDetailDto.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDtoDf.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDto.setSubjectNo("1002.01.00"); |
|
|
voucherResultDetailDtoDf.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDto.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDtoDf.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDto.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
//借方
|
|
|
//借方
|
|
|
voucherResultDetailDto.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDtoJF.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDto.setSubjectNo("2111"); |
|
|
voucherResultDetailDtoJF.setSubjectNo("2111"); |
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
SysOrganizationVo deptVo = sysOrganizationFeign.fetchBySid(finPaymentrecord.getPurchaseSystemSid()).getData(); |
|
|
voucherResultDetailDto.setDimensionDept(deptVo.getOrgCode()); |
|
|
voucherResultDetailDtoJF.setDimensionDept(deptVo.getOrgCode()); |
|
|
String key = dictCommonFeign.selectByValue(finPaymentrecord.getReceiveBank()).getData(); |
|
|
String key = dictCommonFeign.selectByValue(finPaymentrecord.getReceiveBank()).getData(); |
|
|
voucherResultDetailDto.setBank(key); |
|
|
voucherResultDetailDtoJF.setBank(key); |
|
|
voucherResultDetailDto.setDebit(exePayPriceTotal.add(payAccount).toString()); |
|
|
voucherResultDetailDtoJF.setDebit(exePayPriceTotal.add(payAccount).toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoJF); |
|
|
//贷方1
|
|
|
//贷方1
|
|
|
voucherResultDetailDto.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDtoDf.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDto.setSubjectNo("1009.03"); |
|
|
voucherResultDetailDtoDf.setSubjectNo("1009.03"); |
|
|
voucherResultDetailDto.setDimensionDept(deptVo.getOrgCode()); |
|
|
voucherResultDetailDtoDf.setDimensionDept(deptVo.getOrgCode()); |
|
|
voucherResultDetailDto.setBank(key); |
|
|
voucherResultDetailDtoDf.setBank(key); |
|
|
voucherResultDetailDto.setCredit(payPriceTotal.add(payAccount).subtract(finPaymentrecord.getCost()).toString()); |
|
|
voucherResultDetailDtoDf.setCredit(payPriceTotal.add(payAccount).subtract(finPaymentrecord.getCost()).toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf); |
|
|
//贷方2
|
|
|
//贷方2
|
|
|
voucherResultDetailDto.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
Voucher.VoucherResultDetailDto voucherResultDetailDtoDf2 = new Voucher.VoucherResultDetailDto(); |
|
|
voucherResultDetailDto.setSubjectNo("1002.01.00"); |
|
|
voucherResultDetailDtoDf2.setSummary("还" + finPaymentrecord.getCostTitleValue() + finPaymentapplyDetailsBelowEve.getExePayDate()); |
|
|
voucherResultDetailDto.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDtoDf2.setBankAccount(finPaymentrecord.getPayBankAccount()); |
|
|
voucherResultDetailDto.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtoDf2.setCredit(finPaymentrecord.getCost().toString()); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDto); |
|
|
voucherResultDetailDtos.add(voucherResultDetailDtoDf2); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
voucher.setResultDetails(voucherResultDetailDtos); |
|
|
voucher.setResultDetails(voucherResultDetailDtos); |
|
|