Bläddra i källkod

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

yonge 3 år sedan
förälder
incheckning
149ae89aba

+ 0 - 12
cms/src/main/java/com/ym/mec/cms/controller/NewsController.java

@@ -45,22 +45,14 @@ public class NewsController extends BaseController {
 
 	@Autowired
 	private SysNewsInformationService sysNewsInformationService;
-	
 	@Autowired
 	private SysNewsTypeService sysNewsTypeService;
-	
 	@Autowired
 	private SysNewsInformationDao sysNewsInformationDao;
-	
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
-	
 	@Autowired
 	private WebFeignService webFeignService;
-
-	@Autowired
-	private StudentRegistrationDao studentRegistrationDao;
-
 	@Autowired
 	private SysConfigService sysConfigService;
 
@@ -85,11 +77,7 @@ public class NewsController extends BaseController {
 			}
 		}
 
-//		SysConfig cloudTeacherActiveIds = sysConfigService.findByParamName(SysConfigService.CLOUD_TEACHER_ACTIVE_BANNER_IDS);
 		List<Integer> excludeIds = new ArrayList<>();
-//		if(Objects.nonNull(cloudTeacherActiveIds)&&StringUtils.isNotBlank(cloudTeacherActiveIds.getParanValue())){
-//			excludeIds = Arrays.stream(cloudTeacherActiveIds.getParanValue().split(",")).map(id->Integer.valueOf(id)).collect(Collectors.toList());
-//		}
 
 		if (user == null || user.getId() == null) {
 			queryInfo.setOrganId(43);

+ 21 - 29
mec-biz/src/main/java/com/ym/mec/biz/event/listener/TenantConfigListener.java

@@ -1,43 +1,35 @@
 package com.ym.mec.biz.event.listener;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.ym.mec.biz.dal.entity.TenantInfo;
 import com.ym.mec.biz.event.TenantConfigChangeEvent;
-import com.ym.mec.biz.service.SysTenantConfigService;
-import com.ym.mec.biz.service.TenantInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationListener;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-
 @Component
 public class TenantConfigListener implements ApplicationListener<TenantConfigChangeEvent> {
 
-    @Autowired
-    private SysTenantConfigService sysTenantConfigService;
-    @Autowired
-    private TenantInfoService tenantInfoService;
+//    @Autowired
+//    private SysTenantConfigService sysTenantConfigService;
+//    @Autowired
+//    private TenantInfoService tenantInfoService;
 
     @Override
     public void onApplicationEvent(TenantConfigChangeEvent event) {
-        if(event.getTenantId() != null){
-            TenantInfo tenantInfo = tenantInfoService.getById(event.getTenantId());
-            if(tenantInfo != null){
-                ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> allTenantConfig = sysTenantConfigService.getAllTenantConfig();
-                allTenantConfig.put(tenantInfo.getId(),sysTenantConfigService.queryAllMap(tenantInfo.getId()));
-                sysTenantConfigService.setTenantConfig(allTenantConfig);
-            }
-        }else {
-            List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
-            if(tenantInfos != null && tenantInfos.size() > 0){
-                ConcurrentHashMap<Integer,ConcurrentHashMap<String,String>> tenantConfig = new ConcurrentHashMap<>(tenantInfos.size());
-                for (TenantInfo tenantInfo : tenantInfos) {
-                    tenantConfig.put(tenantInfo.getId(),sysTenantConfigService.queryAllMap(tenantInfo.getId()));
-                }
-                sysTenantConfigService.setTenantConfig(tenantConfig);
-            }
-        }
+//        if(event.getTenantId() != null){
+//            TenantInfo tenantInfo = tenantInfoService.getById(event.getTenantId());
+//            if(tenantInfo != null){
+//                ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> allTenantConfig = sysTenantConfigService.getAllTenantConfig();
+//                allTenantConfig.put(tenantInfo.getId(),sysTenantConfigService.queryAllMap(tenantInfo.getId()));
+//                sysTenantConfigService.setTenantConfig(allTenantConfig);
+//            }
+//        }else {
+//            List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
+//            if(tenantInfos != null && tenantInfos.size() > 0){
+//                ConcurrentHashMap<Integer,ConcurrentHashMap<String,String>> tenantConfig = new ConcurrentHashMap<>(tenantInfos.size());
+//                for (TenantInfo tenantInfo : tenantInfos) {
+//                    tenantConfig.put(tenantInfo.getId(),sysTenantConfigService.queryAllMap(tenantInfo.getId()));
+//                }
+//                sysTenantConfigService.setTenantConfig(tenantConfig);
+//            }
+//        }
     }
 }

+ 5 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -1720,7 +1720,11 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             int totalPayNum = studentRegistrationDao.getFirstPayNum(queryInfo.getMusicGroupId(), startTime, null);
             pageInfo.setFirstDayPayNum(firstPayNum);
             pageInfo.setPayNum(totalPayNum);
-            pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum), 2, BigDecimal.ROUND_HALF_UP));
+            if(totalPayNum == 0){
+                pageInfo.setPayScale(new BigDecimal(0));
+            }else {
+                pageInfo.setPayScale(new BigDecimal(firstPayNum).multiply(new BigDecimal(100)).divide(new BigDecimal(totalPayNum), 2, BigDecimal.ROUND_HALF_UP));
+            }
         }
 
         pageInfo.setTotal(count);

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

@@ -44,8 +44,6 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
     private SubjectGoodsMapperDao subjectGoodsMapperDao;
     @Autowired
     private ChargeTypeOrganizationFeeDao chargeTypeOrganizationFeeDao;
-    @Autowired
-    private MusicGroupDao musicGroupDao;
 
     @Override
     public BaseDAO<Integer, Subject> getDAO() {

+ 20 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysTenantConfigServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dao.SysTenantConfigDao;
 import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.entity.SysTenantConfig;
@@ -23,11 +24,13 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.stream.Collectors;
 
 @Service
-public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTenantConfig>  implements SysTenantConfigService, ApplicationEventPublisherAware {
+public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTenantConfig>  implements SysTenantConfigService {
 	
 	@Autowired
 	private SysTenantConfigDao sysTenantConfigDao;
 	@Autowired
+	private SysConfigDao sysConfigDao;
+	@Autowired
 	private RedissonClient redissonClient;
 	private static final String tenantKey = "sysTenantConfig";
 
@@ -36,13 +39,13 @@ public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTena
 		return sysTenantConfigDao;
 	}
 
-	private ApplicationEventPublisher applicationEventPublisher;
+//	private ApplicationEventPublisher applicationEventPublisher;
 
-	@Override
-	public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
-		this.applicationEventPublisher = applicationEventPublisher;
-		applicationEventPublisher.publishEvent(new TenantConfigChangeEvent(this));
-	}
+//	@Override
+//	public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
+//		this.applicationEventPublisher = applicationEventPublisher;
+//		applicationEventPublisher.publishEvent(new TenantConfigChangeEvent(this));
+//	}
 
 	@Override
 	public void setTenantConfig(ConcurrentHashMap<Integer, ConcurrentHashMap<String, String>> tenantConfig) {
@@ -79,10 +82,17 @@ public class SysTenantConfigServiceImpl extends BaseServiceImpl<Integer, SysTena
 		if(sysConfigs == null || sysConfigs.size() == 0){
 			return;
 		}
+		//如果是平台账户只改默认值
+		if(tenantId < 0){
+			sysConfigDao.batchUpdate(sysConfigs);
+			return;
+		}
 		List<Long> configIdList = sysConfigs.stream().map(e -> e.getId()).collect(Collectors.toList());
-		sysTenantConfigDao.delByConfigId(configIdList,tenantId);
-		sysTenantConfigDao.batchInsert(sysConfigs,tenantId);
-		applicationEventPublisher.publishEvent(new TenantConfigChangeEvent(this,tenantId));
+		if(tenantId > 0){
+			sysTenantConfigDao.delByConfigId(configIdList,tenantId);
+			sysTenantConfigDao.batchInsert(sysConfigs,tenantId);
+		}
+//		applicationEventPublisher.publishEvent(new TenantConfigChangeEvent(this,tenantId));
 	}
 
 	@Override

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/ChildrenDayReserveMapper.xml

@@ -157,6 +157,7 @@
     </select>
     <sql id="queryChildrenStatisticsSql">
         <where>
+            cdr.tenant_id_ = #{tenantId}
             <if test="cooperationId != null">
                 AND cdr.cooperation_organ_id_ = #{cooperationId}
             </if>

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/StudentMapper.xml

@@ -424,7 +424,7 @@
 
     <sql id="student4OperatingQueryCondition">
         <where>
-            su.user_type_ LIKE '%STUDENT%' and su.tenant_id_ = #{tenantId}
+            su.user_type_ LIKE '%STUDENT%' and s.tenant_id_ = #{tenantId}
             <if test="search != null and search != ''">
                 AND (su.phone_ LIKE CONCAT('%',#{search},'%') OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.id_
                 LIKE CONCAT('%',#{search},'%'))

+ 0 - 4
mec-web/src/main/java/com/ym/mec/web/controller/ChildrenReserveController.java

@@ -1,7 +1,5 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.ChildrenDayMsgDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDetailDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDto;
@@ -27,8 +25,6 @@ public class ChildrenReserveController extends BaseController {
     @Autowired
     private ChildrenDayReserveService childrenDayReserveService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
-    @Autowired
     private OrganizationService organizationService;
 
     @ApiOperation(value = "21年暑期考级活动统计列表页面")