瀏覽代碼

导出加入是否回复作业

周箭河 5 年之前
父節點
當前提交
cbae6c7d40

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

@@ -18,6 +18,8 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
 
     List<PracticeGroupsDto> getPracticeGroupsBuy();
 
+    List<PracticeGroupsDto> getPracticeGroupsRenew();
+
     List<PracticeGroupsDto> getHasReportNums();
 
     List<PracticeGroupsDto> getOrganPracticeGroups();

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/PracticeGroupsDto.java

@@ -9,6 +9,7 @@ public class PracticeGroupsDto {
     private Integer overNums = 0;
     private Integer reportNums = 0;
     private Integer buyNums = 0;
+    private Integer renewNums = 0;
     private BigDecimal totalMoney = BigDecimal.ZERO;
     private Double buyScale =  0.00;
 
@@ -75,4 +76,12 @@ public class PracticeGroupsDto {
     public void setBuyScale(Double buyScale) {
         this.buyScale = buyScale;
     }
+
+    public Integer getRenewNums() {
+        return renewNums;
+    }
+
+    public void setRenewNums(Integer renewNums) {
+        this.renewNums = renewNums;
+    }
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/practiceGroupStatisDto.java

@@ -8,6 +8,7 @@ public class practiceGroupStatisDto {
     private BigDecimal totalMoney;
     private Integer totalNum = 0;
     private Integer buyNum = 0;
+    private Integer renewNum = 0;
     private Integer overNum = 0;
     private Integer reportNum = 0;
     private BigDecimal buyScale;
@@ -70,4 +71,12 @@ public class practiceGroupStatisDto {
     public void setBuyScale(BigDecimal buyScale) {
         this.buyScale = buyScale;
     }
+
+    public Integer getRenewNum() {
+        return renewNum;
+    }
+
+    public void setRenewNum(Integer renewNum) {
+        this.renewNum = renewNum;
+    }
 }

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

@@ -125,6 +125,7 @@
         <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
         <result column="total_nums_" jdbcType="INTEGER" property="totalNums"/>
         <result column="buy_nums_" jdbcType="INTEGER" property="buyNums"/>
+        <result column="renew_nums_" jdbcType="INTEGER" property="renewNums"/>
         <result column="report_nums_" jdbcType="INTEGER" property="reportNums"/>
         <result column="total_money_" jdbcType="DECIMAL" property="totalMoney"/>
     </resultMap>
@@ -260,4 +261,14 @@
         AND DATE_FORMAT(create_time_,'%Y%m%d') = DATE_FORMAT(#{nowDate},'%Y%m%d')
         GROUP BY class_group_id_;
     </select>
+
+    <select id="getPracticeGroupsRenew" resultMap="PracticeGroupsOrgan">
+        SELECT organ_id_, count(distinct student_id_) renew_nums_
+        FROM practice_group
+        WHERE group_status_ != 'LOCK'
+          AND group_status_ != 'CANCEL'
+          AND buy_months_ >= 1
+          AND be_renew_group_id_ >= 1
+        GROUP BY organ_id_
+    </select>
 </mapper>

+ 11 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -369,6 +369,7 @@ public class StudentOrderController extends BaseController {
         List<PracticeGroupsDto> organPracticeGroups = courseScheduleEvaluateDao.getOrganPracticeGroups();
         List<PracticeGroupsDto> practiceGroupsFrees = courseScheduleEvaluateDao.getPracticeGroupsFree();
         List<PracticeGroupsDto> practiceGroupsBuys = courseScheduleEvaluateDao.getPracticeGroupsBuy();
+        List<PracticeGroupsDto> practiceGroupsRenews = courseScheduleEvaluateDao.getPracticeGroupsRenew();
 
         List<PracticeGroupsDto> practiceGroups = new ArrayList<>();
         for (Organization organ : organs) {
@@ -389,6 +390,13 @@ public class StudentOrderController extends BaseController {
                     break;
                 }
             }
+            //续费人数
+            for (PracticeGroupsDto practiceGroupsRenew : practiceGroupsRenews) {
+                if (organ.getId().equals(practiceGroupsRenew.getOrganId())) {
+                    practiceGroupsDto.setRenewNums(practiceGroupsRenew.getRenewNums());
+                    break;
+                }
+            }
             //已完成人数
             for (PracticeGroupsDto organPracticeGroup : organPracticeGroups) {
                 if (organ.getId().equals(organPracticeGroup.getOrganId()) && organPracticeGroup.getBuyNums() >= organPracticeGroup.getTotalNums()) {
@@ -422,6 +430,7 @@ public class StudentOrderController extends BaseController {
         BigDecimal totalMoney = BigDecimal.ZERO;
         Integer totalNum = 0;
         Integer buyNum = 0;
+        Integer renewNum = 0;
         Integer overNum = 0;
         Integer reportNum = 0;
 
@@ -437,6 +446,7 @@ public class StudentOrderController extends BaseController {
             overNum += next.getOverNums();
             buyNum += next.getBuyNums();
             reportNum += next.getReportNums();
+            renewNum += next.getRenewNums();
         }
         practiceGroups = practiceGroups.stream().sorted(Comparator.comparingDouble(PracticeGroupsDto::getBuyScale).reversed()).collect(Collectors.toList());
 
@@ -445,6 +455,7 @@ public class StudentOrderController extends BaseController {
         practiceGroupStatisDto.setTotalMoney(totalMoney);
         practiceGroupStatisDto.setTotalNum(totalNum);
         practiceGroupStatisDto.setBuyNum(buyNum);
+        practiceGroupStatisDto.setRenewNum(renewNum);
         practiceGroupStatisDto.setOverNum(overNum);
         practiceGroupStatisDto.setReportNum(reportNum);