| @@ -200,13 +200,4 @@ public class WxCouponController extends BaseController { | |||||
| return new ResultData(wxCouponService.findPressData(wxCoupon,pageNum,pageSize)); | return new ResultData(wxCouponService.findPressData(wxCoupon,pageNum,pageSize)); | ||||
| } | } | ||||
| @ApiOperation("商户活动列表信息") | |||||
| @GetMapping("findByMerchant") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData findByMerchant(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(wxCouponService.findByMerchant(wxCoupon,pageNum,pageSize)); | |||||
| } | |||||
| } | } | ||||
| @@ -1,6 +1,8 @@ | |||||
| package com.iformall.controller; | package com.iformall.controller; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxMerchantBUser; | |||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| import com.iformall.enums.EnumCouponChannelActivityStatus; | import com.iformall.enums.EnumCouponChannelActivityStatus; | ||||
| import com.iformall.enums.EnumCouponChannelStatus; | import com.iformall.enums.EnumCouponChannelStatus; | ||||
| @@ -41,9 +43,28 @@ public class WxCouponChannelController extends BaseController { | |||||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | ||||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC); | wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC); | ||||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); | ||||
| filterTimed(wxCouponChannel, page); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("商户活动列表信息") | |||||
| @GetMapping("listByMerchant") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData listByMerchant(@ModelAttribute WxCouponChannel wxCouponChannel, Integer pageNum, Integer pageSize) { | |||||
| wxCouponChannel.setTenantId(getTenantId()); | |||||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.UpdateDate_DESC); | |||||
| PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listByMerchant(wxCouponChannel,pageNum,pageSize); | |||||
| filterTimed(wxCouponChannel, page); | |||||
| return new ResultData(page); | |||||
| } | |||||
| private void filterTimed(WxCouponChannel wxCouponChannel, PageInfo<WxCouponChannelVo> page) { | |||||
| if (wxCouponChannel.getTargetAd()!= null && | if (wxCouponChannel.getTargetAd()!= null && | ||||
| wxCouponChannel.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { | wxCouponChannel.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { | ||||
| Date now = new Date(); | Date now = new Date(); | ||||
| @@ -57,8 +78,5 @@ public class WxCouponChannelController extends BaseController { | |||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| return new ResultData(page); | |||||
| } | } | ||||
| } | } | ||||
| @@ -68,27 +68,4 @@ public class WxCouponController extends BaseController { | |||||
| return new ResultData(wxCouponCVo); | return new ResultData(wxCouponCVo); | ||||
| } | } | ||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| logger.debug("[" + getIpAddr() + "] WxCouponController::list"); | |||||
| if (wxCoupon == null) wxCoupon = new WxCoupon(); | |||||
| wxCoupon.setTenantId(getTenantId()); | |||||
| return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表 | |||||
| } | |||||
| @ApiOperation("商户活动列表信息") | |||||
| @GetMapping("findByMerchant") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData findByMerchant(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(wxCouponService.findByMerchant(wxCoupon,pageNum,pageSize)); | |||||
| } | |||||
| } | } | ||||
| @@ -202,9 +202,6 @@ public class WxCoupon extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="修改库存有效期参数, 用来做乐观锁",name="orgInventory") | @io.swagger.annotations.ApiModelProperty(value="修改库存有效期参数, 用来做乐观锁",name="orgInventory") | ||||
| private Integer orgInventory; | private Integer orgInventory; | ||||
| @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") | |||||
| @Transient | |||||
| private Long merchantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="投放渠道id",name="couponChannelId") | @io.swagger.annotations.ApiModelProperty(value="投放渠道id",name="couponChannelId") | ||||
| @Transient | @Transient | ||||
| @@ -242,13 +239,6 @@ public class WxCoupon extends BaseEntity { | |||||
| this.wxCouponStatisVo = wxCouponStatisVo; | this.wxCouponStatisVo = wxCouponStatisVo; | ||||
| } | } | ||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| } | |||||
| public void setMerchantId(Long merchantId) { | |||||
| this.merchantId = merchantId; | |||||
| } | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -123,6 +123,10 @@ public class WxCouponChannel extends BaseEntity { | |||||
| @SortColumn(column = "price") | @SortColumn(column = "price") | ||||
| private String priceStr; | private String priceStr; | ||||
| @Transient | |||||
| private Long merchantId; | |||||
| public String getSalePriceStr() { | public String getSalePriceStr() { | ||||
| return salePriceStr; | return salePriceStr; | ||||
| } | } | ||||
| @@ -263,6 +267,14 @@ public class WxCouponChannel extends BaseEntity { | |||||
| this.creditPrice = creditPrice; | this.creditPrice = creditPrice; | ||||
| } | } | ||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| } | |||||
| public void setMerchantId(Long merchantId) { | |||||
| this.merchantId = merchantId; | |||||
| } | |||||
| public String getWeaAppPath() { | public String getWeaAppPath() { | ||||
| if(type == null) | if(type == null) | ||||
| return "pages/index/index"; | return "pages/index/index"; | ||||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxTopic; | import com.iformall.domain.po.WxTopic; | ||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| @@ -18,6 +19,8 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str | |||||
| List<WxCouponChannelVo> findVoList(WxCouponChannel wxCouponChannel); | List<WxCouponChannelVo> findVoList(WxCouponChannel wxCouponChannel); | ||||
| List<WxCouponChannelVo> findVoListByMerchant(WxCouponChannel wxCouponChannel); | |||||
| WxCouponCVo findVoDetail(@Param("id")Long id); | WxCouponCVo findVoDetail(@Param("id")Long id); | ||||
| void updateStatusByCouponId(WxCouponChannel wxCouponChannel); | void updateStatusByCouponId(WxCouponChannel wxCouponChannel); | ||||
| @@ -76,10 +76,4 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| // 库存,有效期修改 | // 库存,有效期修改 | ||||
| int updateStockAndValidDate(WxCoupon wxCoupon); | int updateStockAndValidDate(WxCoupon wxCoupon); | ||||
| /** | |||||
| * 查询商户的卷信息 | |||||
| * @param wxCoupon | |||||
| * @return | |||||
| */ | |||||
| List<WxCoupon> findByMerchant(WxCoupon wxCoupon); | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ 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.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| @@ -32,6 +33,15 @@ public interface WxCouponChannelService { | |||||
| PageInfo<WxCouponChannelVo> listPageCVo(WxCouponChannel record, Integer pageIndex, Integer pageSize); | PageInfo<WxCouponChannelVo> listPageCVo(WxCouponChannel record, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 查询商户的卷信息 | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCouponChannelVo> listByMerchant(WxCouponChannel record, Integer pageIndex, Integer pageSize); | |||||
| WxCouponCVo findDetailVo(Long id); | WxCouponCVo findDetailVo(Long id); | ||||
| /** | /** | ||||
| @@ -67,12 +77,5 @@ public interface WxCouponChannelService { | |||||
| ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime); | ResultData addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime, Date endTime); | ||||
| void updateStatusByCouponId(Long couponId,String tenantId,int status); | void updateStatusByCouponId(Long couponId,String tenantId,int status); | ||||
| } | } | ||||
| @@ -175,11 +175,7 @@ public interface WxCouponService { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| String pressSuccRate(WxCoupon wxCoupon); | String pressSuccRate(WxCoupon wxCoupon); | ||||
| /** | |||||
| * 商场补贴金额 | |||||
| * @return | |||||
| */ | |||||
| // Long sumSubsidy(WxCoupon wxCoupon); | |||||
| /** | /** | ||||
| * 砍价参与人数 | * 砍价参与人数 | ||||
| * @return | * @return | ||||
| @@ -199,10 +195,5 @@ public interface WxCouponService { | |||||
| */ | */ | ||||
| ResultData updateCouponStockAndEndTime(WxCoupon wxCoupon); | ResultData updateCouponStockAndEndTime(WxCoupon wxCoupon); | ||||
| /** | |||||
| * 查询商户的卷信息 | |||||
| * @param wxCoupon | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCoupon> findByMerchant(WxCoupon wxCoupon,Integer pageNum, Integer pageSize); | |||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.iformall.common.IdWorker; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCoupon; | import com.iformall.domain.po.WxCoupon; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelAddVo; | import com.iformall.domain.vo.WxCouponChannelAddVo; | ||||
| import com.iformall.domain.vo.WxCouponChannelVo; | import com.iformall.domain.vo.WxCouponChannelVo; | ||||
| @@ -249,4 +250,9 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| return wxCouponChannelMapper.findVoList(record); | return wxCouponChannelMapper.findVoList(record); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxCouponChannelVo> listByMerchant(WxCouponChannel record, Integer pageNum, Integer pageSize) { | |||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponChannelMapper.findVoListByMerchant(record)); | |||||
| } | |||||
| } | } | ||||
| @@ -570,8 +570,4 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @Override | |||||
| public PageInfo<WxCoupon> findByMerchant(WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | |||||
| return PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> wxCouponMapper.findByMerchant(wxCoupon)); | |||||
| } | |||||
| } | } | ||||
| @@ -172,6 +172,26 @@ | |||||
| <include refid="dynamicWhereConditions" /> | <include refid="dynamicWhereConditions" /> | ||||
| </select> | </select> | ||||
| <select id="findVoListByMerchant" parameterType="com.iformall.domain.po.WxCouponChannel" resultMap="CouponChannelVoMap"> | |||||
| select <include refid="CouponChannelVoColumns" /> | |||||
| from wx_coupon_channel cc | |||||
| join wx_coupon_merchant cm | |||||
| on cm.product_id = cc.coupon_id | |||||
| and cm.status = 0 | |||||
| <if test="merchantId != null"> | |||||
| and cm.merchant_id=#{merchantId} | |||||
| </if> | |||||
| left join wx_coupon c on cc.coupon_id = c.id | |||||
| where cc.`target_ad` in (1,2,5,6,7) | |||||
| <if test="status != null"> | |||||
| and cc.status=#{status} | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and cc.tenant_id = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| </select> | |||||
| <sql id="WxCouponCVoColumn"> | <sql id="WxCouponCVoColumn"> | ||||
| cc.id,cc.coupon_id,cc.target_ad,cc.begin_time,cc.end_time, | cc.id,cc.coupon_id,cc.target_ad,cc.begin_time,cc.end_time, | ||||
| c.tenant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price, | c.tenant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price, | ||||
| @@ -803,24 +803,4 @@ | |||||
| where ct.`sub_target_id` = #{id} | where ct.`sub_target_id` = #{id} | ||||
| </select> | </select> | ||||
| <select id="findByMerchant" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> | |||||
| select c.*,wcc.target_ad targetAd,wcc.id couponChannelId from wx_coupon c inner join wx_coupon_channel wcc | |||||
| on wcc.coupon_id = c.id | |||||
| left join wx_coupon_merchant wc on wc.product_id = c.id where 1=1 | |||||
| and c.remain_inventory>0 | |||||
| <if test="merchantId != null"> | |||||
| and wc.merchant_id=#{merchantId} | |||||
| </if> | |||||
| <if test="type != null"> | |||||
| and c.type=#{type} | |||||
| </if> | |||||
| <if test="status != null"> | |||||
| and c.status=#{status} | |||||
| </if> | |||||
| <if test="tenantId != null"> | |||||
| and c.tenantId=#{tenantId} | |||||
| </if> | |||||
| order by c.id desc | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||