zouxuan 3 سال پیش
والد
کامیت
ffbd9b7498

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/DegreeRegistrationDao.java

@@ -17,6 +17,8 @@ public interface DegreeRegistrationDao extends BaseDAO<Integer, DegreeRegistrati
 
     DegreeRegistration getTotalAmount(Map<String, Object> params);
 
+    int countApplyNum(Map<String, Object> params);
+
     DegreeRegistration getWithUserIdAndActivityTag(@Param("degree") DegreeRegistration degree);
 
     List<DegreeRegistration> getUserLevelDegrees(@Param("userId") Integer userId,

+ 1 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/DegreeRegistrationServiceImpl.java

@@ -610,9 +610,7 @@ public class DegreeRegistrationServiceImpl extends BaseServiceImpl<Integer, Degr
             BigDecimal subjectLevelAmount = degree.getMoney() == null ? BigDecimal.ZERO : degree.getMoney();
             BigDecimal theoryLevelAmount = degree.getTheoryMoney() == null ? BigDecimal.ZERO : degree.getTheoryMoney();
             BigDecimal totalAmount = subjectLevelAmount.add(theoryLevelAmount);
-            Set<Integer> collect = dataList.stream().map(e -> e.getUserId()).collect(Collectors.toSet());
-
-            pageInfo.setApplyNum(collect.size());
+            pageInfo.setApplyNum(degreeRegistrationDao.countApplyNum(params));
             pageInfo.setSubjectLevelAmount(subjectLevelAmount);
             pageInfo.setTheoryLevelAmount(theoryLevelAmount);
             pageInfo.setTotalAmount(totalAmount);

+ 6 - 0
mec-biz/src/main/resources/config/mybatis/DegreeRegistrationMapper.xml

@@ -119,6 +119,12 @@
         <include refid="queryPageSql"/>
     </select>
 
+    <select id="countApplyNum" parameterType="map" resultType="int">
+        SELECT COUNT(DISTINCT user_id_)
+        FROM degree_registration
+        <include refid="queryPageSql"/>
+    </select>
+
     <delete id="delete" parameterType="java.lang.Integer">
         delete
         from degree_registration