yonge 5 年之前
父節點
當前提交
e17b8b4185

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

@@ -28,7 +28,7 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
      * @Date: 2019/10/3
      * 根据学生vip课获取缴费订单
      */
-    StudentPaymentOrder findByStudentVipGroup(@Param("vipGroupId") Long vipGroupId, @Param("userId") Long userId);
+    StudentPaymentOrder findByStudentVipGroup(@Param("vipGroupId") Long vipGroupId, @Param("userId") Integer userId);
 
     /**
      * 查询乐团报名的订单

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

@@ -175,7 +175,7 @@ public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
      * @return java.math.BigDecimal
      * @describe 统计学生vip课未上课时费用
      */
-    List<Map<Long,BigDecimal>> countSurplusCourseFee(Long vipGroupId);
+    List<Map<Integer,BigDecimal>> countSurplusCourseFee(Long vipGroupId);
 
     /**
      * @Author: Joburgess

+ 11 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleService.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentCourseScheduleRecordQueryInfo;
@@ -155,13 +156,16 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
     void courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints);
 
     /**
-     * @Author: Joburgess
-     * @Date: 2019/10/3
-     * @params [courseScheduleComplaints]
-     * @return void
-     * @describe 课程投诉审核
-     */
-    void courseScheduleCommplaintAudit(CourseScheduleComplaints courseScheduleComplaints);
+	 * @Author: Joburgess
+	 * @Date: 2019/10/3
+	 * @params [id] 申诉编号
+	 * @params [teacherLiabilityRatio] 老师责任比
+	 * @params [studentLiabilityRatio] 学生责任比
+	 * @params [status] 审批状态
+	 * @return void
+	 * @describe 课程投诉审核
+	 */
+	void courseScheduleCommplaintAudit(Long id, Double teacherLiabilityRatio, Double studentLiabilityRatio, AuditStatusEnum status);
     
     /**
      * 更新课程至结束状态

+ 8 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleStudentPaymentService.java

@@ -5,13 +5,13 @@ import com.ym.mec.common.service.BaseService;
 
 public interface CourseScheduleStudentPaymentService extends BaseService<Long, CourseScheduleStudentPayment> {
 
-    /**
-     * @Author: Joburgess
-     * @Date: 2019/10/14
-     * @params [vipGroupId, userId]
-     * @return int
-     * @describe 生成学生vip课单节课时收费信息
-     */
-    int createCourseScheduleStudentPaymentForVipGroup(Long vipGroupId,Long userId);
+	/**
+	 * @Author: Joburgess
+	 * @Date: 2019/10/14
+	 * @params [vipGroupId, userId]
+	 * @return int
+	 * @describe 生成学生vip课单节课时收费信息
+	 */
+	int createCourseScheduleStudentPaymentForVipGroup(Long vipGroupId, Integer userId);
 
 }

+ 7 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/VipGroupService.java

@@ -142,13 +142,13 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
     void orderCallback(String callbackParams);
 
     /**
-     * @Author: Joburgess
-     * @Date: 2019/10/3
-     * @params [vipGroupId, studentId]
-     * @return void
-     * @describe 申请退课
-     */
-    void applyRefund(Long vipGroupId,Long studentId);
+	 * @Author: Joburgess
+	 * @Date: 2019/10/3
+	 * @params [vipGroupId, studentId]
+	 * @return void
+	 * @describe 申请退课
+	 */
+	void applyRefund(Long vipGroupId, Integer studentId);
 
     /**
      * @Author: Joburgess

+ 15 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -26,6 +26,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.BeanUtils;
@@ -505,14 +506,20 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	}
 
 	@Override
-	public void courseScheduleCommplaintAudit(CourseScheduleComplaints courseScheduleComplaints) {
-		if(Objects.isNull(courseScheduleComplaints.getId())){
-			throw new BizException("请指定投诉记录!");
-		}
-		CourseScheduleComplaints newCourseScheduleComplaints=new CourseScheduleComplaints();
-		newCourseScheduleComplaints.setId(courseScheduleComplaints.getId());
-		newCourseScheduleComplaints.setStatus(courseScheduleComplaints.getStatus());
-		courseScheduleComplaintsDao.update(newCourseScheduleComplaints);
+	public void courseScheduleCommplaintAudit(Long id, Double teacherLiabilityRatio, Double studentLiabilityRatio, AuditStatusEnum status) {
+
+		if(status == AuditStatusEnum.ING){
+			throw new BizException("审批状态不正确");
+		}
+		
+		CourseScheduleComplaints courseScheduleComplaints = courseScheduleComplaintsDao.get(id);
+		if (Objects.isNull(courseScheduleComplaints)) {
+			throw new BizException("投诉记录不存在");
+		}
+		courseScheduleComplaints.setTeacherLiabilityRatio(teacherLiabilityRatio);
+		courseScheduleComplaints.setStudentLiabilityRatio(studentLiabilityRatio);
+		courseScheduleComplaints.setStatus(status);
+		courseScheduleComplaintsDao.update(courseScheduleComplaints);
 	}
 
 	@Override

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

@@ -40,7 +40,7 @@ public class CourseScheduleStudentPaymentServiceImpl extends BaseServiceImpl<Lon
 	}
 
 	@Override
-	public int createCourseScheduleStudentPaymentForVipGroup(Long vipGroupId, Long userId) {
+	public int createCourseScheduleStudentPaymentForVipGroup(Long vipGroupId, Integer userId) {
 		VipGroup vipGroupApplyBaseInfoDto=vipGroupDao.get(vipGroupId);
 
 		if(Objects.isNull(vipGroupApplyBaseInfoDto)){

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

@@ -536,7 +536,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	public Map buyVipGroup(VipGroupBuyParamsDto vipGroupBuyParams) throws Exception {
 		SysUser user = sysUserFeignService.queryUserInfo();
 
-		StudentPaymentOrder byStudentVipGroup = studentPaymentOrderDao.findByStudentVipGroup(vipGroupBuyParams.getVipGroupId(), user.getId().longValue());
+		StudentPaymentOrder byStudentVipGroup = studentPaymentOrderDao.findByStudentVipGroup(vipGroupBuyParams.getVipGroupId(), user.getId());
 
 		if(Objects.nonNull(byStudentVipGroup)){
 			throw new BizException("订单已存在!");
@@ -595,7 +595,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		/*
 		根据回调信息调整订单状态及vip课程状态等相关信息
 		 */
-		Long vipGroupId=1L,userId=1L;
+		Long vipGroupId=1L;
+		Integer userId = 1;
 
 		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
 
@@ -623,11 +624,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 	@Transactional(rollbackFor = Exception.class)
 	@Override
-	public void applyRefund(Long vipGroupId,Long studentId) {
-		SysUser sysUser=sysUserFeignService.queryUserInfo();
-    	if(null==studentId){
-    		studentId=sysUser.getId().longValue();
-		}
+	public void applyRefund(Long vipGroupId,Integer studentId) {
+		
 		StudentApplyRefunds studentApplyRefunds=new StudentApplyRefunds();
 		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId,studentId);
 		if(null==studentPaymentOrder){
@@ -773,14 +771,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
     		vipGroupDao.update(vipGroup);
     		return;
 		}
-		List<Map<Long, BigDecimal>> maps = vipGroupDao.countSurplusCourseFee(vipGroupId);
+		List<Map<Integer, BigDecimal>> maps = vipGroupDao.countSurplusCourseFee(vipGroupId);
     	if(CollectionUtils.isEmpty(maps)||(maps.size()==1&&Objects.isNull(maps.get(0)))){
 			vipGroup.setStatus(VipGroupStatusEnum.CANCEL);
 			vipGroupDao.update(vipGroup);
 			return;
 		}
-		Map<Long, BigDecimal> studentSurplusClassFees = MapUtil.convertMybatisMap(maps);
-    	for(Long userId:studentSurplusClassFees.keySet()){
+		Map<Integer, BigDecimal> studentSurplusClassFees = MapUtil.convertMybatisMap(maps);
+    	for(Integer userId:studentSurplusClassFees.keySet()){
 			StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId,userId);
 			if(null==studentPaymentOrder){
 				throw new BizException("未找到相关订单信息!");

+ 15 - 4
mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java

@@ -1,5 +1,7 @@
 package com.ym.mec.student.controller;
 
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.ConditionDto;
 import com.ym.mec.biz.dal.dto.QueryConditionDto;
 import com.ym.mec.biz.dal.dto.VipGroupBuyParamsDto;
@@ -7,9 +9,12 @@ import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
 import com.ym.mec.biz.service.SubjectService;
 import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
+
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
@@ -31,6 +36,8 @@ public class StudentVipGroupController extends BaseController {
     private VipGroupService vipGroupService;
     @Autowired
     private SubjectService subjectService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "获取vip课列表筛选条件")
     @GetMapping(value = "/findQueryCondition")
@@ -67,9 +74,13 @@ public class StudentVipGroupController extends BaseController {
 
     @ApiOperation(value = "vip课退课")
     @PostMapping("/applyRefund")
-    public Object applyRefund(Long vipGroupId){
-        vipGroupService.applyRefund(vipGroupId,null);
-        return succeed();
-    }
+	public Object applyRefund(Long vipGroupId) {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (null == sysUser) {
+			return failed(HttpStatus.FORBIDDEN, "请登录");
+		}
+		vipGroupService.applyRefund(vipGroupId, sysUser.getId());
+		return succeed();
+	}
 
 }

+ 5 - 5
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleController.java

@@ -30,8 +30,8 @@ import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CreateCourseScheduleDto;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
 import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.biz.dal.entity.MusicGroup;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.MusicGroupService;
@@ -147,10 +147,10 @@ public class CourseScheduleController extends BaseController {
     @ApiOperation(value = "课程投诉审核")
     @GetMapping(value = "/courseScheduleCommplaintAudit")
     @PreAuthorize("@pcs.hasPermissions('courseSchedule/courseScheduleCommplaintAudit')")
-    public Object courseScheduleCommplaintAudit(CourseScheduleComplaints courseScheduleComplaints){
-        scheduleService.courseScheduleCommplaintAudit(courseScheduleComplaints);
-        return succeed();
-    }
+	public Object courseScheduleCommplaintAudit(Long id, Double teacherLiabilityRatio, Double studentLiabilityRatio, AuditStatusEnum status) {
+		scheduleService.courseScheduleCommplaintAudit(id, teacherLiabilityRatio, studentLiabilityRatio, status);
+		return succeed();
+	}
 
     @ApiOperation(value = "检测乐团下所有的班级是否都已排课")
     @PostMapping(value = "/checkMusicGroupClassCourse")

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

@@ -86,7 +86,7 @@ public class VipGroupManageController extends BaseController {
     @ApiOperation(value = "退课申请")
     @PostMapping("/applyRefundForStudent")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/applyRefundForStudent')")
-    public Object applyRefundForStudent(Long vipGroupId,Long studentId){
+    public Object applyRefundForStudent(Long vipGroupId,Integer studentId){
         vipGroupService.applyRefund(vipGroupId,studentId);
         return succeed();
     }

+ 25 - 0
mec-workflow/src/main/java/com/ym/mec/workfow/service/MecAccessStrategy.java

@@ -0,0 +1,25 @@
+package com.ym.mec.workfow.service;
+
+import java.util.List;
+
+import org.snaker.engine.impl.GeneralAccessStrategy;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+
+@Service
+public class MecAccessStrategy extends GeneralAccessStrategy {
+
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+
+	@Override
+	public List<String> ensureGroup(String operator) {
+
+		List<String> roleCodeList = sysUserFeignService.queryRoleCodeListByUserId(Integer.parseInt(operator));
+
+		return roleCodeList;
+	}
+
+}