Explorar el Código

Merge remote-tracking branch 'origin/saas' into saas

zouxuan hace 3 años
padre
commit
a38cefff1c
Se han modificado 33 ficheros con 599 adiciones y 94 borrados
  1. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java
  2. 20 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysEmailDao.java
  3. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysPaymentConfigDao.java
  4. 120 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysEmail.java
  5. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreCategories.java
  6. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/service/SubjectService.java
  7. 15 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysEmailService.java
  8. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/SysPaymentConfigService.java
  9. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/AppRedemptionCodeServiceImpl.java
  10. 63 21
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentActivityServiceImpl.java
  11. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SellOrderServiceImpl.java
  12. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java
  13. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectChangeServiceImpl.java
  14. 7 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SubjectServiceImpl.java
  15. 25 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysEmailServiceImpl.java
  16. 45 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java
  17. 2 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java
  18. 5 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysPaymentConfigServiceImpl.java
  19. 17 1
      mec-biz/src/main/resources/config/mybatis/SubjectMapper.xml
  20. 28 0
      mec-biz/src/main/resources/config/mybatis/SysEmailMapper.xml
  21. 11 7
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml
  22. 3 2
      mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml
  23. 1 2
      mec-student/src/main/java/com/ym/mec/student/controller/StudentManageController.java
  24. 1 4
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherSubjectController.java
  25. 96 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/entity/SysEmail.java
  26. 20 12
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/MessageSenderPluginContext.java
  27. 11 2
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/provider/CommEmailPlugin.java
  28. 9 0
      mec-web/src/main/java/com/ym/mec/web/controller/AppRedemptionCodeController.java
  29. 10 3
      mec-web/src/main/java/com/ym/mec/web/controller/SubjectController.java
  30. 28 0
      mec-web/src/main/java/com/ym/mec/web/controller/SysEmailController.java
  31. 26 9
      mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java
  32. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java
  33. 1 1
      mec-web/src/main/java/com/ym/mec/web/controller/education/EduSubjectController.java

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SubjectDao.java

@@ -93,7 +93,7 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
      *
      * @return
      */
-    List<Subject> findSubSubjects(@Param("tenantId") Integer tenantId);
+    List<Subject> findSubSubjects(@Param("parentSubjectId") Integer parentSubjectId);
 
     List<Subject> findBySubjectByIdList(@Param("subjectIdList") String subjectIdList);
 
@@ -162,4 +162,11 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
      */
     List<StudentRegistration> getRegisterSubject(@Param("musicGroupId") String musicGroupId,
                                                  @Param("userIds") List<Integer> userIds);
+
+    /**
+     * 按id或名称模糊搜索
+     * @param search 搜索条件
+     * @return 查询结果
+     */
+    List<Subject> search(@Param("search") String search);
 }

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysEmailDao.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.biz.dal.entity.SysEmail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * (SysEmail)表数据库访问层
+ *
+ * @author makejava
+ * @since 2022-01-04 17:07:43
+ */
+public interface SysEmailDao extends BaseMapper<SysEmail> {
+
+   int insertBatch(@Param("entities") List<SysEmail> entities);
+   
+}
+

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysPaymentConfigDao.java

@@ -31,12 +31,12 @@ public interface SysPaymentConfigDao extends BaseDAO<Integer, SysPaymentConfig>
      * @param payType
      * @return
      */
-    List<SysPaymentConfig> getPaymentConfigs(@Param("payType") PaymentChannelEnum payType);
+    List<SysPaymentConfig> getPaymentConfigs(@Param("payType") PaymentChannelEnum payType, @Param("tenantId") Integer tenantId);
 
     /**
      * @return
      */
-    List<SysPaymentConfig> getOutAccounts(@Param("payType") PaymentChannelEnum payType);
+    List<SysPaymentConfig> getOutAccounts(@Param("payType") PaymentChannelEnum payType, @Param("tenantId") Integer tenantId);
 
     /**
      * 根据汇付账户获取配置

+ 120 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysEmail.java

@@ -0,0 +1,120 @@
+package com.ym.mec.biz.dal.entity;
+
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+/**
+ * (SysEmail)表实体类
+ *
+ * @author makejava
+ * @since 2022-01-04 17:07:43
+ */
+@ApiModel(value = "sys_email-${tableInfo.comment}")
+public class SysEmail implements Serializable {
+   @TableId(value = "id_", type = IdType.AUTO)
+     @ApiModelProperty(value = "${column.comment}")
+    private Integer id;
+    
+  @TableField("host_name_")
+     @ApiModelProperty(value = "SMTP服务器")
+    private String hostName;
+    
+  @TableField("smtp_port_")
+     @ApiModelProperty(value = "SMTP服务器端口")
+    private Integer smtpPort;
+    
+  @TableField("user_name_")
+     @ApiModelProperty(value = "SMTP服务器认证用户名")
+    private String userName;
+    
+  @TableField("password_")
+     @ApiModelProperty(value = "SMTP服务器认证密码")
+    private String password;
+    
+  @TableField("from_")
+     @ApiModelProperty(value = "发件人邮箱")
+    private String from;
+    
+  @TableField("from_name_")
+     @ApiModelProperty(value = "落款")
+    private String fromName;
+    
+  @TableField("tenant_id_")
+     @ApiModelProperty(value = "${column.comment}")
+    private Integer tenantId;
+    
+    private static final long serialVersionUID = 1L;
+    
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+    }
+
+    public Integer getSmtpPort() {
+        return smtpPort;
+    }
+
+    public void setSmtpPort(Integer smtpPort) {
+        this.smtpPort = smtpPort;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getFrom() {
+        return from;
+    }
+
+    public void setFrom(String from) {
+        this.from = from;
+    }
+
+    public String getFromName() {
+        return fromName;
+    }
+
+    public void setFromName(String fromName) {
+        this.fromName = fromName;
+    }
+
+    public Integer getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Integer tenantId) {
+        this.tenantId = tenantId;
+    }
+
+
+}
+

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SysMusicScoreCategories.java

@@ -41,6 +41,8 @@ public class SysMusicScoreCategories {
 	private Integer order;
 
 	private Integer musicScoreNum;
+
+	private Integer musicScoreNumSum;
 	
 	private String soundResource;
 
@@ -171,4 +173,11 @@ public class SysMusicScoreCategories {
 		return ToStringBuilder.reflectionToString(this);
 	}
 
+	public Integer getMusicScoreNumSum() {
+		return musicScoreNumSum;
+	}
+
+	public void setMusicScoreNumSum(Integer musicScoreNumSum) {
+		this.musicScoreNumSum = musicScoreNumSum;
+	}
 }

+ 8 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/SubjectService.java

@@ -82,7 +82,7 @@ public interface SubjectService extends BaseService<Integer, Subject> {
      * 获取子级科目列表
      * @return
      */
-    List<Subject> findSubSubjects(Integer tenantId);
+    List<Subject> findSubSubjects(Integer parentSubjectId);
 
     List<Subject> findBySubjectByIdList(List<Integer> subjectIdList);
 
@@ -102,4 +102,11 @@ public interface SubjectService extends BaseService<Integer, Subject> {
      * @return
      */
     SubFeeSettingDto setSubjectInfo(Integer chargeTypeId);
+
+    /**
+     * 按名称和Id模糊搜索
+     * @param search 搜索条件
+     * @return 查询结果
+     */
+    List<Subject> search(String search);
 }

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysEmailService.java

@@ -0,0 +1,15 @@
+package com.ym.mec.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.entity.SysEmail;
+
+/**
+ * (SysEmail)表服务接口
+ *
+ * @author makejava
+ * @since 2022-01-04 17:07:43
+ */
+public interface SysEmailService extends IService<SysEmail> {
+
+}
+

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/SysPaymentConfigService.java

@@ -29,7 +29,7 @@ public interface SysPaymentConfigService extends BaseService<Integer, SysPayment
      * @param payType
      * @return
      */
-    List<SysPaymentConfig> getPaymentConfigs(PaymentChannelEnum payType);
+    List<SysPaymentConfig> getPaymentConfigs(PaymentChannelEnum payType, Integer tenantId);
 
 
     /**
@@ -38,7 +38,7 @@ public interface SysPaymentConfigService extends BaseService<Integer, SysPayment
      * @param merNos
      * @return
      */
-    AccountType checkAccountType(PaymentChannelEnum payType, String merNos);
+    AccountType checkAccountType(PaymentChannelEnum payType, String merNos, Integer tenantId);
 
     /**
      * 根据汇付获取配置

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

@@ -120,7 +120,7 @@ public class AppRedemptionCodeServiceImpl extends ServiceImpl<RedemptionCodeDao,
     @Override
     public void checkLowVolume() {
         Integer volume = redemptionCodeDao.findNull();
-        if (volume == null || volume < 10) {
+        if (volume == null || volume < 10000) {
             Map<Integer, String> receivers = new HashMap<>(1);
             receivers.put(0, "13512341234");
             sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS,

+ 63 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentActivityServiceImpl.java

@@ -1,42 +1,84 @@
 package com.ym.mec.biz.service.impl;
 
-import ch.qos.logback.core.util.StringCollectionUtil;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dao.CooperationOrganDao;
+import com.ym.mec.biz.dal.dao.GoodsDao;
+import com.ym.mec.biz.dal.dao.QuestionnaireQuestionDao;
+import com.ym.mec.biz.dal.dao.QuestionnaireQuestionItemDao;
+import com.ym.mec.biz.dal.dao.QuestionnaireTopicDao;
+import com.ym.mec.biz.dal.dao.QuestionnaireUserResultDao;
+import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
+import com.ym.mec.biz.dal.dao.ReplacementInstrumentCooperationDao;
+import com.ym.mec.biz.dal.dao.SellOrderDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityDto;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatHead;
 import com.ym.mec.biz.dal.dto.ReplacementPayDto;
-import com.ym.mec.biz.dal.entity.*;
-import com.ym.mec.biz.dal.enums.*;
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
+import com.ym.mec.biz.dal.entity.Goods;
+import com.ym.mec.biz.dal.entity.QuestionnaireQuestion;
+import com.ym.mec.biz.dal.entity.QuestionnaireQuestionItem;
+import com.ym.mec.biz.dal.entity.QuestionnaireTopic;
+import com.ym.mec.biz.dal.entity.QuestionnaireUserResult;
+import com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity;
+import com.ym.mec.biz.dal.entity.ReplacementInstrumentCooperation;
+import com.ym.mec.biz.dal.entity.SellOrder;
+import com.ym.mec.biz.dal.entity.Student;
+import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
+import com.ym.mec.biz.dal.entity.SysUserCashAccount;
+import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
+import com.ym.mec.biz.dal.enums.AccountType;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.biz.dal.enums.GoodsType;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.MessageTypeEnum;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.enums.PayStatus;
+import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
+import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.QuestionnaireActiveTypeEnum;
+import com.ym.mec.biz.dal.enums.SellTypeEnum;
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.biz.dal.page.ReplacementInstrumentActivityQueryInfo;
-import com.ym.mec.biz.dal.page.ReplacementInstrumentQueryInfo;
-import com.ym.mec.biz.service.*;
+import com.ym.mec.biz.service.ContractService;
+import com.ym.mec.biz.service.CooperationOrganService;
+import com.ym.mec.biz.service.GoodsService;
+import com.ym.mec.biz.service.PayService;
+import com.ym.mec.biz.service.ReplacementInstrumentActivityService;
+import com.ym.mec.biz.service.StudentPaymentOrderService;
+import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
+import com.ym.mec.biz.service.StudentService;
+import com.ym.mec.biz.service.SysCouponCodeService;
+import com.ym.mec.biz.service.SysMessageService;
+import com.ym.mec.biz.service.SysPaymentConfigService;
+import com.ym.mec.biz.service.SysUserCashAccountDetailService;
+import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.IdGeneratorService;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
-import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
 
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-
-import java.math.BigDecimal;
-import java.util.*;
-import java.util.stream.Collectors;
-
 @Service
 public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<Integer, ReplacementInstrumentActivity> implements ReplacementInstrumentActivityService {
 
@@ -531,7 +573,7 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
         BigDecimal goodsTotalPrice = goodies.stream().map(Goods::getGroupPurchasePrice).reduce(BigDecimal.ZERO, BigDecimal::add);
         Map<Integer, GoodsType> goodsTypeMap = goodies.stream().collect(Collectors.toMap(Goods::getId, Goods::getType));
 
-        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos());
+        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos(), order.getTenantId());
 
         List<Integer> goodsIds = new ArrayList<>();
         goodsIds.add(goods.getId());

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

@@ -93,7 +93,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
         BigDecimal goodsTotalBalance = totalAmount.compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO : goodsTotalPrice.multiply(balance).divide(totalAmount, 2, BigDecimal.ROUND_DOWN);
         //商品占用的总现金
         BigDecimal goodsTotalActualAmount = totalAmount.compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO : goodsTotalPrice.multiply(totalActualAmount).divide(totalAmount, 2, BigDecimal.ROUND_DOWN);
-        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos());
+        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos(), order.getTenantId());
 
         List<SellOrder> sellOrderList = goodsService.subtractStock(goodsIds, accountType);
         BigDecimal freeCouponRemitFee = couponRemitFee;
@@ -251,7 +251,7 @@ public class SellOrderServiceImpl extends BaseServiceImpl<Integer, SellOrder> im
         int i = 1;
         BigDecimal detailRouteBalance = BigDecimal.ZERO;
 
-        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(studentPaymentOrder.getPaymentChannel()), studentPaymentOrder.getMerNos());
+        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(studentPaymentOrder.getPaymentChannel()), studentPaymentOrder.getMerNos(), tenantId);
 
         for (StudentPaymentOrderDetail orderDetail : orderDetails) {
             BigDecimal detailBalance = orderDetail.getPrice().compareTo(BigDecimal.ZERO) <= 0 ? BigDecimal.ZERO :

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

@@ -836,7 +836,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
         });
         AccountType accountType = AccountType.INTERNAL;
         if (StringUtils.isNotEmpty(orderByOrderNo.getPaymentChannel())) {
-            accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(orderByOrderNo.getPaymentChannel()), orderByOrderNo.getMerNos());
+            accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(orderByOrderNo.getPaymentChannel()), orderByOrderNo.getMerNos(), orderByOrderNo.getTenantId());
         }
         //实际扣减的库存商品
         List<SellOrder> sellOrderList = goodsService.subtractStock(goodsIds, accountType);

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

@@ -800,7 +800,7 @@ public class SubjectChangeServiceImpl extends BaseServiceImpl<Integer, SubjectCh
         BigDecimal hasRouteBalance = BigDecimal.ZERO;
         BigDecimal hasRouteExpectAmount = BigDecimal.ZERO;
 
-        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos());
+        AccountType accountType = sysPaymentConfigService.checkAccountType(PaymentChannelEnum.valueOf(order.getPaymentChannel()), order.getMerNos(), order.getTenantId());
         List<SellOrder> sellOrderList = goodsService.subtractStock(goodsIds, accountType);
 
         for (Integer goodsId : goodsIds) {

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

@@ -196,8 +196,8 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
     }
 
     @Override
-    public List<Subject> findSubSubjects(Integer tenantId) {
-        return subjectDao.findSubSubjects(tenantId);
+    public List<Subject> findSubSubjects(Integer parentSubjectId) {
+        return subjectDao.findSubSubjects(parentSubjectId);
     }
 
     @Override
@@ -219,4 +219,9 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
     public SubFeeSettingDto setSubjectInfo(Integer chargeTypeId) {
         return null;
     }
+
+    @Override
+    public List<Subject> search(String search) {
+        return  subjectDao.search(search);
+    }
 }

+ 25 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysEmailServiceImpl.java

@@ -0,0 +1,25 @@
+package com.ym.mec.biz.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.biz.dal.dao.SysEmailDao;
+import com.ym.mec.biz.dal.entity.SysEmail;
+import com.ym.mec.biz.service.SysEmailService;
+import org.springframework.stereotype.Service;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * (SysEmail)表服务实现类
+ *
+ * @author makejava
+ * @since 2022-01-04 17:07:43
+ */
+@Service("sysEmailService")
+public class SysEmailServiceImpl extends ServiceImpl<SysEmailDao, SysEmail> implements SysEmailService {
+
+    private final static Logger logger = LoggerFactory.getLogger(SysEmailServiceImpl.class);
+
+
+}
+

+ 45 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.dao.SysMessageDao;
 import com.ym.mec.biz.dal.dao.WaitSendMessageDao;
 import com.ym.mec.biz.dal.dto.Mapper;
 import com.ym.mec.biz.dal.dto.SysMessageDto;
+import com.ym.mec.biz.dal.entity.SysEmail;
 import com.ym.mec.biz.dal.entity.SysMessage;
 import com.ym.mec.biz.dal.entity.SysMessageConfig;
 import com.ym.mec.biz.dal.entity.WaitSendMessage;
@@ -24,6 +25,7 @@ import com.ym.mec.common.entity.ImTxtMessage;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.common.page.WrapperUtil;
 import com.ym.mec.common.redis.service.RedisCache;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
@@ -44,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
 import java.util.Map.Entry;
+import java.util.stream.Collectors;
 
 import static com.ym.mec.biz.dal.enums.MessageTypeEnum.STUDENT_PUSH_VIP_BUY;
 
@@ -64,6 +67,7 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 	@Autowired
 	private SysUserFeignService sysUserFeignService;
 
+
 	@Autowired
 	private WaitSendMessageDao waitSendMessageDao;
 
@@ -76,6 +80,9 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 	@Autowired
 	private RedisCache<String, Object> redisCache;
 
+	@Autowired
+	private SysEmailServiceImpl sysEmailService;
+
 	// 验证码有效期
 	public static final int CODE_EXPIRE = 60 * 5;
 
@@ -305,6 +312,9 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 		if (receivers == null || receivers.size() == 0) {
 			throw new BizException("接收地址不能为空");
 		}
+		// email data from database load, 使用接收者 tenantId, 假设发送者和接收者为同一机构
+		Integer tenantId = getTenantIdByUser(null, String.valueOf(receivers.keySet().stream().findFirst()));
+		loadEmailInfo(messageSender, tenantId);
 		if(StringUtils.isNotEmpty(jpushType) && jpushType == "STUDENT"){
 			//如果不是缴费信息
 			if(type != STUDENT_PUSH_VIP_BUY){
@@ -367,6 +377,8 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 				url, messageConfig.getGroup(),jpushType);
 	}
 
+
+
 	@Override
 	@Async
 	public void batchPushMessage(MessageTypeEnum type, Map<Integer, String> receivers, Date triggerTime, Integer readStatus,
@@ -432,11 +444,13 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 
 	@Override
 	@Async
-	public void sendMessage(MessageSender messageSender, Integer userId, String title, String content, String receiver, Date triggerTime, Integer readStatus,
-			String url, String group,String jpushType) {
+	public void sendMessage(MessageSender messageSender, Integer userId, String title, String content, String receiver, Date triggerTime, Integer readStatus, String url, String group,String jpushType) {
 		if (StringUtils.isBlank(receiver)) {
 			throw new BizException("接收地址不能为空");
 		}
+		// email data from database load
+		Integer tenantId = getTenantIdByUser(userId, receiver);
+		loadEmailInfo(messageSender, tenantId);
 		Date date = new Date();
 		SendStatusEnum status = SendStatusEnum.WAIT;
 		String errorMsg = null;
@@ -466,6 +480,35 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 		addMessage(receivers, title, content, triggerTime, mode, status, errorMsg, readStatus, url, null,jpushType);
 	}
 
+	private Integer getTenantIdByUser(Integer userId, String receiver) throws BizException {
+		SysUser user;
+		if (userId == null) {
+			user = sysUserFeignService.queryUserByMobile(receiver);
+			if (user != null) {
+				return user.getTenantId();
+			} // user query null using receiver query
+		}
+
+		user = sysUserFeignService.queryUserByMobile(receiver);
+		if (user != null) {
+			return user.getTenantId();
+		} else {
+			throw new BizException("找不到发送者用户 id: " + userId.toString() + " 接收者 " + receiver);
+		}
+	}
+
+	private void loadEmailInfo(MessageSender messageSender, Integer tenantId) {
+		if (Objects.equals(messageSender.getSendMode(), "EMAIL")) {
+			SysEmail email1 = sysEmailService.getOne(new WrapperUtil<SysEmail>().hasEq("tenant_id_", tenantId).queryWrapper());
+			messageSenderPluginContext.sysEmail.setHostName(email1.getHostName());
+			messageSenderPluginContext.sysEmail.setSmtpPort(email1.getSmtpPort());
+			messageSenderPluginContext.sysEmail.setUserName(email1.getUserName());
+			messageSenderPluginContext.sysEmail.setPassword(email1.getPassword());
+			messageSenderPluginContext.sysEmail.setFromName(email1.getFromName());
+			messageSenderPluginContext.sysEmail.setFrom(email1.getFrom());
+		}
+	}
+
 	@Override
 	public boolean sendSecurityCode(MessageSender messageSender, Integer userId, MessageTypeEnum messageType, String receiver) {
 		String key1 = getVerificationCode1CacheKey(messageType, receiver);

+ 2 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMusicScoreCategoriesServiceImpl.java

@@ -41,11 +41,7 @@ public class SysMusicScoreCategoriesServiceImpl extends BaseServiceImpl<Integer,
 		List<SysMusicScoreCategories> scoreCategoriesAllList = sysMusicScoreCategoriesDao.findByParentId(null,menuQueryInfo.getOrganId(),menuQueryInfo.getEnable());
 		for (SysMusicScoreCategories categories : scoreCategories) {
 			getTree(categories, scoreCategoriesAllList);
-			if (categories.getSysMusicScoreCategoriesList() != null) {
-				categories.setMusicScoreNum(categories.getSysMusicScoreCategoriesList().size());
-			} else {
-				categories.setMusicScoreNum(0);
-			}
+			categories.setMusicScoreNum(categories.getMusicScoreNumSum());
 		}
 		return scoreCategories;
 	}
@@ -209,11 +205,7 @@ public class SysMusicScoreCategoriesServiceImpl extends BaseServiceImpl<Integer,
 			//遍历子节点....
 			for (SysMusicScoreCategories score : scoreCategories) {
 				getTree(score, scoreCategoriesAllList);
-				if (score.getSysMusicScoreCategoriesList() != null) {
-					score.setMusicScoreNum(score.getSysMusicScoreCategoriesList().size());
-				} else {
-					score.setMusicScoreNum(0);
-				}
+				score.setMusicScoreNum(score.getMusicScoreNumSum());
 			}
 		}
 		return categories;

+ 5 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysPaymentConfigServiceImpl.java

@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -34,16 +35,16 @@ public class SysPaymentConfigServiceImpl extends BaseServiceImpl<Integer, SysPay
     }
 
     @Override
-    public List<SysPaymentConfig> getPaymentConfigs(PaymentChannelEnum payType) {
-        return sysPaymentConfigDao.getPaymentConfigs(payType);
+    public List<SysPaymentConfig> getPaymentConfigs(PaymentChannelEnum payType, Integer tenantId) {
+        return sysPaymentConfigDao.getPaymentConfigs(payType,tenantId);
     }
 
     @Override
-    public AccountType checkAccountType(PaymentChannelEnum payType, String merNos) {
+    public AccountType checkAccountType(PaymentChannelEnum payType, String merNos, Integer tenantId) {
         if (payType == null || (!payType.equals(PaymentChannelEnum.ADAPAY) && !payType.equals(PaymentChannelEnum.YQPAY)) || StringUtils.isBlank(merNos)) {
             return AccountType.INTERNAL;
         }
-        List<SysPaymentConfig> accounts = sysPaymentConfigDao.getOutAccounts(payType);
+        List<SysPaymentConfig> accounts = sysPaymentConfigDao.getOutAccounts(payType,tenantId);
         String[] merNoArr = merNos.split(",");
         AccountType accountType = AccountType.INTERNAL;
         NODE1:

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

@@ -136,7 +136,22 @@
     </select>
     <select id="findSubSubjects" resultMap="Subject">
         SELECT * FROM `subject`
-        WHERE parent_subject_id_ != 0 AND del_flag_ = 0
+        <where>
+            parent_subject_id_ != 0 AND del_flag_ = 0
+            <if test="parentSubjectId != null and parentSubjectId != ''">
+                AND parent_subject_id_ = #{parentSubjectId}
+            </if>
+        </where>
+    </select>
+
+    <select id="search" resultMap="Subject">
+        SELECT * FROM `subject`
+        <where>
+            del_flag_ = 0
+            <if test="search != null and search != ''">
+                AND (id_ = #{search} or name_ like concat('%', #{search}, '%'))
+            </if>
+        </where>
     </select>
 
     <sql id="querySubPageSql">
@@ -241,4 +256,5 @@
             #{userId}
         </foreach>
     </select>
+
 </mapper>

+ 28 - 0
mec-biz/src/main/resources/config/mybatis/SysEmailMapper.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ym.mec.biz.dal.dao.SysEmailDao">
+  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.SysEmail">
+                       <id column="id_" jdbcType="INTEGER" property="id"/>
+                                  <result column="host_name_" jdbcType="VARCHAR" property="hostName"/>
+                                  <result column="smtp_port_" jdbcType="INTEGER" property="smtpPort"/>
+                                  <result column="user_name_" jdbcType="VARCHAR" property="userName"/>
+                                  <result column="password_" jdbcType="VARCHAR" property="password"/>
+                                  <result column="from_" jdbcType="VARCHAR" property="from"/>
+                                  <result column="from_name_" jdbcType="VARCHAR" property="fromName"/>
+                                  <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
+                </resultMap>
+  
+  <sql id="Base_Column_List">    
+                                            id_, host_name_, smtp_port_, user_name_, password_, from_, from_name_, tenant_id_
+  </sql>
+  
+   <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+            parameterType="com.ym.mec.biz.dal.entity.SysEmail">
+       insert into sys_email(host_name_, smtp_port_, user_name_, password_, from_, from_name_, tenant_id_)
+       values
+       <foreach collection="entities" item="entity" separator=",">
+       (#{entity.hostName}, #{entity.smtpPort}, #{entity.userName}, #{entity.password}, #{entity.from}, #{entity.fromName}, #{entity.tenantId})
+       </foreach>
+   </insert>
+
+</mapper>

+ 11 - 7
mec-biz/src/main/resources/config/mybatis/SysMusicScoreCategoriesMapper.xml

@@ -17,6 +17,7 @@
 		<result column="order_" property="order" />
 		<result column="organ_name_" property="organNames" />
 		<result column="music_score_num_" property="musicScoreNum" />
+		<result column="music_score_num_sum_" property="musicScoreNumSum" />
 		<result column="sound_resource_" property="soundResource" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -24,12 +25,16 @@
 	
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="SysMusicScoreCategories" >
-		SELECT * FROM sys_music_score_categories WHERE id_ = #{id} 
+		SELECT categ.*,
+		(select count(1) from sys_music_score ms where categ.id_ = ms.music_score_categories_id_) as music_score_num_sum_
+		FROM sys_music_score_categories categ WHERE categ.id_ = #{id}
 	</select>
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="SysMusicScoreCategories">
-		SELECT * FROM sys_music_score_categories ORDER BY id_
+		SELECT categ.*,
+			   (select count(1) from sys_music_score ms where categ.id_ = ms.music_score_categories_id_) as music_score_num_sum_
+		       FROM sys_music_score_categories categ ORDER BY categ.id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
@@ -136,7 +141,6 @@
 				AND (sm.id_ = #{search} OR sm.name_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 		</where>
-		GROUP BY sm.id_
 		ORDER BY sm.order_
 		<include refid="global.limit"/>
 	</select>
@@ -160,11 +164,11 @@
 		</where>
 	</select>
 	<select id="findByParentId" resultMap="SysMusicScoreCategories">
-		SELECT count(score.id_) AS musicScoreNum, sm.* FROM sys_music_score_categories sm
-		LEFT JOIN sys_music_score score ON sm.id_ = score.music_score_categories_id_
+		SELECT sm.*,
+		(select count(1) from sys_music_score sms where sm.id_ = sms.music_score_categories_id_) as music_score_num_sum_
+        FROM sys_music_score_categories sm
 		<include refid="queryTree"/>
-		group by score.music_score_categories_id_
-# 		ORDER BY sm.order_
+ 		ORDER BY sm.order_
 	</select>
 	<select id="findByCategoriesIds" resultType="java.lang.String">
 		SELECT GROUP_CONCAT(id_) FROM sys_music_score_categories

+ 3 - 2
mec-biz/src/main/resources/config/mybatis/SysPaymentConfigMapper.xml

@@ -205,8 +205,9 @@
         FROM sys_payment_config spc
         LEFT JOIN organization o on spc.organ_id_ = o.id_
         <where>
+        	spc.tenant_id_ = #{tenantId}
             <if test="payType == null">
-                pay_type_ IS NOT NULL
+                and pay_type_ IS NOT NULL
                 AND (spc.yq_mer_no_ !='' OR spc.hf_mer_no_ !='')
             </if>
             <if test="payType != null">
@@ -223,7 +224,7 @@
 
     <!-- 获取所有账户类型为外部的账户 -->
     <select id="getOutAccounts" resultMap="SysPaymentConfig">
-        SELECT * FROM sys_payment_config WHERE account_type_ = 1
+        SELECT * FROM sys_payment_config WHERE account_type_ = 1 and tenant_id_ = #{tenantId}
         <if test="payType != null">
             AND pay_type_ = #{payType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>

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

@@ -318,8 +318,7 @@ public class StudentManageController extends BaseController {
     @ApiOperation(value = "获取子集科目列表")
     @GetMapping("subject/findSubSubjects")
     public Object findSubSubjects(){
-        Integer tenantId = TenantContextHolder.getTenantId();
-        return succeed(subjectService.findSubSubjects(tenantId));
+        return succeed(subjectService.findSubSubjects(null));
     }
 
     @ApiOperation(value = "获取用户所在分部的年级列表)")

+ 1 - 4
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherSubjectController.java

@@ -43,10 +43,7 @@ public class TeacherSubjectController extends BaseController {
     @ApiOperation(value = "获取子集科目列表")
     @GetMapping("/findSubSubjects")
     public Object findSubSubjects(Integer tenantId){
-        if(tenantId == null){
-            tenantId = TenantContextHolder.getTenantId();
-        }
-        return succeed(subjectService.findSubSubjects(tenantId));
+        return succeed(subjectService.findSubSubjects(null));
     }
 
 }

+ 96 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/entity/SysEmail.java

@@ -0,0 +1,96 @@
+package com.ym.mec.thirdparty.entity;
+
+import java.io.Serializable;
+
+/**
+ * (SysEmail)表实体类
+ *
+ * @author makejava
+ * @since 2022-01-04 17:07:43
+ */
+public class SysEmail implements Serializable {
+    private Integer id;
+    
+    private String hostName;
+    
+    private Integer smtpPort;
+    
+    private String userName;
+    
+    private String password;
+    
+    private String from;
+    
+    private String fromName;
+    
+    private Integer tenantId;
+    
+    private static final long serialVersionUID = 1L;
+    
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+    }
+
+    public Integer getSmtpPort() {
+        return smtpPort;
+    }
+
+    public void setSmtpPort(Integer smtpPort) {
+        this.smtpPort = smtpPort;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getFrom() {
+        return from;
+    }
+
+    public void setFrom(String from) {
+        this.from = from;
+    }
+
+    public String getFromName() {
+        return fromName;
+    }
+
+    public void setFromName(String fromName) {
+        this.fromName = fromName;
+    }
+
+    public Integer getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Integer tenantId) {
+        this.tenantId = tenantId;
+    }
+
+
+}
+

+ 20 - 12
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/MessageSenderPluginContext.java

@@ -4,7 +4,8 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import com.ym.mec.thirdparty.message.provider.YimeiSmsPlugin;
+import com.ym.mec.thirdparty.entity.SysEmail;
+import com.ym.mec.thirdparty.message.provider.*;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeansException;
@@ -13,17 +14,15 @@ import org.springframework.context.ApplicationContextAware;
 import org.springframework.stereotype.Component;
 
 import com.ym.mec.thirdparty.exception.ThirdpartyException;
-import com.ym.mec.thirdparty.message.provider.AwSmsPlugin;
-import com.ym.mec.thirdparty.message.provider.JiguangPushPlugin;
-import com.ym.mec.thirdparty.message.provider.MOxintongSMSPlugin;
-import com.ym.mec.thirdparty.message.provider.ShiyuanSMSPlugin;
 
 @Component
 public class MessageSenderPluginContext implements ApplicationContextAware {
 
+	public SysEmail sysEmail = new SysEmail();
+
 	public enum MessageSender {
 
-		JIGUANG("PUSH"), MOXINGTONG("SMS"), SHIYUAN("SMS"), YIMEI("SMS"), AWSMS("SMS");
+		JIGUANG("PUSH"), MOXINGTONG("SMS"), SHIYUAN("SMS"), YIMEI("SMS"), AWSMS("SMS"), EMAIL("EMAIL");
 
 		/**
 		 * 发送模式(SMS,PUSH,EMAIL)
@@ -44,18 +43,14 @@ public class MessageSenderPluginContext implements ApplicationContextAware {
 	private ApplicationContext applicationContext;
 
 	private final Map<String, String> mapper = new HashMap<String, String>() {
-
-		/**
-		 * 
-		 */
 		private static final long serialVersionUID = -3964872523891264522L;
-
 		{
 			put(StringUtils.lowerCase(JiguangPushPlugin.getName()), StringUtils.uncapitalize(JiguangPushPlugin.class.getSimpleName()));
 			put(StringUtils.lowerCase(MOxintongSMSPlugin.getName()), StringUtils.uncapitalize(MOxintongSMSPlugin.class.getSimpleName()));
 			put(StringUtils.lowerCase(ShiyuanSMSPlugin.getName()), StringUtils.uncapitalize(ShiyuanSMSPlugin.class.getSimpleName()));
 			put(StringUtils.lowerCase(YimeiSmsPlugin.getName()), StringUtils.uncapitalize(YimeiSmsPlugin.class.getSimpleName()));
 			put(StringUtils.lowerCase(AwSmsPlugin.getName()), StringUtils.uncapitalize(AwSmsPlugin.class.getSimpleName()));
+			put(StringUtils.lowerCase(CommEmailPlugin.getName()), StringUtils.uncapitalize(CommEmailPlugin.class.getSimpleName()));
 		}
 	};
 
@@ -104,8 +99,21 @@ public class MessageSenderPluginContext implements ApplicationContextAware {
 		if (StringUtils.isBlank(beanId)) {
 			throw new ThirdpartyException("消息提供方:{}不存在", beanId);
 		}
+		MessageSenderPlugin messageSenderPlugin = applicationContext.getBean(beanId, MessageSenderPlugin.class);
+		injectEmailAttribute(messageSenderPlugin);
+		return messageSenderPlugin;
+	}
 
-		return applicationContext.getBean(beanId, MessageSenderPlugin.class);
+	private void injectEmailAttribute(MessageSenderPlugin messageSenderPlugin) {
+		if (messageSenderPlugin.getClass() == CommEmailPlugin.class) {
+			CommEmailPlugin commEmailPlugin = (CommEmailPlugin) messageSenderPlugin;
+			commEmailPlugin.setHostName(sysEmail.getHostName());
+			commEmailPlugin.setSmtpPort(sysEmail.getSmtpPort());
+			commEmailPlugin.setUserName(sysEmail.getUserName());
+			commEmailPlugin.setPassword(sysEmail.getPassword());
+			commEmailPlugin.setFrom(sysEmail.getFrom());
+			commEmailPlugin.setFromName(sysEmail.getFromName());
+		}
 	}
 
 }

+ 11 - 2
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/provider/CommEmailPlugin.java

@@ -12,7 +12,7 @@ import com.ym.mec.thirdparty.message.MessageSenderPlugin;
 
 //@Service
 public class CommEmailPlugin implements MessageSenderPlugin, InitializingBean {
-	
+
 	private String hostName;
 
 	private int smtpPort;
@@ -49,6 +49,10 @@ public class CommEmailPlugin implements MessageSenderPlugin, InitializingBean {
 		this.fromName = fromName;
 	}
 
+	public static String getName() {
+		return "EMAIL";
+	}
+
 	@Override
 	public void afterPropertiesSet() throws Exception {
 		if (StringUtils.isBlank(hostName)) {
@@ -71,6 +75,7 @@ public class CommEmailPlugin implements MessageSenderPlugin, InitializingBean {
 			throw new RuntimeException("发件人邮箱没有配置");
 		}
 
+		// 落款名字
 		if (StringUtils.isBlank(fromName)) {
 			fromName = from;
 		}
@@ -98,7 +103,11 @@ public class CommEmailPlugin implements MessageSenderPlugin, InitializingBean {
 	@Override
 	public boolean batchSend(String subject, String content, String[] receivers, String url, String jpushType, String sound, String channelId) throws Exception {
 		for (String rev : receivers) {
-			send(subject, content, rev, url, jpushType, sound, channelId);
+			try {
+				send(subject, content, rev, url, jpushType, sound, channelId);
+			} catch(EmailException e) {
+				throw new RuntimeException("发送邮件出现异常", e);
+			}
 		}
 		return true;
 	}

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/controller/AppRedemptionCodeController.java

@@ -44,5 +44,14 @@ public class AppRedemptionCodeController extends BaseController {
         }
         return succeed(appRedemptionCodeService.allocation(userId));
     }
+
+    @ApiOperation(value = "使用量检测")
+    @GetMapping(value = "checkLowVolume")
+    // @PreAuthorize("@pcs.hasPermissions('appRedemptionCode/checkLowVolume')")
+    public Object checkLowVolume() {
+        appRedemptionCodeService.checkLowVolume();
+        return null;
+    }
+
 }
 

+ 10 - 3
mec-web/src/main/java/com/ym/mec/web/controller/SubjectController.java

@@ -94,10 +94,17 @@ public class SubjectController extends BaseController {
         return succeed(subjectService.findSubApplyDetail(musicGroupId));
     }
 
-    @ApiOperation(value = "获取子集科目列表")
+    @ApiOperation(value = "获取子集科目列表按父Id")
     @GetMapping("/findSubSubjects")
     @PreAuthorize("@pcs.hasPermissions('subject/findSubSubjects')")
-    public Object findSubSubjects(Integer tenantId){
-        return succeed(subjectService.findSubSubjects(tenantId));
+    public Object findSubSubjects(Integer parentSubjectId){
+        return succeed(subjectService.findSubSubjects(parentSubjectId));
+    }
+
+    @ApiOperation(value = "搜索按Id和名称")
+    @GetMapping("/search")
+    @PreAuthorize("@pcs.hasPermissions('subject/search')")
+    public Object search(String search){
+        return succeed(subjectService.search(search));
     }
 }

+ 28 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SysEmailController.java

@@ -0,0 +1,28 @@
+package com.ym.mec.web.controller;
+
+
+
+import com.ym.mec.biz.dal.entity.SysEmail;
+import com.ym.mec.biz.service.SysEmailService;
+import org.springframework.web.bind.annotation.*;
+import com.ym.mec.common.controller.BaseController;
+
+import javax.annotation.Resource;
+
+/**
+ * (SysEmail)表控制层
+ *
+ * @author makejava
+ * @since 2022-01-04 17:07:43
+ */
+@RestController
+@RequestMapping("/sysEmail")
+public class SysEmailController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private SysEmailService sysEmailService;
+
+}
+

+ 26 - 9
mec-web/src/main/java/com/ym/mec/web/controller/SysPaymentConfigController.java

@@ -1,19 +1,29 @@
 package com.ym.mec.web.controller;
 
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+
+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.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+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.entity.SysPaymentConfig;
-import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
 import com.ym.mec.biz.dal.page.SysPaymentConfigQueryInfo;
 import com.ym.mec.biz.service.SysPaymentConfigService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
-import io.swagger.annotations.*;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.Date;
 
 @RequestMapping("paymentConfig")
 @Api(tags = "支付设置服务")
@@ -22,6 +32,9 @@ public class SysPaymentConfigController extends BaseController {
 
     @Autowired
     private SysPaymentConfigService sysPaymentConfigService;
+    
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
 
     @ApiOperation(value = "新增支付配置")
     @PostMapping("/add")
@@ -96,7 +109,11 @@ public class SysPaymentConfigController extends BaseController {
     @GetMapping("/getPaymentConfigs")
     @PreAuthorize("@pcs.hasPermissions('paymentConfig/getPaymentConfigs')")
     public HttpResponseResult getPaymentConfigs(PaymentChannelEnum payType) {
-        return succeed(sysPaymentConfigService.getPaymentConfigs(payType));
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null || sysUser.getId() == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        return succeed(sysPaymentConfigService.getPaymentConfigs(payType, sysUser.getTenantId()));
     }
 
 

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -138,7 +138,7 @@ public class EduRepairController extends BaseController {
         if (sysUser == null) {
             return failed("用户信息获取失败");
         }
-        return succeed(subjectService.findSubSubjects(1));
+        return succeed(subjectService.findSubSubjects( null));
     }
 
     @ApiOperation("获取学生信息")

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/controller/education/EduSubjectController.java

@@ -25,7 +25,7 @@ public class EduSubjectController extends BaseController {
     @ApiOperation(value = "获取子集科目列表")
     @GetMapping("/findSubSubjects")
     public Object findSubSubjects(Integer tenantId){
-        return succeed(subjectService.findSubSubjects(tenantId));
+        return succeed(subjectService.findSubSubjects(null));
     }
 
     @ApiOperation(value = "根据科目编号查询科目")