Bläddra i källkod

Merge remote-tracking branch 'origin/master'

周箭河 4 år sedan
förälder
incheckning
e62323d782

+ 2 - 1
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -186,7 +186,7 @@
 	<!-- 分页查询 -->
 	<select id="queryHomePage" resultMap="SysNewsInformation"
 		parameterType="map">
-		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni where sni.del_flag_=0
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_) where sni.del_flag_=0
 		<if test="type != null">
 			and sni.type_ = #{type}
 		</if>
@@ -219,6 +219,7 @@
 				</otherwise>
 			</choose>
 		</if>
+		group by sni.id_
 		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
 		<include refid="global.limit" />
 	</select>

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

@@ -109,9 +109,9 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     int countNoPaymentStudentNum(@Param("organIds") Set<Integer> organIds);
     List<String> getNoPaymentMusicGroup(@Param("organIds") Set<Integer> organIds);
 
-    int countApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
+    List<Long> queryApplyForQuitGroupNum(@Param("organIds") Set<Integer> organIds);
 
-    int countStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
+    List<Long> queryStudentAttendanceInfo(@Param("organIds") Set<Integer> organIds,
                                    @Param("type") String type);
 
 

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/MusicGroupQuitQueryInfo.java

@@ -0,0 +1,16 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+
+public class MusicGroupQuitQueryInfo extends QueryInfo {
+
+    private String ids;
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
+}

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

@@ -53,6 +53,17 @@ public class StudentAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "分部")
     private String organId;
 
+    @ApiModelProperty(value = "courseScheduleStudentPaymentId")
+    private String ids;
+
+    public String getIds() {
+        return ids;
+    }
+
+    public void setIds(String ids) {
+        this.ids = ids;
+    }
+
     public Long getCourseScheduleId() {
         return courseScheduleId;
     }

+ 7 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/IndexBaseMonthDataServiceImpl.java

@@ -336,9 +336,12 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 		List<IndexErrInfoDto> twoChild = new ArrayList<>();
 
 		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_NOT_PAYMENT, IndexErrorType.STUDENT_NOT_PAYMENT.getMsg(), indexBaseMonthDataDao.countNoPaymentStudentNum(organIds), indexBaseMonthDataDao.getNoPaymentMusicGroup(organIds)));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), indexBaseMonthDataDao.countApplyForQuitGroupNum(organIds),  null));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode()), null));
-		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), indexBaseMonthDataDao.countStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode()), null));
+		List<Long> quitGroupNum = indexBaseMonthDataDao.queryApplyForQuitGroupNum(organIds);
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP, IndexErrorType.STUDENT_APPLY_FOR_QUIT_MUSIC_GROUP.getMsg(), quitGroupNum.size(),  quitGroupNum));
+		List<Long> attendanceInfo = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.TRUANT.getCode());
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_TRUANT_STUDENT_NUM, IndexErrorType.COURSE_TRUANT_STUDENT_NUM.getMsg(), attendanceInfo.size(), attendanceInfo));
+		List<Long> attendanceInfo1 = indexBaseMonthDataDao.queryStudentAttendanceInfo(organIds, StudentAttendanceStatusEnum.LEAVE.getCode());
+		twoChild.add(new IndexErrInfoDto(IndexErrorType.COURSE_LEAVE_STUDENT_NUM, IndexErrorType.COURSE_LEAVE_STUDENT_NUM.getMsg(), attendanceInfo1.size(), attendanceInfo1));
 		two.setNum(twoChild.stream().mapToInt(IndexErrInfoDto::getNum).sum());
 		two.setResult(twoChild);
 		all.add(two);
@@ -360,7 +363,7 @@ public class IndexBaseMonthDataServiceImpl extends BaseServiceImpl<Long, IndexBa
 
 		String monthStr = DateUtil.format(date, DateUtil.ISO_YEAR_MONTH_FORMAT);
 		List<Long> lowTeacherSalary = indexBaseMonthDataDao.queryLowTeacherSalary(organIdsStr,monthStr);
-		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), null));
+		threeChild.add(new IndexErrInfoDto(IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW, IndexErrorType.TEACHER_EXPECT_SALARY_BE_LOW.getMsg(),lowTeacherSalary.size(), lowTeacherSalary));
 
 		List<Long> inspectionItem = indexBaseMonthDataDao.queryInspectionItem(organIdsStr);
 		threeChild.add(new IndexErrInfoDto(IndexErrorType.INSPECTION_ITEM, IndexErrorType.INSPECTION_ITEM.getMsg(),inspectionItem.size(), inspectionItem));

+ 3 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -2325,7 +2325,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     paymentOrderDetails.add(studentPaymentOrderDetail);
                 });
             }
-            studentPaymentOrderDetailService.batchAdd(paymentOrderDetails);
+            if(paymentOrderDetails.size() > 0){
+                studentPaymentOrderDetailService.batchAdd(paymentOrderDetails);
+            }
 
             //缴费
             SysUserCashAccountDetail paymentDetail = new SysUserCashAccountDetail();

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

@@ -523,8 +523,8 @@
 			</if>
 	</select>
 
-	<select id="countApplyForQuitGroupNum" resultType="int">
-		SELECT COUNT(mgq.id_) FROM music_group_quit mgq
+	<select id="queryApplyForQuitGroupNum" resultType="java.lang.Long">
+		SELECT mgq.id_ FROM music_group_quit mgq
 			LEFT JOIN music_group mg ON mgq.music_group_id_=mg.id_
 		WHERE mg.status_='PROGRESS'
 		  AND mgq.status_='PROCESSING'
@@ -536,9 +536,9 @@
 		</if>
 	</select>
 
-	<select id="countStudentAttendanceInfo" resultType="java.lang.Integer">
+	<select id="queryStudentAttendanceInfo" resultType="java.lang.Long">
 		SELECT
-			COUNT( DISTINCT cssp.user_id_ )
+			DISTINCT cssp.user_id_
 		FROM
 			course_schedule_student_payment cssp
 			LEFT JOIN course_schedule cs ON cssp.course_schedule_id_ = cs.id_

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

@@ -94,14 +94,23 @@
         FROM music_group_quit mgq
         LEFT JOIN sys_user su ON su.id_ = mgq.user_id_
         LEFT JOIN music_group mg ON mg.id_ = mgq.music_group_id_
+        <include refid="queryPageSql"/>
         ORDER BY id_
         <include refid="global.limit"/>
     </select>
+    <sql id="queryPageSql">
+        <where>
+            <if test="ids != null and ids != ''">
+                FIND_IN_SET(mgq.id_,#{ids})
+            </if>
+        </where>
+    </sql>
 
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
         SELECT COUNT(*)
-        FROM music_group_quit
+        FROM music_group_quit mgq
+        <include refid="queryPageSql"/>
     </select>
     <select id="countMusicGroupQuitNum" resultType="int">
         SELECT COUNT(*)

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

@@ -493,98 +493,64 @@
         LEFT JOIN sys_user su ON cssp.user_id_ = su.id_
         left join sys_user tu on tu.id_ = cs.actual_teacher_id_
         left join organization o on o.id_ = cs.organ_id_
+        <include refid="findStudentAttendanceSql"/>
+        ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
+        <include refid="global.limit"/>
+    </select>
+    <sql id="findStudentAttendanceSql">
         <where>
-        	<if test="courseScheduleId != null">
-        		cssp.course_schedule_id_ = #{courseScheduleId}
-        	</if>
-        	<if test="search != null">
-        		and cssp.course_schedule_id_ = #{search}
-        	</if>
-        	<if test="studentID != null">
-        		and cssp.user_id_ = #{studentID}
-        	</if>
-        	<if test="startDateOfCourse != null">
-        		and cs.class_date_ &gt;= #{startDateOfCourse}
-        	</if>
-        	<if test="endDateOfCourse != null">
-        		and cs.class_date_ &lt;= #{endDateOfCourse}
-        	</if>
-        	<if test="courseScheduleType != null">
-        		and cs.type_ = #{courseScheduleType}
-        	</if>
-        	<if test="teacherId != null">
-        		and cs.actual_teacher_id_ = #{teacherId}
-        	</if>
-        	<if test="courseStatus != null">
-        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
+            <if test="courseScheduleId != null">
+                cssp.course_schedule_id_ = #{courseScheduleId}
+            </if>
+            <if test="search != null">
+                and cssp.course_schedule_id_ = #{search}
+            </if>
+            <if test="studentID != null">
+                and cssp.user_id_ = #{studentID}
+            </if>
+            <if test="startDateOfCourse != null">
+                and cs.class_date_ &gt;= #{startDateOfCourse}
+            </if>
+            <if test="endDateOfCourse != null">
+                and cs.class_date_ &lt;= #{endDateOfCourse}
+            </if>
+            <if test="courseScheduleType != null">
+                and cs.type_ = #{courseScheduleType}
+            </if>
+            <if test="teacherId != null">
+                and cs.actual_teacher_id_ = #{teacherId}
+            </if>
+            <if test="courseStatus != null">
+                and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="status != null">
                 and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
                 <if test="status.code == 'TRUANT'">
                     OR sa.id_ IS NULL
                 </if>
                 )
-        	</if>
-        	<if test="groupType != null">
-        		and cssp.group_type_ = #{groupType}
-        	</if>
-        	<if test="musicGroupId != null">
-        		and cssp.music_group_id_ = #{musicGroupId}
-        	</if>
+            </if>
+            <if test="groupType != null">
+                and cssp.group_type_ = #{groupType}
+            </if>
+            <if test="musicGroupId != null">
+                and cssp.music_group_id_ = #{musicGroupId}
+            </if>
             <if test="organId != null and organId != ''">
                 AND FIND_IN_SET(cs.organ_id_,#{organId})
             </if>
+            <if test="ids != null and ids != ''">
+                AND FIND_IN_SET(cssp.id_,#{ids})
+            </if>
         </where>
-        ORDER BY CONCAT(cs.class_date_, ' ', cs.start_class_time_) asc
-        <include refid="global.limit"/>
-    </select>
+    </sql>
     
     <select id="countStudentAttendance" resultType="java.lang.Integer">
         SELECT count(cssp.id_) 
-        FROM course_schedule_student_payment cssp left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
+        FROM course_schedule_student_payment cssp
+        left join course_schedule cs on cs.id_ = cssp.course_schedule_id_
         left join student_attendance sa on cssp.course_schedule_id_ = sa.course_schedule_id_ and cssp.user_id_ = sa.user_id_
-        <where>
-        	<if test="courseScheduleId != null">
-        		cssp.course_schedule_id_ = #{courseScheduleId}
-        	</if>
-        	<if test="search != null">
-        		and cssp.course_schedule_id_ = #{search}
-        	</if>
-        	<if test="studentID != null">
-        		and cssp.user_id_ = #{studentID}
-        	</if>
-        	<if test="startDateOfCourse != null">
-        		and cs.class_date_ &gt;= #{startDateOfCourse}
-        	</if>
-        	<if test="endDateOfCourse != null">
-        		and cs.class_date_ &lt;= #{endDateOfCourse}
-        	</if>
-        	<if test="courseScheduleType != null">
-        		and cs.type_ = #{courseScheduleType}
-        	</if>
-        	<if test="teacherId != null">
-        		and cs.actual_teacher_id_ = #{teacherId}
-        	</if>
-        	<if test="courseStatus != null">
-        		and cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-        	</if>
-        	<if test="status != null">
-        		and (sa.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
-                <if test="status.code == 'TRUANT'">
-                    OR sa.id_ IS NULL
-                </if>
-                )
-        	</if>
-        	<if test="groupType != null">
-        		and cssp.group_type_ = #{groupType}
-        	</if>
-        	<if test="musicGroupId != null">
-        		and cssp.music_group_id_ = #{musicGroupId}
-        	</if>
-            <if test="organId != null and organId != ''">
-                AND FIND_IN_SET(cs.organ_id_,#{organId})
-            </if>
-        </where>
+        <include refid="findStudentAttendanceSql"/>
     </select>
     <select id="findByCourseId" resultMap="StudentAttendance">
         SELECT * FROM student_attendance WHERE course_schedule_id_=#{courseId}

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

@@ -123,7 +123,7 @@
                 AND tcs.user_id_ = #{userId}
             </if>
             <if test="lowSalary != null">
-                AND tcs.low_salary_ = #{lowSalary}
+                AND tcs.low_salary = #{lowSalary}
             </if>
             <if test="minSalary != null">
                 AND tcs.expect_total_salary_ &gt; #{minSalary}

+ 7 - 6
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -196,16 +196,17 @@ public class EmployeeController extends BaseController {
     @ApiOperation(value = "获取维修技师")
     @GetMapping("/findTechnician")
     @PreAuthorize("@pcs.hasPermissions('employee/findTechnician')")
-    public HttpResponseResult findTechnician(){
+    public HttpResponseResult findTechnician(String organIds){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        String organIds = new String();
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        if (!sysUser.getIsSuperAdmin()) {
-            Employee employee = employeeService.get(sysUser.getId());
-            if (StringUtils.isEmpty(organIds)) {
-                organIds=employee.getOrganIdList();
+        if(StringUtils.isEmpty(organIds)){
+            if (!sysUser.getIsSuperAdmin()) {
+                Employee employee = employeeService.get(sysUser.getId());
+                if (StringUtils.isEmpty(organIds)) {
+                    organIds=employee.getOrganIdList();
+                }
             }
         }
         return succeed(employeeService.findByRole("37",organIds));

+ 2 - 1
mec-web/src/main/java/com/ym/mec/web/controller/MusicGroupQuitController.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.page.MusicGroupQuitQueryInfo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
@@ -40,7 +41,7 @@ public class MusicGroupQuitController extends BaseController {
 	@ApiOperation(value = "分页查询")
 	@GetMapping("/queryPage")
 	@PreAuthorize("@pcs.hasPermissions('musicGroupQuit/queryPage')")
-	public HttpResponseResult queryPage(QueryInfo queryInfo) throws Exception {
+	public HttpResponseResult queryPage(MusicGroupQuitQueryInfo queryInfo) throws Exception {
 		return succeed(musicGroupQuitService.queryPage(queryInfo));
 	}