| @@ -9,6 +9,7 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.service.QrCodeService; | |||
| import com.iformall.service.WxMerchantService; | |||
| @@ -250,4 +251,19 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(has); | |||
| } | |||
| @ApiOperation("商户会员消费分页列表接口") | |||
| @GetMapping("userTradeList") | |||
| @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 userTradeList(@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); | |||
| } | |||
| } | |||
| @@ -125,6 +125,12 @@ public class WxMerchant extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "辅谈人", name = "talkUserAux") | |||
| private String talkUserAux; | |||
| @io.swagger.annotations.ApiModelProperty(value = "开始时间", name = "startTime") | |||
| private Date starttime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endTime") | |||
| private Date endtime; | |||
| public String getShopsStr() { | |||
| if (shopVos != null && shopVos.size() > 0) { | |||
| return String.join("\n", | |||
| @@ -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 WxMerchantTradeVo extends BaseEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户id", name = "merchantId") | |||
| protected Long id; | |||
| @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; | |||
| } | |||
| @@ -3,6 +3,7 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import java.util.HashMap; | |||
| @@ -27,4 +28,7 @@ public interface WxMerchantMapper extends CommonMapper<WxMerchant, Long> { | |||
| void updateCreditLocked(WxMerchant wxMerchant); | |||
| List<WxMerchantTradeVo> userTradeList(WxMerchant wxMerchant); | |||
| } | |||
| @@ -6,6 +6,7 @@ import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| @@ -18,6 +19,15 @@ import java.util.Optional; | |||
| * @author gongbiao | |||
| */ | |||
| public interface WxMerchantService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -11,6 +11,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.WxMerchantDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxMerchantSimpleVo; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -739,4 +740,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| PageInfo<WxMerchant> pageInfo = new PageInfo<>(merchants); | |||
| return pageInfo; | |||
| } | |||
| @Override | |||
| public PageInfo<WxMerchantTradeVo> userTradeList(WxMerchant record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.userTradeList(record)); | |||
| } | |||
| } | |||
| @@ -423,4 +423,54 @@ | |||
| update wx_merchant set credit_locked = #{creditLocked} where tenant_id = #{tenantId} | |||
| </update> | |||
| <select id="userTradeList" parameterType="com.iformall.domain.po.WxMerchant" resultType="com.iformall.domain.vo.WxMerchantTradeVo"> | |||
| select m.id,m.`cover_picture` cover,m.`name` merchantName,m.`link_person` linkName, | |||
| (select count(*) from wx_coupon_order o | |||
| left join wx_coupon co on(o.`coupon_id`=co.id) | |||
| left join wx_coupon_merchant cm on(cm.product_id=co.id) | |||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 | |||
| <if test="starttime != null"> | |||
| and o.create_date >= #{starttime} | |||
| </if> | |||
| <if test="endtime != null"> | |||
| and o.create_date <= #{endtime} | |||
| </if> | |||
| ) consumeCount, | |||
| (select count(distinct c.id) from wx_coupon_order o | |||
| left join wx_coupon co on(o.`coupon_id`=co.id) | |||
| left join wx_coupon_merchant cm on(cm.product_id=co.id) | |||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 | |||
| <if test="starttime != null"> | |||
| and o.create_date >= #{starttime} | |||
| </if> | |||
| <if test="endtime != null"> | |||
| and o.create_date <= #{endtime} | |||
| </if> | |||
| ) consumeCountP, | |||
| IFNULL((select sum(co.price) from wx_coupon_order o | |||
| left join wx_coupon co on(o.`coupon_id`=co.id) | |||
| left join wx_coupon_merchant cm on(cm.product_id=co.id) | |||
| inner join wx_c_user_basic_info c on(o.c_user_id=c.id) where cm.`merchant_id`=m.id and o.coupon_order_status=1 | |||
| <if test="starttime != null"> | |||
| and o.create_date >= #{starttime} | |||
| </if> | |||
| <if test="endtime != null"> | |||
| and o.create_date <= #{endtime} | |||
| </if> | |||
| ),0) tradeAmt | |||
| from wx_merchant m where 1=1 | |||
| <if test=" null != name and ''!=name "> | |||
| and `name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != linkPhone and ''!=linkPhone "> | |||
| and `link_phone` like concat('%', #{linkPhone},'%') | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.BaseEntity; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.vo.WxMerchantTradeVo; | |||
| import com.iformall.domain.vo.WxMerchantVo; | |||
| import com.iformall.service.WxMerchantService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -47,21 +48,6 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("商户会员消费分页列表接口") | |||
| @GetMapping("userTradeList") | |||
| @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 userTradeList(@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<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("listVo") | |||
| @ApiImplicitParams({ | |||