|
|
|
@@ -65,12 +65,13 @@ public class WxBillAllHelper { |
|
|
|
@Autowired |
|
|
|
private WxShopService wxShopService; |
|
|
|
|
|
|
|
public WxBillSum getBillRentSum(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillRentSum(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillRent br = new WxBillRent(); |
|
|
|
br.updateTenantInfo(tenantEntity); |
|
|
|
br.updateTenantInfo(wxMerchant); |
|
|
|
br.setStarttime(starttime); |
|
|
|
br.setEndtime(enttime); |
|
|
|
br.setOnlyOwe(onlyOwe); |
|
|
|
br.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
br.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum rentSum = wxBillRentService.getBillMonthSum(br); |
|
|
|
if (null == rentSum) { |
|
|
|
rentSum = new WxBillSum(); |
|
|
|
@@ -79,22 +80,24 @@ public class WxBillAllHelper { |
|
|
|
return rentSum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillRentMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillRentMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillRent br = new WxBillRent(); |
|
|
|
br.updateTenantInfo(tenantEntity); |
|
|
|
br.updateTenantInfo(wxMerchant); |
|
|
|
br.setStarttime(starttime); |
|
|
|
br.setEndtime(enttime); |
|
|
|
br.setOnlyOwe(onlyOwe); |
|
|
|
br.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
br.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillRentService.getMerchantIds(br); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillRentManage(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe,Integer manageFeeType) { |
|
|
|
public WxBillSum getBillRentManage(WxMerchant wxMerchant,Date starttime, Date enttime,Integer manageFeeType) { |
|
|
|
WxBillRentManage brm = new WxBillRentManage(); |
|
|
|
brm.updateTenantInfo(tenantEntity); |
|
|
|
brm.updateTenantInfo(wxMerchant); |
|
|
|
brm.setStarttime(starttime); |
|
|
|
brm.setEndtime(enttime); |
|
|
|
brm.setOnlyOwe(onlyOwe); |
|
|
|
brm.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
brm.setManageFeeType(manageFeeType); |
|
|
|
brm.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum rentManageSum = wxBillRentManageService.getBillMonthSum(brm); |
|
|
|
if (null == rentManageSum) { |
|
|
|
rentManageSum = new WxBillSum(); |
|
|
|
@@ -103,22 +106,24 @@ public class WxBillAllHelper { |
|
|
|
return rentManageSum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillRentManageMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe,Integer manageFeeType) { |
|
|
|
public List<Long> getBillRentManageMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime,Integer manageFeeType) { |
|
|
|
WxBillRentManage brm = new WxBillRentManage(); |
|
|
|
brm.updateTenantInfo(tenantEntity); |
|
|
|
brm.updateTenantInfo(wxMerchant); |
|
|
|
brm.setStarttime(starttime); |
|
|
|
brm.setEndtime(enttime); |
|
|
|
brm.setOnlyOwe(onlyOwe); |
|
|
|
brm.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
brm.setManageFeeType(manageFeeType); |
|
|
|
brm.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillRentManageService.getMerchantIds(brm); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillDeposit(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillDeposit(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillDeposit bd = new WxBillDeposit(); |
|
|
|
bd.updateTenantInfo(tenantEntity); |
|
|
|
bd.updateTenantInfo(wxMerchant); |
|
|
|
bd.setStarttime(starttime); |
|
|
|
bd.setEndtime(enttime); |
|
|
|
bd.setOnlyOwe(onlyOwe); |
|
|
|
bd.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bd.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum rentDepositSum = wxBillRentDepositService.getBillMonthSum(bd); |
|
|
|
if (null == rentDepositSum) { |
|
|
|
rentDepositSum = new WxBillSum(); |
|
|
|
@@ -127,21 +132,23 @@ public class WxBillAllHelper { |
|
|
|
return rentDepositSum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillDepositMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillDepositMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillDeposit bd = new WxBillDeposit(); |
|
|
|
bd.updateTenantInfo(tenantEntity); |
|
|
|
bd.updateTenantInfo(wxMerchant); |
|
|
|
bd.setStarttime(starttime); |
|
|
|
bd.setEndtime(enttime); |
|
|
|
bd.setOnlyOwe(onlyOwe); |
|
|
|
bd.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bd.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillRentDepositService.getMerchantIds(bd); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillProperty(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillProperty(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillProperty bp = new WxBillProperty(); |
|
|
|
bp.updateTenantInfo(tenantEntity); |
|
|
|
bp.updateTenantInfo(wxMerchant); |
|
|
|
bp.setStarttime(starttime); |
|
|
|
bp.setEndtime(enttime); |
|
|
|
bp.setOnlyOwe(onlyOwe); |
|
|
|
bp.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bp.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum propertySum = wxBillPropertyService.getBillMonthSum(bp); |
|
|
|
if (null == propertySum) { |
|
|
|
propertySum = new WxBillSum(); |
|
|
|
@@ -150,21 +157,23 @@ public class WxBillAllHelper { |
|
|
|
return propertySum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillPropertyMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillPropertyMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillProperty bp = new WxBillProperty(); |
|
|
|
bp.updateTenantInfo(tenantEntity); |
|
|
|
bp.updateTenantInfo(wxMerchant); |
|
|
|
bp.setStarttime(starttime); |
|
|
|
bp.setEndtime(enttime); |
|
|
|
bp.setOnlyOwe(onlyOwe); |
|
|
|
bp.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bp.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillPropertyService.getMerchantIds(bp); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillPropertyDeposit(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillPropertyDeposit(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); |
|
|
|
pd.updateTenantInfo(tenantEntity); |
|
|
|
pd.updateTenantInfo(wxMerchant); |
|
|
|
pd.setStarttime(starttime); |
|
|
|
pd.setEndtime(enttime); |
|
|
|
pd.setOnlyOwe(onlyOwe); |
|
|
|
pd.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
pd.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum propertyDepositSum = wxBillPropertyDepositService.getBillMonthSum(pd); |
|
|
|
if (null == propertyDepositSum) { |
|
|
|
propertyDepositSum = new WxBillSum(); |
|
|
|
@@ -173,21 +182,23 @@ public class WxBillAllHelper { |
|
|
|
return propertyDepositSum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillPropertyDepositMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillPropertyDepositMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); |
|
|
|
pd.updateTenantInfo(tenantEntity); |
|
|
|
pd.updateTenantInfo(wxMerchant); |
|
|
|
pd.setStarttime(starttime); |
|
|
|
pd.setEndtime(enttime); |
|
|
|
pd.setOnlyOwe(onlyOwe); |
|
|
|
pd.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
pd.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillPropertyDepositService.getMerchantIds(pd); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillDaily(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillDaily(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillDaily bdd = new WxBillDaily(); |
|
|
|
bdd.updateTenantInfo(tenantEntity); |
|
|
|
bdd.updateTenantInfo(wxMerchant); |
|
|
|
bdd.setStarttime(starttime); |
|
|
|
bdd.setEndtime(enttime); |
|
|
|
bdd.setOnlyOwe(onlyOwe); |
|
|
|
bdd.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bdd.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum dailySum = wxBillDailyService.getBillMonthSum(bdd); |
|
|
|
if (null == dailySum) { |
|
|
|
dailySum = new WxBillSum(); |
|
|
|
@@ -196,21 +207,23 @@ public class WxBillAllHelper { |
|
|
|
return dailySum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillDailyMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillDailyMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillDaily bdd = new WxBillDaily(); |
|
|
|
bdd.updateTenantInfo(tenantEntity); |
|
|
|
bdd.updateTenantInfo(wxMerchant); |
|
|
|
bdd.setStarttime(starttime); |
|
|
|
bdd.setEndtime(enttime); |
|
|
|
bdd.setOnlyOwe(onlyOwe); |
|
|
|
bdd.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bdd.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillDailyService.getMerchantIds(bdd); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillOther(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillOther(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillOther bo = new WxBillOther(); |
|
|
|
bo.updateTenantInfo(tenantEntity); |
|
|
|
bo.updateTenantInfo(wxMerchant); |
|
|
|
bo.setStarttime(starttime); |
|
|
|
bo.setEndtime(enttime); |
|
|
|
bo.setOnlyOwe(onlyOwe); |
|
|
|
bo.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bo.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum otherSum = wxBillOtherService.getBillMonthSum(bo); |
|
|
|
if (null == otherSum) { |
|
|
|
otherSum = new WxBillSum(); |
|
|
|
@@ -219,21 +232,23 @@ public class WxBillAllHelper { |
|
|
|
return otherSum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillOtherMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillOtherMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillOther bo = new WxBillOther(); |
|
|
|
bo.updateTenantInfo(tenantEntity); |
|
|
|
bo.updateTenantInfo(wxMerchant); |
|
|
|
bo.setStarttime(starttime); |
|
|
|
bo.setEndtime(enttime); |
|
|
|
bo.setOnlyOwe(onlyOwe); |
|
|
|
bo.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bo.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillOtherService.getMerchantIds(bo); |
|
|
|
} |
|
|
|
|
|
|
|
public WxBillSum getBillOtherDeposit(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public WxBillSum getBillOtherDeposit(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillOtherDeposit bod = new WxBillOtherDeposit(); |
|
|
|
bod.updateTenantInfo(tenantEntity); |
|
|
|
bod.updateTenantInfo(wxMerchant); |
|
|
|
bod.setStarttime(starttime); |
|
|
|
bod.setEndtime(enttime); |
|
|
|
bod.setOnlyOwe(onlyOwe); |
|
|
|
bod.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bod.setMerchantId(wxMerchant.getId()); |
|
|
|
WxBillSum otherDepositSum = wxBillOtherDepositService.getBillMonthSum(bod); |
|
|
|
if (null == otherDepositSum) { |
|
|
|
otherDepositSum = new WxBillSum(); |
|
|
|
@@ -242,12 +257,13 @@ public class WxBillAllHelper { |
|
|
|
return otherDepositSum; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getBillOtherDepositMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { |
|
|
|
public List<Long> getBillOtherDepositMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
WxBillOtherDeposit bod = new WxBillOtherDeposit(); |
|
|
|
bod.updateTenantInfo(tenantEntity); |
|
|
|
bod.updateTenantInfo(wxMerchant); |
|
|
|
bod.setStarttime(starttime); |
|
|
|
bod.setEndtime(enttime); |
|
|
|
bod.setOnlyOwe(onlyOwe); |
|
|
|
bod.setOnlyOwe(wxMerchant.getOnlyOwe()); |
|
|
|
bod.setMerchantId(wxMerchant.getId()); |
|
|
|
return wxBillOtherDepositService.getMerchantIds(bod); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -259,7 +275,7 @@ public class WxBillAllHelper { |
|
|
|
if (StringUtils.isBlank(_m)) { |
|
|
|
_m = "0"; |
|
|
|
} |
|
|
|
total.add(new BigDecimal(_m)); |
|
|
|
total = total.add(new BigDecimal(_m)); |
|
|
|
} |
|
|
|
return total.setScale(2,RoundingMode.HALF_UP).toPlainString(); |
|
|
|
} |
|
|
|
@@ -279,15 +295,15 @@ public class WxBillAllHelper { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> getOwdMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime) { |
|
|
|
List<Long> rentMids = this.getBillRentMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
List<Long> rentManageMids = this.getBillRentManageMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode(), null); |
|
|
|
List<Long> rentDepositMids = this.getBillDepositMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
List<Long> propertyMids = this.getBillPropertyMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
List<Long> propertyDepositMids = this.getBillPropertyDepositMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
List<Long> dailyMids = this.getBillDailyMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
List<Long> otherMids = this.getBillOtherMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
List<Long> otherDepositMids = this.getBillOtherDepositMerchantIds(tenantEntity, starttime, enttime, EnumYesOrNo.YES.getCode()); |
|
|
|
public List<Long> getOwdMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) { |
|
|
|
List<Long> rentMids = this.getBillRentMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
List<Long> rentManageMids = this.getBillRentManageMerchantIds(wxMerchant, starttime, enttime,null); |
|
|
|
List<Long> rentDepositMids = this.getBillDepositMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
List<Long> propertyMids = this.getBillPropertyMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
List<Long> propertyDepositMids = this.getBillPropertyDepositMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
List<Long> dailyMids = this.getBillDailyMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
List<Long> otherMids = this.getBillOtherMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
List<Long> otherDepositMids = this.getBillOtherDepositMerchantIds(wxMerchant, starttime, enttime); |
|
|
|
return getUnionIds(rentMids,rentManageMids,rentDepositMids,propertyMids,propertyDepositMids,dailyMids,otherMids,otherDepositMids); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -297,7 +313,8 @@ public class WxBillAllHelper { |
|
|
|
for (int i = 0 ; i < lists.length; i++) { |
|
|
|
List<Long> list = lists[i]; |
|
|
|
if (null != list) { |
|
|
|
retList = (List<Long>) CollectionUtils.union(retList, list); |
|
|
|
retList.removeAll(list); |
|
|
|
retList.addAll(list); |
|
|
|
} |
|
|
|
} |
|
|
|
return retList; |
|
|
|
|