yonge 5 vuotta sitten
vanhempi
commit
0a258d45ee

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Teacher.java

@@ -90,6 +90,9 @@ public class Teacher extends SysUser {
 	
 	@ApiModelProperty(value = "离职时间", required = false)
 	private Date demissionDate;
+	
+	@ApiModelProperty(value = "是否支持课程奖励规则活动", required = false)
+	private Boolean isSupportCourseScheduleRewardsRules;
 
 	private List<School> teacherSchools;
 
@@ -261,6 +264,14 @@ public class Teacher extends SysUser {
 		this.demissionDate = demissionDate;
 	}
 
+	public Boolean getIsSupportCourseScheduleRewardsRules() {
+		return isSupportCourseScheduleRewardsRules;
+	}
+
+	public void setIsSupportCourseScheduleRewardsRules(Boolean isSupportCourseScheduleRewardsRules) {
+		this.isSupportCourseScheduleRewardsRules = isSupportCourseScheduleRewardsRules;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentApplyrefundsQueryInfo.java

@@ -11,6 +11,8 @@ public class StudentApplyrefundsQueryInfo extends QueryInfo {
 	private Date endTime;
 
 	private String status;
+	
+	private Integer organId;
 
 	public String getStatus() {
 		return status;
@@ -35,4 +37,12 @@ public class StudentApplyrefundsQueryInfo extends QueryInfo {
 	public void setEndTime(Date endTime) {
 		this.endTime = endTime;
 	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
 }

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -1373,16 +1373,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if (list != null && list.size() > 0) {
 
 			Integer organId = null, teacherId = null, coursesTimes = 0;
+			boolean isSupportCourseScheduleRewardsRules = false;
 
 			for (Map<Integer, Integer> map : list) {
 				organId = map.get("organ_id_");
 				teacherId = map.get("teacher_id_");
 				coursesTimes = map.get("times");
+				isSupportCourseScheduleRewardsRules = Boolean.parseBoolean(map.get("is_support_course_schedule_rewards_rules_").toString());
 
-				BigDecimal decimal = courseScheduleRewardsRulesService.queryRewardsAmount(organId, CourseScheduleType.VIP, coursesTimes);
-				if (decimal.doubleValue() > 0) {
-					sysUserCashAccountDetailService.addCashAccountDetail(teacherId, decimal, "", SysUserCashAccountDetailService.ORGAN,
-							PlatformCashAccountDetailTypeEnum.REWARDS, null, DealStatusEnum.SUCCESS, "分部奖励");
+				if (isSupportCourseScheduleRewardsRules) {
+					BigDecimal decimal = courseScheduleRewardsRulesService.queryRewardsAmount(organId, CourseScheduleType.VIP, coursesTimes);
+					if (decimal.doubleValue() > 0) {
+						sysUserCashAccountDetailService.addCashAccountDetail(teacherId, decimal, "", SysUserCashAccountDetailService.ORGAN,
+								PlatformCashAccountDetailTypeEnum.REWARDS, null, DealStatusEnum.SUCCESS, "分部奖励");
+					}
 				}
 			}
 		}

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -841,7 +841,7 @@
     </select>
     
     <select id="queryVipGroupTeachereClassTimesByMonth" resultType="map" parameterType="map">
-        SELECT vp.organ_id_ organ_id_,cs.actual_teacher_id_ teacher_id_,count(cs.id_) times FROM course_schedule cs left join vip_group vp on cs.music_group_id_ = vp.id_ where cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and date_format(#{monthDate} , '%Y%m' ) = date_format(cs.class_date_, '%Y%m' ) group by vp.organ_id_,cs.actual_teacher_id_
+        SELECT vp.organ_id_ organ_id_,cs.actual_teacher_id_ teacher_id_,count(cs.id_) times,t.is_support_course_schedule_rewards_rules_ FROM course_schedule cs left join vip_group vp on cs.music_group_id_ = vp.id_ left join teacher t on cs.actual_teacher_id_ = t.id_ where cs.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} and date_format(#{monthDate} , '%Y%m' ) = date_format(cs.class_date_, '%Y%m' ) group by vp.organ_id_,cs.actual_teacher_id_
     </select>
     
     <select id="queryFinishedWithNoUpdateStatus" resultMap="CourseSchedule">

+ 11 - 2
mec-biz/src/main/resources/config/mybatis/StudentApplyRefundsMapper.xml

@@ -96,14 +96,17 @@
             and sar.create_time_ &lt;= #{endTime}
         </if>
         <if test="status!=null and status!=''">
-            and status_=#{status}
+            and sar.status_=#{status}
+        </if>
+        <if test="organId!=null and organId!=''">
+            and u.organ_id_=#{organId}
         </if>
         ORDER BY sar.id_ <include refid="global.limit"/>
     </select>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int" parameterType="map">
-		SELECT count(1) FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ 
+		SELECT count(1) FROM student_apply_refunds sar left join student_payment_order spo on sar.orig_payment_order_id_ = spo.id_ left join sys_user u on sar.user_id_ = u.id_
 		where 1=1 
         <if test="startTime != null">
             and sar.create_time_ &gt;= #{startTime}
@@ -111,6 +114,12 @@
         <if test="endTime != null">
             and sar.create_time_ &lt;= #{endTime}
         </if>
+        <if test="status!=null and status!=''">
+            and sar.status_=#{status}
+        </if>
+        <if test="organId!=null and organId!=''">
+            and u.organ_id_=#{organId}
+        </if>
 	</select>
 
     <select id="checkIsApplyRefund" resultType="java.util.Map">

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -113,7 +113,7 @@
 	                current_class_times_ = #{item.currentClassTimes},
 	            </if>
         	</set>
-	        where id_ = ${item.id}
+	        where id_ = #{item.id}
 	    </foreach>      
 	</update>
 

+ 1 - 2
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -486,11 +486,10 @@
         SELECT count(sr.id_) total_num_,sum(case when sr.create_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) new_num_,sum(case when sr.music_group_status_ = 'QUIT' and sr.update_time_ >= timestamp(date_add(curdate(), interval - day(curdate()) + 1 day)) then 1 else 0 end) quit_num_
         FROM student_registration sr left join music_group mg on sr.music_group_id_ = mg.id_
         <where>
-            sr.music_group_status_ != 'QUIT'
     		<if test="organId != null">
     			AND mg.organ_id_ = #{organId}
     		</if>
-    	</where> 
+    	</where>
     </select>
     <select id="findMapByMusicGroupId" resultType="java.util.Map">
         SELECT sr.user_id_ 'key',MIN(sr.parents_phone_) 'value' FROM student_registration sr

+ 6 - 2
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -25,6 +25,7 @@
         <result column="certificate_num_" property="certificateNum"/>
         <result column="flow_organ_range_" property="flowOrganRange"/>
         <result column="introduction_" property="introduction"/>
+        <result column="is_support_course_schedule_rewards_rules_" property="isSupportCourseScheduleRewardsRules"/>
         <result column="update_time_" property="updateTime"/>
         <result column="create_time_" property="createTime"/>
 
@@ -68,8 +69,8 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
         INSERT INTO teacher
-        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_)
-        VALUES(#{id},#{organId},#{jobType},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now())
+        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_course_schedule_rewards_rules_)
+        VALUES(#{id},#{organId},#{jobType},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportCourseScheduleRewardsRules})
     </insert>
 
     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
@@ -132,6 +133,9 @@
             <if test="introduction != null">
                 introduction_ = #{introduction},
             </if>
+            <if test="isSupportCourseScheduleRewardsRules != null">
+                is_support_course_schedule_rewards_rules_ = #{isSupportCourseScheduleRewardsRules},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>