소스 검색

Merge branch '20220914' into saas

yonge 2 년 전
부모
커밋
0cc7042561

+ 15 - 4
cms/src/main/java/com/ym/mec/cms/service/impl/SysNewsInformationServiceImpl.java

@@ -11,8 +11,11 @@ import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.web.WebFeignService;
+
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -87,16 +90,24 @@ public class SysNewsInformationServiceImpl extends BaseServiceImpl<Long, SysNews
 		}
 		PageInfo<SysNewsInformation> app = queryHomePage(queryInfo);
 		if(!CollectionUtils.isEmpty(app.getRows()) && user != null && user.getId() != null){
-			for (SysNewsInformation row : app.getRows()) {
-				if(row.getTitle().equals("进阶课堂")){
+			
+			Iterator<SysNewsInformation> iterator = app.getRows().iterator();
+			SysNewsInformation sni = null;
+    		while(iterator.hasNext()){
+    			sni = iterator.next();
+    			if(TenantContextHolder.getTenantId() != 1 && StringUtils.indexOf(sni.getTitle(), "商城") >= 0){
+    				iterator.remove();
+    				app.setTotal(app.getTotal() - 1);
+    			}else if(sni.getTitle().equals("进阶课堂")){
 					try {
 						//当前学员是否有可购买vip课
-						row.setRedDot(webFeignService.queryVipPracticeGroups());
+						sni.setRedDot(webFeignService.queryVipPracticeGroups());
 					}catch (Exception e){
 						e.printStackTrace();
 					}
 				}
-			}
+    		}
+    		
 		}
 		homeList.put("app",app);
 		return homeList;

+ 15 - 4
cms/src/main/java/com/ym/mec/cms/service/impl/SysNewsTypeServiceImpl.java

@@ -8,10 +8,14 @@ import com.ym.mec.cms.dal.entity.SysNewsTypeTree;
 import com.ym.mec.cms.service.SysNewsTypeService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
+
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Iterator;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -56,11 +60,18 @@ public class SysNewsTypeServiceImpl extends BaseServiceImpl<Integer, SysNewsType
 
         all.forEach(e -> {
             List<SysNewsInformation> list = informationDao.queryBySubType(e.getId(), memo);
-            if (CollectionUtils.isNotEmpty(list)) {
-                e.setInformationList(list);
-            } else {
-                e.setInformationList(informationDao.queryBySubType(e.getId(), null));
+            if (CollectionUtils.isEmpty(list)) {
+            	list = informationDao.queryBySubType(e.getId(), null);
             }
+            Iterator<SysNewsInformation> iterator = list.iterator();
+			SysNewsInformation sni = null;
+    		while(iterator.hasNext()){
+    			sni = iterator.next();
+    			if(TenantContextHolder.getTenantId() != 1 && StringUtils.indexOf(sni.getTitle(), "商城") >= 0){
+    				iterator.remove();
+    			}
+    		}
+            e.setInformationList(list);
         });
         List<SysNewsType> treeMenus = all.stream()
                 .filter((e) -> e.getParentId().equals(newsType.getParentId()))

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

@@ -28,6 +28,7 @@ import com.ym.mec.util.collection.ListUtil;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.json.JsonUtil;
+
 import org.apache.commons.collections.ListUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -438,6 +439,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		if (type == CourseScheduleType.VIP) {
 			throw new BizException("暂不支持vip课加课");
 		}
+		
+		if(type == CourseSchedule.CourseScheduleType.HIGH){
+        	type = CourseScheduleType.HIGH_ONLINE;
+        }
 
 		if (teachingArrangementList == null || teachingArrangementList.size() == 0) {
 			throw new BizException("请设置课时安排");

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleTeacherSalaryServiceImpl.java

@@ -1288,6 +1288,10 @@ public class CourseScheduleTeacherSalaryServiceImpl extends BaseServiceImpl<Long
             BigDecimal salary;
 
             Map<CourseSchedule.CourseScheduleType, TeacherDefaultMusicGroupSalary> collect = teacherSalaryList.stream().collect(Collectors.toMap(TeacherDefaultMusicGroupSalary::getCourseScheduleType, teacherDefaultMusicGroupSalary -> teacherDefaultMusicGroupSalary));
+            
+            if(courseSchedule.getType() == CourseSchedule.CourseScheduleType.HIGH){
+            	courseSchedule.setType(CourseScheduleType.HIGH_ONLINE);
+            }
 
             TeacherDefaultMusicGroupSalary teacherDefaultMusicGroupSalary = collect.get(courseSchedule.getType());
 

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

@@ -866,6 +866,9 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         if (payStatus == PayStatus.SUCCESSED) {
             throw new BizException("订单已支付成功,请勿重复支付");
         }
+        if (payStatus == PayStatus.PAYING) {
+            throw new BizException("有一笔支付中的订单,请勿重复支付");
+        }
         if (!repeatPay) {
             return BaseController.failed(HttpStatus.CONTINUE, "您有待支付的订单,是否继续支付");
         }