浏览代码

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 年之前
父节点
当前提交
a877111ac7

+ 6 - 30
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -898,16 +898,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
         }
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdSet);
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdSet);
 
 
-        String subjectIds = "";
-        String subjectNames = "";
-        for (Subject subject : subjectList) {
-            subjectIds += subject.getId() + ",";
-            subjectNames += subject.getName() + "/";
-        }
-
-        subjectIds = subjectIds.substring(0, subjectIds.length() - 1);
-        subjectNames = subjectNames.substring(0, subjectNames.length() - 1);
-
+        String subjectIds = subjectList.stream().map(subject -> subject.getId().toString()).collect(Collectors.joining(","));
+        String subjectNames = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
 
 
         //1、新建班级
         //1、新建班级
         ClassGroup classGroup = new ClassGroup();
         ClassGroup classGroup = new ClassGroup();
@@ -1111,16 +1103,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
         }
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdSet);
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdSet);
 
 
-        String subjectIds = "";
-        String subjectNames = "";
-        for (Subject subject : subjectList) {
-            subjectIds += subject.getId() + ",";
-            subjectNames += subject.getName() + "/";
-        }
-
-        subjectIds = subjectIds.substring(0, subjectIds.length() - 1);
-        subjectNames = subjectNames.substring(0, subjectNames.length() - 1);
-
+        String subjectIds = subjectList.stream().map(subject -> subject.getId().toString()).collect(Collectors.joining(","));
+        String subjectNames = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
 
 
         //1、新建班级
         //1、新建班级
         ClassGroup classGroup = new ClassGroup();
         ClassGroup classGroup = new ClassGroup();
@@ -1319,16 +1303,8 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         }
         }
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdSet);
         List<Subject> subjectList = subjectService.findBySubjectByIdList(subjectIdSet);
 
 
-        String subjectIds = "";
-        String subjectNames = "";
-        for (Subject subject : subjectList) {
-            subjectIds += subject.getId() + ",";
-            subjectNames += subject.getName() + "/";
-        }
-
-        subjectIds = subjectIds.substring(0, subjectIds.length() - 1);
-        subjectNames = subjectNames.substring(0, subjectNames.length() - 1);
-
+        String subjectIds = subjectList.stream().map(subject -> subject.getId().toString()).collect(Collectors.joining(","));
+        String subjectNames = subjectList.stream().map(subject -> subject.getName()).collect(Collectors.joining("/"));
 
 
         //1、新建班级
         //1、新建班级
         ClassGroup classGroup = new ClassGroup();
         ClassGroup classGroup = new ClassGroup();

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

@@ -52,4 +52,8 @@ public interface TaskRemoteService {
 	@GetMapping("task/homeworkNoReplyRemind")
 	@GetMapping("task/homeworkNoReplyRemind")
 	// 老师未回复作业提醒
 	// 老师未回复作业提醒
 	public void homeworkNoReplyRemind();
 	public void homeworkNoReplyRemind();
+
+	@GetMapping("task/queryOrderStatus")
+	// 订单状态查询
+	public void queryOrderStatus();
 }
 }

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

@@ -66,4 +66,8 @@ public class TaskRemoteServiceFallback implements TaskRemoteService {
 		logger.info("老师未回复作业提醒的服务调用失败");
 		logger.info("老师未回复作业提醒的服务调用失败");
 	}
 	}
 
 
+	@Override
+	public void queryOrderStatus() {
+		logger.info("查询订单状态的服务调用失败");
+	}
 }
 }

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

@@ -179,7 +179,7 @@ public class StudentOrderController extends BaseController {
     }
     }
 
 
 
 
-    //@Scheduled(cron = "0/5 * * * * ?")
+    //@Scheduled(cron = "0 */1 * * * ?")
     public void getOrderStatus() throws Exception {
     public void getOrderStatus() throws Exception {
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
 
 
@@ -351,7 +351,7 @@ public class StudentOrderController extends BaseController {
 
 
     }
     }
 
 
-    @Scheduled(cron = "0/30 * * * * ?")
+    //@Scheduled(cron = "0/30 * * * * ?")
     public void setSuccessStatus() throws Exception {
     public void setSuccessStatus() throws Exception {
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
         List<StudentPaymentOrder> payingOrders = studentPaymentOrderService.findOrdersByStatus(DealStatusEnum.ING, "YQPAY");
 
 

+ 19 - 0
mec-task/src/main/java/com/ym/mec/task/jobs/PayStatusTask.java

@@ -0,0 +1,19 @@
+package com.ym.mec.task.jobs;
+
+import com.ym.mec.task.TaskRemoteService;
+import com.ym.mec.task.core.BaseTask;
+import com.ym.mec.task.core.TaskException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class PayStatusTask extends BaseTask {
+
+	@Autowired
+	private TaskRemoteService taskRemoteService;
+
+	@Override
+	public void execute() throws TaskException {
+		taskRemoteService.queryOrderStatus();
+	}
+}