From 3c867383345caac82343c8e8fa1ab0acc88f0a05 Mon Sep 17 00:00:00 2001 From: luozukai Date: Thu, 12 Sep 2019 17:09:33 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9][=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E5=8D=95][=E4=BF=AE=E6=94=B9=E7=BB=93=E7=AE=97=E5=8D=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxBillSettleServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java index 0004c22d9..060fa4f68 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillSettleServiceImpl.java @@ -14,6 +14,7 @@ import com.iformall.service.ExcelService; import com.iformall.service.WxBillSettleService; import com.iformall.service.WxFlowService; import com.iformall.utils.DateUtils; +import io.swagger.models.auth.In; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -361,6 +362,15 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { } } + public Integer getType(Long billId, WxBillSettle record){ + for (WxBillSettleBill bill:record.getReceiveBillIds()) { + if(bill.getBillId().equals(billId)){ + return 0; + } + } + return 1; + } + @Override @Transactional public ResultData saveOrUpdate(WxBillSettle record, MallUserInfo userInfo) { @@ -369,7 +379,8 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { //检查账单是否存在其他结算单中 WxBillSettle query = new WxBillSettle(); query.setId(record.getId()); - List list = record.getReceiveBillIds(); + List list = new ArrayList<>() + list.addAll(record.getReceiveBillIds()); list.addAll(record.getPayBillIds()); query.setReceiveBillIds(list); List existList = wxBillSettleBillMapper.findExist(query); @@ -382,6 +393,7 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { for (Long id:idSet) { WxBillSettleBill queryBill = new WxBillSettleBill(); queryBill.setBillId(id); + queryBill.setType(getType(id,record)); WxBillSettleBill db = wxBillSettleBillMapper.findByBillId(queryBill).get(0); BigDecimal r = new BigDecimal(db.getReceivePay()).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP); ids += db.getBillName()+r.toString()+"元,";