yuanliang 1 年間 前
コミット
8faad7d29f

+ 6 - 1
cooleshow-app/src/main/java/com/yonge/cooleshow/admin/controller/MemberPriceSettingsController.java

@@ -1,5 +1,7 @@
 package com.yonge.cooleshow.admin.controller;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
@@ -69,6 +71,9 @@ public class MemberPriceSettingsController extends BaseController {
 		}
 		memberPriceSettings.setUpdateBy(user.getId());
 		memberPriceSettings.setUpdateTime(new Date());
-		return status(memberPriceSettingsService.updateById(memberPriceSettings));
+		boolean update = memberPriceSettingsService.update(memberPriceSettings, new UpdateWrapper<MemberPriceSettings>().lambda()
+				.set(MemberPriceSettings::getDesc, memberPriceSettings.getDesc())
+				.eq(MemberPriceSettings::getId, memberPriceSettings.getId()));
+		return status(update);
 	}
 }

+ 3 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/MessageTypeEnum.java

@@ -112,6 +112,9 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     PRACTICE_ADJUST("陪练课调整"),
     ACTIVITY_WIN("获奖消息"),
     PLATFORM_ADD_VIP("会员赠送"),
+
+    PLATFORM_ADD_DUDECT_VIP("会员扣减"),
+
     SMS_STUDENT_LIVE_COMPLETION_FAIL("直播课成课失败"),
     STUDENT_LIVE_COMPLETION_FAIL("直播课成课失败"),
     COUPON_ISSUE("优惠券发放"),
@@ -126,7 +129,6 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     TENANT_VIP_BUY("开通平台会员"),
     TENANT_VIP_EXPIRE("平台会员到期"),
     TENANT_PLATFORM_ADD_VIP("后台添加平台会员"),
-    TENANT_PLATFORM_DUDECT_VIP("后台添加扣减平台会员"),
     TENANT_ALBUM_BUY("购买训练教程"),
     TENANT_ALBUM_EXPIRE("训练教程到期"),
     TENANT_SEND_CODE("发放激活码"),

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

@@ -165,7 +165,7 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
         for (StudentVo record : records) {
             EUserVipType vipType = record.getVipType();
             if (EUserVipType.NORMAL.equals(vipType)) {
-                record.setMembershipEndTime(Optional.ofNullable(record.getSvipEndTime()).orElse(record.getVipEndTime()));
+                record.setMembershipEndTime(Optional.ofNullable(record.getVipEndTime()).orElse(record.getSvipEndTime()));
             }
             if (EUserVipType.SVIP.equals(vipType)) {
                 Date perSvipEndTime = record.getPerSvipEndTime();

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

@@ -261,7 +261,7 @@ public class TeacherServiceImpl extends ServiceImpl<TeacherDao, Teacher> impleme
         for (TeacherVo record : teacherVos) {
             EUserVipType vipType = record.getVipType();
             if (EUserVipType.NORMAL.equals(vipType)) {
-                record.setMembershipEndTime(Optional.ofNullable(record.getSvipEndTime()).orElse(record.getVipEndTime()));
+                record.setMembershipEndTime(Optional.ofNullable(record.getVipEndTime()).orElse(record.getSvipEndTime()));
             }
             if (EUserVipType.SVIP.equals(vipType)) {
                 Date perSvipEndTime = record.getPerSvipEndTime();

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

@@ -789,15 +789,16 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
         if (sysUser == null) {
             return;
         }
-        MessageTypeEnum messageTypeEnum = EVipRecordStatus.ADD.equals(addVipCardRecord.getStatus()) ? MessageTypeEnum.TENANT_PLATFORM_ADD_VIP : MessageTypeEnum.TENANT_PLATFORM_DUDECT_VIP;
+        MessageTypeEnum messageTypeEnum = EVipRecordStatus.ADD.equals(addVipCardRecord.getStatus()) ? MessageTypeEnum.PLATFORM_ADD_VIP : MessageTypeEnum.PLATFORM_ADD_DUDECT_VIP;
         Map<Long, String> receivers = new HashMap<>();
         receivers.put(addVipCardRecord.getUserId(), sysUser.getPhone());
 
         try {
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, messageTypeEnum,
-                    receivers, null, 0, null, addVipCardRecord.getClientType().getCode());
+                    receivers, null, 0, null, addVipCardRecord.getClientType().getCode(), String.valueOf(addVipCardRecord.getTimes()), addVipCardRecord.getType().getMsg(),
+                    addVipCardRecord.getReason());
         } catch (Exception e) {
-            log.error("会员赠送消息发送失败 : {}", e.getMessage());
+            log.error("会员添加消息发送失败 : {}", e.getMessage());
         }
     }
 }

+ 3 - 8
cooleshow-user/user-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -107,7 +107,7 @@
 <!--            if(vcr.type_ = 'PERMANENT',null,vcr.end_time_) as membershipEndTime,-->
             max(if(vcr.vip_type_ = 'VIP', vcr.end_time_, null)) vipEndTime,
             max(if(vcr.vip_type_ = 'SVIP' and vcr.type_ = 'PERPETUAL', vcr.end_time_ , null)) perSvipEndTime,
-            max(if(vcr.vip_type_ = 'SVIP' and vcr.type_ != 'PERPETUAL', vcr.end_time_, null)) svipEndTime,
+            max(if(vcr.vip_type_ = 'SVIP' , vcr.end_time_, null)) svipEndTime,
 <!--            (!isnull(membership_end_time_) and membership_end_time_ > now()) as isVip,-->
             (
             SELECT GROUP_CONCAT(name_ ORDER by locate(id_,t.subject_id_)) FROM subject WHERE FIND_IN_SET(id_,t.subject_id_)
@@ -199,13 +199,8 @@
             </if>
         </where>
         group by t.user_id_
-        <if test="param.vipStartTime != null and param.vipEndTime != null and param.vipType != null">
-            <if test="param.vipType.code == 'VIP'">
-                having  vipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> vipEndTime
-            </if>
-            <if test="param.vipType.code == 'SVIP'">
-                having  svipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> svipEndTime
-            </if>
+        <if test="param.vipStartTime != null and param.vipEndTime != null">
+        having  ((vipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> vipEndTime) or (svipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> svipEndTime))
         </if>
         <choose>
             <when test="param.orderBy != null and param.orderBy.trim() != ''">

+ 3 - 8
cooleshow-user/user-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -110,7 +110,7 @@
         ifnull(vcr2.vip_type_,'NORMAL') as vipType,
         max(if(vcr.vip_type_ = 'VIP', vcr.end_time_, null)) vipEndTime,
         max(if(vcr.vip_type_ = 'SVIP' and vcr.type_ = 'PERPETUAL', vcr.end_time_ , null)) perSvipEndTime,
-        max(if(vcr.vip_type_ = 'SVIP' and vcr.type_ != 'PERPETUAL', vcr.end_time_, null)) svipEndTime,
+        max(if(vcr.vip_type_ = 'SVIP', vcr.end_time_, null)) svipEndTime,
         (case when isnull(u.id_card_no_) then 0 else 1 end) as isReal,
         (case when isnull(b.user_id_) then 0 else 1 end) as isBank,
         (case when t.tenant_id_ = -1 then '平台' else ti.name_ end) as tenantName
@@ -208,13 +208,8 @@
             </if>
         </where>
         group by t.user_id_
-        <if test="param.vipStartTime != null and param.vipEndTime != null and param.vipType != null">
-            <if test="param.vipType.code == 'VIP'">
-                having vipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> vipEndTime
-            </if>
-            <if test="param.vipType.code == 'SVIP'">
-                having svipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> svipEndTime
-            </if>
+        <if test="param.vipStartTime != null and param.vipEndTime != null">
+            having  ((vipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> vipEndTime) or (svipEndTime >= #{param.vipStartTime} and #{param.vipEndTime}> svipEndTime))
         </if>
         <choose>
             <when test="param.orderBy != null and param.orderBy.trim() != ''">