|
|
@ -89,6 +89,7 @@ import org.springframework.stereotype.Service; |
|
|
|
import java.io.FileInputStream; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.NumberFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.*; |
|
|
@ -339,10 +340,10 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
for (int i = 0; i < sids.size(); i++) { |
|
|
|
FinPaymentrecord finPaymentrecord = fetchBySid(sids.get(i)); |
|
|
|
FinPaymentrecord finPaymentrecordOne = null; |
|
|
|
if (dto.getCost() < finPaymentrecord.getAccountsReceive()) {//实收金额小于应收金额
|
|
|
|
if (new BigDecimal(dto.getCost()).compareTo(finPaymentrecord.getAccountsReceive())<0) {//实收金额小于应收金额
|
|
|
|
finPaymentrecordOne = new FinPaymentrecord(); |
|
|
|
BeanUtil.copyProperties(finPaymentrecord, finPaymentrecordOne, "sid"); |
|
|
|
finPaymentrecordOne.setAccountsReceive(finPaymentrecord.getAccountsReceive() - dto.getCost()); |
|
|
|
finPaymentrecordOne.setAccountsReceive(finPaymentrecord.getAccountsReceive().subtract(new BigDecimal(dto.getCost()))); |
|
|
|
finPaymentrecordOne.setCost(finPaymentrecordOne.getAccountsReceive()); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, finPaymentrecord, "sid"); |
|
|
@ -515,10 +516,10 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
} |
|
|
|
List<ApPayBill.FPAYBILLENTRY> FPAYBILLENTRYs = new ArrayList<>(); |
|
|
|
if (finPaymentrecord.getCost() != null |
|
|
|
&& finPaymentrecord.getCost() > 0) { |
|
|
|
&& finPaymentrecord.getCost().compareTo(BigDecimal.ZERO)>0) { |
|
|
|
ApPayBill.FPAYBILLENTRY fpaybillentry = new ApPayBill.FPAYBILLENTRY(); |
|
|
|
//应付金额
|
|
|
|
fpaybillentry.setFPAYTOTALAMOUNTFOR(Double.valueOf(finPaymentrecord.getCost())); |
|
|
|
fpaybillentry.setFPAYTOTALAMOUNTFOR(finPaymentrecord.getCost().doubleValue()); |
|
|
|
//登账日期
|
|
|
|
fpaybillentry.setFPOSTDATE(DateUtil.formatDate(finPaymentrecord.getPayDate())); |
|
|
|
//我方银行账号
|
|
|
@ -817,7 +818,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
dataMap.put("receiveCompany", finPaymentrecord.getReceiveCompany()); |
|
|
|
dataMap.put("receiveBank", finPaymentrecord.getReceiveBank()); |
|
|
|
dataMap.put("receiveBankAccount", finPaymentrecord.getReceiveBankAccount()); |
|
|
|
Double aDouble = Double.valueOf(finPaymentrecord.getAccountsReceive()); |
|
|
|
Double aDouble = finPaymentrecord.getAccountsReceive().doubleValue(); |
|
|
|
String s = upperCase2(aDouble); |
|
|
|
dataMap.put("cost", finPaymentrecord.getAccountsReceive() + " " + "(" + s + ")"); |
|
|
|
//获取图片路径
|
|
|
@ -1003,7 +1004,7 @@ public class FinPaymentrecordService extends MybatisBaseService<FinPaymentrecord |
|
|
|
for (int i = 0; i < sids.size(); i++) { |
|
|
|
FinPaymentrecord finPaymentrecord = fetchBySid(sids.get(i)); |
|
|
|
BeanUtil.copyProperties(dto, finPaymentrecord, "sid"); |
|
|
|
finPaymentrecord.setCost(0); |
|
|
|
finPaymentrecord.setCost(BigDecimal.ZERO); |
|
|
|
baseMapper.updateById(finPaymentrecord); |
|
|
|
//更新付款申请中的状态
|
|
|
|
FinPaymentapply finPaymentapply = finPaymentapplyService.fetchBySid(finPaymentrecord.getApplySid()); |
|
|
|