|
|
|
@@ -45,6 +45,7 @@ import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
@@ -103,6 +104,10 @@ public class WxBillAllController extends BaseController { |
|
|
|
wxMerchant.setFloorForRule(dataRule.getFloorIds()); |
|
|
|
wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); |
|
|
|
} |
|
|
|
Date starttime = wxMerchant.getStarttime(); |
|
|
|
Date enttime = wxMerchant.getEndtime(); |
|
|
|
wxMerchant.setStarttime(null); |
|
|
|
wxMerchant.setEndtime(null); |
|
|
|
PageInfo<WxMerchant> merchantPage = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); |
|
|
|
if (null != merchantPage && null != merchantPage.getList() && merchantPage.getList().size() > 0 ) { |
|
|
|
List<WxMerchantBillVo> retList = new ArrayList<WxMerchantBillVo>(); |
|
|
|
@@ -114,51 +119,75 @@ public class WxBillAllController extends BaseController { |
|
|
|
|
|
|
|
WxBillRent br = new WxBillRent(); |
|
|
|
br.updateTenantInfo(wxMerchant); |
|
|
|
br.setStarttime(wxMerchant.getStarttime()); |
|
|
|
br.setEndtime(wxMerchant.getEndtime()); |
|
|
|
br.setStarttime(starttime); |
|
|
|
br.setEndtime(enttime); |
|
|
|
WxBillSum rentSum = wxBillRentService.getBillMonthSum(br); |
|
|
|
if (null == rentSum) { |
|
|
|
rentSum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillRentManage brm = new WxBillRentManage(); |
|
|
|
brm.updateTenantInfo(wxMerchant); |
|
|
|
brm.setStarttime(wxMerchant.getStarttime()); |
|
|
|
brm.setEndtime(wxMerchant.getEndtime()); |
|
|
|
brm.setStarttime(starttime); |
|
|
|
brm.setEndtime(enttime); |
|
|
|
WxBillSum rentManageSum = wxBillRentManageService.getBillMonthSum(brm); |
|
|
|
if (null == rentManageSum) { |
|
|
|
rentManageSum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillDeposit bd = new WxBillDeposit(); |
|
|
|
bd.updateTenantInfo(wxMerchant); |
|
|
|
bd.setStarttime(wxMerchant.getStarttime()); |
|
|
|
bd.setEndtime(wxMerchant.getEndtime()); |
|
|
|
bd.setStarttime(starttime); |
|
|
|
bd.setEndtime(enttime); |
|
|
|
WxBillSum rentDepositSum = wxBillRentDepositService.getBillMonthSum(bd); |
|
|
|
if (null == rentDepositSum) { |
|
|
|
rentDepositSum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillProperty bp = new WxBillProperty(); |
|
|
|
bp.updateTenantInfo(wxMerchant); |
|
|
|
bp.setStarttime(wxMerchant.getStarttime()); |
|
|
|
bp.setEndtime(wxMerchant.getEndtime()); |
|
|
|
bp.setStarttime(starttime); |
|
|
|
bp.setEndtime(enttime); |
|
|
|
WxBillSum propertySum = wxBillPropertyService.getBillMonthSum(bp); |
|
|
|
if (null == propertySum) { |
|
|
|
propertySum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); |
|
|
|
pd.updateTenantInfo(wxMerchant); |
|
|
|
pd.setStarttime(wxMerchant.getStarttime()); |
|
|
|
pd.setEndtime(wxMerchant.getEndtime()); |
|
|
|
pd.setStarttime(starttime); |
|
|
|
pd.setEndtime(enttime); |
|
|
|
WxBillSum propertyDepositSum = wxBillPropertyDepositService.getBillMonthSum(pd); |
|
|
|
if (null == propertyDepositSum) { |
|
|
|
propertyDepositSum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillDaily bdd = new WxBillDaily(); |
|
|
|
bdd.updateTenantInfo(wxMerchant); |
|
|
|
bdd.setStarttime(wxMerchant.getStarttime()); |
|
|
|
bdd.setEndtime(wxMerchant.getEndtime()); |
|
|
|
bdd.setStarttime(starttime); |
|
|
|
bdd.setEndtime(enttime); |
|
|
|
WxBillSum dailySum = wxBillDailyService.getBillMonthSum(bdd); |
|
|
|
if (null == dailySum) { |
|
|
|
dailySum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillOther bo = new WxBillOther(); |
|
|
|
bo.updateTenantInfo(wxMerchant); |
|
|
|
bo.setStarttime(wxMerchant.getStarttime()); |
|
|
|
bo.setEndtime(wxMerchant.getEndtime()); |
|
|
|
bo.setStarttime(starttime); |
|
|
|
bo.setEndtime(enttime); |
|
|
|
WxBillSum otherSum = wxBillOtherService.getBillMonthSum(bo); |
|
|
|
if (null == otherSum) { |
|
|
|
otherSum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
WxBillOtherDeposit bod = new WxBillOtherDeposit(); |
|
|
|
bod.updateTenantInfo(wxMerchant); |
|
|
|
bod.setStarttime(wxMerchant.getStarttime()); |
|
|
|
bod.setEndtime(wxMerchant.getEndtime()); |
|
|
|
bod.setStarttime(starttime); |
|
|
|
bod.setEndtime(enttime); |
|
|
|
WxBillSum otherDepositSum = wxBillOtherDepositService.getBillMonthSum(bod); |
|
|
|
if (null == otherDepositSum) { |
|
|
|
otherDepositSum = new WxBillSum(); |
|
|
|
} |
|
|
|
|
|
|
|
vo.setNeedPay(calcuteSum(rentSum.getNeedPay(),rentManageSum.getNeedPay(),rentDepositSum.getNeedPay(),propertySum.getNeedPay(), |
|
|
|
propertyDepositSum.getNeedPay(),dailySum.getNeedPay(),otherSum.getNeedPay(),otherDepositSum.getNeedPay())); |
|
|
|
@@ -166,6 +195,7 @@ public class WxBillAllController extends BaseController { |
|
|
|
propertyDepositSum.getPaid(),dailySum.getPaid(),otherSum.getPaid(),otherDepositSum.getPaid())); |
|
|
|
vo.setOwe(calcuteSum(rentSum.getOwe(),rentManageSum.getOwe(),rentDepositSum.getOwe(),propertySum.getOwe(), |
|
|
|
propertyDepositSum.getOwe(),dailySum.getOwe(),otherSum.getOwe(),otherDepositSum.getOwe())); |
|
|
|
|
|
|
|
retList.add(vo); |
|
|
|
} |
|
|
|
return new ResultData(retList); |
|
|
|
|