Sfoglia il codice sorgente

运营活动开发

liweifan 3 anni fa
parent
commit
2598dd68ca

+ 13 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/ActivityRewardSearch.java

@@ -1,8 +1,10 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
+import com.yonge.cooleshow.common.enums.YesOrNoEnum;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import io.swagger.models.auth.In;
 
 /**
  * @Author: liweifan
@@ -21,6 +23,9 @@ public class ActivityRewardSearch extends QueryInfo{
 	@ApiModelProperty("客户端:STUDENT 学生端 TEACHER 老师端  多选 ")
 	private String rewardClient;
 
+	@ApiModelProperty("是否只查询有库存的数据 0 否 1 是")
+	private YesOrNoEnum hasStock = YesOrNoEnum.YES;
+
 	public String getRewardName() {
 		return rewardName;
 	}
@@ -44,4 +49,12 @@ public class ActivityRewardSearch extends QueryInfo{
 	public void setRewardClient(String rewardClient) {
 		this.rewardClient = rewardClient;
 	}
+
+	public YesOrNoEnum getHasStock() {
+		return hasStock;
+	}
+
+	public void setHasStock(YesOrNoEnum hasStock) {
+		this.hasStock = hasStock;
+	}
 }

+ 3 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ActivityRewardServiceImpl.java

@@ -98,11 +98,13 @@ public class ActivityRewardServiceImpl extends ServiceImpl<ActivityRewardDao, Ac
 
         if (null == activityReward.getId()) {
             activityReward.setCreateBy(user.getId());
+            activityReward.setUpdateBy(user.getId());
+
             baseMapper.insert(activityReward);
         } else {
             activityReward.setStock(null);
-
             activityReward.setUpdateBy(user.getId());
+
             baseMapper.updateById(activityReward);
         }
         return true;

+ 3 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/ActivityRewardMapper.xml

@@ -68,6 +68,9 @@
             <if test="param.rewardClient != null and param.rewardClient != ''">
                 and INTE_ARRAY(t.reward_client_,#{param.rewardClient})
             </if>
+            <if test="param.hasStock != null and param.hasStock.code == 1">
+                and t.stock_>0
+            </if>
         </where>
     </sql>