瀏覽代碼

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

zouxuan 5 年之前
父節點
當前提交
0d0b199c99

+ 8 - 8
codegen/src/main/resources/generateConfigration.xml

@@ -2,16 +2,16 @@
 <GenerateConfiguration>
 	<dbConfiguration>
 		<driverClass>com.mysql.jdbc.Driver</driverClass>
-		<url>jdbc:mysql://47.99.212.176:3306/mec_data_online</url>
-		<username>dayaData</username>
-		<password>dayaDataOnline2019</password>
-		<catalog>mec_data_online</catalog>
-		<schema>mec_data_online</schema>
+		<url>jdbc:mysql://47.99.212.176:3306/edu_saas</url>
+		<username>edu_saas</username>
+		<password>edu_saas</password>
+		<catalog>edu_saas</catalog>
+		<schema>edu_saas</schema>
 	</dbConfiguration>
 	<srcBase>e:/javabean</srcBase>
-	<pojoPackageName>com.ym.mec.biz.dal.entity</pojoPackageName>
-	<daoPackageName>com.ym.mec.biz.dal.dao</daoPackageName>
-	<servicePackageName>com.ym.mec.biz.service</servicePackageName>
+	<pojoPackageName>com.keao.edu.datasource.dal.entity</pojoPackageName>
+	<daoPackageName>com.keao.edu.datasource.dal.dao</daoPackageName>
+	<servicePackageName>com.keao.edu.datasource.service</servicePackageName>
 	<sqlmapPackageName>resources</sqlmapPackageName>
 	<sqlmapConfigPackageName>resources/config</sqlmapConfigPackageName>
 </GenerateConfiguration>

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleStudentPaymentDao.java

@@ -295,4 +295,15 @@ public interface CourseScheduleStudentPaymentDao extends BaseDAO<Long, CourseSch
      * @return
      */
     String getMidiByCourseIdAndUserId(@Param("courseScheduleId") String courseScheduleId, @Param("userId") String userId);
+
+    /**
+     * @describe 统计课程组下的课程单价
+     * @author Joburgess
+     * @date 2020.06.11
+     * @param groupType:
+     * @param groupIds:
+     * @return java.util.List<java.util.Map<java.lang.String,java.math.BigDecimal>>
+     */
+    List<Map<String, BigDecimal>> findGroupCoursesUnitPrice(@Param("groupType") GroupType groupType,
+                                                            @Param("groupIds") List<String> groupIds);
 }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroup.java

@@ -132,6 +132,16 @@ public class VipGroup {
 
 	private String lastOverTime;
 
+	private BigDecimal courseUnitPrice;
+
+	public BigDecimal getCourseUnitPrice() {
+		return courseUnitPrice;
+	}
+
+	public void setCourseUnitPrice(BigDecimal courseUnitPrice) {
+		this.courseUnitPrice = courseUnitPrice;
+	}
+
 	public String getLastOverTime() {
 		return lastOverTime;
 	}

+ 30 - 28
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -2077,22 +2077,24 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         }
         if(groupType == VIP){
 			VipGroup vipGroup = vipGroupDao.get(vipGroupCourseAdjustInfo.getVipGroupId().longValue());
-			try {
-				Map<String, BigDecimal> costInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
-						courseSchedules.get(0).getActualTeacherId(),
-						vipGroup.getOnlineClassesUnitPrice(),
-						vipGroup.getOfflineClassesUnitPrice(),
-						false,true);
-				courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds,
-						vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?costInfo.get("offlineTeacherSalary"):costInfo.get("onlineTeacherSalary"));
-			} catch (Exception e) {
+
+			BigDecimal teacherSalary=BigDecimal.ZERO;
+
+			ClassGroupTeacherSalary classGroupTeacherSalary = classGroupTeacherSalaryDao.findByVipGoupAndTeacher(vipGroupCourseAdjustInfo.getVipGroupId().intValue(), courseSchedules.get(0).getActualTeacherId());
+
+			if(Objects.nonNull(classGroupTeacherSalary)){
+				teacherSalary=vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?classGroupTeacherSalary.getSalary():classGroupTeacherSalary.getOnlineClassesSalary();
+			}
+			if(teacherSalary.compareTo(BigDecimal.ZERO)<=0){
 				TeacherDefaultVipGroupSalary tdvs = teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(courseSchedules.get(0).getActualTeacherId(),vipGroup.getVipGroupCategoryId());
-				if (tdvs == null) {
+				if (tdvs == null||Objects.isNull(tdvs.getOfflineClassesSalary())) {
 					throw new BizException("老师[]没有设置默认课酬,请先设置", courseSchedules.get(0).getActualTeacherId());
 				}
-				courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds,
-						vipGroupCourseAdjustInfo.getTeachMode().equals(TeachModeEnum.OFFLINE)?tdvs.getOfflineClassesSalary():tdvs.getOnlineClassesSalary());
+				teacherSalary=tdvs.getOfflineClassesSalary();
 			}
+
+			courseScheduleTeacherSalaryDao.batchUpdateCourseSalarys(courseScheduleIds, teacherSalary);
+
 		}
 
         courseScheduleDao.batchUpdate(courseSchedules);
@@ -2697,24 +2699,24 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 						if (vipGroup == null) {
 							throw new BizException("课程[{}]记录存在异常,请联系管理员", courseScheduleId);
 						}
-						try {
-							Map<String, BigDecimal> costInfo = vipGroupService.countVipGroupPredictFee(vipGroup,
-									teacherId,
-									vipGroup.getOnlineClassesUnitPrice(),
-									vipGroup.getOfflineClassesUnitPrice(),
-									false,true);
-							if (newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE) {
-								ts.setExpectSalary(costInfo.get("offlineTeacherSalary"));
-							} else {
-								ts.setExpectSalary(costInfo.get("onlineTeacherSalary"));
-							}
-						} catch (Exception e) {
-							TeacherDefaultVipGroupSalary tdvs = map.get(vipGroup.getVipGroupCategoryId());
-							if (tdvs == null) {
+
+						BigDecimal teacherSalary=BigDecimal.ZERO;
+
+						ClassGroupTeacherSalary classGroupTeacherSalary = classGroupTeacherSalaryDao.findByVipGoupAndTeacher(vipGroup.getId().intValue(), teacherId);
+
+						if(Objects.nonNull(classGroupTeacherSalary)){
+							teacherSalary=newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?classGroupTeacherSalary.getSalary():classGroupTeacherSalary.getOnlineClassesSalary();
+						}
+						if(Objects.isNull(teacherSalary)||teacherSalary.compareTo(BigDecimal.ZERO)<=0){
+							TeacherDefaultVipGroupSalary tdvs = teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(teacherId,vipGroup.getVipGroupCategoryId());
+							if (tdvs == null||Objects.isNull(tdvs.getOfflineClassesSalary())) {
 								throw new BizException("老师[]没有设置默认课酬,请先设置", teacherId);
 							}
-							ts.setExpectSalary(newCourseSchedule.getTeachMode() == TeachModeEnum.OFFLINE?tdvs.getOfflineClassesSalary():tdvs.getOnlineClassesSalary());
+							teacherSalary=tdvs.getOfflineClassesSalary();
 						}
+
+						ts.setExpectSalary(teacherSalary);
+
 					} else if (newCourseSchedule.getGroupType() == PRACTICE) {
 						List<TeacherDefaultPracticeGroupSalary> teacherDefaultPracticeGroupSalaryList = teacherDefaultPracticeGroupSalaryDao
 								.queryByUserId(teacherId);
@@ -3894,7 +3896,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
         PracticeGroup practiceGroup = practiceGroupDao.get(Long.valueOf(oldCourseSchedule.getMusicGroupId()));
 		if(practiceGroup.getType() != TRIAL){
-			if(practiceGroup.getType() == FREE){
+			if(practiceGroup.getType() != FREE){
 				List<TeacherDefaultPracticeGroupSalary> teacherDefaultPracticeGroupSalaries = teacherDefaultPracticeGroupSalaryDao.queryByUserId(teacherId);
 				if(teacherDefaultPracticeGroupSalaries == null || teacherDefaultPracticeGroupSalaries.size() == 0){
 					throw new BizException("请设置老师默认课酬");

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -267,7 +267,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         studentRepair.setContactMobile(repairInfo.getContactMobile());
         studentRepair.setAddress(repairInfo.getAddress());
         studentRepair.setUpdateTime(date);
-        studentRepairDao.update(repairInfo);
+        studentRepairDao.update(studentRepair);
 
         String channelType = "";
 
@@ -370,6 +370,9 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         if (repairInfo == null) {
             throw new BizException("维修单不存在");
         }
+        if(repairInfo.getPayStatus().equals(2)){
+            return true;
+        }
 
         Integer userId = studentPaymentOrder.getUserId();
 

+ 8 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TeacherServiceImpl.java

@@ -28,6 +28,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.time.DayOfWeek;
@@ -451,15 +452,18 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 			LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
 			LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
 			List<TeacherExercisesServiceDto> teacherExercisesServiceSituations = studentExtracurricularExercisesSituationDao.findTeacherExercisesServiceSituations(monDayDate.toString(), new ArrayList<>(teachers));
-			Map<Integer, TeacherExercisesServiceDto> teacherServiceMap = teacherExercisesServiceSituations.stream().collect(Collectors.toMap(TeacherExercisesServiceDto::getTeacherId, t -> t));
+			Map<Integer, TeacherExercisesServiceDto> teacherServiceMap = new HashMap<>();
+			if(!CollectionUtils.isEmpty(teacherExercisesServiceSituations)){
+				teacherServiceMap = teacherExercisesServiceSituations.stream().collect(Collectors.toMap(TeacherExercisesServiceDto::getTeacherId, t -> t));
+			}
 
 			Map<Integer,String> operatingStudentsNum = MapUtil.convertMybatisMap(studentDao.getTeacherOperatingStudentsNum(teacherIds));
 			Map<Integer,String> practiceStudentsNum = MapUtil.convertMybatisMap(studentDao.getBuyNums(teacherIds, GroupType.PRACTICE));
 			Map<Integer,String> vipStudentsNum = MapUtil.convertMybatisMap(studentDao.getBuyNums(teacherIds, GroupType.VIP));
 			Map<Integer,String> practiceAndVipStudentsNum = MapUtil.convertMybatisMap(studentDao.getPracticeAndVipNums(teacherIds));
 
-			rows.forEach(e->{
-//				e.setSubjectName(subjectDao.findBySubIds(e.getSubjectId()));
+			for (Teacher e : rows) {
+				e.setSubjectName(subjectDao.findBySubIds(e.getSubjectId()));
 				e.setOrganName(organNames.get(e.getTeacherOrganId()));
 				if(StringUtils.isNotEmpty(e.getSplitSubjectName())){
 					e.setSubjectName(Arrays.asList(e.getSplitSubjectName().split(",")));
@@ -488,8 +492,7 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 				}else {
 					e.setOperatingIndex(BigDecimal.ZERO);
 				}
-
-			});
+			}
 		}
 		return pageInfo;
 	}

+ 10 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -590,6 +590,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 				Map<String,Long> currentClassTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.countCourseScheduleNum(vipGroupIds,"VIP"));
 				Map<String,String> lastOverTimeMap = MapUtil.convertIntegerMap(courseScheduleDao.findLastOverTime(vipGroupIds));
 
+				List<Map<String, BigDecimal>> groupCoursesUnitPriceMaps = courseScheduleStudentPaymentDao.findGroupCoursesUnitPrice(GroupType.VIP, vipGroupIds);
+				Map<String,BigDecimal> groupCoursesUnitPrice=new HashMap<>();
+				if(!CollectionUtils.isEmpty(groupCoursesUnitPriceMaps)){
+					groupCoursesUnitPrice=MapUtil.convertIntegerMap(groupCoursesUnitPriceMaps);
+				}
+
 				Map<Integer, String> idNameMap=new HashMap<>();
 				if(!CollectionUtils.isEmpty(educationalTeacherIds)){
 					List<SimpleUserDto> educationalUsers = employeeDao.findByIds(educationalTeacherIds);
@@ -616,6 +622,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 					vipGroup.setEducationalTeacherName(idNameMap.get(vipGroup.getEducationalTeacherId()));
 
+					vipGroup.setCourseUnitPrice(groupCoursesUnitPrice.get(String.valueOf(vipGroup.getId())));
+
 					if(queryInfo.getIsExport()){
 						List<GroupUserDto> groupStudents = groupStudentsMap.get(vipGroup.getId().toString());
 						if(!CollectionUtils.isEmpty(groupStudents)){
@@ -967,21 +975,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		totalPrice=totalPrice.setScale(0,BigDecimal.ROUND_CEILING);
 		results.put("totalPrice",totalPrice);
 
-		Teacher teacher = teacherDao.get(teacherId);
-		if(!JobNatureEnum.FULL_TIME.equals(teacher.getJobNature())){
-			if(Objects.isNull(teacherDefaultVipGroupSalary)||Objects.isNull(teacherDefaultVipGroupSalary.getOnlineClassesSalary())){
-				results.put("onlineTeacherSalary", BigDecimal.ZERO);
-			}else{
-				results.put("onlineTeacherSalary", teacherDefaultVipGroupSalary.getOnlineClassesSalary());
-			}
-			if(Objects.isNull(teacherDefaultVipGroupSalary)||Objects.isNull(teacherDefaultVipGroupSalary.getOfflineClassesSalary())){
-				results.put("offlineTeacherSalary", BigDecimal.ZERO);
-			}else{
-				results.put("offlineTeacherSalary", teacherDefaultVipGroupSalary.getOfflineClassesSalary());
-			}
-			return results;
-		}
-
 		//教师课酬线上单课酬计算
 		if(Objects.nonNull(vipGroupSalarySettlementDto.getOnlineSalarySettlement())){
 			if(vipGroup instanceof VipGroupApplyBaseInfoDto&&!useDefaultTeacherSalary
@@ -992,17 +985,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			if(Objects.isNull(teacherOnlineSalary)){
 				switch (vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSalarySettlementType()){
 					case TEACHER_DEFAULT:
-						if(Objects.isNull(teacherDefaultVipGroupSalary)||Objects.isNull(teacherDefaultVipGroupSalary.getOnlineClassesSalary())){
+						if(Objects.isNull(teacherDefaultVipGroupSalary)||Objects.isNull(teacherDefaultVipGroupSalary.getOfflineClassesSalary())){
 							teacherOnlineSalary=new BigDecimal(0);
 						}else{
-							teacherOnlineSalary=teacherDefaultVipGroupSalary.getOnlineClassesSalary();
+							teacherOnlineSalary=teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 						}
-//                        teacherOnlineSalary=teacherOnlineSalary.multiply(classTimeDuty);
 						results.put("onlineTeacherSalary",teacherOnlineSalary.setScale(0, BigDecimal.ROUND_HALF_UP));
 						break;
 					case RATIO_DISCOUNT:
-//						results.put("onlineTeacherSalary",onlineClassesUnitPrice.multiply((vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue())).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(0,BigDecimal.ROUND_HALF_UP));
-
 						results.put("onlineTeacherSalary",totalPrice.multiply(new BigDecimal(vipGroupCategory.getStudentNum())).divide(totalClassNum, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(0,BigDecimal.ROUND_HALF_UP));
 
 						break;
@@ -1036,8 +1026,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 						results.put("offlineTeacherSalary",teacherOfflineSalary.setScale(0, BigDecimal.ROUND_HALF_UP));
 						break;
 					case RATIO_DISCOUNT:
-//						results.put("offlineTeacherSalary",offlineClassesUnitPrice.multiply(vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSettlementValue()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(0,BigDecimal.ROUND_HALF_UP));
-
 						results.put("offlineTeacherSalary",totalPrice.multiply(new BigDecimal(vipGroupCategory.getStudentNum())).divide(totalClassNum, CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).multiply(vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSettlementValue()).divide(new BigDecimal(100), CommonConstants.DECIMAL_PLACE, BigDecimal.ROUND_DOWN).setScale(0,BigDecimal.ROUND_HALF_UP));
 
 						break;

+ 16 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleStudentPaymentMapper.xml

@@ -464,4 +464,20 @@
 		SELECT cssp.open_play_midi_ FROM course_schedule_student_payment cssp
 		WHERE cssp.user_id_ = #{userId} AND cssp.course_schedule_id_ = #{courseScheduleId}
 	</select>
+
+    <select id="findGroupCoursesUnitPrice" resultType="java.util.Map">
+		SELECT
+			music_group_id_ AS 'key',
+			CONVERT ( SUM( expect_price_ ) / COUNT(DISTINCT course_schedule_id_ ), DECIMAL ( 10, 2 ) ) AS 'value'
+		FROM
+			course_schedule_student_payment
+		WHERE
+			group_type_ = #{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+			AND music_group_id_ IN
+			<foreach collection="groupIds" item="groupId" separator="," open="(" close=")">
+				#{groupId}
+			</foreach>
+		GROUP BY
+			music_group_id_;
+	</select>
 </mapper>

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

@@ -337,6 +337,7 @@
 		COUNT( CASE WHEN actual_exercises_num_ = 1 THEN 1 ELSE NULL END ) actualExercisesNum
 		FROM
 		student_extracurricular_exercises_situation_
+		FORCE INDEX(monday_)
 		WHERE monday_ = #{monday}
 		AND teacher_id_ IN
 		<foreach collection="teacherIds" item="teacherId" open="(" close=")" separator=",">

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -273,7 +273,8 @@
                 AND sa.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
             <if test="attendanceStatus != null and attendanceStatus == @com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum@TRUANT">
-                AND (sa.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler} OR sa.status_ IS NULL)
+                AND (sa.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                OR (sa.status_ IS NULL AND cs.status_!='NOT_START'))
             </if>
             <if test="classGroupName!=null">
                 AND (cg.name_ LIKE CONCAT("%",#{classGroupName},"%") OR cs.name_ LIKE CONCAT("%",#{classGroupName},"%"))
@@ -294,7 +295,7 @@
             CONCAT(cs.class_date_," ",cs.end_class_time_) course_end_date_,
             cssp.course_schedule_id_,
             su.real_name_ teacher_name_,
-            IF(sa.status_ IS NULL,'TRUANT',sa.status_) status_,
+            IF(sa.status_ IS NULL AND cs.status_!='NOT_START','TRUANT',sa.status_) status_,
             sa.current_class_times_,
             cg.total_class_times_,
             cs.status_ courseStatus,

+ 8 - 3
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -29,6 +29,7 @@
         <result column="repair_status_" jdbcType="INTEGER" property="repairStatus"/>
         <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="username_" jdbcType="VARCHAR" property="studentName"/>
     </resultMap>
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="StudentRepair">
@@ -138,6 +139,7 @@
         <if test="search">
             AND (username_ LIKE CONCAT(#{search},'%') OR phone_ LIKE CONCAT(#{search},'%'))
         </if>
+        AND del_flag_ = 0
         <include refid="global.limit"/>
     </select>
 
@@ -148,11 +150,13 @@
         <if test="search">
             AND (username_ LIKE CONCAT(#{search},'%') OR phone_ LIKE CONCAT(#{search},'%'))
         </if>
+        AND del_flag_ = 0
     </select>
 
     <select id="queryPage" resultMap="StudentRepair">
-        SELECT sr.*,o.name_ FROM student_repair sr
+        SELECT sr.*,o.name_,su.username_ FROM student_repair sr
         LEFT JOIN organization o ON o.id_ = sr.organ_id_
+        LEFT JOIN sys_user su on sr.student_id_ = su.id_
         <include refid="queryPageSql"/>
         ORDER BY id_ DESC
         <include refid="global.limit"/>
@@ -160,7 +164,7 @@
     <sql id="queryPageSql">
         <where>
             <if test="search != null and search != ''">
-                AND (sr.trans_no_ LIKE CONCAT('%',#{search},'%') OR sr.student_id_ = #{search} OR sr.student_name_ LIKE
+                AND (sr.trans_no_ LIKE CONCAT('%',#{search},'%') OR sr.student_id_ = #{search} OR su.username_ LIKE
                 CONCAT('%',#{search},'%'))
             </if>
             <if test="employeeId != null">
@@ -193,7 +197,8 @@
         </where>
     </sql>
     <select id="queryCount" resultType="int">
-        SELECT COUNT(id_) FROM student_repair sr
+        SELECT COUNT(*) FROM student_repair sr
+        LEFT JOIN sys_user su on sr.student_id_ = su.id_
         <include refid="queryPageSql"/>
     </select>
 

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -27,7 +27,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
 				.authorizeRequests().antMatchers("/v2/api-docs","/code/*","/register/*","/studentOrder/*","/musicGroup/getSubjectGoodsAndInfo",
 				"/musicGroup/getMusicGroupStatus","/musicGroup/getOrderStatus",
-				"/musicGroup/pay","/musicGroup/rePay","/studentManage/queryStudentPer","/sporadicChargeInfo/get","/sporadicChargeInfo/sporadicPay").permitAll().anyRequest().authenticated().and().httpBasic();
+				"/musicGroup/pay","/musicGroup/rePay","/studentManage/queryStudentPer","/sporadicChargeInfo/get","/sporadicChargeInfo/sporadicPay","/repair/getRepairInfo","/repair/payRepair").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 6 - 3
mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java

@@ -46,13 +46,16 @@ public class RepairController extends BaseController {
 
     @ApiOperation("获取维修记录详情")
     @GetMapping(value = "/getRepairInfo")
-    public HttpResponseResult getRepairInfo(Integer id) {
+    public HttpResponseResult getRepairInfo(Integer id,Integer studentId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
-        if (sysUser == null) {
+        if ((sysUser == null || sysUser.getId() ==null) && studentId == null) {
             return failed("用户信息获取失败");
         }
+        if(sysUser.getId() != null){
+            studentId = sysUser.getId();
+        }
         StudentRepair repairInfo = studentRepairService.getRepairInfo(id);
-        if (!repairInfo.getStudentId().equals(sysUser.getId())) {
+        if (!repairInfo.getStudentId().equals(studentId)) {
             return failed("您的维修记录不存在");
         }
         return succeed(repairInfo);

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

@@ -486,10 +486,10 @@ public class ExportController extends BaseController {
             });
         }
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"VIP编号", "课程名称", "课程状态", "指导老师", "指导老师", "班级人数", "先上课单价", "线下课单价",
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"VIP编号", "课程名称", "课程状态", "指导老师", "指导老师", "班级人数", "课程单价",
                     "活动方案", "当前课次", "总课次", "剩余课次", "月消耗", "上次课时间", "开课时间", "结束时间", "申请时间", "学生姓名"}, new String[]{
-                    "id", "name", "status.msg", "userName", "educationalTeacherName", "studentNum", "onlineClassesUnitPrice",
-                    "offlineClassesUnitPrice", "vipGroupActivityName", "currentClassTimes", "totalClassTimes", "subClassTimes", "monthConsumeRate", "lastOverTime",
+                    "id", "name", "status.msg", "userName", "educationalTeacherName", "studentNum", "courseUnitPrice",
+                    "vipGroupActivityName", "currentClassTimes", "totalClassTimes", "subClassTimes", "monthConsumeRate", "lastOverTime",
                     "courseStartDate", "coursesExpireDate", "registrationStartTime", "userInfo"}, rows);
             response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment;filename=lender-" + DateUtil.getDate(new Date()) + ".xls");

+ 31 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -11,15 +11,21 @@ import com.ym.mec.biz.service.StudentRepairService;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
 import java.util.Objects;
 
 @RequestMapping("eduRepair")
@@ -108,4 +114,29 @@ public class EduRepairController extends BaseController {
         return succeed(studentRepairService.getRepairInfo(id));
     }
 
+
+    @ApiOperation("获取维修列表")
+    @GetMapping(value = "/queryPage")
+    public HttpResponseResult queryPage(RepairStudentQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        queryInfo.setEmployeeId(sysUser.getId());
+        Date endTime = queryInfo.getEndTime();
+        if(endTime != null){
+            queryInfo.setEndTime(DateUtil.addDays(endTime, 1));
+        }
+        queryInfo.setPayStatus(2);
+        return succeed(studentRepairService.queryPage(queryInfo));
+    }
+
+
+    @ApiOperation("维修完成")
+    @PostMapping(value = "/repairSuccess")
+    public HttpResponseResult repairSuccess(Integer id,String description,Integer repairStatus) {
+        studentRepairService.repairSuccess(id,description,repairStatus);
+        return succeed();
+    }
+
 }