Răsfoiți Sursa

Merge branch 'develop-kjf' into develop

* develop-kjf:
  修复了股东大盘查询积分接口bug
mac 2 ani în urmă
părinte
comite
ba69745965

+ 1 - 1
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/impl/KxsShdScoreServiceImpl.java

@@ -128,11 +128,11 @@ public class KxsShdScoreServiceImpl extends ServiceImpl<KxsShdScoreMapper, KxsSh
 
                         //存在数据则根据条件增加
                         if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_FRIST.getTransactions()) >= 0){
+                            
                             kxsShdScore.setFirstScore(kxsShdScore.getFirstScore() + 1);
                         }
                         if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_CENTER.getTransactions()) >= 0){
                             kxsShdScore.setCenterScore(kxsShdScore.getCenterScore() + 1);
-
                         }
                         if (integralStatDTO.getTotalAmount().compareTo(ShdGradingEnum.LEVEL_HIGH.getTransactions()) >= 0){
                             kxsShdScore.setHighScore(kxsShdScore.getHighScore() + 1);

+ 1 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/impl/KxsShdTradeAmtServiceImpl.java

@@ -100,6 +100,7 @@ public class KxsShdTradeAmtServiceImpl extends ServiceImpl<KxsShdTradeAmtMapper,
             kxsShdTradeAmt.setFirstBonus(bonus);//初级奖池
             kxsShdTradeAmt.setCenterBonus(bonus);//中级奖池
             kxsShdTradeAmt.setHighBonus(bonus);//高级奖池
+            kxsShdTradeAmt.setUpdateTime(LocalDateTime.now());
             kxsShdTradeAmtMapper.updateById(kxsShdTradeAmt);
         }
     }

+ 37 - 22
kxs-user/kxs-user-biz/src/main/resources/mapper/KxsShdScoreMapper.xml

@@ -17,28 +17,35 @@
     </resultMap>
     <select id="getMyStandards"
             resultType="com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsVO">
-                SELECT
-                     first_score/3,center_score/3,high_score/3
-                 FROM kxs_shd_score
-                 WHERE
-                     del_flag != 1
-                     and first_score >= 3
-                     and center_score >= 3
-                     and high_score >= 3
-                     and user_code = #{userCode}
-                     and month = #{month}
+                SELECT first_score / 3 as firstScore,
+                       center_score / 3 as centerScore,
+                       high_score / 3 as highScore
+                FROM kxs_shd_score
+                WHERE del_flag != 1
+                AND (
+                first_score >= 3
+                OR center_score >= 3
+                OR high_score >= 3
+                )
+                and user_code = #{userCode}
+                and month = #{month}
     </select>
     <select id="getMyStandardsAll"
             resultType="com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsAllVO">
-        SELECT sum(first_score/3)  as firstScoreAll,
-               sum(center_score/3) as centerScoreAll,
-               sum(high_score/3)   as highScoreAll
-        FROM kxs_shd_score
-        WHERE del_flag != 1
-          and first_score >= 3
-          and center_score >= 3
-          and high_score >= 3
-          and month = #{month}
+        SELECT
+            SUM(CASE WHEN first_score >= 3 THEN first_score / 3 ELSE 0 END) AS firstScoreAll,
+            SUM(CASE WHEN center_score >= 3 THEN center_score / 3 ELSE 0 END) AS centerScoreAll,
+            SUM(CASE WHEN high_score >= 3 THEN high_score / 3 ELSE 0 END) AS highScoreAll
+        FROM
+            kxs_shd_score
+        WHERE
+            del_flag != 1
+    AND (
+        first_score >= 3
+        OR center_score >= 3
+        OR high_score >= 3
+    )
+    AND month = #{month}
     </select>
 
     <select id="getShareholderHighScoreUserList"
@@ -58,9 +65,17 @@
         id,username,user_code,id,user_id
         FROM kxs_shd_score
         WHERE del_flag != 1
-        AND first_score >= 3
-        AND center_score >= 3
-        AND high_score >= 3
+        <choose>
+            <when test="type == 1">
+                AND first_score >= 3
+            </when>
+            <when test="type == 2">
+                AND center_score >= 3
+            </when>
+            <when test="type == 3">
+                AND high_score >= 3
+            </when>
+        </choose>
         AND month = #{month}
         <choose>
             <when test="type == 1">