Kaynağa Gözat

商户注券->卡券列表

release_toaliyun_real
Burce 6 yıl önce
ebeveyn
işleme
1418e0abc8
3 değiştirilmiş dosya ile 61 ekleme ve 0 silme
  1. +52
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxCouponSendController.java
  2. +6
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java
  3. +3
    -0
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml

+ 52
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxCouponSendController.java Dosyayı Görüntüle

@@ -0,0 +1,52 @@
package com.iformall.controller;

import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.BaseEntity;
import com.iformall.domain.po.WxCouponSend;
import com.iformall.domain.vo.WxCouponSendVo;
import com.iformall.enums.EnumCouponSendStatus;
import com.iformall.service.WxCouponActionLogService;
import com.iformall.service.WxCouponSendService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/couponSend")
@Api(description = "商户卡券相关接口")
public class WxCouponSendController extends BaseController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());

@Autowired
private WxCouponSendService wxCouponSendService;
@Autowired
private WxCouponActionLogService wxCouponActionLogService;

@ApiOperation("查询商户卡券列表")
@GetMapping("/list")
@ApiImplicitParam(name = "sendType", value = "sendType", dataType = "Long", paramType = "query", required = true)
public ResultData list(Integer sendType, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxCouponSendController::list");
WxCouponSend wxCouponSend = new WxCouponSend();
wxCouponSend.setSendType(sendType);
wxCouponSend.setTenantId(getTenantId());
wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode());
//库存大于0
wxCouponSend.setInventory(0);
wxCouponSend.setSortColumns(BaseEntity.SortField.CreateDate_DESC);
final PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize);

for (WxCouponSendVo cs : page.getList()) {
cs.setSendCount(wxCouponActionLogService.getCountByChannelId(getTenantId(), cs.getSendType(), cs.getId()));
}
return new ResultData(page);
}

}

+ 6
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java Dosyayı Görüntüle

@@ -38,6 +38,12 @@ public class WxCouponSend extends BaseEntity {
@Transient
protected List<Long> ids;

/**
* 库存条件
*/
@Transient
protected Integer inventory;

@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@io.swagger.annotations.ApiModelProperty(value="卡券id",name="couponId")


+ 3
- 0
mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml Dosyayı Görüntüle

@@ -87,6 +87,9 @@
and cs.send_sms = #{sendSms}
</if>
<if test=" null != inventory ">
and c.remain_inventory > #{inventory}
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>



Yükleniyor…
İptal
Kaydet