From a33a5a2b6ed6214d6c1fe61f31e68a6b8ff07356 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 7 Jul 2024 15:45:45 +0800 Subject: [PATCH] fix --- .../iformall/domain/po/WxBillProperty.java | 3 +++ .../impl/WxPropertyContractServiceImpl.java | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java index bf145487f..e9af49f52 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java @@ -189,4 +189,7 @@ public class WxBillProperty extends WxBillBaseEntity { @TableField(exist = false) List unFixedbillFeesStandardsList; + @TableField(exist = false) + List childList; + } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 90b444060..f12801b2f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -644,7 +644,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxPropertyContract); SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); Map resultMap = new HashedMap(); - List resultList = new ArrayList<>(); + List propertyResultList = new ArrayList<>(); + List allResultList = new ArrayList<>(); Date endDate = null; if(yearList.size() > 1){ @@ -736,36 +737,41 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService WxBillProperty wxBillProperty = generateBillProperty(wxPayAccountBill,wxPropertyContract,isPreview,billTimeVo.getStartDate(),billTimeVo.getEndDate(),billTimeVo.getReceiveDate(),needpay,userId,billcount,shopInfo,standarsTotal,"",null,null); //非一次性账单 wxBillProperty.setUnFixedbillFeesStandardsList(unFixedList); + List childList = null; //每个非从一次性都要创建账单 - if (null != unFixedList) { + if (null != unFixedList && unFixedList.size() > 0 ) { + childList = new ArrayList(); for (int j = 0 ; j < unFixedList.size(); j ++ ) { WxBillFeesStandardsListVo svo = unFixedList.get(j); svo.setParentBillId(wxBillProperty.getId()); WxBillProperty property = generateBillPropertyByBillStandards(wxPayAccountBill,wxPropertyContract,isPreview,userId,svo,billcount,shopInfo); - resultList.add(property); + allResultList.add(property); + childList.add(property); } } + wxBillProperty.setChildList(childList); //主账单列表 - resultList.add(wxBillProperty); + propertyResultList.add(wxBillProperty); + allResultList.add(wxBillProperty); } - if (null != fixedList) { + if (null != fixedList && fixedList.size() > 0 ) { for (int i = 0 ; i < fixedList.size(); i ++ ) { WxBillFeesStandardsListVo svo = fixedList.get(i); WxBillProperty property = generateBillPropertyByBillStandards(wxPayAccountBill,wxPropertyContract,isPreview,userId,svo,billcount,shopInfo); - resultList.add(property); + allResultList.add(property); } } //批量生成预账单 - if(saveDb && resultList.size() > 0 ) { - wxBillPropertyMapper.insertBills(wxPropertyContract.getTenantId() ,resultList); + if(saveDb && allResultList.size() > 0 ) { + wxBillPropertyMapper.insertBills(wxPropertyContract.getTenantId() ,allResultList); //for (int i = 0 ; i < resultList.size() ; i++) { // wxBillPropertyMapper.insert(resultList.get(i)); //} } resultMap.put("billcount",billcount); - resultMap.put("billList",resultList); + resultMap.put("billList",propertyResultList); return resultMap; }