Browse Source

[账单][修改][导入数据]

release_toaliyun_real
gongbiao 7 years ago
parent
commit
e56cf1e5fe
1 changed files with 32 additions and 26 deletions
  1. +32
    -26
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java

+ 32
- 26
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java View File

@@ -1023,15 +1023,17 @@ public class WxBillAllServiceImpl implements WxBillAllService {
dailyQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); dailyQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode());
WxBillDaily daily = wxBillDailyMapper.selectOne(dailyQuery); WxBillDaily daily = wxBillDailyMapper.selectOne(dailyQuery);
long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact();
if (daily != null && !daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (daily.getOwe() <= pay) {
daily.setStatus(EnumBillRentStatus.PAID.getCode());
if (daily != null) {
if (!daily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (daily.getOwe() <= pay) {
daily.setStatus(EnumBillRentStatus.PAID.getCode());
}
daily.setPay(daily.getPay() + pay);
daily.setOwe(daily.getOwe() - pay);
daily.setPayDate(bill.getPayDate());
daily.setReceiveDate(bill.getReceiveDate());
wxBillDailyMapper.updateByPrimaryKey(daily);
} }
daily.setPay(daily.getPay() + pay);
daily.setOwe(daily.getOwe() - pay);
daily.setPayDate(bill.getPayDate());
daily.setReceiveDate(bill.getReceiveDate());
wxBillDailyMapper.updateByPrimaryKey(daily);
} else { } else {
WxMerchantShop wxMerchantShop = new WxMerchantShop(); WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setTenantId(tenantId); wxMerchantShop.setTenantId(tenantId);
@@ -1070,17 +1072,19 @@ public class WxBillAllServiceImpl implements WxBillAllService {
otherQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); otherQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode());
WxBillOther other = wxBillOtherMapper.selectOne(otherQuery); WxBillOther other = wxBillOtherMapper.selectOne(otherQuery);
long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact();
if (other != null && !other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (other.getOwe() <= pay) {
other.setStatus(EnumBillRentStatus.PAID.getCode());
if (other != null) {
if (!other.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (other.getOwe() <= pay) {
other.setStatus(EnumBillRentStatus.PAID.getCode());
}
other.setName(bill.getBillAttr());
other.setComments(bill.getBillAttr());
other.setPay(other.getPay() + pay);
other.setOwe(other.getOwe() - pay);
other.setPayDate(bill.getPayDate());
other.setReceiveDate(bill.getReceiveDate());
wxBillOtherMapper.updateByPrimaryKey(other);
} }
other.setName(bill.getBillAttr());
other.setComments(bill.getBillAttr());
other.setPay(other.getPay() + pay);
other.setOwe(other.getOwe() - pay);
other.setPayDate(bill.getPayDate());
other.setReceiveDate(bill.getReceiveDate());
wxBillOtherMapper.updateByPrimaryKey(other);
} else { } else {
WxMerchantShop wxMerchantShop = new WxMerchantShop(); WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setTenantId(tenantId); wxMerchantShop.setTenantId(tenantId);
@@ -1120,15 +1124,17 @@ public class WxBillAllServiceImpl implements WxBillAllService {
otherDepositQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode()); otherDepositQuery.setIsDel(EnumDelStatus.NOT_DEL.getCode());
WxBillOtherDeposit otherDeposit = wxBillOtherDepositMapper.selectOne(otherDepositQuery); WxBillOtherDeposit otherDeposit = wxBillOtherDepositMapper.selectOne(otherDepositQuery);
long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact(); long pay = new BigDecimal(bill.getPayStr()).multiply(new BigDecimal(100)).longValueExact();
if (otherDeposit != null && !otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (otherDeposit.getOwe() <= pay) {
otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
if (otherDeposit != null) {
if (!otherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
if (otherDeposit.getOwe() <= pay) {
otherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
}
otherDeposit.setPay(otherDeposit.getPay() + pay);
otherDeposit.setOwe(otherDeposit.getOwe() - pay);
otherDeposit.setPayDate(bill.getPayDate());
otherDeposit.setReceiveDate(bill.getReceiveDate());
wxBillOtherDepositMapper.updateByPrimaryKey(otherDeposit);
} }
otherDeposit.setPay(otherDeposit.getPay() + pay);
otherDeposit.setOwe(otherDeposit.getOwe() - pay);
otherDeposit.setPayDate(bill.getPayDate());
otherDeposit.setReceiveDate(bill.getReceiveDate());
wxBillOtherDepositMapper.updateByPrimaryKey(otherDeposit);
} else { } else {
WxMerchantShop wxMerchantShop = new WxMerchantShop(); WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setTenantId(tenantId); wxMerchantShop.setTenantId(tenantId);


Loading…
Cancel
Save