yonge 5 éve
szülő
commit
2378d8560f

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

@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
@@ -808,6 +809,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 	}
 
 	@Override
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public boolean awardedMonthlyRewards() {
 		List<Map<Integer, Integer>> list = courseScheduleDao.queryVipGroupTeachereClassTimesByMonth(new Date(), CourseStatusEnum.OVER);
 

+ 2 - 0
mec-client-api/src/main/java/com/ym/mec/task/TaskRemoteService.java

@@ -12,4 +12,6 @@ public interface TaskRemoteService {
 	@GetMapping(value = "task/refreshPaymentFeeStatus")
 	public void refreshPaymentFeeStatus();
 
+	@GetMapping(value = "task/vipGroupAwardedMonthlyRewards")
+	public void vipGroupAwardedMonthlyRewards();
 }

+ 5 - 0
mec-client-api/src/main/java/com/ym/mec/task/fallback/TaskRemoteServiceFallback.java

@@ -16,4 +16,9 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 		logger.info("更新学生缴费状态的服务调用失败");
 	}
 
+	@Override
+	public void vipGroupAwardedMonthlyRewards() {
+		logger.info("vip课月度奖励的服务调用失败");
+	}
+
 }

+ 24 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/VipGroupAwardedMonthlyRewardsTask.java

@@ -0,0 +1,24 @@
+package com.ym.mec.task.jobs;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+
+/**
+ * vip课月度奖励
+ */
+@Service
+public class VipGroupAwardedMonthlyRewardsTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.vipGroupAwardedMonthlyRewards();
+	}
+
+}

+ 15 - 6
mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java

@@ -6,19 +6,28 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.ym.mec.biz.service.MusicGroupStudentFeeService;
+import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 
 @RequestMapping("task")
 @RestController
 public class TaskController extends BaseController {
-	
+
 	@Autowired
 	private MusicGroupStudentFeeService musicGroupStudentFeeService;
 
-    @GetMapping("/refreshPaymentFeeStatus")
-    //刷新付费状态
-    public void refreshPaymentFeeStatus() {
-    	musicGroupStudentFeeService.refreshPaymentFeeStatus();
-    }
+	@Autowired
+	private VipGroupService vipGroupService;
+
+	@GetMapping("/refreshPaymentFeeStatus")
+	// 刷新付费状态
+	public void refreshPaymentFeeStatus() {
+		musicGroupStudentFeeService.refreshPaymentFeeStatus();
+	}
 
+	@GetMapping("/vipGroupAwardedMonthlyRewards")
+	// vip课月度奖励
+	public void vipGroupAwardedMonthlyRewards() {
+		vipGroupService.awardedMonthlyRewards();
+	}
 }