|
|
@@ -192,7 +192,8 @@ public class PaybalanceServiceImpl implements PaybalanceService {
|
|
|
//更新账户资料金额
|
|
|
Bankinformation bankinformation = new Bankinformation();
|
|
|
Bankinformation nowBankInformation = paybalanceMapper.selectBankInformationByPrimaryKey(det.getPd_bankid());
|
|
|
- bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()+det.getPd_amount());
|
|
|
+ bankinformation.setBk_thisamount((nowBankInformation.getBk_thisamount() == null ? new Double(0) : nowBankInformation.getBk_thisamount())
|
|
|
+ + (det.getPd_amount() == null ? 0.0 : det.getPd_amount()));
|
|
|
paybalanceMapper.updateBankByPrimaryKeySelective(bankinformation);
|
|
|
}
|
|
|
//更新主表pb_pbdamount=从表二金额合计
|
|
|
@@ -204,6 +205,7 @@ public class PaybalanceServiceImpl implements PaybalanceService {
|
|
|
updatePay.setPb_pdamount(amountTotal);
|
|
|
updatePay.setPb_pbdamount(amountTotal2);
|
|
|
paybalanceMapper.updateByPrimaryKeySelective(updatePay);
|
|
|
+ //updateByPrimaryKeySelective
|
|
|
/**
|
|
|
* ve_preamount=nvl(ve_preamount,0)+pb_preamount,
|
|
|
* ve_payamount=nvl(ve_payamount,0)-pb_pbdamount,
|
|
|
@@ -239,18 +241,18 @@ public class PaybalanceServiceImpl implements PaybalanceService {
|
|
|
* ve_leftamount=ve_beginapamount-ve_beginprepayamount+ve_payamount-ve_preamount;
|
|
|
*/
|
|
|
Paybalance pay = paybalanceMapper.selectByPrimaryKey(Long.valueOf(id));
|
|
|
- Double pay_preamount = pay.getPb_preamount()==null?new Double(0):pay.getPb_preamount();
|
|
|
- Double pay_pbdamount = pay.getPb_pbdamount()==null?new Double(0):pay.getPb_pbdamount();
|
|
|
+ Double pay_preamount = pay.getPb_preamount() == null ? new Double(0): pay.getPb_preamount();
|
|
|
+ Double pay_pbdamount = pay.getPb_pbdamount() == null ? new Double(0): pay.getPb_pbdamount();
|
|
|
Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(pay.getPb_vendid());
|
|
|
- Double preamount = vendorData.getVe_preamount()==null?new Double(0):vendorData.getVe_preamount();
|
|
|
- Double beginapamount = vendorData.getVe_beginapamount()==null?new Double(0):vendorData.getVe_beginapamount();
|
|
|
- Double beginprepayamount= vendorData.getVe_beginprepayamount()==null?new Double(0):vendorData.getVe_beginprepayamount();
|
|
|
- Double payamount = vendorData.getVe_payamount()==null?new Double(0):vendorData.getVe_payamount();
|
|
|
+ Double preamount = vendorData.getVe_preamount() == null ? new Double(0) : vendorData.getVe_preamount();
|
|
|
+ Double beginapamount = vendorData.getVe_beginapamount() == null ? new Double(0) : vendorData.getVe_beginapamount();
|
|
|
+ Double beginprepayamount= vendorData.getVe_beginprepayamount() == null ? new Double(0) : vendorData.getVe_beginprepayamount();
|
|
|
+ Double payamount = vendorData.getVe_payamount() == null ? new Double(0) : vendorData.getVe_payamount() ;
|
|
|
Vendor vendor = new Vendor();
|
|
|
vendor.setId(Long.valueOf(String.valueOf(pay.getPb_vendid())));
|
|
|
- vendor.setVe_preamount(preamount-pay_preamount);
|
|
|
- vendor.setVe_payamount(payamount+pay_pbdamount);
|
|
|
- vendor.setVe_leftamount(beginapamount-beginprepayamount+payamount+pay_pbdamount-preamount+pay_preamount);
|
|
|
+ vendor.setVe_preamount(preamount - pay_preamount);
|
|
|
+ vendor.setVe_payamount(payamount + pay_pbdamount);
|
|
|
+ vendor.setVe_leftamount(beginapamount - beginprepayamount + payamount + pay_pbdamount - preamount + pay_preamount);
|
|
|
paybalanceMapper.updateVendorByPrimaryKeySelective(vendor);
|
|
|
|
|
|
//更新账户资料金额
|
|
|
@@ -258,7 +260,8 @@ public class PaybalanceServiceImpl implements PaybalanceService {
|
|
|
for (Paybalancedet det:paybalancedet) {
|
|
|
Bankinformation bankinformation = new Bankinformation();
|
|
|
Bankinformation nowBankInformation = paybalanceMapper.selectBankInformationByPrimaryKey(det.getPd_bankid());
|
|
|
- bankinformation.setBk_thisamount(nowBankInformation.getBk_thisamount()-det.getPd_amount());
|
|
|
+ bankinformation.setBk_thisamount((nowBankInformation.getBk_thisamount() == null ? new Double(0) : nowBankInformation.getBk_thisamount())
|
|
|
+ - (det.getPd_amount() == null ? new Double(0) : det.getPd_amount()));
|
|
|
paybalanceMapper.updateBankByPrimaryKeySelective(bankinformation);
|
|
|
}
|
|
|
|
|
|
@@ -459,7 +462,9 @@ public class PaybalanceServiceImpl implements PaybalanceService {
|
|
|
banksubledger.setBl_manname(paybalance.getPb_manname());
|
|
|
banksubledger.setBl_remark(paybalancedet.getPd_remark());
|
|
|
banksubledger.setBl_orderamount(paybalancedet.getPd_amount() * -1);
|
|
|
- if (banksubledgerMapper.selectCode(banksubledger.getBl_code()) == null){
|
|
|
+
|
|
|
+ List<String> bankList = banksubledgerMapper.selectCode(banksubledger.getBl_code());
|
|
|
+ if (bankList.size() == 0){
|
|
|
banksubledgerMapper.insertSelective(banksubledger);
|
|
|
}else {
|
|
|
banksubledgerMapper.updateByPrimaryKeySelective(banksubledger);
|