Bladeren bron

Merge remote-tracking branch 'origin/master'

Joburgess 5 jaren geleden
bovenliggende
commit
774d6f38d9

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

@@ -15,7 +15,7 @@ public interface SchoolDao extends BaseDAO<Integer, School> {
      * @param organId
      * @return
      */
-    List<School> queryByOrganId(@Param("organId") Integer organId);
+    List<School> queryByOrganId(@Param("organId") String organId);
 
     /**
      * 根据学校编号列表获取学校名称map

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/SchoolService.java

@@ -12,7 +12,7 @@ public interface SchoolService extends BaseService<Integer, School> {
      * @param organId
      * @return
      */
-    List<School> queryByOrganId(Integer organId);
+    List<School> queryByOrganId(String organId);
 
     /**
      * @describe 获取教师vip课教学点

+ 1 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -1001,6 +1001,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		List<StudentAttendance> studentAttendanceList = courseScheduleDao.queryUnsignedStudentList();
 		for (StudentAttendance studentAttendance : studentAttendanceList) {
 			studentAttendance.setStatus(StudentAttendanceStatusEnum.TRUANT);
+			studentAttendance.setRemark("课程已结束,自动补旷课");
 			studentAttendance.setCurrentClassTimes(studentAttendance.getCurrentClassTimes() + 1);
 			studentAttendance.setCreateTime(date);
 		}

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

@@ -777,6 +777,7 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         studentPaymentOrder.setMusicGroupId(musicGroupId);
         studentPaymentOrder.setCreateTime(date);
         studentPaymentOrder.setUpdateTime(date);
+        studentPaymentOrder.setVersion(1);
         studentPaymentOrderService.insert(studentPaymentOrder);
 
         ArrayList<StudentPaymentOrderDetail> studentPaymentOrderDetailList = new ArrayList<>();

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

@@ -24,7 +24,7 @@ public class SchoolServiceImpl extends BaseServiceImpl<Integer, School>  impleme
 	}
 
 	@Override
-	public List<School> queryByOrganId(Integer organId) {
+	public List<School> queryByOrganId(String organId) {
 		return schoolDao.queryByOrganId(organId);
 	}
 

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

@@ -358,7 +358,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 			CourseSchedule courseSchedule = courseScheduleDao.get(courseScheduleId.longValue());
 			ClassGroup classGroup = classGroupDao.findByCourseSchedule(courseScheduleId);
 			if(classGroup != null && courseSchedule != null){
-				int advanceSignMinutes = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES));
+//				int advanceSignMinutes = Integer.parseInt(sysConfigDao.findConfigValue(SysConfigService.ADVANCE_SIGN_IN_MINUTES));
 				Date date = new Date();
 				String classDate = DateUtil.format(courseSchedule.getClassDate(), DateUtil.DEFAULT_PATTERN);
 				String startClassTime = DateUtil.format(courseSchedule.getStartClassTime(), DateUtil.EXPANDED_TIME_FORMAT);
@@ -372,7 +372,7 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 					studentAttendance = new StudentAttendance();
 					studentAttendance.setClassGroupId(classGroup.getId());
 					studentAttendance.setCourseScheduleId(courseScheduleId.longValue());
-					studentAttendance.setCurrentClassTimes(classGroup.getCurrentClassTimes());
+					studentAttendance.setCurrentClassTimes(classGroup.getCurrentClassTimes() + 1);
 					studentAttendance.setGroupType(classGroup.getGroupType());
 					studentAttendance.setMusicGroupId(classGroup.getMusicGroupId());
 					studentAttendance.setStatus(statusEnum);

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -283,6 +283,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		classGroupTeacherSalary.setSalary(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary());
 		classGroupTeacherSalary.setOnlineClassesSalary(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary());
 		classGroupTeacherSalary.setGroupType(GroupType.VIP);
+		classGroupTeacherSalary.setCreateTime(now);
+		classGroupTeacherSalary.setUpdateTime(now);
 		classGroupTeacherSalaryDao.insert(classGroupTeacherSalary);
 
 		//课程信息调整

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

@@ -21,7 +21,6 @@
     where id_ = #{id}
   </delete>
   <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary" useGeneratedKeys="true">
-    
     insert into class_group_teacher_salary
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="groupType != null">

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

@@ -69,6 +69,7 @@
     <resultMap type="com.ym.mec.biz.dal.entity.StudentAttendance" id="StudentAttendance">
         <result column="music_group_id_" property="musicGroupId"/>
         <result column="class_group_id_" property="classGroupId"/>
+        <result column="group_type_" property="groupType"/>
         <result column="course_schedule_id_" property="courseScheduleId"/>
         <result column="user_id_" property="userId"/>
         <result column="teacher_id_" property="teacherId"/>

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

@@ -112,7 +112,7 @@
         <where>
             del_flag_ = 0
             <if test="organId != null">
-                AND organ_id_ = #{organId}
+                AND FIND_IN_SET(organ_id_,#{organId})
             </if>
         </where>
     </select>

+ 2 - 0
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -54,6 +54,8 @@ public class MusicGroupRegisterController extends BaseController {
 
         if (musicGroup.getStatus().equals(MusicGroupStatusEnum.PAY)) {
             studentRegistration.setPaymentStatus(PaymentStatusEnum.OPEN);
+        }else{
+            studentRegistration.setPaymentStatus(PaymentStatusEnum.NO);
         }
         studentRegistration.setOrganId(musicGroup.getOrganId());
         return succeed(studentRegistrationService.addStudent(studentRegistration));

+ 29 - 1
mec-web/src/main/java/com/ym/mec/web/controller/SchoolController.java

@@ -1,5 +1,9 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.entity.School;
 import com.ym.mec.biz.dal.page.SchoolQueryInfo;
 import com.ym.mec.biz.service.SchoolService;
@@ -7,11 +11,14 @@ import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Arrays;
 import java.util.Date;
+import java.util.List;
 
 @RequestMapping("school")
 @Api(tags = "学校(教学点)服务")
@@ -20,6 +27,10 @@ public class SchoolController extends BaseController {
 
     @Autowired
     private SchoolService schoolService;
+    @Autowired
+    private EmployeeDao employeeDao;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "新增学校")
     @PostMapping("/add")
@@ -63,7 +74,24 @@ public class SchoolController extends BaseController {
     @ApiOperation(value = "根据机构编号获取学校列表")
     @GetMapping("/queryByOrganId")
     @PreAuthorize("@pcs.hasPermissions('school/queryByOrganId')")
-    public Object queryByOrganId(@RequestParam Integer organId){
+    public Object queryByOrganId(String organId){
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(organId)) {
+                organId = employee.getOrganIdList();
+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+                return failed("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(organId.split(",")))){
+                    return failed("非法请求");
+                }
+            }
+        }
         return succeed(schoolService.queryByOrganId(organId));
     }