From 22d199559342c1ccb3a0a8a5b5ee50e973819e16 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期五, 19 一月 2024 11:31:19 +0800
Subject: [PATCH] Merge branch 'master-prod-new' into chenjiahe-再生俱乐部

---
 phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java |   42 +++++++++++++++++++++++++++++++++++++-----
 1 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java b/phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java
index 2e03af0..9c28823 100644
--- a/phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java
+++ b/phi_platform_user/src/main/java/com/hx/phip/controller/message/CorpMessageController.java
@@ -311,6 +311,30 @@
                     if (userInfo == null) {
                         throw new PlatTipsException(PlatformCode.ERROR_TIPS, "鏈壘鍒板鎴蜂俊鎭紒");
                     }
+                    // 鏄惁杩囨湡鎻愰啋
+                    int isExpire = BaseEntity.NO;
+                    // 寰呰繃鏈熼鍛婂崌闄嶇骇淇℃伅
+                    if (NotificationLog.NOTIFICATION_SUBJECT_USER_LEVEL_1_EXPIRE_NOTICE.equals(notificationLog.getNotificationSubject()) ||
+                            NotificationLog.NOTIFICATION_SUBJECT_USER_LEVEL_2_EXPIRE_NOTICE.equals(notificationLog.getNotificationSubject()) ||
+                            NotificationLog.NOTIFICATION_SUBJECT_USER_LEVEL_3_EXPIRE_NOTICE.equals(notificationLog.getNotificationSubject())) {
+                        // 鏄惁杩囨湡鎻愰啋
+                        isExpire = BaseEntity.YES;
+                        // 鏍囬澶勭悊
+                        title = "瀹㈡埛鍗冲皢闄嶇骇閫氱煡";
+                        // 璁$畻闄嶇骇淇濈骇鏌ヨ鏁版嵁
+                        UserLevelRecord checkUserLevelRecord = UserLevelTool.handlerSaveAndDownLevel(commonService, userLevelRecord, BaseEntity.YES, BaseEntity.NO);
+                        if (checkUserLevelRecord != null) {
+                            // 鍥炲~鏄剧ず鏁版嵁
+                            userLevelRecord.setBeforeLevelName(checkUserLevelRecord.getBeforeLevelName());
+                            userLevelRecord.setLevelName(checkUserLevelRecord.getLevelName());
+                            // 淇濈骇涓嶇敤鍙戦�侀�氱煡
+                            if (UserLevelRecord.CHANGE_LEVEL_TYPE_SAVE_LEVEL.equals(checkUserLevelRecord.getChangeLevelType())){
+                               return;
+                            }
+                        } else {
+                            throw new PlatTipsException(PlatformCode.ERROR_TIPS, "鏈绠楀嚭瀹㈡埛绛夌骇闄嶇骇淇濈骇淇℃伅锛�");
+                        }
+                    }
                     // 濮撳悕
                     net.sf.json.JSONObject contentItem401 = new net.sf.json.JSONObject();
                     contentItem401.put("key", "瀹㈡埛濮撳悕");
@@ -318,10 +342,12 @@
                     contentItem401.put("value", userInfo.getName() + ciqInfo);
                     jsonArray.add(contentItem401);
                     // 鍙樺姩鏃ユ湡
-                    net.sf.json.JSONObject contentItem402 = new net.sf.json.JSONObject();
-                    contentItem402.put("key", "鍙樺姩鏃ユ湡");
-                    contentItem402.put("value", DateUtil.formatDate_9(userLevelRecord.getCreateTime()));
-                    jsonArray.add(contentItem402);
+                    if (BaseEntity.NO == isExpire) {
+                        net.sf.json.JSONObject contentItem402 = new net.sf.json.JSONObject();
+                        contentItem402.put("key", "鍙樺姩鏃ユ湡");
+                        contentItem402.put("value", DateUtil.formatDate_9(userLevelRecord.getCreateTime()));
+                        jsonArray.add(contentItem402);
+                    }
                     // 鍘熺瓑绾�
                     net.sf.json.JSONObject contentItem403 = new net.sf.json.JSONObject();
                     contentItem403.put("key", "鍘熺瓑绾�");
@@ -340,7 +366,13 @@
                     // 鍙樺姩鍘熷洜
                     net.sf.json.JSONObject contentItem406 = new net.sf.json.JSONObject();
                     contentItem406.put("key", "鍙樺姩鍘熷洜");
-                    String reasonInfo = UserLevelTool.getUserLevelReasonInfo(commonService, userLevelRecord);
+                    // 鑾峰彇鍙樺姩鍘熷洜
+                    String reasonInfo;
+                    if (BaseEntity.NO == isExpire) {
+                        reasonInfo = UserLevelTool.getUserLevelReasonInfo(commonService, userLevelRecord);
+                    } else {
+                        reasonInfo = "淇濈骇鏈揪鎴愶紝浼氬憳闄嶇骇";
+                    }
                     contentItem406.put("value", reasonInfo);
                     jsonArray.add(contentItem406);
                     break;

--
Gitblit v1.8.0