Kaynağa Gözat

商户注券->有效期过滤

release_toaliyun_real
Burce 6 yıl önce
ebeveyn
işleme
325ab34c49
5 değiştirilmiş dosya ile 28 ekleme ve 15 silme
  1. +8
    -8
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java
  2. +5
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxCouponSend.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxCouponSendMapper.java
  4. +1
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java
  5. +13
    -2
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml

+ 8
- 8
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponSendController.java Dosyayı Görüntüle

@@ -57,13 +57,13 @@ public class WxCouponSendController extends BaseController {
if (null == wxCouponSend) wxCouponSend = new WxCouponSend();
wxCouponSend.setTenantId(getTenantId());
Integer valid = EnumCouponSendStatus.VALID.getCode();
if (Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), wxCouponSend.getSendType())) {
if (Objects.nonNull(wxCouponSend.getStatus())) {
valid = wxCouponSend.getStatus();
} else {
wxCouponSend.setStatus(null);
}
}
// if (Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), wxCouponSend.getSendType())) {
// if (Objects.nonNull(wxCouponSend.getStatus())) {
// valid = wxCouponSend.getStatus();
// } else {
// wxCouponSend.setStatus(null);
// }
// }
wxCouponSend.setStatus(valid);
wxCouponSend.setSortColumns(BaseEntity.SortField.CreateDate_DESC);
PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize);
@@ -143,7 +143,7 @@ public class WxCouponSendController extends BaseController {
@ApiImplicitParam(name = "sendType", value = "注券类型(会员生日券时必传)", dataType = "int", paramType = "query")
})
@SystemControllerLog(description = "注券-删除")
public ResultData delete(Long id,Integer sendType) {
public ResultData delete(Long id) {
logger.debug("[" + getIpAddr() + "] WxCouponSendController::delete");
WxCouponSend wxCouponSend = wxCouponSendService.getById(id);
if (wxCouponSend == null)


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

@@ -59,7 +59,7 @@ public class WxCouponSend extends BaseEntity {
private Integer sendType;
@io.swagger.annotations.ApiModelProperty(value="发券条件",name="condition")
private String conditions;
@io.swagger.annotations.ApiModelProperty(value="全部时不传 0:有效 1:无效",name="status")
@io.swagger.annotations.ApiModelProperty(value="0:有效 1:无效",name="status")
private Integer status;

@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
@@ -74,4 +74,8 @@ public class WxCouponSend extends BaseEntity {
@io.swagger.annotations.ApiModelProperty(value = "1是0否", name = "是否发送短信1是0否")
private Integer sendSms;

@io.swagger.annotations.ApiModelProperty(value = "0未过期1已过期,全部时不传", name = "expired" )
@Transient
private Integer expired;

}

+ 1
- 1
mallinkService/src/main/java/com/iformall/mapper/WxCouponSendMapper.java Dosyayı Görüntüle

@@ -8,7 +8,7 @@ import com.iformall.domain.vo.WxCouponSendVo;
public interface WxCouponSendMapper extends CommonMapper<WxCouponSend, String> {

List<WxCouponSendVo> findListVo(WxCouponSend wxCouponSend);
List<WxCouponSendVo> findListVoFilterName(WxCouponSend wxCouponSend);
List<WxCouponSendVo> findListVoByNameAndDate(WxCouponSend wxCouponSend);

void updateStatusByCouponId(WxCouponSend wxCouponSend);



+ 1
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxCouponSendServiceImpl.java Dosyayı Görüntüle

@@ -7,7 +7,6 @@ import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.iformall.common.ErrorCode;
import com.iformall.common.IdWorker;
import com.iformall.common.ResultData;
import com.iformall.domain.po.*;
import com.iformall.domain.po.msg.AppUniformMsg;
import com.iformall.domain.po.msg.MpAppMsg;
@@ -26,7 +25,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@@ -71,7 +69,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService {
PageInfo<WxCouponSendVo> pageInfo;
//设置商户购买券数
if (Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), record.getSendType())) {
pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendMapper.findListVoFilterName(record));
pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendMapper.findListVoByNameAndDate(record));
for (WxCouponSendVo cs : pageInfo.getList()) {
JSONObject jo = JSONObject.parseObject(cs.getConditions());
int inventory = jo.getInteger(WxCouponSend.KEY_MERCHANT_LNVENTORY);


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

@@ -98,14 +98,25 @@
<include refid="dynamicWhereConditions" />
</select>

<select id="findListVoFilterName" parameterType="com.iformall.domain.vo.WxCouponSendVo" resultMap="BaseResultMap">
<select id="findListVoByNameAndDate" parameterType="com.iformall.domain.vo.WxCouponSendVo" resultMap="BaseResultMap">
select tt.* from (select
<include refid="allColumns"/>
from wx_coupon_send cs left join wx_coupon c on c.id = cs.coupon_id
<include refid="dynamicWhereConditions"/>) as tt
where 1=1
<if test=" null != merchantName ">
where tt.conditions like concat('%', #{merchantName},'%')
and tt.conditions like concat('%', #{merchantName},'%')
</if>
<choose>
<when test="expired == 0">
and <![CDATA[ tt.valid_end_date <= now() ]]>
</when>
<when test="expired == 1">
and <![CDATA[ tt.valid_end_date > now() ]]>
</when>
<otherwise>
</otherwise>
</choose>
</select>

<update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">


Yükleniyor…
İptal
Kaydet