Selaa lähdekoodia

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into feature/1101-appversion

yuanliang 1 vuosi sitten
vanhempi
commit
de2f5f6236
100 muutettua tiedostoa jossa 1349 lisäystä ja 3193 poistoa
  1. 0 37
      codegen/pom.xml
  2. 0 63
      codegen/src/main/java/com/yonge/crud/CodegenApplication.java
  3. 0 111
      codegen/src/main/java/com/yonge/crud/core/Configuration.java
  4. 0 144
      codegen/src/main/java/com/yonge/crud/core/CrudSession.java
  5. 0 60
      codegen/src/main/java/com/yonge/crud/core/CrudSessionFactory.java
  6. 0 93
      codegen/src/main/java/com/yonge/crud/core/FreemarkerTemplateEngine.java
  7. 0 84
      codegen/src/main/java/com/yonge/crud/core/GenerateConfiguration.java
  8. 0 59
      codegen/src/main/java/com/yonge/crud/core/db/ConnectionFactory.java
  9. 0 117
      codegen/src/main/java/com/yonge/crud/core/db/DatabaseIntrospector.java
  10. 0 127
      codegen/src/main/java/com/yonge/crud/core/db/model/Column.java
  11. 0 86
      codegen/src/main/java/com/yonge/crud/core/db/model/Table.java
  12. 0 234
      codegen/src/main/java/com/yonge/crud/core/generator/ModuleGenerateIntrospector.java
  13. 0 41
      codegen/src/main/java/com/yonge/crud/core/generator/module/JavaFileGenerator.java
  14. 0 129
      codegen/src/main/java/com/yonge/crud/core/generator/module/SpringGenerator.java
  15. 0 82
      codegen/src/main/java/com/yonge/crud/core/generator/module/SqlMapConfigGenerator.java
  16. 0 160
      codegen/src/main/java/com/yonge/crud/core/util/JavaBeansUtil.java
  17. 0 169
      codegen/src/main/java/com/yonge/crud/core/util/XmlUtil.java
  18. 0 17
      codegen/src/main/resources/generateConfigration.xml
  19. 0 10
      codegen/src/main/resources/template/dao.ftl
  20. 0 44
      codegen/src/main/resources/template/pojo.ftl
  21. 0 9
      codegen/src/main/resources/template/service.ftl
  22. 0 22
      codegen/src/main/resources/template/service_impl.ftl
  23. 0 36
      codegen/src/main/resources/template/spring.ftl
  24. 0 64
      codegen/src/main/resources/template/sqlmap.ftl
  25. 0 11
      codegen/src/main/resources/template/sqlmapConfig.ftl
  26. 2 1
      mec-application/src/main/java/com/ym/mec/config/ResourceServerConfig.java
  27. 69 15
      mec-application/src/main/java/com/ym/mec/student/controller/ActivityController.java
  28. 1 1
      mec-application/src/main/java/com/ym/mec/student/controller/ChildrenDayDegreeDetailController.java
  29. 5 2
      mec-application/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java
  30. 18 0
      mec-application/src/main/java/com/ym/mec/student/controller/StudentController.java
  31. 1 1
      mec-application/src/main/java/com/ym/mec/teacher/controller/VipGroupCategoryController.java
  32. 7 7
      mec-application/src/main/java/com/ym/mec/web/controller/ExportController.java
  33. 2 2
      mec-application/src/main/java/com/ym/mec/web/controller/HfMerchantConfigController.java
  34. 1 1
      mec-application/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java
  35. 1 1
      mec-application/src/main/java/com/ym/mec/web/controller/StudentStatisticsController.java
  36. 348 0
      mec-application/src/main/java/com/ym/mec/web/controller/open/OpenDouble11StaticsController.java
  37. 7 0
      mec-application/src/main/java/com/ym/mec/web/controller/open/OpenSysConfigController.java
  38. 11 11
      mec-application/src/main/resources/exportColumnMapper.ini
  39. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java
  40. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/IndexBaseMonthDataDao.java
  41. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java
  42. 14 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java
  43. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ActivityCourseDetailDto.java
  44. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ActivityUserMapperSumDto.java
  45. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/BasicUserDto.java
  46. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseReviewDto.java
  47. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DegreePayDto.java
  48. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DoubleEleven2021ActivityDto.java
  49. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DoubleEleven2021Dto.java
  50. 23 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterUserDto.java
  51. 4 23
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SporadicPayDto.java
  52. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java
  53. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java
  54. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleReview.java
  55. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationDegreeCourseFee.java
  56. 3 218
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java
  57. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupCategory.java
  58. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ActivityCourseType.java
  59. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportEnum.java
  60. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportTypeEnum.java
  61. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java
  62. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java
  63. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java
  64. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/DoubleEleven2021QueryInfo.java
  65. 2 40
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/SporadicChargeInfoQueryInfo.java
  66. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java
  67. 246 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/Double11StaticWrapper.java
  68. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/LiveGroupWrapper.java
  69. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/SporadicChargeInfoService.java
  70. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SysConfigService.java
  71. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ActivityUserMapperServiceImpl.java
  72. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ExportServiceImpl.java
  73. 10 14
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupServiceImpl.java
  74. 0 10
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankSettingServiceImpl.java
  75. 7 6
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  76. 15 7
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java
  77. 37 32
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  78. 6 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysConfigServiceImpl.java
  79. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysMessageServiceImpl.java
  80. 7 5
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java
  81. 191 72
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  82. 1 1
      mec-biz/src/main/resources/config/mybatis/ActivityUserMapperMapper.xml
  83. 7 25
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  84. 1 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleStatisticsMapper.xml
  85. 11 13
      mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml
  86. 4 2
      mec-biz/src/main/resources/config/mybatis/LiveGroupPlusMapper.xml
  87. 10 6
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  88. 232 0
      mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml
  89. 1 1
      mec-biz/src/main/resources/config/mybatis/StudentStatisticsMapper.xml
  90. 2 2
      mec-client-api/src/main/java/com/ym/mec/web/WebFeignService.java
  91. 1 1
      mec-client-api/src/main/java/com/ym/mec/web/fallback/WebFeignServiceFallback.java
  92. 0 120
      mec-education/pom.xml
  93. 0 37
      mec-education/src/main/java/com/ym/mec/education/EducationApplication.java
  94. 0 20
      mec-education/src/main/java/com/ym/mec/education/base/BaseQuery.java
  95. 0 61
      mec-education/src/main/java/com/ym/mec/education/base/BaseResponse.java
  96. 0 201
      mec-education/src/main/java/com/ym/mec/education/base/PageResponse.java
  97. 0 100
      mec-education/src/main/java/com/ym/mec/education/base/Response.java
  98. 0 28
      mec-education/src/main/java/com/ym/mec/education/config/ImageVerifyCodeConfig.java
  99. 0 22
      mec-education/src/main/java/com/ym/mec/education/config/MybatisPlusConfig.java
  100. 0 36
      mec-education/src/main/java/com/ym/mec/education/config/ResourceServerConfig.java

+ 0 - 37
codegen/pom.xml

@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<project
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>com.ym</groupId>
-		<artifactId>mec</artifactId>
-		<version>1.0</version>
-	</parent>
-
-	<groupId>com.yonge</groupId>
-	<artifactId>codegen</artifactId>
-	<name>codegen</name>
-	<url>http://maven.apache.org</url>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-
-	<dependencies>
-		<dependency>
-			<groupId>org.freemarker</groupId>
-			<artifactId>freemarker</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>mysql</groupId>
-			<artifactId>mysql-connector-java</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>com.ym</groupId>
-			<artifactId>mec-util</artifactId>
-		</dependency>
-	</dependencies>
-</project>

+ 0 - 63
codegen/src/main/java/com/yonge/crud/CodegenApplication.java

@@ -1,63 +0,0 @@
-package com.yonge.crud;
-
-import java.util.List;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
-import javax.xml.transform.stream.StreamSource;
-
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-
-import com.yonge.crud.core.Configuration;
-import com.yonge.crud.core.CrudSession;
-import com.yonge.crud.core.CrudSessionFactory;
-import com.yonge.crud.core.GenerateConfiguration;
-import com.yonge.crud.core.db.model.Table;
-
-@SpringBootApplication
-public class CodegenApplication {
-
-	public static void main(String[] args) throws JAXBException {
-		//SpringApplication.run(CodegenApplication.class, args);
-
-		/*
-		 * Configuration config = new Configuration("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.10.134:1521:orcl", "margin_gy",
-		 * "margin_gy", null, "margin_gy");
-		 */
-
-		// "src/generateConfigration.xml"
-		GenerateConfiguration genConfig = toObject("codegen/src/main/resources/generateConfigration.xml", GenerateConfiguration.class);
-
-		Configuration config = genConfig.getDbConfiguration();
-
-		CrudSessionFactory sessionFactory = config.buildCrudSessionFactory();
-		CrudSession session = sessionFactory.openSession();
-		List<Table> tables = session.getTables();
-		String srcBase = genConfig.getSrcBase();
-		String pojoPackageName = genConfig.getPojoPackageName();
-		String daoPackageName = genConfig.getDaoPackageName();
-		String servicePackageName = genConfig.getServicePackageName();
-		String sqlmapPackageName = genConfig.getSqlmapPackageName();
-		String sqlmapConfigPackageName = genConfig.getSqlmapConfigPackageName();
-		for (Table table : tables) {
-			try {
-				session.reverse(table, srcBase, pojoPackageName, sqlmapPackageName, daoPackageName, servicePackageName);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-		// 生成sqlmapConfig
-		session.generateSqlmapConfig(tables, srcBase, sqlmapConfigPackageName, sqlmapPackageName);
-		session.closeSession();
-	}
-
-	public static <T> T toObject(String systemId, Class<T> clazz) throws JAXBException {
-		JAXBContext jc = JAXBContext.newInstance(clazz);
-		Unmarshaller unmarshaller = jc.createUnmarshaller();
-		StreamSource xml = new StreamSource(systemId);
-		JAXBElement<T> je = unmarshaller.unmarshal(xml, clazz);
-		return je.getValue();
-	}
-}

+ 0 - 111
codegen/src/main/java/com/yonge/crud/core/Configuration.java

@@ -1,111 +0,0 @@
-package com.yonge.crud.core;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Configuration {
-
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(Configuration.class);
-
-	private String driverClass;
-
-	private String url;
-
-	private String username;
-
-	private String password;
-
-	private String catalog;
-
-	private String schema;
-
-	public Configuration() {
-		// TODO Auto-generated constructor stub
-	}
-
-	public Configuration(String driverClass, String url, String username,
-			String password, String catalog, String schema) {
-		if (StringUtils.isBlank(driverClass)) {
-			LOGGER.warn("driverClass不能为空");
-			return;
-		}
-		if (StringUtils.isBlank(url)) {
-			LOGGER.warn("url不能为空");
-			return;
-		}
-		if (StringUtils.isBlank(username)) {
-			LOGGER.warn("username不能为空");
-			return;
-		}
-		if (StringUtils.isBlank(password)) {
-			LOGGER.warn("password不能为空");
-			return;
-		}
-		if (StringUtils.isBlank(schema)) {
-			LOGGER.warn("schema不能为空");
-			return;
-		}
-		this.driverClass = driverClass;
-		this.url = url;
-		this.username = username;
-		this.password = password;
-		if (catalog != null) {
-			this.catalog = catalog.toUpperCase();
-		}
-		this.schema = schema.toUpperCase();
-	}
-
-	public String getDriverClass() {
-		return driverClass;
-	}
-
-	public void setDriverClass(String driverClass) {
-		this.driverClass = driverClass;
-	}
-
-	public String getUrl() {
-		return url;
-	}
-
-	public void setUrl(String url) {
-		this.url = url;
-	}
-
-	public String getUsername() {
-		return username;
-	}
-
-	public void setUsername(String username) {
-		this.username = username;
-	}
-
-	public String getPassword() {
-		return password;
-	}
-
-	public void setPassword(String password) {
-		this.password = password;
-	}
-
-	public String getCatalog() {
-		return catalog;
-	}
-
-	public void setCatalog(String catalog) {
-		this.catalog = catalog;
-	}
-
-	public String getSchema() {
-		return schema;
-	}
-
-	public void setSchema(String schema) {
-		this.schema = schema;
-	}
-
-	public CrudSessionFactory buildCrudSessionFactory() {
-		return new CrudSessionFactory(this);
-	}
-}

+ 0 - 144
codegen/src/main/java/com/yonge/crud/core/CrudSession.java

@@ -1,144 +0,0 @@
-package com.yonge.crud.core;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.yonge.crud.core.db.DatabaseIntrospector;
-import com.yonge.crud.core.db.model.Table;
-import com.yonge.crud.core.generator.ModuleGenerateIntrospector;
-
-public class CrudSession {
-
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(CrudSession.class);
-
-	private Connection connection;
-
-	private DatabaseMetaData dbMetaData;
-
-	private String catalog;
-
-	private String schema;
-
-	private CrudSessionFactory sessionFactory;
-
-	CrudSession(Connection connection, String catalog, String schema,
-			CrudSessionFactory sessionFactory) {
-		if (connection == null) {
-			LOGGER.warn("没有获取连接,不能打开session");
-			return;
-		}
-		this.connection = connection;
-		this.catalog = catalog;
-		this.schema = schema;
-		this.sessionFactory = sessionFactory;
-		try {
-			this.dbMetaData = connection.getMetaData();
-		} catch (SQLException e) {
-			LOGGER.warn("获取数据库连接的元数据失败", e);
-		}
-	}
-
-	/**
-	 * 关闭会话
-	 */
-	public void closeSession() {
-		if (connection != null) {
-			try {
-				connection.close();
-			} catch (SQLException e) {
-				LOGGER.warn("数据库连接关闭失败", e);
-			}
-		}
-	}
-
-	/**
-	 * 获取工厂信息
-	 * 
-	 * @return
-	 */
-	public CrudSessionFactory getFactory() {
-		return sessionFactory;
-	}
-
-	/**
-	 * 获取所有表信息
-	 * 
-	 * @return
-	 */
-	public List<Table> getTables() {
-		DatabaseIntrospector dbIntrospector = new DatabaseIntrospector(
-				dbMetaData);
-		return dbIntrospector.getTables(catalog, schema);
-	}
-
-	/**
-	 * 数据库表的反向工程
-	 * 
-	 * @param table
-	 *            表对象
-	 * @param srcBase
-	 *            生成目录的根路径
-	 * @param pojoPackageName
-	 *            存放pojo的包名称
-	 * @param sqlmapPackageName
-	 *            存放sqlmap的包名称
-	 * @param daoPackageName
-	 *            存放dao的包名称
-	 */
-	public void reverse(Table table, String srcBase, String pojoPackageName,
-			String sqlmapPackageName, String daoPackageName,
-			String servicePackageName) {
-		ModuleGenerateIntrospector
-				.generatePOJO(table, srcBase, pojoPackageName);
-		ModuleGenerateIntrospector.generatSqlmap(this.getFactory()
-				.getMetadata().getDriverClass(), table, srcBase,
-				sqlmapPackageName, daoPackageName);
-		ModuleGenerateIntrospector.generateDaoAndService(table, srcBase,
-				daoPackageName, servicePackageName);
-	}
-
-	/**
-	 * 生成spring的配置文件
-	 * 
-	 * @param tables
-	 *            需要生成spring配置文件对应的表
-	 * @param srcBase
-	 *            根目录
-	 * @param packageName
-	 *            配置文件的包路径
-	 * @param daoPackageName
-	 *            dao的包路径
-	 * @param servicePackageName
-	 *            service的包路径
-	 */
-	public void generateSpringConfig(List<Table> tables, String srcBase,
-			String packageName, String daoPackageName, String servicePackageName) {
-		ModuleGenerateIntrospector.generateSpring(tables, srcBase, packageName,
-				daoPackageName, servicePackageName);
-	}
-
-	/**
-	 * 生成sqlmapConfig文件
-	 * 
-	 * @param tables
-	 *            相关表信息
-	 * @param srcBase
-	 *            生成目标的根目录
-	 * @param packageName
-	 *            sqlmapConfig文件的包路径
-	 * @param sqlmapPackageName
-	 *            sqlmap文件的包路径
-	 */
-	public void generateSqlmapConfig(List<Table> tables, String srcBase,
-			String packageName, String sqlmapPackageName) {
-		ModuleGenerateIntrospector.generateSqlMapConfig(tables, srcBase,
-				sqlmapPackageName, packageName);
-	}
-
-}

+ 0 - 60
codegen/src/main/java/com/yonge/crud/core/CrudSessionFactory.java

@@ -1,60 +0,0 @@
-package com.yonge.crud.core;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.yonge.crud.core.db.ConnectionFactory;
-
-public class CrudSessionFactory {
-
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(CrudSessionFactory.class);
-
-	private CrudSession session;
-
-	private Connection connection;
-
-	private String catalog;
-
-	private String schema;
-
-	private Configuration config;
-
-	CrudSessionFactory(Configuration config) {
-		LOGGER.debug("数据库的连接信息:url={} user={} password={}", config.getUrl(),
-				config.getUsername(), config.getPassword());
-		try {
-			this.config = config;
-			this.catalog = config.getCatalog();
-			this.schema = config.getSchema();
-			connection = ConnectionFactory.getInstance().getConnection(
-					config.getDriverClass(), config.getUrl(),
-					config.getUsername(), config.getPassword());
-			session = new CrudSession(connection, catalog, schema, this);
-		} catch (SQLException e) {
-			LOGGER.warn("数据库连接创建失败", e);
-		}
-	}
-
-	/**
-	 * 开启一个会话
-	 */
-	public synchronized CrudSession openSession() {
-		if (session == null) {
-			session = new CrudSession(connection, catalog, schema, this);
-		}
-		return session;
-	}
-
-	/**
-	 * 获取元数据
-	 * 
-	 * @return
-	 */
-	public Configuration getMetadata() {
-		return config;
-	}
-}

+ 0 - 93
codegen/src/main/java/com/yonge/crud/core/FreemarkerTemplateEngine.java

@@ -1,93 +0,0 @@
-package com.yonge.crud.core;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import freemarker.template.Configuration;
-import freemarker.template.DefaultObjectWrapper;
-import freemarker.template.Template;
-
-public class FreemarkerTemplateEngine {
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(FreemarkerTemplateEngine.class);
-
-	private static Configuration cfg;
-
-	static {
-		cfg = new Configuration();
-		cfg.setOutputEncoding("UTF-8");
-		cfg.setClassForTemplateLoading(FreemarkerTemplateEngine.class,
-				"/template/");
-		cfg.setObjectWrapper(new DefaultObjectWrapper());
-	}
-
-	public void render(Map<String, Object> data, String templateFile,
-			File outputFile) {
-		FileWriter fw = null;
-		BufferedWriter bw = null;
-		try {
-			Template temp = cfg.getTemplate(templateFile);
-			fw = new FileWriter(outputFile);
-			bw = new BufferedWriter(fw);
-			temp.process(data, bw);
-			bw.flush();
-		} catch (Exception e) {
-			LOGGER.warn(String.format("将数据%1$s通过FreeMarker模板%2$s生成文件%3$s失败",
-					data, templateFile, outputFile), e);
-		} finally {
-			if (bw != null) {
-				try {
-					bw.close();
-				} catch (IOException e) {
-					LOGGER.warn("BufferedWriter关闭异常");
-				}
-			}
-			if (fw != null) {
-				try {
-					fw.close();
-				} catch (IOException e) {
-					LOGGER.warn("FileWriter关闭异常");
-				}
-			}
-		}
-	}
-
-	public void render(Map<String, Object> data, String templateFile,
-			String outputFile) {
-		FileWriter fw = null;
-		BufferedWriter bw = null;
-		try {
-			Template temp = cfg.getTemplate(templateFile);
-			File file = new File(outputFile);
-			fw = new FileWriter(file);
-			bw = new BufferedWriter(fw);
-			temp.process(data, bw);
-			bw.flush();
-		} catch (Exception e) {
-			LOGGER.warn(String.format("将数据%1$s通过FreeMarker模板%2$s生成文件%3$s失败",
-					data, templateFile, outputFile), e);
-		} finally {
-			if (bw != null) {
-				try {
-					bw.close();
-				} catch (IOException e) {
-					LOGGER.warn("BufferedWriter关闭异常");
-				}
-			}
-			if (fw != null) {
-				try {
-					fw.close();
-				} catch (IOException e) {
-					LOGGER.warn("FileWriter关闭异常");
-				}
-			}
-		}
-	}
-
-}

+ 0 - 84
codegen/src/main/java/com/yonge/crud/core/GenerateConfiguration.java

@@ -1,84 +0,0 @@
-package com.yonge.crud.core;
-
-public class GenerateConfiguration {
-
-	private Configuration dbConfiguration;
-
-	private String srcBase;
-
-	private String pojoPackageName;
-
-	private String daoPackageName;
-
-	private String servicePackageName;
-
-	private String sqlmapPackageName;
-
-	private String sqlmapConfigPackageName;
-
-	private String springConfigPackageName;
-
-	public Configuration getDbConfiguration() {
-		return dbConfiguration;
-	}
-
-	public void setDbConfiguration(Configuration dbConfiguration) {
-		this.dbConfiguration = dbConfiguration;
-	}
-
-	public String getSrcBase() {
-		return srcBase;
-	}
-
-	public void setSrcBase(String srcBase) {
-		this.srcBase = srcBase;
-	}
-
-	public String getPojoPackageName() {
-		return pojoPackageName;
-	}
-
-	public void setPojoPackageName(String pojoPackageName) {
-		this.pojoPackageName = pojoPackageName;
-	}
-
-	public String getDaoPackageName() {
-		return daoPackageName;
-	}
-
-	public void setDaoPackageName(String daoPackageName) {
-		this.daoPackageName = daoPackageName;
-	}
-
-	public String getServicePackageName() {
-		return servicePackageName;
-	}
-
-	public void setServicePackageName(String servicePackageName) {
-		this.servicePackageName = servicePackageName;
-	}
-
-	public String getSqlmapPackageName() {
-		return sqlmapPackageName;
-	}
-
-	public void setSqlmapPackageName(String sqlmapPackageName) {
-		this.sqlmapPackageName = sqlmapPackageName;
-	}
-
-	public String getSqlmapConfigPackageName() {
-		return sqlmapConfigPackageName;
-	}
-
-	public void setSqlmapConfigPackageName(String sqlmapConfigPackageName) {
-		this.sqlmapConfigPackageName = sqlmapConfigPackageName;
-	}
-
-	public String getSpringConfigPackageName() {
-		return springConfigPackageName;
-	}
-
-	public void setSpringConfigPackageName(String springConfigPackageName) {
-		this.springConfigPackageName = springConfigPackageName;
-	}
-}

+ 0 - 59
codegen/src/main/java/com/yonge/crud/core/db/ConnectionFactory.java

@@ -1,59 +0,0 @@
-package com.yonge.crud.core.db;
-
-import java.sql.Connection;
-import java.sql.Driver;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import org.apache.commons.lang3.StringUtils;
-
-public class ConnectionFactory {
-
-	private static ConnectionFactory instance = new ConnectionFactory();
-
-	private static final String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";
-
-	public static ConnectionFactory getInstance() {
-		return instance;
-	}
-
-	private ConnectionFactory() {
-		super();
-	}
-
-	public Connection getConnection(String driverClass, String url,
-			String username, String password) throws SQLException {
-		Driver driver = getDriver(driverClass);
-
-		Properties props = new Properties();
-
-		props.setProperty("user", username);
-
-		props.setProperty("password", password);
-
-		// 只有oracle才需要这个参数
-		if (StringUtils.equals(driverClass, ORACLE_DRIVER)) {
-			props.setProperty("remarksReporting", "true");
-		}
-
-		Connection conn = driver.connect(url, props);
-
-		if (conn == null) {
-			throw new SQLException("连接获取失败");
-		}
-
-		return conn;
-	}
-
-	private Driver getDriver(String driverClass) {
-		Driver driver = null;
-		try {
-			Class<?> clazz = Class.forName(driverClass);
-			driver = (Driver) clazz.newInstance();
-		} catch (Exception e) {
-			throw new RuntimeException("类加载器加载driver失败", e);
-		}
-
-		return driver;
-	}
-}

+ 0 - 117
codegen/src/main/java/com/yonge/crud/core/db/DatabaseIntrospector.java

@@ -1,117 +0,0 @@
-package com.yonge.crud.core.db;
-
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.yonge.crud.core.db.model.Column;
-import com.yonge.crud.core.db.model.Table;
-import com.yonge.crud.core.util.JavaBeansUtil;
-
-public class DatabaseIntrospector {
-	private static final Logger LOGGER = LoggerFactory.getLogger(DatabaseIntrospector.class);
-
-	private DatabaseMetaData dbMetaData;
-
-	public DatabaseIntrospector(DatabaseMetaData dbMetaData) {
-		this.dbMetaData = dbMetaData;
-	}
-
-	public List<Table> getTables(String catalog, String schema) {
-		List<Table> tables = new ArrayList<Table>();
-		if (dbMetaData == null) {
-			LOGGER.warn("DatabaseMetaData对象不能为空");
-			return tables;
-		}
-		ResultSet resultSet = null;
-		try {
-			resultSet = dbMetaData.getTables(catalog, schema, null, new String[] { "TABLE" });
-			Table table = null;
-			while (resultSet.next()) {
-				table = new Table();
-				table.setName(resultSet.getString("TABLE_NAME"));
-				table.setCatalog(resultSet.getString("TABLE_CAT"));
-				table.setRemarks(resultSet.getString("REMARKS"));
-				table.setSchema(resultSet.getString("TABLE_SCHEM"));
-				table.setClassName(JavaBeansUtil.getCamelCaseString(table.getName(), true));
-
-				table.setColumns(getColumns(table));
-				tables.add(table);
-			}
-		} catch (SQLException e) {
-			LOGGER.warn("获取数据库表失败", e);
-		} finally {
-			if (resultSet != null) {
-				try {
-					resultSet.close();
-				} catch (SQLException e) {
-					LOGGER.warn("关闭ResultSet对象出现异常", e);
-				}
-			}
-		}
-		return tables;
-	}
-
-	private List<Column> getColumns(Table table) {
-		List<Column> columns = new ArrayList<Column>();
-		if (table == null) {
-			LOGGER.warn("参数不能为空");
-			return columns;
-		}
-		String tableName = table.getName();
-		String schema = table.getSchema();
-		String name = tableName.toUpperCase();
-		if (dbMetaData == null) {
-			LOGGER.warn("DatabaseMetaData对象不能为空");
-		}
-		ResultSet resultSet = null;
-		Column column = null;
-		try {
-			resultSet = dbMetaData.getPrimaryKeys(table.getCatalog(), schema, tableName);
-			List<String> keyColumns = new ArrayList<String>();
-			while (resultSet.next()) {
-				keyColumns.add(resultSet.getString("COLUMN_NAME"));
-			}
-
-			resultSet = dbMetaData.getColumns(table.getCatalog(), schema, tableName, null);
-			while (resultSet.next()) {
-				column = new Column();
-				// 获得字段名称
-				column.setFieldName(resultSet.getString("COLUMN_NAME"));
-				// 获得字段类型名称
-				column.setJdbcTypeName(resultSet.getString("TYPE_NAME"));
-				// 数据类型
-				column.setDataType(resultSet.getInt("DATA_TYPE"));
-				// 获得字段大小
-				column.setLength(resultSet.getInt("COLUMN_SIZE"));
-				column.setNullable((resultSet.getInt("NULLABLE") == DatabaseMetaData.columnNullable));
-				column.setScale(resultSet.getInt("DECIMAL_DIGITS"));
-				column.setRemarks(resultSet.getString("REMARKS"));
-				for (String key : keyColumns) {
-					if (StringUtils.equalsIgnoreCase(key, column.getFieldName())) {
-						column.setIsPrimaryKey(true);
-					}
-				}
-				columns.add(column);
-			}
-		} catch (SQLException e) {
-			LOGGER.warn("在" + schema + "中获取" + name + "表字段出现异常", e);
-		} finally {
-			if (resultSet != null) {
-				try {
-					resultSet.close();
-				} catch (SQLException e) {
-					LOGGER.warn("关闭ResultSet对象出现异常", e);
-				}
-			}
-		}
-		return columns;
-	}
-
-}

+ 0 - 127
codegen/src/main/java/com/yonge/crud/core/db/model/Column.java

@@ -1,127 +0,0 @@
-package com.yonge.crud.core.db.model;
-
-public class Column {
-
-	/** 字段名称 */
-	private String fieldName;
-
-	/** 是否是主键 */
-	private boolean isPrimaryKey;
-
-	/** 属性名称 */
-	private String propertyName;
-
-	/** JDBC类型 名称 */
-	private String jdbcTypeName;
-
-	/** java类型 */
-	private String javaTypeName;
-
-	/** 数据类型 */
-	private int dataType;
-
-	/** 字段长度 */
-	private int length;
-
-	/** 是否可以为空 */
-	private boolean nullable;
-
-	private int scale;
-
-	/** 描述 */
-	private String remarks;
-
-	public String getFieldName() {
-		return fieldName;
-	}
-
-	public void setFieldName(String fieldName) {
-		this.fieldName = fieldName;
-	}
-
-	public boolean isPrimaryKey() {
-		return isPrimaryKey;
-	}
-
-	public void setIsPrimaryKey(boolean isPrimaryKey) {
-		this.isPrimaryKey = isPrimaryKey;
-	}
-
-	public String getPropertyName() {
-		return propertyName;
-	}
-
-	public void setPropertyName(String propertyName) {
-		this.propertyName = propertyName;
-	}
-
-	public String getJdbcTypeName() {
-		return jdbcTypeName;
-	}
-
-	public void setJdbcTypeName(String jdbcTypeName) {
-		this.jdbcTypeName = jdbcTypeName;
-	}
-
-	public String getJavaTypeName() {
-		return javaTypeName;
-	}
-
-	public void setJavaTypeName(String javaTypeName) {
-		this.javaTypeName = javaTypeName;
-	}
-
-	public int getDataType() {
-		return dataType;
-	}
-
-	public void setDataType(int dataType) {
-		this.dataType = dataType;
-	}
-
-	public int getLength() {
-		return length;
-	}
-
-	public void setLength(int length) {
-		this.length = length;
-	}
-
-	public boolean isNullable() {
-		return nullable;
-	}
-
-	public void setNullable(boolean nullable) {
-		this.nullable = nullable;
-	}
-
-	public int getScale() {
-		return scale;
-	}
-
-	public void setScale(int scale) {
-		this.scale = scale;
-	}
-
-	public String getRemarks() {
-		return remarks;
-	}
-
-	public void setRemarks(String remarks) {
-		this.remarks = remarks;
-	}
-
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("fieldName = " + fieldName)
-				.append(" isPrimaryKey = " + isPrimaryKey)
-				.append(" propertyName = " + propertyName)
-				.append(" jdbcTypeName = " + jdbcTypeName)
-				.append(" javaTypeName = " + javaTypeName)
-				.append(" dataType = " + dataType)
-				.append(" length = " + length)
-				.append(" nullable = " + nullable).append(" scale = " + scale)
-				.append(" remarks = " + remarks);
-		return sb.toString();
-	}
-}

+ 0 - 86
codegen/src/main/java/com/yonge/crud/core/db/model/Table.java

@@ -1,86 +0,0 @@
-package com.yonge.crud.core.db.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Table {
-
-	private String name;
-
-	private String schema;
-
-	private String catalog;
-
-	private String remarks;
-
-	private String className;
-
-	private String packageName;
-
-	private List<Column> columns = new ArrayList<Column>();
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public String getSchema() {
-		return schema;
-	}
-
-	public void setSchema(String schema) {
-		this.schema = schema;
-	}
-
-	public String getCatalog() {
-		return catalog;
-	}
-
-	public void setCatalog(String catalog) {
-		this.catalog = catalog;
-	}
-
-	public String getRemarks() {
-		return remarks;
-	}
-
-	public void setRemarks(String remarks) {
-		this.remarks = remarks;
-	}
-
-	public List<Column> getColumns() {
-		return columns;
-	}
-
-	public void setColumns(List<Column> columns) {
-		this.columns = columns;
-	}
-
-	public String getClassName() {
-		return className;
-	}
-
-	public void setClassName(String className) {
-		this.className = className;
-	}
-
-	public String getPackageName() {
-		return packageName;
-	}
-
-	public void setPackageName(String packageName) {
-		this.packageName = packageName;
-	}
-
-	public String toString() {
-		StringBuilder sb = new StringBuilder();
-		sb.append("name = " + name).append(" catalog = " + catalog)
-				.append(" schema = " + schema).append(" remarks = " + remarks)
-				.append(" packageName = " + packageName)
-				.append(" className = " + className);
-		return sb.toString();
-	}
-}

+ 0 - 234
codegen/src/main/java/com/yonge/crud/core/generator/ModuleGenerateIntrospector.java

@@ -1,234 +0,0 @@
-package com.yonge.crud.core.generator;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.commons.lang3.StringUtils;
-
-import com.yonge.crud.core.db.model.Column;
-import com.yonge.crud.core.db.model.Table;
-import com.yonge.crud.core.generator.module.JavaFileGenerator;
-import com.yonge.crud.core.generator.module.SpringGenerator;
-import com.yonge.crud.core.generator.module.SqlMapConfigGenerator;
-import com.yonge.crud.core.util.JavaBeansUtil;
-
-public class ModuleGenerateIntrospector {
-
-	private static final String DAO_TEMPLATE_NAME = "dao.ftl";
-
-	private static final String POJO_TEMPLATE_NAME = "pojo.ftl";
-
-	private static final String SERVICE_IMPL_TEMPLATE_NAME = "service_impl.ftl";
-
-	private static final String SERVICE_TEMPLATE_NAME = "service.ftl";
-
-	private static final String SQLMAP_TEMPLATE_NAME = "sqlmap.ftl";
-
-	private static final String SQLMAPCONFIG_TEMPLATE_NAME = "sqlmapConfig.ftl";
-
-	private static final String SPRING_TEMPLATE = "spring.ftl";
-
-	private static final String POJO_FILE_SUFFIX = ".java";
-
-	private static final String SQLMAP_FILE_PREFIX = "SqlMap_";
-
-	private static final String XML_FILE_SUFFIX = ".xml";
-
-	private static final String DAO_FILE_SUFFIX = "Dao.java";
-
-	private static final String SERVICE_FILE_SUFFIX = "Service.java";
-
-	private static final String SERVICE_IMPL_FILE_SUFFIX = "ServiceImpl.java";
-
-	private static final String SQLMAP_CONFIG_FILE = "SqlMapConfig.xml";
-
-	private static final String SPRING_CONFIG_FILE = "spring-crud.xml";
-
-	public static void generatePOJO(Table table, String srcBase,
-			String packageName) {
-		List<Column> columns = table.getColumns();
-		for (Column col : columns) {
-			// 转换类型
-			col.setJavaTypeName(JavaBeansUtil.fromJdbcToJava(col));
-			// 转换属性名称
-			col.setPropertyName(JavaBeansUtil.getCamelCaseString(
-					col.getFieldName(), false));
-		}
-		table.setColumns(columns);
-		table.setPackageName(packageName);
-		Map<String, Object> params = new HashMap<String, Object>();
-		params.put("props", columns);
-		params.put("table", table);
-		// 生成pojo
-		JavaFileGenerator entiryGenerator = new JavaFileGenerator();
-		entiryGenerator.generate(params, srcBase, packageName,
-				table.getClassName() + POJO_FILE_SUFFIX, POJO_TEMPLATE_NAME);
-	}
-
-	public static void generatSqlmap(String driverClass, Table table,
-			String srcBase, String sqlMapPackageName, String daoPackageName) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		String className = table.getClassName();
-		params.put("namespace", daoPackageName + "." + className + "Dao");
-		params.put("fullClassName", table.getPackageName() + "." + className);
-		params.put("alias", className);
-		params.put("columns", table.getColumns());
-
-		String tableName = table.getName();
-		params.put("tableName", tableName);
-
-		// 构建sql语句
-		String fields = "", properties = "", criteria = "", orderbyStr = "";
-		Map<String, String> fieldPropMapping = new HashMap<String, String>();
-		int keys = 0;
-		for (Column col : table.getColumns()) {
-			fields += (col.getFieldName() + ",");
-			properties += ("#{" + col.getPropertyName() + "},");
-			fieldPropMapping.put(col.getFieldName(), col.getPropertyName());
-			if (col.isPrimaryKey()) {
-				criteria += (col.getFieldName() + " = #{"
-						+ col.getPropertyName() + "} AND ");
-				++keys;
-				orderbyStr += (col.getFieldName() + ",");
-			}
-		}
-		if (keys > 1) {
-			params.put("paramType", Map.class.getName());
-		}
-		// 清除最后一个"AND"
-		if (StringUtils.isNotBlank(criteria)) {
-			criteria = criteria.substring(0, criteria.length() - 4);
-		}
-		// 删除最后一个“,”
-		fields = fields.substring(0, fields.length() - 1);
-		properties = properties.substring(0, properties.length() - 1);
-
-		String queryBaseSQL = "SELECT * FROM " + tableName;
-		// 全查询
-		String queryFullSQL = queryBaseSQL;
-		if (StringUtils.isNotBlank(orderbyStr)) {
-			orderbyStr = orderbyStr.substring(0, orderbyStr.length() - 1);
-			queryFullSQL += " ORDER BY " + orderbyStr;
-		}
-		params.put("queryFullSQL", queryFullSQL);
-		// 插入
-		String insertSQL = "INSERT INTO " + tableName + " (" + fields
-				+ ") VALUES(" + properties + ")";
-		params.put("insertSQL", insertSQL);
-		if (StringUtils.isNotBlank(criteria)) {
-			// 修改
-			String updateSQL = "UPDATE " + tableName + " <set>\n<if test=\"";
-			for (Entry<String, String> entry : fieldPropMapping.entrySet()) {
-				updateSQL += entry.getValue() + " != null\">\n" + (entry.getKey() + " = #{" + entry.getValue() + "},\n</if>\n<if test=\"");
-			}
-			// 删除最后一个“,”
-			updateSQL = updateSQL.substring(0, updateSQL.length() - 10);
-			updateSQL += ("</set> WHERE " + criteria);
-			params.put("updateSQL", updateSQL);
-			// 根据主键查询
-			String querySingleSQL = queryBaseSQL + " WHERE " + criteria;
-			params.put("querySingleSQL", querySingleSQL);
-			// 根据主键删除
-			String deleteSQL = "DELETE FROM " + tableName + " WHERE "
-					+ criteria;
-			params.put("deleteSQL", deleteSQL);
-		}
-		// 分页查询语句
-		String queryPage = "";
-
-		if (StringUtils.equals(driverClass, "com.mysql.jdbc.Driver")) {
-			// mysql
-			queryPage = queryFullSQL + " <include refid=\"global.limit\"/>";
-		} else if (StringUtils.equals(driverClass,
-				"oracle.jdbc.driver.OracleDriver")) {
-			// oracle
-			queryPage = "SELECT * FROM (SELECT A.*,ROWNUM FROM " + tableName
-					+ " A WHERE ROWNUM <= #endLine# ORDER BY " + orderbyStr
-					+ ") WHERE ROWNUM >= #startLine#";
-		} else if (StringUtils.equals(driverClass, "com.ibm.db2.jcc.DB2Driver")) {
-			// db2
-			queryPage = "SELECT * FROM (SELECT B.*,ROWNUMBER() OVER(ORDER BY "
-					+ orderbyStr
-					+ ") AS RN FROM "
-					+ tableName
-					+ " AS B) AS A WHERE A.RN BETWEEN #startLine# AND #endLine#";
-		}
-		if (StringUtils.isNotBlank(queryPage)) {
-			params.put("queryPage", queryPage);
-		}
-		// 生成sqlmap
-		JavaFileGenerator sqlMapGenerator = new JavaFileGenerator();
-		sqlMapGenerator.generate(params, srcBase, sqlMapPackageName,
-				className+"Mapper" + XML_FILE_SUFFIX,
-				SQLMAP_TEMPLATE_NAME);
-	}
-
-	public static void generateSqlMapConfig(List<Table> tables, String srcBase,
-			String sqlmapPackageName, String sqlMapConfigPackageName) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		params.put("sqlmapPackageName", sqlmapPackageName);
-		params.put("tables", tables);
-		// 生成sqlmap-config
-		SqlMapConfigGenerator sqlMapConfigGenerator = new SqlMapConfigGenerator();
-		sqlMapConfigGenerator.createSqlMapConfigFile(sqlmapPackageName, tables,
-				params, srcBase, sqlMapConfigPackageName, SQLMAP_CONFIG_FILE,
-				SQLMAPCONFIG_TEMPLATE_NAME);
-	}
-
-	public static void generateDaoAndService(Table table, String srcBase,
-			String daoPackageName, String servicePackageName) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		String className = table.getClassName();
-		String pojoFullClassName = table.getPackageName() + "."
-				+ table.getClassName();
-
-		List<Column> primarykeys = new ArrayList<Column>();
-		for (Column col : table.getColumns()) {
-			if (col.isPrimaryKey()) {
-				primarykeys.add(col);
-			}
-		}
-		String paramType = null;
-		if (primarykeys.size() == 1) {
-			paramType = primarykeys.get(0).getJavaTypeName();
-		} else if (primarykeys.size() > 1) {
-			paramType = Map.class.getName();
-		}
-		params.put("pojoFullClassName", pojoFullClassName);
-		params.put("className", className);
-		params.put("paramType", paramType);
-		params.put("daoPackageName", daoPackageName);
-
-		JavaFileGenerator daoGenerator = new JavaFileGenerator();
-		daoGenerator.generate(params, srcBase, daoPackageName, className
-				+ DAO_FILE_SUFFIX, DAO_TEMPLATE_NAME);
-
-		params.put("servicePackageName", servicePackageName);
-
-		JavaFileGenerator serviceGenerator = new JavaFileGenerator();
-		serviceGenerator.generate(params, srcBase, servicePackageName,
-				className + SERVICE_FILE_SUFFIX, SERVICE_TEMPLATE_NAME);
-
-		JavaFileGenerator serviceImplGenerator = new JavaFileGenerator();
-		serviceImplGenerator.generate(params, srcBase, servicePackageName
-				+ File.separator + "impl",
-				className + SERVICE_IMPL_FILE_SUFFIX,
-				SERVICE_IMPL_TEMPLATE_NAME);
-	}
-
-	public static void generateSpring(List<Table> tables, String srcBase,
-			String packageName, String daoPackageName, String servicePackageName) {
-		Map<String, Object> params = new HashMap<String, Object>();
-		params.put("daoPackageName", daoPackageName);
-		params.put("servicePackageName", servicePackageName);
-		params.put("tables", tables);
-		SpringGenerator springGenerator = new SpringGenerator();
-		springGenerator.createSpringFile(daoPackageName, servicePackageName,
-				tables, params, srcBase, packageName, SPRING_CONFIG_FILE,
-				SPRING_TEMPLATE);
-	}
-}

+ 0 - 41
codegen/src/main/java/com/yonge/crud/core/generator/module/JavaFileGenerator.java

@@ -1,41 +0,0 @@
-package com.yonge.crud.core.generator.module;
-
-import java.io.File;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.yonge.crud.core.FreemarkerTemplateEngine;
-
-public final class JavaFileGenerator extends FreemarkerTemplateEngine {
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(JavaFileGenerator.class);
-
-	public JavaFileGenerator() {
-		super();
-	}
-
-	public void generate(Map<String, Object> data, String srcBase,
-			String packageName, String targetFile, String templateFile) {
-		StringBuilder buf = new StringBuilder();
-		buf.append(srcBase).append(File.separator);
-		buf.append(packageName.replaceAll("\\.", File.separator
-				+ File.separator));// 单个的File.separator会导致无法通过正则表达式解析
-		buf.append(File.separator);
-		File packageDir = new File(buf.toString());
-		if (!packageDir.exists()) {
-			boolean flag = packageDir.mkdirs();
-			if (!flag) {
-				LOGGER.warn("递归创建文件夹{}失败", packageDir);
-				return;
-			}
-		}
-		buf.append(targetFile);
-		String outputFile = buf.toString();
-		LOGGER.debug("根据输入内容[{},{},{}]得到文件名{}", new Object[] { templateFile,
-				srcBase, packageName, outputFile });
-		render(data, templateFile, outputFile);
-	}
-
-}

+ 0 - 129
codegen/src/main/java/com/yonge/crud/core/generator/module/SpringGenerator.java

@@ -1,129 +0,0 @@
-package com.yonge.crud.core.generator.module;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import com.yonge.crud.core.FreemarkerTemplateEngine;
-import com.yonge.crud.core.db.model.Table;
-import com.yonge.crud.core.util.XmlUtil;
-
-public class SpringGenerator extends FreemarkerTemplateEngine {
-
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(SpringGenerator.class);
-
-	public SpringGenerator() {
-		super();
-	}
-
-	public void createSpringFile(String daoPackageName,
-			String servicePackageName, List<Table> tables,
-			Map<String, Object> data, String srcBase, String packageName,
-			String targetFile, String templateFile) {
-		StringBuilder buf = new StringBuilder();
-		buf.append(srcBase).append(File.separator);
-		buf.append(packageName.replaceAll("\\.", File.separator
-				+ File.separator));// 单个的File.separator会导致无法通过正则表达式解析
-		buf.append(File.separator);
-		File dbDir = new File(buf.toString());
-		if (!dbDir.exists()) {
-			boolean flag = dbDir.mkdirs();
-			if (!flag) {
-				LOGGER.warn("递归创建文件夹{}失败", dbDir);
-				return;
-			}
-		}
-		buf.append(targetFile);
-		String outputFile = buf.toString();
-		File file = new File(outputFile);
-		if (file.exists()) {
-			Map<String, String> nsMap = new HashMap<String, String>();
-			nsMap.put("ns", "http://www.springframework.org/schema/beans");
-			try {
-				Document doc = XmlUtil.parse(file);
-				for (Table table : tables) {
-					String className = table.getClassName();
-					if (StringUtils.isNotBlank(className)) {
-						String className_firstLower = Character
-								.toLowerCase(className.charAt(0))
-								+ className.substring(1);
-						Object obj = XmlUtil.queryNodeValue(doc,
-								"//ns:beans/ns:bean[@id='"
-										+ className_firstLower + "Dao']",
-								XPathConstants.NODE, nsMap);
-						if (obj == null) {
-							// 创建dao
-							Element element = doc.createElement("bean");
-							element.setAttribute("id", className_firstLower
-									+ "Dao");
-							element.setAttribute("class",
-									"com.erayt.solar2.db.DaoProxyFactoryBean");
-							// 创建property元素
-							Element subElement = doc.createElement("property");
-							subElement.setAttribute("name", "daoInterface");
-							subElement.setAttribute("value", daoPackageName
-									+ "." + className + "Dao");
-							element.appendChild(subElement);
-
-							subElement = doc.createElement("property");
-							subElement.setAttribute("name", "sqlMapClient");
-							subElement.setAttribute("ref", "sqlMapClient");
-							element.appendChild(subElement);
-							doc.getDocumentElement().appendChild(element);
-
-						} else {
-							LOGGER.warn(targetFile + "中已经存在" + className
-									+ "的DAO配置");
-						}
-
-						obj = XmlUtil.queryNodeValue(doc,
-								"//ns:beans/ns:bean[@id='"
-										+ className_firstLower + "Service']",
-								XPathConstants.NODE, nsMap);
-						if (obj == null) {
-							// 创建service
-							Element element = doc.createElement("bean");
-							element.setAttribute("id", className_firstLower
-									+ "Service");
-							element.setAttribute("class", servicePackageName
-									+ ".impl." + className + "ServiceImpl");
-							doc.getDocumentElement().appendChild(element);
-						} else {
-							LOGGER.warn(targetFile + "中已经存在" + className
-									+ "的SERVICE配置");
-						}
-					}
-				}
-				// 将dom写入文件
-				XmlUtil.writeXmlFile(doc, outputFile);
-				return;
-			} catch (ParserConfigurationException e) {
-				LOGGER.warn("xml文件解析失败", e);
-			} catch (SAXException e) {
-				LOGGER.warn("xml文件解析失败", e);
-			} catch (IOException e) {
-				LOGGER.warn("xml文件解析失败", e);
-			} catch (XPathExpressionException e) {
-				LOGGER.warn("xpath表达式异常", e);
-			}
-		}
-		LOGGER.debug("根据输入内容[{},{},{}]得到文件名{}", new Object[] { templateFile,
-				srcBase, packageName, outputFile });
-		render(data, templateFile, outputFile);
-	}
-
-}

+ 0 - 82
codegen/src/main/java/com/yonge/crud/core/generator/module/SqlMapConfigGenerator.java

@@ -1,82 +0,0 @@
-package com.yonge.crud.core.generator.module;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import com.yonge.crud.core.FreemarkerTemplateEngine;
-import com.yonge.crud.core.db.model.Table;
-import com.yonge.crud.core.util.XmlUtil;
-
-public final class SqlMapConfigGenerator extends FreemarkerTemplateEngine {
-	private static final Logger LOGGER = LoggerFactory
-			.getLogger(SqlMapConfigGenerator.class);
-
-	public void createSqlMapConfigFile(String sqlmapPackageName,
-			List<Table> tables, Map<String, Object> data, String srcBase,
-			String packageName, String targetFile, String templateFile) {
-		StringBuilder buf = new StringBuilder();
-		buf.append(srcBase).append(File.separator);
-		buf.append(packageName.replaceAll("\\.", File.separator
-				+ File.separator));// 单个的File.separator会导致无法通过正则表达式解析
-		buf.append(File.separator);
-		File dbDir = new File(buf.toString());
-		if (!dbDir.exists()) {
-			boolean flag = dbDir.mkdirs();
-			if (!flag) {
-				LOGGER.warn("递归创建文件夹{}失败", dbDir);
-				return;
-			}
-		}
-		buf.append(targetFile);
-		String outputFile = buf.toString();
-		// 判断文件是否存在,如果存在,则在原来的基础上追加
-		File file = new File(outputFile);
-		if (file.exists()) {
-			try {
-				Document doc = XmlUtil.parse(file);
-				for (Table table : tables) {
-					String src = sqlmapPackageName.replace('.', '/')
-							+ "/SqlMap_" + table.getName() + ".xml";
-					Object obj = XmlUtil.queryNodeValue(doc,
-							"//sqlMapConfig/sqlMap[@resource='" + src + "']",
-							XPathConstants.NODE, null);
-					if (obj == null) {
-						// 创建一个新的节点
-						Element element = doc.createElement("sqlMap");
-						element.setAttribute("resource", src);
-						doc.getDocumentElement().appendChild(element);
-					} else {
-						LOGGER.warn(targetFile + "中已经存在" + table.getName()
-								+ "配置");
-					}
-				}
-				// 将dom写入文件
-				XmlUtil.writeXmlFile(doc, outputFile);
-				return;
-			} catch (ParserConfigurationException e) {
-				LOGGER.warn("xml文件解析失败", e);
-			} catch (SAXException e) {
-				LOGGER.warn("xml文件解析失败", e);
-			} catch (IOException e) {
-				LOGGER.warn("xml文件解析失败", e);
-			} catch (XPathExpressionException e) {
-				LOGGER.warn("xpath表达式异常", e);
-			}
-		}
-		LOGGER.debug("根据输入内容[{},{},{}]得到文件名{}", new Object[] { data,
-				templateFile, srcBase, outputFile });
-		render(data, templateFile, outputFile);
-	}
-}

+ 0 - 160
codegen/src/main/java/com/yonge/crud/core/util/JavaBeansUtil.java

@@ -1,160 +0,0 @@
-package com.yonge.crud.core.util;
-
-import java.sql.Types;
-import java.util.regex.Pattern;
-
-import com.yonge.crud.core.db.model.Column;
-
-public class JavaBeansUtil {
-
-	private static final Pattern allowedClassNames = Pattern
-			.compile("[a-zA-Z]+");
-
-	public static String fromJdbcToJava(Column column) {
-		String answer = null;
-		switch (column.getDataType()) {
-		case Types.ARRAY:
-		case Types.DATALINK:
-		case Types.DISTINCT:
-		case Types.JAVA_OBJECT:
-		case Types.NULL:
-		case Types.OTHER:
-		case Types.REF:
-		case Types.STRUCT:
-			answer = "Object";
-			break;
-
-		case Types.BIGINT:
-			answer = "Long";
-			break;
-
-		case Types.BINARY:
-		case Types.BLOB:
-		case Types.LONGVARBINARY:
-		case Types.VARBINARY:
-			answer = "byte[]"; //$NON-NLS-1$
-			break;
-
-		case Types.BIT:
-		case Types.BOOLEAN:
-			answer = "boolean";
-			break;
-		case Types.CHAR:
-		case Types.CLOB:
-		case Types.LONGVARCHAR:
-		case Types.VARCHAR:
-			answer = "String";
-			break;
-
-		case Types.DATE:
-		case Types.TIME:
-		case Types.TIMESTAMP:
-			answer = "java.util.Date";
-			break;
-
-		case Types.DECIMAL:
-			if (column.getScale() > 0 || column.getLength() > 18) {
-				answer = "java.math.BigDecimal";
-			} else if (column.getLength() > 9) {
-				answer = "long";
-			} else if (column.getLength() > 4) {
-				answer = "int";
-			} else {
-				answer = "short";
-			}
-			break;
-
-		case Types.DOUBLE:
-			answer = "double";
-			break;
-
-		case Types.FLOAT:
-		case Types.REAL:
-			answer = "float";
-			break;
-
-		case Types.INTEGER:
-		case Types.TINYINT:
-			answer = "Integer";
-			break;
-
-		case Types.NUMERIC:
-			if (column.getScale() > 0 || column.getLength() > 18) {
-				answer = "java.math.BigDecimal";
-			} else if (column.getLength() > 9) {
-				answer = "long";
-			} else if (column.getLength() > 4) {
-				answer = "int";
-			} else {
-				answer = "short";
-			}
-			break;
-
-		case Types.SMALLINT:
-			answer = "short";
-			break;
-
-
-		default:
-			answer = null;
-			break;
-		}
-
-		return answer;
-	}
-
-	public static String getClassName(String tableName) {
-		String className = tableName;
-		if (allowedClassNames.matcher(className).matches()) {
-			className = tableName;
-		} else {
-			for (String chunk : allowedClassNames.split(tableName)) {
-				className = className.replace(chunk, "");
-			}
-		}
-		if (Character.isLowerCase(className.charAt(0))) {
-			className = className.substring(0, 1).toUpperCase()
-					+ className.substring(1);
-		}
-		return className;
-	}
-
-	public static String getCamelCaseString(String inputString,
-			boolean firstCharacterUppercase) {
-		StringBuilder sb = new StringBuilder();
-
-		boolean nextUpperCase = false;
-		for (int i = 0; i < inputString.length(); i++) {
-			char c = inputString.charAt(i);
-
-			switch (c) {
-			case '_':
-			case '-':
-			case '@':
-			case '$':
-			case '#':
-			case ' ':
-				if (sb.length() > 0) {
-					nextUpperCase = true;
-				}
-				break;
-
-			default:
-				if (nextUpperCase) {
-					sb.append(Character.toUpperCase(c));
-					nextUpperCase = false;
-				} else {
-					sb.append(Character.toLowerCase(c));
-				}
-				break;
-			}
-		}
-
-		if (firstCharacterUppercase) {
-			sb.setCharAt(0, Character.toUpperCase(sb.charAt(0)));
-		}
-
-		return sb.toString();
-	}
-
-}

+ 0 - 169
codegen/src/main/java/com/yonge/crud/core/util/XmlUtil.java

@@ -1,169 +0,0 @@
-package com.yonge.crud.core.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class XmlUtil {
-
-	private static final Logger LOGGER = LoggerFactory.getLogger(XmlUtil.class);
-
-	private static final Map<ClassLoader, DocumentBuilderFactory> DOCUMENT_BUILDER_FACTORIES = Collections
-			.synchronizedMap(new WeakHashMap<ClassLoader, DocumentBuilderFactory>());
-
-	/**
-	 * 根据xpath表达式查询目标document中节点的值
-	 * 
-	 * @param doc
-	 *            目标对象
-	 * @param expression
-	 *            xpath表达式
-	 * @param returnType
-	 *            节点值的返回类型(eg:XPathConstants.STRING)
-	 * @param nsMap
-	 *            如果有默认的命名空间,需设置默认的命名空间
-	 * @return
-	 * @throws XPathExpressionException
-	 */
-	public static Object queryNodeValue(final Document doc, String expression,
-			QName returnType, final Map<String, String> nsMap)
-			throws XPathExpressionException {
-		XPathFactory factory = XPathFactory.newInstance();
-		XPath xpath = factory.newXPath();
-
-		xpath.setNamespaceContext(new NamespaceContext() {
-
-			@SuppressWarnings("rawtypes")
-			public Iterator getPrefixes(String namespaceURI) {
-				throw new UnsupportedOperationException();
-			}
-
-			public String getPrefix(String namespaceURI) {
-				throw new UnsupportedOperationException();
-			}
-
-			public String getNamespaceURI(String prefix) {
-				String xmlns = doc.lookupNamespaceURI(prefix);
-				if (StringUtils.isBlank(xmlns)) {
-					xmlns = nsMap.get(prefix);
-				}
-				return xmlns;
-			}
-		});
-
-		XPathExpression expr = xpath.compile(expression);
-
-		return expr.evaluate(doc, returnType);
-	}
-
-	/**
-	 * 将document对象写入filename文件
-	 * 
-	 * @param doc
-	 *            目标对象
-	 * @param filename
-	 *            输出文件名称
-	 */
-	public static void writeXmlFile(Document doc, String filename) {
-		try {
-			// Prepare the DOM document for writing
-			Source source = new DOMSource(doc);
-
-			// Prepare the output file
-			File file = new File(filename);
-			Result result = new StreamResult(file);
-
-			// Write the DOM document to the file
-			Transformer xformer = TransformerFactory.newInstance()
-					.newTransformer();
-			xformer.setOutputProperty(OutputKeys.INDENT, "yes");
-			xformer.transform(source, result);
-		} catch (TransformerException e) {
-			LOGGER.warn("document对象写入文件失败", e);
-		}
-	}
-
-	public static DocumentBuilder getParser()
-			throws ParserConfigurationException {
-		return getDocumentBuilderFactory().newDocumentBuilder();
-	}
-
-	public static Document parse(InputSource is)
-			throws ParserConfigurationException, SAXException, IOException {
-		return getParser().parse(is);
-	}
-
-	public static Document parse(File is) throws ParserConfigurationException,
-			SAXException, IOException {
-		return getParser().parse(is);
-	}
-
-	public static Document parse(InputStream in)
-			throws ParserConfigurationException, SAXException, IOException {
-		if (in == null) {
-			LOGGER.warn("XMLUtils trying to parse a null inputstream");
-		}
-		return getParser().parse(in);
-	}
-
-	public static Document parse(String in)
-			throws ParserConfigurationException, SAXException, IOException {
-		return parse(in.getBytes());
-	}
-
-	public static Document parse(byte[] in)
-			throws ParserConfigurationException, SAXException, IOException {
-		if (in == null) {
-			LOGGER.warn("XMLUtils trying to parse a null bytes");
-			return null;
-		}
-		return getParser().parse(new ByteArrayInputStream(in));
-	}
-
-	private static DocumentBuilderFactory getDocumentBuilderFactory() {
-		ClassLoader loader = Thread.currentThread().getContextClassLoader();
-		if (loader == null) {
-			loader = XmlUtil.class.getClassLoader();
-		}
-		if (loader == null) {
-			return DocumentBuilderFactory.newInstance();
-		}
-		DocumentBuilderFactory factory = DOCUMENT_BUILDER_FACTORIES.get(loader);
-		if (factory == null) {
-			factory = DocumentBuilderFactory.newInstance();
-			factory.setNamespaceAware(true);
-			DOCUMENT_BUILDER_FACTORIES.put(loader, factory);
-		}
-		return factory;
-	}
-}

+ 0 - 17
codegen/src/main/resources/generateConfigration.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<GenerateConfiguration>
-	<dbConfiguration>
-		<driverClass>com.mysql.jdbc.Driver</driverClass>
-		<url>jdbc:mysql://47.114.176.40:3306/mec_test</url>
-		<username>mec_dev</username>
-		<password>dayaDataOnline@2019</password>
-		<catalog>mec_test</catalog>
-		<schema>mec_test</schema>
-	</dbConfiguration>
-	<srcBase>D:/usr/javabean</srcBase>
-	<pojoPackageName>com.ym.mec.biz.dal.entity</pojoPackageName>
-	<daoPackageName>com.ym.mec.biz.dal.dao</daoPackageName>
-	<servicePackageName>com.ym.mec.biz.service</servicePackageName>
-	<sqlmapPackageName>resources</sqlmapPackageName>
-	<sqlmapConfigPackageName>resources/config</sqlmapConfigPackageName>
-</GenerateConfiguration>

+ 0 - 10
codegen/src/main/resources/template/dao.ftl

@@ -1,10 +0,0 @@
-[#ftl]
-package ${daoPackageName};
-
-import com.ym.mec.common.dal.BaseDAO;
-import ${pojoFullClassName};
-
-public interface ${className}Dao [#if paramType??]extends BaseDAO<${paramType}, ${className}>[/#if] {
-
-	
-}

+ 0 - 44
codegen/src/main/resources/template/pojo.ftl

@@ -1,44 +0,0 @@
-[#ftl]
-package ${table.packageName};
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-
-/**
- * 对应数据库表(${table.name}):${table.remarks}
- */
-public class ${table.className} {
-
-	[#list props as prop]
-	[#if prop.remarks??]
-	/** ${prop.remarks} */
-	[/#if]
-	private ${prop.javaTypeName} ${prop.propertyName};
-	
-	[/#list]
-	[#list props as prop]
-		[#if prop.javaTypeName == 'boolean']
-	public void set${prop.propertyName?cap_first}(${prop.javaTypeName} ${prop.propertyName}){
-		this.${prop.propertyName} = ${prop.propertyName};
-	}
-	
-	public boolean is${prop.propertyName?cap_first}(){
-		return this.${prop.propertyName};
-	}
-			
-		[#else]
-	public void set${prop.propertyName?cap_first}(${prop.javaTypeName} ${prop.propertyName}){
-		this.${prop.propertyName} = ${prop.propertyName};
-	}
-	
-	public ${prop.javaTypeName} get${prop.propertyName?cap_first}(){
-		return this.${prop.propertyName};
-	}
-			
-		[/#if]
-	[/#list]
-	@Override
-	public String toString() {
-		return ToStringBuilder.reflectionToString(this);
-	}
-
-}

+ 0 - 9
codegen/src/main/resources/template/service.ftl

@@ -1,9 +0,0 @@
-[#ftl]
-package ${servicePackageName};
-
-import ${pojoFullClassName};
-import com.ym.mec.common.service.BaseService;
-
-public interface ${className}Service extends BaseService<${paramType}, ${className}> {
-
-}

+ 0 - 22
codegen/src/main/resources/template/service_impl.ftl

@@ -1,22 +0,0 @@
-[#ftl]
-package ${servicePackageName}.impl;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-import ${pojoFullClassName};
-import ${servicePackageName}.${className}Service;
-import ${daoPackageName}.${className}Dao;
-
-@Service
-public class ${className}ServiceImpl extends BaseServiceImpl<${paramType}, ${className}>  implements ${className}Service {
-	
-	[#assign daoName = className + 'Dao']
-	@Autowired
-	private ${daoName} ${daoName?uncap_first};
-
-	@Override
-	public BaseDAO<${paramType}, ${className}> getDAO() {
-		return ${daoName?uncap_first};
-	}
-	
-}

+ 0 - 36
codegen/src/main/resources/template/spring.ftl

@@ -1,36 +0,0 @@
-[#ftl]
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-This file is auto generated by Ant & FreeMarker.
-DO NOT MODIFY IT.All modified content will be lost when next auto generate.
-这个文件是用ANT和FreeMarker自动生成的。
-不要修改此文件。所有改动将在下次重新自动生成时丢失。
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
-	xmlns:context="http://www.springframework.org/schema/context"
-	xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"
-	default-autowire="byName">
-
-	[#-- 
-	<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
-		<property name="configLocation" value="${sqlmapConfigPackageName}/SqlMap_Config.xml" />
-		<property name="dataSource" ref ="${r"${dataSource}"}" />
-	</bean>
-	--]
-	
-	
-	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
-		<property name="dataSource" ref="dataSource" />
-		<property name="configLocation" value="classpath:SqlMapConfig.xml" />
-	</bean>
-	
-	[#list tables as table]
-	<bean id="${table.className?uncap_first}Dao" class="org.mybatis.spring.mapper.MapperFactoryBean">
-		<property name="mapperInterface" value="${daoPackageName}.${table.className}Dao" />
-		<property name="sqlSessionFactory" ref="sqlSessionFactory" />
-	</bean>
-	
-	[/#list]
-</beans>

+ 0 - 64
codegen/src/main/resources/template/sqlmap.ftl

@@ -1,64 +0,0 @@
-[#ftl]
-<?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="${namespace}">
-	
-	<resultMap type="${fullClassName}" id="${alias}">
-	[#list columns as col]
-		<result column="${col.fieldName}" property="${col.propertyName}" />
-	[/#list]
-	</resultMap>
-	
-	[#if querySingleSQL??]
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="${alias}" [#if paramType??]parameterType="${paramType}"[/#if]>
-		${querySingleSQL}
-	</select>
-	[/#if]
-	
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="${alias}">
-		${queryFullSQL}
-	</select>
-	
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="${fullClassName}" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		${insertSQL}
-	</insert>
-	
-	[#if updateSQL??]
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="${fullClassName}">
-		${updateSQL}
-	</update>
-	[/#if]
-	
-	[#if deleteSQL??]
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" [#if paramType??]parameterType="${paramType}"[/#if]>
-		${deleteSQL}
-	</delete>
-	[/#if]
-	
-	[#if queryPage??]
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="${alias}" parameterType="map">
-		${queryPage}
-	</select>
-	[/#if]
-	
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM ${tableName}
-	</select>
-</mapper>
- 

+ 0 - 11
codegen/src/main/resources/template/sqlmapConfig.ftl

@@ -1,11 +0,0 @@
-[#ftl]
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL Map Config 3.0//EN"  
-	"http://mybatis.org/dtd/mybatis-3-config.dtd">
-<configuration>
-	<mappers>
-	[#list tables as table]
-		<mapper resource="${sqlmapPackageName?replace(".","/")}/SqlMap_${table.name}.xml" />
-	[/#list]
-	</mappers>
-</configuration>

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

@@ -66,7 +66,8 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                         "/api-web/tenantInfo/info/*", "/api-web/tenantInfo/checkInfo/*", "/api-web/tenantInfo/pay/*","/api-web/tenantInfo/testCheck", "/api-web/tenantInfo/getContract/*",
                         "/api-web/tenantPreJoin/add","/api-web/imLiveBroadcastRoom/queryRoomInfo","/api-web/imLiveBroadcastRoom/test",
                         "/api-web/eduOrganization/queryAllOrgan","/api-web/eduOrganization/queryAll","/api-web/eduOrganization/getOrganCooperation","/api-web/import/oaUploadFile",
-                        "/api-web/tenantInfo/callback/**","/api-web/adapay/callback","/api-web/temp/*", "/api-web/open/**","/api-web/schoolActivity/detail/*","/api-web/yeepay/callback/**"
+                        "/api-web/tenantInfo/callback/**","/api-web/adapay/callback","/api-web/temp/*", "/api-web/open/**","/api-web/schoolActivity/detail/*",
+                        "/api-web/yeepay/callback/**","/api-web/hfMerchantConfig/queryByTenantId"
 
                 )
                 .permitAll().anyRequest().authenticated().and().httpBasic();

+ 69 - 15
mec-application/src/main/java/com/ym/mec/student/controller/ActivityController.java

@@ -1,20 +1,11 @@
 package com.ym.mec.student.controller;
 
-import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.StudentDao;
-import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
-import com.ym.mec.biz.dal.dao.SysConfigDao;
-import com.ym.mec.biz.dal.dao.VipGroupCategoryDao;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.ActivityDetailDto;
-import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
-import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.entity.VipGroupActivity;
-import com.ym.mec.biz.service.MarketActivityService;
-import com.ym.mec.biz.service.SporadicChargeInfoService;
-import com.ym.mec.biz.service.SysUserService;
-import com.ym.mec.biz.service.VipGroupActivityService;
+import com.ym.mec.biz.dal.entity.*;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
@@ -22,7 +13,10 @@ import com.yonge.log.model.AuditLogAnnotation;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -51,7 +45,13 @@ public class ActivityController extends BaseController {
     @Autowired
     private StudentDao studentDao;
     @Autowired
+    private VipGroupDao vipGroupDao;
+    @Autowired
     private VipGroupCategoryDao vipGroupCategoryDao;
+    @Autowired
+    private MusicGroupPlanMakingService musicGroupPlanMakingService;
+    @Autowired
+    private SubjectService subjectService;
 
     @ApiOperation("活动购买")
     @PostMapping(value = "/buy")
@@ -82,7 +82,7 @@ public class ActivityController extends BaseController {
         SysUser user = sysUserService.getUser();
         Integer organId = user.getOrganId();
 
-        List<SporadicChargeInfo> activeInfos = sporadicChargeInfoService.getOrganActiveInfo(organId, 12);
+        List<SporadicChargeInfo> activeInfos = sporadicChargeInfoService.getOrganActiveInfo(organId.toString(), 12);
         activeInfos.sort(Comparator.comparing(SporadicChargeInfo::getAmount).reversed());
         if (activeInfos.size() <= 0) {
             return failed("分部活动不存在");
@@ -109,7 +109,7 @@ public class ActivityController extends BaseController {
         return succeed(resultMap);
     }
 
-    @ApiOperation("获取2022云教练活动列表")
+/*    @ApiOperation("获取2022云教练活动列表")
     @PostMapping(value = "/queryActivity")
     @AuditLogAnnotation(operateName = "获取2022云教练活动列表")
     public HttpResponseResult<List<VipGroupActivity>> queryActivity(){
@@ -117,8 +117,43 @@ public class ActivityController extends BaseController {
         List<Cloud2022ActivityDto> cloud2022ActivityDtos = JSONArray.parseArray(configValue, Cloud2022ActivityDto.class);
         String collect = cloud2022ActivityDtos.stream().map(e -> e.getActivityId()).collect(Collectors.joining(","));
         return succeed(vipGroupActivityService.getDao().queryByIds(collect));
+    }*/
+
+    @ApiOperation("获取2023乐理直播活动列表")
+    @PostMapping(value = "/queryTheoryLiveActivity")
+    @AuditLogAnnotation(operateName = "获取2023乐理直播活动列表")
+    public HttpResponseResult<List<VipGroup>> queryTheoryLiveActivity(){
+        String configValue = sysConfigDao.findConfigValue("2023_double_eleven_active_config");
+        JSONObject jsonObject = JSONObject.parseObject(configValue);
+        String theoryLive = jsonObject.getString("theoryLive");
+        //转换成long数组
+        List<Long> longs = Arrays.stream(theoryLive.split(",")).map(Long::parseLong).collect(Collectors.toList());
+        return succeed(vipGroupDao.getVipGroupByIds(longs));
+    }
+    @ApiOperation("获取2023商品列表")
+    @PostMapping(value = "/queryGoodsActivity")
+    @AuditLogAnnotation(operateName = "获取2023商品列表")
+    public HttpResponseResult<JSONObject> queryGoodsActivity(){
+        String configValue = sysConfigDao.findConfigValue("2023_double_eleven_active_config");
+        JSONObject jsonObject = JSONObject.parseObject(configValue);
+        return succeed(jsonObject.getJSONObject("musical"));
+    }
+    @ApiOperation("校验用户分部是否参与活动")
+    @PostMapping(value = "/checkActivityOrgan")
+    @AuditLogAnnotation(operateName = "校验用户分部是否参与活动")
+    public HttpResponseResult<Boolean> checkActivityOrgan(){
+        String configValue = sysConfigDao.findConfigValue("2023_activity_organ");
+        if (StringUtils.isEmpty(configValue)) {
+            return succeed(true);
+        }
+        SysUser user = sysUserService.getUser();
+        if(configValue.contains(user.getOrganId().toString())){
+            return succeed(true);
+        }
+        return succeed(false);
     }
 
+
     @ApiOperation(value = "学员已购买的双十一活动信息")
     @GetMapping("/queryStudentDoubleEleven2022Order")
     public Object queryStudentDoubleEleven2022Order() {
@@ -169,6 +204,25 @@ public class ActivityController extends BaseController {
         return succeed(vipGroupActivity);
     }
 
+    @ApiOperation(value = "查询乐团编制")
+    @GetMapping(value = "/querySubject")
+    public HttpResponseResult<MusicGroupPlanMakingDto> query(Integer id) throws Exception {
+        MusicGroupPlanMaking pm = musicGroupPlanMakingService.get(id);
+
+        if (pm != null) {
+            MusicGroupPlanMakingDto dto = new MusicGroupPlanMakingDto();
+
+            BeanUtils.copyProperties(pm, dto);
+
+            List<Subject> subjectList = subjectService.findBySubjectByIdList(pm.getSubjectIdList());
+            if (subjectList != null) {
+                dto.setSubjectMap(subjectList.stream().collect(Collectors.toMap(Subject::getId, Subject::getName)));
+            }
+            return succeed(dto);
+        }
+        return succeed();
+    }
+
     @ApiOperation(value = "根据课程类型获取对应课程活动方案")
     @GetMapping("/findByVipGroupCategory")
     public HttpResponseResult<List<VipGroupActivity>> findByVipGroupCategory(){

+ 1 - 1
mec-application/src/main/java/com/ym/mec/student/controller/ChildrenDayDegreeDetailController.java

@@ -33,7 +33,7 @@ public class ChildrenDayDegreeDetailController extends BaseController {
     @Autowired
     private StudentDao studentDao;
 
-    @ApiOperation(value = "获取用户已报名的详情,类型 1-专业考级 2-乐理考级 3-vip1v1,4-vip1v2 5-乐理课")
+    @ApiOperation(value = "获取用户已报名的详情,类型 1-专业考级 2-小组考级 3-vip1v1,4-vip1v2 5-小组课")
     @GetMapping("/getUserDegreeInfo")
     public HttpResponseResult<ChildrenDayDetailDto> getFeeInfo() {
         SysUser user = sysUserFeignService.queryUserInfo();

+ 5 - 2
mec-application/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java

@@ -62,6 +62,7 @@ public class SporadicChargeInfoController extends BaseController {
                 return failed("用户不存在");
             }
             sporadicPayDto.setUserId(sysUser.getId());
+            sporadicPayDto.setOrganId(sysUser.getOrganId());
         }
         if (sporadicPayDto.getRepeatPay() == false) {
         	List<StudentPaymentOrder> studentPaymentOrderList = studentPaymentOrderDao.findPaymentOrderByGroupType(sporadicPayDto.getUserId(), sporadicPayDto.getSporadicId(), "SPORADIC", DealStatusEnum.ING);
@@ -76,7 +77,9 @@ public class SporadicChargeInfoController extends BaseController {
             }
         }
         SporadicChargeInfo info = sporadicChargeInfoService.get(sporadicPayDto.getSporadicId());
-
+        if(sporadicPayDto.getOrganId() == null){
+            sporadicPayDto.setOrganId(Integer.parseInt(info.getOrganId()));
+        }
         if (info.getMaxAmount() != null) {
             String msg = "";
             for (int i = 1; i <= 100; i++) {
@@ -124,7 +127,7 @@ public class SporadicChargeInfoController extends BaseController {
         if (type == null || type <= 0) {
             return failed("参数不合法");
         }
-        SporadicChargeInfo chargeInfo = sporadicChargeInfoService.findByOrganIdAndType(organId, type);
+        SporadicChargeInfo chargeInfo = sporadicChargeInfoService.findByOrganIdAndType(organId.toString(), type);
         if (chargeInfo == null) {
             return failed("分部活动不存在");
         }

+ 18 - 0
mec-application/src/main/java/com/ym/mec/student/controller/StudentController.java

@@ -2,9 +2,11 @@ package com.ym.mec.student.controller;
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dto.RegisterUserDto;
 import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.dal.entity.StudentPreRegistration;
 import com.ym.mec.biz.service.StudentService;
+import com.ym.mec.biz.service.SysUserService;
 import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -25,6 +27,8 @@ public class StudentController extends BaseController {
 
     @Resource
     private SysUserFeignService sysUserFeignService;
+	@Resource
+	private SysUserService sysUserService;
     @Autowired
     private StudentService studentService;
 
@@ -57,4 +61,18 @@ public class StudentController extends BaseController {
 		}
 		return succeed();
 	}
+
+	@ApiOperation("补充基本信息")
+	@PostMapping(value = "/updateBasicInfo")
+	public Object updateBasicInfo(RegisterUserDto registerUserDto) {
+		SysUser user = sysUserService.getUser();
+		user.setUsername(registerUserDto.getUsername());
+		sysUserService.updateSysUser(user);
+		Student student = studentService.get(user.getId());
+		student.setSubjectIdList(registerUserDto.getSubjectId().toString());
+		student.setCurrentGradeNum(registerUserDto.getCurrentGradeNum());
+		student.setUpdateTime(new Date());
+		studentService.update(student);
+		return succeed();
+	}
 }

+ 1 - 1
mec-application/src/main/java/com/ym/mec/teacher/controller/VipGroupCategoryController.java

@@ -52,7 +52,7 @@ public class VipGroupCategoryController extends BaseController {
 	@ApiOperation("全查询")
 	@ApiImplicitParams({
 			@ApiImplicitParam(name = "organId", value = "分部id", dataType = "int", paramType = "query"),
-			@ApiImplicitParam(name = "includeMusicTheory", value = "是否包含乐理", dataType = "int", paramType = "query", defaultValue = "0"),
+			@ApiImplicitParam(name = "includeMusicTheory", value = "是否包含小组", dataType = "int", paramType = "query", defaultValue = "0"),
 			@ApiImplicitParam(name = "groupType", value = "课类别", dataType = "String", paramType = "query", defaultValue = "VIP")
 	})
 	@GetMapping(value = "/queryAll")

+ 7 - 7
mec-application/src/main/java/com/ym/mec/web/controller/ExportController.java

@@ -266,7 +266,7 @@ public class ExportController extends BaseController {
         }
         OutputStream outputStream = response.getOutputStream();
         try {
-            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "合作单位", "乐团", "学员编号", "学员姓名", "手机号", "声部", "所在班级", "是否预约", "器乐等级", "乐理等级", "是否购买VIP", "是否购买乐理课"}, new String[]{
+            HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "合作单位", "乐团", "学员编号", "学员姓名", "手机号", "声部", "所在班级", "是否预约", "器乐等级", "小组等级", "是否购买VIP", "是否购买小组课"}, new String[]{
                     "organName", "cooperationOrganName", "musicGroupName", "userId", "username", "phone", "subjectName",
                     "currentClass", "isReserve == true ?'是':'否'", "gradeLeave"
                     , "theoryLevel", "buyVipFlag == true ?'是':'否'", "buyTheoryCourseFlag == true ?'是':'否'"}, rows);
@@ -340,7 +340,7 @@ public class ExportController extends BaseController {
         try {
             HSSFWorkbook workbook = POIUtil.exportExcel(new String[]{"分部", "总成交金额", "总购买人数", "人均购买金额",
                     "20节1v1成交金额", "20节1v1成交人数", "40节1v1成交金额", "40节1v1成交人数", "20节1v2成交金额", "20节1v2成交人数",
-                    "40节1v2成交金额", "40节1v2成交人数", "乐理课成交金额", "乐理课成交人数", "赠送会员人数"}, new String[]{
+                    "40节1v2成交金额", "40节1v2成交人数", "小组课成交金额", "小组课成交人数", "赠送会员人数"}, new String[]{
                     "organName", "totalBuyAmount", "totalBuyNum", "avgBuyAmount", "vip1V120Amount", "vip1V120Num", "vip1V140Amount",
                     "vip1V140Num", "vip1V220Amount", "vip1V220Num", "vip1V240Amount"
                     , "vip1V240Num", "musicTheoryAmount", "musicTheoryNum", "giveMemberNum"}, rows);
@@ -1037,7 +1037,7 @@ public class ExportController extends BaseController {
     public void queryPage(SporadicChargeInfoQueryInfo queryInfo, HttpServletResponse response) throws IOException {
         queryInfo.setPage(1);
         queryInfo.setRows(49999);
-        queryInfo.setIsExport(true);
+        queryInfo.setExport(true);
         queryInfo.setOrganId(organizationService.getEmployeeOrgan(queryInfo.getOrganId()));
         List<SporadicChargeInfo> rows = sporadicChargeInfoService.queryDetailPage(queryInfo).getRows();
 //        for (SporadicChargeInfo row : rows) {
@@ -1363,7 +1363,7 @@ public class ExportController extends BaseController {
             }
 
             String[] header = {"分部", "上课日期", "学生编号", "课程编号", "学员是否到课", "课程班名称", "老师", "教材内容", "发音", "节奏",
-                    "乐理", "曲目", "评价备注", "回访日期(布置训练)", "完成app双向沟通", "学员评分", "是否布置训练", "是否提交训练", "是否回复训练", "教务老师", "教务评价"};
+                    "小组", "曲目", "评价备注", "回访日期(布置训练)", "完成app双向沟通", "学员评分", "是否布置训练", "是否提交训练", "是否回复训练", "教务老师", "教务评价"};
             String[] body = {"organName", "classDateStr", "studentId", "id", "attendanceStr", "courseName",
                     "teacherName", "teachingMaterial", "pronunciationStr", "tempoStr", "musicTheoryStr", "song",
                     "memo", "createTimeStr", "hasLiaison", "studentReview", "assignHomeworkStr", "handHomeworkStr", "homeWorkReplied", "eduTeacherName", "courseReview"};
@@ -1727,7 +1727,7 @@ public class ExportController extends BaseController {
                 }
             }
 
-            String[] header = {"分部", "上课日期", "课程编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理",
+            String[] header = {"分部", "上课日期", "课程编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "小组",
                     "曲目", "评价备注", "回访日期(布置训练)", "是否布置训练", "是否提交训练", "教务老师", "教务评价"};
             String[] body = {"organName", "classDateStr", "id", "courseName", "teacherName", "teachingMaterial",
                     "pronunciationStr", "tempoStr", "musicTheoryStr", "song", "memo", "createTimeStr", "assignHomeworkStr",
@@ -1778,7 +1778,7 @@ public class ExportController extends BaseController {
         for (DegreeRegistration row : pageList.getRows()) {
 //            row.setActivityTag(map.get(row.getLevel()));
 //            if (row.getType() == DegreeTypeEnum.THEORY) {
-//                row.setSubject("乐理");
+//                row.setSubject("小组");
 //            }
             row.setGender("1".equals(row.getGender()) ? "男" : "女");
             row.setLevel(map.get(row.getLevel()));
@@ -1801,7 +1801,7 @@ public class ExportController extends BaseController {
         OutputStream outputStream = response.getOutputStream();
         try {
             String[] header = {"姓名", "性别", "用户编号", "证件号码", "所属城市", "学校", "报考专业", "报考信息", "证书", "联系电话", "备注", "缴费状态", "订单编号", "交易流水号", "报名时间"};
-            String[] body = {"name", "gender", "userId", "idcard",  "organName", "com/ym/app/web/controller/school", "type.code =='GRADE'?'专业考级':'乐理考级'",
+            String[] body = {"name", "gender", "userId", "idcard",  "organName", "com/ym/app/web/controller/school", "type.code =='GRADE'?'专业考级':'小组考级'",
                     "type.code =='GRADE'?subjectName+'/'+level+'/'+money +'元':level+'/'+money +'元'",
                     "theoryCert", "mobile", "memo", "statusStr", "orderNo", "transNo", "createTime"};
             HSSFWorkbook workbook = POIUtil.exportExcel(header, body, pageList.getRows());

+ 2 - 2
mec-application/src/main/java/com/ym/mec/web/controller/HfMerchantConfigController.java

@@ -68,8 +68,8 @@ public class HfMerchantConfigController extends BaseController {
     }
 
     @ApiOperation("根据机构id查询汇付商户配置")
-    @GetMapping(value = "/queryByTenantId/{payerName}/{id}")
-    public HttpResponseResult<HfMerchantConfig> queryByTenantId(@PathVariable("payerName") String payerName, @ApiParam(value = "机构ID", required = true) @PathVariable("id") Integer id) {
+    @GetMapping(value = "/queryByTenantId")
+    public HttpResponseResult<HfMerchantConfig> queryByTenantId(String payerName, Integer id) {
         return succeed(hfMerchantConfigService.queryByTenantId(id, payerName));
     }
 

+ 1 - 1
mec-application/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java

@@ -68,7 +68,7 @@ public class SporadicChargeInfoController extends BaseController {
 			if(user.getOrganId() == null){
 				return failed("分部信息异常");
 			}
-			sporadicChargeInfo.setOrganId(user.getOrganId());
+			sporadicChargeInfo.setOrganId(user.getOrganId().toString());
 		}
 		if(sporadicChargeInfo.getChargeType().equals(SporadicChargeTypeEnum.LUCKY_BAG_ACTIVE)){
 			SporadicChargeInfo info = sporadicChargeInfoService.findByOrganIdAndType(sporadicChargeInfo.getOrganId(), sporadicChargeInfo.getChargeType().getCode());

+ 1 - 1
mec-application/src/main/java/com/ym/mec/web/controller/StudentStatisticsController.java

@@ -113,7 +113,7 @@ public class StudentStatisticsController extends BaseController {
         if(Objects.equals(queryInfo.getGroupType(),"VIP")){
             name = "VIP课学员统计";
         }else if(Objects.equals(queryInfo.getGroupType(),"THEORY")){
-            name = "乐理课学员统计";
+            name = "小组课学员统计";
         }
         String fileName = new StringBuffer(name)
                 .append("-")

+ 348 - 0
mec-application/src/main/java/com/ym/mec/web/controller/open/OpenDouble11StaticsController.java

@@ -0,0 +1,348 @@
+package com.ym.mec.web.controller.open;
+
+import com.alibaba.fastjson.JSON;
+import com.microsvc.toolkit.common.response.template.R;
+import com.ym.mec.biz.dal.dao.StudentPaymentOrderDao;
+import com.ym.mec.biz.dal.entity.Organization;
+import com.ym.mec.biz.dal.entity.SysConfig;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import com.ym.mec.biz.dal.wrapper.Double11StaticWrapper;
+import com.ym.mec.biz.service.OrganizationService;
+import com.ym.mec.biz.service.SysConfigService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.util.collection.MapUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.jetbrains.annotations.NotNull;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.math.BigDecimal;
+import java.rmi.MarshalledObject;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * @author 袁亮
+ * @apiNote 2023双11销售统计
+ */
+@Slf4j
+@Validated
+@RestController
+@RequestMapping("${app-config.url.web:}/open/double11Statics")
+@Api(tags = "2023双11统计")
+public class OpenDouble11StaticsController extends BaseController {
+
+    @Autowired
+    private StudentPaymentOrderDao studentPaymentOrderDao;
+
+    @Autowired
+    private OrganizationService organizationService;
+
+    @Autowired
+    private SysConfigService sysConfigService;
+
+
+    @ApiOperation(value = "2023双11销售统计", notes = "2023双11销售统计")
+    @GetMapping("/saleStatics")
+    public R<Double11StaticWrapper.SaleStatics> saleStatics() {
+        Double11StaticWrapper.SaleStaticsQuery query = new Double11StaticWrapper.SaleStaticsQuery();
+
+        SysConfig config = sysConfigService.findByParamName("2023_double_eleven_active_config");
+        SysConfig orgs = sysConfigService.findByParamName("2023_activity_organ");
+        if (orgs != null) {
+            query.setOrganId(orgs.getParanValue());
+        }
+        Double11StaticWrapper.SaleStaticConfigParam configParam =
+                JSON.parseObject(config.getParanValue(), Double11StaticWrapper.SaleStaticConfigParam.class);
+
+        Double11StaticWrapper.SaleStatics result = new Double11StaticWrapper.SaleStatics();
+        // 1V1
+        query.setSaleStaticsType(1);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser s1v1 = studentPaymentOrderDao.saleStatics(query);
+        result.setTotalSale1V1(s1v1.getSaleAmount());
+        result.setTotalUser1V1PurchaseNumber(s1v1.getUserPurchaseNumber());
+
+        // 1v12
+        query.setSaleStaticsType(2);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser s1v2 = studentPaymentOrderDao.saleStatics(query);
+        result.setTotalSale1V2(s1v2.getSaleAmount());
+        result.setTotalUser1V2PurchaseNumber(s1v2.getUserPurchaseNumber());
+
+        // 乐理直播
+        query.setSaleStaticsType(3);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser theory = studentPaymentOrderDao.saleStatics(query);
+        result.setTotalSaleTheory(theory.getSaleAmount());
+        result.setTotalUserTheoryPurchaseNumber(theory.getUserPurchaseNumber());
+
+        // 云教练
+        query.setSaleStaticsType(4);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser cloudTeacher = studentPaymentOrderDao.saleStatics(query);
+        result.setTotalSaleCloudTeacher(cloudTeacher.getSaleAmount());
+        result.setTotalUserCloudTeacherPurchaseNumber(cloudTeacher.getUserPurchaseNumber());
+
+        // 乐器
+        query.setSaleStaticsType(5);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser good = studentPaymentOrderDao.musicalSaleStatics(query);
+        result.setTotalSaleMusical(good.getSaleAmount());
+        result.setTotalUserMusicalPurchaseNumber(good.getUserPurchaseNumber());
+
+        // 保价卡
+        query.setSaleStaticsType(6);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser sporadic = studentPaymentOrderDao.saleStatics(query);
+        result.setTotalSaleMaintenance(sporadic.getSaleAmount());
+        result.setTotalUserMaintenancePurchaseNumber(sporadic.getUserPurchaseNumber());
+
+        // 小组课
+        query.setSaleStaticsType(7);
+        setQueryParam(query, configParam);
+        Double11StaticWrapper.SaleAmountAndUser smallGroups = studentPaymentOrderDao.saleStatics(query);
+        result.setSmallGroupsMaintenance(smallGroups.getSaleAmount());
+        result.setSmallGroupsPurchaseNumber(smallGroups.getUserPurchaseNumber());
+
+        BigDecimal totalAmount = result.getTotalSale1V1()
+                .add(result.getTotalSale1V2())
+                .add(result.getTotalSaleMaintenance())
+                .add(result.getTotalSaleMusical())
+                .add(result.getTotalSaleTheory())
+                .add(result.getTotalSaleCloudTeacher())
+                .add(result.getSmallGroupsMaintenance());
+        result.setTotalSaleAmount(totalAmount);
+        return R.from(result);
+    }
+
+    @ApiOperation(value = "2023双11销售统计详情", notes = "2023双11销售统计详情")
+    @GetMapping("/saleStaticsDetail")
+    public R<List<Double11StaticWrapper.SaleAmountAndUser>> saleStaticsDetail(Double11StaticWrapper.SaleStaticsQuery query) {
+
+
+        SysConfig config = sysConfigService.findByParamName("2023_double_eleven_active_config");
+        Double11StaticWrapper.SaleStaticConfigParam configParam =
+                JSON.parseObject(config.getParanValue(), Double11StaticWrapper.SaleStaticConfigParam.class);
+        Map<Integer, Organization> orgIdMap = new HashMap<>();
+        SysConfig orgs = sysConfigService.findByParamName("2023_activity_organ");
+        if (orgs != null) {
+            query.setOrganId(orgs.getParanValue());
+            Map<Integer, Organization> mapById = organizationService.getMapById(Arrays.stream(query.getOrganId()
+                    .split(",")).map(Integer::valueOf).collect(Collectors.toList()));
+            orgIdMap.putAll(mapById);
+            configParam.setOrganId(orgs.getParanValue());
+        } else {
+            List<Organization> allOrgans = organizationService.findAllOrgans(query.getTenantId());
+            Map<Integer, Organization> mapById = allOrgans.stream()
+                    .collect(Collectors.toMap(Organization::getId, Function.identity()));
+            orgIdMap.putAll(mapById);
+            List<String> organId =
+                    allOrgans.stream().map(next -> String.valueOf(next.getId())).collect(Collectors.toList());
+            configParam.setOrganId(String.join(",", organId));
+        }
+        List<Double11StaticWrapper.SaleAmountAndUser> result;
+        Integer saleStaticsType = query.getSaleStaticsType();
+        if (0 == saleStaticsType) { //将不同类型数据汇总
+            List<Double11StaticWrapper.SaleAmountAndUser> allResult = new ArrayList<>();
+            for (int i = 1; i <= 7; i++) {
+                query.setSaleStaticsType(i);
+                setQueryParam(query, configParam);
+                List<Double11StaticWrapper.SaleAmountAndUser> oneResult = queryOrgSaleAmount(query, orgIdMap);
+                allResult.addAll(oneResult);
+            }
+
+            List<Double11StaticWrapper.StudentCount> studentNumByOrgan =
+                    studentPaymentOrderDao.count2023Double11StudentsByOrgan(configParam);
+            Map<Integer, Integer> countByOgranId = studentNumByOrgan.stream()
+                    .collect(Collectors.toMap(Double11StaticWrapper.StudentCount::getOrganId, Double11StaticWrapper.StudentCount::getCount));
+
+
+            Map<Integer, List<Double11StaticWrapper.SaleAmountAndUser>> groupByOrg = allResult.stream()
+                    .collect(Collectors.groupingBy(Double11StaticWrapper.SaleAmountAndUser::getOrganId));
+            result = groupByOrg.entrySet().stream()
+                    .map(entry -> {
+                        Double11StaticWrapper.SaleAmountAndUser amount = new Double11StaticWrapper.SaleAmountAndUser();
+                        amount.setOrganId(entry.getKey());
+                        amount.setOrganName(orgIdMap.getOrDefault(entry.getKey(), new Organization()).getName());
+                        for (Double11StaticWrapper.SaleAmountAndUser v : entry.getValue()) {
+                            amount.setActualAmount(amount.getActualAmount().add(v.getActualAmount()));
+                            amount.setBalancePaymentAmount(amount.getBalancePaymentAmount().add(v.getBalancePaymentAmount()));
+                        }
+                        amount.setUserPurchaseNumber(countByOgranId.getOrDefault(entry.getKey(),0));
+                        return amount;
+                    }).collect(Collectors.toList());
+        } else {
+            setQueryParam(query, configParam);
+            result = queryOrgSaleAmount(query, orgIdMap);
+        }
+
+        // 排序
+        String orderBy = Optional.ofNullable(query.getOrderBy()).orElse("saleAmount");
+        int asc = Optional.ofNullable(query.getAsc()).orElse(0);
+        if ("saleAmount".equals(orderBy)) {
+            result.sort((o1, o2) -> {
+                if (1 == asc) {
+                    return o1.getSaleAmount().compareTo(o2.getSaleAmount());
+                } else {
+                    return o2.getSaleAmount().compareTo(o1.getSaleAmount());
+                }
+            });
+        } else if ("userCount".equals(orderBy)) {
+            result.sort((o1, o2) -> {
+                if (1 == asc) {
+                    return o1.getUserPurchaseNumber().compareTo(o2.getUserPurchaseNumber());
+                } else {
+                    return o2.getUserPurchaseNumber().compareTo(o1.getUserPurchaseNumber());
+                }
+            });
+        }
+        return R.from(result);
+    }
+
+
+    @ApiOperation(value = "2023双11销售统计详情", notes = "2023双11销售统计详情")
+    @GetMapping("/queryStudentPaymentOrder")
+    public R<PageInfo<Double11StaticWrapper.SaleStaticsStudent>> queryStudentPaymentOrder(Double11StaticWrapper.SaleStaticsStudentQuery query) {
+        Double11StaticWrapper.SaleStaticsQuery temp = new Double11StaticWrapper.SaleStaticsQuery();
+        SysConfig config = sysConfigService.findByParamName("2023_double_eleven_active_config");
+        Double11StaticWrapper.SaleStaticConfigParam configParam =
+                JSON.parseObject(config.getParanValue(), Double11StaticWrapper.SaleStaticConfigParam.class);
+        temp.setSaleStaticsType(query.getSaleStaticsType());
+        setQueryParam(temp, configParam);
+
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, temp);
+
+        query.setOrderBy("t.pay_time_");
+        MapUtil.populateMap(params, query);
+        PageInfo<Double11StaticWrapper.SaleStaticsStudent> pageInfo = new PageInfo<>(query.getPage(), query.getRows());
+        List<Double11StaticWrapper.SaleStaticsStudent> dataList = new ArrayList<>();
+        Integer count = studentPaymentOrderDao.queryPaymentStudentCount(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = studentPaymentOrderDao.queryPaymentStudentByPage(params);
+            dataList.forEach(next -> {
+                String phone = next.getPhone();
+                if (StringUtils.isNotEmpty(phone)) {
+                    next.setPhone(phone.replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+            });
+        }
+        pageInfo.setRows(dataList);
+        return R.from(pageInfo);
+    }
+
+    @ApiOperation(value = "获取分部列表")
+    @GetMapping("/getOrgans")
+    public HttpResponseResult<List<Organization>> getOrgans() {
+        SysConfig config = sysConfigService.findByParamName("2023_double_eleven_active_config");
+        Double11StaticWrapper.SaleStaticConfigParam configParam =
+                JSON.parseObject(config.getParanValue(), Double11StaticWrapper.SaleStaticConfigParam.class);
+        Integer tenantId = Optional.ofNullable(configParam.getTenantId()).orElse(1);
+        List<Organization> allOrgans = organizationService.findAllOrgans(tenantId);
+        allOrgans.sort(Comparator.comparing(Organization::getName));
+        return succeed(allOrgans);
+    }
+
+    private void setQueryParam(Double11StaticWrapper.SaleStaticsQuery query,
+                               Double11StaticWrapper.SaleStaticConfigParam configParam) {
+
+        Integer saleStaticsType = query.getSaleStaticsType();
+        query.setGroupType(null);
+        query.setType(null);
+        query.setActivityId(null);
+        query.setGoodId(null);
+        query.setMusicGroupId(null);
+        if (StringUtils.isEmpty(query.getOrganId())) {
+            query.setTenantId(Optional.ofNullable(configParam.getTenantId()).orElse(1));
+        }
+
+        if (saleStaticsType == 1) {
+            // 1V1
+            query.setGroupType(GroupType.ACTIVITY);
+            query.setType(OrderTypeEnum.SMALL_CLASS_TO_BUY);
+            query.setActivityId(configParam.getV1());
+        } else if (saleStaticsType == 2) {
+            // 1v2
+            query.setGroupType(GroupType.ACTIVITY);
+            query.setType(OrderTypeEnum.SMALL_CLASS_TO_BUY);
+            query.setActivityId(configParam.getV2());
+        } else if (saleStaticsType == 3) {
+            // 乐理
+            query.setGroupType(GroupType.LIVE);
+            query.setType(OrderTypeEnum.LIVE_GROUP_BUY);
+            query.setMusicGroupId(configParam.getTheoryLive());
+        } else if (saleStaticsType == 4) {
+            // 云教练
+            query.setGroupType(GroupType.ACTIVITY);
+            query.setType(OrderTypeEnum.MEMBER);
+            query.setActivityId(configParam.getCloudTeacher());
+        } else if (saleStaticsType == 5) {
+            // 乐器销售
+            SysConfig good = sysConfigService.findByParamName("2023_activity_good");
+            query.setGoodId(good.getParanValue());
+
+            SysConfig startTime = sysConfigService.findByParamName("2023_activity_start_time");
+            query.setStartPayTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(
+                    Optional.ofNullable(startTime.getParanValue()).orElse("2023-11-11 00:00:00"),
+                    new ParsePosition(0)));
+
+            SysConfig endTime = sysConfigService.findByParamName("2023_activity_end_time");
+            query.setEndPayTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(
+                    Optional.ofNullable(endTime.getParanValue()).orElse("2023-11-11 23:59:59"),
+                    new ParsePosition(0)));
+            configParam.setStartPayTime(query.getStartPayTime());
+            configParam.setEndPayTime(query.getEndPayTime());
+            configParam.setGoodId(good.getParanValue());
+        } else if (saleStaticsType == 6) {
+            // 保价卡销售
+            query.setGroupType(GroupType.SPORADIC);
+            query.setType(OrderTypeEnum.SPORADIC);
+            query.setMusicGroupId(configParam.getSporadic());
+        }else if (saleStaticsType == 7) {
+            // 小组课
+            query.setGroupType(GroupType.ACTIVITY);
+            query.setType(OrderTypeEnum.SMALL_CLASS_TO_BUY);
+            query.setActivityId(configParam.getTheory());
+        }
+    }
+
+    private List<Double11StaticWrapper.SaleAmountAndUser> queryOrgSaleAmount(Double11StaticWrapper.SaleStaticsQuery query,
+                                                                             Map<Integer, Organization> orgIdMap) {
+        List<Double11StaticWrapper.SaleAmountAndUser> saleAmount = studentPaymentOrderDao.saleStaticsByOrgId(query);
+        Map<Integer, Double11StaticWrapper.SaleAmountAndUser> idDataMap = saleAmount.stream()
+                .collect(Collectors.toMap(Double11StaticWrapper.SaleAmountAndUser::getOrganId, Function.identity()));
+
+        return orgIdMap.entrySet().stream()
+                .map(next -> {
+                    if (idDataMap.containsKey(next.getKey())) {
+                        Double11StaticWrapper.SaleAmountAndUser saleAmountAndUser = idDataMap.get(next.getKey());
+                        saleAmountAndUser.setOrganName(next.getValue().getName());
+                        return saleAmountAndUser;
+                    }
+
+                    Double11StaticWrapper.SaleAmountAndUser statics = new Double11StaticWrapper.SaleAmountAndUser();
+                    statics.setOrganId(next.getKey());
+                    statics.setOrganName(next.getValue().getName());
+                    statics.setActualAmount(new BigDecimal(0));
+                    statics.setBalancePaymentAmount(new BigDecimal(0));
+                    statics.setUserPurchaseNumber(0);
+                    return statics;
+                }).collect(Collectors.toList());
+    }
+
+}

+ 7 - 0
mec-application/src/main/java/com/ym/mec/web/controller/open/OpenSysConfigController.java

@@ -29,4 +29,11 @@ public class OpenSysConfigController extends BaseController {
 		}
 		return succeed(sysConfigService.findByParamName(paramName));
 	}
+
+	@ApiOperation(value = "查询参数")
+	@GetMapping(value = "transfer")
+	public Object transfer() {
+		sysConfigService.redisTransfer();
+		return succeed();
+	}
 }

+ 11 - 11
mec-application/src/main/resources/exportColumnMapper.ini

@@ -7,7 +7,7 @@ headColumns = ["分部", "乐团编号", "乐团名称","合作单位", "乐团
 fieldColumns = ["organName", "id", "name","cooperationOrganName", "status.msg", "courseViewType.msg","chargeTypeName","educationalTeacherName", "teamTeacherName", "groupMemberNum","payNum","createTime","updateTime","hasVerifyMusicalList?'已确认':'未确认'"]
 
 [21年暑期考级活动统计页面详情导出]
-headColumns = ["分部", "合作单位", "乐团","学员编号", "学员姓名", "手机号","声部","所在班级","指导老师", "是否预约", "器乐等级", "乐理等级", "是否购买VIP","是否购买乐理课"]
+headColumns = ["分部", "合作单位", "乐团","学员编号", "学员姓名", "手机号","声部","所在班级","指导老师", "是否预约", "器乐等级", "小组等级", "是否购买VIP","是否购买小组课"]
 fieldColumns = ["organName", "cooperationOrganName", "musicGroupName","userId", "username", "phone","subjectName","currentClass", "realName", "isReserve == true ?'是':'否'","gradeLeave","theoryLevel","buyVipFlag == true ?'是':'否'","buyTheoryCourseFlag == true ?'是':'否'"]
 
 [2021双十一学员购买详情]
@@ -15,7 +15,7 @@ headColumns = ["学员编号", "学员姓名","订单号", "交易金额","交
 fieldColumns = ["userId", "username", "orderNo","amount", "payTime", "createTime","type","giveMember==0?'否':'是'"]
 
 [分部2021双11活动统计导出]
-headColumns = ["分部", "总成交金额","总购买人数", "人均购买金额","20节1v1成交金额", "20节1v1成交人数", "40节1v1成交金额", "40节1v1成交人数", "20节1v2成交金额", "20节1v2成交人数","40节1v2成交金额", "40节1v2成交人数", "乐理课成交金额", "乐理课成交人数", "赠送会员人数"]
+headColumns = ["分部", "总成交金额","总购买人数", "人均购买金额","20节1v1成交金额", "20节1v1成交人数", "40节1v1成交金额", "40节1v1成交人数", "20节1v2成交金额", "20节1v2成交人数","40节1v2成交金额", "40节1v2成交人数", "小组课成交金额", "小组课成交人数", "赠送会员人数"]
 fieldColumns = ["organName", "totalBuyAmount", "totalBuyNum","avgBuyAmount", "vip1V120Amount", "vip1V120Num","vip1V140Amount", "vip1V140Num", "vip1V220Amount", "vip1V220Num","vip1V240Amount" ,"vip1V240Num","musicTheoryAmount","musicTheoryNum","giveMemberNum"]
 
 [学生个人账户余额导出]
@@ -115,15 +115,15 @@ headColumns = ["序号", "学生编号", "学生姓名", "交易流水号", "订
 fieldColumns = ["id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount","balancePaymentAmount","couponRemitFee", "transferFee", "platformFee", "payTime", "organName","memo"]
 
 [订单列表导出1]
-headColumns = ["序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额", "课程家长采买","课程学校采买", "VIP课",  "直播课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费","账户充值", "零售乐器","大件乐器", "其它", "汇付手续费","平台手续费", "到账时间","关联乐团ID/VIP课ID","课程形态","类型","收费乐团编号","收费乐团","零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
+headColumns = ["序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额", "课程家长采买","课程学校采买", "VIP课",  "直播课", "网管课", "小组课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费","账户充值", "零售乐器","大件乐器", "其它", "汇付手续费","平台手续费", "到账时间","关联乐团ID/VIP课ID","课程形态","类型","收费乐团编号","收费乐团","零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
 fieldColumns = ["id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount","balancePaymentAmount","couponRemitFee","musicGroupCourseFee","courseSchoolBuyAmount", "vipCourseFee",  "liveCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee","leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee","retailGoodsFee","largeMusicalFee", "otherFee", "transferFee", "platformFee", "payTime", "musicGroupId","groupType.desc","typeDesc","feeMusicGroupId","feeMusicGroupName", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"]
 
 [订单列表导出2]
-headColumns = ["序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额","课程家长采买","课程学校采买", "VIP课",  "直播课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费","账户充值", "零售乐器","大件乐器", "其它","平台手续费", "到账时间",    "关联乐团ID/VIP课ID", "课程形态","类型","收费乐团编号","收费乐团", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
+headColumns = ["序号", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额","课程家长采买","课程学校采买", "VIP课",  "直播课", "网管课", "小组课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费","账户充值", "零售乐器","大件乐器", "其它","平台手续费", "到账时间",    "关联乐团ID/VIP课ID", "课程形态","类型","收费乐团编号","收费乐团", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
 fieldColumns = ["id", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount",  "couponRemitFee",     "musicGroupCourseFee","courseSchoolBuyAmount", "vipCourseFee",  "liveCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee",     "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee","retailGoodsFee","largeMusicalFee", "otherFee", "platformFee", "payTime", "musicGroupId", "groupType.desc","typeDesc","feeMusicGroupId","feeMusicGroupName", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"]
 
 [订单列表汇总导出]
-headColumns = ["分部", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额","课程家长采买","课程学校采买", "VIP课",  "直播课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费","账户充值", "零售乐器","大件乐器", "其它"]
+headColumns = ["分部", "订单金额", "应付金额", "现金支付", "余额支付", "优惠金额","课程家长采买","课程学校采买", "VIP课",  "直播课", "网管课", "小组课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费","账户充值", "零售乐器","大件乐器", "其它"]
 fieldColumns = ["organName", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount",  "couponRemitFee","musicGroupCourseFee","courseSchoolBuyAmount", "vipCourseFee", "liveCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee","leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee","retailGoodsFee","largeMusicalFee", "otherFee"]
 
 [学员小课记录导出]
@@ -135,7 +135,7 @@ headColumns = ["学员编号", "学员姓名", "性别", "联系电话","入团
 fieldColumns = ["userId", "realName", "gender", "phone","registerTime", "currentGrade", "currentClass", "subjectName", "studentStatus", "paymentStatus.desc" ,"courseFee", "activeName", "hasCourse ? '是' : '否'" ,"carePackage == null || carePackage == 0 ? '不可用' : carePackage == 1 ? '可用' : '已使用'" ,"comeOnPackage == null || comeOnPackage == 0 ? '不可用' : comeOnPackage == 1 ? '可用' : '已使用'" ,"noPaymentAmount == null ? 0 : noPaymentAmount", "quitReason", "membershipEndTime","membershipEndTime == null ? hasNoStartCloudTeacher ? '未生效' : '未购买' : membershipDay >= 0 ? membershipDay : hasNoStartCloudTeacher ? '未生效' : '会员已过期'"]
 
 [评论列表导出]
-headColumns = ["分部", "上课日期", "学生编号", "课程编号", "学员是否到课", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置训练)", "完成app双向沟通", "学员评分", "是否布置训练", "是否提交训练", "是否回复训练", "教务老师", "教务评价"]
+headColumns = ["分部", "上课日期", "学生编号", "课程编号", "学员是否到课", "课程班名称", "老师", "教材内容", "发音", "节奏", "小组", "曲目", "评价备注", "回访日期(布置训练)", "完成app双向沟通", "学员评分", "是否布置训练", "是否提交训练", "是否回复训练", "教务老师", "教务评价"]
 fieldColumns = ["organName", "classDateStr", "studentId", "id", "attendanceStr", "courseName",  "teacherName", "teachingMaterial", "pronunciationStr", "tempoStr", "musicTheoryStr", "song",  "memo", "createTimeStr", "hasLiaison", "studentReview", "assignHomeworkStr", "handHomeworkStr", "homeWorkReplied", "eduTeacherName", "courseReview"]
 
 [网管课管理导出]
@@ -159,11 +159,11 @@ headColumns = ["分部", "课程组类型", "课程编号", "时间", "课程名
 fieldColumns = ["organName", "groupType.desc", "courseScheduleId", "startClassTime", "courseName", "teacherId", "teacherName",         "signInStatusStr", "signOutStatusStr", "actualReceipts", "salaryType", "actualSalary", "reduceSalary", "finalSalary",         "confirmStatus.desc", "memo", "deductionReason"]
 
 [vip评论列表导出]
-headColumns = ["分部", "上课日期", "课程编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "乐理", "曲目", "评价备注", "回访日期(布置训练)", "是否布置训练", "是否提交训练", "教务老师", "教务评价"]
+headColumns = ["分部", "上课日期", "课程编号", "课程班名称", "老师", "教材内容", "发音", "节奏", "小组", "曲目", "评价备注", "回访日期(布置训练)", "是否布置训练", "是否提交训练", "教务老师", "教务评价"]
 fieldColumns = ["organName", "classDateStr", "id", "courseName", "teacherName", "teachingMaterial",  "pronunciationStr", "tempoStr", "musicTheoryStr", "song", "memo", "createTimeStr", "assignHomeworkStr",  "handHomeworkStr", "eduTeacherName", "courseReview"]
 
 [考级报名导出]
-headColumns = ["姓名", "性别", "身份证号", "城市", "学校", "报考乐器", "报考级别","乐理级别证书", "家长联系电话", "考级费用","备注", "缴费状态", "订单编号", "商户订单号", "报名时间"]
+headColumns = ["姓名", "性别", "身份证号", "城市", "学校", "报考乐器", "报考级别","小组级别证书", "家长联系电话", "考级费用","备注", "缴费状态", "订单编号", "商户订单号", "报名时间"]
 fieldColumns = ["name", "gender == 1?'男':'女'", "idcard", "city", "school", "subject", "level", "theoryCert", "mobile", "money","memo", "status == 2?'已缴费':'未缴费'", "orderNo", "transNo", "createTime"]
 
 [合作单位导出]
@@ -175,11 +175,11 @@ headColumns = ["序号", "业务分部",  "学生编号", "学生姓名", "交
 fieldColumns = ["id", "userOrganName", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee", "transferFee", "platformFee", "payTime", "organName", "memo"]
 
 [财务管理导出1]
-headColumns = ["序号", "业务分部",  "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课",  "直播课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "汇付手续费", "平台手续费", "到账时间", "关联乐团ID/VIP课ID", "课程形态","类型","收费乐团编号","收费乐团", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
+headColumns = ["序号", "业务分部",  "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课",  "直播课", "网管课", "小组课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "汇付手续费", "平台手续费", "到账时间", "关联乐团ID/VIP课ID", "课程形态","类型","收费乐团编号","收费乐团", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
 fieldColumns = ["id", "userOrganName", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount", "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee","musicGroupCourseFee", "vipCourseFee",  "liveCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee", "otherFee", "transferFee", "platformFee", "payTime", "musicGroupId", "groupType.desc","typeDesc","feeMusicGroupId","feeMusicGroupName", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"]
 
 [财务管理导出2]
-headColumns = ["序号", "业务分部", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课",  "直播课", "网管课", "乐理课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "平台手续费", "到账时间", "关联乐团ID/VIP课ID", "课程形态","类型","收费乐团编号","收费乐团", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
+headColumns = ["序号", "业务分部", "学生编号", "学生姓名", "交易流水号", "订单编号", "收款渠道", "收款账户", "订单金额", "应付金额", "现金支付", "余额支付", "分润账户", "分润金额", "分配余额", "优惠金额", "乐团课", "VIP课",  "直播课", "网管课", "小组课", "考级", "维修费用", "乐保费用", "云教练", "押金", "乐器", "教辅费用", "上门费", "账户充值", "其它", "平台手续费", "到账时间", "关联乐团ID/VIP课ID", "课程形态","类型","收费乐团编号","收费乐团", "零星收款类别", "专业", "分部", "教学点", "合作单位", "乐团主管", "备注"]
 fieldColumns = ["id", "userOrganName", "userId", "user.username", "transNo", "orderNo", "paymentChannel", "merNos", "orderAmount" , "expectAmount", "actualAmount", "balancePaymentAmount", "routeMerNo", "routeAmount", "routeBalance",  "couponRemitFee","musicGroupCourseFee", "vipCourseFee",  "liveCourseFee", "practiceCourseFee", "theoryCourseFee", "degreeFee", "repairFee", "maintenanceFee", "cloudTeacherFee", "leaseFee", "musicalFee", "teachingFee", "visitFee", "rechargeFee", "otherFee", "platformFee", "payTime", "musicGroupId", "groupType.desc","typeDesc","feeMusicGroupId","feeMusicGroupName", "sporadicType", "subjectName", "organName", "schoolName", "cooperationOrganName", "eduTeacher", "memo"]
 
 [老师默认课酬导出]
@@ -274,7 +274,7 @@ fieldColumns = ["organName", "username", "userId", "teacherName", "teacherId", "
 headColumns = ["分部", "学员姓名", "学员编号", "指导老师", "指导老师编号", "教务老师", "教务老师编号", "声部课老师", "声部课老师编号", "总课次", "已进行课次", "剩余课次", "上次课时间", "近30天消耗课时", "是否活跃", "课程类型"]
 fieldColumns = ["organName", "username", "userId", "teacherName", "teacherId", "eduName", "eduId",  "subjectTeacherName",  "subjectTeacherId", "totalClassNum", "completedTimes", "remaindTimes", "lastCourseTime", "consumerTimes", "activeFlag", "courseType"]
 
-[乐理课学员课程信息导出]
+[小组课学员课程信息导出]
 headColumns = ["分部", "学员姓名", "学员编号", "指导老师", "指导老师编号", "教务老师", "教务老师编号", "总课次", "已进行课次", "剩余课次", "上次课时间", "年级"]
 fieldColumns = ["organName", "username", "userId", "teacherName", "teacherId", "eduName", "eduId", "totalClassNum", "startClassNum", "subClassNum", "beforeClassNum", "grade"]
 

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/PhoneAuthenticationProvider.java

@@ -49,7 +49,7 @@ public class PhoneAuthenticationProvider extends AbstractAuthenticationProvider
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    protected UserDetails retrieveUser(String username, Authentication authentication) throws AuthenticationException {
+    public UserDetails retrieveUser(String username, Authentication authentication) throws AuthenticationException {
         LoginEntity loginEntity = (LoginEntity) authentication.getCredentials();
         if (loginEntity == null) {
             throw new BadCredentialsException("Bad credentials");

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

@@ -435,7 +435,7 @@ public interface IndexBaseMonthDataDao extends BaseDAO<Long, IndexBaseMonthData>
     //获取vip课订单数量
     List<IndexBaseMonthData> getStudentVipOrderNum(@Param("dayStr") String dayStr,@Param("tenantId") Integer tenantId);
 
-    //获取乐理课订单数量
+    //获取小组课订单数量
     List<IndexBaseMonthData> getStudentTheoryOrderNum(@Param("dayStr") String dayStr,@Param("tenantId") Integer tenantId);
 
     //获取网管课订单数量

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

@@ -12,7 +12,7 @@ import java.util.Map;
 public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeInfo> {
     SporadicChargeInfo findInfoById(@Param("id") Integer id);
 
-    SporadicChargeInfo findByOrganIdAndType(@Param("organId") Integer organId, @Param("chargeType") Integer chargeType);
+    SporadicChargeInfo findByOrganIdAndType(@Param("organId") String organId, @Param("chargeType") Integer chargeType);
 
     /**
      * 根据分部和类型获取活动信息
@@ -21,7 +21,7 @@ public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeIn
      * @param chargeType
      * @return
      */
-    List<SporadicChargeInfo> getOrganActiveInfo(@Param("organId") Integer organId, @Param("chargeType") Integer chargeType);
+    List<SporadicChargeInfo> getOrganActiveInfo(@Param("organId") String organId, @Param("chargeType") Integer chargeType);
 
     List<SporadicChargeInfo> findSporadicChargeInfos(Map<String, Object> params);
 

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentPaymentOrderDao.java

@@ -2,6 +2,7 @@ package com.ym.mec.biz.dal.dao;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.microsvc.toolkit.common.response.template.R;
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
@@ -9,6 +10,7 @@ import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.dal.enums.OrderTypeEnum;
 import com.ym.mec.biz.dal.vo.StudentPaymentOrderVo;
+import com.ym.mec.biz.dal.wrapper.Double11StaticWrapper;
 import com.ym.mec.common.dal.BaseDAO;
 
 import org.apache.ibatis.annotations.Param;
@@ -466,4 +468,16 @@ public interface StudentPaymentOrderDao extends BaseDAO<Long, StudentPaymentOrde
     List<BaseMapDto<Long, BigDecimal>> groupSellOrder(Map<String, Object> params);
 
     List<StudentPaymentOrder> queryVipQuitOrder(@Param("vipGroupId") Long vipGroupId, @Param("orderTypeEnum") OrderTypeEnum orderTypeEnum, @Param("success") DealStatusEnum success);
+
+    Double11StaticWrapper.SaleAmountAndUser saleStatics(@Param("param") Double11StaticWrapper.SaleStaticsQuery query);
+
+    Double11StaticWrapper.SaleAmountAndUser musicalSaleStatics(@Param("param") Double11StaticWrapper.SaleStaticsQuery query);
+
+    List<Double11StaticWrapper.SaleAmountAndUser> saleStaticsByOrgId(@Param("param") Double11StaticWrapper.SaleStaticsQuery query);
+
+    List<Double11StaticWrapper.SaleStaticsStudent> queryPaymentStudentByPage(Map<String, Object> params);
+
+    Integer queryPaymentStudentCount(Map<String, Object> params);
+
+    List<Double11StaticWrapper.StudentCount> count2023Double11StudentsByOrgan(@Param("param") Double11StaticWrapper.SaleStaticConfigParam configParam);
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ActivityCourseDetailDto.java

@@ -16,7 +16,7 @@ public class ActivityCourseDetailDto {
     @ApiModelProperty(value = "赠送vip", required = false)
     private Integer free_vip = 0;
 
-    @ApiModelProperty(value = "乐理课", required = false)
+    @ApiModelProperty(value = "小组课", required = false)
     private Integer music_theory = 0;
 
     private BigDecimal music_theory_price;

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ActivityUserMapperSumDto.java

@@ -40,7 +40,7 @@ public class ActivityUserMapperSumDto {
     @ApiModelProperty(value = "1v7")
     private String seven;
 
-    @ApiModelProperty(value = "乐理")
+    @ApiModelProperty(value = "小组")
     private String theory;
 
     @ApiModelProperty(value = "网管")

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/BasicUserDto.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.dal.dto;
 
-import com.ym.mec.biz.dal.enums.JoinCourseType;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Objects;

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseReviewDto.java

@@ -92,7 +92,7 @@ public class CourseReviewDto {
     @ApiModelProperty(value = "节奏",required = false)
     private Integer tempo;
 
-    @ApiModelProperty(value = "乐理",required = false)
+    @ApiModelProperty(value = "小组",required = false)
     private Integer musicTheory;
 
     @ApiModelProperty(value = "曲目",required = false)
@@ -122,7 +122,7 @@ public class CourseReviewDto {
     @ApiModelProperty(value = "节奏Str",required = false)
     private String tempoStr;
 
-    @ApiModelProperty(value = "乐理Str",required = false)
+    @ApiModelProperty(value = "小组Str",required = false)
     private String musicTheoryStr;
 
     @ApiModelProperty(value = "作业是否回复",required = false)

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DegreePayDto.java

@@ -19,7 +19,7 @@ public class DegreePayDto {
     @ApiModelProperty(value = "报考器乐等级必须购Vip课")
     private Boolean needVipCourse = false;
 
-    @ApiModelProperty(value = "乐理等级")
+    @ApiModelProperty(value = "小组等级")
     private Integer theoryLevel;
 
     @ApiModelProperty(value = "vip 1v1")
@@ -28,7 +28,7 @@ public class DegreePayDto {
     @ApiModelProperty(value = "vip 1v2")
     private Boolean vip1v2 = false;
 
-    @ApiModelProperty(value = "乐理课程")
+    @ApiModelProperty(value = "小组课程")
     private Boolean theoryCourse = false;
 
     @ApiModelProperty(value = "支付金额", required = true)

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DoubleEleven2021ActivityDto.java

@@ -13,7 +13,7 @@ public class DoubleEleven2021ActivityDto {
     @ApiModelProperty(value = "总购买数",required = false)
     private int buyNum = 0;
 
-    @ApiModelProperty(value = "购买的活动类型1、1v1 20节,2、1v1 40节,3、1v2 20节,4、1v2 40节,5、乐理课",required = false)
+    @ApiModelProperty(value = "购买的活动类型1、1v1 20节,2、1v1 40节,3、1v2 20节,4、1v2 40节,5、小组课",required = false)
     private Integer type;
 
     private Integer organId;

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/DoubleEleven2021Dto.java

@@ -49,10 +49,10 @@ public class DoubleEleven2021Dto {
     @ApiModelProperty(value = "1v2 40节课购买人数",required = false)
     private Integer vip1V240Num = 0;
 
-    @ApiModelProperty(value = "乐理课购买金额",required = false)
+    @ApiModelProperty(value = "小组课购买金额",required = false)
     private BigDecimal musicTheoryAmount = BigDecimal.ZERO;
 
-    @ApiModelProperty(value = "乐理课购买人数",required = false)
+    @ApiModelProperty(value = "小组课购买人数",required = false)
     private Integer musicTheoryNum = 0;
 
     public Integer getOrganId() {

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/RegisterUserDto.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class RegisterUserDto {
+
+    @ApiModelProperty(value = "学生姓名", required = false)
+    private String username;
+
+    @ApiModelProperty(value = "头像", required = false)
+    private String avatar;
+
+    @ApiModelProperty(value = "声部", required = false)
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "年级(数字表示)", required = false)
+    private Integer currentGradeNum;
+
+//    @ApiModelProperty(value = "当前所在班级", required = false)
+//    private String currentClass;
+}

+ 4 - 23
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SporadicPayDto.java

@@ -1,7 +1,9 @@
 package com.ym.mec.biz.dal.dto;
 
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
+@Data
 public class SporadicPayDto extends PayParamBasicDto {
 
     @ApiModelProperty(value = "用户编号",required = false)
@@ -13,27 +15,6 @@ public class SporadicPayDto extends PayParamBasicDto {
     @ApiModelProperty(value = "购买数量",required = false)
     private Integer num = 1;
 
-    public Integer getUserId() {
-        return userId;
-    }
-
-    public void setUserId(Integer userId) {
-        this.userId = userId;
-    }
-
-    public Integer getSporadicId() {
-        return sporadicId;
-    }
-
-    public void setSporadicId(Integer sporadicId) {
-        this.sporadicId = sporadicId;
-    }
-
-    public Integer getNum() {
-        return num;
-    }
-
-    public void setNum(Integer num) {
-        this.num = num;
-    }
+    @ApiModelProperty(value = "学员分部",required = false)
+    private Integer organId;
 }

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentPaymentOrderExportDto.java

@@ -64,8 +64,8 @@ public class StudentPaymentOrderExportDto extends StudentPaymentOrderRouteDto {
     @ApiModelProperty(value = "网管课程费用",required = true)
     private BigDecimal practiceCourseFee = BigDecimal.ZERO;
 
-    //乐理课程费用
-    @ApiModelProperty(value = "乐理课程费用",required = true)
+    //小组课程费用
+    @ApiModelProperty(value = "小组课程费用",required = true)
     private BigDecimal theoryCourseFee = BigDecimal.ZERO;
 
     //考级费用

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleEvaluate.java

@@ -54,7 +54,7 @@ public class CourseScheduleEvaluate extends BaseEntity {
 
     private String month;
 
-    @ApiModelProperty(value = "乐理")
+    @ApiModelProperty(value = "小组")
     private String musicTheory;
 
     @ApiModelProperty(value = "乐曲")

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleReview.java

@@ -69,7 +69,7 @@ public class CourseScheduleReview extends BaseEntity {
     private Integer tempo;
 
     /**
-    * 乐理
+    * 小组
     */
     private Integer musicTheory;
 

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/OrganizationDegreeCourseFee.java

@@ -44,15 +44,15 @@ public class OrganizationDegreeCourseFee extends BaseEntity {
     private BigDecimal vip1v2;
 
     /**
-     * 乐理课原价格
+     * 小组课原价格
      */
-    @ApiModelProperty(value = "乐理课价格")
+    @ApiModelProperty(value = "小组课价格")
     private BigDecimal originalTheory;
 
     /**
-     * 乐理课价格
+     * 小组课价格
      */
-    @ApiModelProperty(value = "乐理课价格")
+    @ApiModelProperty(value = "小组课价格")
     private BigDecimal theory;
 
     /**

+ 3 - 218
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java

@@ -3,8 +3,8 @@ package com.ym.mec.biz.dal.entity;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
 import com.ym.mec.common.entity.BaseEntity;
-
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -12,6 +12,7 @@ import java.util.Date;
 /**
  * 对应数据库表(sporadic_charge_info):
  */
+@Data
 public class SporadicChargeInfo extends BaseEntity {
 	/**  */
 	private Integer id;
@@ -22,7 +23,7 @@ public class SporadicChargeInfo extends BaseEntity {
 	@ApiModelProperty(value = "收费类型", required = true)
 	private SporadicChargeTypeEnum chargeType;
 
-	private Integer organId;
+	private String organId;
 
 	private String organName;
 
@@ -80,220 +81,4 @@ public class SporadicChargeInfo extends BaseEntity {
 	private YesOrNoEnum openMaxTerm;
 
 	private Integer version;
-
-	public String getMusicGroupName() {
-		return musicGroupName;
-	}
-
-	public void setMusicGroupName(String musicGroupName) {
-		this.musicGroupName = musicGroupName;
-	}
-
-	public String getMusicGroupId() {
-		return musicGroupId;
-	}
-
-	public void setMusicGroupId(String musicGroupId) {
-		this.musicGroupId = musicGroupId;
-	}
-
-	public Integer getOpenFlag() {
-		return openFlag;
-	}
-
-	public void setOpenFlag(Integer openFlag) {
-		this.openFlag = openFlag;
-	}
-
-	public String getUserName() {
-		return userName;
-	}
-
-	public void setUserName(String userName) {
-		this.userName = userName;
-	}
-
-	public Integer getUserId() {
-		return userId;
-	}
-
-	public void setUserId(Integer userId) {
-		this.userId = userId;
-	}
-
-	public Integer getDelFlag() {
-		return delFlag;
-	}
-
-	public void setDelFlag(Integer delFlag) {
-		this.delFlag = delFlag;
-	}
-
-	public String getOrganName() {
-		return organName;
-	}
-
-	public void setOrganName(String organName) {
-		this.organName = organName;
-	}
-
-	public String getOperatorName() {
-		return operatorName;
-	}
-
-	public void setOperatorName(String operatorName) {
-		this.operatorName = operatorName;
-	}
-
-	public BigDecimal getBalance() {
-		return balance;
-	}
-
-	public void setBalance(BigDecimal balance) {
-		this.balance = balance;
-	}
-
-	public Integer getId() {
-		return id;
-	}
-
-	public void setId(Integer id) {
-		this.id = id;
-	}
-
-	public String getTitle() {
-		return title;
-	}
-
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	public SporadicChargeTypeEnum getChargeType() {
-		return chargeType;
-	}
-
-	public void setChargeType(SporadicChargeTypeEnum chargeType) {
-		this.chargeType = chargeType;
-	}
-
-	public Integer getOrganId() {
-		return organId;
-	}
-
-	public void setOrganId(Integer organId) {
-		this.organId = organId;
-	}
-
-	public BigDecimal getAmount() {
-		return amount;
-	}
-
-	public void setAmount(BigDecimal amount) {
-		this.amount = amount;
-	}
-
-	public String getDetail() {
-		return detail;
-	}
-
-	public void setDetail(String detail) {
-		this.detail = detail;
-	}
-
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	public Date getUpdateTime() {
-		return updateTime;
-	}
-
-	public void setUpdateTime(Date updateTime) {
-		this.updateTime = updateTime;
-	}
-
-	public Integer getOperatorId() {
-		return operatorId;
-	}
-
-	public void setOperatorId(Integer operatorId) {
-		this.operatorId = operatorId;
-	}
-
-	public BigDecimal getDiscountAmount() {
-		return discountAmount;
-	}
-
-	public void setDiscountAmount(BigDecimal discountAmount) {
-		this.discountAmount = discountAmount;
-	}
-
-	public String getOpenFlagStr() {
-		return openFlagStr;
-	}
-
-	public void setOpenFlagStr(String openFlagStr) {
-		this.openFlagStr = openFlagStr;
-	}
-
-	public String getOrderType() {
-		return orderType;
-	}
-
-	public void setOrderType(String orderType) {
-		this.orderType = orderType;
-	}
-
-	public Integer getMaxNum() {
-		return maxNum;
-	}
-
-	public void setMaxNum(Integer maxNum) {
-		this.maxNum = maxNum;
-	}
-
-	public Integer getPaidNum() {
-		return paidNum;
-	}
-
-	public void setPaidNum(Integer paidNum) {
-		this.paidNum = paidNum;
-	}
-
-	public Integer getVersion() {
-		return version;
-	}
-
-	public void setVersion(Integer version) {
-		this.version = version;
-	}
-
-	public BigDecimal getMaxAmount() {
-		return maxAmount;
-	}
-
-	public void setMaxAmount(BigDecimal maxAmount) {
-		this.maxAmount = maxAmount;
-	}
-
-	public BigDecimal getPaidAmount() {
-		return paidAmount;
-	}
-
-	public void setPaidAmount(BigDecimal paidAmount) {
-		this.paidAmount = paidAmount;
-	}
-
-	public YesOrNoEnum getOpenMaxTerm() {
-		return openMaxTerm;
-	}
-
-	public void setOpenMaxTerm(YesOrNoEnum openMaxTerm) {
-		this.openMaxTerm = openMaxTerm;
-	}
 }

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupCategory.java

@@ -43,7 +43,7 @@ public class VipGroupCategory extends BaseEntity {
 	@ApiModelProperty(value = "线下课单价",required = false)
 	private BigDecimal offlineClassesUnitPrice;
 
-	@ApiModelProperty(value = "是否乐理课")
+	@ApiModelProperty(value = "是否小组课")
 	private Boolean musicTheory = false;
 
 	@ApiModelProperty("购买单价id")

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ActivityCourseType.java

@@ -10,7 +10,7 @@ public enum ActivityCourseType implements BaseEnum<String, ComplaintsStatusEnum>
     FREE_VIP("free_vip", "考级活动赠送课"),
     VIP1("vip1", "考级活动1v1VIP课"),
     VIP2("vip2", "考级活动1v2VIP课"),
-    MUSIC_THEORY("music_theory", "考级活动乐理课");
+    MUSIC_THEORY("music_theory", "考级活动小组课");
 
     private String code;
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportEnum.java

@@ -71,7 +71,7 @@ public enum ExportEnum implements BaseEnum<String, ExportEnum> {
     STUDENT_INSTRUMENT("STUDENT_INSTRUMENT", "乐保导出"),
     EXPORT_BILL("EXPORT_BILL", "对账单导出"),
     STUDENT_VIP_COURSE_INFO("STUDENT_VIP_COURSE_INFO", "VIP课学员课程信息导出"),
-    STUDENT_MUSIC_THEORY_COURSE_INFO("STUDENT_MUSIC_THEORY_COURSE_INFO", "乐理课学员课程信息导出"),
+    STUDENT_MUSIC_THEORY_COURSE_INFO("STUDENT_MUSIC_THEORY_COURSE_INFO", "小组课学员课程信息导出"),
     VIP_STUDENT_COURSE_MANAGE("VIP_STUDENT_COURSE_MANAGE", "vip学员课程管理"),
     EXERCISES_SITUATION("EXERCISES_SITUATION", "服务指标导出"),
     EXPORT_STUDENT_SUBCOURSE("EXPORT_STUDENT_SUBCOURSE", "活动资格导出"),

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/ExportTypeEnum.java

@@ -7,7 +7,7 @@ public enum ExportTypeEnum implements BaseEnum<Integer, ExportTypeEnum> {
 	COURSE_SCHEDULE(1, "课表列表"),
 	ROUTE_ORDER(2, "财务管理"),
 	STUDENT_VIP_PRACTICE(3, "VIP网管课耗导出"),
-	STUDENT_MUSIC_THEORY_COURSE_INFO(4, "乐理课学员课程导出"),
+	STUDENT_MUSIC_THEORY_COURSE_INFO(4, "小组课学员课程导出"),
 	STUDENT_VIP_COURSE_INFO(5, "VIP课学员课程信息导出"),
 	VIP_STUDENT_COURSE_MANAGE(6, "vip学员课程管理"),
 	STUDENT_SMALL_CLASS_STATISTICS(7, "学员小课数据统计"),

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/IndexDataType.java

@@ -97,7 +97,7 @@ public enum IndexDataType implements BaseEnum<String, IndexDataType> {
 
     //小课数据统计
     STUDENT_VIP_ORDER_NUM("STUDENT_VIP_ORDER_NUM", "学员vip课订单数量", false, false),
-    STUDENT_THEORY_ORDER_NUM("STUDENT_THEORY_ORDER_NUM", "学员乐理课订单数量", false, false),
+    STUDENT_THEORY_ORDER_NUM("STUDENT_THEORY_ORDER_NUM", "学员小组课订单数量", false, false),
     STUDENT_PRACTICE_ORDER_NUM("STUDENT_PRACTICE_ORDER_NUM", "学员网管课订单数量", false, false),
     ;
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderDetailTypeEnum.java

@@ -30,7 +30,7 @@ public enum OrderDetailTypeEnum implements BaseEnum<String, OrderDetailTypeEnum>
     MAINTENANCE("MAINTENANCE","乐保服务"),
     CLOUD_TEACHER("CLOUD_TEACHER","云教练"),
     CLOUD_TEACHER_PLUS("CLOUD_TEACHER_PLUS","云教练"),
-    THEORY_COURSE("THEORY_COURSE", "乐理课"),
+    THEORY_COURSE("THEORY_COURSE", "小组课"),
     REPAIR("REPAIR", "乐器维修"),
     ORGAN_SHARE_PROFIT("ORGAN_SHARE_PROFIT", "分部分润");
 

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SporadicChargeTypeEnum.java

@@ -17,7 +17,8 @@ public enum SporadicChargeTypeEnum implements BaseEnum<Integer, SporadicChargeTy
     DOUBLE_ELEVEN2020(12,"2020双十一活动"),
     HIGH_ONLINE_ACTIVITY(13,"网基课活动"),
     PRACTICE_GROUP_BUY(14,"加油包"),
-    CLOUD_TEACHER_BUY(15,"系统购买");
+    CLOUD_TEACHER_BUY(15,"系统购买"),
+    DOUBLE_ELEVEN2023(16,"2023双十一活动");
 
     private Integer code;
 

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/page/DoubleEleven2021QueryInfo.java

@@ -13,7 +13,7 @@ public class DoubleEleven2021QueryInfo extends QueryInfo {
 
     private String organId;
 
-    @ApiModelProperty(value = "购买的活动类型1、1v1 20节,2、1v1 40节,3、1v2 20节,4、1v2 40节,5、乐理课",required = false)
+    @ApiModelProperty(value = "购买的活动类型1、1v1 20节,2、1v1 40节,3、1v2 20节,4、1v2 40节,5、小组课",required = false)
     private Integer type;
 
     private Date startTime;

+ 2 - 40
mec-biz/src/main/java/com/ym/mec/biz/dal/page/SporadicChargeInfoQueryInfo.java

@@ -3,7 +3,9 @@ package com.ym.mec.biz.dal.page;
 import com.ym.mec.biz.dal.enums.SporadicChargeTypeEnum;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
+@Data
 public class SporadicChargeInfoQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "分部编号",required = false)
@@ -19,44 +21,4 @@ public class SporadicChargeInfoQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "是否关闭", required = true)
     private Integer openFlag;
-
-    public Integer getOpenFlag() {
-        return openFlag;
-    }
-
-    public void setOpenFlag(Integer openFlag) {
-        this.openFlag = openFlag;
-    }
-
-    public boolean getIsExport() {
-        return isExport;
-    }
-
-    public void setIsExport(boolean export) {
-        isExport = export;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getOrganId() {
-        return organId;
-    }
-
-    public void setOrganId(String organId) {
-        this.organId = organId;
-    }
-
-    public SporadicChargeTypeEnum getChargeType() {
-        return chargeType;
-    }
-
-    public void setChargeType(SporadicChargeTypeEnum chargeType) {
-        this.chargeType = chargeType;
-    }
 }

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentCompetitionQueryInfo.java

@@ -1,6 +1,5 @@
 package com.ym.mec.biz.dal.page;
 
-import com.sun.org.apache.xpath.internal.operations.Bool;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 

+ 246 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/Double11StaticWrapper.java

@@ -0,0 +1,246 @@
+package com.ym.mec.biz.dal.wrapper;
+
+import com.microsvc.toolkit.common.response.paging.QueryInfo;
+import com.ym.mec.biz.dal.enums.GroupType;
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+
+@Data
+public class Double11StaticWrapper {
+
+    @ApiModel("2023销售统计查询参数")
+    @Data
+    public static class SaleStaticsQuery {
+
+        @ApiModelProperty("分部")
+        private String organId;
+
+        @ApiModelProperty("统计类型,0:汇总,1:1V1,2:1v2,3:乐理,4:云教练,5:乐器销售,6:报价卡")
+        @NotNull
+        private Integer saleStaticsType = 0;
+
+        @ApiModelProperty("排序字段,saleAmount:销售金额,userCount:人数")
+        @Pattern(regexp = "saleAmount|userCount", message = "不支持的类型")
+        private String orderBy;
+
+        @ApiModelProperty("1:升序 0:降序")
+        private Integer asc = 0;
+
+        @ApiModelProperty(hidden = true)
+        private Integer tenantId;
+
+        @ApiModelProperty(hidden = true)
+        private GroupType groupType;
+
+        @ApiModelProperty(hidden = true)
+        private OrderTypeEnum type;
+
+        @ApiModelProperty(hidden = true)
+        private String activityId;
+
+        @ApiModelProperty(hidden = true)
+        private String musicGroupId;
+
+        @ApiModelProperty(hidden = true)
+        private String goodId;
+
+        @ApiModelProperty(hidden = true)
+        private Date startPayTime;
+
+        @ApiModelProperty(hidden = true)
+        private Date endPayTime;
+
+    }
+
+    @ApiModel("分部学生购买")
+    @Data
+    public static class SaleStaticsStudentQuery implements QueryInfo {
+
+        @ApiModelProperty("当前页")
+        private Integer page;
+
+        @ApiModelProperty("分页行数")
+        private Integer rows;
+
+        @ApiModelProperty("分部")
+        private String organId;
+
+        @ApiModelProperty("学生姓名")
+        private String userName;
+
+        @ApiModelProperty("统计类型,1:1V1,2:1v2,3:乐理,4:云教练,5:乐器销售,6:报价卡")
+        private Integer saleStaticsType;
+
+        @ApiModelProperty("默认为时间")
+        private String orderBy;
+
+        @ApiModelProperty("1:升序,0:降序")
+        private Integer asc = 0;
+
+        @ApiModelProperty(hidden = true)
+        private Long tenantId;
+
+        @ApiModelProperty(hidden = true)
+        private GroupType groupType;
+
+        @ApiModelProperty(hidden = true)
+        private OrderTypeEnum type;
+
+        @ApiModelProperty(hidden = true)
+        private String activityId;
+
+        @ApiModelProperty(hidden = true)
+        private String musicGroupId;
+
+        @ApiModelProperty(hidden = true)
+        private String goodId;
+    }
+
+    @Data
+    public static class SaleStaticsStudent {
+
+        @ApiModelProperty("分部")
+        private Long organId;
+
+        private String organName;
+
+        private String userName;
+
+        private String phone;
+
+        private Date payTime;
+
+        private BigDecimal payAmount;
+
+    }
+
+
+    @ApiModel(value = "销售额")
+    @Data
+    public static class SaleStatics {
+
+        @ApiModelProperty("总销售额")
+        private BigDecimal totalSaleAmount;
+
+        @ApiModelProperty("1V1销售额")
+        private BigDecimal totalSale1V1;
+
+        @ApiModelProperty("1V1销售购买人数")
+        private Integer totalUser1V1PurchaseNumber;
+
+        @ApiModelProperty("1V2销售额")
+        private BigDecimal totalSale1V2;
+
+        @ApiModelProperty("1V2销售购买人数")
+        private Integer totalUser1V2PurchaseNumber;
+
+        @ApiModelProperty("乐理销售额")
+        private BigDecimal totalSaleTheory;
+
+        @ApiModelProperty("乐理销售购买人数")
+        private Integer totalUserTheoryPurchaseNumber;
+
+        @ApiModelProperty("云教练销售额")
+        private BigDecimal totalSaleCloudTeacher;
+
+        @ApiModelProperty("云教练销售购买人数")
+        private Integer totalUserCloudTeacherPurchaseNumber;
+
+        @ApiModelProperty("乐器销售额")
+        private BigDecimal totalSaleMusical;
+
+        @ApiModelProperty("乐器销售购买人数")
+        private Integer totalUserMusicalPurchaseNumber;
+
+        @ApiModelProperty("保价卡销售额")
+        private BigDecimal totalSaleMaintenance;
+
+        @ApiModelProperty("保价卡销售购买人数")
+        private Integer totalUserMaintenancePurchaseNumber;
+
+        @ApiModelProperty("小组课销售额")
+        private BigDecimal smallGroupsMaintenance;
+
+        @ApiModelProperty("小组课购买人数")
+        private Integer smallGroupsPurchaseNumber;
+
+        @ApiModelProperty("分部ID")
+        private Long orgId;
+
+        @ApiModelProperty("分部名称")
+        private Long orgName;
+
+    }
+
+    @ApiModel("分部统计详情")
+    @Data
+    public static class SaleAmountAndUser {
+
+        @ApiModelProperty("分部")
+        private Integer organId;
+
+        @ApiModelProperty("分部")
+        private String organName;
+
+        @ApiModelProperty("总销售额")
+        private BigDecimal saleAmount;
+
+        @ApiModelProperty("购买人数")
+        private Integer userPurchaseNumber;
+
+        @ApiModelProperty(hidden = true)
+        private BigDecimal actualAmount = new BigDecimal(0);
+
+        @ApiModelProperty(hidden = true)
+        private BigDecimal balancePaymentAmount  = new BigDecimal(0);
+
+        public BigDecimal getSaleAmount() {
+            BigDecimal a = Optional.ofNullable(actualAmount).orElse(new BigDecimal(0));
+            BigDecimal b = Optional.ofNullable(balancePaymentAmount).orElse(new BigDecimal(0));
+            BigDecimal saleAmount = a.add(b);
+            return saleAmount.setScale(2, RoundingMode.HALF_UP);
+        }
+    }
+
+    @Data
+    public static class SaleStaticConfigParam {
+        // {"1v1":680,"1v2":"930","theoryLive":"778,776,775","cloudTeacher":"11160","musical":{"flute":10,
+        // "clarinet":"9","altoSaxophone":"8","trumpet":"7","trombone":"6","upperTuba":"5"},"sporadic":680}
+        private String v1;
+        private String v2;
+        private String theoryLive;
+        private String cloudTeacher;
+        // 保价卡
+        private String sporadic;
+        // 小组课
+        private String theory;
+
+        private Map<String, Long> musical;
+
+        private Integer tenantId;
+
+        private Date startPayTime;
+
+        private Date endPayTime;
+
+        private String organId;
+
+        private String goodId;
+    }
+    @Data
+    public static class StudentCount {
+        private Integer organId;
+
+        private Integer count;
+    }
+}

+ 3 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/wrapper/LiveGroupWrapper.java

@@ -80,6 +80,9 @@ public class LiveGroupWrapper {
         @ApiModelProperty("学生状态")
         private int studentStatus = 0;
 
+        @ApiModelProperty("学生班级状态")
+        private String classStatus;
+
 
     }
 

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

@@ -33,7 +33,7 @@ public interface SporadicChargeInfoService extends BaseService<Integer, Sporadic
      */
     SporadicChargeInfo getDetail(Integer id);
 
-    SporadicChargeInfo findByOrganIdAndType(Integer organId, Integer type);
+    SporadicChargeInfo findByOrganIdAndType(String organId, Integer type);
 
     /**
      * 开启/关闭缴费
@@ -68,7 +68,7 @@ public interface SporadicChargeInfoService extends BaseService<Integer, Sporadic
      * @param type
      * @return
      */
-    List<SporadicChargeInfo> getOrganActiveInfo(Integer organId, Integer type);
+    List<SporadicChargeInfo> getOrganActiveInfo(String organId, Integer type);
 
     List<SporadicChargeInfo> findByIds(String sporadicIds);
 }

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

@@ -467,4 +467,6 @@ public interface SysConfigService extends BaseService<Long, SysConfig> {
     void batchUpdate(List<SysConfig> configList);
 
     void updateConfig(SysConfig config);
+
+    void redisTransfer();
 }

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

@@ -503,7 +503,7 @@ public class ActivityUserMapperServiceImpl extends BaseServiceImpl<Integer, Acti
 			className.append(StringUtils.join(bySubIds, ","));
 			className.append(vipGroupCategory.getName());
 		} else {
-			className.append("乐理课•");
+			className.append("小组课•");
 		}
 		className.append(StringUtils.join(studentNames, ","));
 		applyBaseInfo.setName(className.toString());

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

@@ -2107,7 +2107,7 @@ public class ExportServiceImpl implements ExportService {
                             row.setVipCourseFee(typeFee);
                         } else if (feeTypeStr.contains("网管课")) {
                             row.setPracticeCourseFee(typeFee);
-                        } else if (feeTypeStr.contains("乐理课")) {
+                        } else if (feeTypeStr.contains("小组课")) {
                             row.setTheoryCourseFee(typeFee);
                         }
                     }
@@ -2459,7 +2459,7 @@ public class ExportServiceImpl implements ExportService {
                                 row.setVipCourseFee(typeFee);
                             } else if (feeTypeStr.contains("网管课")) {
                                 row.setPracticeCourseFee(typeFee);
-                            } else if (feeTypeStr.contains("乐理课")) {
+                            } else if (feeTypeStr.contains("小组课")) {
                                 row.setTheoryCourseFee(typeFee);
                             }
                         }

+ 10 - 14
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ImGroupServiceImpl.java

@@ -13,12 +13,8 @@ import com.microsvc.toolkit.middleware.im.message.GroupMemberWrapper;
 import com.microsvc.toolkit.middleware.im.message.MessageWrapper;
 import com.microsvc.toolkit.middleware.im.message.TencentRequest;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.biz.dal.dao.ClassGroupTeacherMapperDao;
-import com.ym.mec.biz.dal.dao.ImGroupDao;
-import com.ym.mec.biz.dal.dao.ImGroupMemberDao;
-import com.ym.mec.biz.dal.dao.ImUserFriendDao;
-import com.ym.mec.biz.dal.dao.MusicGroupDao;
-import com.ym.mec.biz.dal.dao.TeacherDao;
+import com.ym.mec.auth.api.enums.SysUserType;
+import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.ImGroupDto;
 import com.ym.mec.biz.dal.dto.ImGroupMemberDto;
 import com.ym.mec.biz.dal.dto.NameDto;
@@ -93,6 +89,9 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
     private ImGroupMemberDao imGroupMemberDao;
 
     @Resource
+    private ImGroupNoticeDao imGroupNoticeDao;
+
+    @Resource
     private ImGroupMemberService imGroupMemberService;
 
     @Resource
@@ -284,14 +283,11 @@ public class ImGroupServiceImpl extends BaseServiceImpl<String, ImGroup> impleme
     @Transactional(rollbackFor = Exception.class)
     public boolean cancel(String imGroupId) {
         // 删除群成员
-//        imGroupMemberDao.deleteByImGroupId(imGroupId);
-//        // 删除群公告
-//        imGroupNoticeDao.deleteByImGroupId(imGroupId);
-//        // 删除群信息
-//        imGroupDao.delete(imGroupId);
-//
-//        imFeignService.groupDismiss(new GroupModel(imGroupId, null));
-
+        imGroupMemberDao.deleteByImGroupId(imGroupId);
+        // 删除群公告
+        imGroupNoticeDao.deleteByImGroupId(imGroupId);
+        // 删除群信息
+        imGroupDao.delete(imGroupId);
         try {
             imGroupCoreService.groupDismiss(imGroupId);
         } catch (Exception e) {

+ 0 - 10
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MemberRankSettingServiceImpl.java

@@ -663,14 +663,6 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
     @Override
     @Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
     public boolean liveBuyOrderCallback(StudentPaymentOrder studentPaymentOrder) {
-        //查询原定的是否已处理
-        /*StudentPaymentOrder orignStudentPaymentOrder = studentPaymentOrderService.lockOrder(studentPaymentOrder.getId());
-        if (orignStudentPaymentOrder == null) {
-            return false;
-        }
-        if (orignStudentPaymentOrder.getStatus() != DealStatusEnum.ING) {
-            return false;
-        }*/
         Integer userId = studentPaymentOrder.getUserId();
         Date nowDate = new Date();
         // 更新订单信息
@@ -679,7 +671,6 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
         if (updateCount <= 0) {
             throw new BizException("订单更新失败");
         }
-
         if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
             //退还优惠券和余额
             studentPaymentOrderService.returnBalanceAndCoupon(studentPaymentOrder, "直播购买云教练支付失败");
@@ -689,7 +680,6 @@ public class MemberRankSettingServiceImpl extends BaseServiceImpl<Integer, Membe
             }
             return true;
         }
-
         // 支付成功
         if (studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS) {
             VipGroupActivity activity = vipGroupActivityDao.get(Integer.parseInt(studentPaymentOrder.getActivityId()));

+ 7 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -890,7 +890,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         if (sporadicPayDto.getNum() == null) {
             sporadicPayDto.setNum(1);
         }
-        BigDecimal amount = chargeInfo.getAmount().multiply(new BigDecimal(sporadicPayDto.getNum()));
+		Integer organId = sporadicPayDto.getOrganId();
+		BigDecimal amount = chargeInfo.getAmount().multiply(new BigDecimal(sporadicPayDto.getNum()));
         if (chargeInfo.getDiscountAmount() != null && chargeInfo.getDiscountAmount().compareTo(BigDecimal.ZERO) > 0) {
             amount = amount.subtract(chargeInfo.getDiscountAmount().multiply(new BigDecimal(sporadicPayDto.getNum())));
         }
@@ -954,14 +955,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         }
 
         studentPaymentOrder.setPaymentChannel("BALANCE");
-        studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
-        studentPaymentOrder.setRoutingOrganId(chargeInfo.getOrganId());
+        studentPaymentOrder.setOrganId(organId);
+        studentPaymentOrder.setRoutingOrganId(organId);
         studentPaymentOrder.setUpdateTime(date);
         studentPaymentOrderService.update(studentPaymentOrder);
         studentPaymentOrder.setVersion(studentPaymentOrder.getVersion() + 1);
 
         if (amount.compareTo(BigDecimal.ZERO) == 0) {
-            studentPaymentRouteOrderService.addRouteOrder(orderNo, chargeInfo.getOrganId(), balance);
+            studentPaymentRouteOrderService.addRouteOrder(orderNo, organId, balance);
             Map<String, String> notifyMap = new HashMap<>();
             notifyMap.put("tradeState", "1");
             notifyMap.put("merOrderNo", studentPaymentOrder.getOrderNo());
@@ -989,10 +990,10 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                 baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
                 chargeInfo.getTitle(),
                 chargeInfo.getTitle(),
-                chargeInfo.getOrganId(),
+				organId,
                 receiver
         );
-        studentPaymentOrder.setOrganId(chargeInfo.getOrganId());
+        studentPaymentOrder.setOrganId(organId);
         studentPaymentOrder.setMerNos((String) payMap.get("routingMerNos"));
         studentPaymentOrder.setPaymentChannel((String) payMap.get("type"));
         studentPaymentOrder.setUpdateTime(date);

+ 15 - 7
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java

@@ -49,7 +49,6 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
     private SysUserCashAccountDetailService sysUserCashAccountDetailService;
     @Autowired
     private DegreeRegistrationService degreeRegistrationService;
-
     @Lazy
     @Autowired
     private ContractService contractService;
@@ -188,20 +187,29 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
         PageInfo<SporadicChargeInfo> pageInfo = queryPage(queryInfo);
         List<SporadicChargeInfo> rows = pageInfo.getRows();
         if (rows != null && rows.size() > 0) {
-            if (queryInfo.getIsExport() && rows.size() > 50000) {
+            if (queryInfo.isExport() && rows.size() > 50000) {
                 throw new BizException("数据集太大,不能导出.最大数据集不能超过50000");
             }
-            Set<Integer> organIds = rows.stream().map(e -> e.getOrganId()).collect(Collectors.toSet());
+            String organIds = rows.stream().map(e -> e.getOrganId()).collect(Collectors.joining(","));
             List<Integer> userIds = rows.stream().map(e -> e.getUserId()).collect(Collectors.toList());
             if (userIds == null) {
                 userIds = new ArrayList<>();
             }
             Set<Integer> operatorIds = rows.stream().map(e -> e.getOperatorId()).collect(Collectors.toSet());
-            Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMapList(organIds));
+            Map<Integer, String> organNames = MapUtil.convertMybatisMap(organizationDao.findOrganNameMap(organIds));
             Map<Integer, String> operatorNames = MapUtil.convertMybatisMap(teacherDao.queryNameByIds(StringUtils.join(operatorIds, ",")));
             Map<Integer, String> userNames = MapUtil.convertMybatisMap(teacherDao.queryUsernameByIds(userIds));
             rows.forEach(e -> {
-                e.setOrganName(organNames.get(e.getOrganId()));
+                StringBuffer sb = new StringBuffer();
+                for (String organId : e.getOrganId().split(",")) {
+                    if (organNames.containsKey(Integer.parseInt(organId))) {
+                        if(sb.length() > 0){
+                            sb.append(",");
+                        }
+                        sb.append(organNames.get(Integer.parseInt(organId)));
+                    }
+                }
+                e.setOrganName(sb.toString());
                 if (e.getUserId() != null) {
                     e.setUserName(userNames.get(e.getUserId()));
                 }
@@ -222,7 +230,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
     }
 
     @Override
-    public SporadicChargeInfo findByOrganIdAndType(Integer organId, Integer type) {
+    public SporadicChargeInfo findByOrganIdAndType(String organId, Integer type) {
         return sporadicChargeInfoDao.findByOrganIdAndType(organId, type);
     }
 
@@ -270,7 +278,7 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
     }
 
     @Override
-    public List<SporadicChargeInfo> getOrganActiveInfo(Integer organId, Integer type) {
+    public List<SporadicChargeInfo> getOrganActiveInfo(String organId, Integer type) {
         return sporadicChargeInfoDao.getOrganActiveInfo(organId, type);
     }
 

+ 37 - 32
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java

@@ -19,6 +19,7 @@ import java.util.Optional;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.service.*;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -88,34 +89,6 @@ import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.SporadicOrderQueryInfo;
 import com.ym.mec.biz.dal.page.StudentPaymentOrderQueryInfo;
 import com.ym.mec.biz.dal.vo.StudentPaymentOrderVo;
-import com.ym.mec.biz.service.ActivityUserMapperService;
-import com.ym.mec.biz.service.ChildrenDayReserveService;
-import com.ym.mec.biz.service.CloudTeacherOrderService;
-import com.ym.mec.biz.service.ContractService;
-import com.ym.mec.biz.service.DegreeRegistrationService;
-import com.ym.mec.biz.service.GoodsService;
-import com.ym.mec.biz.service.HfMerchantConfigService;
-import com.ym.mec.biz.service.MemberRankSettingService;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
-import com.ym.mec.biz.service.PayService;
-import com.ym.mec.biz.service.PracticeGroupService;
-import com.ym.mec.biz.service.ReplacementInstrumentActivityService;
-import com.ym.mec.biz.service.SporadicChargeInfoService;
-import com.ym.mec.biz.service.StudentInstrumentService;
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.StudentPaymentRouteOrderService;
-import com.ym.mec.biz.service.StudentRegistrationService;
-import com.ym.mec.biz.service.StudentRepairService;
-import com.ym.mec.biz.service.SubjectChangeService;
-import com.ym.mec.biz.service.SysCouponCodeService;
-import com.ym.mec.biz.service.SysPaymentConfigService;
-import com.ym.mec.biz.service.SysUserCashAccountDetailService;
-import com.ym.mec.biz.service.SysUserCashAccountService;
-import com.ym.mec.biz.service.TenantConfigService;
-import com.ym.mec.biz.service.VipGroupActivityService;
-import com.ym.mec.biz.service.VipGroupService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.HttpResponseResult;
@@ -1478,13 +1451,26 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
         }
 
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
-
+        //获取支付渠道
+        String paymentChannelStr = sysConfigDao.findConfigValue(SysConfigService.PAYMENT_CHANNEL);
+        if(StringUtils.isBlank(paymentChannelStr)) {
+            paymentChannelStr = PaymentChannelEnum.ADAPAY.getCode();
+        }
+        PaymentChannelEnum paymentChannel = PaymentChannelEnum.codeOf(paymentChannelStr);
+        String notifyUrl = "";
+        if (PaymentChannelEnum.YEEPAY == paymentChannel){
+            notifyUrl = baseApiUrl + "/api-mall-portal/payment/callback_yee/" + studentPaymentOrder.getTenantId();
+        }else if (PaymentChannelEnum.ADAPAY == paymentChannel){
+            notifyUrl = baseApiUrl + "/api-mall-portal/payment/callback";
+        }else {
+            throw new BizException("支付渠道错误");
+        }
         //  receiver类型
         payMap = payService.getPayMap(
                 studentPaymentOrder.getActualAmount(),
                 studentPaymentOrder.getBalancePaymentAmount(),
                 model.getOrderNo(),
-                baseApiUrl + "/api-mall-portal/payment/callback",
+                notifyUrl,
                 baseApiUrl + "/api-student/studentOrder/paymentResult?type=edu&orderNo=" + model.getOrderNo(),
                 "商品销售",
                 "商品销售",
@@ -1813,7 +1799,26 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             if(hfMerchantConfig == null){
                 throw new BizException("机构[{}]汇付商户信息找不到", order.getTenantId());
             }
-            Map<String, Object> payment = Payment.queryPayment(order.getTransNo(), hfMerchantConfig.getMerKey());
+            Map<String, Object> payment = new HashMap<>();
+            if(StringUtils.equals(order.getPaymentChannel(), PaymentChannelEnum.ADAPAY.getCode())) {
+                payment = Payment.queryPayment(order.getTransNo(), hfMerchantConfig.getMerKey());
+            }else if(StringUtils.equals(order.getPaymentChannel(), PaymentChannelEnum.YEEPAY.getCode())) {
+                Map<String, Object> orderInfo = yeepayPaymentService.queryOrder(hfMerchantConfig, order.getMerNos(), order.getOrderNo());
+                payment.put("pay_channel", orderInfo.get("channel"));
+
+                String respStatus = orderInfo.get("status").toString();
+
+                if(StringUtils.equals("SUCCESS", respStatus)) {
+                    payment.put("status", "succeeded");
+                }else if(StringUtils.equals("FAIL", respStatus) || StringUtils.equals("TIME_OUT", respStatus) || StringUtils.equals("CLOSE", respStatus)) {
+                    payment.put("status", "failed");
+                }else {
+                    payment.put("status", "pending");
+                }
+                payment.put("error_msg", orderInfo.get("failReason"));
+            }else {
+                throw new BizException("[{}]支付渠道不支持", order.getPaymentChannel());
+            }
             LOGGER.info("订单[{}]交易主动查询接口返回:{}", order.getTransNo(), payment);
 
             model.setPayChannel((String) payment.get("pay_channel"));
@@ -2033,7 +2038,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
                                         row.setVipCourseFee(typeFee);
                                     } else if (feeTypeStr.contains("网管课")) {
                                         row.setPracticeCourseFee(typeFee);
-                                    } else if (feeTypeStr.contains("乐理课")) {
+                                    } else if (feeTypeStr.contains("小组课")) {
                                         row.setTheoryCourseFee(typeFee);
                                     }
                                 }

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

@@ -44,7 +44,12 @@ public class SysConfigServiceImpl extends BaseServiceImpl<Long, SysConfig>  impl
 		applicationEventPublisher.publishEvent(new TenantConfigChangeEvent(this));
 	}
 
-	@Override
+    @Override
+    public void redisTransfer() {
+
+    }
+
+    @Override
 	public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
 		this.applicationEventPublisher = applicationEventPublisher;
 	}

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

@@ -83,7 +83,7 @@ public class SysMessageServiceImpl extends BaseServiceImpl<Long, SysMessage> imp
 	@Autowired
 	private SysEmailServiceImpl sysEmailService;
 	// 验证码有效期
-	public static final int CODE_EXPIRE = 60 * 5;
+	public static final int CODE_EXPIRE = 60 * 10;
 	// 发送验证码的间隔时间
 	public static final int CODE_INTERVAL_TIME = 60;
 

+ 7 - 5
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupActivityServiceImpl.java

@@ -656,6 +656,7 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 		//余额消耗
 		Boolean success = sysUserCashAccountService.use(payParam,studentPaymentOrder);
 		if(success){
+			studentPaymentOrder.setPayTime(new Date());
 			this.orderCallback(studentPaymentOrder);
 			Map<String, Object> result = new HashMap<>();
 			result.put("orderNo", studentPaymentOrder.getOrderNo());
@@ -778,21 +779,22 @@ public class VipGroupActivityServiceImpl extends BaseServiceImpl<Integer, VipGro
 			if(StringUtils.isEmpty(activity.getVipGroupCategoryIdList())){
 				activity.setActivityTypeEnum("PRACTICE");
 			}else {
-				if(StringUtils.equals(activity.getVipGroupCategoryNames(),"乐理课")){
+				activity.setActivityTypeEnum(activity.getVipGroupCategoryNames());
+				/*if(StringUtils.equals(activity.getVipGroupCategoryNames(),"小组课")){
 					activity.setActivityTypeEnum("THEORY");
 				}else{
 					activity.setActivityTypeEnum(activity.getVipGroupCategoryNames());
-				}
+				}*/
 			}
 		}
-		String giveCourseType = activity.getGiveCourseType();
+		/*String giveCourseType = activity.getGiveCourseType();
 		if(StringUtils.isNotEmpty(giveCourseType)){
 			if(StringUtils.equals(giveCourseType,"VIP")){
-				if(StringUtils.equals(activity.getGiveCategoryName(),"乐理课")){
+				if(StringUtils.equals(activity.getGiveCategoryName(),"小组课")){
 					activity.setGiveCourseType("THEORY");
 				}
 			}
-		}
+		}*/
     }
 
 	@Override

+ 191 - 72
mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java

@@ -6,9 +6,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import com.microsvc.toolkit.middleware.live.LivePluginContext;
-import com.microsvc.toolkit.middleware.live.LivePluginService;
-import com.microsvc.toolkit.middleware.live.message.LiveRoomMessage;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.*;
 import com.ym.mec.biz.dal.dto.VipGroupClassGroupMapper;
@@ -19,7 +16,6 @@ import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.mapper.LiveGroupPlusMapper;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.dal.vo.ImLiveBroadcastRoomVo;
-import com.ym.mec.biz.dal.vo.ImLiveRoomVideoVo;
 import com.ym.mec.biz.dal.wrapper.LiveGroupWrapper;
 import com.ym.mec.biz.event.source.SendSeoMessageSource;
 import com.ym.mec.biz.service.*;
@@ -190,8 +186,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
     @Autowired
     private ImLiveBroadcastRoomService imLiveBroadcastRoomService;
-    @Autowired
-    private LivePluginContext livePluginContext;
 
     @Autowired
     private StudentService studentService;
@@ -450,9 +444,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
         applyBaseInfo.setName(vipGroup.getLiveBroadcastRoom().getRoomTitle());
         //课程信息调整
-        List<CourseSchedule> courseSchedules = vipGroup.getCourseSchedules();
-        ClassGroup finalClassGroup = classGroup;
-        courseSchedules.forEach(courseSchedule -> {
+        List<CourseSchedule> courseSchedules = courseScheduleDao.getClassGroupCourses(classGroup.getId().longValue());
+
+        Boolean upCourseFlag = true;
+        //兼容历史的直播课
+        if(CollectionUtils.isEmpty(courseSchedules)){
+            courseSchedules = vipGroup.getCourseSchedules();
+            upCourseFlag = false;
+        }
+        for (CourseSchedule courseSchedule : courseSchedules) {
             courseSchedule.setGroupType(GroupType.valueOf(groupType));
             courseSchedule.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
             if (courseSchedule.getTeachMode().equals(TeachModeEnum.OFFLINE)) {
@@ -462,10 +462,17 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             courseSchedule.setActualTeacherId(vipGroupApplyBaseInfoDto.getUserId());
             courseSchedule.setStatus(CourseStatusEnum.NOT_START);
             courseSchedule.setType(CourseSchedule.CourseScheduleType.valueOf(groupType));
-            courseSchedule.setClassGroupId(finalClassGroup.getId());
+            courseSchedule.setClassGroupId(classGroup.getId());
             courseSchedule.setName(vipGroupApplyBaseInfoDto.getName());
             courseSchedule.setOrganId(vipGroupApplyBaseInfoDto.getOrganId());
-        });
+        }
+        vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
+        if (upCourseFlag) {
+            vipGroup.setCourseSchedules(courseSchedules);
+            courseScheduleDao.batchUpdate(courseSchedules);
+        }else {
+            this.liveProgress(vipGroupApplyBaseInfoDto,classGroup);
+        }
         if (vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
             // 修改课程信息
             // 修改直播间标题
@@ -496,10 +503,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             imGroupMemberService.join(classGroup.getId().toString(), applyBaseInfo.getEducationalTeacherId(),EFriendRoleType.ORCHESTRA_MANAGER.getMsg(),false);
         }
 
-        if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
+        if (!vipGroup1.getStatus().equals(VipGroupStatusEnum.PROGRESS) && upCourseFlag) {
             courseScheduleService.checkNewCourseSchedules(courseSchedules, false, false);
         }
-        vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
         vipGroupDao.update(vipGroupApplyBaseInfoDto);
         return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
     }
@@ -613,7 +619,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             className.append(StringUtils.join(bySubIds, ","));
             className.append(vipGroupCategory.getName());
         } else {
-            className.append("乐理课•");
+            className.append("小组课•");
         }
         className.append(StringUtils.join(studentNames, ","));
         vipGroupApplyBaseInfoDto.setName(className.toString());
@@ -684,6 +690,9 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         classGroup.setTotalClassTimes(totalClassTimes);
         classGroup.setType(ClassGroupTypeEnum.valueOf(groupType));
         classGroup.setDelFlag(1);
+        if(StringUtils.equals(vipGroupApplyBaseInfoDto.getGroupType(),"LIVE")){
+            classGroup.setDelFlag(0);
+        }
         classGroup.setGroupType(GroupType.valueOf(groupType));
         classGroup.setMusicGroupId(vipGroupApplyBaseInfoDto.getId().toString());
         classGroup.setCreateTime(now);
@@ -734,6 +743,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         courseScheduleService.checkNewCourseSchedules(courseSchedules, false, false);
         vipGroupApplyBaseInfoDto.setCourseSchedulesJson(JSON.toJSONString(courseSchedules));
         vipGroupDao.update(vipGroupApplyBaseInfoDto);
+        //如果创建的是直播课,生成课程以及老师关联、群聊等信息
+        if(StringUtils.equals(vipGroupApplyBaseInfoDto.getGroupType(),"LIVE")){
+            this.liveProgress(vipGroupApplyBaseInfoDto,classGroup);
+        }
         return BaseController.succeed(vipGroupApplyBaseInfoDto.getAuditStatus().getCode());
     }
 
@@ -966,7 +979,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             className.append(StringUtils.join(bySubIds, ","));
             className.append(vipGroupCategory.getName());
         } else {
-            className.append("乐理课•");
+            className.append("小组课•");
         }
         className.append(StringUtils.join(studentNames, ","));
         vipGroupApplyBaseInfoDto.setName(className.toString());
@@ -1293,7 +1306,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             className.append(StringUtils.join(bySubIds, ","));
             className.append(vipGroupCategory.getName());
         } else {
-            className.append("乐理课•");
+            className.append("小组课•");
         }
         className.append(StringUtils.join(studentNames, ","));
         vipGroupApplyBaseInfoDto.setName(className.toString());
@@ -2257,7 +2270,11 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                     }
                 }
             }
-            if (StringUtils.isNotEmpty(vipGroup.getCourseSchedulesJson())) {
+            List<CourseSchedule> groupCourseSchedules = courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(), vipGroup.getGroupType());
+            if(!CollectionUtils.isEmpty(groupCourseSchedules)){
+                vipGroupDetail.setCourseSchedules(groupCourseSchedules);
+                vipGroupDetail.setTotalClassTimes(groupCourseSchedules.size());
+            }else if (StringUtils.isNotEmpty(vipGroup.getCourseSchedulesJson())) {
                 vipGroupDetail.setCourseSchedules(JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class));
                 // 排课时间排序
                 List<CourseSchedule> collect = vipGroupDetail.getCourseSchedules().stream()
@@ -2645,7 +2662,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             throw new BizException("您已加入此课程");
         }
         int courseNum = courseScheduleDao.countVipGroupCourses(vipGroup.getId().intValue(), vipGroup.getGroupType());
-        if (vipGroup.getStatus() != VipGroupStatusEnum.APPLYING || classGroup.getDelFlag() != 1 || courseNum > 0) {
+        if (vipGroup.getGroupType().equals("VIP") && (vipGroup.getStatus() != VipGroupStatusEnum.APPLYING || classGroup.getDelFlag() != 1 || courseNum > 0)) {
             throw new BizException("当前课程已无法通过购买加入,请联系教务老师");
         }
         GroupType groupType = GroupType.VIP;
@@ -2754,7 +2771,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                 studentPaymentOrder.setUpdateTime(date);
                 studentPaymentOrder.setOrganId(user.getOrganId());
                 studentPaymentOrder.setRoutingOrganId(user.getOrganId());
-
+                studentPaymentOrder.setPayTime(date);
                 this.orderCallback(studentPaymentOrder);
 
                 sysUserCashAccountService.updateBalance(userId, amount.negate(), PlatformCashAccountDetailTypeEnum.PAY_FEE, groupType.getDesc() + "购买");
@@ -2949,6 +2966,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                     String organIdsString = StringUtils.join(hashSet, ",");
                     vipGroup.setOrganIdList(organIdsString);
                     vipGroupDao.update(vipGroup);
+                }else {
+                    this.liveProgress(vipGroup,classGroup,order);
                 }
                 SysUserCashAccount sysUserCashAccount = sysUserCashAccountService.get(userId);
                 //插入缴费明细
@@ -4564,6 +4583,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                     eduMap.put(vipGroup.getEducationalTeacherId(),vipGroup.getEducationalTeacherId().toString());
                     if(CollectionUtils.isEmpty(classGroupStudents)){
                         vipGroup.setStatus(VipGroupStatusEnum.CANCEL);
+                        vipGroup.setStopReason("没有学员");
+                        // 删除课表
+                        courseScheduleDao.deleteCourseSchedulesByMusicGroupID(vipGroup.getId().toString(), vipGroup.getGroupType());
+                        courseScheduleTeacherSalaryDao.deleteByMusicGroupId(vipGroup.getId().toString(), vipGroup.getGroupType());
+                        //删除考勤
+                        teacherAttendanceDao.deleteByMusicGroupId(vipGroup.getId().toString(), vipGroup.getGroupType());
+                        imGroupService.cancel(classGroup.getId().toString());
                         //推送
                         sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.JIGUANG_TEACHER_LIVE_CANCEL,
                                 teacherMap, null, 0, null, "TEACHER", vipGroup.getName());
@@ -4586,15 +4612,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
     }
 
-    private void liveProgress(VipGroup vipGroup,ClassGroup classGroup,List<ClassGroupStudentMapper> classGroupStudents){
-        vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
+    private void liveProgress(VipGroup vipGroup,ClassGroup classGroup){
         Integer tenantId = vipGroup.getTenantId();
-        classGroup.setDelFlag(0);
-        VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
-                null, vipGroup.getGroupType(),tenantId);
         //生成课表
         List<CourseSchedule> courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
-        classGroup.setTotalClassTimes(courseSchedules.size());
         courseScheduleService.batchAddCourseSchedule1(courseSchedules);
         //考勤信息
         List<TeacherAttendance> teacherAttendances = new ArrayList<>();
@@ -4633,43 +4654,137 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             userRoleMap.put(vipGroup.getEducationalTeacherId(), "乐团主管");
         }
         userRoleMap.put(vipGroup.getUserId(), "指导老师");
+        imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
+        imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
+    }
+
+    private void liveProgress(VipGroup vipGroup,ClassGroup classGroup,List<ClassGroupStudentMapper> classGroupStudents){
+        vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
+        Integer tenantId = vipGroup.getTenantId();
+        classGroup.setDelFlag(0);
+        List<CourseSchedule> courseSchedules = courseScheduleDao.getClassGroupCourses(classGroup.getId().longValue());
+        //兼容历史逻辑,原有的直播课只有课程组变更状态时才生成课程
+        if(CollectionUtils.isEmpty(courseSchedules)){
+            //生成课表
+            courseSchedules = JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
+            VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
+                    null, vipGroup.getGroupType(),tenantId);
+            courseScheduleService.batchAddCourseSchedule1(courseSchedules);
+            //考勤信息
+            List<TeacherAttendance> teacherAttendances = new ArrayList<>();
+            //创建课酬信息
+            List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = new ArrayList<>();
+            Map<String, BigDecimal> stringBigDecimalMap = countVipGroupPredictFee1(vipGroup, vipGroup.getUserId());
+            for (CourseSchedule courseSchedule : courseSchedules) {
+                //创建教师课程薪水记录
+                CourseScheduleTeacherSalary courseScheduleTeacherSalary = new CourseScheduleTeacherSalary();
+                courseScheduleTeacherSalary.setCourseScheduleId(courseSchedule.getId());
+                courseScheduleTeacherSalary.setGroupType(courseSchedule.getGroupType());
+                courseScheduleTeacherSalary.setMusicGroupId(courseSchedule.getMusicGroupId());
+                courseScheduleTeacherSalary.setTeacherRole(TeachTypeEnum.BISHOP);
+                courseScheduleTeacherSalary.setUserId(courseSchedule.getActualTeacherId().intValue());
+                courseScheduleTeacherSalary.setClassGroupId(courseSchedule.getClassGroupId());
+                courseScheduleTeacherSalary.setExpectSalary(stringBigDecimalMap.get("offlineTeacherSalary"));
+                courseScheduleTeacherSalary.setActualSalary(null);
+                courseScheduleTeacherSalary.setTenantId(tenantId);
+                courseScheduleTeacherSalaries.add(courseScheduleTeacherSalary);
+
+                TeacherAttendance teacherAttendance = new TeacherAttendance();
+                teacherAttendance.setGroupType(courseSchedule.getGroupType());
+                teacherAttendance.setClassGroupId(courseSchedule.getClassGroupId());
+                teacherAttendance.setMusicGroupId(courseSchedule.getMusicGroupId());
+                teacherAttendance.setTeacherId(courseSchedule.getActualTeacherId());
+                teacherAttendance.setCourseScheduleId(courseSchedule.getId());
+                teacherAttendance.setTenantId(tenantId);
+                teacherAttendances.add(teacherAttendance);
+            }
+            courseScheduleTeacherSalaryDao.batchInsert(courseScheduleTeacherSalaries);
+            teacherAttendanceDao.batchInsert(teacherAttendances);
+
+            //群聊数据
+            Map<Integer, String> userRoleMap = new HashMap<Integer, String>(5);
+            if (Objects.nonNull(vipGroup.getEducationalTeacherId())) {
+                userRoleMap.put(vipGroup.getEducationalTeacherId(), "乐团主管");
+            }
+            userRoleMap.put(vipGroup.getUserId(), "指导老师");
+            //生成课程学员关联
+            List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
+            List<Integer> studentIdList = classGroupStudents.stream().map(e -> e.getUserId()).collect(Collectors.toList());
+            for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
+                StudentPaymentOrder successOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroup.getId(), classGroupStudent.getUserId(), "SUCCESS","VIP".equals(vipGroup.getGroupType())?"SMALL_CLASS_TO_BUY":"LIVE_GROUP_BUY");
+                //实际支付金额,去除优惠券
+                BigDecimal actualPrice = successOrder.getExpectAmount();
+                BigDecimal divide = actualPrice.divide(new BigDecimal(courseSchedules.size()), ROUND_DOWN);
+                BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(courseSchedules.size()))).add(divide);
+                for (int i = 0; i < courseSchedules.size(); i++) {
+                    CourseSchedule courseSchedule = courseSchedules.get(i);
+                    CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+                    courseScheduleStudentPayment.setUserId(classGroupStudent.getUserId());
+                    courseScheduleStudentPayment.setGroupType(courseSchedule.getGroupType());
+                    courseScheduleStudentPayment.setMusicGroupId(courseSchedule.getMusicGroupId());
+                    courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+                    courseScheduleStudentPayment.setClassGroupId(courseSchedule.getClassGroupId());
+                    if (i == 0) {
+                        courseScheduleStudentPayment.setExpectPrice(firstAmount);
+                    } else {
+                        courseScheduleStudentPayment.setExpectPrice(divide);
+                    }
+                    courseScheduleStudentPayment.setOriginalPrice(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
+                    courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
+                    courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+                }
+                userRoleMap.put(classGroupStudent.getUserId(), null);
+            }
+            studentDao.updateStudentServiceTag(null, studentIdList, YesOrNoEnum.YES.getCode());
+
+            courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
+
+            imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
+            imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
+        }
+        imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
+                vipGroup.getName(), null, "",
+                vipGroup.getGroupType(), ImGroup.GroupTypeEnum.valueOf(vipGroup.getGroupType()));
+        classGroup.setTotalClassTimes(courseSchedules.size());
+        classGroupDao.update(classGroup);
+    }
+
+    private void liveProgress(VipGroup vipGroup,ClassGroup classGroup,StudentPaymentOrder studentPaymentOrder){
+        List<CourseSchedule> courseSchedules = courseScheduleDao.getClassGroupCourses(classGroup.getId().longValue());
+        VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupCategoryId(),
+                null, vipGroup.getGroupType(),vipGroup.getTenantId());
+        //群聊数据
+        Map<Integer, String> userRoleMap = new HashMap<Integer, String>(1);
         //生成课程学员关联
         List<CourseScheduleStudentPayment> courseScheduleStudentPayments = new ArrayList<>();
-        List<Integer> studentIdList = classGroupStudents.stream().map(e -> e.getUserId()).collect(Collectors.toList());
-        for (ClassGroupStudentMapper classGroupStudent : classGroupStudents) {
-            StudentPaymentOrder successOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroup.getId(), classGroupStudent.getUserId(), "SUCCESS","VIP".equals(vipGroup.getGroupType())?"SMALL_CLASS_TO_BUY":"LIVE_GROUP_BUY");
-            //实际支付金额,去除优惠券
-            BigDecimal actualPrice = successOrder.getExpectAmount();
-            BigDecimal divide = actualPrice.divide(new BigDecimal(courseSchedules.size()), ROUND_DOWN);
-            BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(courseSchedules.size()))).add(divide);
-            for (int i = 0; i < courseSchedules.size(); i++) {
-                CourseSchedule courseSchedule = courseSchedules.get(i);
-                CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
-                courseScheduleStudentPayment.setUserId(classGroupStudent.getUserId());
-                courseScheduleStudentPayment.setGroupType(courseSchedule.getGroupType());
-                courseScheduleStudentPayment.setMusicGroupId(courseSchedule.getMusicGroupId());
-                courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
-                courseScheduleStudentPayment.setClassGroupId(courseSchedule.getClassGroupId());
-                if (i == 0) {
-                    courseScheduleStudentPayment.setExpectPrice(firstAmount);
-                } else {
-                    courseScheduleStudentPayment.setExpectPrice(divide);
-                }
-                courseScheduleStudentPayment.setOriginalPrice(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
-                courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
-                courseScheduleStudentPayments.add(courseScheduleStudentPayment);
+        //实际支付金额,去除优惠券
+        BigDecimal actualPrice = studentPaymentOrder.getExpectAmount();
+        BigDecimal divide = actualPrice.divide(new BigDecimal(courseSchedules.size()), ROUND_DOWN);
+        BigDecimal firstAmount = actualPrice.subtract(divide.multiply(new BigDecimal(courseSchedules.size()))).add(divide);
+        for (int i = 0; i < courseSchedules.size(); i++) {
+            CourseSchedule courseSchedule = courseSchedules.get(i);
+            CourseScheduleStudentPayment courseScheduleStudentPayment = new CourseScheduleStudentPayment();
+            courseScheduleStudentPayment.setUserId(studentPaymentOrder.getUserId());
+            courseScheduleStudentPayment.setGroupType(courseSchedule.getGroupType());
+            courseScheduleStudentPayment.setMusicGroupId(courseSchedule.getMusicGroupId());
+            courseScheduleStudentPayment.setCourseScheduleId(courseSchedule.getId());
+            courseScheduleStudentPayment.setClassGroupId(courseSchedule.getClassGroupId());
+            if (i == 0) {
+                courseScheduleStudentPayment.setExpectPrice(firstAmount);
+            } else {
+                courseScheduleStudentPayment.setExpectPrice(divide);
             }
-            userRoleMap.put(classGroupStudent.getUserId(), null);
+            courseScheduleStudentPayment.setOriginalPrice(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice());
+            courseScheduleStudentPayment.setActualPrice(courseScheduleStudentPayment.getExpectPrice());
+            courseScheduleStudentPayments.add(courseScheduleStudentPayment);
         }
-        studentDao.updateStudentServiceTag(null, studentIdList, YesOrNoEnum.YES.getCode());
+        userRoleMap.put(studentPaymentOrder.getUserId(), null);
+        studentDao.updateStudentServiceTag(studentPaymentOrder.getUserId(), null, YesOrNoEnum.YES.getCode());
 
         courseScheduleStudentPaymentDao.batchInsert(courseScheduleStudentPayments);
 
-        imGroupService.create(classGroup.getId().toString(), null, classGroup.getName(), classGroup.getName(),
-                vipGroup.getName(), null, "", vipGroup.getGroupType(), ImGroup.GroupTypeEnum.valueOf(vipGroup.getGroupType()));
         imGroupMemberService.join(classGroup.getId().toString(), userRoleMap);
         imUserFriendService.refreshGroupImUserFriend(classGroup.getMusicGroupId(), classGroup.getGroupType());
-        classGroupDao.update(classGroup);
     }
 
 
@@ -4714,7 +4829,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
                 teacherAttendanceDao.deleteByMusicGroupId(vipGroup.getId().toString(), vipGroup.getGroupType());
             }
             vipGroupDao.batchUpdate(vipGroupList);
-            
             for(VipGroupClassGroupMapper vgcgm : vipGroupClassGroupMapperList){
                 imGroupService.cancel(vgcgm.getClassGroupId().toString());
             }
@@ -4739,6 +4853,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         }
     }
 
+
     @Override
     public VipGroupPayInfoDto getVipGroupPayInfo(Integer vipGroupId, Integer userId) {
         if (Objects.isNull(vipGroupId)) {
@@ -4859,7 +4974,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         String subjectId = imLiveBroadcastRoomDto.getSubjectId();
         baseInfoDto.setSubjectIdList(subjectId);
         if ("-1".equals(subjectId)) {
-            baseInfoDto.setSubjectName("乐理");
+            baseInfoDto.setSubjectName("小组");
         } else {
             baseInfoDto.setSubjectName(subjectDao.findNames(subjectId));
         }
@@ -4932,32 +5047,31 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
         if (CollectionUtils.isEmpty(studentMapperList)) {
             return livedStudentList;
         }
-        Map<Integer, ClassGroupStudentMapper> studentMapperMap = studentMapperList.stream().collect(Collectors.toMap(ClassGroupStudentMapper::getUserId, o->o ,(k1,k2)->k2));
-
         List<StudentApplyRefunds> applyRefunds = studentApplyRefundsDao.findByGroupAndType(query.getLiveGroupId().toString(), GroupType.LIVE.getCode());
         Map<Integer, List<StudentApplyRefunds>> studentApplyRefundsMap = applyRefunds.stream()
                 .collect(Collectors.groupingBy(StudentApplyRefunds::getUserId));
         records.forEach(data -> {
-            ClassGroupStudentMapper classGroupStudentMapper = studentMapperMap.get(data.getStudentId());
-            if (Objects.isNull(classGroupStudentMapper)) {
+            if (StringUtils.isEmpty(data.getClassStatus())) {
                 data.setStudentStatus(0);
                 return;
             }
-            if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) {
+            if (StringUtils.equals(data.getClassStatus(),ClassGroupStudentStatusEnum.QUIT.getCode())) {
                 data.setStudentStatus(1);
                 return;
-            } else if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT_SCHOOL)) {
+            } else if (StringUtils.equals(data.getClassStatus(),ClassGroupStudentStatusEnum.QUIT_SCHOOL.getCode())) {
                 data.setStudentStatus(3);
                 return;
-            }
-
-            List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId());
-            if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
-                StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
-                if (data.getStudentStatus() == 0 && studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)) {
-                    data.setStudentStatus(2);
-                    return;
+            } else if (StringUtils.equals(data.getClassStatus(),ClassGroupStudentStatusEnum.NORMAL.getCode())) {
+                data.setStudentStatus(0);
+                List<StudentApplyRefunds> studentApplyRefunds = studentApplyRefundsMap.get(data.getStudentId());
+                if (!CollectionUtils.isEmpty(studentApplyRefunds)) {
+                    StudentApplyRefunds studentApplyRefund = studentApplyRefunds.get(0);
+                    if (data.getStudentStatus() == 0 && studentApplyRefund.getStatus().equals(StudentApplyRefundsStatus.ING)) {
+                        data.setStudentStatus(2);
+                        return;
+                    }
                 }
+                return;
             }
             data.setStudentStatus(0);
         });
@@ -4977,14 +5091,19 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
             throw new BizException("此课程不是直播课程");
         }
         // 报名中的课程直接返回json数据
-        List<CourseSchedule> courseSchedules;
-        if (VipGroupStatusEnum.APPLYING.equals(vipGroup.getStatus()) ||VipGroupStatusEnum.NOT_START.equals(vipGroup.getStatus())) {
+        List<CourseSchedule> courseSchedules =  courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(), GroupType.LIVE.getCode());
+        if(CollectionUtils.isEmpty(courseSchedules)){
+            courseSchedules =  JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
+            // 报名中的课程默认未分享,不能修改
+            courseSchedules.forEach(next->next.setShareMode(ShareModeEnum.NO_SHARE));
+        }
+        /*if (VipGroupStatusEnum.APPLYING.equals(vipGroup.getStatus()) ||VipGroupStatusEnum.NOT_START.equals(vipGroup.getStatus())) {
             courseSchedules =  JSON.parseArray(vipGroup.getCourseSchedulesJson(), CourseSchedule.class);
             // 报名中的课程默认未分享,不能修改
             courseSchedules.forEach(next->next.setShareMode(ShareModeEnum.NO_SHARE));
         } else {
             courseSchedules =  courseScheduleDao.findGroupCourseSchedules(vipGroup.getId().toString(), GroupType.LIVE.getCode());
-        }
+        }*/
         // 添加共享方式过滤
         ShareModeEnum shareMode = query.getShareMode();
         if (shareMode != null) {

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

@@ -697,7 +697,7 @@
 		CONCAT(SUM(CASE WHEN vgc.name_ = '1v5' THEN aum.total_course_num_ - aum.sub_course_num_ ELSE 0 END) ,'/',SUM(CASE WHEN vgc.name_ = '1v5' THEN aum.total_course_num_ ELSE 0 END)) 'five',
 		CONCAT(SUM(CASE WHEN vgc.name_ = '1v6' THEN aum.total_course_num_ - aum.sub_course_num_ ELSE 0 END) ,'/',SUM(CASE WHEN vgc.name_ = '1v6' THEN aum.total_course_num_ ELSE 0 END)) 'six',
 		CONCAT(SUM(CASE WHEN vgc.name_ = '1v7' THEN aum.total_course_num_ - aum.sub_course_num_ ELSE 0 END) ,'/',SUM(CASE WHEN vgc.name_ = '1v7' THEN aum.total_course_num_ ELSE 0 END)) 'seven',
-		CONCAT(SUM(CASE WHEN vgc.name_ = '乐理课' THEN aum.total_course_num_ - aum.sub_course_num_ ELSE 0 END) ,'/',SUM(CASE WHEN vgc.name_ = '乐理课' THEN aum.total_course_num_ ELSE 0 END)) 'theory',
+		CONCAT(SUM(CASE WHEN vgc.name_ = '小组课' THEN aum.total_course_num_ - aum.sub_course_num_ ELSE 0 END) ,'/',SUM(CASE WHEN vgc.name_ = '乐理课' THEN aum.total_course_num_ ELSE 0 END)) 'theory',
 		CONCAT(SUM(CASE WHEN vgc.name_ IS NULL THEN aum.total_course_num_ - aum.sub_course_num_ ELSE 0 END) ,'/',SUM(CASE WHEN vgc.name_ IS NULL THEN aum.total_course_num_ ELSE 0 END)) 'practice'
 		from (select aum.user_id_,aum.category_id_,aum.sub_course_num_,aum.total_course_num_
 		from activity_user_mapper aum

+ 7 - 25
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -34,6 +34,7 @@
         <result column="class_group_name_" property="classGroupName"/>
         <result column="class_group_type_" property="classGroupType"/>
         <result column="teaching_content_" property="teachingContent"/>
+        <result column="teaching_point_" property="teachingPoint"/>
         <result column="note_" property="note"/>
         <result column="organ_id_" property="organId"/>
         <result column="member_flag_" property="memberFlag"/>
@@ -180,6 +181,7 @@
         cs.del_flag_,
         cs.is_lock_,
         cs.teaching_content_,
+        cs.teaching_point_,
         cs.note_,
         cs.organ_id_,
         cs.member_flag_,
@@ -1272,29 +1274,7 @@
           AND status_ = 'NORMAL'
     </select>
     <select id="findGroupCourseSchedules" resultMap="CourseSchedule">
-        SELECT cs.id_,
-               cs.group_type_,
-               cs.music_group_id_,
-               cs.class_group_id_,
-               cs.status_,
-               cs.subsidy_,
-               cs.class_date_,
-               CONCAT(cs.class_date_, ' ', cs.start_class_time_) start_class_time_,
-               CONCAT(cs.class_date_, ' ', cs.end_class_time_)   end_class_time_,
-               cs.start_class_time_                              start_class_time_str_,
-               cs.end_class_time_                                end_class_time_str_,
-               cs.teacher_id_,
-               cs.actual_teacher_id_,
-               cs.create_time_,
-               cs.update_time_,
-               cs.teach_mode_,
-               cs.type_,
-               cs.name_,
-               cs.student_num_,
-               cs.leave_student_num_,
-               cs.schoole_id_,
-        cs.live_room_id_,
-               cs.share_mode_,
+        SELECT <include refid="resultSql"/>,
                s.name_                                           schoole_name_
         FROM course_schedule cs
                  LEFT JOIN school s ON cs.schoole_id_ = s.id_
@@ -1844,7 +1824,9 @@
         LEFT JOIN vip_group vg ON vg.id_ = cgsm.music_group_id_ AND cgsm.group_type_ IN ('VIP', 'LIVE') AND vg.group_status_!=7
         LEFT JOIN practice_group pg ON pg.id_ = cgsm.music_group_id_ AND cgsm.group_type_ = 'PRACTICE'
         WHERE cgsm.user_id_ = #{userId} AND cgsm.status_ != 'QUIT'
-        AND (mg.status_ = 'PROGRESS' OR vg.group_status_ = 2 OR vg.group_status_ = 4 OR (pg.id_ IS NOT NULL AND
+        AND (mg.status_ = 'PROGRESS' OR vg.group_status_ = 2 OR vg.group_status_ = 4
+        OR (vg.group_type_ = 'LIVE' AND vg.group_status_ IN (1,2,4,5))
+        OR (pg.id_ IS NOT NULL AND
         pg.group_status_!='LOCK' AND pg.group_status_!='CANCEL'))
         ORDER BY cgsm.music_group_id_
         <include refid="global.limit"/>
@@ -1866,7 +1848,7 @@
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         WHERE spo.type_ != 'OTHER' AND spo.music_group_id_ IS NOT NULL
         AND spo.user_id_ = #{userId} AND spo.status_='SUCCESS' AND cgsm.status_ != 'QUIT'
-        AND IF(spo.group_type_ = 'VIP', (vg.group_status_ = 4 OR vg.group_status_ = 3 ),0)=0 AND cg.del_flag_ = 0
+        AND IF(spo.group_type_ = 'VIP', (vg.group_status_ = 4 OR vg.group_status_ = 3 ),0) = 0 AND cg.del_flag_ = 0
         <include refid="global.limit"/>
     </select>
 

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

@@ -172,7 +172,7 @@
 			   COUNT(DISTINCT CASE WHEN sa.qualified_flag_ = 1 THEN sa.id_ ELSE NULL END) standard_num_,
 			   CASE WHEN sch.id_ IS NOT NULL THEN 1 ELSE 0 END homework_flag_,
 			   COUNT(DISTINCT CASE WHEN sch.status_ = 1 THEN sch.id_ ELSE NULL END) homework_commit_num_,cs.class_date_,cs.status_ course_status_
-		FROM course_schedule_statistics_wait cssw
+		FROM (select * from course_schedule_statistics_wait limit 500) cssw
 				 LEFT JOIN course_schedule_statistics css ON css.course_schedule_id_ = cssw.course_schedule_id_
 				 LEFT JOIN course_schedule cs ON cs.id_ = cssw.course_schedule_id_
 				 LEFT JOIN course_schedule_student_payment cssp ON cssp.course_schedule_id_ = cssw.course_schedule_id_

+ 11 - 13
mec-biz/src/main/resources/config/mybatis/IndexBaseMonthDataMapper.xml

@@ -2004,15 +2004,13 @@
 			COUNT( DISTINCT user_id_ ) percent_
 		FROM
 		(
-		SELECT
-			su.organ_id_,smcr.tenant_id_,
-			smcr.user_id_
-		FROM
-			sys_music_compare_record smcr
-			LEFT JOIN sys_user su ON smcr.user_id_ = su.id_
-		WHERE su.del_flag_ = 0 and smcr.tenant_id_ = #{tenantId}
-		GROUP BY user_id_
-		HAVING MIN(DATE( smcr.create_time_ ))= #{dayStr}) t
+		SELECT su.organ_id_, smcr.tenant_id_, smcr.user_id_
+		FROM sys_music_compare_record smcr
+		INNER JOIN sys_user su ON smcr.user_id_ = su.id_
+		WHERE su.del_flag_ = 0 AND smcr.tenant_id_ = 3
+		AND smcr.create_time_ >= #{dayStr}
+		AND smcr.create_time_ &lt; DATE_ADD(#{dayStr}, INTERVAL 1 DAY)
+		GROUP BY smcr.user_id_) t
 		GROUP BY t.organ_id_
 	</select>
 	<resultMap id="CloudTeacherActiveTargetDto" type="com.ym.mec.biz.dal.dto.CloudTeacherActiveTargetDto">
@@ -2057,8 +2055,8 @@
 		LEFT JOIN vip_group_category vgc2 ON vgc2.id_ = vga1.vip_group_category_id_list_
 		WHERE (spo.group_type_ = 'SPORADIC' AND spo.type_ = 'DEGREE_REGISTRATION' AND spod.type_ = 'DEGREE_REGISTRATION')
 		OR (spo.group_type_ = 'SPORADIC' AND spo.type_ = 'DOUBLE_ELEVEN2020') OR (spo.group_type_ = 'DEGREE' AND spod.type_ = 'VIP')
-		OR (spo.type_ = 'SMALL_CLASS_TO_BUY' AND vgc1.name_ != '乐理课') OR (spo.group_type_ = 'MUSIC' AND spod.type_ = 'VIP' AND vgc2.name_ != '乐理课')
-		OR (spo.type_ = 'DOUBLE_ELEVEN2021' AND vgc.name_ != '乐理课')
+		OR (spo.type_ = 'SMALL_CLASS_TO_BUY' AND vgc1.name_ != '小组课') OR (spo.group_type_ = 'MUSIC' AND spod.type_ = 'VIP' AND vgc2.name_ != '小组课')
+		OR (spo.type_ = 'DOUBLE_ELEVEN2021' AND vgc.name_ != '小组课')
 		GROUP BY spo.user_id_,spo.create_time_,spo.organ_id_;
 	</select>
 	<select id="getStudentTheoryOrderNum" resultMap="IndexBaseMonthData">
@@ -2077,8 +2075,8 @@
 				 LEFT JOIN vip_group_activity vga1 ON vga1.id_ = mgpca.activity_id_
 				 LEFT JOIN vip_group_category vgc2 ON vgc2.id_ = vga1.vip_group_category_id_list_
 		WHERE (spo.group_type_ = 'DEGREE' AND spod.type_ = 'THEORY_COURSE')
-		   OR (spo.type_ = 'SMALL_CLASS_TO_BUY' AND vgc1.name_ = '乐理课') OR (spo.group_type_ = 'MUSIC' AND spod.type_ = 'VIP' AND vgc2.name_ = '乐理课')
-		   OR (spo.type_ = 'DOUBLE_ELEVEN2021' AND vgc.name_ = '乐理课')
+		   OR (spo.type_ = 'SMALL_CLASS_TO_BUY' AND vgc1.name_ = '小组课') OR (spo.group_type_ = 'MUSIC' AND spod.type_ = 'VIP' AND vgc2.name_ = '小组课')
+		   OR (spo.type_ = 'DOUBLE_ELEVEN2021' AND vgc.name_ = '小组课')
 		GROUP BY spo.user_id_,spo.create_time_,spo.organ_id_;
 	</select>
 	<select id="getStudentPracticeOrderNum" resultMap="IndexBaseMonthData">

+ 4 - 2
mec-biz/src/main/resources/config/mybatis/LiveGroupPlusMapper.xml

@@ -6,8 +6,10 @@
     select
     t.user_id_ as studentId,
     t.create_time_ as createTime,
-    t.order_no_ as orderNo
+    t.order_no_ as orderNo,
+    cgsm.status_ as classStatus
     from student_payment_order t
+    left join class_group_student_mapper cgsm ON cgsm.music_group_id_ = t.music_group_id_ and cgsm.class_group_id_ = t.class_group_id_ and cgsm.user_id_ = t.user_id_
     left join sys_user su on su.id_ = t.user_id_
     <where>
         <if test="param.liveGroupId != null">
@@ -22,7 +24,7 @@
             )
         </if>
     </where>
-
+    group by cgsm.id_
     </select>
 
 <select id="liveCoursePage" resultMap="com.ym.mec.biz.dal.dao.CourseScheduleDao.courseScheduleDto">

+ 10 - 6
mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml

@@ -130,8 +130,8 @@
     <sql id="queryPageSql">
         <where>
             sci.del_flag_ != 1 and sci.tenant_id_ = #{tenantId}
-            <if test="organId != null">
-                AND FIND_IN_SET(sci.organ_id_,#{organId})
+            <if test="organId != null and organId != ''">
+                AND INTE_ARRAY(sci.organ_id_,#{organId})
             </if>
             <if test="chargeType != null">
                 AND sci.charge_type_ = #{chargeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
@@ -166,15 +166,19 @@
     <select id="findByOrganIdAndType" resultMap="SporadicChargeInfo">
         SELECT *
         FROM sporadic_charge_info
-        where organ_id_ = #{organId}
-          AND charge_type_ = #{chargeType}
+        where charge_type_ = #{chargeType}
+          <if test="organId != null and organId != ''">
+            AND organ_id_ = #{organId}
+          </if>
           AND del_flag_ = 0
     </select>
     <select id="getOrganActiveInfo" resultMap="SporadicChargeInfo">
         SELECT *
         FROM sporadic_charge_info
-        where organ_id_ = #{organId}
-          AND charge_type_ = #{chargeType}
+        where charge_type_ = #{chargeType}
+        <if test="organId != null and organId != ''">
+            AND organ_id_ = #{organId}
+        </if>
           AND del_flag_ = 0
     </select>
 

+ 232 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderMapper.xml

@@ -1238,5 +1238,237 @@
         AND spo.status_ = 'SUCCESS'  AND spo.class_group_id_ = cgsm.class_group_id_ and spo.music_group_id_ = cgsm.music_group_id_
     </select>
 
+    <select id="saleStatics" resultType="com.ym.mec.biz.dal.wrapper.Double11StaticWrapper$SaleAmountAndUser">
+        SELECT
+        SUM(actual_amount_) AS 'actualAmount'
+        , SUM(balance_payment_amount_) AS 'balancePaymentAmount'
+        , COUNT(distinct user_id_) AS 'userPurchaseNumber'
+        FROM student_payment_order
+        <where>
+            status_ = 'SUCCESS'
+            <if test="param.tenantId != null">
+                AND tenant_id_ =#{param.tenantId}
+            </if>
+            <if test="param.organId != null">
+                AND find_in_set(organ_id_,#{param.organId})
+            </if>
+            <if test="param.groupType != null">
+                AND group_type_ =#{param.groupType}
+            </if>
+            <if test="param.type != null">
+                AND type_ =#{param.type}
+            </if>
+            <if test="param.activityId != null">
+                AND find_in_set(activity_id_,#{param.activityId})
+            </if>
+            <if test="param.musicGroupId != null">
+                AND find_in_set(music_group_id_,#{param.musicGroupId})
+            </if>
+        </where>
+    </select>
+
+    <select id="musicalSaleStatics" resultType="com.ym.mec.biz.dal.wrapper.Double11StaticWrapper$SaleAmountAndUser">
+        SELECT
+        SUM(t.actual_amount_) AS 'actualAmount'
+        , SUM(t.balance_payment_amount_) AS 'balancePaymentAmount'
+        , COUNT(distinct t.user_id_) AS 'userPurchaseNumber'
+        FROM student_payment_order t
+        LEFT join sell_order so on t.order_no_ = so.order_no_
+        <where>
+            t.status_ = 'SUCCESS'
+            AND find_in_set(so.goods_id_,#{param.goodId})
+            AND t.pay_time_ between #{param.startPayTime} and #{param.endPayTime}
+            <if test="param.tenantId != null">
+                AND t.tenant_id_ =#{param.tenantId}
+            </if>
+            <if test="param.organId != null">
+                AND find_in_set(t.organ_id_,#{param.organId})
+            </if>
+
+        </where>
+    </select>
 
+    <select id="saleStaticsByOrgId" resultType="com.ym.mec.biz.dal.wrapper.Double11StaticWrapper$SaleAmountAndUser">
+        SELECT
+        t.organ_id_ AS organId
+        , SUM(t.actual_amount_) AS 'actualAmount'
+        , SUM(t.balance_payment_amount_) AS 'balancePaymentAmount'
+        , COUNT(distinct t.user_id_) AS 'userPurchaseNumber'
+        FROM student_payment_order t
+        <if test="param.goodId != null">
+            LEFT JOIN sell_order so on t.order_no_ = so.order_no_
+        </if>
+        <where>
+            t.status_ = 'SUCCESS'
+            <if test="param.tenantId != null">
+                AND t.tenant_id_ =#{param.tenantId}
+            </if>
+            <if test="param.organId != null">
+                AND find_in_set(t.organ_id_,#{param.organId})
+            </if>
+            <if test="param.groupType!= null">
+                AND t.group_type_ =#{param.groupType}
+            </if>
+            <if test="param.type!= null">
+                AND t.type_ =#{param.type}
+            </if>
+            <if test="param.activityId != null">
+                AND find_in_set(t.activity_id_,#{param.activityId})
+            </if>
+            <if test="param.musicGroupId != null">
+                AND find_in_set(t.music_group_id_,#{param.musicGroupId})
+            </if>
+            <if test="param.goodId != null">
+                AND find_in_set(so.goods_id_,#{param.goodId})
+            </if>
+            <if test="param.startPayTime != null and param.endPayTime != null">
+                AND t.pay_time_ between #{param.startPayTime} and #{param.endPayTime}
+            </if>
+        </where>
+        GROUP BY t.organ_id_
+    </select>
+
+    <select id="queryPaymentStudentByPage" resultType="com.ym.mec.biz.dal.wrapper.Double11StaticWrapper$SaleStaticsStudent">
+        select t.user_id_ as userId
+        , t.organ_id_ as organId
+        , su.username_ as userName
+        , su.phone_ as phone
+        , t.pay_time_ as payTime
+        , (t.actual_amount_ + t.balance_payment_amount_) as payAmount
+        from student_payment_order t
+        left join sys_user su on t.user_id_ = su.id_
+        <if test="goodId != null">
+            LEFT JOIN sell_order so on t.order_no_ = so.order_no_
+        </if>
+        <where>
+            t.status_='SUCCESS'
+            <if test="tenantId != null">
+                AND t.tenant_id_ =#{tenantId}
+            </if>
+            <if test="organId != null">
+                AND find_in_set(t.organ_id_,#{organId})
+            </if>
+            <if test="userName != null and userName.trim() !=''">
+                AND su.username_ like concat('%',#{userName},'%')
+            </if>
+            <if test="groupType != null">
+                AND group_type_ =#{groupType}
+            </if>
+            <if test="type != null">
+                AND type_ =#{type}
+            </if>
+            <if test="activityId != null">
+                AND find_in_set(activity_id_,#{activityId})
+            </if>
+            <if test="musicGroupId != null">
+                AND find_in_set(music_group_id_,#{musicGroupId})
+            </if>
+            <if test="goodId != null">
+                AND find_in_set(so.goods_id_,#{goodId})
+            </if>
+            <if test="startPayTime != null and endPayTime != null">
+                AND t.pay_time_ between #{startPayTime} and #{endPayTime}
+            </if>
+        </where>
+        <if test=" orderBy != null and asc == 0">
+            order by ${orderBy} desc
+        </if>
+        <if test=" orderBy != null and asc == 1">
+            order by ${orderBy} asc
+        </if>
+        <include refid="global.limit"/>
+    </select>
+
+    <select id="queryPaymentStudentCount" resultType="java.lang.Integer">
+        select count(1) from student_payment_order t
+        left join sys_user su on t.user_id_ = su.id_
+        <if test="goodId != null">
+            LEFT JOIN sell_order so on t.order_no_ = so.order_no_
+        </if>
+        <where>
+            t.status_='SUCCESS'
+            <if test="tenantId != null">
+                AND t.tenant_id_ =#{tenantId}
+            </if>
+            <if test="organId != null">
+                AND find_in_set(t.organ_id_,#{organId})
+            </if>
+            <if test="userName != null and userName.trim() !=''">
+                AND su.username_ like concat('%',#{userName},'%')
+            </if>
+            <if test="groupType != null">
+                AND group_type_ =#{groupType}
+            </if>
+            <if test="type != null">
+                AND type_ =#{type}
+            </if>
+            <if test="activityId != null">
+                AND find_in_set(activity_id_,#{activityId})
+            </if>
+            <if test="musicGroupId != null">
+                AND find_in_set(music_group_id_,#{musicGroupId})
+            </if>
+            <if test="goodId != null">
+                AND find_in_set(so.goods_id_,#{goodId})
+            </if>
+            <if test="startPayTime != null and endPayTime != null">
+                AND t.pay_time_ between #{startPayTime} and #{endPayTime}
+            </if>
+        </where>
+    </select>
+
+    <select id="count2023Double11StudentsByOrgan" resultType="com.ym.mec.biz.dal.wrapper.Double11StaticWrapper$StudentCount">
+        select organ_id_ as organId, count(distinct user_id_) as count
+        from (select user_id_, organ_id_
+              from student_payment_order
+              where status_ = 'SUCCESS'
+                and group_type_ = 'ACTIVITY'
+                and type_ = 'SMALL_CLASS_TO_BUY'
+                and find_in_set(activity_id_, #{param.v1})
+              union
+              select user_id_, organ_id_
+              from student_payment_order
+              where status_ = 'SUCCESS'
+                and group_type_ = 'ACTIVITY'
+                and type_ = 'SMALL_CLASS_TO_BUY'
+                and find_in_set(activity_id_, #{param.v2})
+              union
+              SELECT user_id_, organ_id_
+              FROM student_payment_order
+              WHERE status_ = 'SUCCESS'
+                AND group_type_ = 'LIVE'
+                AND type_ = 'LIVE_GROUP_BUY'
+                AND find_in_set(music_group_id_, #{param.theoryLive})
+              union
+              select user_id_, organ_id_
+              from student_payment_order
+              where status_ = 'SUCCESS'
+                and group_type_ = 'ACTIVITY'
+                and type_ = 'MEMBER'
+                and find_in_set(activity_id_, #{param.cloudTeacher})
+              union
+              select t.user_id_, t.organ_id_
+              from student_payment_order t
+                       LEFT join sell_order so on t.order_no_ = so.order_no_
+              where t.status_ = 'SUCCESS'
+                and find_in_set(so.goods_id_, #{param.goodId})
+                and t.pay_time_ between #{param.startPayTime} and #{param.endPayTime}
+              union
+              select user_id_
+                   , organ_id_
+              from student_payment_order
+              where status_ = 'SUCCESS'
+                and group_type_ = 'SPORADIC'
+                and type_ = 'SPORADIC'
+                and find_in_set(music_group_id_, #{param.sporadic})
+              union
+              select user_id_, organ_id_
+              from student_payment_order
+              where status_ = 'SUCCESS'
+                and group_type_ = 'ACTIVITY'
+                and type_ = 'SMALL_CLASS_TO_BUY'
+                and find_in_set(activity_id_, #{param.theory})) t
+        where find_in_set(t.organ_id_, #{param.organId})
+        group by organ_id_
+    </select>
 </mapper>

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

@@ -460,7 +460,7 @@
 			'VIP课回访'
 		</if>
 		<if test="groupType == 'THEORY'">
-			'乐理课回访'
+			'小组课回访'
 		</if>
 		<if test="groupType == 'PRACTICE'">
 			'网管课回访'

+ 2 - 2
mec-client-api/src/main/java/com/ym/mec/web/WebFeignService.java

@@ -43,8 +43,8 @@ public interface WebFeignService {
 	@PostMapping(value = "api/queryVipPracticeGroups")
     Boolean queryVipPracticeGroups();
 
-	@GetMapping(value = "/queryByTenantId/{id}")
-	HttpResponseResult<HfMerchantConfig> queryByTenantId(@PathVariable("id") Integer id);
+	@GetMapping(value = "/hfMerchantConfig/queryByTenantId")
+	HttpResponseResult<HfMerchantConfig> queryByTenantId(@RequestParam("payerName") String payerName,@RequestParam("id") Integer id);
 
 	@PostMapping("/api/mallCreateOrder")
 	HttpResponseResult<Map> mallCreateOrder(@RequestBody MallCreateOrderModel model);

+ 1 - 1
mec-client-api/src/main/java/com/ym/mec/web/fallback/WebFeignServiceFallback.java

@@ -55,7 +55,7 @@ public class WebFeignServiceFallback implements WebFeignService {
 	}
 
 	@Override
-	public HttpResponseResult<HfMerchantConfig> queryByTenantId(Integer id) {
+	public HttpResponseResult<HfMerchantConfig> queryByTenantId(String payerName,Integer id) {
 		return null;
 	}
 

+ 0 - 120
mec-education/pom.xml

@@ -1,120 +0,0 @@
-<?xml version="1.0"?>
-<project
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>com.ym</groupId>
-		<artifactId>mec</artifactId>
-		<version>1.0</version>
-	</parent>
-	<artifactId>mec-education</artifactId>
-	<name>mec-education</name>
-	<url>http://maven.apache.org</url>
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-starter-security</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-sleuth-zipkin</artifactId>
-		</dependency>
-
-		<!-- swagger-spring-boot -->
-		<dependency>
-			<groupId>com.spring4all</groupId>
-			<artifactId>swagger-spring-boot-starter</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>com.alibaba</groupId>
-			<artifactId>druid-spring-boot-starter</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>mysql</groupId>
-			<artifactId>mysql-connector-java</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>com.baomidou</groupId>
-			<artifactId>mybatis-plus-boot-starter</artifactId>
-			<version>3.1.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.projectlombok</groupId>
-			<artifactId>lombok</artifactId>
-			<version>1.18.4</version>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>com.baomidou</groupId>
-			<artifactId>mybatis-plus-generate</artifactId>
-			<version>2.3.3</version>
-		</dependency>
-		<!-- 模板引擎 -->
-		<dependency>
-			<groupId>org.apache.velocity</groupId>
-			<artifactId>velocity-engine-core</artifactId>
-			<version>2.0</version>
-		</dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.12</version>
-        </dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-test</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-test</artifactId>
-			<version>5.1.9.RELEASE</version>
-			<scope>compile</scope>
-		</dependency>
-        <dependency>
-            <groupId>javax.persistence</groupId>
-            <artifactId>javax.persistence-api</artifactId>
-        </dependency>
-		<dependency>
-			<groupId>com.ym</groupId>
-			<artifactId>common-core</artifactId>
-			<exclusions>
-				<exclusion>
-					<groupId>org.mybatis.spring.boot</groupId>
-					<artifactId>mybatis-spring-boot-starter</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-
-		<dependency>
-			<groupId>com.ym</groupId>
-			<artifactId>mec-biz</artifactId>
-		</dependency>
-
-        <dependency>
-            <groupId>com.ym</groupId>
-            <artifactId>snakerflowy</artifactId>
-        </dependency>
-
-	</dependencies>
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.boot</groupId>
-				<artifactId>spring-boot-maven-plugin</artifactId>
-			</plugin>
-		</plugins>
-	</build>
-</project>

+ 0 - 37
mec-education/src/main/java/com/ym/mec/education/EducationApplication.java

@@ -1,37 +0,0 @@
-package com.ym.mec.education;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.client.loadbalancer.LoadBalanced;
-import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.web.client.RestTemplate;
-
-import com.spring4all.swagger.EnableSwagger2Doc;
-
-@MapperScan({"com.ym.mec.education.mapper", "com.ym.mec.biz.dal.dao","com.ym.mec.biz.config.mybatis"})
-@SpringBootApplication
-@EnableDiscoveryClient
-@EnableFeignClients("com.ym.mec")
-@ComponentScan(basePackages = {"com.ym.mec", "org.snaker"})
-@Configuration
-@EnableSwagger2Doc
-@EnableAsync
-public class EducationApplication {
-
-    public static void main(String[] args) {
-        SpringApplication.run(EducationApplication.class, args);
-    }
-
-    @Bean
-    @LoadBalanced
-    public RestTemplate restTemplate() {
-        return new RestTemplate();
-    }
-
-}

+ 0 - 20
mec-education/src/main/java/com/ym/mec/education/base/BaseQuery.java

@@ -1,20 +0,0 @@
-package com.ym.mec.education.base;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import java.io.Serializable;
-
-/**
- * @version V1.0
- * @Description: TODO
- * @date Date : 2019年09月25日 21:50
- */
-@Data
-public class BaseQuery implements Serializable {
-
-    @ApiModelProperty(value = "起始页",required = false)
-    private Integer pageNo = 1;
-
-    @ApiModelProperty(value = "每页显示记录数",required = false)
-    private Integer pageSize = 10;
-}

+ 0 - 61
mec-education/src/main/java/com/ym/mec/education/base/BaseResponse.java

@@ -1,61 +0,0 @@
-package com.ym.mec.education.base;
-
-import com.ym.mec.education.enums.ReturnCodeEnum;
-import javax.persistence.MappedSuperclass;
-import java.io.Serializable;
-
-/**
- * @author : chengp
- * @version V1.0
- * @Description: TODO
- * @date Date : 2019年09月25日 17:53
- */
-@MappedSuperclass
-public class BaseResponse<T> extends Response implements Serializable {
-    protected T dataInfo;
-
-    public BaseResponse() {
-    }
-
-    public T getDataInfo() {
-        return this.dataInfo;
-    }
-
-    public void setDataInfo(final T dataInfo) {
-        this.dataInfo = dataInfo;
-    }
-
-    @Override
-    public String toString() {
-        return "BaseResponse(super=" + super.toString() + ", dataInfo=" + this.getDataInfo() + ")";
-    }
-
-    public static BaseResponse success(Object dataInfo) {
-        BaseResponse baseResponse = new BaseResponse<>();
-        baseResponse.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
-        baseResponse.setMessage(ReturnCodeEnum.CODE_200.getValue());
-        baseResponse.setDataInfo(dataInfo);
-        return baseResponse;
-    }
-
-    public static BaseResponse failParams() {
-        BaseResponse baseResponse = new BaseResponse<>();
-        baseResponse.setReturnCode(ReturnCodeEnum.CODE_206.getCode());
-        baseResponse.setMessage(ReturnCodeEnum.CODE_206.getValue());
-        return baseResponse;
-    }
-
-
-    public static BaseResponse errorParam(){
-        BaseResponse baseResponse = new BaseResponse();
-        baseResponse.setReturnCode(ReturnCodeEnum.CODE_206.getCode());
-        baseResponse.setMessage(ReturnCodeEnum.CODE_206.getValue());
-        return baseResponse;
-    }
-    public static BaseResponse noDataExists() {
-        BaseResponse baseResponse = new BaseResponse<>();
-        baseResponse.setReturnCode(ReturnCodeEnum.CODE_207.getCode());
-        baseResponse.setMessage(ReturnCodeEnum.CODE_207.getValue());
-        return baseResponse;
-    }
-}

+ 0 - 201
mec-education/src/main/java/com/ym/mec/education/base/PageResponse.java

@@ -1,201 +0,0 @@
-package com.ym.mec.education.base;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.ym.mec.education.enums.ReturnCodeEnum;
-import org.apache.commons.lang3.StringUtils;
-import org.snaker.engine.access.Page;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @version V1.0
- * @Description: TODO
- * @date Date : 2019年09月25日 17:53
- */
-public class PageResponse<T> extends Response implements Serializable {
-    private static final long serialVersionUID = 1L;
-    private List<T> records;
-    private Integer total;
-    private Integer size;
-    private Integer pages;
-    private Integer current;
-    private boolean searchCount;
-    private boolean optimizeCount;
-    private String orderByField;
-    private boolean isAsc;
-
-    public PageResponse() {
-        this.records = Collections.emptyList();
-        this.size = 10;
-        this.current = 1;
-        this.searchCount = true;
-        this.optimizeCount = false;
-        this.isAsc = true;
-    }
-
-    public static PageResponse success(IPage page) {
-        PageResponse pageResponse = new PageResponse(Math.toIntExact(page.getCurrent()), Math.toIntExact(page.getSize()));
-        pageResponse.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
-        pageResponse.setMessage(ReturnCodeEnum.CODE_200.getValue());
-        pageResponse.setRecords(page.getRecords());
-        pageResponse.setTotal(Math.toIntExact(page.getTotal()));
-        return pageResponse;
-    }
-
-    public static PageResponse success(Page page) {
-        PageResponse pageResponse = new PageResponse(page.getPageNo(), page.getPageSize());
-        pageResponse.setReturnCode(ReturnCodeEnum.CODE_200.getCode());
-        pageResponse.setMessage(ReturnCodeEnum.CODE_200.getValue());
-        pageResponse.setRecords(page.getResult());
-        pageResponse.setTotal(Math.toIntExact(page.getTotalCount()));
-        return pageResponse;
-    }
-
-    public PageResponse(Integer current, Integer size) {
-        this(current, size, true);
-    }
-
-    public PageResponse(Integer current, Integer size, String orderByField) {
-        this.records = Collections.emptyList();
-        this.setOrderByField(orderByField);
-    }
-
-    public PageResponse(Integer current, Integer size, boolean searchCount) {
-        this.records = Collections.emptyList();
-        this.size = 10;
-        this.current = 1;
-        this.searchCount = true;
-        this.optimizeCount = false;
-        this.isAsc = true;
-        if (current > 1) {
-            this.current = current;
-        }
-
-        this.size = size;
-        this.searchCount = searchCount;
-    }
-
-    public List<T> getRecords() {
-        return this.records;
-    }
-
-    public void setRecords(List<T> records) {
-        this.records = records;
-    }
-
-    protected static Integer offsetCurrent(Integer current, Integer size) {
-        return current > 0 ? (current - 1) * size : 0;
-    }
-
-    public Integer getOffsetCurrent() {
-        return offsetCurrent(this.current, this.size);
-    }
-
-    public boolean hasPrevious() {
-        return this.current > 1;
-    }
-
-    public boolean hasNext() {
-        return this.current < this.pages;
-    }
-
-    public Integer getTotal() {
-        return this.total;
-    }
-
-    public void setTotal(Integer total) {
-        this.total = total;
-    }
-
-    public Integer getSize() {
-        return this.size;
-    }
-
-    public void setSize(Integer size) {
-        this.size = size;
-    }
-
-    public Integer getPages() {
-        if (this.size != null && 0 != this.size && this.total != null) {
-            this.pages = this.total / this.size;
-            if (this.total % this.size != 0) {
-                this.pages = this.pages + 1;
-            }
-
-            return this.pages;
-        } else {
-            return null;
-        }
-    }
-
-    public void setCurrent(Integer current) {
-        this.current = current;
-    }
-
-    public Integer getCurrent() {
-        return this.current;
-    }
-
-    public boolean isSearchCount() {
-        return this.searchCount;
-    }
-
-    public void setSearchCount(boolean searchCount) {
-        this.searchCount = searchCount;
-    }
-
-    public boolean isOptimizeCount() {
-        return this.optimizeCount;
-    }
-
-    public void setOptimizeCount(boolean optimizeCount) {
-        this.optimizeCount = optimizeCount;
-    }
-
-    public String getOrderByField() {
-        return this.orderByField;
-    }
-
-    public void setOrderByField(String orderByField) {
-        if (StringUtils.isNotEmpty(orderByField)) {
-            this.orderByField = orderByField;
-        }
-
-    }
-
-    public boolean isAsc() {
-        return this.isAsc;
-    }
-
-    public void setAsc(boolean isAsc) {
-        this.isAsc = isAsc;
-    }
-
-    @Override
-    public String toString() {
-        StringBuffer pg = new StringBuffer();
-        pg.append(" Page:{ [").append(super.toString()).append("], ");
-        if (this.records != null) {
-            pg.append("records-size:").append(this.records.size());
-        } else {
-            pg.append("records is null");
-        }
-
-        return pg.append(" }").toString();
-    }
-
-    public static PageResponse errorParam(){
-        PageResponse pageResponse = new PageResponse();
-        pageResponse.setReturnCode(ReturnCodeEnum.CODE_206.getCode());
-        pageResponse.setMessage(ReturnCodeEnum.CODE_206.getValue());
-        return pageResponse;
-    }
-
-    public static PageResponse noDataExists() {
-        PageResponse pageResponse = new PageResponse();
-        pageResponse.setReturnCode(ReturnCodeEnum.CODE_207.getCode());
-        pageResponse.setMessage(ReturnCodeEnum.CODE_207.getValue());
-        return pageResponse;
-    }
-}

+ 0 - 100
mec-education/src/main/java/com/ym/mec/education/base/Response.java

@@ -1,100 +0,0 @@
-package com.ym.mec.education.base;
-
-/**
- * @version V1.0
- * @Description: TODO
- * @date Date : 2019年09月25日 17:50
- */
-import java.io.Serializable;
-
-public class Response implements Serializable {
-    protected Integer returnCode;
-    protected String message;
-    protected String chainId;
-
-    public Response() {
-    }
-
-    public Integer getReturnCode() {
-        return this.returnCode;
-    }
-
-    public String getMessage() {
-        return this.message;
-    }
-
-    public String getChainId() {
-        return this.chainId;
-    }
-
-    public void setReturnCode(final Integer returnCode) {
-        this.returnCode = returnCode;
-    }
-
-    public void setMessage(final String message) {
-        this.message = message;
-    }
-
-    public void setChainId(final String chainId) {
-        this.chainId = chainId;
-    }
-    @Override
-    public boolean equals(final Object o) {
-        if (o == this) {
-            return true;
-        } else if (!(o instanceof Response)) {
-            return false;
-        } else {
-            Response other = (Response) o;
-            if (!other.canEqual(this)) {
-                return false;
-            } else {
-                label47:
-                {
-                    Object this$returnCode = this.getReturnCode();
-                    Object other$returnCode = other.getReturnCode();
-                    if (this$returnCode == null) {
-                        if (other$returnCode == null) {
-                            break label47;
-                        }
-                    } else if (this$returnCode.equals(other$returnCode)) {
-                        break label47;
-                    }
-
-                    return false;
-                }
-
-                Object this$message = this.getMessage();
-                Object other$message = other.getMessage();
-                if (this$message == null) {
-                    if (other$message != null) {
-                        return false;
-                    }
-                } else if (!this$message.equals(other$message)) {
-                    return false;
-                }
-
-                Object this$chainId = this.getChainId();
-                Object other$chainId = other.getChainId();
-                if (this$chainId == null) {
-                    if (other$chainId != null) {
-                        return false;
-                    }
-                } else if (!this$chainId.equals(other$chainId)) {
-                    return false;
-                }
-
-                return true;
-            }
-        }
-    }
-
-    protected boolean canEqual(final Object other) {
-        return other instanceof Response;
-    }
-
-    @Override
-    public String toString() {
-        return "Response(returnCode=" + this.getReturnCode() + ", message=" + this.getMessage() + ", chainId=" + this.getChainId() + ")";
-    }
-}

+ 0 - 28
mec-education/src/main/java/com/ym/mec/education/config/ImageVerifyCodeConfig.java

@@ -1,28 +0,0 @@
-package com.ym.mec.education.config;
-
-import com.google.code.kaptcha.impl.DefaultKaptcha;
-import com.google.code.kaptcha.util.Config;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.Properties;
-
-@Configuration
-public class ImageVerifyCodeConfig {
-    @Bean(name="captchaProducer")
-    public DefaultKaptcha getKaptchaBean(){
-        DefaultKaptcha defaultKaptcha=new DefaultKaptcha();
-        Properties properties=new Properties();
-        properties.setProperty("kaptcha.border", "yes");
-        properties.setProperty("kaptcha.border.color", "105,179,90");
-        properties.setProperty("kaptcha.textproducer.font.color", "blue");
-        properties.setProperty("kaptcha.image.width", "125");
-        properties.setProperty("kaptcha.image.height", "45");
-        properties.setProperty("kaptcha.session.key", "code");
-        properties.setProperty("kaptcha.textproducer.char.length", "4");
-        properties.setProperty("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑");
-        Config config=new Config(properties);
-        defaultKaptcha.setConfig(config);
-        return defaultKaptcha;
-    }
-}

+ 0 - 22
mec-education/src/main/java/com/ym/mec/education/config/MybatisPlusConfig.java

@@ -1,22 +0,0 @@
-package com.ym.mec.education.config;
-
-import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * program: mec
- * description: mybatisplus分页插件
- * @author xw
- * create: 2019-09-25 13:26
- */
-@Configuration
-public class MybatisPlusConfig {
-
-    @Bean
-    public PaginationInterceptor paginationInterceptor(){
-        PaginationInterceptor page = new PaginationInterceptor();
-        page.setDialectType("mysql");
-        return page;
-    }
-}

+ 0 - 36
mec-education/src/main/java/com/ym/mec/education/config/ResourceServerConfig.java

@@ -1,36 +0,0 @@
-package com.ym.mec.education.config;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
-import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
-import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
-
-import com.ym.mec.common.security.BaseAccessDeniedHandler;
-import com.ym.mec.common.security.BaseAuthenticationEntryPoint;
-
-@Configuration
-@EnableResourceServer
-@EnableGlobalMethodSecurity(prePostEnabled = true)
-public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
-
-	@Autowired
-	private BaseAccessDeniedHandler baseAccessDeniedHandler;
-
-	@Autowired
-	private BaseAuthenticationEntryPoint baseAuthenticationEntryPoint;
-
-	@Override
-	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/v2/api-docs","/code/*").permitAll().antMatchers("/api/**").permitAll().anyRequest().authenticated().and().httpBasic();
-	}
-
-	@Override
-	public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
-		resources.authenticationEntryPoint(baseAuthenticationEntryPoint).accessDeniedHandler(baseAccessDeniedHandler);
-	}
-
-}

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä