Bläddra i källkod

Merge remote-tracking branch 'origin/teacher_income' into teacher_income

zouxuan 4 år sedan
förälder
incheckning
0ef2b5aad8

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

@@ -123,6 +123,17 @@ public class Teacher extends SysUser {
 	private BigDecimal operatingIndex;
 	private BigDecimal serviceIndex;
 
+	@ApiModelProperty(value = "是否结算课酬")
+	private Boolean isSettlementSalary;
+
+	public Boolean getIsSettlementSalary() {
+		return isSettlementSalary;
+	}
+
+	public void setIsSettlementSalary(Boolean isSettlementSalary) {
+		this.isSettlementSalary = isSettlementSalary;
+	}
+
 	public BigDecimal getOperatingIndex() {
 		return operatingIndex;
 	}

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TeacherQueryInfo.java

@@ -28,6 +28,17 @@ public class TeacherQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "是否支持额外陪练课授课")
     private Boolean isSupportExtraPracticeLesson;
 
+    @ApiModelProperty(value = "是否结算课酬")
+    private Boolean isSettlementSalary;
+
+    public Boolean getIsSettlementSalary() {
+        return isSettlementSalary;
+    }
+
+    public void setIsSettlementSalary(Boolean isSettlementSalary) {
+        this.isSettlementSalary = isSettlementSalary;
+    }
+
     public Integer getTenantId() {
         return tenantId;
     }

+ 17 - 7
mec-biz/src/main/resources/config/mybatis/CourseScheduleTeacherSalaryMapper.xml

@@ -292,13 +292,15 @@
 		    cs.schoole_id_,
 			csts.*
 		FROM
-		course_schedule_teacher_salary csts
-		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
-		LEFT JOIN vip_group vg ON vg.id_ = cs.music_group_id_
+			course_schedule_teacher_salary csts
+			LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
+			LEFT JOIN vip_group vg ON vg.id_ = cs.music_group_id_
+			LEFT JOIN teacher tea ON csts.user_id_=tea.id_
 		WHERE 1=1
 		<if test="startDate != null">
 			AND cs.class_date_ BETWEEN #{startDate} AND #{endDate}
 		</if>
+		AND tea.is_settlement_salary_ = 1
 		AND cs.group_type_ = 'VIP' AND vg.organ_id_ != 41
 		AND csts.settlement_time_ IS NULL
 		AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
@@ -323,12 +325,14 @@
 		cs.schoole_id_,
 		csts.*
 		FROM
-		course_schedule_teacher_salary csts
-		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
+			course_schedule_teacher_salary csts
+			LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
+			LEFT JOIN teacher tea ON csts.user_id_=tea.id_
 		WHERE 1=1
 		<if test="startDate != null">
 			AND cs.class_date_ BETWEEN #{startDate} AND #{endDate}
 		</if>
+		AND tea.is_settlement_salary_ = 1
 		AND cs.type_ = 'PRACTICE'
 		AND csts.settlement_time_ IS NULL
 		AND (cs.del_flag_ IS NULL OR cs.del_flag_=0)
@@ -439,12 +443,14 @@
 		WHEN ta.sign_in_status_ IS NULL OR ta.sign_in_status_ = 0 THEN 0.5
 		WHEN ta.sign_out_status_ IS NULL OR ta.sign_out_status_ = 0 THEN 0.5 ELSE 1 END) ELSE csts.expect_salary_ END teacher_actual_salary_
 		FROM course_schedule_teacher_salary csts
-		LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = csts.course_schedule_id_
-		LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
+			LEFT JOIN teacher_attendance ta ON ta.course_schedule_id_ = csts.course_schedule_id_
+			LEFT JOIN course_schedule cs ON cs.id_ = csts.course_schedule_id_
+			LEFT JOIN teacher tea ON csts.user_id_=tea.id_
 		WHERE csts.course_schedule_id_ IN
 		<foreach collection="courseScheduleIds" item="courseScheduleId" open="(" close=")" separator=",">
 			#{courseScheduleId}
 		</foreach>
+		AND tea.is_settlement_salary_=1
 		AND csts.settlement_time_ IS NULL
 	</select>
 
@@ -707,6 +713,7 @@
 		LEFT JOIN organization mgo ON mgo.id_ = mg.organ_id_
 		LEFT JOIN charge_type ct ON ct.id_ = mg.charge_type_id_
 		WHERE cs.class_date_ BETWEEN #{firstDayOfMonth} AND #{lastDayOfMonth} AND cs.`del_flag_` != 1 AND cs.group_type_ = 'MUSIC' AND ts.settlement_time_ IS NOT NULL
+		AND t.is_settlement_salary_ = 1
 		<if test="courseTypeList != null">
 			and cs.type_ in (#{courseTypeList})
 		</if>
@@ -747,6 +754,7 @@
 		left join vip_group_category vgc on vgc.id_ = vg.vip_group_category_id_
 		WHERE vg.organ_id_ != 41 AND cs.class_date_ BETWEEN #{firstDayOfMonth} AND #{lastDayOfMonth} AND cs.`del_flag_` != 1
 		AND cs.group_type_ = 'VIP' AND ts.settlement_time_ IS NOT NULL
+		AND t.is_settlement_salary_ = 1
 		<if test="courseTypeList != null">
 			and cs.type_ in (#{courseTypeList})
 		</if>
@@ -786,6 +794,7 @@
 		LEFT JOIN practice_group pg ON (pg.id_ = ts.music_group_id_ AND ts.group_type_ = 'PRACTICE')
 		LEFT JOIN organization pgo ON pgo.id_ = pg.organ_id_
 		WHERE cs.class_date_ BETWEEN #{firstDayOfMonth} AND #{lastDayOfMonth} AND cs.`del_flag_` != 1 AND cs.group_type_ = 'PRACTICE' AND ts.settlement_time_ IS NOT NULL
+		AND t.is_settlement_salary_ = 1
 		<if test="courseTypeList != null">
 			and cs.type_ in (#{courseTypeList})
 		</if>
@@ -842,6 +851,7 @@
 			(cs.del_flag_ IS NULL OR cs.del_flag_=0)
             AND csts.group_type_!='COMM'
 			AND csts.settlement_time_ IS NOT NULL
+			AND t.is_settlement_salary_ = 1
 			<if test="teacherId!=null">
 				AND csts.user_id_=#{teacherId}
 			</if>

+ 12 - 4
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -55,6 +55,7 @@
         <result column="im_token_" property="imToken"/>
         <result column="subject_name_" property="splitSubjectName"/>
         <result column="id_card_no_" property="idCardNo"/>
+        <result column="is_settlement_salary_" property="isSettlementSalary"/>
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.dto.TeacherDefaultSalaryDto" id="TeacherDefaultSalaryDto">
@@ -117,7 +118,8 @@
         t.lecture_num_,t.idcard_front_img_,t.idcard_back_img_,t.idcard_hand_img_,t.memo_,
         su.real_name_,su.id_card_no_,su.password_,su.salt_,su.phone_,su.avatar_,
         su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
-        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,su.username_,su.organ_id_
+        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,su.username_,su.organ_id_,
+        t.is_settlement_salary_
         FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
         WHERE t.id_ = #{id} AND su.del_flag_ = 0
@@ -138,8 +140,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_,formal_staff_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_course_schedule_rewards_rules_,idcard_front_img_,idcard_back_img_,idcard_hand_img_,memo_)
-        VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{formalStaffDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportCourseScheduleRewardsRules},#{idcardFrontImg},#{idcardBackImg},#{idcardHandImg},#{memo})
+        (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,formal_staff_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_course_schedule_rewards_rules_,idcard_front_img_,idcard_back_img_,idcard_hand_img_,memo_,is_settlement_salary_)
+        VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{formalStaffDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportCourseScheduleRewardsRules},#{idcardFrontImg},#{idcardBackImg},#{idcardHandImg},#{memo},#{isSettlementSalary})
     </insert>
 
     <insert id="addSysUser" parameterType="com.ym.mec.auth.api.entity.SysUser" useGeneratedKeys="true" keyColumn="id"
@@ -220,6 +222,9 @@
             <if test="idcardHandImg != null">
                 idcard_hand_img_ = #{idcardHandImg},
             </if>
+            <if test="isSettlementSalary != null">
+                is_settlement_salary_ = #{isSettlementSalary},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>
@@ -293,7 +298,7 @@
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="Teacher" parameterType="map">
         SELECT t.id_,su.real_name_,su.lock_flag_,t.subject_id_,su.phone_,t.organ_id_ teacher_organ_id_,t.organ_id_,t.is_support_extra_practice_lesson_,
-        t.job_nature_,t.demission_date_,t.formal_staff_date_,t.is_probation_period_,t.memo_,GROUP_CONCAT(s.name_) subject_name_,su.del_flag_
+        t.job_nature_,t.demission_date_,t.formal_staff_date_,t.is_probation_period_,t.memo_,GROUP_CONCAT(s.name_) subject_name_,su.del_flag_,t.is_settlement_salary_
         FROM teacher t
         LEFT JOIN sys_user su ON t.id_ = su.id_
         LEFT JOIN `subject` s ON FIND_IN_SET(s.id_,t.subject_id_)
@@ -336,6 +341,9 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="isSettlementSalary!=null">
+                AND t.is_settlement_salary_ = #{isSettlementSalary}
+            </if>
             <if test="search != null">
                 AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR t.id_ = #{search})
             </if>