Browse Source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 years ago
parent
commit
cbf6fc9be0

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

@@ -157,7 +157,14 @@ public interface CourseScheduleEvaluateDao extends BaseDAO<Long, CourseScheduleE
 
 
     /**
     /**
      * 禁止中vip和网管同时存在人数
      * 禁止中vip和网管同时存在人数
+     *
      * @return
      * @return
      */
      */
     List<Practice4OrganDto> getPracticeAndVipTryNums();
     List<Practice4OrganDto> getPracticeAndVipTryNums();
+
+    /**
+     * 获取所有的体验人数
+     * @return
+     */
+    List<Practice4OrganDto> getAllTryNums();
 }
 }

+ 16 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 package com.ym.mec.biz.dal.dao;
 
 
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.Student4operating;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.Student;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -17,5 +18,19 @@ public interface StudentDao extends com.ym.mec.common.dal.BaseDAO<Integer, Stude
     
     
     List<Student> queryByOperatingTag(Integer operatingTag);
     List<Student> queryByOperatingTag(Integer operatingTag);
     
     
-    int batchUpdate(List<Student> studentList);
+    int batchUpdate(@Param("studentList") List<Student> studentList);
+
+    /**
+     * 查询运营学生列表
+     * @param params
+     * @return
+     */
+    List<Student4operating> getOperatingStudents(Map<String, Object> params);
+
+    /**
+     * 查询运营学生总数
+     * @param params
+     * @return
+     */
+    Integer countOperatingStudents(Map<String, Object> params);
 }
 }

+ 140 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/Student4operating.java

@@ -0,0 +1,140 @@
+package com.ym.mec.biz.dal.dto;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+public class Student4operating {
+
+private String organName;
+private String organId;
+private String studentName;
+private Integer studentId;
+private String teacherId;
+private String teacherName;
+private Integer operatingTag;
+private Integer vipTimes;
+private Integer freePracticeTimes;
+private Integer buyPracticeTimes;
+
+private String operatingTagStr;
+private String vipTimesStr;
+private String freePracticeTimesStr;
+private String buyPracticeTimesStr;
+
+
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
+	public String getStudentName() {
+		return studentName;
+	}
+
+	public void setStudentName(String studentName) {
+		this.studentName = studentName;
+	}
+
+	public Integer getStudentId() {
+		return studentId;
+	}
+
+	public void setStudentId(Integer studentId) {
+		this.studentId = studentId;
+	}
+
+	public String getTeacherId() {
+		return teacherId;
+	}
+
+	public void setTeacherId(String teacherId) {
+		this.teacherId = teacherId;
+	}
+
+	public String getTeacherName() {
+		return teacherName;
+	}
+
+	public void setTeacherName(String teacherName) {
+		this.teacherName = teacherName;
+	}
+
+	public Integer getOperatingTag() {
+		return operatingTag;
+	}
+
+	public void setOperatingTag(Integer operatingTag) {
+		this.operatingTag = operatingTag;
+	}
+
+	public Integer getVipTimes() {
+		return vipTimes;
+	}
+
+	public void setVipTimes(Integer vipTimes) {
+		this.vipTimes = vipTimes;
+	}
+
+	public Integer getFreePracticeTimes() {
+		return freePracticeTimes;
+	}
+
+	public void setFreePracticeTimes(Integer freePracticeTimes) {
+		this.freePracticeTimes = freePracticeTimes;
+	}
+
+	public Integer getBuyPracticeTimes() {
+		return buyPracticeTimes;
+	}
+
+	public void setBuyPracticeTimes(Integer buyPracticeTimes) {
+		this.buyPracticeTimes = buyPracticeTimes;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+	public String getOperatingTagStr() {
+		return operatingTagStr;
+	}
+
+	public void setOperatingTagStr(String operatingTagStr) {
+		this.operatingTagStr = operatingTagStr;
+	}
+
+	public String getVipTimesStr() {
+		return vipTimesStr;
+	}
+
+	public void setVipTimesStr(String vipTimesStr) {
+		this.vipTimesStr = vipTimesStr;
+	}
+
+	public String getFreePracticeTimesStr() {
+		return freePracticeTimesStr;
+	}
+
+	public void setFreePracticeTimesStr(String freePracticeTimesStr) {
+		this.freePracticeTimesStr = freePracticeTimesStr;
+	}
+
+	public String getBuyPracticeTimesStr() {
+		return buyPracticeTimesStr;
+	}
+
+	public void setBuyPracticeTimesStr(String buyPracticeTimesStr) {
+		this.buyPracticeTimesStr = buyPracticeTimesStr;
+	}
+}

+ 20 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TeacherCourseSalaryDetail4WebDto.java

@@ -36,11 +36,13 @@ public class TeacherCourseSalaryDetail4WebDto {
     private java.util.Date signInTime;
     private java.util.Date signInTime;
 
 
     private YesOrNoEnum signInStatus;
     private YesOrNoEnum signInStatus;
-
-    private YesOrNoEnum signOutStatus;
+    private String signInStatusStr;
 
 
     private Date signOutTime;
     private Date signOutTime;
 
 
+    private YesOrNoEnum signOutStatus;
+    private String signOutStatusStr;
+
     private java.math.BigDecimal expectSalary;
     private java.math.BigDecimal expectSalary;
 
 
     private java.math.BigDecimal actualSalary;
     private java.math.BigDecimal actualSalary;
@@ -53,6 +55,22 @@ public class TeacherCourseSalaryDetail4WebDto {
 
 
     private String memo;
     private String memo;
 
 
+    public String getSignInStatusStr() {
+        return signInStatusStr;
+    }
+
+    public void setSignInStatusStr(String signInStatusStr) {
+        this.signInStatusStr = signInStatusStr;
+    }
+
+    public String getSignOutStatusStr() {
+        return signOutStatusStr;
+    }
+
+    public void setSignOutStatusStr(String signOutStatusStr) {
+        this.signOutStatusStr = signOutStatusStr;
+    }
+
     public BigDecimal getFinalSalary() {
     public BigDecimal getFinalSalary() {
         return finalSalary;
         return finalSalary;
     }
     }

+ 10 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -16,6 +16,8 @@ public class Student {
 	private Integer serviceTag;
 	private Integer serviceTag;
 
 
 	private Integer operatingTag;
 	private Integer operatingTag;
+
+	private Integer teacherId;
 	
 	
 	/**  */
 	/**  */
 	private java.util.Date createTime;
 	private java.util.Date createTime;
@@ -83,9 +85,16 @@ public class Student {
 	public void setOperatingTag(Integer operatingTag) {
 	public void setOperatingTag(Integer operatingTag) {
 		this.operatingTag = operatingTag;
 		this.operatingTag = operatingTag;
 	}
 	}
+
+	public Integer getTeacherId() {
+		return teacherId;
+	}
+
+	public void setTeacherId(Integer teacherId) {
+		this.teacherId = teacherId;
+	}
 	@Override
 	@Override
 	public String toString() {
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);
 		return ToStringBuilder.reflectionToString(this);
 	}
 	}
-
 }
 }

+ 77 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentOperatingQueryInfo.java

@@ -0,0 +1,77 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+
+public class StudentOperatingQueryInfo extends QueryInfo {
+    
+    @ApiModelProperty(value = "部门ID")
+    private String organId;
+
+    @ApiModelProperty(value = "指导老师")
+    private Integer teacherId;
+
+    @ApiModelProperty(value = "运营指标")
+    private Integer operatingTag;
+
+    @ApiModelProperty(value = "是否有VIP课")
+    private Integer hasVip;
+
+    @ApiModelProperty(value = "是否有免费网管课")
+    private Integer HasFreePractice;
+
+    @ApiModelProperty(value = "是否有收费网管课")
+    private Integer HasBuyPractice;
+
+    public String getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(String organId) {
+        this.organId = organId;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getOperatingTag() {
+        return operatingTag;
+    }
+
+    public void setOperatingTag(Integer operatingTag) {
+        this.operatingTag = operatingTag;
+    }
+
+    public Integer getHasVip() {
+        return hasVip;
+    }
+
+    public void setHasVip(Integer hasVip) {
+        this.hasVip = hasVip;
+    }
+
+    public Integer getHasFreePractice() {
+        return HasFreePractice;
+    }
+
+    public void setHasFreePractice(Integer hasFreePractice) {
+        HasFreePractice = hasFreePractice;
+    }
+
+    public Integer getHasBuyPractice() {
+        return HasBuyPractice;
+    }
+
+    public void setHasBuyPractice(Integer hasBuyPractice) {
+        HasBuyPractice = hasBuyPractice;
+    }
+}

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentManageService.java

@@ -145,4 +145,11 @@ public interface StudentManageService {
      * @return
      * @return
      */
      */
     Map<String,Integer> sumStudentAttendance(Integer courseScheduleId);
     Map<String,Integer> sumStudentAttendance(Integer courseScheduleId);
+
+    /**
+     * 运营指标学生
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<Student4operating> getOperatingStudents(StudentOperatingQueryInfo queryInfo);
 }
 }

+ 4 - 3
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExtracurricularExercisesReplyServiceImpl.java

@@ -225,13 +225,14 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 			int exercisesMessageNum=0;
 			int exercisesMessageNum=0;
 			int exercisesMessageTimelyNum=0;
 			int exercisesMessageTimelyNum=0;
 			for (ExtracurricularExercisesReply studentExercise : studentExercises) {
 			for (ExtracurricularExercisesReply studentExercise : studentExercises) {
-				if(Objects.isNull(studentExercise.getCreateTime())){
+				if(Objects.isNull(studentExercise.getSubmitTime())
+					||Objects.isNull(studentExercise.getCreateTime())){
 					continue;
 					continue;
 				}
 				}
-				exercisesMessageNum+=1;
-				if(Objects.isNull(studentExercise.getSubmitTime())){
+				if(studentExercise.getSubmitTime().after(studentExercise.getCreateTime())){
 					continue;
 					continue;
 				}
 				}
+				exercisesMessageNum+=1;
 				int hours = DateUtil.hoursBetween(studentExercise.getSubmitTime(), studentExercise.getCreateTime());
 				int hours = DateUtil.hoursBetween(studentExercise.getSubmitTime(), studentExercise.getCreateTime());
 				if(hours<=12){
 				if(hours<=12){
 					exercisesMessageTimelyNum+=1;
 					exercisesMessageTimelyNum+=1;

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -61,6 +61,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     private VipGroupDao vipGroupDao;
     private VipGroupDao vipGroupDao;
     @Autowired
     @Autowired
     private SysUserCashAccountDao sysUserCashAccountDao;
     private SysUserCashAccountDao sysUserCashAccountDao;
+    @Autowired
+    private StudentDao studentDao;
 
 
     @Override
     @Override
     public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
     public PageInfo<StudentManageListDto> findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
@@ -450,4 +452,22 @@ public class StudentManageServiceImpl implements StudentManageService {
         sum.put("repliedNum",studentManageDao.countRepliedNum(courseScheduleId));
         sum.put("repliedNum",studentManageDao.countRepliedNum(courseScheduleId));
         return sum;
         return sum;
     }
     }
+
+    @Override
+    public PageInfo<Student4operating> getOperatingStudents(StudentOperatingQueryInfo queryInfo) {
+        PageInfo<Student4operating> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+        params.put("offset", pageInfo.getOffset());
+        Integer count = studentDao.countOperatingStudents(params);
+
+        List<Student4operating> dataList = new ArrayList<>();
+
+        if(count > 0){
+            pageInfo.setTotal(count);
+            dataList = studentDao.getOperatingStudents(params);
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
+    }
 }
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -83,9 +83,10 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
 		List<Student> updateStudentList = new ArrayList<Student>();
 		List<Student> updateStudentList = new ArrayList<Student>();
 		StudentCourseTimesDto dto = null;
 		StudentCourseTimesDto dto = null;
 		for(Student s : studentList){
 		for(Student s : studentList){
-			dto = map.get(s.getUpdateTime());
+			dto = map.get(s.getUserId());
 			if(dto != null){
 			if(dto != null){
 				if(dto.getTotalCourseTimes() != dto.getFreePracticeCourseTimes()){
 				if(dto.getTotalCourseTimes() != dto.getFreePracticeCourseTimes()){
+					s.setOperatingTag(1);
 					updateStudentList.add(s);
 					updateStudentList.add(s);
 				}
 				}
 			}
 			}

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

@@ -421,4 +421,12 @@
         AND pg.buy_months_ >= 1
         AND pg.buy_months_ >= 1
         GROUP BY pg.organ_id_
         GROUP BY pg.organ_id_
     </select>
     </select>
+
+    <!-- 获取所有体验人数 -->
+    <select id="getAllTryNums" resultMap="practice4Organ">
+        SELECT su.organ_id_, COUNT(s.user_id_) try_num_ FROM student s
+        LEFT JOIN sys_user su ON  su.id_ = s.user_id_
+            WHERE s.operating_tag_ =1 AND su.organ_id_ >0
+        GROUP BY su.organ_id_
+    </select>
 </mapper>
 </mapper>

+ 110 - 0
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -133,4 +133,114 @@
 			WHERE user_id_ = #{item.userId}
 			WHERE user_id_ = #{item.userId}
         </foreach>
         </foreach>
 	</update>
 	</update>
+
+	<resultMap id="student4operating" type="com.ym.mec.biz.dal.dto.Student4operating">
+		<result column="organ_name_" property="organName"/>
+		<result column="organ_id_" property="organId"/>
+		<result column="student_name_" property="studentName"/>
+		<result column="student_id_" property="studentId"/>
+		<result column="teacher_id_" property="teacherId"/>
+		<result column="teacher_name_" property="teacherName"/>
+		<result column="operating_tag_" property="operatingTag"/>
+		<result column="vip_times_" property="vipTimes"/>
+		<result column="free_practice_times_" property="freePracticeTimes"/>
+		<result column="buy_practice_times_" property="buyPracticeTimes"/>
+	</resultMap>
+
+	<select id="getOperatingStudents" resultMap="student4operating">
+		SELECT su.organ_id_,
+		o.name_ organ_name_,
+		su.username_   student_name_,
+		s.user_id_     student_id_,
+		tsu.id_        teacher_id_,
+		tsu.real_name_ teacher_name_,
+		s.operating_tag_,
+		a.vip_times_,
+		a.buy_practice_times_,
+		p.free_practice_times_
+		FROM student s
+		LEFT JOIN sys_user su ON s.user_id_ = su.id_
+		LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
+		LEFT JOIN organization o ON o.id_ = su.organ_id_
+		LEFT JOIN (
+		SELECT s.user_id_,
+		SUM(case when (cs.group_type_ = 'VIP') then 1 ELSE 0 END) vip_times_,
+		SUM(case when (pg.buy_months_ > 0) then 1 ELSE 0 END)     buy_practice_times_
+		FROM student s
+		LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
+		LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+		LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
+		WHERE cs.status_ IN ('NOT_START','UNDERWAY')
+		GROUP BY s.user_id_
+		) a on a.user_id_ = s.user_id_
+		LEFT JOIN (
+		SELECT student_id_, count(id_) free_practice_times_
+		FROM practice_group
+		WHERE buy_months_ IS NULL
+		GROUP BY student_id_
+		) p ON p.student_id_ = s.user_id_
+		<include refid="student4OperatingQueryCondition"/>
+		ORDER BY s.user_id_
+		<include refid="global.limit"/>
+	</select>
+
+	<select id="countOperatingStudents" resultType="int">
+		SELECT COUNT(s.user_id_) FROM student s
+		LEFT JOIN sys_user su ON s.user_id_ = su.id_
+		LEFT JOIN sys_user tsu ON tsu.id_ = s.teacher_id_
+		LEFT JOIN (
+		SELECT s.user_id_,
+		SUM(case when (cs.group_type_ = 'VIP') then 1 ELSE 0 END) vip_times_,
+		SUM(case when (pg.buy_months_ > 0) then 1 ELSE 0 END)     buy_practice_times_
+		FROM student s
+		LEFT JOIN course_schedule_student_payment cssp ON cssp.user_id_ = s.user_id_
+		LEFT JOIN course_schedule cs ON cs.id_ = cssp.course_schedule_id_
+		LEFT JOIN practice_group pg ON pg.`id_` = cs.`music_group_id_` AND cs.`group_type_` = 'PRACTICE'
+		WHERE cs.status_ IN ('NOT_START','UNDERWAY')
+		GROUP BY s.user_id_
+		) a on a.user_id_ = s.user_id_
+		LEFT JOIN (
+		SELECT student_id_, count(id_) free_practice_times_
+		FROM practice_group
+		WHERE buy_months_ IS NULL
+		GROUP BY student_id_
+		) p ON p.student_id_ = s.user_id_
+
+		<include refid="student4OperatingQueryCondition"/>
+	</select>
+
+	<sql id="student4OperatingQueryCondition">
+		<where>
+			<if test="search != null and search != ''">
+				AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_ LIKE CONCAT('%',#{search},'%'))
+			</if>
+			<if test="organId != null and organId != ''">
+				AND FIND_IN_SET(su.organ_id_,#{organId})
+			</if>
+			<if test="teacherId!=null">
+				AND s.teacher_id_ = #{teacherId}
+			</if>
+			<if test="operatingTag !=null">
+				AND s.operating_tag_ = #{operatingTag}
+			</if>
+			<if test='hasVip != null and hasVip=="1"'>
+				AND a.vip_times_ >=1
+			</if>
+			<if test='hasVip != null and hasVip=="0"'>
+				AND (a.vip_times_ =0 OR a.vip_times_ IS NULL)
+			</if>
+			<if test='HasFreePractice != null and HasFreePractice=="1"'>
+				AND p.free_practice_times_ >=1
+			</if>
+			<if test='HasFreePractice != null and HasFreePractice=="0"'>
+				AND (p.free_practice_times_ =0 OR p.free_practice_times_ IS NULL)
+			</if>
+			<if test='HasBuyPractice != null and HasBuyPractice=="1"'>
+				AND a.buy_practice_times_ >=1
+			</if>
+			<if test='HasBuyPractice != null and HasBuyPractice=="0"'>
+				AND (a.buy_practice_times_ =0 OR a.buy_practice_times_ IS NULL)
+			</if>
+		</where>
+	</sql>
 </mapper>
 </mapper>

+ 37 - 29
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -496,10 +496,12 @@ public class StudentOrderController extends BaseController {
         Date nowDate = new Date();
         Date nowDate = new Date();
         List<Organization> organs = organizationDao.findAllOrgans();
         List<Organization> organs = organizationDao.findAllOrgans();
         //除去禁止的体验人数
         //除去禁止的体验人数
-        List<Practice4OrganDto> organTryNums = courseScheduleEvaluateDao.getTryNums();
-        List<Practice4OrganDto> organPracticeTryNums = courseScheduleEvaluateDao.getPracticeTryNums();
-        List<Practice4OrganDto> organVipTryNums = courseScheduleEvaluateDao.getVipTryNums();
-        List<Practice4OrganDto> organPracticeAndVipTryNums = courseScheduleEvaluateDao.getPracticeAndVipTryNums();
+//        List<Practice4OrganDto> organTryNums = courseScheduleEvaluateDao.getTryNums();
+//        List<Practice4OrganDto> organPracticeTryNums = courseScheduleEvaluateDao.getPracticeTryNums();
+//        List<Practice4OrganDto> organVipTryNums = courseScheduleEvaluateDao.getVipTryNums();
+//        List<Practice4OrganDto> organPracticeAndVipTryNums = courseScheduleEvaluateDao.getPracticeAndVipTryNums();
+        List<Practice4OrganDto> allTryNums = courseScheduleEvaluateDao.getAllTryNums();
+
         List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null);
         List<Practice4OrganDto> practiceBuyNums = courseScheduleEvaluateDao.getPracticeBuyNums(nowDate, null);
         List<Practice4OrganDto> vipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(nowDate, null);
         List<Practice4OrganDto> vipBuyNums = courseScheduleEvaluateDao.getVipBuyNums(nowDate, null);
 
 
@@ -532,31 +534,37 @@ public class StudentOrderController extends BaseController {
             practice4OrganDto.setOrganName(organ.getName());
             practice4OrganDto.setOrganName(organ.getName());
             practice4OrganDto.setOrganId(organ.getId());
             practice4OrganDto.setOrganId(organ.getId());
             //体验人数(除去禁止)
             //体验人数(除去禁止)
-            for (Practice4OrganDto organTryNum : organTryNums) {
-                if (organ.getId().equals(organTryNum.getOrganId())) {
-                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organTryNum.getTryNum());
-                    break;
-                }
-            }
-            //网管课体验人数(禁止)
-            for (Practice4OrganDto organPracticeTryNum : organPracticeTryNums) {
-                if (organ.getId().equals(organPracticeTryNum.getOrganId())) {
-                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organPracticeTryNum.getTryNum());
-                    break;
-                }
-            }
-            //vip课体验人数(禁止)
-            for (Practice4OrganDto organVipTryNum : organVipTryNums) {
-                if (organ.getId().equals(organVipTryNum.getOrganId())) {
-                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organVipTryNum.getTryNum());
-                    break;
-                }
-            }
-            //减去vip中在网管课的人数
-            for (Practice4OrganDto organPracticeAndVipTryNum : organPracticeAndVipTryNums) {
-                if (organ.getId().equals(organPracticeAndVipTryNum.getOrganId())) {
-                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() - organPracticeAndVipTryNum.getTryNum());
-                    break;
+//            for (Practice4OrganDto organTryNum : organTryNums) {
+//                if (organ.getId().equals(organTryNum.getOrganId())) {
+//                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organTryNum.getTryNum());
+//                    break;
+//                }
+//            }
+//            //网管课体验人数(禁止)
+//            for (Practice4OrganDto organPracticeTryNum : organPracticeTryNums) {
+//                if (organ.getId().equals(organPracticeTryNum.getOrganId())) {
+//                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organPracticeTryNum.getTryNum());
+//                    break;
+//                }
+//            }
+//            //vip课体验人数(禁止)
+//            for (Practice4OrganDto organVipTryNum : organVipTryNums) {
+//                if (organ.getId().equals(organVipTryNum.getOrganId())) {
+//                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() + organVipTryNum.getTryNum());
+//                    break;
+//                }
+//            }
+//            //减去vip中在网管课的人数
+//            for (Practice4OrganDto organPracticeAndVipTryNum : organPracticeAndVipTryNums) {
+//                if (organ.getId().equals(organPracticeAndVipTryNum.getOrganId())) {
+//                    practice4OrganDto.setTryNum(practice4OrganDto.getTryNum() - organPracticeAndVipTryNum.getTryNum());
+//                    break;
+//                }
+//            }
+
+            for (Practice4OrganDto allTryNum : allTryNums) {
+                if (organ.getId().equals(allTryNum.getOrganId())) {
+                    practice4OrganDto.setTryNum(allTryNum.getTryNum());
                 }
                 }
             }
             }
             //网管课转化人数
             //网管课转化人数

+ 104 - 10
mec-web/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -5,10 +5,7 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
-import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
@@ -107,9 +104,9 @@ public class ExportController extends BaseController {
         List<StudentBuyPracticeDto> rows = practiceGroupService.studentBuys(queryInfo).getRows();
         List<StudentBuyPracticeDto> rows = practiceGroupService.studentBuys(queryInfo).getRows();
         OutputStream outputStream = response.getOutputStream();
         OutputStream outputStream = response.getOutputStream();
         try {
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员名称", "所属分部","课程老师","课程组老师", "购买网管课",
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"学员编号", "学员名称", "所属分部", "课程老师", "课程组老师", "购买网管课",
                     "免费课结束日期", "首次购买日期", "时间差"}, new String[]{
                     "免费课结束日期", "首次购买日期", "时间差"}, new String[]{
-                    "studentId", "studentName", "organName","teacherName","courseGroupTeacherName" ,"buyPractice.msg",
+                    "studentId", "studentName", "organName", "teacherName", "courseGroupTeacherName", "buyPractice.msg",
                     "lastClassDate", "firstBuyTime", "intervalDay"}, rows);
                     "lastClassDate", "firstBuyTime", "intervalDay"}, rows);
             response.setContentType("application/octet-stream");
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -949,7 +946,7 @@ public class ExportController extends BaseController {
 
 
         try {
         try {
             String[] header = {"分部", "学生编号", "学生姓名", "网管课老师id", "网管课老师", "有效期截止时间", "课程截止时间", "总课时", "剩余课时", "是否购买"};
             String[] header = {"分部", "学生编号", "学生姓名", "网管课老师id", "网管课老师", "有效期截止时间", "课程截止时间", "总课时", "剩余课时", "是否购买"};
-            String[] body = {"organName", "studentId", "studentName", "teacherIds", "teacherName", "expireDate", "classEndDate", "totalClassTimes", "noStartClassTimes","buyPractice.msg"};
+            String[] body = {"organName", "studentId", "studentName", "teacherIds", "teacherName", "expireDate", "classEndDate", "totalClassTimes", "noStartClassTimes", "buyPractice.msg"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, practiceGroupExports);
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, practiceGroupExports);
             response.setContentType("application/octet-stream");
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
@@ -1183,13 +1180,110 @@ public class ExportController extends BaseController {
             response.flushBuffer();
             response.flushBuffer();
             return;
             return;
         }
         }
+        for (TeacherCourseSalaryDetail4WebDto row : rows) {
+            if (Objects.isNull(row.getSignInTime())) {
+                row.setSignInStatusStr("未签到");
+            } else {
+                String signInTimeStr = DateUtil.dateToString(row.getSignInTime(), "yyyy-MM-dd HH:mm");
+                if (YesOrNoEnum.YES.equals(row.getSignInStatus())) {
+                    row.setSignInStatusStr(signInTimeStr + "(正常签到)");
+                } else {
+                    row.setSignInStatusStr(signInTimeStr + "(异常签到)");
+                }
+            }
+            if (Objects.isNull(row.getSignOutTime())) {
+                row.setSignOutStatusStr("未签退");
+            } else {
+                String signOutTimeStr = DateUtil.dateToString(row.getSignOutTime(), "yyyy-MM-dd HH:mm");
+                if (YesOrNoEnum.YES.equals(row.getSignOutStatus())) {
+                    row.setSignOutStatusStr(signOutTimeStr + "(正常签退)");
+                } else {
+                    row.setSignOutStatusStr(signOutTimeStr + "(异常签退)");
+                }
+            }
+        }
         OutputStream ouputStream = null;
         OutputStream ouputStream = null;
         try {
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(
             HSSFWorkbook workbook = POIUtil.exportExcel(
                     new String[]{"分部", "课程组类型", "课程编号", "时间", "课程名称", "老师编号", "老师姓名", "签到时间", "签退时间", "应发课酬",
                     new String[]{"分部", "课程组类型", "课程编号", "时间", "课程名称", "老师编号", "老师姓名", "签到时间", "签退时间", "应发课酬",
-                                 "课酬扣款", "结算课酬", "结算课酬", "状态", "备注"},
-                    new String[]{"organName", "groupType", "courseScheduleId", "startClassTime", "courseName", "teacherId", "teacherName",
-                                "signInTime", "signOutTime", "actualSalary", "reduceSalary", "finalSalary", "confirmStatus", "memo"}, rows);
+                            "课酬扣款", "结算课酬", "状态", "备注"},
+                    new String[]{"organName", "groupType.desc", "courseScheduleId", "startClassTime", "courseName", "teacherId", "teacherName",
+                            "signInStatusStr", "signOutStatusStr", "actualSalary", "reduceSalary", "finalSalary", "confirmStatus.desc", "memo"}, rows);
+            response.setContentType("application/octet-stream");
+            response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
+            ouputStream = response.getOutputStream();
+            workbook.write(ouputStream);
+            ouputStream.flush();
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            if (ouputStream != null) {
+                try {
+                    ouputStream.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+
+    @ApiOperation(value = "课外训练-教学导出")
+    @GetMapping("export/operatingStudents")
+    @PreAuthorize("@pcs.hasPermissions('export/operatingStudents')")
+    public void operatingStudents(StudentOperatingQueryInfo queryInfo, HttpServletResponse response) {
+        queryInfo.setRows(999999);
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            throw new BizException("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+                throw new BizException("用户所在分部异常");
+            } else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                    throw new BizException("非法请求");
+                }
+            }
+        }
+        PageInfo<Student4operating> PageOperatingStudents = studentManageService.getOperatingStudents(queryInfo);
+
+        if (PageOperatingStudents.getTotal() <= 0) {
+            throw new BizException("导出记录不存在");
+        }
+        List<Student4operating> rows = PageOperatingStudents.getRows();
+        for (Student4operating row : rows) {
+            if(row.getOperatingTag() != null && row.getOperatingTag()==1){
+                row.setOperatingTagStr("是");
+            }else {
+                row.setOperatingTagStr("否");
+            }
+            if(row.getVipTimes() != null && row.getVipTimes() >0){
+                row.setVipTimesStr("有");
+            }else {
+                row.setVipTimesStr("无");
+            }
+            if(row.getFreePracticeTimes() != null && row.getFreePracticeTimes() >0){
+                row.setFreePracticeTimesStr("有");
+            }else {
+                row.setFreePracticeTimesStr("无");
+            }
+            if(row.getBuyPracticeTimes() != null && row.getBuyPracticeTimes() >0){
+                row.setBuyPracticeTimesStr("有");
+            }else {
+                row.setBuyPracticeTimesStr("无");
+            }
+        }
+        OutputStream ouputStream = null;
+        try {
+
+            HSSFWorkbook workbook = POIUtil.exportExcel(
+                    new String[]{"分部", "学生", "学生编号", "指导老师","指导老师id", "运营指标", "VIP课", "免费网管课", "付费网管课"},
+                    new String[]{"organName", "studentName", "studentId", "teacherName","teacherId", "operatingTagStr", "vipTimesStr", "freePracticeTimesStr", "buyPracticeTimesStr"}, rows);
             response.setContentType("application/octet-stream");
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");
             ouputStream = response.getOutputStream();
             ouputStream = response.getOutputStream();

+ 24 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -262,4 +262,28 @@ public class StudentManageController extends BaseController {
         }
         }
         return succeed(studentManageService.sumStudentAttendance(courseScheduleId));
         return succeed(studentManageService.sumStudentAttendance(courseScheduleId));
     }
     }
+
+    @ApiOperation(value = "获取运营指标列表")
+    @GetMapping("/getOperatingStudents")
+    @PreAuthorize("@pcs.hasPermissions('studentManage/getOperatingStudents')")
+    public Object getOperatingStudents(StudentOperatingQueryInfo queryInfo){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+                return failed("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+                    return failed("非法请求");
+                }
+            }
+        }
+        return succeed(studentManageService.getOperatingStudents(queryInfo));
+    }
 }
 }