|
|
|
@@ -14,7 +14,6 @@ import com.iformall.domain.po.base.BaseEntity; |
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
import com.iformall.domain.vo.BillTimeVo; |
|
|
|
import com.iformall.domain.vo.WxBillFeesStandardsListVo; |
|
|
|
import com.iformall.domain.vo.WxBillFeesStandardsVo; |
|
|
|
import com.iformall.enums.*; |
|
|
|
import com.iformall.exception.MallinkException; |
|
|
|
import com.iformall.mapper.*; |
|
|
|
@@ -645,7 +644,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxPropertyContract); |
|
|
|
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
Map<String,Object> resultMap = new HashedMap(); |
|
|
|
List<WxBillProperty> resultList = new ArrayList<>(); |
|
|
|
List<WxBillProperty> propertyResultList = new ArrayList<>(); |
|
|
|
List<WxBillProperty> allResultList = new ArrayList<>(); |
|
|
|
|
|
|
|
Date endDate = null; |
|
|
|
if(yearList.size() > 1){ |
|
|
|
@@ -673,13 +673,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
billStartDate = billTimeVoList.get(0).getStartDate(); |
|
|
|
billEndDate = billTimeVoList.get(billTimeVoList.size()-1).getEndDate(); |
|
|
|
} |
|
|
|
WxBillFeesStandardsVo standardsVo = WxRentContractHelper.getStandardsBillList(wxPropertyContract.getFeesStardarsList(),billStartDate,billEndDate); |
|
|
|
List<WxBillFeesStandardsListVo> fixedList = null; |
|
|
|
List<WxBillFeesStandardsListVo> unFixedList = null; |
|
|
|
if (null != standardsVo) { |
|
|
|
fixedList = standardsVo.getFixedFeeStandards(); |
|
|
|
unFixedList = standardsVo.getUnFixedFeeStandards(); |
|
|
|
} |
|
|
|
//一次性费用的,只有一个账单。 |
|
|
|
List<WxBillFeesStandardsListVo> fixedList = WxRentContractHelper.getStandardsBillList(wxPropertyContract.getFeesStardarsList(),billStartDate,billEndDate,true); |
|
|
|
|
|
|
|
|
|
|
|
int index = 0; |
|
|
|
@@ -688,6 +683,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
//计算金额 |
|
|
|
String needpay = "0"; |
|
|
|
String standarsTotal = "0"; |
|
|
|
|
|
|
|
//非一次性费用的,跟随物业账单的周期 |
|
|
|
List<WxBillFeesStandardsListVo> unFixedList = WxRentContractHelper.getStandardsBillList(wxPropertyContract.getFeesStardarsList(),billStartDate,billEndDate,true); |
|
|
|
|
|
|
|
|
|
|
|
boolean flag = false; |
|
|
|
//超过1年 |
|
|
|
@@ -734,39 +733,41 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
} |
|
|
|
|
|
|
|
++billcount; |
|
|
|
//物业主账单 |
|
|
|
WxBillProperty wxBillProperty = generateBillProperty(wxPayAccountBill,wxPropertyContract,isPreview,billTimeVo.getStartDate(),billTimeVo.getEndDate(),billTimeVo.getReceiveDate(),needpay,userId,billcount,shopInfo,standarsTotal,""); |
|
|
|
//非一次性账单 |
|
|
|
wxBillProperty.setUnFixedbillFeesStandardsList(unFixedList); |
|
|
|
|
|
|
|
resultList.add(wxBillProperty); |
|
|
|
//每个非从一次性都要创建账单 |
|
|
|
if (null != unFixedList) { |
|
|
|
for (int j = 0 ; j < unFixedList.size(); j ++ ) { |
|
|
|
WxBillFeesStandardsListVo svo = unFixedList.get(j); |
|
|
|
WxBillProperty property = generateBillPropertyByBillStandards(wxPayAccountBill,wxPropertyContract,isPreview,userId,svo,billcount,shopInfo); |
|
|
|
allResultList.add(property); |
|
|
|
} |
|
|
|
} |
|
|
|
//主账单列表 |
|
|
|
propertyResultList.add(wxBillProperty); |
|
|
|
//所有账单列表 |
|
|
|
allResultList.add(wxBillProperty); |
|
|
|
} |
|
|
|
|
|
|
|
if (null != fixedList) { |
|
|
|
for (int i = 0 ; i < fixedList.size(); i ++ ) { |
|
|
|
WxBillFeesStandardsListVo svo = fixedList.get(i); |
|
|
|
++billcount; |
|
|
|
WxBillProperty property = generateBillPropertyByBillStandards(wxPayAccountBill,wxPropertyContract,isPreview,userId,svo,billcount,shopInfo); |
|
|
|
resultList.add(property); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (null != unFixedList) { |
|
|
|
for (int i = 0 ; i < unFixedList.size(); i ++ ) { |
|
|
|
WxBillFeesStandardsListVo svo = unFixedList.get(i); |
|
|
|
++billcount; |
|
|
|
WxBillProperty property = generateBillPropertyByBillStandards(wxPayAccountBill,wxPropertyContract,isPreview,userId,svo,billcount,shopInfo); |
|
|
|
resultList.add(property); |
|
|
|
allResultList.add(property); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//批量生成预账单 |
|
|
|
if(saveDb && resultList.size() > 0 ) { |
|
|
|
wxBillPropertyMapper.insertBills(resultList); |
|
|
|
if(saveDb && allResultList.size() > 0 ) { |
|
|
|
wxBillPropertyMapper.insertBills(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; |
|
|
|
} |
|
|
|
|
|
|
|
|