Browse Source

学生评价列表导出增加学生评分

周箭河 5 years ago
parent
commit
07e8281ded

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleEvaluateDao.java

@@ -95,8 +95,16 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
 
     /**
      * 获取当月成交金额,人数
+     *
      * @param type
      * @return
      */
     List<PracticeGroupsDto> getMonthOrganMoney(@Param("type") OrderTypeEnum type);
+
+    /**
+     * 获取当月新成交金额,人数
+     *
+     * @return
+     */
+    List<PracticeGroupsDto> getOrganNewPracticeGroupsOfMonth(@Param("type") OrderTypeEnum type,@Param("startTime") Date startTime);
 }

+ 21 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleEvaluateMapper.xml

@@ -281,4 +281,25 @@
           AND DATE_FORMAT(create_time_, '%Y%m') = DATE_FORMAT(now(), '%Y%m')
         GROUP BY organ_id_
     </select>
+
+    <select id="getOrganNewPracticeGroupsOfMonth" resultMap="PracticeGroupsOrgan">
+        SELECT SUM(actual_amount_) total_money_, count(distinct user_id_) buy_nums_, organ_id_
+        FROM student_payment_order
+        WHERE type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+        AND status_ = 'SUCCESS'
+        AND create_time_ >= #{startTime}
+        AND user_id_ NOT IN (
+        SELECT distinct student_id_ FROM practice_group
+        WHERE group_status_ != 'LOCK'
+        AND group_status_ != 'CANCEL'
+        AND buy_months_ >= 1
+        <if test="type==@com.ym.mec.biz.dal.enums.OrderTypeEnum@PRACTICE_GROUP_BUY">
+        <![CDATA[ AND be_renew_group_id_ IS NULL AND create_time_ < #{startTime} ]]>
+        </if>
+        <if test="type==@com.ym.mec.biz.dal.enums.OrderTypeEnum@PRACTICE_GROUP_RENEW">
+            <![CDATA[ AND be_renew_group_id_ >= 1 AND create_time_ < #{startTime} ]]>
+        </if>
+        )
+        GROUP BY organ_id_
+    </select>
 </mapper>

+ 6 - 9
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -1,6 +1,7 @@
 package com.ym.mec.student.controller;
 
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -9,15 +10,7 @@ import io.swagger.annotations.ApiOperation;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.stream.Collectors;
 
 import javax.servlet.http.HttpServletResponse;
@@ -374,6 +367,10 @@ public class StudentOrderController extends BaseController {
         List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_BUY);
         List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getMonthOrganMoney(OrderTypeEnum.PRACTICE_GROUP_RENEW);
 
+        //Date startTime = DateUtil.getFirstDayOfMonth(new Date());
+        //List<PracticeGroupsDto> monthOrganBuyMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_BUY,startTime);
+        //List<PracticeGroupsDto> monthOrganRenewMoneys = courseScheduleEvaluateDao.getOrganNewPracticeGroupsOfMonth(OrderTypeEnum.PRACTICE_GROUP_RENEW,startTime);
+
         List<PracticeGroupsDto> practiceGroups = new ArrayList<>();
         for (Organization organ : organs) {
             PracticeGroupsDto practiceGroupsDto = new PracticeGroupsDto();