Ver código fonte

推送文案修改

yuanliang 1 ano atrás
pai
commit
2d6d66fa5b

+ 5 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/MessageTypeEnum.java

@@ -118,8 +118,13 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     PRACTICE_ADJUST("陪练课调整"),
     ACTIVITY_WIN("获奖消息"),
     PLATFORM_ADD_VIP("会员赠送"),
+    PLATFORM_ADD_SVIP("会员赠送"),
+
+    PLATFORM_ADD_PER_SVIP("会员永久赠送"),
 
     PLATFORM_ADD_DUDECT_VIP("会员扣减"),
+    PLATFORM_ADD_DUDECT_SVIP("会员扣减"),
+    PLATFORM_ADD_DUDECT_PER_SVIP("会员永久扣减"),
 
     SMS_STUDENT_LIVE_COMPLETION_FAIL("直播课成课失败"),
     STUDENT_LIVE_COMPLETION_FAIL("直播课成课失败"),

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

@@ -815,7 +815,35 @@ public class VipCardRecordServiceImpl extends ServiceImpl<VipCardRecordDao, VipC
         if (sysUser == null) {
             return;
         }
-        MessageTypeEnum messageTypeEnum = EVipRecordStatus.ADD.equals(addVipCardRecord.getStatus()) ? MessageTypeEnum.PLATFORM_ADD_VIP : MessageTypeEnum.PLATFORM_ADD_DUDECT_VIP;
+        MessageTypeEnum messageTypeEnum;
+        EVipRecordStatus status = addVipCardRecord.getStatus();
+        EVipType vipType = addVipCardRecord.getVipType();
+        if (EVipRecordStatus.ADD.equals(status)) {
+            if (EVipType.VIP.equals(vipType)) {
+                messageTypeEnum = MessageTypeEnum.PLATFORM_ADD_VIP;
+            }else {
+                PeriodEnum period = addVipCardRecord.getType();
+                if (PeriodEnum.PERPETUAL.equals(period)) {
+                    messageTypeEnum = MessageTypeEnum.PLATFORM_ADD_PER_SVIP;
+                } else {
+                    messageTypeEnum = MessageTypeEnum.PLATFORM_ADD_SVIP;
+                }
+            }
+        } else if (EVipRecordStatus.DEDUCTION.equals(status)) {
+            if (EVipType.VIP.equals(vipType)) {
+                messageTypeEnum = MessageTypeEnum.PLATFORM_ADD_DUDECT_VIP;
+            }else {
+                PeriodEnum period = addVipCardRecord.getType();
+                if (PeriodEnum.PERPETUAL.equals(period)) {
+                    messageTypeEnum = MessageTypeEnum.PLATFORM_ADD_DUDECT_PER_SVIP;
+                } else {
+                    messageTypeEnum = MessageTypeEnum.PLATFORM_ADD_DUDECT_SVIP;
+                }
+            }
+        } else {
+            throw new BizException("不支持类型");
+        }
+
         Map<Long, String> receivers = new HashMap<>();
         receivers.put(addVipCardRecord.getUserId(), sysUser.getPhone());
 

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

@@ -103,7 +103,7 @@
             u.phone_ as phone,
             !isnull(birthdate_) as isReal,
             u.real_name_ as realName,
-            ifnull(group_concat(vcr2.vip_type_),'NORMAL') as vipType,
+            ifnull(vcr2.vip_type_ ,'NORMAL') as vipType,
 <!--            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,

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

@@ -107,7 +107,7 @@
 <!--        (case when t.membership_end_time_ &gt;= now() then 1 else 0 end) isVip,-->
         <!--            t.tag_ tag,-->
         u.del_flag_ as delFlag,
-        ifnull(group_concat(vcr2.vip_type_),'NORMAL') as vipType,
+        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', vcr.end_time_, null)) svipEndTime,

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

@@ -147,7 +147,7 @@
 
     <select id="queryUserVipInfo" resultType="com.yonge.cooleshow.biz.dal.wrapper.VipCardRecordWrapper$UserVipInfo">
         select m.*
-        , ifnull(group_concat(vcr.vip_type_), 'NORMAL') currentVipType
+        , ifnull(vcr.vip_type_, 'NORMAL') currentVipType
         from (select t.user_id_ userId
         , max(if(t.vip_type_ = 'VIP', t.end_time_, null)) vipEndTime
         , max(if(t.vip_type_ = 'SVIP' and t.type_ = 'PERPETUAL', t.end_time_, null)) perSvipEndTime