yonge 5 年之前
父節點
當前提交
2aa77669f3

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

@@ -1,17 +1,27 @@
 package com.ym.mec.biz.service;
 
-import com.ym.mec.biz.dal.dto.*;
+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.entity.School;
-import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
 import com.ym.mec.biz.dal.entity.VipGroup;
-import com.ym.mec.biz.dal.page.*;
+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.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> {
 
     /**
@@ -157,7 +167,7 @@ public interface VipGroupService extends BaseService<Long, VipGroup> {
      * @return void
      * @describe 退课申请审核
      */
-    void applyRefundAudit(StudentApplyRefunds studentApplyRefunds);
+    void applyRefundAudit(Long id,AuditStatusEnum status,String remark);
 
     /**
      * @Author: Joburgess

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

@@ -647,47 +647,47 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
 	@Transactional(rollbackFor = Exception.class)
 	@Override
-	public void applyRefundAudit(StudentApplyRefunds studentApplyRefunds) {
-    	if(Objects.isNull(studentApplyRefunds.getId())){
-    		throw new BizException("请指定退费订单!");
-		}
+	public void applyRefundAudit(Long id, AuditStatusEnum status, String remark) {
 
-		StudentApplyRefunds oldStudentApplyRefunds=studentApplyRefundsDao.get(studentApplyRefunds.getId());
+		StudentApplyRefunds studentApplyRefunds = studentApplyRefundsDao.get(id);
+		if (studentApplyRefunds == null) {
+			throw new BizException("退课申请记录不存在");
+		}
 
-		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(oldStudentApplyRefunds.getOrigPaymentOrderId());
-		if(null==studentPaymentOrder){
+		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.get(studentApplyRefunds.getOrigPaymentOrderId());
+		if (null == studentPaymentOrder) {
 			throw new BizException("未找到原订单信息!");
 		}
 
-		oldStudentApplyRefunds.setStatus(studentApplyRefunds.getStatus());
-		if(null==studentApplyRefunds.getActualAmount()){
-			oldStudentApplyRefunds.setActualAmount(oldStudentApplyRefunds.getExpectAmount());
-		}else{
-			oldStudentApplyRefunds.setActualAmount(studentApplyRefunds.getActualAmount());
-		}
-		oldStudentApplyRefunds.setRemark(studentApplyRefunds.getRemark());
-		studentApplyRefundsDao.update(oldStudentApplyRefunds);
-		switch (studentApplyRefunds.getStatus()){
-			case PASS:
-				sysUserCashAccountService.updateBalance(oldStudentApplyRefunds.getUserId(),oldStudentApplyRefunds.getActualAmount());
-				SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentApplyRefunds.getUserId().intValue());
-				SysUserCashAccountDetail sysUserCashAccountDetail=new SysUserCashAccountDetail();
-				sysUserCashAccountDetail.setUserId(studentApplyRefunds.getUserId());
-				sysUserCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
-				sysUserCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
-				sysUserCashAccountDetail.setAmount(oldStudentApplyRefunds.getActualAmount());
-				sysUserCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
-				sysUserCashAccountDetail.setAttribute(oldStudentApplyRefunds.getId().toString());
-				sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
-
-				classGroupStudentMapperDao.deleteStudentByClassGroupId(studentPaymentOrder.getClassGroupId().longValue(),
-						studentPaymentOrder.getUserId().longValue());
-				break;
-			case REJECT:
+		studentApplyRefunds.setStatus(status);
+		if (studentApplyRefunds.getStatus() == AuditStatusEnum.PASS) {
+			studentApplyRefunds.setActualAmount(studentApplyRefunds.getExpectAmount());
+		} else {
+			studentApplyRefunds.setActualAmount(new BigDecimal(0));
+		}
+		studentApplyRefunds.setRemark(remark);
+		studentApplyRefundsDao.update(studentApplyRefunds);
+		switch (studentApplyRefunds.getStatus()) {
+		case PASS:
+			sysUserCashAccountService.updateBalance(studentApplyRefunds.getUserId(), studentApplyRefunds.getActualAmount());
+			SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(studentApplyRefunds.getUserId().intValue());
+			SysUserCashAccountDetail sysUserCashAccountDetail = new SysUserCashAccountDetail();
+			sysUserCashAccountDetail.setUserId(studentApplyRefunds.getUserId());
+			sysUserCashAccountDetail.setType(PlatformCashAccountDetailTypeEnum.REFUNDS);
+			sysUserCashAccountDetail.setStatus(DealStatusEnum.SUCCESS);
+			sysUserCashAccountDetail.setAmount(studentApplyRefunds.getActualAmount());
+			sysUserCashAccountDetail.setBalance(sysUserCashAccount.getBalance());
+			sysUserCashAccountDetail.setAttribute(studentApplyRefunds.getId().toString());
+			sysUserCashAccountDetailDao.insert(sysUserCashAccountDetail);
 
-				break;
-			default:
-				throw new BizException("审核状态错误!");
+			classGroupStudentMapperDao.deleteStudentByClassGroupId(studentPaymentOrder.getClassGroupId().longValue(), studentPaymentOrder.getUserId()
+					.longValue());
+			break;
+		case REJECT:
+
+			break;
+		default:
+			throw new BizException("审核状态错误!");
 		}
 	}
 

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

@@ -1,11 +1,27 @@
 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;
 import com.ym.mec.biz.dal.dto.VipGroupApplyDto;
-import com.ym.mec.biz.dal.entity.StudentApplyRefunds;
 import com.ym.mec.biz.dal.entity.VipGroup;
+import com.ym.mec.biz.dal.enums.AuditStatusEnum;
 import com.ym.mec.biz.dal.page.VipGroupAttendanceQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupSalaryQueryInfo;
@@ -14,18 +30,6 @@ 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
  * @Date 2019/9/21
@@ -94,8 +98,8 @@ public class VipGroupManageController extends BaseController {
     @ApiOperation(value = "退课申请审核")
     @PostMapping("/applyRefundAudit")
     @PreAuthorize("@pcs.hasPermissions('vipGroupManage/applyRefundAudit')")
-    public Object applyRefundAudit(StudentApplyRefunds studentApplyRefunds){
-        vipGroupService.applyRefundAudit(studentApplyRefunds);
+	public Object applyRefundAudit(Long id, AuditStatusEnum status, String remark) {
+		vipGroupService.applyRefundAudit(id, status, remark);
         return succeed();
     }