diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java index d7a4ac5cb..cfbcfd6ef 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillAllController.java @@ -5,10 +5,29 @@ import com.github.pagehelper.PageInfo; import com.iformall.annotation.SystemControllerLog; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.WxBillDaily; +import com.iformall.domain.po.WxBillDeposit; +import com.iformall.domain.po.WxBillOther; +import com.iformall.domain.po.WxBillOtherDeposit; +import com.iformall.domain.po.WxBillProperty; +import com.iformall.domain.po.WxBillPropertyDeposit; +import com.iformall.domain.po.WxBillRent; +import com.iformall.domain.po.WxBillRentManage; import com.iformall.domain.po.WxMerchant; +import com.iformall.domain.po.WxUserDataRule; import com.iformall.domain.vo.WxBillAll; import com.iformall.domain.vo.WxBillExcelTemplate; +import com.iformall.domain.vo.WxBillSum; +import com.iformall.domain.vo.WxMerchantBillVo; import com.iformall.service.WxBillAllService; +import com.iformall.service.WxBillDailyService; +import com.iformall.service.WxBillDepositService; +import com.iformall.service.WxBillOtherDepositService; +import com.iformall.service.WxBillOtherService; +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.WxPayAccountBillService; import io.swagger.annotations.ApiImplicitParam; @@ -22,8 +41,12 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -37,11 +60,135 @@ public class WxBillAllController extends BaseController { @Autowired private WxMerchantService wxMerchantService; + + @Autowired + private WxBillRentService wxBillRentService; + + @Autowired + private WxBillRentManageService wxBillRentManageService; + + @Autowired + private WxBillDepositService wxBillRentDepositService; + + @Autowired + private WxBillPropertyService wxBillPropertyService; + + @Autowired + private WxBillPropertyDepositService wxBillPropertyDepositService; + + @Autowired + private WxBillDailyService wxBillDailyService; + + @Autowired + private WxBillOtherService wxBillOtherService; + + @Autowired + private WxBillOtherDepositService wxBillOtherDepositService; + + private Logger logger = LoggerFactory.getLogger(WxBillAllController.class); @Autowired WxPayAccountBillService wxPayAccountBillService; + + @GetMapping("merchantBillList") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), + @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) + public ResultData merchantBillList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { + wxMerchant.updateTenantInfo(getTenantInfo()); + WxUserDataRule dataRule = this.getCurrentDataFloors(); + if (null != dataRule) { + wxMerchant.setFloorForRule(dataRule.getFloorIds()); + wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); + } + PageInfo merchantPage = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); + if (null != merchantPage && null != merchantPage.getList() && merchantPage.getList().size() > 0 ) { + List retList = new ArrayList(); + for (int i = 0 ; i < merchantPage.getList().size(); i ++) { + WxMerchantBillVo vo = new WxMerchantBillVo(); + WxMerchant m = merchantPage.getList().get(i); + vo.setMerchantId(m.getId()); + vo.setMerchantName(m.getName()); + + WxBillRent br = new WxBillRent(); + br.updateTenantInfo(wxMerchant); + br.setStarttime(wxMerchant.getStarttime()); + br.setEndtime(wxMerchant.getEndtime()); + WxBillSum rentSum = wxBillRentService.getBillMonthSum(br); + + WxBillRentManage brm = new WxBillRentManage(); + brm.updateTenantInfo(wxMerchant); + brm.setStarttime(wxMerchant.getStarttime()); + brm.setEndtime(wxMerchant.getEndtime()); + WxBillSum rentManageSum = wxBillRentManageService.getBillMonthSum(brm); + + WxBillDeposit bd = new WxBillDeposit(); + bd.updateTenantInfo(wxMerchant); + bd.setStarttime(wxMerchant.getStarttime()); + bd.setEndtime(wxMerchant.getEndtime()); + WxBillSum rentDepositSum = wxBillRentDepositService.getBillMonthSum(bd); + + WxBillProperty bp = new WxBillProperty(); + bp.updateTenantInfo(wxMerchant); + bp.setStarttime(wxMerchant.getStarttime()); + bp.setEndtime(wxMerchant.getEndtime()); + WxBillSum propertySum = wxBillPropertyService.getBillMonthSum(bp); + + WxBillPropertyDeposit pd = new WxBillPropertyDeposit(); + pd.updateTenantInfo(wxMerchant); + pd.setStarttime(wxMerchant.getStarttime()); + pd.setEndtime(wxMerchant.getEndtime()); + WxBillSum propertyDepositSum = wxBillPropertyDepositService.getBillMonthSum(pd); + + WxBillDaily bdd = new WxBillDaily(); + bdd.updateTenantInfo(wxMerchant); + bdd.setStarttime(wxMerchant.getStarttime()); + bdd.setEndtime(wxMerchant.getEndtime()); + WxBillSum dailySum = wxBillDailyService.getBillMonthSum(bdd); + + WxBillOther bo = new WxBillOther(); + bo.updateTenantInfo(wxMerchant); + bo.setStarttime(wxMerchant.getStarttime()); + bo.setEndtime(wxMerchant.getEndtime()); + WxBillSum otherSum = wxBillOtherService.getBillMonthSum(bo); + + WxBillOtherDeposit bod = new WxBillOtherDeposit(); + bod.updateTenantInfo(wxMerchant); + bod.setStarttime(wxMerchant.getStarttime()); + bod.setEndtime(wxMerchant.getEndtime()); + WxBillSum otherDepositSum = wxBillOtherDepositService.getBillMonthSum(bod); + + vo.setNeedPay(calcuteSum(rentSum.getNeedPay(),rentManageSum.getNeedPay(),rentDepositSum.getNeedPay(),propertySum.getNeedPay(), + propertyDepositSum.getNeedPay(),dailySum.getNeedPay(),otherSum.getNeedPay(),otherDepositSum.getNeedPay())); + vo.setPaid(calcuteSum(rentSum.getPaid(),rentManageSum.getPaid(),rentDepositSum.getPaid(),propertySum.getPaid(), + 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); + } + return new ResultData(); + } + + private String calcuteSum(String... money) { + if (null != money) { + BigDecimal total = new BigDecimal(0); + for (int i = 0 ; i < money.length ; i++) { + String _m = money[i]; + if (StringUtils.isBlank(_m)) { + _m = "0"; + } + total.add(new BigDecimal(_m)); + } + return total.setScale(2,RoundingMode.HALF_UP).toPlainString(); + } + return "0"; + } + + @GetMapping("oweBillCount") @ApiImplicitParams({ @@ -117,13 +264,13 @@ public class WxBillAllController extends BaseController { wxBillAllService.exportBill(request, response, wxBillAll); } - @GetMapping("getBillInfo") - @SystemControllerLog(description = "账单总览-获取账单信息") - public ResultData getBillInfo(@ModelAttribute WxBillAll wxBillAll) { - wxBillAll.updateTenantInfo(getTenantInfo()); - Object billInfo = wxBillAllService.getBillInfo(wxBillAll); - return new ResultData(billInfo); - } +// @GetMapping("getBillInfo") +// @SystemControllerLog(description = "账单总览-获取账单信息") +// public ResultData getBillInfo(@ModelAttribute WxBillAll wxBillAll) { +// wxBillAll.updateTenantInfo(getTenantInfo()); +// Object billInfo = wxBillAllService.getBillInfo(wxBillAll); +// return new ResultData(billInfo); +// } /** diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillRentManageController.java b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillRentManageController.java index a8affe685..c120ca627 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillRentManageController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillRentManageController.java @@ -1,10 +1,12 @@ package com.iformall.controller.rent; +import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; import com.github.pagehelper.PageInfo; import com.iformall.annotation.SystemControllerLog; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; +import com.iformall.domain.po.WxBillRent; import com.iformall.domain.po.WxBillRentManage; import com.iformall.domain.po.WxUserDataRule; import com.iformall.domain.po.base.BaseEntity; @@ -52,6 +54,20 @@ public class WxBillRentManageController extends BaseController { return new ResultData(page); } + @GetMapping("monthBillSum") + public ResultData monthBillSum(@ModelAttribute WxBillRentManage wxBillRentManage) { + if (StringUtils.isBlank(wxBillRentManage.getMonth())) { + new ResultData(Result.ERROR, "请选择月份"); + } + wxBillRentManage.updateTenantInfo(getTenantInfo()); + WxUserDataRule dataRule = this.getCurrentDataFloors(); + if (null != dataRule) { + wxBillRentManage.setFloorForRule(dataRule.getFloorIds()); + wxBillRentManage.setBusinessForRule(dataRule.getBussinessIds()); + } + return new ResultData(wxBillRentManageService.getBillMonthSum(wxBillRentManage)); + } + @GetMapping("/detail") @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData detail(Long id) { diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java index 03fd65189..9ef9449f1 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java @@ -97,7 +97,7 @@ public class WxBillRent extends TenantEntity { private String oweStr; @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6"}, width = 20, orderNum = "10") - @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期", name = "status") + @io.swagger.annotations.ApiModelProperty(value = "账单状态1欠缴2待缴3已结清4未到期EnumBillRentStatus", name = "status") private Integer status; @io.swagger.annotations.ApiModelProperty(value = "账单审核状态EnumBillRentApplyStatus", name = "applyStatus") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRentManage.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRentManage.java index c3eed4fd4..8d4455f0b 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRentManage.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRentManage.java @@ -218,5 +218,8 @@ public class WxBillRentManage extends TenantEntity { private List merchantIds; @TableField(exist = false) private Integer hasMerchant; + + @TableField(exist = false) + private String month; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java index 8e1eb1947..05f41f9fa 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java @@ -443,5 +443,5 @@ public class WxMerchant extends TenantEntity { @TableField(exist = false) private String initLog; - + } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantBillVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantBillVo.java new file mode 100644 index 000000000..9b2e9abde --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantBillVo.java @@ -0,0 +1,48 @@ +package com.iformall.domain.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; + +import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.math.RoundingMode; + +@Data +public class WxMerchantBillVo implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long merchantId; + @Excel(name = "商户名称", width = 20, orderNum = "2") + @TableField(exist = false) + private String merchantName;//商户名称 + + + private String needPay; + @Excel(name = "应付账单金额(元)", width = 20, orderNum = "3") + @TableField(exist = false) + private String needPayNumber; + public String getNeedPayNumber() { + return StringUtils.isBlank(needPay) ? "0" : new BigDecimal(needPay).setScale(2,RoundingMode.HALF_UP).toPlainString(); + } + + private String paid; + @Excel(name = "已付账单金额(元)", width = 20, orderNum = "4") + @TableField(exist = false) + private String paidNumber; + public String getPaidNumber() { + return StringUtils.isBlank(paid) ? "0" : new BigDecimal(paid).setScale(2,RoundingMode.HALF_UP).toPlainString(); + } + + private String owe; + @Excel(name = "欠费账单金额(元)", width = 20, orderNum = "5") + @TableField(exist = false) + private String oweNumber; + public String getOweNumber() { + return StringUtils.isBlank(owe) ? "0" : new BigDecimal(owe).setScale(2,RoundingMode.HALF_UP).toPlainString(); + } + +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillRentManageMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillRentManageMapper.java index d5f555ac2..ca9c23a0b 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillRentManageMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillRentManageMapper.java @@ -1,7 +1,10 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; +import com.iformall.domain.po.WxBillRent; import com.iformall.domain.po.WxBillRentManage; +import com.iformall.domain.vo.WxBillSum; + import org.apache.ibatis.annotations.Param; import java.util.List; @@ -29,4 +32,6 @@ public interface WxBillRentManageMapper extends CommonMapper resultList); + WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); + } diff --git a/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java b/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java index 82ac41758..66faf0e8f 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxBillAllService.java @@ -37,7 +37,7 @@ public interface WxBillAllService { void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll); - Object getBillInfo(WxBillAll wxBillAll); + //Object getBillInfo(WxBillAll wxBillAll); Long hasOweBill(Long contractId, Integer type); diff --git a/mallinkService/src/main/java/com/iformall/service/WxBillRentManageService.java b/mallinkService/src/main/java/com/iformall/service/WxBillRentManageService.java index 3104c239e..43b4f8a83 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxBillRentManageService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxBillRentManageService.java @@ -3,9 +3,11 @@ package com.iformall.service; import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.MallUserInfo; +import com.iformall.domain.po.WxBillRent; import com.iformall.domain.po.WxBillRentManage; import com.iformall.domain.po.WxPayAccountBill; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.WxBillSum; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -65,5 +67,7 @@ public interface WxBillRentManageService { ResultData updateLatePayStatus(WxBillRentManage wxBillRent); void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillRentManage wxBillRentManage); + + WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 9312a6038..7131898f9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -1869,28 +1869,28 @@ public class WxBillAllServiceImpl implements WxBillAllService { wxBillDailyMapper.updateById(wxBillDaily); } - @Override - public Object getBillInfo(WxBillAll record) { - - record.setRentShopType(EnumRentShopType.SHOP.getCode()); - record.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); - Map oweInfoForShop = wxBillAllMapper.queryOweInfo(record); - record.setStatus(EnumBillRentStatus.PAID.getCode()); - Map paidInfoForShop = wxBillAllMapper.queryPaidInfo(record); - - record.setRentShopType(EnumRentShopType.POINT.getCode()); - record.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); - Map oweInfoForPoint = wxBillAllMapper.queryOweInfo(record); - record.setStatus(EnumBillRentStatus.PAID.getCode()); - Map paidInfoForPoint = wxBillAllMapper.queryPaidInfo(record); - - Map result = new HashMap<>(4); - result.put("oweInfoForShop", oweInfoForShop); - result.put("paidInfoForShop", paidInfoForShop); - result.put("oweInfoForPoint", oweInfoForPoint); - result.put("paidInfoForPoint", paidInfoForPoint); - return result; - } +// @Override +// public Object getBillInfo(WxBillAll record) { +// +// record.setRentShopType(EnumRentShopType.SHOP.getCode()); +// record.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); +// Map oweInfoForShop = wxBillAllMapper.queryOweInfo(record); +// record.setStatus(EnumBillRentStatus.PAID.getCode()); +// Map paidInfoForShop = wxBillAllMapper.queryPaidInfo(record); +// +// record.setRentShopType(EnumRentShopType.POINT.getCode()); +// record.setStatus(EnumBillRentStatus.NOT_PAID.getCode()); +// Map oweInfoForPoint = wxBillAllMapper.queryOweInfo(record); +// record.setStatus(EnumBillRentStatus.PAID.getCode()); +// Map paidInfoForPoint = wxBillAllMapper.queryPaidInfo(record); +// +// Map result = new HashMap<>(4); +// result.put("oweInfoForShop", oweInfoForShop); +// result.put("paidInfoForShop", paidInfoForShop); +// result.put("oweInfoForPoint", oweInfoForPoint); +// result.put("paidInfoForPoint", paidInfoForPoint); +// return result; +// } @Override public Long hasOweBill(Long contractId, Integer type) { diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java index 10a16ece2..7cc07c1c5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentManageServiceImpl.java @@ -16,6 +16,7 @@ import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxPayAccountBill; import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.base.TenantEntity; +import com.iformall.domain.vo.WxBillSum; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillActionMapper; @@ -79,7 +80,7 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { return getBillRentManageList(pageIndex, pageSize, wxBillRentManage, wxPayAccountBill); } - private PageInfo getBillRentManageList(Integer pageIndex, Integer pageSize,WxBillRentManage wxBillRentManage,WxPayAccountBill wxPayAccountBill) { + private void updateQueryParam(WxBillRentManage wxBillRentManage) { if (null != wxBillRentManage.getFloorForRule()) { List merchantIds = wxMerchantService.getFloorBuildMerchantIds(wxBillRentManage, wxBillRentManage.getFloorForRule(), null, null, 0, 0); if (null != merchantIds) { @@ -108,6 +109,10 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { wxBillRentManage.setId(-1L); } } + } + + private PageInfo getBillRentManageList(Integer pageIndex, Integer pageSize,WxBillRentManage wxBillRentManage,WxPayAccountBill wxPayAccountBill) { + updateQueryParam(wxBillRentManage); PageInfo billRentList = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBillRentManageMapper.queryBillManageList(wxBillRentManage)); if (null == billRentList) { return null; @@ -422,5 +427,11 @@ public class WxBillRentManageServiceImpl implements WxBillRentManageService { excelService.exportExcel(datalist, null, billName, WxBillRentManage.class, billName + ".xlsx", response, false); } + + @Override + public WxBillSum getBillMonthSum(WxBillRentManage wxBillRentManage) { + updateQueryParam(wxBillRentManage); + return wxBillRentManageMapper.getBillMonthSum(wxBillRentManage); + } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java index 49c70599b..2325dece7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java @@ -173,6 +173,8 @@ public class WxMerchantServiceImpl implements WxMerchantService { if(record.getIsAdmin() == null){ record.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); } + Map merchantRentMap = new HashMap(); + initQueryParam(record,false, merchantRentMap); return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findList(record)); } @@ -1206,17 +1208,6 @@ public class WxMerchantServiceImpl implements WxMerchantService { } } -// List isUseMerchantIds = new ArrayList(); -// if(record.getIsUse() != null){ -// WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); -// wxProfitSharingReceiver.updateTenantInfo(record); -// wxProfitSharingReceiver.setSharingType(EnumProfitSharingType.PROFIT_SHARING_TYPE_DOUYIN.getCode()); -// wxProfitSharingReceiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_VALID.getCode()); -// wxProfitSharingReceiver.setPlat(EnumAppPlat.TOUTIAO.getCode()); -// wxProfitSharingReceiver.setIsUse(EnumProfitSharingUse.YES.getCode()); -// isUseMerchantIds = wxProfitSharingReceiverMapper.findMerchantIdList(wxProfitSharingReceiver); -// } - List merchantIds = new ArrayList(); if (record.getCouponId() != null){ @@ -1262,42 +1253,11 @@ public class WxMerchantServiceImpl implements WxMerchantService { } } - -// if(EnumProfitSharingUse.YES.getCode().equals(record.getIsUse())){ -// if(merchantIds.size() > 0){ -// merchantIds.retainAll(isUseMerchantIds); -// }else{ -// merchantIds.addAll(isUseMerchantIds); -// } -// } - if (merchantIds.size() > 0 ) { record.setIds(merchantIds); } -// List noMerchantIds = new ArrayList(); -// Integer rentShopType = record.getRentShopType(); -// if (null != rentShopType) { -// WxRentContract rentContractQ = new WxRentContract(); -// rentContractQ.updateTenantInfo(record); -// rentContractQ.setStatuss(EnumRentContractStatus.getValidStatus()); -// List usedMerchantIds = wxRentContractMapper.getMerchantIdsByStatuss(rentContractQ); -// if (null != usedMerchantIds && usedMerchantIds.size() >0 ) { -// noMerchantIds.addAll(usedMerchantIds); -//// record.setNotInids(usedMerchantIds); -// } -// } -// if(EnumProfitSharingUse.NO.getCode().equals(record.getIsUse())){ -// if(noMerchantIds.size() > 0){ -// noMerchantIds.retainAll(isUseMerchantIds); -// }else{ -// noMerchantIds.addAll(isUseMerchantIds); -// } -// } - -// if(noMerchantIds.size() > 0){ -// record.setNotInids(noMerchantIds); -// } + Integer rentShopType = record.getRentShopType(); } private List getFloorBuildingMerchantIds(TenantEntity tenantEntity,String floorForRule,Long buildingId,Long floor) { diff --git a/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml index 9fd50bd79..c588d0dd2 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentManageMapper.xml @@ -112,8 +112,11 @@ and br.`rent_contract_id` = #{rentContractId} and br.`pay_way` = #{payWay} and br.`late_pay_status` = #{latePayStatus} - and br.`receive_date` between #{starttime} and #{endtime} - + and br.`starttime` <= #{starttime} + and br.`endtime` >= #{endtime} + + and date_format(br.starttime,'%Y-%m') <= #{month} and date_format(br.endtime,'%Y-%m') >= #{month} + and br.`manage_fee_type` = #{manageFeeType} and br.`merchant_id` is not null @@ -140,6 +143,16 @@ + + + + + + +