Просмотр исходного кода

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

zouxuan 3 лет назад
Родитель
Сommit
16e5634856
54 измененных файлов с 1184 добавлено и 1956 удалено
  1. 0 28
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudRoomFlowConfigDao.java
  2. 0 18
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudRoomFlowInfoDao.java
  3. 0 18
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudRoomFlowRecordDao.java
  4. 5 9
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantConfigDao.java
  5. 4 11
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantInfoDao.java
  6. 2 13
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantProductInfoDao.java
  7. 0 74
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CloudRoomFlowDto.java
  8. 84 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantConfigDto.java
  9. 54 26
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantInfoDto.java
  10. 148 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantProductInfoDto.java
  11. 0 147
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudRoomFlowConfig.java
  12. 0 104
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudRoomFlowInfo.java
  13. 0 131
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudRoomFlowRecord.java
  14. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java
  15. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPreRegistration.java
  16. 29 79
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantConfig.java
  17. 48 65
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantInfo.java
  18. 59 47
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantProductInfo.java
  19. 12 6
      mec-biz/src/main/java/com/ym/mec/biz/dal/vo/PlatformServeModeVo.java
  20. 128 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/vo/TenantInfoInfoPageVo.java
  21. 5 8
      mec-biz/src/main/java/com/ym/mec/biz/event/listener/TenantConfigListener.java
  22. 0 19
      mec-biz/src/main/java/com/ym/mec/biz/service/CloudRoomFlowConfigService.java
  23. 0 4
      mec-biz/src/main/java/com/ym/mec/biz/service/CloudRoomFlowInfoService.java
  24. 0 4
      mec-biz/src/main/java/com/ym/mec/biz/service/CloudRoomFlowRecordService.java
  25. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentService.java
  26. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantConfigService.java
  27. 19 1
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantInfoService.java
  28. 9 1
      mec-biz/src/main/java/com/ym/mec/biz/service/TenantProductInfoService.java
  29. 0 112
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudRoomFlowConfigServiceImpl.java
  30. 0 21
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudRoomFlowInfoServiceImpl.java
  31. 0 19
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudRoomFlowRecordServiceImpl.java
  32. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformProductServiceImpl.java
  33. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PlatformServeServiceImpl.java
  34. 4 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentGoodsSellServiceImpl.java
  35. 44 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java
  36. 44 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantConfigServiceImpl.java
  37. 195 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantInfoServiceImpl.java
  38. 24 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantProductInfoServiceImpl.java
  39. 0 166
      mec-biz/src/main/resources/config/mybatis/CloudRoomFlowConfigMapper.xml
  40. 0 134
      mec-biz/src/main/resources/config/mybatis/CloudRoomFlowInfoMapper.xml
  41. 0 134
      mec-biz/src/main/resources/config/mybatis/CloudRoomFlowRecordMapper.xml
  42. 1 0
      mec-biz/src/main/resources/config/mybatis/PlatformServeDetailMapper.xml
  43. 13 7
      mec-biz/src/main/resources/config/mybatis/StudentMapper.xml
  44. 1 1
      mec-biz/src/main/resources/config/mybatis/SysMusicScoreMapper.xml
  45. 25 143
      mec-biz/src/main/resources/config/mybatis/TenantConfigMapper.xml
  46. 57 185
      mec-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml
  47. 6 119
      mec-biz/src/main/resources/config/mybatis/TenantProductInfoMapper.xml
  48. 12 0
      mec-common/common-core/src/main/java/com/ym/mec/common/config/MyBatisPlusConfig.java
  49. 23 0
      mec-common/common-core/src/main/java/com/ym/mec/common/page/PageUtil.java
  50. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  51. 11 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentController.java
  52. 0 65
      mec-web/src/main/java/com/ym/mec/web/controller/CloudRoomFlowConfigController.java
  53. 6 14
      mec-web/src/main/java/com/ym/mec/web/controller/TaskController.java
  54. 75 0
      mec-web/src/main/java/com/ym/mec/web/controller/TenantInfoController.java

+ 0 - 28
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudRoomFlowConfigDao.java

@@ -1,28 +0,0 @@
-package com.ym.mec.biz.dal.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.ym.mec.biz.dal.entity.CloudRoomFlowConfig;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-public interface CloudRoomFlowConfigDao extends BaseMapper<CloudRoomFlowConfig> {
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(CloudRoomFlowConfig record);
-
-    int insertSelective(CloudRoomFlowConfig record);
-
-    CloudRoomFlowConfig selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(CloudRoomFlowConfig record);
-
-    int updateByPrimaryKey(CloudRoomFlowConfig record);
-
-    <T> IPage<T> queryPage(Page<T> page, @Param("minuteUp") Integer minuteUp);
-
-    List<Integer> getGroupMinuteUp();
-}

+ 0 - 18
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudRoomFlowInfoDao.java

@@ -1,18 +0,0 @@
-package com.ym.mec.biz.dal.dao;
-
-
-import com.ym.mec.biz.dal.entity.CloudRoomFlowInfo;
-
-public interface CloudRoomFlowInfoDao {
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(CloudRoomFlowInfo record);
-
-    int insertSelective(CloudRoomFlowInfo record);
-
-    CloudRoomFlowInfo selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(CloudRoomFlowInfo record);
-
-    int updateByPrimaryKey(CloudRoomFlowInfo record);
-}

+ 0 - 18
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CloudRoomFlowRecordDao.java

@@ -1,18 +0,0 @@
-package com.ym.mec.biz.dal.dao;
-
-
-import com.ym.mec.biz.dal.entity.CloudRoomFlowRecord;
-
-public interface CloudRoomFlowRecordDao {
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(CloudRoomFlowRecord record);
-
-    int insertSelective(CloudRoomFlowRecord record);
-
-    CloudRoomFlowRecord selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(CloudRoomFlowRecord record);
-
-    int updateByPrimaryKey(CloudRoomFlowRecord record);
-}

+ 5 - 9
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantConfigDao.java

@@ -1,18 +1,14 @@
 package com.ym.mec.biz.dal.dao;
 
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.biz.dal.entity.TenantConfig;
+import org.apache.ibatis.annotations.Param;
 
-public interface TenantConfigDao {
-    int deleteByPrimaryKey(Integer id);
+import java.util.List;
 
-    int insert(TenantConfig record);
+public interface TenantConfigDao extends BaseMapper<TenantConfig> {
 
-    int insertSelective(TenantConfig record);
+    int insertBatch(@Param("entities") List<TenantConfig> entities);
 
-    TenantConfig selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(TenantConfig record);
-
-    int updateByPrimaryKey(TenantConfig record);
 }

+ 4 - 11
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TenantInfoDao.java

@@ -1,23 +1,16 @@
 package com.ym.mec.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ym.mec.biz.dal.entity.TenantInfo;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
 import java.util.Map;
 
 public interface TenantInfoDao extends BaseMapper<TenantInfo> {
 
-    int deleteByPrimaryKey(Integer id);
+    int opsTenantState(@Param("id") Integer id, @Param("state") Integer state);
 
-    int insert(TenantInfo record);
-
-    int insertSelective(TenantInfo record);
-
-    TenantInfo selectByPrimaryKey(Integer id);
-
-    int updateByKey(TenantInfo record);
-
-    List<TenantInfo> queryList(@Param("param") Map<String, Object> param);
+    <T> IPage<T> queryPage(Page<T> page, @Param("param") Map<String, Object> param);
 }

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

@@ -1,18 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.biz.dal.entity.TenantProductInfo;
 
-public interface TenantProductInfoDao {
-    int deleteByPrimaryKey(Integer id);
-
-    int insert(TenantProductInfo record);
-
-    int insertSelective(TenantProductInfo record);
-
-    TenantProductInfo selectByPrimaryKey(Integer id);
-
-    int updateByPrimaryKeySelective(TenantProductInfo record);
-
-    int updateByPrimaryKey(TenantProductInfo record);
+public interface TenantProductInfoDao extends BaseMapper<TenantProductInfo> {
 }

+ 0 - 74
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CloudRoomFlowDto.java

@@ -1,74 +0,0 @@
-package com.ym.mec.biz.dal.dto;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import javax.validation.constraints.*;
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-/**
- * @author hgw
- * Created by 2021-12-06
- */
-@ApiModel(value = "云教室流量包配置参数")
-public class CloudRoomFlowDto implements Serializable {
-
-    private Integer id;
-
-    /**
-     * 分钟上限
-     */
-    @Min(value = 1, message = "分钟上限不能小于等于0!")
-    @Max(value = 1000000, message = "分钟上限不能大于一百万分钟!")
-    @NotNull(message = "分钟上限不能为空!")
-    @ApiModelProperty(value = "分钟上限")
-    private Integer minuteUpLimit;
-
-    /**
-     * 单价
-     */
-    @NotNull(message = "单价不能为空!")
-    @DecimalMin(value = "0.01", message = "单价必需大于0元!")
-    @DecimalMax(value = "100000", message = "单价不能大于10万元!")
-    @ApiModelProperty(value = "单价")
-    private BigDecimal price;
-
-    /**
-     * 备注
-     */
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getMinuteUpLimit() {
-        return minuteUpLimit;
-    }
-
-    public void setMinuteUpLimit(Integer minuteUpLimit) {
-        this.minuteUpLimit = minuteUpLimit;
-    }
-
-    public BigDecimal getPrice() {
-        return price;
-    }
-
-    public void setPrice(BigDecimal price) {
-        this.price = price;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-}

+ 84 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantConfigDto.java

@@ -0,0 +1,84 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author hgw
+ * Created by 2021-12-07
+ */
+@ApiModel(value = "机构配置参数")
+public class TenantConfigDto implements Serializable {
+
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    @NotNull(message = "机构id不能为空!")
+    @ApiModelProperty(value = "机构id")
+    private Integer tenantId;
+
+    @NotNull(message = "手续费率不能为空!")
+    @ApiModelProperty(value = "手续费率")
+    private BigDecimal chargeRate;
+
+    @ApiModelProperty(value = "可用教材id,多个用逗号分割")
+    private String teachingMaterialId;
+
+    @ApiModelProperty(value = "机构动态配置,以json格式储存")
+    private String config;
+
+    @ApiModelProperty(value = "更新人")
+    private Integer updatedBy;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Integer tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public BigDecimal getChargeRate() {
+        return chargeRate;
+    }
+
+    public void setChargeRate(BigDecimal chargeRate) {
+        this.chargeRate = chargeRate;
+    }
+
+    public String getTeachingMaterialId() {
+        return teachingMaterialId;
+    }
+
+    public void setTeachingMaterialId(String teachingMaterialId) {
+        this.teachingMaterialId = teachingMaterialId;
+    }
+
+    public String getConfig() {
+        return config;
+    }
+
+    public void setConfig(String config) {
+        this.config = config;
+    }
+
+    public Integer getUpdatedBy() {
+        return updatedBy;
+    }
+
+    public void setUpdatedBy(Integer updatedBy) {
+        this.updatedBy = updatedBy;
+    }
+}

+ 54 - 26
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantInfoDto.java

@@ -3,10 +3,7 @@ package com.ym.mec.biz.dal.dto;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
-import javax.validation.constraints.Email;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import javax.validation.constraints.*;
 import java.io.Serializable;
 
 /**
@@ -36,7 +33,7 @@ public class TenantInfoDto implements Serializable {
      * 机构联系人
      */
     @NotBlank(message = "机构联系人不能为空")
-    @Size(max = 14, message = "机构联系人长度不能超过14!")
+    @Size(max = 14, message = "机构联系人名称不能超过14个字!")
     @ApiModelProperty(value = "机构联系人")
     private String contacts;
 
@@ -44,8 +41,8 @@ public class TenantInfoDto implements Serializable {
      * 机构联系人电话
      */
     @NotBlank(message = "机构联系人电话不能为空!")
-    @Size(max = 13, message = "联系人电话手机号最高11位,座机号最高为13位,请核实后在填写!")
-    @Pattern(regexp = "^[0-9|-]*$", message = "联系人电话只能填写数字")
+    @Size(max = 12, message = "联系人电话手机号最高11位,座机号最高为12位,请核实后在填写!")
+    @Pattern(regexp = "^[0-9]*$", message = "联系人电话只能填写数字,手机号最高11位,座机号最高为12位,请核实后在填写!")
     @ApiModelProperty(value = "机构联系人电话")
     private String phone;
 
@@ -53,7 +50,7 @@ public class TenantInfoDto implements Serializable {
      * 地址
      */
     @NotBlank(message = "地址不能为空!")
-    @Size(max = 200, message = "地址长度不能超过200个字!")
+    @Size(max = 200, message = "地址不能超过200个字!")
     @ApiModelProperty(value = "地址")
     private String address;
 
@@ -75,24 +72,31 @@ public class TenantInfoDto implements Serializable {
     /**
      * 客服电话
      */
-    @NotBlank(message = "客服电话不能为空!")
     @Size(max = 13, message = "客服电话电话-手机号最高11位、座机号最高为13位,请核实后再填写!")
-    @Pattern(regexp = "^[0-9]*$", message = "客服电话电话只能填写数字!")
+    @Pattern(regexp = "^[0-9]*$", message = "客服电话只能填写数字!")
     @ApiModelProperty(value = "客服电话")
     private String customerServicePhone;
 
     /**
-     * 域名
+     * 机构描述
      */
-    @ApiModelProperty(value = "域名")
-    private String domainName;
+    @Size(max = 200, message = "机构描述不能超过200个字!")
+    @ApiModelProperty(value = "机构描述")
+    private String remark;
 
-    /**
-     * 数据源
-     */
-    @ApiModelProperty(value = "数据源")
-    private String dataSource;
+    @ApiModelProperty(value = "缴费状态 0未缴费  1已缴费")
+    private Integer payState;
+
+    @ApiModelProperty(value = "状态0 草稿 1启动 2停用")
+    private Integer state;
+
+    @NotNull(message = "请选择机构的产品信息!")
+    @ApiModelProperty(value = "机构关联的产品信息")
+    private TenantProductInfoDto productInfo;
 
+    @NotNull(message = "请填写机构配置参数信息!")
+    @ApiModelProperty(value = "机构配置参数")
+    private TenantConfigDto config;
 
     public Integer getId() {
         return id;
@@ -158,19 +162,43 @@ public class TenantInfoDto implements Serializable {
         this.customerServicePhone = customerServicePhone;
     }
 
-    public String getDomainName() {
-        return domainName;
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Integer getPayState() {
+        return payState;
+    }
+
+    public void setPayState(Integer payState) {
+        this.payState = payState;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public TenantProductInfoDto getProductInfo() {
+        return productInfo;
     }
 
-    public void setDomainName(String domainName) {
-        this.domainName = domainName;
+    public void setProductInfo(TenantProductInfoDto productInfo) {
+        this.productInfo = productInfo;
     }
 
-    public String getDataSource() {
-        return dataSource;
+    public TenantConfigDto getConfig() {
+        return config;
     }
 
-    public void setDataSource(String dataSource) {
-        this.dataSource = dataSource;
+    public void setConfig(TenantConfigDto config) {
+        this.config = config;
     }
 }

+ 148 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/TenantProductInfoDto.java

@@ -0,0 +1,148 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author hgw
+ * Created by 2021-12-06
+ */
+@ApiModel(value = "机构产品参数")
+public class TenantProductInfoDto {
+
+    @ApiModelProperty(value = "id")
+    private Integer id;
+
+    /**
+     * 机构id
+     */
+    @ApiModelProperty(value="机构id")
+    private Integer tenantId;
+
+    /**
+     * 选择的服务的id
+     */
+    @NotNull(message = "请选择一个服务!")
+    @ApiModelProperty(value="选择的服务的id")
+    private Integer serveId;
+
+    /**
+     * 服务的付费类型id
+     */
+    @NotNull(message = "请选择付费类型!")
+    @ApiModelProperty(value="服务的付费类型id")
+    private Integer serveDetailId;
+
+    /**
+     * 原价单价
+     */
+    @ApiModelProperty(value="原价单价")
+    private BigDecimal originalPrice;
+
+    /**
+     * 合同价单价
+     */
+    @DecimalMin(value = "0.01", message = "合同价单价必需大于0元!")
+    @DecimalMax(value = "1000000", message = "合同价单价不能大于100万元!")
+    @ApiModelProperty(value="合同价单价")
+    private BigDecimal contractPrice;
+
+    /**
+     * 本次开通价格/本次实际应付金额
+     */
+    @DecimalMin(value = "0.01", message = "开通价必需大于0元!")
+    @DecimalMax(value = "1000000", message = "开通价不能大于100万元!")
+    @ApiModelProperty(value="本次开通价格/本次实际应付金额")
+    private BigDecimal payAmount;
+
+    /**
+     * 有效期(数字-结合有效期单位)
+     */
+    @NotNull(message = "请填写有效期!")
+    @Pattern(regexp = "^[0-9]*$", message = "有效期只能填写数字!")
+    @ApiModelProperty(value="有效期(数字-结合有效期单位)")
+    private Integer expiryCount;
+
+    /**
+     * 有效期单位(年/月)
+     */
+    @NotBlank(message = "有效期单位不能为空!")
+    @ApiModelProperty(value="有效期单位(年/月)")
+    private String expiryUnit;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTenantId() {
+        return tenantId;
+    }
+
+    public void setTenantId(Integer tenantId) {
+        this.tenantId = tenantId;
+    }
+
+    public Integer getServeId() {
+        return serveId;
+    }
+
+    public void setServeId(Integer serveId) {
+        this.serveId = serveId;
+    }
+
+    public Integer getServeDetailId() {
+        return serveDetailId;
+    }
+
+    public void setServeDetailId(Integer serveDetailId) {
+        this.serveDetailId = serveDetailId;
+    }
+
+    public BigDecimal getOriginalPrice() {
+        return originalPrice;
+    }
+
+    public void setOriginalPrice(BigDecimal originalPrice) {
+        this.originalPrice = originalPrice;
+    }
+
+    public BigDecimal getContractPrice() {
+        return contractPrice;
+    }
+
+    public void setContractPrice(BigDecimal contractPrice) {
+        this.contractPrice = contractPrice;
+    }
+
+    public BigDecimal getPayAmount() {
+        return payAmount;
+    }
+
+    public void setPayAmount(BigDecimal payAmount) {
+        this.payAmount = payAmount;
+    }
+
+    public Integer getExpiryCount() {
+        return expiryCount;
+    }
+
+    public void setExpiryCount(Integer expiryCount) {
+        this.expiryCount = expiryCount;
+    }
+
+    public String getExpiryUnit() {
+        return expiryUnit;
+    }
+
+    public void setExpiryUnit(String expiryUnit) {
+        this.expiryUnit = expiryUnit;
+    }
+}

+ 0 - 147
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudRoomFlowConfig.java

@@ -1,147 +0,0 @@
-package com.ym.mec.biz.dal.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * cloud_room_flow_config
- *
- * @author
- */
-@ApiModel(value = "云教室流量包配置表")
-public class CloudRoomFlowConfig implements Serializable {
-    /**
-     * 主键
-     */
-    @ApiModelProperty(value = "主键")
-    @TableId(value = "id_", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 分钟上限
-     */
-    @ApiModelProperty(value = "分钟上限")
-    private Integer minuteUpLimit;
-
-    /**
-     * 单价
-     */
-    @ApiModelProperty(value = "单价")
-    private BigDecimal price;
-
-    /**
-     * 备注
-     */
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    /**
-     * 是否删除0未删除 1删除
-     */
-    @ApiModelProperty(value = "是否删除0未删除 1删除")
-    private Integer deleted;
-
-    /**
-     * 创建人
-     */
-    @ApiModelProperty(value = "创建人")
-    private Integer createdBy;
-
-    /**
-     * 创建时间
-     */
-    @ApiModelProperty(value = "创建时间")
-    private Date createdTime;
-
-    /**
-     * 更新人
-     */
-    @ApiModelProperty(value = "更新人")
-    private Integer updatedBy;
-
-    /**
-     * 更新时间
-     */
-    @ApiModelProperty(value = "更新时间")
-    private Date updatedTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getMinuteUpLimit() {
-        return minuteUpLimit;
-    }
-
-    public void setMinuteUpLimit(Integer minuteUpLimit) {
-        this.minuteUpLimit = minuteUpLimit;
-    }
-
-    public BigDecimal getPrice() {
-        return price;
-    }
-
-    public void setPrice(BigDecimal price) {
-        this.price = price;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public Integer getDeleted() {
-        return deleted;
-    }
-
-    public void setDeleted(Integer deleted) {
-        this.deleted = deleted;
-    }
-
-    public Integer getCreatedBy() {
-        return createdBy;
-    }
-
-    public void setCreatedBy(Integer createdBy) {
-        this.createdBy = createdBy;
-    }
-
-    public Date getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Date createdTime) {
-        this.createdTime = createdTime;
-    }
-
-    public Integer getUpdatedBy() {
-        return updatedBy;
-    }
-
-    public void setUpdatedBy(Integer updatedBy) {
-        this.updatedBy = updatedBy;
-    }
-
-    public Date getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Date updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-}

+ 0 - 104
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudRoomFlowInfo.java

@@ -1,104 +0,0 @@
-package com.ym.mec.biz.dal.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * cloud_room_flow_info
- *
- * @author
- */
-@ApiModel(value = "云教室流量包明细表")
-public class CloudRoomFlowInfo implements Serializable {
-    /**
-     * 主键
-     */
-    @ApiModelProperty(value = "主键")
-    @TableId(value = "id_", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 机构id
-     */
-    @ApiModelProperty(value = "机构id")
-    private Integer tenantId;
-
-    /**
-     * 总分钟数
-     */
-    @ApiModelProperty(value = "总分钟数")
-    private Integer totalMinute;
-
-    /**
-     * 已用分钟数
-     */
-    @ApiModelProperty(value = "已用分钟数")
-    private Integer useMinute;
-
-    /**
-     * 更新人
-     */
-    @ApiModelProperty(value = "更新人")
-    private Integer updatedBy;
-
-    /**
-     * 更新时间
-     */
-    @ApiModelProperty(value = "更新时间")
-    private Date updatedTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getTenantId() {
-        return tenantId;
-    }
-
-    public void setTenantId(Integer tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public Integer getTotalMinute() {
-        return totalMinute;
-    }
-
-    public void setTotalMinute(Integer totalMinute) {
-        this.totalMinute = totalMinute;
-    }
-
-    public Integer getUseMinute() {
-        return useMinute;
-    }
-
-    public void setUseMinute(Integer useMinute) {
-        this.useMinute = useMinute;
-    }
-
-    public Integer getUpdatedBy() {
-        return updatedBy;
-    }
-
-    public void setUpdatedBy(Integer updatedBy) {
-        this.updatedBy = updatedBy;
-    }
-
-    public Date getUpdatedTime() {
-        return updatedTime;
-    }
-
-    public void setUpdatedTime(Date updatedTime) {
-        this.updatedTime = updatedTime;
-    }
-}

+ 0 - 131
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CloudRoomFlowRecord.java

@@ -1,131 +0,0 @@
-package com.ym.mec.biz.dal.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.io.Serializable;
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * cloud_room_flow_record
- * @author 
- */
-@ApiModel(value="机构的云教室流量包购买记录表")
-public class CloudRoomFlowRecord implements Serializable {
-    /**
-     * 主键
-     */
-    @ApiModelProperty(value="主键")
-    @TableId(value = "id_", type = IdType.AUTO)
-    private Integer id;
-
-    /**
-     * 机构产品设置表id
-     */
-    @ApiModelProperty(value="机构产品设置表id")
-    private Integer tenantId;
-
-    /**
-     * 云教室配置对应的id
-     */
-    @ApiModelProperty(value="云教室配置对应的id")
-    private Integer cloudRoomConfigId;
-
-    /**
-     * 购买的分钟
-     */
-    @ApiModelProperty(value="购买的分钟")
-    private Integer minute;
-
-    /**
-     * 合同价
-     */
-    @ApiModelProperty(value="合同价")
-    private BigDecimal contractPrice;
-
-    /**
-     * 单价
-     */
-    @ApiModelProperty(value="单价")
-    private BigDecimal price;
-
-    /**
-     * 创建人
-     */
-    @ApiModelProperty(value="创建人")
-    private Integer createdBy;
-
-    /**
-     * 创建时间
-     */
-    @ApiModelProperty(value="创建时间")
-    private Date createdTime;
-
-    private static final long serialVersionUID = 1L;
-
-    public Integer getId() {
-        return id;
-    }
-
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    public Integer getTenantId() {
-        return tenantId;
-    }
-
-    public void setTenantId(Integer tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    public Integer getCloudRoomConfigId() {
-        return cloudRoomConfigId;
-    }
-
-    public void setCloudRoomConfigId(Integer cloudRoomConfigId) {
-        this.cloudRoomConfigId = cloudRoomConfigId;
-    }
-
-    public Integer getMinute() {
-        return minute;
-    }
-
-    public void setMinute(Integer minute) {
-        this.minute = minute;
-    }
-
-    public BigDecimal getContractPrice() {
-        return contractPrice;
-    }
-
-    public void setContractPrice(BigDecimal contractPrice) {
-        this.contractPrice = contractPrice;
-    }
-
-    public BigDecimal getPrice() {
-        return price;
-    }
-
-    public void setPrice(BigDecimal price) {
-        this.price = price;
-    }
-
-    public Integer getCreatedBy() {
-        return createdBy;
-    }
-
-    public void setCreatedBy(Integer createdBy) {
-        this.createdBy = createdBy;
-    }
-
-    public Date getCreatedTime() {
-        return createdTime;
-    }
-
-    public void setCreatedTime(Date createdTime) {
-        this.createdTime = createdTime;
-    }
-}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Student.java

@@ -21,6 +21,8 @@ public class Student extends SysUser {
 	/**  */
 	private Integer userId;
 	
+	private String schoolName;
+	
 	/**  */
 	private String subjectIdList;
 
@@ -154,6 +156,14 @@ public class Student extends SysUser {
 		return this.userId;
 	}
 			
+	public String getSchoolName() {
+		return schoolName;
+	}
+
+	public void setSchoolName(String schoolName) {
+		this.schoolName = schoolName;
+	}
+
 	public void setSubjectIdList(String subjectIdList){
 		this.subjectIdList = subjectIdList;
 	}

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentPreRegistration.java

@@ -14,6 +14,8 @@ public class StudentPreRegistration {
 	
 	private String musicGroupId;
 	
+	private String school;
+	
 	/** 用户编号 */
 	private Integer userId;
 	
@@ -83,6 +85,14 @@ public class StudentPreRegistration {
 		this.musicGroupId = musicGroupId;
 	}
 
+	public String getSchool() {
+		return school;
+	}
+
+	public void setSchool(String school) {
+		this.school = school;
+	}
+
 	public void setUserId(Integer userId){
 		this.userId = userId;
 	}

+ 29 - 79
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantConfig.java

@@ -1,75 +1,49 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
 /**
- * tenant_config
- * @author 
+ * 机构配置表(TenantConfig)表实体类
+ *
+ * @author hgw
+ * @since 2021-12-09 13:37:18
  */
-@ApiModel(value="机构配置表")
+@ApiModel(value = "机构配置表")
 public class TenantConfig implements Serializable {
-    /**
-     * 主键
-     */
-    @ApiModelProperty(value="主键")
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
     private Integer id;
 
-    /**
-     * 机构id
-     */
-    @ApiModelProperty(value="机构id")
+    @TableField("tenant_id_")
+    @ApiModelProperty(value = "机构id")
     private Integer tenantId;
 
-    /**
-     * 手续费率
-     */
-    @ApiModelProperty(value="手续费率")
+    @TableField("charge_rate_")
+    @ApiModelProperty(value = "手续费率")
     private BigDecimal chargeRate;
 
-    /**
-     * 可用教材id,多个用逗号分割
-     */
-    @ApiModelProperty(value="可用教材id,多个用逗号分割")
+    @TableField("teaching_material_id_")
+    @ApiModelProperty(value = "可用教材id,多个用逗号分割")
     private String teachingMaterialId;
 
-    /**
-     * 每月分润/元
-     */
-    @ApiModelProperty(value="每月分润/元")
-    private BigDecimal monthDivide;
-
-    /**
-     * 每季度分润/元
-     */
-    @ApiModelProperty(value="每季度分润/元")
-    private BigDecimal quarterDivide;
-
-    /**
-     * 每半年分润/元
-     */
-    @ApiModelProperty(value="每半年分润/元")
-    private BigDecimal halfYearDivide;
-
-    /**
-     * 每年分润/元
-     */
-    @ApiModelProperty(value="每年分润/元")
-    private BigDecimal yearDivide;
-
-    /**
-     * 更新人
-     */
-    @ApiModelProperty(value="更新人")
+    @TableField("config_")
+    @ApiModelProperty(value = "机构动态配置,以json格式储存")
+    private String config;
+
+    @TableField("updated_by_")
+    @ApiModelProperty(value = "更新人")
     private Integer updatedBy;
 
-    /**
-     * 更新时间
-     */
-    @ApiModelProperty(value="更新时间")
+    @TableField("updated_time_")
+    @ApiModelProperty(value = "更新时间")
     private Date updatedTime;
 
     private static final long serialVersionUID = 1L;
@@ -106,36 +80,12 @@ public class TenantConfig implements Serializable {
         this.teachingMaterialId = teachingMaterialId;
     }
 
-    public BigDecimal getMonthDivide() {
-        return monthDivide;
-    }
-
-    public void setMonthDivide(BigDecimal monthDivide) {
-        this.monthDivide = monthDivide;
-    }
-
-    public BigDecimal getQuarterDivide() {
-        return quarterDivide;
-    }
-
-    public void setQuarterDivide(BigDecimal quarterDivide) {
-        this.quarterDivide = quarterDivide;
-    }
-
-    public BigDecimal getHalfYearDivide() {
-        return halfYearDivide;
-    }
-
-    public void setHalfYearDivide(BigDecimal halfYearDivide) {
-        this.halfYearDivide = halfYearDivide;
-    }
-
-    public BigDecimal getYearDivide() {
-        return yearDivide;
+    public String getConfig() {
+        return config;
     }
 
-    public void setYearDivide(BigDecimal yearDivide) {
-        this.yearDivide = yearDivide;
+    public void setConfig(String config) {
+        this.config = config;
     }
 
     public Integer getUpdatedBy() {

+ 48 - 65
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantInfo.java

@@ -1,5 +1,8 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -11,102 +14,74 @@ import java.util.Date;
  * 机构信息表
  * 对应数据库表(tenant_info):
  */
-@ApiModel(value="TenantInfo机构表")
+@ApiModel(value = "TenantInfo机构表")
 public class TenantInfo implements Serializable {
-    /**
-     * 机构id
-     */
-    @ApiModelProperty(value="机构id")
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "机构id")
     private Integer id;
 
-    /**
-     * 机构名称
-     */
-    @ApiModelProperty(value="机构名称")
+    @TableField("name_")
+    @ApiModelProperty(value = "机构名称")
     private String name;
 
-    /**
-     * 机构联系人
-     */
-    @ApiModelProperty(value="机构联系人")
+    @TableField("contacts_")
+    @ApiModelProperty(value = "机构联系人")
     private String contacts;
 
-    /**
-     * 机构联系人电话
-     */
-    @ApiModelProperty(value="机构联系人电话")
+    @TableField("phone_")
+    @ApiModelProperty(value = "机构联系人电话")
     private String phone;
 
-    /**
-     * 地址
-     */
-    @ApiModelProperty(value="地址")
+    @TableField("address_")
+    @ApiModelProperty(value = "地址")
     private String address;
 
-    /**
-     * 机构邮箱
-     */
-    @ApiModelProperty(value="机构邮箱")
+    @TableField("email_")
+    @ApiModelProperty(value = "机构邮箱")
     private String email;
 
-    /**
-     * 机构logo
-     */
-    @ApiModelProperty(value="机构logo")
+    @TableField("logo_")
+    @ApiModelProperty(value = "机构logo")
     private String logo;
 
-    /**
-     * 客服电话
-     */
-    @ApiModelProperty(value="客服电话")
+    @TableField("customer_service_phone")
+    @ApiModelProperty(value = "客服电话")
     private String customerServicePhone;
 
-    /**
-     * 域名
-     */
-    @ApiModelProperty(value="域名")
+    @TableField("remark_")
+    @ApiModelProperty(value = "机构描述")
+    private String remark;
+
+    @TableField("domain_name_")
+    @ApiModelProperty(value = "域名")
     private String domainName;
 
-    /**
-     * 数据源
-     */
-    @ApiModelProperty(value="数据源")
+    @TableField("data_source_")
+    @ApiModelProperty(value = "数据源")
     private String dataSource;
 
-    /**
-     * 缴费状态 0未缴费  1已缴费
-     */
-    @ApiModelProperty(value="缴费状态 0未缴费  1已缴费")
+    @TableField("pay_state_")
+    @ApiModelProperty(value = "缴费状态 0未缴费  1已缴费")
     private Integer payState;
 
-    /**
-     * 状态0 草稿 1启动 2停用
-     */
-    @ApiModelProperty(value="状态0 草稿 1启动 2停用")
+    @TableField("state_")
+    @ApiModelProperty(value = "状态0 草稿 1启动 2停用")
     private Integer state;
 
-    /**
-     * 创建人
-     */
-    @ApiModelProperty(value="创建人")
+    @TableField("created_by_")
+    @ApiModelProperty(value = "创建人")
     private Integer createdBy;
 
-    /**
-     * 创建时间
-     */
-    @ApiModelProperty(value="创建时间")
+    @TableField("created_time_")
+    @ApiModelProperty(value = "创建时间")
     private Date createdTime;
 
-    /**
-     * 更新人
-     */
-    @ApiModelProperty(value="更新人")
+    @TableField("updated_by_")
+    @ApiModelProperty(value = "更新人")
     private Integer updatedBy;
 
-    /**
-     * 更新时间
-     */
-    @ApiModelProperty(value="更新时间")
+    @TableField("updated_time_")
+    @ApiModelProperty(value = "更新时间")
     private Date updatedTime;
 
     private static final long serialVersionUID = 1L;
@@ -175,6 +150,14 @@ public class TenantInfo implements Serializable {
         this.customerServicePhone = customerServicePhone;
     }
 
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
     public String getDomainName() {
         return domainName;
     }

+ 59 - 47
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/TenantProductInfo.java

@@ -1,70 +1,66 @@
 package com.ym.mec.biz.dal.entity;
 
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
 /**
- * tenant_product_info
- * @author 
+ * 机构产品设置表(TenantProductInfo)表实体类
+ *
+ * @author hgw
+ * @since 2021-12-08 11:47:30
  */
-@ApiModel(value="机构产品设置表")
+@ApiModel(value = "机构产品设置表")
 public class TenantProductInfo implements Serializable {
-    /**
-     * 主键
-     */
-    @ApiModelProperty(value="主键")
+    @TableId(value = "id_", type = IdType.AUTO)
+    @ApiModelProperty(value = "主键")
     private Integer id;
 
-    /**
-     * 机构id
-     */
-    @ApiModelProperty(value="机构id")
+    @TableField("tenant_id_")
+    @ApiModelProperty(value = "机构id")
     private Integer tenantId;
 
-    /**
-     * 选择的服务的id
-     */
-    @ApiModelProperty(value="选择的服务的id")
+    @TableField("serve_id_")
+    @ApiModelProperty(value = "选择的服务的id")
     private Integer serveId;
 
-    /**
-     * 服务的付费类型id
-     */
-    @ApiModelProperty(value="服务的付费类型id")
+    @TableField("serve_detail_id_")
+    @ApiModelProperty(value = "服务的付费类型id")
     private Integer serveDetailId;
 
-    /**
-     * 原价
-     */
-    @ApiModelProperty(value="原价")
-    private String originalPrice;
+    @TableField("original_price_")
+    @ApiModelProperty(value = "原价单价")
+    private BigDecimal originalPrice;
 
-    /**
-     * 合同价
-     */
-    @ApiModelProperty(value="合同价")
+    @TableField("contract_price_")
+    @ApiModelProperty(value = "合同价单价")
     private BigDecimal contractPrice;
 
-    /**
-     * 有效期(数字-结合有效期单位)
-     */
-    @ApiModelProperty(value="有效期(数字-结合有效期单位)")
+    @TableField("pay_amount_")
+    @ApiModelProperty(value = "本次开通价格/本次实际应付金额")
+    private BigDecimal payAmount;
+
+    @TableField("pay_date_")
+    @ApiModelProperty(value = "付费/开通 时间")
+    private Date payDate;
+
+    @TableField("expiry_count_")
+    @ApiModelProperty(value = "有效期(数字-结合有效期单位)")
     private Integer expiryCount;
 
-    /**
-     * 有效期单位(年/月)
-     */
-    @ApiModelProperty(value="有效期单位(年/月)")
+    @TableField("expiry_unit_")
+    @ApiModelProperty(value = "有效期单位(年/月)")
     private String expiryUnit;
 
-    /**
-     * 有效期(具体到期时间)
-     */
-    @ApiModelProperty(value="有效期(具体到期时间)")
-    private Date expiryData;
+    @TableField("expiry_date_")
+    @ApiModelProperty(value = "有效期(具体到期时间)")
+    private Date expiryDate;
 
     private static final long serialVersionUID = 1L;
 
@@ -100,11 +96,11 @@ public class TenantProductInfo implements Serializable {
         this.serveDetailId = serveDetailId;
     }
 
-    public String getOriginalPrice() {
+    public BigDecimal getOriginalPrice() {
         return originalPrice;
     }
 
-    public void setOriginalPrice(String originalPrice) {
+    public void setOriginalPrice(BigDecimal originalPrice) {
         this.originalPrice = originalPrice;
     }
 
@@ -116,6 +112,22 @@ public class TenantProductInfo implements Serializable {
         this.contractPrice = contractPrice;
     }
 
+    public BigDecimal getPayAmount() {
+        return payAmount;
+    }
+
+    public void setPayAmount(BigDecimal payAmount) {
+        this.payAmount = payAmount;
+    }
+
+    public Date getPayDate() {
+        return payDate;
+    }
+
+    public void setPayDate(Date payDate) {
+        this.payDate = payDate;
+    }
+
     public Integer getExpiryCount() {
         return expiryCount;
     }
@@ -132,12 +144,12 @@ public class TenantProductInfo implements Serializable {
         this.expiryUnit = expiryUnit;
     }
 
-    public Date getExpiryData() {
-        return expiryData;
+    public Date getExpiryDate() {
+        return expiryDate;
     }
 
-    public void setExpiryData(Date expiryData) {
-        this.expiryData = expiryData;
+    public void setExpiryDate(Date expiryDate) {
+        this.expiryDate = expiryDate;
     }
 
 }

+ 12 - 6
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/PlatformServeModeVo.java

@@ -29,18 +29,24 @@ public class PlatformServeModeVo implements Serializable {
      * 各个付费模式的详情
      */
     static class PlatformServeModeDetailVo implements Serializable {
-        /**
-         * 学员上限
-         */
+
+        @ApiModelProperty(value = "付费模式的详情的id")
+        private Integer id;
+
         @ApiModelProperty(value = "学员上限")
         private Integer studentUpLimit;
 
-        /**
-         * 服务原价
-         */
         @ApiModelProperty(value = "服务原价")
         private BigDecimal originalPrice;
 
+        public Integer getId() {
+            return id;
+        }
+
+        public void setId(Integer id) {
+            this.id = id;
+        }
+
         public Integer getStudentUpLimit() {
             return studentUpLimit;
         }

+ 128 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/TenantInfoInfoPageVo.java

@@ -0,0 +1,128 @@
+package com.ym.mec.biz.dal.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author hgw
+ * Created by 2021-12-09
+ */
+@ApiModel(value = "分页查询机构信息")
+public class TenantInfoInfoPageVo implements Serializable {
+    //机构基础信息
+    @ApiModelProperty(value = "机构id")
+    private Integer id;
+
+    @ApiModelProperty(value = "机构名称")
+    private String name;
+
+    @ApiModelProperty(value = "机构联系人")
+    private String contacts;
+
+    @ApiModelProperty(value = "机构联系人电话")
+    private String phone;
+
+    @ApiModelProperty(value = "缴费状态 0未缴费  1已缴费")
+    private Integer payState;
+
+    @ApiModelProperty(value = "状态0 草稿 1启动 2停用")
+    private Integer state;
+
+    @ApiModelProperty(value = "创建人名称")
+    private String createdName;
+
+    //机构产品信息
+    @ApiModelProperty(value = "服务名称")
+    private String serveName;
+
+    @ApiModelProperty(value = "学员上限")
+    private Integer studentUpLimit;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "到期时间")
+    private Date expireDate;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getContacts() {
+        return contacts;
+    }
+
+    public void setContacts(String contacts) {
+        this.contacts = contacts;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public Integer getPayState() {
+        return payState;
+    }
+
+    public void setPayState(Integer payState) {
+        this.payState = payState;
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public String getServeName() {
+        return serveName;
+    }
+
+    public void setServeName(String serveName) {
+        this.serveName = serveName;
+    }
+
+    public Integer getStudentUpLimit() {
+        return studentUpLimit;
+    }
+
+    public void setStudentUpLimit(Integer studentUpLimit) {
+        this.studentUpLimit = studentUpLimit;
+    }
+
+    public Date getExpireDate() {
+        return expireDate;
+    }
+
+    public void setExpireDate(Date expireDate) {
+        this.expireDate = expireDate;
+    }
+
+    public String getCreatedName() {
+        return createdName;
+    }
+
+    public void setCreatedName(String createdName) {
+        this.createdName = createdName;
+    }
+}

+ 5 - 8
mec-biz/src/main/java/com/ym/mec/biz/event/listener/TenantConfigListener.java

@@ -1,16 +1,15 @@
 package com.ym.mec.biz.event.listener;
 
-import com.ym.mec.biz.dal.dao.TenantInfoDao;
+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.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 @Component
@@ -19,21 +18,19 @@ public class TenantConfigListener implements ApplicationListener<TenantConfigCha
     @Autowired
     private SysTenantConfigService sysTenantConfigService;
     @Autowired
-    private TenantInfoDao tenantInfoDao;
+    private TenantInfoService tenantInfoService;
 
     @Override
     public void onApplicationEvent(TenantConfigChangeEvent event) {
         if(event.getTenantId() != null){
-            TenantInfo tenantInfo = tenantInfoDao.selectByPrimaryKey(event.getTenantId());
+            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 {
-            Map<String,Object> paramMap = new HashMap<>(1);
-            paramMap.put("state",1);
-            List<TenantInfo> tenantInfos = tenantInfoDao.queryList(paramMap);
+            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) {

+ 0 - 19
mec-biz/src/main/java/com/ym/mec/biz/service/CloudRoomFlowConfigService.java

@@ -1,19 +0,0 @@
-package com.ym.mec.biz.service;
-
-import com.ym.mec.biz.dal.dto.CloudRoomFlowDto;
-import com.ym.mec.biz.dal.entity.CloudRoomFlowConfig;
-import com.ym.mec.common.page.PageInfo;
-
-import java.util.List;
-
-public interface CloudRoomFlowConfigService {
-    void addConfig(CloudRoomFlowDto obj);
-
-    void updateConfig(CloudRoomFlowDto obj);
-
-    void deleteConfig(Integer id);
-
-    PageInfo<CloudRoomFlowConfig> queryPage(Integer minuteUp, Integer page, Integer rows);
-
-    List<Integer> getGroupMinuteUp();
-}

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

@@ -1,4 +0,0 @@
-package com.ym.mec.biz.service;
-
-public interface CloudRoomFlowInfoService {
-}

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

@@ -1,4 +0,0 @@
-package com.ym.mec.biz.service;
-
-public interface CloudRoomFlowRecordService {
-}

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

@@ -83,6 +83,8 @@ public interface StudentService extends BaseService<Integer, Student> {
      * 更新学员会员信息
      */
     void updateMemberRank(CloudTeacherOrder cloudTeacherOrder, PeriodEnum periodEnum);
+    
+    void updateMemberRank(Integer userId, PeriodEnum periodEnum, int times, Integer memberRankSettingId);
 
     /**
      * 更新服务指标

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/TenantConfigService.java

@@ -1,4 +1,12 @@
 package com.ym.mec.biz.service;
 
-public interface TenantConfigService {
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.dto.TenantConfigDto;
+import com.ym.mec.biz.dal.entity.TenantConfig;
+
+public interface TenantConfigService extends IService<TenantConfig> {
+
+    void addConfig(TenantConfigDto dto);
+
+    void updateConfig(TenantConfigDto dto);
 }

+ 19 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/TenantInfoService.java

@@ -1,5 +1,23 @@
 package com.ym.mec.biz.service;
 
-public interface TenantInfoService {
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.dto.TenantInfoDto;
+import com.ym.mec.biz.dal.entity.TenantInfo;
+import com.ym.mec.biz.dal.vo.TenantInfoInfoPageVo;
+import com.ym.mec.common.page.PageInfo;
+
+import java.util.Map;
+
+public interface TenantInfoService extends IService<TenantInfo> {
+
+    void addTenantInfo(TenantInfoDto dto);
+
+    void updateTenantInfo(TenantInfoDto dto);
+
+    TenantInfoDto queryTenantInfo(Integer tenantId);
+
+    void opsTenantState(Integer id, Integer state);
+
+    PageInfo<TenantInfoInfoPageVo> queryPage(Map<String, Object> param);
 
 }

+ 9 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/TenantProductInfoService.java

@@ -1,4 +1,12 @@
 package com.ym.mec.biz.service;
 
-public interface TenantProductInfoService {
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.dto.TenantProductInfoDto;
+import com.ym.mec.biz.dal.entity.TenantProductInfo;
+
+public interface TenantProductInfoService extends IService<TenantProductInfo> {
+
+    void addTenantProduct(TenantProductInfoDto dto);
+
+    void updateTenantProduct(TenantProductInfoDto dto);
 }

+ 0 - 112
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudRoomFlowConfigServiceImpl.java

@@ -1,112 +0,0 @@
-package com.ym.mec.biz.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ym.mec.auth.api.client.SysUserFeignService;
-import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.CloudRoomFlowConfigDao;
-import com.ym.mec.biz.dal.dto.CloudRoomFlowDto;
-import com.ym.mec.biz.dal.entity.CloudRoomFlowConfig;
-import com.ym.mec.biz.dal.entity.PlatformProduct;
-import com.ym.mec.biz.service.CloudRoomFlowConfigService;
-import com.ym.mec.common.exception.BizException;
-import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.PageUtil;
-import io.swagger.models.auth.In;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Optional;
-
-/**
- * @author hgw
- * Created by 2021-12-02
- */
-@Service
-public class CloudRoomFlowConfigServiceImpl extends ServiceImpl<CloudRoomFlowConfigDao, CloudRoomFlowConfig>
-        implements CloudRoomFlowConfigService {
-
-    @Autowired
-    private SysUserFeignService sysUserFeignService;
-
-    /**
-     * 增加
-     */
-    @Override
-    public void addConfig(CloudRoomFlowDto obj) {
-        Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
-                .map(SysUser::getId)
-                .orElse(null);
-        CloudRoomFlowConfig config = new CloudRoomFlowConfig();
-        config.setMinuteUpLimit(obj.getMinuteUpLimit());
-        config.setPrice(obj.getPrice());
-        config.setRemark(obj.getRemark());
-        config.setDeleted(0);
-        config.setCreatedBy(userId);
-        config.setCreatedTime(new Date());
-        baseMapper.insert(config);
-    }
-
-    /**
-     * 修改
-     */
-    @Override
-    public void updateConfig(CloudRoomFlowDto obj) {
-        Optional.ofNullable(obj.getId()).orElseThrow(()->new BizException("id不能为空!"));
-        Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
-                .map(SysUser::getId)
-                .orElse(null);
-        CloudRoomFlowConfig config = new CloudRoomFlowConfig();
-        config.setId(obj.getId());
-        config.setMinuteUpLimit(obj.getMinuteUpLimit());
-        config.setPrice(obj.getPrice());
-        config.setRemark(obj.getRemark());
-        config.setUpdatedBy(userId);
-        config.setUpdatedTime(new Date());
-        baseMapper.updateByPrimaryKeySelective(config);
-    }
-
-    /**
-     * 删除
-     * @param id
-     */
-    @Override
-    public void deleteConfig(Integer id){
-        Optional.ofNullable(id).orElseThrow(()-> new BizException("Id不能为空"));
-        Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
-                .map(SysUser::getId)
-                .orElse(null);
-        CloudRoomFlowConfig config = new CloudRoomFlowConfig();
-        config.setId(id);
-        config.setDeleted(1);
-        config.setUpdatedBy(userId);
-        config.setUpdatedTime(new Date());
-        baseMapper.updateByPrimaryKeySelective(config);
-    }
-
-    /**
-     * 分页查询
-     *
-     * @param minuteUp 分钟上限
-     * @param page   页数
-     * @param rows   查询数
-     */
-    @Override
-    public PageInfo<CloudRoomFlowConfig> queryPage(Integer minuteUp, Integer page, Integer rows) {
-        Page<CloudRoomFlowConfig> pageInfo = PageUtil.getPage(page, rows);
-        pageInfo.setAsc("id_");
-        IPage<CloudRoomFlowConfig> productIPage = baseMapper.queryPage(pageInfo, minuteUp);
-        return PageUtil.pageInfo(productIPage);
-    }
-
-    /**
-     * 查询分钟上限分组
-     */
-    public List<Integer> getGroupMinuteUp() {
-        return baseMapper.getGroupMinuteUp();
-    }
-
-}

+ 0 - 21
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudRoomFlowInfoServiceImpl.java

@@ -1,21 +0,0 @@
-package com.ym.mec.biz.service.impl;
-
-import com.ym.mec.biz.dal.dao.CloudRoomFlowInfoDao;
-import com.ym.mec.biz.service.CloudRoomFlowInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @author hgw
- * Created by 2021-12-02
- */
-@Service
-public class CloudRoomFlowInfoServiceImpl implements CloudRoomFlowInfoService {
-
-    @Autowired
-    private CloudRoomFlowInfoDao cloudRoomFlowInfoDao;
-
-
-
-
-}

+ 0 - 19
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CloudRoomFlowRecordServiceImpl.java

@@ -1,19 +0,0 @@
-package com.ym.mec.biz.service.impl;
-
-import com.ym.mec.biz.dal.dao.CloudRoomFlowRecordDao;
-import com.ym.mec.biz.service.CloudRoomFlowRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-/**
- * @author hgw
- * Created by 2021-12-02
- */
-@Service
-public class CloudRoomFlowRecordServiceImpl implements CloudRoomFlowRecordService {
-
-    @Autowired
-    private CloudRoomFlowRecordDao cloudRoomFlowRecordDao;
-
-
-}

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

@@ -34,7 +34,7 @@ public class PlatformProductServiceImpl extends ServiceImpl<PlatformProductDao,
     public void addProduct(PlatformProductDto obj) {
         Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .map(SysUser::getId)
-                .orElse(null);
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
 
         PlatformProduct platformProduct = new PlatformProduct();
         platformProduct.setName(obj.getName());
@@ -54,7 +54,7 @@ public class PlatformProductServiceImpl extends ServiceImpl<PlatformProductDao,
         Optional.ofNullable(obj.getId()).orElseThrow(()-> new BizException("产品Id不能为空"));
         Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .map(SysUser::getId)
-                .orElse(null);
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
         PlatformProduct platformProduct = new PlatformProduct();
         platformProduct.setId(obj.getId());
         platformProduct.setName(obj.getName());
@@ -74,7 +74,7 @@ public class PlatformProductServiceImpl extends ServiceImpl<PlatformProductDao,
         Optional.ofNullable(id).orElseThrow(()-> new BizException("产品Id不能为空"));
         Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .map(SysUser::getId)
-                .orElse(null);
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
         PlatformProduct platformProduct = new PlatformProduct();
         platformProduct.setId(id);
         platformProduct.setDeleted(1);

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

@@ -83,7 +83,7 @@ public class PlatformServeServiceImpl extends ServiceImpl<PlatformServeDao, Plat
         Optional.ofNullable(id).orElseThrow(() -> new BizException("服务Id不能为空!"));
         Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .map(SysUser::getId)
-                .orElse(null);
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
         PlatformServe platformServe = new PlatformServe();
         platformServe.setId(id);
         platformServe.setDeleted(1);
@@ -133,7 +133,7 @@ public class PlatformServeServiceImpl extends ServiceImpl<PlatformServeDao, Plat
 
         Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
                 .map(SysUser::getId)
-                .orElse(null);
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
         PlatformServe platformServe = new PlatformServe();
         platformServe.setName(obj.getName());
         platformServe.setProductId(obj.getProductId());

+ 4 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentGoodsSellServiceImpl.java

@@ -2,19 +2,18 @@ package com.ym.mec.biz.service.impl;
 
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.GoodsSellDto;
 import com.ym.mec.biz.dal.dto.StudentGoodsSellDto;
 import com.ym.mec.biz.dal.dto.StudentPaymentOrderDto;
-import com.ym.mec.biz.dal.dto.SysCouponCodeDto;
 import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.page.GoodsSellQueryInfo;
 import com.ym.mec.biz.service.StudentGoodsSellService;
 import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.biz.service.TenantInfoService;
 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.impl.BaseServiceImpl;
 import com.ym.mec.util.collection.MapUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -35,7 +34,7 @@ public class StudentGoodsSellServiceImpl extends BaseServiceImpl<Integer, Studen
     @Autowired
     private SysTenantConfigDao sysTenantConfigDao;
     @Autowired
-    private TenantInfoDao tenantInfoDao;
+    private TenantInfoService tenantInfoService;
     @Autowired
     private GoodsDao goodsDao;
     @Autowired
@@ -85,9 +84,7 @@ public class StudentGoodsSellServiceImpl extends BaseServiceImpl<Integer, Studen
         //如果订单编号为空,那么自动确认
         StringBuffer sb = new StringBuffer();
         str = "AUTO_RECEIVE";
-        Map<String,Object> param = new HashMap<>(1);
-        param.put("state",1);
-        List<TenantInfo> tenantInfos = tenantInfoDao.queryList(param);
+        List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
         if(tenantInfos != null && tenantInfos.size() > 0){
             for (int i = 0; i < tenantInfos.size(); i++) {
                 TenantInfo tenantInfo = tenantInfos.get(i);

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

@@ -149,7 +149,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         		throw new BizException("您已注册,请直接下载APP!");
         	}
         	userId = user.getId();
-
+        	user.setOrganId(studentPreRegistration.getOrganId());
             user.setUpdateTime(date);
             teacherDao.updateUser(user);
         }else{
@@ -175,10 +175,15 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         student.setCreateTime(date);
         student.setUpdateTime(date);
         student.setIsNewUser(true);
+        student.setSchoolName(studentPreRegistration.getSchool());
         student.setCurrentGradeNum(studentPreRegistration.getCurrentGradeNum());
         student.setCurrentClass(studentPreRegistration.getCurrentClass());
         studentDao.insert(student);
         
+        if(user.getOrganId() == 59){
+        	updateMemberRank(userId, PeriodEnum.MONTH, 1, 1);
+        }
+        
         return true;
 	}
 
@@ -481,6 +486,44 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
+	public void updateMemberRank(Integer userId, PeriodEnum periodEnum, int times, Integer memberRankSettingId) {
+    	Student student = this.get(userId);
+        if (student == null) {
+            throw new BizException("学员信息不存在");
+        }
+        
+        Date nowDate = new Date();
+        
+        if(student.getMembershipStartTime() == null){
+            student.setMembershipStartTime(nowDate);
+        }
+        
+        if(student.getMembershipEndTime() != null && student.getMembershipEndTime().after(nowDate)){
+        	nowDate = student.getMembershipEndTime();
+        }
+        
+        switch (periodEnum) {
+		case DAY:
+            student.setMembershipEndTime(DateUtil.addDays(nowDate, times));
+			break;
+		case MONTH:
+		case QUARTERLY:
+		case YEAR_HALF:
+            student.setMembershipEndTime(DateUtil.addMonths(nowDate, times));
+			break;
+		case YEAR:
+            student.setMembershipEndTime(DateUtil.addYears(nowDate, times));
+			break;
+
+		default:
+			break;
+		}
+        student.setMemberRankSettingId(memberRankSettingId);
+        this.update(student);
+	}
+
+	@Override
     public void updateStudentServiceTag(Integer studentId,List<Integer> studentIds,Integer serviceTag) {
         studentDao.updateStudentServiceTag(studentId, studentIds, serviceTag);
     }

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

@@ -1,16 +1,58 @@
 package com.ym.mec.biz.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.TenantConfigDao;
+import com.ym.mec.biz.dal.dto.TenantConfigDto;
+import com.ym.mec.biz.dal.entity.TenantConfig;
 import com.ym.mec.biz.service.TenantConfigService;
+import com.ym.mec.common.exception.BizException;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.function.Consumer;
 
 /**
  * @author hgw
  * Created by 2021-12-02
  */
 @Service
-public class TenantConfigServiceImpl implements TenantConfigService {
+public class TenantConfigServiceImpl extends ServiceImpl<TenantConfigDao, TenantConfig> implements TenantConfigService {
+
     @Autowired
-    private TenantConfigDao tenantConfigDao;
+    private SysUserFeignService sysUserFeignService;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void addConfig(TenantConfigDto dto) {
+        setUserId(dto.getUpdatedBy(), dto::setUpdatedBy);
+        TenantConfig info = new TenantConfig();
+        info.setUpdatedTime(new Date());
+        BeanUtils.copyProperties(dto, info);
+        this.save(info);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateConfig(TenantConfigDto dto) {
+        setUserId(dto.getUpdatedBy(), dto::setUpdatedBy);
+        TenantConfig info = new TenantConfig();
+        BeanUtils.copyProperties(dto, info);
+        this.updateById(info);
+    }
+
+    private void setUserId(Integer id, Consumer<Integer> setOption) {
+        if (Objects.isNull(id)) {
+            Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
+                    .map(SysUser::getId)
+                    .orElseThrow(() -> new BizException("用户信息获取失败"));
+            setOption.accept(userId);
+        }
+    }
 }

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

@@ -1,20 +1,214 @@
 package com.ym.mec.biz.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.TenantInfoDao;
+import com.ym.mec.biz.dal.dto.TenantConfigDto;
 import com.ym.mec.biz.dal.dto.TenantInfoDto;
+import com.ym.mec.biz.dal.dto.TenantProductInfoDto;
+import com.ym.mec.biz.dal.entity.TenantConfig;
 import com.ym.mec.biz.dal.entity.TenantInfo;
+import com.ym.mec.biz.dal.entity.TenantProductInfo;
+import com.ym.mec.biz.dal.vo.TenantInfoInfoPageVo;
+import com.ym.mec.biz.service.TenantConfigService;
 import com.ym.mec.biz.service.TenantInfoService;
+import com.ym.mec.biz.service.TenantProductInfoService;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.common.page.PageUtil;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import java.util.function.Consumer;
 
 @Service
 public class TenantInfoServiceImpl extends ServiceImpl<TenantInfoDao, TenantInfo> implements TenantInfoService {
 
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private TenantProductInfoService tenantProductInfoService;
+    @Autowired
+    private TenantConfigService tenantConfigService;
+
     /**
      * 新增机构
      */
-    public void addTenantInfo(TenantInfoDto tenantInfoDto) {
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void addTenantInfo(TenantInfoDto dto) {
+        //校验手机号是否唯一
+        checkPhone(dto);
+
+        //添加机构基本信息
+        Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
+                .map(SysUser::getId)
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
+        TenantInfo tenantInfo = new TenantInfo();
+        BeanUtils.copyProperties(dto, tenantInfo);
+        tenantInfo.setPayState(0);
+        tenantInfo.setState(2);
+        tenantInfo.setCreatedBy(userId);
+        tenantInfo.setCreatedTime(new Date());
+        baseMapper.insert(tenantInfo);
+
+        //机构id
+        Integer tenantId = tenantInfo.getId();
+        //添加机构产品信息
+        setIdByApply(tenantId, dto.getProductInfo(), dto.getProductInfo()::setTenantId,
+                tenantProductInfoService::addTenantProduct);
+        //添加机构配置
+        setIdByApply(tenantId, dto.getConfig(), dto.getConfig()::setTenantId, tenantConfigService::addConfig);
+    }
+
+    /**
+     * 修改机构信息
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void updateTenantInfo(TenantInfoDto dto) {
+        //机构id
+        Integer tenantId = Optional.ofNullable(dto)
+                .map(TenantInfoDto::getId)
+                .orElseThrow(() -> new BizException("机构信息不能为空!"));
+
+        //查询机构信息
+        TenantInfo tenantInfo = this.getById(tenantId);
+        if (Objects.isNull(tenantInfo)) {
+            throw new BizException("未找到该机构信息!");
+        }
+
+        //机构状态 1已缴费,并且 机构注册的手机号与本次修改后的手机号不同,就证明本次修改了手机号 则需要修改机构的账号信息
+        if (1 == tenantInfo.getPayState() && !Objects.equals(tenantInfo.getPhone(), dto.getPhone())) {
+            //校验修改后的手机号是否是唯一
+            checkPhone(dto);
+            //修改机构用户手机号(登录账号)信息
+            SysUser tenantUser = sysUserFeignService.queryUserByMobile(tenantInfo.getPhone());
+            tenantUser.setPhone(dto.getPhone());
+            sysUserFeignService.updateSysUser(tenantUser);
+        }
+
+        //机构状态 0未缴费
+        if (0 == tenantInfo.getPayState()) {
+            //修改产品
+            setIdByApply(tenantId, dto.getProductInfo(), dto.getProductInfo()::setTenantId,
+                    tenantProductInfoService::updateTenantProduct);
+        }
+
+        //修改机构基础信息
+        Integer userId = Optional.ofNullable(sysUserFeignService.queryUserInfo())
+                .map(SysUser::getId)
+                .orElseThrow(() -> new BizException("用户信息获取失败"));
+        Date now = new Date();
+        BeanUtils.copyProperties(dto, tenantInfo);
+        tenantInfo.setUpdatedBy(userId);
+        tenantInfo.setUpdatedTime(now);
+        this.updateById(tenantInfo);
+
+        //修改机构配置
+        setIdByApply(tenantId, dto.getConfig(), dto.getConfig()::setTenantId, tenantConfigService::updateConfig);
+    }
+
+    /**
+     * 查询单个机构详情
+     *
+     * @param tenantId 机构id
+     */
+    @Override
+    public TenantInfoDto queryTenantInfo(Integer tenantId) {
+        //查询机构基础信息
+        TenantInfo tenantInfo = Optional.ofNullable(tenantId)
+                .map(baseMapper::selectById)
+                .orElseThrow(() -> new BizException("未查询到机构信息[" + "tenantId" + "]"));
+        TenantInfoDto tenantInfoDto = new TenantInfoDto();
+        BeanUtils.copyProperties(tenantInfo, tenantInfoDto);
+        //机构产品信息
+        TenantProductInfo productInfo = tenantProductInfoService.getOne(new QueryWrapper<TenantProductInfo>()
+                .eq("tenant_id_", tenantId));
+        setTenantInfo(productInfo, new TenantProductInfoDto(), tenantInfoDto::setProductInfo);
+        //机构配置信息
+        TenantConfig tenantConfig = tenantConfigService.getOne(new QueryWrapper<TenantConfig>()
+                .eq("tenant_id_", tenantId));
+        setTenantInfo(tenantConfig, new TenantConfigDto(), tenantInfoDto::setConfig);
+        return tenantInfoDto;
+    }
+
+    /**
+     * 启用/停用
+     *
+     * @param id    机构id
+     * @param state 机构状态 0草稿 1启动 2停用
+     */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void opsTenantState(Integer id, Integer state) {
+        if (Objects.nonNull(state)) {
+            if (state == 1 || state == 2) {
+                baseMapper.opsTenantState(id, state);
+                return;
+            }
+        }
+        throw new BizException("机构状态参数异常!");
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param param 查询条件
+     * @return
+     */
+    @Override
+    public PageInfo<TenantInfoInfoPageVo> queryPage(Map<String, Object> param) {
+        Page<TenantInfoInfoPageVo> pageInfo = PageUtil.getPageInfo(param);
+        pageInfo.setAsc("a.id_");
+        return PageUtil.pageInfo(baseMapper.queryPage(pageInfo, param));
+    }
+
+    /**
+     * 校验手机号
+     */
+    private void checkPhone(TenantInfoDto dto) {
+        SysUser sysUser = Optional.ofNullable(dto)
+                .map(TenantInfoDto::getPhone)
+                .map(sysUserFeignService::queryUserByMobile)
+                .orElse(null);
+        if (Objects.nonNull(sysUser)) {
+            throw new BizException("该手机号已被注册!");
+        }
+    }
 
+    /**
+     * set机构Id 并执行一个操作
+     *
+     * @param tenantId  机构id
+     * @param clazz     setId的类
+     * @param setOption set构造函数
+     * @param action    需要执行的操作
+     */
+    private <T> void setIdByApply(Integer tenantId, T clazz, Consumer<Integer> setOption, Consumer<T> action) {
+        Optional.ofNullable(tenantId)
+                .ifPresent(setOption);
+        action.accept(clazz);
+    }
+
+    /**
+     * 给机构各关联配置赋值
+     *
+     * @param source 原对象
+     * @param target 转换的对象
+     * @param action 执行动作
+     */
+    private <T> void setTenantInfo(Object source, T target, Consumer<T> action) {
+        if (Objects.nonNull(source)) {
+            BeanUtils.copyProperties(source, target);
+            action.accept(target);
+        }
     }
 
 }

+ 24 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/TenantProductInfoServiceImpl.java

@@ -1,8 +1,11 @@
 package com.ym.mec.biz.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.biz.dal.dao.TenantProductInfoDao;
+import com.ym.mec.biz.dal.dto.TenantProductInfoDto;
+import com.ym.mec.biz.dal.entity.TenantProductInfo;
 import com.ym.mec.biz.service.TenantProductInfoService;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
 /**
@@ -10,7 +13,24 @@ import org.springframework.stereotype.Service;
  * Created by 2021-12-02
  */
 @Service
-public class TenantProductInfoServiceImpl implements TenantProductInfoService {
-    @Autowired
-    private TenantProductInfoDao tenantProductInfoDao;
+public class TenantProductInfoServiceImpl extends ServiceImpl<TenantProductInfoDao, TenantProductInfo> implements TenantProductInfoService {
+
+    /**
+     * 添加机构选购的产品信息
+     */
+    @Override
+    public void addTenantProduct(TenantProductInfoDto dto) {
+        TenantProductInfo info = new TenantProductInfo();
+        BeanUtils.copyProperties(dto, info);
+        baseMapper.insert(info);
+    }
+
+    @Override
+    public void updateTenantProduct(TenantProductInfoDto dto) {
+        TenantProductInfo info = new TenantProductInfo();
+        BeanUtils.copyProperties(dto, info);
+        baseMapper.updateById(info);
+    }
+
+
 }

+ 0 - 166
mec-biz/src/main/resources/config/mybatis/CloudRoomFlowConfigMapper.xml

@@ -1,166 +0,0 @@
-<?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.CloudRoomFlowConfigDao">
-
-    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.CloudRoomFlowConfig">
-        <id column="id_" jdbcType="INTEGER" property="id"/>
-        <result column="minute_up_limit_" jdbcType="INTEGER" property="minuteUpLimit"/>
-        <result column="price_" jdbcType="DECIMAL" property="price"/>
-        <result column="remark_" jdbcType="VARCHAR" property="remark"/>
-        <result column="deleted_" jdbcType="INTEGER" property="deleted"/>
-        <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
-        <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
-        <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
-        <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
-    </resultMap>
-
-    <sql id="Base_Column_List">
-        id_
-        , minute_up_limit_, price_, remark_, deleted_, created_by_, created_time_, updated_by_,
-    updated_time_
-    </sql>
-
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from cloud_room_flow_config
-        where id_ = #{id,jdbcType=INTEGER}
-    </select>
-
-    <select id="queryPage" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from cloud_room_flow_config
-        <where>
-            deleted_ = 0
-            <if test="minuteUp != null">
-                and minute_up_limit_ = #{minuteUp}
-            </if>
-        </where>
-    </select>
-
-    <select id="getGroupMinuteUp" resultType="integer">
-        select
-            minute_up_limit_
-        from cloud_room_flow_config
-        where deleted_ = 0
-        group by minute_up_limit_
-    </select>
-
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-        delete
-        from cloud_room_flow_config
-        where id_ = #{id,jdbcType=INTEGER}
-    </delete>
-
-    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowConfig"
-            useGeneratedKeys="true">
-        insert into cloud_room_flow_config (minute_up_limit_, price_, remark_,
-                                            deleted_, created_by_, created_time_,
-                                            updated_by_, updated_time_)
-        values (#{minuteUpLimit,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
-                #{deleted,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP},
-                #{updatedBy,jdbcType=VARCHAR}, #{updatedTime,jdbcType=TIMESTAMP})
-    </insert>
-
-    <insert id="insertSelective" keyColumn="id_" keyProperty="id"
-            parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowConfig" useGeneratedKeys="true">
-        insert into cloud_room_flow_config
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="minuteUpLimit != null">
-                minute_up_limit_,
-            </if>
-            <if test="price != null">
-                price_,
-            </if>
-            <if test="remark != null">
-                remark_,
-            </if>
-            <if test="deleted != null">
-                deleted_,
-            </if>
-            <if test="createdBy != null">
-                created_by_,
-            </if>
-            <if test="createdTime != null">
-                created_time_,
-            </if>
-            <if test="updatedBy != null">
-                updated_by_,
-            </if>
-            <if test="updatedTime != null">
-                updated_time_,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="minuteUpLimit != null">
-                #{minuteUpLimit,jdbcType=INTEGER},
-            </if>
-            <if test="price != null">
-                #{price,jdbcType=DECIMAL},
-            </if>
-            <if test="remark != null">
-                #{remark,jdbcType=VARCHAR},
-            </if>
-            <if test="deleted != null">
-                #{deleted,jdbcType=INTEGER},
-            </if>
-            <if test="createdBy != null">
-                #{createdBy,jdbcType=VARCHAR},
-            </if>
-            <if test="createdTime != null">
-                #{createdTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updatedBy != null">
-                #{updatedBy,jdbcType=VARCHAR},
-            </if>
-            <if test="updatedTime != null">
-                #{updatedTime,jdbcType=TIMESTAMP},
-            </if>
-        </trim>
-    </insert>
-
-    <update id="updateByPrimaryKeySelective" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowConfig">
-        update cloud_room_flow_config
-        <set>
-            <if test="minuteUpLimit != null">
-                minute_up_limit_ = #{minuteUpLimit,jdbcType=INTEGER},
-            </if>
-            <if test="price != null">
-                price_ = #{price,jdbcType=DECIMAL},
-            </if>
-            <if test="remark != null">
-                remark_ = #{remark,jdbcType=VARCHAR},
-            </if>
-            <if test="deleted != null">
-                deleted_ = #{deleted,jdbcType=INTEGER},
-            </if>
-            <if test="createdBy != null">
-                created_by_ = #{createdBy,jdbcType=VARCHAR},
-            </if>
-            <if test="createdTime != null">
-                created_time_ = #{createdTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updatedBy != null">
-                updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-            </if>
-            <if test="updatedTime != null">
-                updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
-            </if>
-        </set>
-        where id_ = #{id,jdbcType=INTEGER}
-    </update>
-
-    <update id="updateByPrimaryKey" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowConfig">
-        update cloud_room_flow_config
-        set minute_up_limit_ = #{minuteUpLimit,jdbcType=INTEGER},
-            price_           = #{price,jdbcType=DECIMAL},
-            remark_          = #{remark,jdbcType=VARCHAR},
-            deleted_         = #{deleted,jdbcType=INTEGER},
-            created_by_      = #{createdBy,jdbcType=VARCHAR},
-            created_time_    = #{createdTime,jdbcType=TIMESTAMP},
-            updated_by_      = #{updatedBy,jdbcType=VARCHAR},
-            updated_time_    = #{updatedTime,jdbcType=TIMESTAMP}
-        where id_ = #{id,jdbcType=INTEGER}
-    </update>
-</mapper>

+ 0 - 134
mec-biz/src/main/resources/config/mybatis/CloudRoomFlowInfoMapper.xml

@@ -1,134 +0,0 @@
-<?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.CloudRoomFlowInfoDao">
-  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.CloudRoomFlowInfo">
-    <id column="id_" jdbcType="INTEGER" property="id" />
-    <result column="minute_up_limit_" jdbcType="INTEGER" property="minuteUpLimit" />
-    <result column="price_" jdbcType="DECIMAL" property="price" />
-    <result column="remark_" jdbcType="VARCHAR" property="remark" />
-    <result column="deleted_" jdbcType="INTEGER" property="deleted" />
-    <result column="created_by_" jdbcType="INTEGER" property="createdBy" />
-    <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime" />
-    <result column="updated_by_" jdbcType="INTEGER" property="updatedBy" />
-    <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    id_, minute_up_limit_, price_, remark_, deleted_, created_by_, created_time_, updated_by_, 
-    updated_time_
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from cloud_room_flow_config
-    where id_ = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from cloud_room_flow_config
-    where id_ = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowInfo" useGeneratedKeys="true">
-    insert into cloud_room_flow_config (minute_up_limit_, price_, remark_, 
-      deleted_, created_by_, created_time_, 
-      updated_by_, updated_time_)
-    values (#{minuteUpLimit,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, 
-      #{deleted,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP}, 
-      #{updatedBy,jdbcType=VARCHAR}, #{updatedTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowInfo" useGeneratedKeys="true">
-    insert into cloud_room_flow_config
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="minuteUpLimit != null">
-        minute_up_limit_,
-      </if>
-      <if test="price != null">
-        price_,
-      </if>
-      <if test="remark != null">
-        remark_,
-      </if>
-      <if test="deleted != null">
-        deleted_,
-      </if>
-      <if test="createdBy != null">
-        created_by_,
-      </if>
-      <if test="createdTime != null">
-        created_time_,
-      </if>
-      <if test="updatedBy != null">
-        updated_by_,
-      </if>
-      <if test="updatedTime != null">
-        updated_time_,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="minuteUpLimit != null">
-        #{minuteUpLimit,jdbcType=INTEGER},
-      </if>
-      <if test="price != null">
-        #{price,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="deleted != null">
-        #{deleted,jdbcType=INTEGER},
-      </if>
-      <if test="createdBy != null">
-        #{createdBy,jdbcType=VARCHAR},
-      </if>
-      <if test="createdTime != null">
-        #{createdTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updatedBy != null">
-        #{updatedBy,jdbcType=VARCHAR},
-      </if>
-      <if test="updatedTime != null">
-        #{updatedTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowInfo">
-    update cloud_room_flow_config
-    <set>
-      <if test="minuteUpLimit != null">
-        minute_up_limit_ = #{minuteUpLimit,jdbcType=INTEGER},
-      </if>
-      <if test="price != null">
-        price_ = #{price,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        remark_ = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="deleted != null">
-        deleted_ = #{deleted,jdbcType=INTEGER},
-      </if>
-      <if test="createdBy != null">
-        created_by_ = #{createdBy,jdbcType=VARCHAR},
-      </if>
-      <if test="createdTime != null">
-        created_time_ = #{createdTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updatedBy != null">
-        updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-      </if>
-      <if test="updatedTime != null">
-        updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowInfo">
-    update cloud_room_flow_config
-    set minute_up_limit_ = #{minuteUpLimit,jdbcType=INTEGER},
-      price_ = #{price,jdbcType=DECIMAL},
-      remark_ = #{remark,jdbcType=VARCHAR},
-      deleted_ = #{deleted,jdbcType=INTEGER},
-      created_by_ = #{createdBy,jdbcType=VARCHAR},
-      created_time_ = #{createdTime,jdbcType=TIMESTAMP},
-      updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-      updated_time_ = #{updatedTime,jdbcType=TIMESTAMP}
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
-</mapper>

+ 0 - 134
mec-biz/src/main/resources/config/mybatis/CloudRoomFlowRecordMapper.xml

@@ -1,134 +0,0 @@
-<?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.CloudRoomFlowRecordDao">
-  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.CloudRoomFlowRecord">
-    <id column="id_" jdbcType="INTEGER" property="id" />
-    <result column="minute_up_limit_" jdbcType="INTEGER" property="minuteUpLimit" />
-    <result column="price_" jdbcType="DECIMAL" property="price" />
-    <result column="remark_" jdbcType="VARCHAR" property="remark" />
-    <result column="deleted_" jdbcType="INTEGER" property="deleted" />
-    <result column="created_by_" jdbcType="INTEGER" property="createdBy" />
-    <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime" />
-    <result column="updated_by_" jdbcType="INTEGER" property="updatedBy" />
-    <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    id_, minute_up_limit_, price_, remark_, deleted_, created_by_, created_time_, updated_by_, 
-    updated_time_
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from cloud_room_flow_config
-    where id_ = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from cloud_room_flow_config
-    where id_ = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowRecord" useGeneratedKeys="true">
-    insert into cloud_room_flow_config (minute_up_limit_, price_, remark_, 
-      deleted_, created_by_, created_time_, 
-      updated_by_, updated_time_)
-    values (#{minuteUpLimit,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, 
-      #{deleted,jdbcType=INTEGER}, #{createdBy,jdbcType=VARCHAR}, #{createdTime,jdbcType=TIMESTAMP}, 
-      #{updatedBy,jdbcType=VARCHAR}, #{updatedTime,jdbcType=TIMESTAMP})
-  </insert>
-  <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowRecord" useGeneratedKeys="true">
-    insert into cloud_room_flow_config
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="minuteUpLimit != null">
-        minute_up_limit_,
-      </if>
-      <if test="price != null">
-        price_,
-      </if>
-      <if test="remark != null">
-        remark_,
-      </if>
-      <if test="deleted != null">
-        deleted_,
-      </if>
-      <if test="createdBy != null">
-        created_by_,
-      </if>
-      <if test="createdTime != null">
-        created_time_,
-      </if>
-      <if test="updatedBy != null">
-        updated_by_,
-      </if>
-      <if test="updatedTime != null">
-        updated_time_,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="minuteUpLimit != null">
-        #{minuteUpLimit,jdbcType=INTEGER},
-      </if>
-      <if test="price != null">
-        #{price,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="deleted != null">
-        #{deleted,jdbcType=INTEGER},
-      </if>
-      <if test="createdBy != null">
-        #{createdBy,jdbcType=VARCHAR},
-      </if>
-      <if test="createdTime != null">
-        #{createdTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updatedBy != null">
-        #{updatedBy,jdbcType=VARCHAR},
-      </if>
-      <if test="updatedTime != null">
-        #{updatedTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowRecord">
-    update cloud_room_flow_config
-    <set>
-      <if test="minuteUpLimit != null">
-        minute_up_limit_ = #{minuteUpLimit,jdbcType=INTEGER},
-      </if>
-      <if test="price != null">
-        price_ = #{price,jdbcType=DECIMAL},
-      </if>
-      <if test="remark != null">
-        remark_ = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="deleted != null">
-        deleted_ = #{deleted,jdbcType=INTEGER},
-      </if>
-      <if test="createdBy != null">
-        created_by_ = #{createdBy,jdbcType=VARCHAR},
-      </if>
-      <if test="createdTime != null">
-        created_time_ = #{createdTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updatedBy != null">
-        updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-      </if>
-      <if test="updatedTime != null">
-        updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.ym.mec.biz.dal.entity.CloudRoomFlowRecord">
-    update cloud_room_flow_config
-    set minute_up_limit_ = #{minuteUpLimit,jdbcType=INTEGER},
-      price_ = #{price,jdbcType=DECIMAL},
-      remark_ = #{remark,jdbcType=VARCHAR},
-      deleted_ = #{deleted,jdbcType=INTEGER},
-      created_by_ = #{createdBy,jdbcType=VARCHAR},
-      created_time_ = #{createdTime,jdbcType=TIMESTAMP},
-      updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-      updated_time_ = #{updatedTime,jdbcType=TIMESTAMP}
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
-</mapper>

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

@@ -29,6 +29,7 @@
     <resultMap id="PlatformServeModeVoResult" type="com.ym.mec.biz.dal.vo.PlatformServeModeVo">
         <result column="mode_" jdbcType="VARCHAR" property="mode"/>
         <collection property="list" ofType="com.ym.mec.biz.dal.vo.PlatformServeModeVo$PlatformServeModeDetailVo">
+            <result column="id_" jdbcType="INTEGER" property="id"/>
             <result column="student_up_limit_" jdbcType="INTEGER" property="studentUpLimit"/>
             <result column="original_price_" jdbcType="DECIMAL" property="originalPrice"/>
         </collection>

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

@@ -8,6 +8,7 @@
 
     <resultMap type="com.ym.mec.biz.dal.entity.Student" id="Student">
         <result column="user_id_" property="userId"/>
+        <result column="school_name_" property="schoolName"/>
         <result column="subject_id_list_" property="subjectIdList"/>
         <result column="subject_name_" property="subjectNames"/>
         <result column="service_tag_" property="serviceTag"/>
@@ -77,7 +78,7 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.Student" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        INSERT INTO student (user_id_,subject_id_list_,
+        INSERT INTO student (user_id_,school_name_,subject_id_list_,
         <if test="serviceTag != null">
             service_tag_,
         </if>
@@ -87,7 +88,7 @@
         teacher_id_,create_time_,update_time_,service_tag_update_time_,cooperation_organ_id_,
         care_package_,come_on_package_,member_rank_setting_id_,membership_start_time_,membership_end_time_)
         VALUES
-        (#{userId},#{subjectIdList},
+        (#{userId},#{schoolName},#{subjectIdList},
         <if test="serviceTag != null">
             #{serviceTag},
         </if>
@@ -101,6 +102,9 @@
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.Student">
         UPDATE student
         <set>
+            <if test="schoolName != null">
+                school_name_ = #{schoolName},
+            </if>
             <if test="subjectIdList != null">
                 subject_id_list_ = #{subjectIdList},
             </if>
@@ -232,6 +236,9 @@
         <foreach collection="studentList" item="item" index="index" open="" close="" separator=";">
             UPDATE student
             <set>
+	            <if test="item.schoolName != null">
+	                school_name_ = #{item.schoolName},
+	            </if>
                 <if test="item.subjectIdList != null">
                     subject_id_list_ = #{item.subjectIdList},
                 </if>
@@ -769,15 +776,14 @@
         </foreach>
     </select>
     <select id="getNoTeacherOrNoSubjectStudent" resultMap="Student">
-        SELECT * FROM student WHERE teacher_id_ IS NULL OR subject_id_list_ IS NULL OR cooperation_organ_id_ IS NULL;
+        SELECT * FROM student WHERE teacher_id_ IS NULL OR subject_id_list_ IS NULL OR cooperation_organ_id_ IS NULL limit 0,1000;
     </select>
 
     <select id="getHasVipCourseStudentIdsFromNewStudents" resultType="int">
-        SELECT DISTINCT s.user_id_
-        FROM student s
-        LEFT JOIN course_schedule_student_payment cssp ON s.user_id_=cssp.user_id_
-        WHERE s.is_new_user_=1 AND cssp.group_type_='VIP'
+        SELECT DISTINCT(spo.user_id_) from student_payment_order spo LEFT JOIN student s on spo.user_id_ = s.user_id_ WHERE spo.type_ in ('DOUBLE_ELEVEN2021','DOUBLE_ELEVEN2020','SMALL_CLASS_TO_BUY')
+		and spo.status_ = 'SUCCESS' and spo.expect_amount_ > 0 and s.is_new_user_ = 1
     </select>
+    
     <select id="getMemberNum" resultType="int">
         SELECT COUNT(0) FROM student WHERE member_rank_setting_id_ IS NOT NULL AND FIND_IN_SET(user_id_,#{studentIdsStr})
     </select>

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

@@ -171,7 +171,7 @@
 			</if>
 			<if test="rankType != null">
 				<if test="rankType == 0">
-					AND ses.rank_ids_ IS NULL
+					AND (ses.rank_ids_ IS NULL or ses.rank_ids_ = '')
 				</if>
 				<if test="rankType == 1">
 					AND ses.rank_ids_ IS NOT NULL AND ses.rank_ids_ != ''

+ 25 - 143
mec-biz/src/main/resources/config/mybatis/TenantConfigMapper.xml

@@ -1,147 +1,29 @@
 <?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.TenantConfigDao">
-  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantConfig">
-    <id column="id_" jdbcType="INTEGER" property="id" />
-    <result column="tenant_id_" jdbcType="INTEGER" property="tenantId" />
-    <result column="charge_rate_" jdbcType="DECIMAL" property="chargeRate" />
-    <result column="teaching_material_id_" jdbcType="VARCHAR" property="teachingMaterialId" />
-    <result column="month_divide_" jdbcType="DECIMAL" property="monthDivide" />
-    <result column="quarter_divide_" jdbcType="DECIMAL" property="quarterDivide" />
-    <result column="half_year_divide_" jdbcType="DECIMAL" property="halfYearDivide" />
-    <result column="year_divide_" jdbcType="DECIMAL" property="yearDivide" />
-    <result column="updated_by_" jdbcType="INTEGER" property="updatedBy" />
-    <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    id_, tenant_id_, charge_rate_, teaching_material_id_, month_divide_, quarter_divide_, 
-    half_year_divide_, year_divide_, updated_by_, updated_time_
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from tenant_config
-    where id_ = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from tenant_config
-    where id_ = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantConfig" useGeneratedKeys="true">
-    insert into tenant_config (tenant_id_, charge_rate_, teaching_material_id_, 
-      month_divide_, quarter_divide_, half_year_divide_, 
-      year_divide_, updated_by_, updated_time_
-      )
-    values (#{tenantId,jdbcType=INTEGER}, #{chargeRate,jdbcType=DECIMAL}, #{teachingMaterialId,jdbcType=VARCHAR}, 
-      #{monthDivide,jdbcType=DECIMAL}, #{quarterDivide,jdbcType=DECIMAL}, #{halfYearDivide,jdbcType=DECIMAL}, 
-      #{yearDivide,jdbcType=DECIMAL}, #{updatedBy,jdbcType=VARCHAR}, #{updatedTime,jdbcType=TIMESTAMP}
-      )
-  </insert>
-  <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantConfig" useGeneratedKeys="true">
-    insert into tenant_config
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="tenantId != null">
-        tenant_id_,
-      </if>
-      <if test="chargeRate != null">
-        charge_rate_,
-      </if>
-      <if test="teachingMaterialId != null">
-        teaching_material_id_,
-      </if>
-      <if test="monthDivide != null">
-        month_divide_,
-      </if>
-      <if test="quarterDivide != null">
-        quarter_divide_,
-      </if>
-      <if test="halfYearDivide != null">
-        half_year_divide_,
-      </if>
-      <if test="yearDivide != null">
-        year_divide_,
-      </if>
-      <if test="updatedBy != null">
-        updated_by_,
-      </if>
-      <if test="updatedTime != null">
-        updated_time_,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="tenantId != null">
-        #{tenantId,jdbcType=INTEGER},
-      </if>
-      <if test="chargeRate != null">
-        #{chargeRate,jdbcType=DECIMAL},
-      </if>
-      <if test="teachingMaterialId != null">
-        #{teachingMaterialId,jdbcType=VARCHAR},
-      </if>
-      <if test="monthDivide != null">
-        #{monthDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="quarterDivide != null">
-        #{quarterDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="halfYearDivide != null">
-        #{halfYearDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="yearDivide != null">
-        #{yearDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="updatedBy != null">
-        #{updatedBy,jdbcType=VARCHAR},
-      </if>
-      <if test="updatedTime != null">
-        #{updatedTime,jdbcType=TIMESTAMP},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.ym.mec.biz.dal.entity.TenantConfig">
-    update tenant_config
-    <set>
-      <if test="tenantId != null">
-        tenant_id_ = #{tenantId,jdbcType=INTEGER},
-      </if>
-      <if test="chargeRate != null">
-        charge_rate_ = #{chargeRate,jdbcType=DECIMAL},
-      </if>
-      <if test="teachingMaterialId != null">
-        teaching_material_id_ = #{teachingMaterialId,jdbcType=VARCHAR},
-      </if>
-      <if test="monthDivide != null">
-        month_divide_ = #{monthDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="quarterDivide != null">
-        quarter_divide_ = #{quarterDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="halfYearDivide != null">
-        half_year_divide_ = #{halfYearDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="yearDivide != null">
-        year_divide_ = #{yearDivide,jdbcType=DECIMAL},
-      </if>
-      <if test="updatedBy != null">
-        updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-      </if>
-      <if test="updatedTime != null">
-        updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
-      </if>
-    </set>
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.ym.mec.biz.dal.entity.TenantConfig">
-    update tenant_config
-    set tenant_id_ = #{tenantId,jdbcType=INTEGER},
-      charge_rate_ = #{chargeRate,jdbcType=DECIMAL},
-      teaching_material_id_ = #{teachingMaterialId,jdbcType=VARCHAR},
-      month_divide_ = #{monthDivide,jdbcType=DECIMAL},
-      quarter_divide_ = #{quarterDivide,jdbcType=DECIMAL},
-      half_year_divide_ = #{halfYearDivide,jdbcType=DECIMAL},
-      year_divide_ = #{yearDivide,jdbcType=DECIMAL},
-      updated_by_ = #{updatedBy,jdbcType=VARCHAR},
-      updated_time_ = #{updatedTime,jdbcType=TIMESTAMP}
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
+    <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.TenantConfig">
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="tenant_id_" jdbcType="INTEGER" property="tenantId"/>
+        <result column="charge_rate_" jdbcType="VARCHAR" property="chargeRate"/>
+        <result column="teaching_material_id_" jdbcType="VARCHAR" property="teachingMaterialId"/>
+        <result column="config_" jdbcType="VARCHAR" property="config"/>
+        <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
+        <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id_
+        , tenant_id_, charge_rate_, teaching_material_id_, config_, updated_by_, updated_time_
+    </sql>
+
+    <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
+            parameterType="com.ym.mec.biz.dal.entity.TenantConfig">
+        insert into tenant_config(tenant_id_, charge_rate_, teaching_material_id_, config_, updated_by_, updated_time_)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.tenantId}, #{entity.chargeRate}, #{entity.teachingMaterialId}, #{entity.config},
+            #{entity.updatedBy}, #{entity.updatedTime})
+        </foreach>
+    </insert>
+
 </mapper>

+ 57 - 185
mec-biz/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -11,6 +11,7 @@
         <result column="email_" jdbcType="VARCHAR" property="email"/>
         <result column="logo_" jdbcType="VARCHAR" property="logo"/>
         <result column="customer_service_phone" jdbcType="VARCHAR" property="customerServicePhone"/>
+        <result column="remark_" jdbcType="VARCHAR" property="remark"/>
         <result column="domain_name_" jdbcType="VARCHAR" property="domainName"/>
         <result column="data_source_" jdbcType="VARCHAR" property="dataSource"/>
         <result column="pay_state_" jdbcType="INTEGER" property="payState"/>
@@ -21,203 +22,74 @@
         <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
     </resultMap>
 
+    <!--    <include refid="Base_Column_List"/>-->
     <sql id="Base_Column_List">
         id_
-        , name_, contacts_, phone_, address_, email_, logo_, customer_service_phone, domain_name_,
+        , name_, contacts_, phone_, address_, email_, logo_, customer_service_phone,remark_ ,domain_name_,
     data_source_, pay_state_, state_, created_by_, created_time_, updated_by_, updated_time_
     </sql>
 
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from tenant_info
-        where id_ = #{id,jdbcType=INTEGER}
-    </select>
-
-    <select id="queryList" resultType="com.ym.mec.biz.dal.entity.TenantInfo">
-        select
-        <include refid="Base_Column_List"/>
-        from tenant_info
-        <where>
-            <if test="param.state != null">
-                AND state_ = #{param.state,jdbcType=INTEGER}
-            </if>
-            <if test="param.id != null">
-                AND id_ = #{param.id,jdbcType=INTEGER}
-            </if>
-        </where>
-    </select>
-
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-        delete
-        from tenant_info
-        where id_ = #{id,jdbcType=INTEGER}
-    </delete>
-
-    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantInfo"
-            useGeneratedKeys="true">
-        insert into tenant_info (name_, contacts_, phone_,
-                                 address_, email_, logo_,
-                                 customer_service_phone, domain_name_, data_source_,
-                                 pay_state_, state_, created_by_,
-                                 created_time_, updated_by_, updated_time_)
-        values (#{name,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
-                #{address,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR},
-                #{customerServicePhone,jdbcType=VARCHAR}, #{domainName,jdbcType=VARCHAR},
-                #{dataSource,jdbcType=VARCHAR},
-                #{payState,jdbcType=INTEGER}, #{state,jdbcType=INTEGER}, #{createdBy,jdbcType=INTEGER},
-                #{createdTime,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=INTEGER}, #{updatedTime,jdbcType=TIMESTAMP})
-    </insert>
+    <update id="opsTenantState" parameterType="object">
+        update tenant_info
+        set state_ = #{state}
+        where id_ = #{id}
+    </update>
 
-    <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantInfo"
-            useGeneratedKeys="true">
-        insert into tenant_info
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="name != null">
-                name_,
-            </if>
-            <if test="contacts != null">
-                contacts_,
-            </if>
-            <if test="phone != null">
-                phone_,
-            </if>
-            <if test="address != null">
-                address_,
-            </if>
-            <if test="email != null">
-                email_,
-            </if>
-            <if test="logo != null">
-                logo_,
-            </if>
-            <if test="customerServicePhone != null">
-                customer_service_phone,
-            </if>
-            <if test="domainName != null">
-                domain_name_,
-            </if>
-            <if test="dataSource != null">
-                data_source_,
-            </if>
-            <if test="payState != null">
-                pay_state_,
-            </if>
-            <if test="state != null">
-                state_,
-            </if>
-            <if test="createdBy != null">
-                created_by_,
-            </if>
-            <if test="createdTime != null">
-                created_time_,
-            </if>
-            <if test="updatedBy != null">
-                updated_by_,
-            </if>
-            <if test="updatedTime != null">
-                updated_time_,
-            </if>
-        </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="name != null">
-                #{name,jdbcType=VARCHAR},
-            </if>
-            <if test="contacts != null">
-                #{contacts,jdbcType=VARCHAR},
-            </if>
-            <if test="phone != null">
-                #{phone,jdbcType=VARCHAR},
-            </if>
-            <if test="address != null">
-                #{address,jdbcType=VARCHAR},
-            </if>
-            <if test="email != null">
-                #{email,jdbcType=VARCHAR},
-            </if>
-            <if test="logo != null">
-                #{logo,jdbcType=VARCHAR},
-            </if>
-            <if test="customerServicePhone != null">
-                #{customerServicePhone,jdbcType=VARCHAR},
-            </if>
-            <if test="domainName != null">
-                #{domainName,jdbcType=VARCHAR},
-            </if>
-            <if test="dataSource != null">
-                #{dataSource,jdbcType=VARCHAR},
-            </if>
-            <if test="payState != null">
-                #{payState,jdbcType=INTEGER},
-            </if>
-            <if test="state != null">
-                #{state,jdbcType=INTEGER},
-            </if>
-            <if test="createdBy != null">
-                #{createdBy,jdbcType=INTEGER},
-            </if>
-            <if test="createdTime != null">
-                #{createdTime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="updatedBy != null">
-                #{updatedBy,jdbcType=INTEGER},
-            </if>
-            <if test="updatedTime != null">
-                #{updatedTime,jdbcType=TIMESTAMP},
-            </if>
-        </trim>
-    </insert>
+    <resultMap id="TenantInfoInfoResult" type="com.ym.mec.biz.dal.vo.TenantInfoInfoPageVo">
+        <!--  机构基础信息-->
+        <id column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="name_" jdbcType="VARCHAR" property="name"/>
+        <result column="contacts_" jdbcType="VARCHAR" property="contacts"/>
+        <result column="phone_" jdbcType="VARCHAR" property="phone"/>
+        <result column="pay_state_" jdbcType="INTEGER" property="payState"/>
+        <result column="state_" jdbcType="INTEGER" property="state"/>
+        <result column="real_name_" jdbcType="VARCHAR" property="createdName"/>
+        <!-- 机构产品信息-->
+        <result column="serve_name_" jdbcType="VARCHAR" property="serveName"/>
+        <result column="student_up_limit_" jdbcType="INTEGER" property="studentUpLimit"/>
+        <result column="expiry_date_" jdbcType="TIMESTAMP" property="expireDate"/>
+    </resultMap>
 
-    <update id="updateByKey" parameterType="com.ym.mec.biz.dal.entity.TenantInfo">
-        update tenant_info
-        <set>
-            <if test="name != null">
-                name_ = #{name,jdbcType=VARCHAR},
-            </if>
-            <if test="contacts != null">
-                contacts_ = #{contacts,jdbcType=VARCHAR},
-            </if>
-            <if test="phone != null">
-                phone_ = #{phone,jdbcType=VARCHAR},
-            </if>
-            <if test="address != null">
-                address_ = #{address,jdbcType=VARCHAR},
-            </if>
-            <if test="email != null">
-                email_ = #{email,jdbcType=VARCHAR},
-            </if>
-            <if test="logo != null">
-                logo_ = #{logo,jdbcType=VARCHAR},
-            </if>
-            <if test="customerServicePhone != null">
-                customer_service_phone = #{customerServicePhone,jdbcType=VARCHAR},
-            </if>
-            <if test="domainName != null">
-                domain_name_ = #{domainName,jdbcType=VARCHAR},
-            </if>
-            <if test="dataSource != null">
-                data_source_ = #{dataSource,jdbcType=VARCHAR},
-            </if>
-            <if test="payState != null">
-                pay_state_ = #{payState,jdbcType=INTEGER},
+    <select id="queryPage" parameterType="map" resultMap="TenantInfoInfoResult">
+        SELECT a.`id_`,
+        a.`name_`,
+        a.`contacts_`,
+        a.`phone_`,
+        a.`pay_state_`,
+        a.`state_`,
+        u.`real_name_`,
+        c.`name_` AS serve_name_,
+        d.`student_up_limit_`,
+        b.`expiry_date_`
+        FROM tenant_info AS a
+        LEFT JOIN tenant_product_info AS b ON a.`id_` = b.`tenant_id_`
+        LEFT JOIN platform_serve AS c ON b.`serve_id_` = c.`id_`
+        LEFT JOIN platform_serve_detail AS d ON b.`serve_detail_id_` = d.`id_` AND c.`id_` = d.`serve_id_`
+        LEFT JOIN sys_user AS u ON a.`created_by_` = u.`id_`
+        <where>
+            <if test="param.search != null ">
+                AND (
+                a.`id_` LIKE CONCAT('%', #{param.search},'%')
+                OR a.`name_` LIKE CONCAT('%', #{param.search},'%')
+                OR a.`phone_` LIKE CONCAT('%', #{param.search},'%')
+                )
             </if>
-            <if test="state != null">
-                state_ = #{state,jdbcType=INTEGER},
+            <if test="param.createdName != null ">
+                AND u.`real_name_` LIKE CONCAT('%', #{param.createdName},'%')
             </if>
-            <if test="createdBy != null">
-                created_by_ = #{createdBy,jdbcType=INTEGER},
+            <if test="param.payState != null ">
+                AND a.`pay_state_` = #{param.payState}
             </if>
-            <if test="createdTime != null">
-                created_time_ = #{createdTime,jdbcType=TIMESTAMP},
+            <if test="param.state != null ">
+                AND a.`state_` = #{param.state}
             </if>
-            <if test="updatedBy != null">
-                updated_by_ = #{updatedBy,jdbcType=INTEGER},
+            <if test="param.startDate != null">
+                AND a.`created_time_` <![CDATA[ >= ]]>  #{param.startDate}
             </if>
-            <if test="updatedTime != null">
-                updated_time_ = #{updatedTime,jdbcType=TIMESTAMP},
+            <if test="param.endDate != null ">
+                AND a.`created_time_` <![CDATA[ <= ]]>  #{param.endDate}
             </if>
-        </set>
-        where id_ = #{id,jdbcType=INTEGER}
-    </update>
+        </where>
+    </select>
 
 </mapper>

+ 6 - 119
mec-biz/src/main/resources/config/mybatis/TenantProductInfoMapper.xml

@@ -6,129 +6,16 @@
     <result column="tenant_id_" jdbcType="INTEGER" property="tenantId" />
     <result column="serve_id_" jdbcType="INTEGER" property="serveId" />
     <result column="serve_detail_id_" jdbcType="INTEGER" property="serveDetailId" />
-    <result column="original_price_" jdbcType="VARCHAR" property="originalPrice" />
+    <result column="original_price_" jdbcType="DECIMAL" property="originalPrice" />
     <result column="contract_price_" jdbcType="DECIMAL" property="contractPrice" />
+    <result column="pay_amount_" jdbcType="DECIMAL" property="payAmount" />
     <result column="expiry_count_" jdbcType="INTEGER" property="expiryCount" />
     <result column="expiry_unit_" jdbcType="VARCHAR" property="expiryUnit" />
-    <result column="expiry_data_" jdbcType="DATE" property="expiryData" />
+    <result column="expiry_data_" jdbcType="DATE" property="expiryDate" />
   </resultMap>
   <sql id="Base_Column_List">
-    id_, tenant_id_, serve_id_, serve_detail_id_, original_price_, contract_price_, expiry_count_, 
-    expiry_unit_, expiry_data_
+    id_, tenant_id_, serve_id_, serve_detail_id_, original_price_, contract_price_, pay_amount_, 
+    expiry_count_, expiry_unit_, expiry_data_
   </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
-    select 
-    <include refid="Base_Column_List" />
-    from tenant_product_info
-    where id_ = #{id,jdbcType=INTEGER}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    delete from tenant_product_info
-    where id_ = #{id,jdbcType=INTEGER}
-  </delete>
-  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantProductInfo" useGeneratedKeys="true">
-    insert into tenant_product_info (tenant_id_, serve_id_, serve_detail_id_, 
-      original_price_, contract_price_, expiry_count_, 
-      expiry_unit_, expiry_data_)
-    values (#{tenantId,jdbcType=INTEGER}, #{serveId,jdbcType=INTEGER}, #{serveDetailId,jdbcType=INTEGER}, 
-      #{originalPrice,jdbcType=VARCHAR}, #{contractPrice,jdbcType=DECIMAL}, #{expiryCount,jdbcType=INTEGER}, 
-      #{expiryUnit,jdbcType=VARCHAR}, #{expiryData,jdbcType=DATE})
-  </insert>
-  <insert id="insertSelective" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TenantProductInfo" useGeneratedKeys="true">
-    insert into tenant_product_info
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="tenantId != null">
-        tenant_id_,
-      </if>
-      <if test="serveId != null">
-        serve_id_,
-      </if>
-      <if test="serveDetailId != null">
-        serve_detail_id_,
-      </if>
-      <if test="originalPrice != null">
-        original_price_,
-      </if>
-      <if test="contractPrice != null">
-        contract_price_,
-      </if>
-      <if test="expiryCount != null">
-        expiry_count_,
-      </if>
-      <if test="expiryUnit != null">
-        expiry_unit_,
-      </if>
-      <if test="expiryData != null">
-        expiry_data_,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="tenantId != null">
-        #{tenantId,jdbcType=INTEGER},
-      </if>
-      <if test="serveId != null">
-        #{serveId,jdbcType=INTEGER},
-      </if>
-      <if test="serveDetailId != null">
-        #{serveDetailId,jdbcType=INTEGER},
-      </if>
-      <if test="originalPrice != null">
-        #{originalPrice,jdbcType=VARCHAR},
-      </if>
-      <if test="contractPrice != null">
-        #{contractPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="expiryCount != null">
-        #{expiryCount,jdbcType=INTEGER},
-      </if>
-      <if test="expiryUnit != null">
-        #{expiryUnit,jdbcType=VARCHAR},
-      </if>
-      <if test="expiryData != null">
-        #{expiryData,jdbcType=DATE},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.ym.mec.biz.dal.entity.TenantProductInfo">
-    update tenant_product_info
-    <set>
-      <if test="tenantId != null">
-        tenant_id_ = #{tenantId,jdbcType=INTEGER},
-      </if>
-      <if test="serveId != null">
-        serve_id_ = #{serveId,jdbcType=INTEGER},
-      </if>
-      <if test="serveDetailId != null">
-        serve_detail_id_ = #{serveDetailId,jdbcType=INTEGER},
-      </if>
-      <if test="originalPrice != null">
-        original_price_ = #{originalPrice,jdbcType=VARCHAR},
-      </if>
-      <if test="contractPrice != null">
-        contract_price_ = #{contractPrice,jdbcType=DECIMAL},
-      </if>
-      <if test="expiryCount != null">
-        expiry_count_ = #{expiryCount,jdbcType=INTEGER},
-      </if>
-      <if test="expiryUnit != null">
-        expiry_unit_ = #{expiryUnit,jdbcType=VARCHAR},
-      </if>
-      <if test="expiryData != null">
-        expiry_data_ = #{expiryData,jdbcType=DATE},
-      </if>
-    </set>
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.ym.mec.biz.dal.entity.TenantProductInfo">
-    update tenant_product_info
-    set tenant_id_ = #{tenantId,jdbcType=INTEGER},
-      serve_id_ = #{serveId,jdbcType=INTEGER},
-      serve_detail_id_ = #{serveDetailId,jdbcType=INTEGER},
-      original_price_ = #{originalPrice,jdbcType=VARCHAR},
-      contract_price_ = #{contractPrice,jdbcType=DECIMAL},
-      expiry_count_ = #{expiryCount,jdbcType=INTEGER},
-      expiry_unit_ = #{expiryUnit,jdbcType=VARCHAR},
-      expiry_data_ = #{expiryData,jdbcType=DATE}
-    where id_ = #{id,jdbcType=INTEGER}
-  </update>
+
 </mapper>

+ 12 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/config/MyBatisPlusConfig.java

@@ -3,10 +3,12 @@ package com.ym.mec.common.config;
 import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
 import com.baomidou.mybatisplus.core.MybatisConfiguration;
 import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
+import org.springframework.context.annotation.Profile;
 
 /**
  * @author hgw
@@ -33,4 +35,14 @@ public class MyBatisPlusConfig {
         return new PaginationInterceptor();
     }
 
+
+    /**
+     * 性能分析插件
+     */
+    @Bean
+    @Profile({"dev","test"})
+    public PerformanceInterceptor performanceInterceptor() {
+        return new PerformanceInterceptor();
+    }
+
 }

+ 23 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/page/PageUtil.java

@@ -3,6 +3,7 @@ package com.ym.mec.common.page;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 
+import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -42,4 +43,26 @@ public class PageUtil {
         resultPage.setTotal(total);
         return resultPage;
     }
+
+
+    /**
+     * 获取Map中的关键字获取分页数据
+     *
+     * @param param Map<String, Object> param
+     * @param str   关键字
+     * @return Optional
+     */
+    public static <S, O> Optional<Integer> getPage(Map<S, O> param, String str) {
+        return Optional.ofNullable(param)
+                .map(p -> p.get(str))
+                .map(String::valueOf)
+                .map(Integer::valueOf);
+    }
+
+    public static <S, O, T> Page<T> getPageInfo(Map<S, O> param) {
+        int pageSize = getPage(param, "rows").orElse(20);
+        int pageIndex = getPage(param, "page").orElse(1);
+        return new Page<>(pageIndex, pageSize);
+    }
+
 }

+ 1 - 1
mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java

@@ -24,7 +24,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
     @Override
     public void configure(HttpSecurity http) throws Exception {
         http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-                .authorizeRequests().antMatchers("/wechat/*","/v2/api-docs", "/code/*", "/register/*", "/studentOrder/*", "/musicGroup/getSubjectGoodsAndInfo",
+                .authorizeRequests().antMatchers("/wechat/*","/v2/api-docs", "/code/*", "/student/registering", "/register/*", "/studentOrder/*", "/musicGroup/getSubjectGoodsAndInfo",
                 "/musicGroup/getMusicGroupStatus", "/musicGroup/getOrderStatus","/sysCouponCode/queryPage",
                 "/musicGroup/pay",
                 "/musicGroup/rePay",

+ 11 - 1
mec-student/src/main/java/com/ym/mec/student/controller/StudentController.java

@@ -12,6 +12,7 @@ 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.StudentPreRegistration;
 import com.ym.mec.biz.service.StudentService;
 import com.ym.mec.common.controller.BaseController;
@@ -29,7 +30,16 @@ public class StudentController extends BaseController {
 
     @ApiOperation("注册")
     @PostMapping(value = "/registering")
-    public Object preRegister(@RequestBody StudentPreRegistration studentPreRegistration) {
+    public Object registering(@RequestBody StudentPreRegistration studentPreRegistration) {
+
+    	// 判断用户是否存在
+        SysUser user = sysUserFeignService.queryUserByMobile(studentPreRegistration.getPhone());
+        if(user != null && user.getId() != null){
+        	if(user.getUserType().contains("STUDENT")){
+        		return succeed("您已注册,请直接下载APP!");
+        	}
+        }
+        
         return studentService.register(studentPreRegistration) ? succeed() : failed();
     }
 

+ 0 - 65
mec-web/src/main/java/com/ym/mec/web/controller/CloudRoomFlowConfigController.java

@@ -1,65 +0,0 @@
-package com.ym.mec.web.controller;
-
-import com.ym.mec.biz.dal.dto.CloudRoomFlowDto;
-import com.ym.mec.biz.service.CloudRoomFlowConfigService;
-import com.ym.mec.common.controller.BaseController;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.*;
-
-import javax.validation.Valid;
-
-/**
- * @author hgw
- * Created by 2021-12-06
- */
-@RequestMapping("/cloudRoomFlowConfig")
-@Api(tags = "云教室流量管理")
-@RestController
-public class CloudRoomFlowConfigController extends BaseController {
-
-    @Autowired
-    private CloudRoomFlowConfigService flowConfigService;
-
-    @ApiOperation("分页查询")
-    @GetMapping(value = "/queryPage")
-    @PreAuthorize("@pcs.hasPermissions('cloudRoomFlowConfig/queryPage')")
-    public Object queryPage(Integer minuteUp, Integer page, Integer rows) {
-        return succeed(flowConfigService.queryPage(minuteUp, page, rows));
-    }
-
-    @ApiOperation("修改云教室流量")
-    @PostMapping(value = "/update")
-    @PreAuthorize("@pcs.hasPermissions('cloudRoomFlowConfig/update')")
-    public Object updateProduct(@Valid @RequestBody CloudRoomFlowDto dto) {
-        flowConfigService.updateConfig(dto);
-        return succeed();
-    }
-
-    @ApiOperation("添加云教室流量")
-    @PostMapping(value = "/add")
-    @PreAuthorize("@pcs.hasPermissions('cloudRoomFlowConfig/add')")
-    public Object addProduct(@Valid @RequestBody CloudRoomFlowDto dto) {
-        flowConfigService.addConfig(dto);
-        return succeed();
-    }
-
-    @ApiOperation("删除云教室流量")
-    @GetMapping(value = "/delete/{id}")
-    @PreAuthorize("@pcs.hasPermissions('cloudRoomFlowConfig/delete')")
-    public Object deleteProduct(@ApiParam(value = "平台产品ID", required = true) @PathVariable("id") Integer id) {
-        flowConfigService.deleteConfig(id);
-        return succeed();
-    }
-
-    @ApiOperation("获取云教师流量包各分钟上限设置")
-    @GetMapping(value = "/getMinuteUp")
-    @PreAuthorize("@pcs.hasPermissions('cloudRoomFlowConfig/getMinuteUp')")
-    public Object getGroupMinuteUp() {
-        return succeed(flowConfigService.getGroupMinuteUp());
-    }
-
-}

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

@@ -1,8 +1,8 @@
 package com.ym.mec.web.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ym.mec.biz.dal.dao.MusicGroupSchoolTermCourseDetailDao;
-import com.ym.mec.biz.dal.dao.TenantInfoDao;
 import com.ym.mec.biz.dal.entity.MusicGroupSchoolTermCourseDetail;
 import com.ym.mec.biz.dal.entity.TenantInfo;
 import com.ym.mec.biz.dal.enums.IndexDataType;
@@ -105,7 +105,7 @@ public class TaskController extends BaseController {
 	@Autowired
 	private SysMusicCompareRecordService sysMusicCompareRecordService;
 	@Autowired
-	private TenantInfoDao tenantInfoDao;
+	private TenantInfoService tenantInfoService;
 
 	@GetMapping(value = "/syncImHistoryMessageTask")
 	// 同步即时通讯聊天记录
@@ -152,9 +152,7 @@ public class TaskController extends BaseController {
 	@GetMapping(value = "/repertoryWarn")
 	// 商品库存预警
 	public void repertoryWarn(){
-		Map<String,Object> paramMap = new HashMap<>(1);
-		paramMap.put("state",1);
-		List<TenantInfo> tenantInfos = tenantInfoDao.queryList(paramMap);
+		List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
 		if(tenantInfos != null && tenantInfos.size() > 0){
 			for (TenantInfo tenantInfo : tenantInfos) {
 				goodsService.repertoryWarn(tenantInfo.getId());
@@ -183,9 +181,7 @@ public class TaskController extends BaseController {
 	@GetMapping("/vipGroupTeacherSalarySettlement")
 	// vip课课酬结算
 	public void vipGroupTeacherSalarySettlement() {
-		Map<String,Object> paramMap = new HashMap<>(1);
-		paramMap.put("state",1);
-		List<TenantInfo> tenantInfos = tenantInfoDao.queryList(paramMap);
+        List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
 		if(tenantInfos != null && tenantInfos.size() > 0){
 			for (TenantInfo tenantInfo : tenantInfos) {
 				courseScheduleTeacherSalaryService.teacherSalarySettlement(tenantInfo.getId());
@@ -198,9 +194,7 @@ public class TaskController extends BaseController {
 	@GetMapping("/practiceTeacherSalarySettlement")
 	// 陪练课课酬结算
 	public void practiceTeacherSalarySettlement() {
-		Map<String,Object> paramMap = new HashMap<>(1);
-		paramMap.put("state",1);
-		List<TenantInfo> tenantInfos = tenantInfoDao.queryList(paramMap);
+        List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
 		if(tenantInfos != null && tenantInfos.size() > 0){
 			for (TenantInfo tenantInfo : tenantInfos) {
 				courseScheduleTeacherSalaryService.practiceTeacherSalarySettlement(tenantInfo.getId());
@@ -213,9 +207,7 @@ public class TaskController extends BaseController {
 	// 乐团课课酬结算
 	@GetMapping("/musicGroupTeacherSalarySettlement")
 	public void musicGroupTeacherSalarySettlement() {
-		Map<String,Object> paramMap = new HashMap<>(1);
-		paramMap.put("state",1);
-		List<TenantInfo> tenantInfos = tenantInfoDao.queryList(paramMap);
+        List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
 		if(tenantInfos != null && tenantInfos.size() > 0){
 			for (TenantInfo tenantInfo : tenantInfos) {
 				courseScheduleTeacherSalaryService.musicGroupTeacherSalarySettlement(tenantInfo.getId());

+ 75 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TenantInfoController.java

@@ -0,0 +1,75 @@
+package com.ym.mec.web.controller;
+
+import com.ym.mec.biz.dal.dto.TenantInfoDto;
+import com.ym.mec.biz.service.TenantInfoService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Map;
+
+/**
+ * @author hgw
+ * Created by 2021-12-07
+ */
+@RequestMapping("/tenantInfo")
+@Api(tags = "机构管理")
+@RestController
+public class TenantInfoController extends BaseController {
+
+    @Autowired
+    private TenantInfoService tenantInfoService;
+
+    @ApiOperation("添加机构信息")
+    @PostMapping(value = "/add")
+//    @PreAuthorize("@pcs.hasPermissions('tenantInfo/add')")
+    public Object addTenantInfo(@Valid @RequestBody TenantInfoDto dto) {
+        tenantInfoService.addTenantInfo(dto);
+        return succeed();
+    }
+
+    @ApiOperation("修改机构信息")
+    @PostMapping(value = "/update")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfo/update')")
+    public Object updateTenantInfo(@Valid @RequestBody TenantInfoDto dto) {
+        tenantInfoService.updateTenantInfo(dto);
+        return succeed();
+    }
+
+    @ApiOperation("修改机构启用停用状态")
+    @GetMapping(value = "/opsState/{id}")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfo/opsState')")
+    public Object opsState(@ApiParam(value = "机构ID", required = true) @PathVariable("id") Integer id, Integer state) {
+        tenantInfoService.opsTenantState(id, state);
+        return succeed();
+    }
+
+    @ApiOperation("查询单个机构详情")
+    @GetMapping(value = "/info/{id}")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfo/info')")
+    public Object queryTenantInfo(@ApiParam(value = "机构ID", required = true) @PathVariable("id") Integer id) {
+        return succeed(tenantInfoService.queryTenantInfo(id));
+    }
+
+
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "search", dataType = "String", value = "关键字"),
+            @ApiImplicitParam(name = "createdName", dataType = "String", value = "创建人"),
+            @ApiImplicitParam(name = "payState", dataType = "Integer", value = "支付状态 缴费状态 0未缴费  1已缴费"),
+            @ApiImplicitParam(name = "state", dataType = "Integer", value = "机构状态 1启动 2停用"),
+            @ApiImplicitParam(name = "startDate", dataType = "String", value = "开始时间"),
+            @ApiImplicitParam(name = "endDate", dataType = "String", value = "结束时间"),
+            @ApiImplicitParam(name = "page", dataType = "Integer", value = "页数"),
+            @ApiImplicitParam(name = "rows", dataType = "Integer", value = "每页数量"),
+    })
+    @ApiOperation("分页查询")
+    @PostMapping(value = "/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('tenantInfo/queryPage')")
+    public Object queryPage(@RequestBody Map<String, Object> param) {
+        return succeed(tenantInfoService.queryPage(param));
+    }
+
+}