Joburgess 5 年之前
父節點
當前提交
1cd5d90d8e

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -45,6 +45,15 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     Integer[] countStudentInClass(List<Integer> classGroupIDs);
 
     /**
+     * @describe 根据课程编号列表获取课程列表
+     * @author Joburgess
+     * @date 2019/10/22
+     * @param courseScheduleIds: 课程编号列表
+     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseSchedule>
+     */
+    List<CourseSchedule> findByCourseScheduleIds(List<Long> courseScheduleIds);
+
+    /**
      * @Author: Joburgess
      * @Date: 2019/9/17
      * 根据日期获取当日排课信息

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

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.service;
 
-import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
 import com.ym.mec.biz.dal.dto.CourseScheduleDto;
 import com.ym.mec.biz.dal.dto.TeacherAttendanceDto;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
@@ -112,7 +111,7 @@ public interface CourseScheduleService extends BaseService<Long, CourseSchedule>
      * @Date: 2019/9/23
      * 课时调整
      */
-    void classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto);
+    void classStartDateAdjust(List<CourseSchedule> newCourseSchedules);
 
     /**
      * @Author: Joburgess

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java

@@ -76,6 +76,11 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
 	public static final String SIGN_OUT_MESSAGE_PUSH_MINUTE = "sign_out_message_push_minute";
 
 	/**
+	 * 教师课酬结算单位时长
+	 */
+	String TEACHER_SALARY_TIME_UNIT="teacher_salary_time_unit";
+
+	/**
 	 * @params paramName
 	 * @return com.ym.mec.biz.dal.entity.SysConfig
 	 * @describe 根据配置名称获取配置信息

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

@@ -1,27 +1,18 @@
 package com.ym.mec.biz.service;
 
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Map;
-
-import com.ym.mec.biz.dal.dto.StudentVipGroupDetailDto;
-import com.ym.mec.biz.dal.dto.TeachingRecordBaseInfo;
-import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
-import com.ym.mec.biz.dal.dto.VipGroupBuyParamsDto;
-import com.ym.mec.biz.dal.dto.VipGroupCostCountDto;
-import com.ym.mec.biz.dal.dto.VipGroupCostCountParamsDto;
-import com.ym.mec.biz.dal.dto.VipGroupManageDetailDto;
+import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.School;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
 import com.ym.mec.biz.dal.entity.VipGroup;
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
-import com.ym.mec.biz.dal.page.StudentVipGroupQueryInfo;
-import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
-import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
-import com.ym.mec.biz.dal.page.VipGroupSalaryQueryInfo;
-import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
+import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
 public interface VipGroupService extends BaseService<Long, VipGroup> {
 
     /**
@@ -34,6 +25,16 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
     void createVipGroup(VipGroupApplyDto vipGroup);
 
     /**
+     * @describe vip课程审核
+     * @author Joburgess
+     * @date 2019/10/22
+     * @param vipGroupId: vip课编号
+     * @param auditStatus: 审核状态
+     * @return void
+     */
+    void vipApplyAudit(Long vipGroupId,AuditStatusEnum auditStatus,String reason);
+
+    /**
      * @Author: Joburgess
      * @Date: 2019/10/3
      * @params [queryInfo]
@@ -149,7 +150,7 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
      * @return void
      * @describe 支付回调接口
      */
-    void orderCallback(String callbackParams);
+    void orderCallback(StudentPaymentOrder order);
 
     /**
 	 * @Author: Joburgess

+ 17 - 57
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -23,15 +23,12 @@ 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;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -311,74 +308,37 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 
 	@Transactional(rollbackFor = Exception.class)
 	@Override
-	public void classStartDateAdjust(ClassDateAdjustDto classDateAdjustDto) {
-
-		CourseSchedule nowCourseSchedule = courseScheduleDao.get(classDateAdjustDto.getId());
-		if(DateUtils.isSameDay(nowCourseSchedule.getClassDate(),classDateAdjustDto.getClassDate())&&
-				DateUtils.isSameDay(nowCourseSchedule.getStartClassTime(),classDateAdjustDto.getStartClassTime())&&
-				DateUtils.isSameDay(nowCourseSchedule.getEndClassTime(),classDateAdjustDto.getEndClassTime())){
-			courseScheduleDao.update(classDateAdjustDto);
-			return;
-		}
-
-		//单次调整课时
-		if(null==classDateAdjustDto.getAdjustStartTime()&&null==classDateAdjustDto.getAdjustEndTime()){
+	public void classStartDateAdjust(List<CourseSchedule> newCourseSchedules) {
+		List<Long> newCourseScheduleIds = newCourseSchedules.stream().map(CourseSchedule::getId).collect(Collectors.toList());
+		//获取对应未修改的课程列表
+		List<CourseSchedule> oldCourseScheduleList = courseScheduleDao.findByCourseScheduleIds(newCourseScheduleIds);
+		if(oldCourseScheduleList.size()!=newCourseSchedules.size()){
+			throw new BizException("课程信息错误");
+		}
+		Map<Long, List<CourseSchedule>> oldCourseSchedules = oldCourseScheduleList.stream().collect(Collectors.groupingBy(CourseSchedule::getId));
+		newCourseSchedules.forEach(newCourseSchedule -> {
+			CourseSchedule oldCourseSchedule = oldCourseSchedules.get(newCourseSchedule.getId()).get(0);
 			ArrayList<Date> dates = new ArrayList<>();
-			dates.add(classDateAdjustDto.getClassDate());
-			List<CourseSchedule> coursesByDates = courseScheduleDao.findOverLapCoursesInDay(dates,classDateAdjustDto.getStartClassTime(),classDateAdjustDto.getEndClassTime());
+			dates.add(newCourseSchedule.getClassDate());
+			List<CourseSchedule> coursesByDates = courseScheduleDao.findOverLapCoursesInDay(dates,newCourseSchedule.getStartClassTime(),newCourseSchedule.getEndClassTime());
 			//判断是否存在同时间上课的班级
 			if(null==coursesByDates||coursesByDates.size()<=0){
-				courseScheduleDao.update(classDateAdjustDto);
+				courseScheduleDao.update(newCourseSchedule);
 			}else{
 				coursesByDates.forEach(courseSchedule -> {
-					if(courseSchedule.getTeacherId().equals(classDateAdjustDto.getTeacherId())){
+					if(courseSchedule.getTeacherId().equals(newCourseSchedule.getTeacherId())){
 						//存在时间重叠,需要前端重新调整
 						throw new BizException("所选教师在当天课程安排上存在重叠!");
 					}
 				});
 				List<Integer> repeatClassGroupIds = coursesByDates.stream().map(CourseSchedule::getClassGroupId).collect(Collectors.toList());
 				checkStudentIsRepeat(repeatClassGroupIds);
-				courseScheduleDao.update(classDateAdjustDto);
+				courseScheduleDao.update(newCourseSchedule);
 			}
-		}else{
-			//根据时间段调整课时
-			List<Date> dates= DateUtil.getWeekDays(classDateAdjustDto.getAdjustStartTime(),classDateAdjustDto.getAdjustEndTime(),classDateAdjustDto.getWeekNum());
-			List<CourseSchedule> coursesByDates = courseScheduleDao.findOverLapCoursesInDay(dates,classDateAdjustDto.getStartClassTime(),classDateAdjustDto.getEndClassTime());
-			//判断是否存在同时间上课的班级
-			if(null==coursesByDates||coursesByDates.size()<=0){
-				createNewCourseByAdjust(dates,classDateAdjustDto);
-			}else{
-				//判断教师是否在时间安排上存在冲突
-				SimpleDateFormat s1=new SimpleDateFormat("yyyy-MM-dd"),
-						s2=new SimpleDateFormat("HH:mm:ss"),
-						s3=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-				List<CourseSchedule> teacherCoursesInDates = courseScheduleDao.findTeacherCoursesInDates(dates, classDateAdjustDto.getTeacherId());
-				teacherCoursesInDates.forEach(courseSchedule -> {
-					Date updateStartClassTime = null,updateEndClassTime=null;
-					try {
-						updateStartClassTime=s3.parse(s1.format(courseSchedule.getClassDate())+" "+s2.format(classDateAdjustDto.getStartClassTime()));
-						updateEndClassTime=s3.parse(s1.format(courseSchedule.getClassDate())+" "+s2.format(classDateAdjustDto.getEndClassTime()));
-					} catch (ParseException e) {
-						e.printStackTrace();
-					}
-					boolean isDuplication=(courseSchedule.getStartClassTime().after(updateStartClassTime)
-							&&courseSchedule.getStartClassTime().before(updateEndClassTime))
-							||(updateStartClassTime.after(courseSchedule.getStartClassTime())
-							&&updateStartClassTime.before(courseSchedule.getEndClassTime()));
-					if(isDuplication){
-						throw new BizException("在所选时段内教师上课时间存在重复!");
-					}
+			if(oldCourseSchedule.getType()== CourseSchedule.CourseScheduleType.VIP){
 
-				});
-				//判断学生在时间安排上是否存在冲突
-				Map<Date, List<CourseSchedule>> collect = coursesByDates.stream().collect(Collectors.groupingBy(CourseSchedule::getClassDate));
-				for(Date keyDate:collect.keySet()){
-					List<Integer> repeatClassGroupIds = collect.get(keyDate).stream().map(CourseSchedule::getClassGroupId).collect(Collectors.toList());
-					checkStudentIsRepeat(repeatClassGroupIds);
-				}
-				createNewCourseByAdjust(dates,classDateAdjustDto);
 			}
-		}
+		});
 	}
 
 	@Transactional(rollbackFor = Exception.class)

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

@@ -7,14 +7,12 @@ import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.SysAccountService;
 import com.ym.mec.thirdparty.union.UnionPay;
 import com.ym.mec.thirdparty.union.UnionPayFeignService;
-import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Random;
 
 /**
  * 支付服务类
@@ -42,18 +40,20 @@ public class PayServiceImpl implements PayService {
      * @return
      * @throws Exception
      */
+    @Override
     public Map getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody) throws Exception {
         //支付通道决策
         SysAccount routingAccount = getRoutingAccount(amount);
         HashMap<String, Object> unionPay = new HashMap<>();
         Map payMap;
         payMap = UnionPay.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject);
-        unionPay.put("orderNo", orderNo);
+        unionPay.put("orderNo", "1017"+orderNo);
         unionPay.put("type", "UNIONPAY");
         unionPay.put("payMap", payMap);
         return unionPay;
     }
 
+    @Override
     public Map<String, Object> query(String orderNo) throws Exception {
         return new UnionPay(unionPayFeignService).query(orderNo);
     }

+ 48 - 11
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -89,6 +89,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 	@Autowired
 	private CourseScheduleRewardsRulesService courseScheduleRewardsRulesService;
+	@Autowired
+	private SysConfigService sysConfigService;
 
 	private SysUserCashAccountDetailService sysUserCashAccountDetailService;
 
@@ -137,13 +139,20 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		className.append(vipGroupApplyBaseInfoDto.getName());
 		vipGroupApplyBaseInfoDto.setName(className.toString());
 
-		Map<String, BigDecimal> stringBigDecimalMap = countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
+		//计算课程相关费用信息
+		Map<String, BigDecimal> costInfo = countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
 				vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice(),
 				vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice());
 
-		vipGroupApplyBaseInfoDto.setTotalPrice(countVipGroupPredictFee(vipGroupApplyBaseInfoDto,
-				vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice(),
-				vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice()).get("totalPrice"));
+		//如果默认课酬与实际课酬不匹配则需要审批
+		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())!=0||
+			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())!=0){
+			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
+		}else{
+			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
+		}
+
+		vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.get("totalPrice"));
 		vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
 		vipGroupApplyBaseInfoDto.setOrganId(sysUser.getOrganId());
 		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
@@ -210,6 +219,26 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	public void vipApplyAudit(Long vipGroupId, AuditStatusEnum auditStatus, String reason) {
+		if(Objects.isNull(vipGroupId)||Objects.isNull(auditStatus)){
+			throw new BizException("请指定vip课及审核结果");
+		}
+		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
+		if(Objects.isNull(vipGroup)){
+			throw new BizException("vip课不存在");
+		}
+		if(vipGroup.getAuditStatus()!=AuditStatusEnum.ING){
+			throw new BizException("该课程已被审核");
+		}
+		if(auditStatus==AuditStatusEnum.REJECT&&StringUtils.isBlank(reason)){
+			throw new BizException("请填写拒绝原因");
+		}
+		vipGroup.setAuditStatus(auditStatus);
+		vipGroup.setStopReason(reason);
+		vipGroupDao.update(vipGroup);
+	}
+
+	@Override
 	public PageInfo findStudentVipGroupList(StudentVipGroupQueryInfo queryInfo) {
 		PageInfo pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
@@ -427,7 +456,12 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("请指定课程形式");
 		}
 
-    	TeacherDefaultVipGroupSalary teacherDefaultVipGroupSalary = teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(vipGroup.getUserId().longValue(),
+		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupCategoryId().intValue());
+		if(Objects.isNull(vipGroupCategory)){
+			throw new BizException("未找到课程形式");
+		}
+
+		TeacherDefaultVipGroupSalary teacherDefaultVipGroupSalary = teacherDefaultVipGroupSalaryDao.findByTeacherAndCategory(vipGroup.getUserId().longValue(),
 				vipGroup.getVipGroupCategoryId());
 
 		VipGroupActivity vipGroupActivity = vipGroupActivityDao.get(vipGroup.getVipGroupActivityId().intValue());
@@ -444,6 +478,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 		Map<String,BigDecimal> results=new HashMap<>(1);
 
+		BigDecimal teacherSalaryTimeUnit=new BigDecimal(sysConfigService.findByParamName(SysConfigService.TEACHER_SALARY_TIME_UNIT).getParanValue());
+		//课程时长与结算单位时长占比
+		BigDecimal classTimeDuty=new BigDecimal(vipGroupCategory.getSingleClassMinutes()).divide(teacherSalaryTimeUnit);
 		BigDecimal offlineClassNum=new BigDecimal(vipGroup.getOfflineClassesNum());
 		BigDecimal onlineClassNum=new BigDecimal(vipGroup.getOnlineClassesNum());
 		BigDecimal onlineVipGroupCharge = onlineClassesUnitPrice.multiply(onlineClassNum);
@@ -456,7 +493,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 					if(Objects.isNull(teacherDefaultVipGroupSalary)){
 						throw new BizException("未设置教师默认课酬");
 					}
-					results.put("onlineTeacherSalary",teacherDefaultVipGroupSalary.getOfflineClassesSalary());
+					results.put("onlineTeacherSalary",teacherDefaultVipGroupSalary.getOfflineClassesSalary().multiply(classTimeDuty));
 					break;
 				case RATIO_DISCOUNT:
 					results.put("onlineTeacherSalary",onlineClassesUnitPrice.multiply((vipGroupSalarySettlementDto.getOnlineSalarySettlement().getSettlementValue())));
@@ -478,7 +515,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 					if(Objects.isNull(teacherDefaultVipGroupSalary)){
 						throw new BizException("未设置教师默认课酬");
 					}
-					results.put("offlineTeacherSalary",teacherDefaultVipGroupSalary.getOfflineClassesSalary());
+					results.put("offlineTeacherSalary",teacherDefaultVipGroupSalary.getOfflineClassesSalary().multiply(classTimeDuty));
 					break;
 				case RATIO_DISCOUNT:
 					results.put("offlineTeacherSalary",offlineClassesUnitPrice.multiply(vipGroupSalarySettlementDto.getOfflineSalarySettlement().getSettlementValue()));
@@ -606,13 +643,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void orderCallback(String callbackParams) {
+	public void orderCallback(StudentPaymentOrder order) {
 		/*
 		根据回调信息调整订单状态及vip课程状态等相关信息
 		 */
-		Long vipGroupId=1L;
-		Integer userId = 1;
-		boolean isOk=true;
+		Long vipGroupId=Long.parseLong(order.getMusicGroupId());
+		Integer userId = order.getUserId();
+		boolean isOk=order.getStatus().equals(DealStatusEnum.SUCCESS);
 
 		//将学生加入到班级,更新班级报名状态及人数信息
 		if(!isOk){

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

@@ -284,6 +284,17 @@
         GROUP BY user_id_
     </select>
 
+    <select id="findByCourseScheduleIds" resultMap="CourseSchedule">
+        SELECT
+            *
+        FROM
+            course_schedule
+        WHERE id_ IN
+        <foreach collection="courseScheduleIds" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </select>
+
     <select id="getCourseSchedulesWithDate" resultMap="courseScheduleDto">
         SELECT
         cg.id_ seal_class_id_,

+ 0 - 1
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -311,7 +311,6 @@ public class MusicGroupController extends BaseController {
             return failed("商品价格不符");
         }
 
-
         IdWorker idWorker = new IdWorker(0, 0);
         String orderNo = idWorker.nextId();
 

+ 5 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -6,6 +6,7 @@ import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.service.StudentPaymentOrderService;
 import com.ym.mec.biz.service.StudentRegistrationService;
+import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.thirdparty.union.NotifyMsg;
 import io.swagger.annotations.Api;
 import org.slf4j.Logger;
@@ -27,6 +28,8 @@ public class StudentOrderController {
     private StudentPaymentOrderService studentPaymentOrderService;
     @Autowired
     private StudentRegistrationService studentRegistrationService;
+    @Autowired
+    private VipGroupService vipGroupService;
 
 
     @PostMapping("/notify")
@@ -61,6 +64,8 @@ public class StudentOrderController {
         order.setPayTime(notifyMsg.getPayTime());
         if (order.getType().equals(OrderTypeEnum.APPLY)) { //报名订单
             studentRegistrationService.updateApplyOrder(order);
+        }else if (order.getType().equals(OrderTypeEnum.SMALL_CLASS_TO_BUY)){
+            vipGroupService.orderCallback(order);
         }
 
         return "SUCCESS";

+ 2 - 2
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/union/UnionPay.java

@@ -89,7 +89,7 @@ public class UnionPay {
         json.put("mid", h5Mid);
         json.put("tid", h5Tid);
         json.put("orderDesc", orderSubject);
-        json.put("merOrderId", orderNo);
+        json.put("merOrderId", "1017" + orderNo);
         json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
         json.put("expireTime", DateFormatUtils.format(new Date().getTime() + 300000, "yyyy-MM-dd HH:mm:ss"));
         json.put("notifyUrl", notifyUrl);
@@ -119,7 +119,7 @@ public class UnionPay {
         json.put("instMid", "H5DEFAULT");
         json.put("mid", h5Mid);
         json.put("tid", h5Tid);
-        json.put("merOrderId", orderNo);
+        json.put("merOrderId", "1017" + orderNo);
         json.put("requestTimestamp", DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
 
         String authorization = getOpenBodySig(wpAppId, wpAppKey, timestamp, nonce, json.toString(), "POST");

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

@@ -1,21 +1,5 @@
 package com.ym.mec.web.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-
-import java.util.Map;
-import java.util.Objects;
-
-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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.ClassDateAdjustDto;
@@ -29,6 +13,16 @@ import com.ym.mec.biz.dal.page.VipGroupTeachingRecordQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 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.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.*;
+
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @Author Joburgess
@@ -161,4 +155,12 @@ public class VipGroupManageController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation(value = "vip课审核")
+    @PostMapping(value = "/vipApplyAudit")
+    @PreAuthorize("@pcs.hasPermissions('vipGroupManage/vipApplyAudit')")
+    public Object vipApplyAudit(Long vipGroupId, AuditStatusEnum auditStatus, String reason){
+        vipGroupService.vipApplyAudit(vipGroupId,auditStatus,reason);
+        return succeed();
+    }
+
 }