فهرست منبع

Merge branch 'fee_audit' of http://git.dayaedu.com/yonge/mec into test

zouxuan 4 سال پیش
والد
کامیت
38c788fa2d

+ 36 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/EmployeeRoleEnum.java

@@ -0,0 +1,36 @@
+package com.ym.mec.biz.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * 员工角色枚举
+ */
+public enum EmployeeRoleEnum implements BaseEnum<String, EmployeeRoleEnum> {
+	TEAM_TEACHER("TEAM_TEACHER", "运营主管"), EDUCATION("EDUCATION", "乐团主管");
+
+	private String code;
+
+	private String msg;
+
+	EmployeeRoleEnum(String code, String msg) {
+		this.code = code;
+		this.msg = msg;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	@Override
+	public String getCode() {
+		return this.code;
+	}
+}

+ 95 - 88
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1002,7 +1002,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				if(StringUtils.isNotEmpty(studentIds)){
 					SysUser sysUser = sysUserFeignService.queryUserById(Integer.parseInt(studentIds));
 					calenderAuditDetailDto.setPhone(sysUser.getPhone());
-					calenderAuditDetailDto.setPhone(sysUser.getUsername());
+					calenderAuditDetailDto.setUsername(sysUser.getUsername());
 				}
 			}catch (Exception e){
 				e.printStackTrace();
@@ -1081,111 +1081,118 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void auditPass(String batchNo,String auditMemo) {
-		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
-		if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
-			throw new BizException("缴费项目不存在");
-		}
+	public void auditPass(String batchNs,String auditMemo) {
+		String[] split = batchNs.split(",");
 		Date date = new Date();
-		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
-			//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
-			if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
-			}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
-			}else {
-				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+		for (String batchNo : split) {
+			List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+			if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
+				throw new BizException("缴费项目不存在");
 			}
-			musicGroupPaymentCalender.setAuditMemo(auditMemo);
-			musicGroupPaymentCalender.setUpdateTime(date);
+			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+				//如果是报名项目,将乐团改为审核中,缴费项目修改状态,审核状态改为审核通过
+				if(musicGroupPaymentCalender.getPayUserType() == SCHOOL){
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+				}else if (date.after(musicGroupPaymentCalender.getStartPaymentDate())) {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OPEN);
+				}else if (date.after(musicGroupPaymentCalender.getDeadlinePaymentDate())) {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.OVER);
+				}else {
+					musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.NO);
+				}
+				musicGroupPaymentCalender.setAuditMemo(auditMemo);
+				musicGroupPaymentCalender.setUpdateTime(date);
 
-			if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
-				musicGroupPaymentCalender.setExpectNum(1);
-				List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
-				addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
-			}
-		}
-		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
-		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
-		if (calender.getPaymentType() == MUSIC_APPLY) {
-			//统计乐团还在审核中或者审核被拒的缴费
-			int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
-			if(count == 0){
-				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-				musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
-				musicGroup.setUpdateTime(date);
-				musicGroupDao.update(musicGroup);
-				SysUser sysUser = sysUserFeignService.queryUserInfo();
-				if(sysUser == null || sysUser.getId() == null){
-					throw new BizException("请重新登录");
+				if (musicGroupPaymentCalender.getPaymentType() == PaymentType.ADD_STUDENT) {
+					musicGroupPaymentCalender.setExpectNum(1);
+					List<MusicGroupPaymentCalenderCourseSettings> musicGroupPaymentCalenderCourseSettings = musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettings(musicGroupPaymentCalender.getId());
+					addStudent(musicGroupPaymentCalender,musicGroupPaymentCalenderCourseSettings);
 				}
-				//记录操作日志
-				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
 			}
-		} else if (calender.getPaymentType() == ADD_STUDENT) {
-			// 学生加到班级
-			String classGroupIdStr = calender.getAttribute1();
-			if (StringUtils.isNotBlank(classGroupIdStr)) {
-				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
-						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+			MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
+			//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
+			if (calender.getPaymentType() == MUSIC_APPLY) {
+				//统计乐团还在审核中或者审核被拒的缴费
+				int count = musicGroupPaymentCalenderDao.countAuditReject(calender.getMusicGroupId(),calender.getId());
+				if(count == 0){
+					MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
+					musicGroup.setStatus(MusicGroupStatusEnum.APPLY);
+					musicGroup.setUpdateTime(date);
+					musicGroupDao.update(musicGroup);
+					SysUser sysUser = sysUserFeignService.queryUserInfo();
+					if(sysUser == null || sysUser.getId() == null){
+						throw new BizException("请重新登录");
+					}
+					//记录操作日志
+					musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目通过(费用审核中 -> 报名中)", sysUser.getId(), ""));
+				}
+			} else if (calender.getPaymentType() == ADD_STUDENT) {
+				// 学生加到班级
+				String classGroupIdStr = calender.getAttribute1();
+				if (StringUtils.isNotBlank(classGroupIdStr)) {
+					classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
+							musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
+				}
+				MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				if(musicGroupStudentClassAdjust != null){
+					//如果是合班缴费
+					autoClassGroupAdjust(musicGroupStudentClassAdjust);
+				}else {
+					imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
+				}
+			}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
+				//删除和解冻班级,课程信息
+				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(),Map.class);
+				List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
+				List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
+				List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
+				//如果是跨团班级合并,添加学员
+				musicGroupPaymentCalenderDetailService.batchAdd(calender,musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
+				classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
+						,studentIds,courseIds,classGroupStudents,allLockCourseIds,batchNo,adjust.getMasterTotalPrice());
 			}
-			MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-			if(musicGroupStudentClassAdjust != null){
-				//如果是合班缴费
-				autoClassGroupAdjust(musicGroupStudentClassAdjust);
-			}else {
-				imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
+			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+				//将0元未缴费学员缴费状态更新为已缴费
+				int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
+				musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
 			}
-		}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
-			//删除和解冻班级,课程信息
-			MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-			List<Map> classGroupStudents = JSON.parseArray(adjust.getClassGroupStudents(),Map.class);
-			List<Integer> studentIds = JSON.parseArray(adjust.getStudentIds(), Integer.class);
-			List<Long> courseIds = JSON.parseArray(adjust.getSubLockCourseIds(), Long.class);
-			List<Long> allLockCourseIds = JSON.parseArray(adjust.getAllLockCourseIds(), Long.class);
-			//如果是跨团班级合并,添加学员
-			musicGroupPaymentCalenderDetailService.batchAdd(calender,musicGroupPaymentCalenderStudentDetailDao.findByBatchNo(batchNo));
-			classGroupService.spanGroupClassAdjustPass(adjust.getMasterClassGroupId()
-					,studentIds,courseIds,classGroupStudents,allLockCourseIds,batchNo,adjust.getMasterTotalPrice());
+			musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		}
-		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
-			//将0元未缴费学员缴费状态更新为已缴费
-			int j = musicGroupPaymentCalenderDetailDao.updateNoPaymentAndZeroPaymentStatus(musicGroupPaymentCalender.getId());
-			musicGroupPaymentCalender.setActualNum((musicGroupPaymentCalender.getActualNum()==null?0:musicGroupPaymentCalender.getActualNum()) + j);
-		}
-		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
+
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void auditRefuse(String batchNo,String auditMemo) {
+	public void auditRefuse(String batchNs,String auditMemo) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if(sysUser == null || sysUser.getId() == null){
 			throw new BizException("请重新登录");
 		}
-		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
-		if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
-			throw new BizException("缴费项目不存在");
-		}
+		String[] split = batchNs.split(",");
 		Date date = new Date();
-		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
-			musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
-			musicGroupPaymentCalender.setUpdateTime(date);
-			musicGroupPaymentCalender.setAuditMemo(auditMemo);
-		}
-		MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
-		//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
-		if (calender.getPaymentType() == MUSIC_APPLY) {
-			MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
-			musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
-			musicGroup.setUpdateTime(date);
-			musicGroupDao.update(musicGroup);
-			//记录操作日志
-			musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
+		for (String batchNo : split) {
+			List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
+			if(musicGroupPaymentCalenders == null || musicGroupPaymentCalenders.size() == 0){
+				throw new BizException("缴费项目不存在");
+			}
+			for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
+				musicGroupPaymentCalender.setStatus(PaymentCalenderStatusEnum.REJECT);
+				musicGroupPaymentCalender.setUpdateTime(date);
+				musicGroupPaymentCalender.setAuditMemo(auditMemo);
+			}
+			MusicGroupPaymentCalender calender = musicGroupPaymentCalenders.get(0);
+			//如果是报名,并且所有的报名都审核通过,需要修改乐团状态
+			if (calender.getPaymentType() == MUSIC_APPLY) {
+				MusicGroup musicGroup = musicGroupDao.get(calender.getMusicGroupId());
+				musicGroup.setStatus(MusicGroupStatusEnum.PRE_BUILD_FEE);
+				musicGroup.setUpdateTime(date);
+				musicGroupDao.update(musicGroup);
+				//记录操作日志
+				musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroup.getId(), "报名缴费项目失败(费用审核中 -> 审核拒绝)", sysUser.getId(), ""));
+			}
+			musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 		}
-		musicGroupPaymentCalenderDao.batchUpdate(musicGroupPaymentCalenders);
 	}
 
 	//推送待续费通知

+ 29 - 0
mec-web/src/main/java/com/ym/mec/web/controller/EmployeeController.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.EmployeeLevelDto;
 import com.ym.mec.biz.dal.dto.SimpleUserDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.enums.EmployeeOperateEnum;
+import com.ym.mec.biz.dal.enums.EmployeeRoleEnum;
 import com.ym.mec.biz.dal.page.EmployeeQueryInfo;
 import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.OrganizationService;
@@ -167,6 +168,34 @@ public class EmployeeController extends BaseController {
         return succeed(employeeService.findByRole("4,5",organIds));
     }
 
+    @ApiOperation(value = "获取对应角色的员工")
+    @GetMapping("/findUserByRole")
+    public HttpResponseResult findEducationUsers(Integer userId, Integer organId, EmployeeRoleEnum employeeRole){
+        SysUser sysUser;
+        if(userId == null){
+            sysUser = sysUserFeignService.queryUserInfo();
+            if (sysUser == null) {
+                return failed("用户信息获取失败");
+            }
+        }else {
+            sysUser = sysUserFeignService.queryUserById(userId);
+        }
+        String organIds = new String();
+        if(Objects.isNull(organId)){
+            Employee employee = employeeService.get(sysUser.getId());
+            if (StringUtils.isEmpty(organIds)) {
+                organIds = employee.getOrganIdList();
+            }
+        }else{
+            organIds = organId.toString();
+        }
+        if(employeeRole == EmployeeRoleEnum.TEAM_TEACHER){
+            return succeed(employeeService.findByRole("5",organIds));
+        }else {
+            return succeed(employeeService.findByRole("4",organIds));
+        }
+    }
+
     @ApiOperation(value = "获取教务老师")
     @GetMapping("/findEducationTeacher")
     public HttpResponseResult findEducationTeacher(Integer userId){