Переглянути джерело

Merge remote-tracking branch 'origin/dev_1_3_2_20220815' into dev_1_3_2_20220815

liweifan 3 роки тому
батько
коміт
0e8df0946d

+ 1 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/ActivityUserRewardController.java

@@ -40,7 +40,7 @@ public class ActivityUserRewardController extends BaseController {
      */
     @PostMapping("/page")
     @ApiOperation(value = "查询分页", notes = "传入activityUserRewardSearch")
-    public HttpResponseResult<PageInfo<ActivityUserRewardVo>> page(@RequestBody ActivityUserRewardSearch query) {
+    public HttpResponseResult<PageInfo<ActivityUserRewardVo>> page(@RequestBody @Valid ActivityUserRewardSearch query) {
 		IPage<ActivityUserRewardVo> pages = activityUserRewardService.selectPage(PageUtil.getPage(query), query);
         return succeed(PageUtil.pageInfo(pages));
 	}

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

@@ -1,7 +1,13 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
 
 /**
  * @Author: liweifan
@@ -11,4 +17,67 @@ import io.swagger.annotations.ApiModel;
 public class ActivityUserRewardSearch extends QueryInfo{
 	private static final long serialVersionUID = 1L;
 
+
+	@ApiModelProperty("活动id")
+	@NotNull(message = "活动id不能为空")
+	private Long activityId;
+
+
+	@ApiModelProperty("真实姓名/编号/手机号")
+	private String search;
+
+	@ApiModelProperty("奖品id")
+	private Long  activityRewardId;
+
+	@ApiModelProperty("开始时间")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date startTime;
+
+	@ApiModelProperty("结束时间")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date endTime;
+
+	public Long getActivityId() {
+		return activityId;
+	}
+
+	public void setActivityId(Long activityId) {
+		this.activityId = activityId;
+	}
+
+	@Override
+	public String getSearch() {
+		return search;
+	}
+
+	@Override
+	public void setSearch(String search) {
+		this.search = search;
+	}
+
+	public Long getActivityRewardId() {
+		return activityRewardId;
+	}
+
+	public void setActivityRewardId(Long activityRewardId) {
+		this.activityRewardId = activityRewardId;
+	}
+
+	public Date getStartTime() {
+		return startTime;
+	}
+
+	public void setStartTime(Date startTime) {
+		this.startTime = startTime;
+	}
+
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
 }

+ 85 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/vo/UserRewardVo.java

@@ -0,0 +1,85 @@
+package com.yonge.cooleshow.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @Author: liweifan
+ * @Data: 2022-08-04 10:19:49
+ */
+@ApiModel(value = "UserRewardVo对象", description = "获奖名单")
+public class UserRewardVo{
+
+
+	@ApiModelProperty("用户id")
+	private Long userId;
+
+	@ApiModelProperty("真实姓名")
+	private String realName;
+
+	@ApiModelProperty("昵称")
+	private String username;
+
+	@ApiModelProperty("手机号")
+	private String phone;
+
+	@ApiModelProperty("获奖时间")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	private Date  createTime;
+
+	@ApiModelProperty("奖品名 逗号隔开")
+	private String rewardNames;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public String getRealName() {
+		return realName;
+	}
+
+	public void setRealName(String realName) {
+		this.realName = realName;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getPhone() {
+		return phone;
+	}
+
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getRewardNames() {
+		return rewardNames;
+	}
+
+	public void setRewardNames(String rewardNames) {
+		this.rewardNames = rewardNames;
+	}
+}

+ 29 - 2
cooleshow-user/user-biz/src/main/resources/config/mybatis/ActivityUserRewardMapper.xml

@@ -33,9 +33,36 @@
         where t.id_ = #{id}
     </select>
 
-    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.ActivityUserRewardVo">
+    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.UserRewardVo">
         SELECT
-        <include refid="baseColumns" />
+        su.id_ as userId,
+        su.real_name_ as realName,
+        su.username_ as username,
+        su.phone_ as phone,
+        t.create_time_ as createTime,
+        group_concat(if(t.grant_flag_ = 1,ar.reward_name_,null)) as rewardNames
         FROM activity_user_reward t
+        left join activity_reward ar on ar.id_ = t.reward_id_
+        left join sys_user su on t.user_id_ = su.id_
+        <where>
+            <if test="param.activityId != null">
+                and t.activity_id_ = #{param.activityId}
+            </if>
+            <if test="param.search !=null and param.search != ''">
+                and (su.real_name_ like concat('%',#{param.search},'%')
+                    or su.phone_ like concat('%',#{param.search},'%')
+                    or su.id_ like concat('%',#{param.search},'%'))
+            </if>
+            <if test="param.activityRewardId != null">
+                and t.reward_id_ = #{param.activityRewardId}
+            </if>
+            <if test="param.startTime != null">
+                and t.create_time_ &gt;= #{param.startTime}
+            </if>
+            <if test="param.endTime != null">
+                and  t.create_time_ &lt;= #{param.endTime}
+            </if>
+        </where>
+        GROUP BY t.user_id_,t.activity_id_
     </select>
 </mapper>

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/HomeMapper.xml

@@ -412,7 +412,7 @@
 				vlg.lesson_subject_,
 				count(1) as videoNum
 			from video_lesson_group vlg
-			where vlg.shelves_flag_ = 1
+			where vlg.shelves_flag_ = 1 and vlg.audit_status_ = 'PASS'
 			group by vlg.lesson_subject_
 		) e on e.lesson_subject_ = s.id_
 		where s.parent_subject_id_ !=0 and s.parent_subject_id_ is not null