| @@ -14,6 +14,7 @@ import com.iformall.domain.vo.WxMerchantVo; | |||||
| import com.iformall.service.QrCodeService; | import com.iformall.service.QrCodeService; | ||||
| import com.iformall.service.WxMerchantService; | import com.iformall.service.WxMerchantService; | ||||
| import com.iformall.service.WxScoreRulesService; | import com.iformall.service.WxScoreRulesService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -24,6 +25,10 @@ import org.springframework.web.bind.annotation.*; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.ArrayList; | |||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -267,4 +272,27 @@ public class WxMerchantController extends BaseController { | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("商户会员消费明细列表接口") | |||||
| @GetMapping("userTradeDetailList") | |||||
| @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 userTradeDetailList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::list"); | |||||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||||
| wxMerchant.setTenantId(getTenantId()); | |||||
| wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); | |||||
| final PageInfo<WxMerchantTradeVo> page = wxMerchantService.userTradeList(wxMerchant, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("导出商户会员消费分页列表") | |||||
| @GetMapping("exportUserTradeList") | |||||
| @SystemControllerLog(description = "导出商户会员消费分页列表") | |||||
| public void exportUserTradeList(@ModelAttribute WxMerchant wxMerchant,HttpServletRequest request, HttpServletResponse response) throws Exception{ | |||||
| logger.debug("[" + getIpAddr() + "] WxBusinessController::exportUserTradeList"); | |||||
| wxMerchantService.exportUserTradeList(wxMerchant, request,response); | |||||
| } | |||||
| } | } | ||||
| @@ -0,0 +1,28 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import com.iformall.domain.po.BaseEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxMerchantTradeDetailVo extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "会员昵称", name = "userName") | |||||
| protected String userName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "cover") | |||||
| private String cover; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") | |||||
| private String merchantName; | |||||
| @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkName") | |||||
| private String linkName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "消费会员人数", name = "consumeCount") | |||||
| private Integer consumeCount; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "消费会员人次(去重)", name = "consumeCountP") | |||||
| private Integer consumeCountP; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "会员消费金额", name = "tradeAmt") | |||||
| private Integer tradeAmt; | |||||
| } | |||||
| @@ -9,6 +9,7 @@ import lombok.ToString; | |||||
| @ToString(callSuper = true) | @ToString(callSuper = true) | ||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxMerchantTradeVo extends BaseEntity { | public class WxMerchantTradeVo extends BaseEntity { | ||||
| @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId") | @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId") | ||||
| protected Long id; | protected Long id; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "cover") | @io.swagger.annotations.ApiModelProperty(value = "封面图", name = "cover") | ||||
| @@ -3,11 +3,13 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.dto.WxMerchantDto; | import com.iformall.domain.dto.WxMerchantDto; | ||||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxProfitSharingReceiver; | import com.iformall.domain.po.WxProfitSharingReceiver; | ||||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | import com.iformall.domain.vo.WxMerchantSimpleVo; | ||||
| import com.iformall.domain.vo.WxMerchantTradeVo; | import com.iformall.domain.vo.WxMerchantTradeVo; | ||||
| import com.iformall.domain.vo.WxMerchantVo; | import com.iformall.domain.vo.WxMerchantVo; | ||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| @@ -19,6 +21,18 @@ import java.util.Optional; | |||||
| * @author gongbiao | * @author gongbiao | ||||
| */ | */ | ||||
| public interface WxMerchantService { | public interface WxMerchantService { | ||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxMerchantTradeVo> userTradeDetailList(WxMerchant record, Integer pageIndex, Integer pageSize); | |||||
| /** | /** | ||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| * | * | ||||
| @@ -29,6 +43,13 @@ public interface WxMerchantService { | |||||
| */ | */ | ||||
| PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize); | PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| void exportUserTradeList(@ModelAttribute WxMerchant record, HttpServletRequest request, HttpServletResponse response); | |||||
| /** | /** | ||||
| * 根据实体查询分页列表 | * 根据实体查询分页列表 | ||||
| * | * | ||||
| @@ -745,4 +745,10 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| public PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeList(record)); | ||||
| } | } | ||||
| @Override | |||||
| public void exportUserTradeList(WxMerchant record,HttpServletRequest request, HttpServletResponse response) { | |||||
| List<WxMerchantTradeVo> datalist = wxMerchantMapper.userTradeList(record); | |||||
| excelService.exportExcel(datalist, null, "商户会员消费列表", WxMerchantTradeVo.class, "商户会员消费列表.xlsx", response, false); | |||||
| } | |||||
| } | } | ||||