Explorar o código

会员购买周期列表

刘俊驰 hai 1 ano
pai
achega
44d85a775a

+ 27 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dto/search/MemberPriceSettingsSearch.java

@@ -1,5 +1,6 @@
 package com.yonge.cooleshow.biz.dal.dto.search;
 
+import com.yonge.cooleshow.biz.dal.enums.EVipType;
 import com.yonge.toolset.base.page.QueryInfo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -18,7 +19,32 @@ public class MemberPriceSettingsSearch extends QueryInfo{
 	@ApiModelProperty("活动id")
 	private Long  activityId;
 
-	public Long getActivityId() {
+
+    @ApiModelProperty("状态")
+    private Boolean  status;
+
+
+    @ApiModelProperty("会员类型 VIP SVIP")
+    private EVipType vipType;
+
+
+    public Boolean getStatus() {
+        return status;
+    }
+
+    public void setStatus(Boolean status) {
+        this.status = status;
+    }
+
+    public EVipType getVipType() {
+        return vipType;
+    }
+
+    public void setVipType(EVipType vipType) {
+        this.vipType = vipType;
+    }
+
+    public Long getActivityId() {
 		return activityId;
 	}
 

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

@@ -331,12 +331,11 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
 
         // 设置剩余天数
         if (userVip.getVipEndDate() != null) {
-
-            int num = DateUtil.daysBetween(new Date(), userVip.getVipEndDate());
+            int num = DateUtil.daysBetween(new Date(), userVip.getVipEndDate()) +1;
             userVip.setVipEndDays(Math.max(num, 0));
         }
         if (userVip.getSvipEndDate() != null) {
-            int num = DateUtil.daysBetween(new Date(), userVip.getSvipEndDate());
+            int num = DateUtil.daysBetween(new Date(), userVip.getSvipEndDate()) +1;
             userVip.setSvipEndDays(Math.max(num, 0));
         }
         return userVip;

+ 8 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/MemberPriceSettingsMapper.xml

@@ -45,6 +45,14 @@
 		ifnull(u.real_name_,u.username_) as modifierName
 		FROM member_price_settings t
 		LEFT JOIN sys_user u on t.update_by_ = u.id_
+        <where>
+            <if test="param.status != null">
+                and t.status_ = #{param.status}
+            </if>
+            <if test="param.vipType != null">
+                and t.vip_type_ = #{param.vipType}
+            </if>
+        </where>
 	</sql>
 
 	<select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.vo.MemberPriceSettingsVo">