| @@ -26,6 +26,7 @@ import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.domain.vo.WxMerchantBillVo; | |||
| import com.iformall.domain.vo.WxMerchantMicroPayVo; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBillAllService; | |||
| import com.iformall.service.WxBillDailyService; | |||
| @@ -102,7 +103,15 @@ public class WxBillAllController extends BaseController { | |||
| Date starttime = wxMerchant.getStarttime(); | |||
| Date enttime = wxMerchant.getEndtime(); | |||
| wxMerchant.setStarttime(null); | |||
| wxMerchant.setEndtime(null); | |||
| wxMerchant.setEndtime(null); | |||
| if (null != wxMerchant.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxMerchant.getOnlyOwe().intValue()) { | |||
| List<Long> mids = billAllHelper.getOwdMerchantIds(wxMerchant, starttime, enttime); | |||
| if (null != mids && mids.size() > 0 ) { | |||
| wxMerchant.setIds(mids);; | |||
| }else { | |||
| wxMerchant.setId(-1L); | |||
| } | |||
| } | |||
| PageInfo<WxMerchant> merchantPage = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | |||
| if (null != merchantPage && null != merchantPage.getList() && merchantPage.getList().size() > 0 ) { | |||
| List<WxMerchantBillVo> retList = new ArrayList<WxMerchantBillVo>(); | |||
| @@ -113,14 +122,14 @@ public class WxBillAllController extends BaseController { | |||
| vo.setMerchantName(m.getName()); | |||
| vo.setShopNumber(billAllHelper.getMerchantShopNumber(m)); | |||
| WxBillSum rentSum = billAllHelper.getBillRentSum(wxMerchant,starttime, enttime); | |||
| WxBillSum rentManageSum = billAllHelper.getBillRentManage(wxMerchant, starttime, enttime); | |||
| WxBillSum rentDepositSum = billAllHelper.getBillDeposit(wxMerchant, starttime, enttime); | |||
| WxBillSum propertySum = billAllHelper.getBillProperty(wxMerchant, starttime, enttime); | |||
| WxBillSum propertyDepositSum = billAllHelper.getBillPropertyDeposit(wxMerchant, starttime, enttime); | |||
| WxBillSum dailySum = billAllHelper.getBillDaily(wxMerchant, starttime, enttime); | |||
| WxBillSum otherSum = billAllHelper.getBillOther(wxMerchant, starttime, enttime); | |||
| WxBillSum otherDepositSum = billAllHelper.getBillOtherDeposit(wxMerchant, starttime, enttime); | |||
| WxBillSum rentSum = billAllHelper.getBillRentSum(wxMerchant,starttime, enttime,null); | |||
| WxBillSum rentManageSum = billAllHelper.getBillRentManage(wxMerchant, starttime, enttime,null,null); | |||
| WxBillSum rentDepositSum = billAllHelper.getBillDeposit(wxMerchant, starttime, enttime,null); | |||
| WxBillSum propertySum = billAllHelper.getBillProperty(wxMerchant, starttime, enttime,null); | |||
| WxBillSum propertyDepositSum = billAllHelper.getBillPropertyDeposit(wxMerchant, starttime, enttime,null); | |||
| WxBillSum dailySum = billAllHelper.getBillDaily(wxMerchant, starttime, enttime,null); | |||
| WxBillSum otherSum = billAllHelper.getBillOther(wxMerchant, starttime, enttime,null); | |||
| WxBillSum otherDepositSum = billAllHelper.getBillOtherDeposit(wxMerchant, starttime, enttime,null); | |||
| vo.setNeedPay(billAllHelper.calcuteSum(rentSum.getNeedPay(),rentManageSum.getNeedPay(),rentDepositSum.getNeedPay(),propertySum.getNeedPay(), | |||
| propertyDepositSum.getNeedPay(),dailySum.getNeedPay(),otherSum.getNeedPay(),otherDepositSum.getNeedPay())); | |||
| @@ -176,14 +185,14 @@ public class WxBillAllController extends BaseController { | |||
| vo.setMerchantName(m.getName()); | |||
| vo.setShopNumber(billAllHelper.getMerchantShopNumber(m)); | |||
| WxBillSum rentSum = billAllHelper.getBillRentSum(wxMerchant,starttime, enttime); | |||
| WxBillSum rentManageSum = billAllHelper.getBillRentManage(wxMerchant, starttime, enttime); | |||
| WxBillSum rentDepositSum = billAllHelper.getBillDeposit(wxMerchant, starttime, enttime); | |||
| WxBillSum propertySum = billAllHelper.getBillProperty(wxMerchant, starttime, enttime); | |||
| WxBillSum propertyDepositSum = billAllHelper.getBillPropertyDeposit(wxMerchant, starttime, enttime); | |||
| WxBillSum dailySum = billAllHelper.getBillDaily(wxMerchant, starttime, enttime); | |||
| WxBillSum otherSum = billAllHelper.getBillOther(wxMerchant, starttime, enttime); | |||
| WxBillSum otherDepositSum = billAllHelper.getBillOtherDeposit(wxMerchant, starttime, enttime); | |||
| WxBillSum rentSum = billAllHelper.getBillRentSum(wxMerchant,starttime, enttime,null); | |||
| WxBillSum rentManageSum = billAllHelper.getBillRentManage(wxMerchant, starttime, enttime,null,null); | |||
| WxBillSum rentDepositSum = billAllHelper.getBillDeposit(wxMerchant, starttime, enttime,null); | |||
| WxBillSum propertySum = billAllHelper.getBillProperty(wxMerchant, starttime, enttime,null); | |||
| WxBillSum propertyDepositSum = billAllHelper.getBillPropertyDeposit(wxMerchant, starttime, enttime,null); | |||
| WxBillSum dailySum = billAllHelper.getBillDaily(wxMerchant, starttime, enttime,null); | |||
| WxBillSum otherSum = billAllHelper.getBillOther(wxMerchant, starttime, enttime,null); | |||
| WxBillSum otherDepositSum = billAllHelper.getBillOtherDeposit(wxMerchant, starttime, enttime,null); | |||
| vo.setNeedPay(billAllHelper.calcuteSum(rentSum.getNeedPay(),rentManageSum.getNeedPay(),rentDepositSum.getNeedPay(),propertySum.getNeedPay(), | |||
| propertyDepositSum.getNeedPay(),dailySum.getNeedPay(),otherSum.getNeedPay(),otherDepositSum.getNeedPay())); | |||
| @@ -206,6 +215,34 @@ public class WxBillAllController extends BaseController { | |||
| return new ResultData(vo); | |||
| } | |||
| /** | |||
| * 欠缴商户列表 | |||
| * @param wxBillAll | |||
| * @param pageNum | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| @GetMapping("oweBillList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| @SystemControllerLog(description = "费用收缴数据-欠缴商户列表") | |||
| public ResultData oweBillList(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::oweMerchantlist"); | |||
| if (null == wxBillAll) { | |||
| wxBillAll = new WxBillAll(); | |||
| } | |||
| //默认查当月第一天到今天 | |||
| if(StringUtils.isNotBlank(wxBillAll.getEndtime())){ | |||
| wxBillAll.setEndtime(wxBillAll.getEndtime()+" 23:59:59"); | |||
| } | |||
| wxBillAll.updateTenantInfo(getTenantInfo()); | |||
| Map<String, Object> result = wxBillAllService.getOweBillAsPage(wxBillAll, pageNum, pageSize); | |||
| return new ResultData(result); | |||
| } | |||
| /** | |||
| * 欠缴商户列表 | |||
| * @param wxBillAll | |||
| @@ -444,4 +444,7 @@ public class WxMerchant extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String initLog; | |||
| @TableField(exist = false) | |||
| private Integer onlyOwe; | |||
| } | |||
| @@ -22,5 +22,7 @@ public interface WxBillDailyMapper extends CommonMapper<WxBillDaily, Long> { | |||
| List<WxBillDaily> queryBillDailyList(WxBillDaily record); | |||
| WxBillSum getBillMonthSum(WxBillDaily record); | |||
| List<Long> getMerchantIdList(WxBillDaily record); | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| @@ -33,4 +34,6 @@ public interface WxBillDepositMapper extends CommonMapper<WxBillDeposit, Long> { | |||
| WxBillSum getBillMonthSum(WxBillDeposit wxBillDeposit); | |||
| List<Long> getMerchantIdList(WxBillDeposit wxBillDeposit); | |||
| } | |||
| @@ -22,5 +22,7 @@ public interface WxBillOtherDepositMapper extends CommonMapper<WxBillOtherDeposi | |||
| List<WxBillOtherDeposit> queryBillList(WxBillOtherDeposit record); | |||
| WxBillSum getBillMonthSum(WxBillOtherDeposit record); | |||
| List<Long> getMerchantIdList(WxBillOtherDeposit record); | |||
| } | |||
| @@ -26,4 +26,6 @@ public interface WxBillOtherMapper extends CommonMapper<WxBillOther, Long> { | |||
| Map<String,Object> queryOweInfo(Map<String,Object> params); | |||
| WxBillSum getBillMonthSum(WxBillOther record); | |||
| List<Long> getMerchantIdList(WxBillOther record); | |||
| } | |||
| @@ -30,5 +30,5 @@ public interface WxBillPropertyDepositMapper extends CommonMapper<WxBillProperty | |||
| WxBillSum getBillMonthSum(WxBillPropertyDeposit wxBillPropertyDeposit); | |||
| List<Long> getMerchantIdList(WxBillPropertyDeposit wxBillPropertyDeposit); | |||
| } | |||
| @@ -66,5 +66,7 @@ public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, Long> | |||
| WxBillSum getBillMonthSum(WxBillProperty propertyQuery); | |||
| List<Long> getMerchantIdList(WxBillProperty propertyQuery); | |||
| } | |||
| @@ -33,5 +33,7 @@ public interface WxBillRentManageMapper extends CommonMapper<WxBillRentManage, L | |||
| void insertBills(List<WxBillRentManage> resultList); | |||
| WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); | |||
| List<Long> getMerchantIdList(WxBillRentManage wxBillRentManage); | |||
| } | |||
| @@ -62,5 +62,7 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> { | |||
| void updateOwe(); | |||
| WxBillSum getBillMonthSum(WxBillRent wxBillRent); | |||
| List<Long> getMerchantIdList(WxBillRent wxBillRent); | |||
| } | |||
| @@ -9,6 +9,8 @@ import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillDailyVo; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -62,5 +64,7 @@ public interface WxBillDailyService { | |||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillDaily wxBillDaily); | |||
| WxBillSum getBillMonthSum(WxBillDaily wxBillDaily); | |||
| List<Long> getMerchantIds(WxBillDaily wxBillDaily); | |||
| } | |||
| @@ -1,9 +1,12 @@ | |||
| package com.iformall.service; | |||
| import java.util.List; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| @@ -54,5 +57,7 @@ public interface WxBillDepositService { | |||
| void computeTotalMoney(Integer decimalSize,WxPayAccountBill wxPayAccountBill, WxBillDeposit deposit); | |||
| WxBillSum getBillMonthSum(WxBillDeposit wxBillDeposit); | |||
| List<Long> getMerchantIds(WxBillDeposit wxBillDeposit); | |||
| } | |||
| @@ -8,6 +8,8 @@ import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -61,5 +63,7 @@ public interface WxBillOtherDepositService { | |||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillOtherDeposit wxBillDeposit); | |||
| WxBillSum getBillMonthSum(WxBillOtherDeposit wxBillDeposit); | |||
| List<Long> getMerchantIds(WxBillOtherDeposit wxBillDeposit); | |||
| } | |||
| @@ -8,6 +8,8 @@ import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -57,5 +59,7 @@ public interface WxBillOtherService { | |||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillOther wxBillOther); | |||
| WxBillSum getBillMonthSum(WxBillOther wxBillOther); | |||
| List<Long> getMerchantIds(WxBillOther wxBillOther); | |||
| } | |||
| @@ -1,5 +1,7 @@ | |||
| package com.iformall.service; | |||
| import java.util.List; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| @@ -58,4 +60,6 @@ public interface WxBillPropertyDepositService { | |||
| void computeTotalMoney(Integer decimalSize,WxPayAccountBill wxPayAccountBill, WxBillPropertyDeposit deposit); | |||
| WxBillSum getBillMonthSum(WxBillPropertyDeposit deposit); | |||
| List<Long> getMerchantIds(WxBillPropertyDeposit deposit); | |||
| } | |||
| @@ -8,6 +8,8 @@ import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -72,4 +74,6 @@ public interface WxBillPropertyService { | |||
| void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillProperty wxBillProperty); | |||
| WxBillSum getBillMonthSum(WxBillProperty wxBillProperty); | |||
| List<Long> getMerchantIds(WxBillProperty wxBillProperty); | |||
| } | |||
| @@ -9,6 +9,8 @@ import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -70,4 +72,5 @@ public interface WxBillRentManageService { | |||
| WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); | |||
| List<Long> getMerchantIds(WxBillRentManage wxBillRentManage); | |||
| } | |||
| @@ -7,6 +7,8 @@ import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import java.util.List; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| @@ -73,5 +75,7 @@ public interface WxBillRentService { | |||
| WxBillSum getBillMonthSum(WxBillRent wxBillRent); | |||
| List<Long> getMerchantIds(WxBillRent wxBillRent); | |||
| } | |||
| @@ -2,9 +2,12 @@ package com.iformall.service.helper; | |||
| import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.util.ArrayList; | |||
| import java.util.Collection; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| @@ -21,6 +24,7 @@ import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxBillSum; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.WxBillDailyService; | |||
| import com.iformall.service.WxBillDepositService; | |||
| import com.iformall.service.WxBillOtherDepositService; | |||
| @@ -29,7 +33,6 @@ import com.iformall.service.WxBillPropertyDepositService; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxBillRentManageService; | |||
| import com.iformall.service.WxBillRentService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxShopService; | |||
| @Service | |||
| @@ -62,11 +65,12 @@ public class WxBillAllHelper { | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| public WxBillSum getBillRentSum(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public WxBillSum getBillRentSum(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillRent br = new WxBillRent(); | |||
| br.updateTenantInfo(tenantEntity); | |||
| br.setStarttime(starttime); | |||
| br.setEndtime(enttime); | |||
| br.setOnlyOwe(onlyOwe); | |||
| WxBillSum rentSum = wxBillRentService.getBillMonthSum(br); | |||
| if (null == rentSum) { | |||
| rentSum = new WxBillSum(); | |||
| @@ -75,11 +79,22 @@ public class WxBillAllHelper { | |||
| return rentSum; | |||
| } | |||
| public WxBillSum getBillRentManage(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillRentMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillRent br = new WxBillRent(); | |||
| br.updateTenantInfo(tenantEntity); | |||
| br.setStarttime(starttime); | |||
| br.setEndtime(enttime); | |||
| br.setOnlyOwe(onlyOwe); | |||
| return wxBillRentService.getMerchantIds(br); | |||
| } | |||
| public WxBillSum getBillRentManage(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe,Integer manageFeeType) { | |||
| WxBillRentManage brm = new WxBillRentManage(); | |||
| brm.updateTenantInfo(tenantEntity); | |||
| brm.setStarttime(starttime); | |||
| brm.setEndtime(enttime); | |||
| brm.setOnlyOwe(onlyOwe); | |||
| brm.setManageFeeType(manageFeeType); | |||
| WxBillSum rentManageSum = wxBillRentManageService.getBillMonthSum(brm); | |||
| if (null == rentManageSum) { | |||
| rentManageSum = new WxBillSum(); | |||
| @@ -88,11 +103,22 @@ public class WxBillAllHelper { | |||
| return rentManageSum; | |||
| } | |||
| public WxBillSum getBillDeposit(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillRentManageMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe,Integer manageFeeType) { | |||
| WxBillRentManage brm = new WxBillRentManage(); | |||
| brm.updateTenantInfo(tenantEntity); | |||
| brm.setStarttime(starttime); | |||
| brm.setEndtime(enttime); | |||
| brm.setOnlyOwe(onlyOwe); | |||
| brm.setManageFeeType(manageFeeType); | |||
| return wxBillRentManageService.getMerchantIds(brm); | |||
| } | |||
| public WxBillSum getBillDeposit(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillDeposit bd = new WxBillDeposit(); | |||
| bd.updateTenantInfo(tenantEntity); | |||
| bd.setStarttime(starttime); | |||
| bd.setEndtime(enttime); | |||
| bd.setOnlyOwe(onlyOwe); | |||
| WxBillSum rentDepositSum = wxBillRentDepositService.getBillMonthSum(bd); | |||
| if (null == rentDepositSum) { | |||
| rentDepositSum = new WxBillSum(); | |||
| @@ -101,11 +127,21 @@ public class WxBillAllHelper { | |||
| return rentDepositSum; | |||
| } | |||
| public WxBillSum getBillProperty(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillDepositMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillDeposit bd = new WxBillDeposit(); | |||
| bd.updateTenantInfo(tenantEntity); | |||
| bd.setStarttime(starttime); | |||
| bd.setEndtime(enttime); | |||
| bd.setOnlyOwe(onlyOwe); | |||
| return wxBillRentDepositService.getMerchantIds(bd); | |||
| } | |||
| public WxBillSum getBillProperty(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillProperty bp = new WxBillProperty(); | |||
| bp.updateTenantInfo(tenantEntity); | |||
| bp.setStarttime(starttime); | |||
| bp.setEndtime(enttime); | |||
| bp.setOnlyOwe(onlyOwe); | |||
| WxBillSum propertySum = wxBillPropertyService.getBillMonthSum(bp); | |||
| if (null == propertySum) { | |||
| propertySum = new WxBillSum(); | |||
| @@ -114,11 +150,21 @@ public class WxBillAllHelper { | |||
| return propertySum; | |||
| } | |||
| public WxBillSum getBillPropertyDeposit(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillPropertyMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillProperty bp = new WxBillProperty(); | |||
| bp.updateTenantInfo(tenantEntity); | |||
| bp.setStarttime(starttime); | |||
| bp.setEndtime(enttime); | |||
| bp.setOnlyOwe(onlyOwe); | |||
| return wxBillPropertyService.getMerchantIds(bp); | |||
| } | |||
| public WxBillSum getBillPropertyDeposit(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); | |||
| pd.updateTenantInfo(tenantEntity); | |||
| pd.setStarttime(starttime); | |||
| pd.setEndtime(enttime); | |||
| pd.setOnlyOwe(onlyOwe); | |||
| WxBillSum propertyDepositSum = wxBillPropertyDepositService.getBillMonthSum(pd); | |||
| if (null == propertyDepositSum) { | |||
| propertyDepositSum = new WxBillSum(); | |||
| @@ -127,11 +173,21 @@ public class WxBillAllHelper { | |||
| return propertyDepositSum; | |||
| } | |||
| public WxBillSum getBillDaily(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillPropertyDepositMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); | |||
| pd.updateTenantInfo(tenantEntity); | |||
| pd.setStarttime(starttime); | |||
| pd.setEndtime(enttime); | |||
| pd.setOnlyOwe(onlyOwe); | |||
| return wxBillPropertyDepositService.getMerchantIds(pd); | |||
| } | |||
| public WxBillSum getBillDaily(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillDaily bdd = new WxBillDaily(); | |||
| bdd.updateTenantInfo(tenantEntity); | |||
| bdd.setStarttime(starttime); | |||
| bdd.setEndtime(enttime); | |||
| bdd.setOnlyOwe(onlyOwe); | |||
| WxBillSum dailySum = wxBillDailyService.getBillMonthSum(bdd); | |||
| if (null == dailySum) { | |||
| dailySum = new WxBillSum(); | |||
| @@ -140,11 +196,21 @@ public class WxBillAllHelper { | |||
| return dailySum; | |||
| } | |||
| public WxBillSum getBillOther(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillDailyMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillDaily bdd = new WxBillDaily(); | |||
| bdd.updateTenantInfo(tenantEntity); | |||
| bdd.setStarttime(starttime); | |||
| bdd.setEndtime(enttime); | |||
| bdd.setOnlyOwe(onlyOwe); | |||
| return wxBillDailyService.getMerchantIds(bdd); | |||
| } | |||
| public WxBillSum getBillOther(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillOther bo = new WxBillOther(); | |||
| bo.updateTenantInfo(tenantEntity); | |||
| bo.setStarttime(starttime); | |||
| bo.setEndtime(enttime); | |||
| bo.setEndtime(enttime); | |||
| bo.setOnlyOwe(onlyOwe); | |||
| WxBillSum otherSum = wxBillOtherService.getBillMonthSum(bo); | |||
| if (null == otherSum) { | |||
| otherSum = new WxBillSum(); | |||
| @@ -153,11 +219,21 @@ public class WxBillAllHelper { | |||
| return otherSum; | |||
| } | |||
| public WxBillSum getBillOtherDeposit(TenantEntity tenantEntity,Date starttime, Date enttime) { | |||
| public List<Long> getBillOtherMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillOther bo = new WxBillOther(); | |||
| bo.updateTenantInfo(tenantEntity); | |||
| bo.setStarttime(starttime); | |||
| bo.setEndtime(enttime); | |||
| bo.setOnlyOwe(onlyOwe); | |||
| return wxBillOtherService.getMerchantIds(bo); | |||
| } | |||
| public WxBillSum getBillOtherDeposit(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillOtherDeposit bod = new WxBillOtherDeposit(); | |||
| bod.updateTenantInfo(tenantEntity); | |||
| bod.setStarttime(starttime); | |||
| bod.setEndtime(enttime); | |||
| bod.setEndtime(enttime); | |||
| bod.setOnlyOwe(onlyOwe); | |||
| WxBillSum otherDepositSum = wxBillOtherDepositService.getBillMonthSum(bod); | |||
| if (null == otherDepositSum) { | |||
| otherDepositSum = new WxBillSum(); | |||
| @@ -166,6 +242,15 @@ public class WxBillAllHelper { | |||
| return otherDepositSum; | |||
| } | |||
| public List<Long> getBillOtherDepositMerchantIds(TenantEntity tenantEntity,Date starttime, Date enttime,Integer onlyOwe) { | |||
| WxBillOtherDeposit bod = new WxBillOtherDeposit(); | |||
| bod.updateTenantInfo(tenantEntity); | |||
| bod.setStarttime(starttime); | |||
| bod.setEndtime(enttime); | |||
| bod.setOnlyOwe(onlyOwe); | |||
| return wxBillOtherDepositService.getMerchantIds(bod); | |||
| } | |||
| public String calcuteSum(String... money) { | |||
| if (null != money) { | |||
| BigDecimal total = new BigDecimal(0); | |||
| @@ -193,4 +278,30 @@ 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()); | |||
| return getUnionIds(rentMids,rentManageMids,rentDepositMids,propertyMids,propertyDepositMids,dailyMids,otherMids,otherDepositMids); | |||
| } | |||
| private List<Long> getUnionIds(List<Long>...lists ) { | |||
| if (null != lists && lists.length > 0 ) { | |||
| List<Long> retList = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < lists.length; i++) { | |||
| List<Long> list = lists[i]; | |||
| if (null != list) { | |||
| retList = (List<Long>) CollectionUtils.union(retList, list); | |||
| } | |||
| } | |||
| return retList; | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -463,5 +463,11 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| updateQueryParam(record); | |||
| return wxBillDailyMapper.getBillMonthSum(record); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillDaily record) { | |||
| updateQueryParam(record); | |||
| return wxBillDailyMapper.getMerchantIdList(record); | |||
| } | |||
| } | |||
| @@ -11,6 +11,7 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.domain.po.WxShop; | |||
| @@ -368,6 +369,12 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| setQueryParam(wxBillDeposit); | |||
| return wxBillDepositMapper.getBillMonthSum(wxBillDeposit); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillDeposit wxBillDeposit) { | |||
| setQueryParam(wxBillDeposit); | |||
| return wxBillDepositMapper.getMerchantIdList(wxBillDeposit); | |||
| } | |||
| } | |||
| @@ -426,5 +426,11 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||
| updateQueryParam(wxBillDeposit); | |||
| return wxBillOtherDepositMapper.getBillMonthSum(wxBillDeposit); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillOtherDeposit wxBillDeposit) { | |||
| updateQueryParam(wxBillDeposit); | |||
| return wxBillOtherDepositMapper.getMerchantIdList(wxBillDeposit); | |||
| } | |||
| } | |||
| @@ -370,4 +370,10 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||
| updateQueryParam(wxBillOther); | |||
| return wxBillOtherMapper.getBillMonthSum(wxBillOther); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillOther wxBillOther) { | |||
| updateQueryParam(wxBillOther); | |||
| return wxBillOtherMapper.getMerchantIdList(wxBillOther); | |||
| } | |||
| } | |||
| @@ -11,6 +11,7 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillDeposit; | |||
| import com.iformall.domain.po.WxBillPropertyDeposit; | |||
| import com.iformall.domain.po.WxBillRent; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPayAccountBill; | |||
| import com.iformall.domain.po.WxShop; | |||
| @@ -366,6 +367,12 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| updateQueryParam(deposit); | |||
| return wxBillPropertyDepositMapper.getBillMonthSum(deposit); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillPropertyDeposit deposit) { | |||
| updateQueryParam(deposit); | |||
| return wxBillPropertyDepositMapper.getMerchantIdList(deposit); | |||
| } | |||
| } | |||
| @@ -516,4 +516,10 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| updateQueryParam(wxBillProperty); | |||
| return wxBillPropertyMapper.getBillMonthSum(wxBillProperty); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillProperty wxBillProperty) { | |||
| updateQueryParam(wxBillProperty); | |||
| return wxBillPropertyMapper.getMerchantIdList(wxBillProperty); | |||
| } | |||
| } | |||
| @@ -433,5 +433,11 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { | |||
| updateQueryParam(wxBillRentManage); | |||
| return wxBillRentManageMapper.getBillMonthSum(wxBillRentManage); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillRentManage wxBillRentManage) { | |||
| updateQueryParam(wxBillRentManage); | |||
| return wxBillRentManageMapper.getMerchantIdList(wxBillRentManage); | |||
| } | |||
| } | |||
| @@ -602,4 +602,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| updateQueryParam(wxBillRent); | |||
| return wxBillRentMapper.getBillMonthSum(wxBillRent); | |||
| } | |||
| @Override | |||
| public List<Long> getMerchantIds(WxBillRent wxBillRent) { | |||
| updateQueryParam(wxBillRent); | |||
| return wxBillRentMapper.getMerchantIdList(wxBillRent); | |||
| } | |||
| } | |||
| @@ -101,7 +101,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != buildWay ">and br.`build_way` = #{buildWay}</if> | |||
| <if test=" null != merchantIds "> | |||
| and br.`merchant_id` in | |||
| @@ -134,6 +134,11 @@ | |||
| <include refid="queryBillDailyListConditions"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillDaily" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_daily br | |||
| <include refid="queryBillDailyListConditions"/> | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_daily set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where status!=#{paid} | |||
| @@ -123,7 +123,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != merchantIds "> | |||
| and br.`merchant_id` in | |||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | |||
| @@ -142,6 +142,11 @@ | |||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxBillDeposit" resultMap="SumBaseResultMap"> | |||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_rent_deposit br | |||
| <include refid="queryBillRentListCondition"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillDeposit" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_rent_deposit br | |||
| <include refid="queryBillRentListCondition"/> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| @@ -107,7 +107,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != merchantIds "> | |||
| and br.`merchant_id` in | |||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | |||
| @@ -138,6 +138,11 @@ | |||
| <include refid="queryBillListConditions"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillOtherDeposit" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_other_deposit br | |||
| <include refid="queryBillListConditions"/> | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_other_deposit set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| where status!=#{paid} | |||
| @@ -102,7 +102,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != merchantIds "> | |||
| and br.`merchant_id` in | |||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | |||
| @@ -133,6 +133,11 @@ | |||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_other br | |||
| <include refid="queryBillListConditions"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillOther" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_other br | |||
| <include refid="queryBillListConditions"/> | |||
| </select> | |||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | |||
| update wx_bill_other set status=#{notPaid},expired_day=DATEDIFF(now(),receive_date) | |||
| @@ -113,7 +113,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != merchantIds "> | |||
| and br.`merchant_id` in | |||
| <foreach collection="merchantIds" index="index" item="midItem" open="(" separator="," close=")"> | |||
| @@ -142,6 +142,11 @@ | |||
| <include refid="queryBillDepositListConditions"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillPropertyDeposit" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_property_deposit br | |||
| <include refid="queryBillDepositListConditions"/> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL((sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property_deposit | |||
| where date_format(receive_date,'%Y-%m')=#{receiveDate} | |||
| @@ -134,7 +134,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != propertyContractId ">and br.`property_contract_id` = #{propertyContractId}</if> | |||
| <if test=" null != payWay ">and br.`pay_way` = #{payWay}</if> | |||
| @@ -183,6 +183,11 @@ | |||
| select sum(br.receive_pay) receive_pay , sum(br.pay) paid, sum(br.owe) owe from wx_bill_property br | |||
| <include refid="queryBillPropertyListConditions"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillProperty" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_property br | |||
| <include refid="queryBillPropertyListConditions"/> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_property | |||
| @@ -120,7 +120,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != manageFeeType ">and br.`manage_fee_type` = #{manageFeeType}</if> | |||
| <if test=" null != hasMerchant ">and br.`merchant_id` is not null</if> | |||
| @@ -157,6 +157,11 @@ | |||
| <include refid="queryBillManageListConditions"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillRentManage" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_rent_manage br | |||
| <include refid="queryBillManageListConditions"/> | |||
| </select> | |||
| <select id="queryRentContractIds" parameterType="com.iformall.domain.po.WxBillRentManage" resultType="Long"> | |||
| select distinct br.`rent_contract_id` from wx_bill_rent_manage br | |||
| <include refid="queryBillManageListConditions"/> | |||
| @@ -140,7 +140,7 @@ | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| <if test=" null != onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" 1 == onlyOwe">and br.`owe` > 0</if> | |||
| <if test=" null != rentContractIdList "> | |||
| and br.`rent_contract_id` in | |||
| <foreach collection="rentContractIdList" index="index" item="ridItem" open="(" separator="," close=")"> | |||
| @@ -174,7 +174,6 @@ | |||
| <include refid="queryBillRentListCondition"/> | |||
| </select> | |||
| <resultMap id="SumBaseResultMap" type="com.iformall.domain.vo.WxBillSum"> | |||
| <result column="receive_pay" jdbcType="VARCHAR" property="needPay"/> | |||
| <result column="paid" jdbcType="VARCHAR" property="paid" /> | |||
| @@ -185,8 +184,11 @@ | |||
| <include refid="queryBillRentListCondition"/> | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxBillRent" resultType="Long"> | |||
| select distinct merchant_id from wx_bill_rent br | |||
| <include refid="queryBillRentListCondition"/> | |||
| </select> | |||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||
| select IFNULL(sum(receive_pay),0) receivepay,IFNULL(sum(pay),0) pay,tenant_id from wx_bill_rent | |||
| where is_preview = 0 | |||