Jelajahi Sumber

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

# Conflicts:
#	mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupServiceImpl.java
周箭河 5 tahun lalu
induk
melakukan
2313dcd5c2
86 mengubah file dengan 3087 tambahan dan 302 penghapusan
  1. 1 1
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/client/SysUserFeignService.java
  2. 16 15
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java
  3. 47 0
      mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/enums/UserLockFlag.java
  4. 2 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/handler/AuthenticationFailureListener.java
  5. 3 2
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/service/DefaultUserDetailsService.java
  6. 3 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java
  7. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java
  8. 7 6
      mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  9. 0 6
      mec-client-api/pom.xml
  10. 5 0
      mec-common/common-core/pom.xml
  11. 46 0
      mec-common/common-core/src/main/java/com/ym/mec/common/entity/UploadReturnBean.java
  12. 113 0
      mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/UploadFileService.java
  13. 0 78
      mec-thirdpart/pom.xml
  14. 36 0
      mec-thirdpart/src/main/java/com/ym/mec/thirdparty/exception/ThirdpartyException.java
  15. 24 0
      mec-thirdpart/src/main/java/com/ym/mec/thirdparty/storage/StoragePlugin.java
  16. 79 0
      mec-thirdpart/src/main/java/com/ym/mec/thirdparty/storage/StoragePluginContext.java
  17. 123 0
      mec-thirdpart/src/main/java/com/ym/mec/thirdparty/storage/vendors/AliyunOssStoragePlugin.java
  18. 84 0
      mec-thirdparty/pom.xml
  19. 36 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/exception/ThirdpartyException.java
  20. 24 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/StoragePlugin.java
  21. 97 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/StoragePluginContext.java
  22. 123 0
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/vendors/AliyunOssStoragePlugin.java
  23. 36 0
      mec-util/src/main/java/com/ym/mec/util/exception/UtilException.java
  24. 258 0
      mec-util/src/main/java/com/ym/mec/util/image/VerifyCodeUtils.java
  25. 80 0
      mec-util/src/main/java/com/ym/mec/util/image/WatermarkUtils.java
  26. 161 0
      mec-util/src/main/java/com/ym/mec/util/upload/UploadUtil.java
  27. 148 0
      mec-util/src/main/java/com/yqh/p2p/utils/codec/NumEncodeUtil.java
  28. 12 20
      mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java
  29. 48 0
      mec-web/src/main/java/com/ym/mec/web/controller/UploadFileController.java
  30. 33 0
      mec-web/src/main/java/com/ym/mec/web/controller/student/HotWordLabelController.java
  31. 56 0
      mec-web/src/main/java/com/ym/mec/web/controller/student/SuggestionController.java
  32. 63 0
      mec-web/src/main/java/com/ym/mec/web/controller/system/HotWordLabelManageController.java
  33. 16 0
      mec-web/src/main/java/com/ym/mec/web/controller/system/StudentManageController.java
  34. 3 3
      mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherAttendanceController.java
  35. 3 3
      mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherCourseHomeworkReplyController.java
  36. 34 0
      mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherDefaultMusicGroupSalaryController.java
  37. 40 0
      mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherLeaveRecordController.java
  38. 3 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupDao.java
  39. 9 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/HotWordsLabelDao.java
  40. 7 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/OrganizationDao.java
  41. 8 4
      mec-web/src/main/java/com/ym/mec/web/dal/dao/StudentManageDao.java
  42. 7 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/SubjectDao.java
  43. 7 1
      mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherDao.java
  44. 9 0
      mec-web/src/main/java/com/ym/mec/web/dal/dao/VipGroupCategoryDao.java
  45. 10 1
      mec-web/src/main/java/com/ym/mec/web/dal/dao/VipGroupDao.java
  46. 45 0
      mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentManageAccountBaseInfoDto.java
  47. 22 0
      mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentManageVipGroupDto.java
  48. 16 8
      mec-web/src/main/java/com/ym/mec/web/dal/entity/ClassGroupTeacherMapper.java
  49. 1 0
      mec-web/src/main/java/com/ym/mec/web/dal/entity/CourseSchedule.java
  50. 70 0
      mec-web/src/main/java/com/ym/mec/web/dal/entity/HotWordsLabel.java
  51. 14 2
      mec-web/src/main/java/com/ym/mec/web/dal/entity/Teacher.java
  52. 44 23
      mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherDefaultMusicGroupSalary.java
  53. 10 9
      mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherLeaveRecord.java
  54. 13 3
      mec-web/src/main/java/com/ym/mec/web/dal/entity/VipGroup.java
  55. 92 0
      mec-web/src/main/java/com/ym/mec/web/dal/entity/VipGroupCategory.java
  56. 36 0
      mec-web/src/main/java/com/ym/mec/web/dal/enums/AuditStatusEnum.java
  57. 47 0
      mec-web/src/main/java/com/ym/mec/web/dal/enums/UserLockFlag.java
  58. 11 0
      mec-web/src/main/java/com/ym/mec/web/dal/page/StudentManageCourseQueryInfo.java
  59. 23 0
      mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherAttendanceQueryInfo.java
  60. 19 0
      mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherCourseQueryInfo.java
  61. 59 0
      mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherQueryInfo.java
  62. 9 1
      mec-web/src/main/java/com/ym/mec/web/service/ClassGroupService.java
  63. 8 0
      mec-web/src/main/java/com/ym/mec/web/service/HotWordsLabelService.java
  64. 16 0
      mec-web/src/main/java/com/ym/mec/web/service/StudentManageService.java
  65. 8 0
      mec-web/src/main/java/com/ym/mec/web/service/TeacherDefaultMusicGroupSalaryService.java
  66. 22 0
      mec-web/src/main/java/com/ym/mec/web/service/TeacherService.java
  67. 8 0
      mec-web/src/main/java/com/ym/mec/web/service/VipGroupCategoryService.java
  68. 13 7
      mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupServiceImpl.java
  69. 19 9
      mec-web/src/main/java/com/ym/mec/web/service/impl/EmployeeServiceImpl.java
  70. 23 0
      mec-web/src/main/java/com/ym/mec/web/service/impl/HotWordsLabelServiceImpl.java
  71. 14 3
      mec-web/src/main/java/com/ym/mec/web/service/impl/StudentManageServiceImpl.java
  72. 23 0
      mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java
  73. 50 0
      mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherServiceImpl.java
  74. 23 0
      mec-web/src/main/java/com/ym/mec/web/service/impl/VipGroupCategoryServiceImpl.java
  75. 3 0
      mec-web/src/main/resources/config/mybatis/ClassGroupMapper.xml
  76. 72 0
      mec-web/src/main/resources/config/mybatis/HotWordsLabelMapper.xml
  77. 3 0
      mec-web/src/main/resources/config/mybatis/OrganizationMapper.xml
  78. 28 0
      mec-web/src/main/resources/config/mybatis/StudentManageDao.xml
  79. 3 0
      mec-web/src/main/resources/config/mybatis/SubjectMapper.xml
  80. 9 3
      mec-web/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml
  81. 1 7
      mec-web/src/main/resources/config/mybatis/TeacherDefaultMusicGroupSalaryMapper.xml
  82. 67 68
      mec-web/src/main/resources/config/mybatis/TeacherLeaveRecordMapper.xml
  83. 114 11
      mec-web/src/main/resources/config/mybatis/TeacherMapper.xml
  84. 80 0
      mec-web/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml
  85. 16 0
      mec-web/src/main/resources/config/mybatis/VipGroupMapper.xml
  86. 12 5
      pom.xml

+ 1 - 1
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/client/SysUserFeignService.java

@@ -21,7 +21,7 @@ public interface SysUserFeignService {
 	public SysUser getUserByMobile(@RequestParam("mobile") String mobile);
 
 	@GetMapping(value = "user/add")
-	public Object addUser(@RequestBody SysUser user);
+	public Object addUser(SysUser user);
 
 	@GetMapping(value = "task/test")
 	public Object test();

+ 16 - 15
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/entity/SysUser.java

@@ -1,12 +1,13 @@
 package com.ym.mec.auth.api.entity;
 
-import java.util.Date;
-
+import com.ym.mec.auth.api.enums.SysUserType;
+import com.ym.mec.auth.api.enums.UserLockFlag;
+import com.ym.mec.auth.api.enums.YesOrNoEnum;
+import com.ym.mec.common.enums.UserGenderEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
-import com.ym.mec.auth.api.enums.SysUserType;
-import com.ym.mec.common.enums.UserGenderEnum;
+import java.util.Date;
 
 /**
  * 对应数据库表(sys_user):
@@ -29,7 +30,7 @@ public class SysUser {
 	private String salt;
 
 	/** 简介 */
-	@ApiModelProperty(value = "菜单ID",required = false)
+	@ApiModelProperty(value = "手机号",required = false)
 	private String phone;
 
 	/** 头像 */
@@ -48,11 +49,11 @@ public class SysUser {
 
 	/** 0-正常,9-锁定 */
 	@ApiModelProperty(value = "0-正常,9-锁定",required = false)
-	private String lockFlag;
+	private UserLockFlag lockFlag;
 
 	/** 0-正常,1-删除 */
 	@ApiModelProperty(value = "0-正常,1-删除",required = false)
-	private String delFlag;
+	private YesOrNoEnum delFlag;
 
 	/** 微信openid */
 	@ApiModelProperty(value = "微信openid",required = false)
@@ -161,20 +162,20 @@ public class SysUser {
 		return this.updateTime;
 	}
 
-	public void setLockFlag(String lockFlag) {
-		this.lockFlag = lockFlag;
+	public UserLockFlag getLockFlag() {
+		return lockFlag;
 	}
 
-	public String getLockFlag() {
-		return this.lockFlag;
+	public void setLockFlag(UserLockFlag lockFlag) {
+		this.lockFlag = lockFlag;
 	}
 
-	public void setDelFlag(String delFlag) {
-		this.delFlag = delFlag;
+	public YesOrNoEnum getDelFlag() {
+		return delFlag;
 	}
 
-	public String getDelFlag() {
-		return this.delFlag;
+	public void setDelFlag(YesOrNoEnum delFlag) {
+		this.delFlag = delFlag;
 	}
 
 	public void setWxOpenid(String wxOpenid) {

+ 47 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/enums/UserLockFlag.java

@@ -0,0 +1,47 @@
+package com.ym.mec.auth.api.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/** 
+ * @author sunzl 
+ * 2015年8月25日 下午4:19:00 
+ * 会员状态枚举类
+ */
+public enum UserLockFlag implements BaseEnum<Integer, UserLockFlag> {
+
+	NOACTIVATED(0, "正常"), CANCELLED(1, "冻结"), NORMAL(9, "锁定");
+
+	private int code;
+
+	private UserLockFlag(int code, String remark) {
+		this.code = code;
+		this.remark = remark;
+	}
+
+	private String remark;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public static UserLockFlag codeOf(int code) {
+		for (UserLockFlag userStatus : UserLockFlag.values()) {
+			if (code == userStatus.getCode()) {
+				return userStatus;
+			}
+		}
+		return null;
+	}
+}

+ 2 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/handler/AuthenticationFailureListener.java

@@ -3,6 +3,7 @@ package com.ym.mec.auth.core.handler;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserLogin;
+import com.ym.mec.auth.api.enums.UserLockFlag;
 import com.ym.mec.auth.config.constant.SecurityConstants;
 import com.ym.mec.auth.service.SysUserLoginService;
 import com.ym.mec.auth.service.SysUserService;
@@ -58,7 +59,7 @@ public class AuthenticationFailureListener implements ApplicationListener<Authen
                 if(userLogin.getFailCount() >= 5){
                     userLogin.setLockTime(30);
                     userLogin.setLockDate(date);
-                    sysUser.setLockFlag("9");
+                    sysUser.setLockFlag(UserLockFlag.NORMAL);
                     sysUser.setUpdateTime(date);
                     sysUserService.update(sysUser);
                 }

+ 3 - 2
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/core/provider/service/DefaultUserDetailsService.java

@@ -3,6 +3,7 @@ package com.ym.mec.auth.core.provider.service;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.ym.mec.auth.api.enums.UserLockFlag;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.LockedException;
@@ -50,7 +51,7 @@ public class DefaultUserDetailsService implements UserDetailsService {
 		}
 		if (userInfo == null) {
 			throw new UsernameNotFoundException("账户不存在");
-		} else if (StringUtils.equals(userInfo.getSysUser().getLockFlag(), "9")) {
+		} else if (userInfo.getSysUser().getLockFlag() == UserLockFlag.NORMAL) {
 			throw new LockedException("账户被锁定");
 		}
 
@@ -67,7 +68,7 @@ public class DefaultUserDetailsService implements UserDetailsService {
 
 		SysUser sysUser = userInfo.getSysUser();
 
-		return new AuthUser(sysUser.getId(), sysUser.getOrganId(), username, BCRYPT + sysUser.getPassword(), StringUtils.equals(sysUser.getLockFlag(), "0"),
+		return new AuthUser(sysUser.getId(), sysUser.getOrganId(), username, BCRYPT + sysUser.getPassword(), sysUser.getLockFlag() == UserLockFlag.NOACTIVATED,
 				true, true, true, authorities);
 	}
 

+ 3 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java

@@ -3,6 +3,8 @@ package com.ym.mec.auth.service.impl;
 import java.util.Date;
 import java.util.List;
 
+import com.ym.mec.auth.api.enums.UserLockFlag;
+import com.ym.mec.auth.api.enums.YesOrNoEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -82,7 +84,7 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 		}
 
 		user.setUpdateTime(new Date());
-		user.setDelFlag("1");
+		user.setDelFlag(YesOrNoEnum.YES);
 
 		update(user);
 

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -140,7 +140,7 @@ public class UserController extends BaseController {
 
 	@ApiOperation(value = "修改用户")
 	@PutMapping("/update")
-	public Object update(@RequestBody SysUser sysUser) {
+	public Object update(SysUser sysUser) {
 		AuthUser user = SecurityUtils.getUser();
 		if(user != null){
 			Date date = new Date();

+ 7 - 6
mec-auth/mec-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -16,8 +16,8 @@
         <result column="organ_id_" property="organId"/>
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
-        <result column="lock_flag_" property="lockFlag"/>
-        <result column="del_flag_" property="delFlag"/>
+        <result column="lock_flag_" property="lockFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="wx_openid_" property="wxOpenid"/>
         <result column="qq_openid_" property="qqOpenid"/>
         <result column="user_type_" property="userType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -37,7 +37,7 @@
             and create_time_ &lt;= #{createEndDate}
         </if>
         <if test="userType != null">
-            and user_type_ = #{userType}
+            and user_type_ = #{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
         </if>
         <if test="organId != null">
             and organ_id_ = #{organId}
@@ -64,7 +64,8 @@
         -->
         INSERT INTO sys_user
         (im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,gender_,nation_,birthdate_,email_)
-        VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{gender, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{nation},#{birthdate},#{email})
+        VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        #{gender, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{nation},#{birthdate},#{email})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -72,7 +73,7 @@
         UPDATE sys_user
         <set>
             <if test="delFlag != null">
-                del_flag_ = #{delFlag},
+                del_flag_ = #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="wxOpenid != null">
                 wx_openid_ = #{wxOpenid},
@@ -99,7 +100,7 @@
                 update_time_ = #{updateTime},
             </if>
             <if test="lockFlag != null">
-                lock_flag_ = #{lockFlag},
+                lock_flag_ = #{lockFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             </if>
             <if test="birthdate != null">
                 birthdate_ = #{birthdate},

+ 0 - 6
mec-client-api/pom.xml

@@ -16,11 +16,5 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
   <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 </project>

+ 5 - 0
mec-common/common-core/pom.xml

@@ -38,5 +38,10 @@
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-openfeign</artifactId>
 		</dependency>
+
+		<dependency>
+			<groupId>com.ym</groupId>
+			<artifactId>mec-thirdparty</artifactId>
+		</dependency>
 	</dependencies>
 </project>

+ 46 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/entity/UploadReturnBean.java

@@ -0,0 +1,46 @@
+package com.ym.mec.common.entity;
+
+/** 
+ * @author sunzl 
+ * 2015年8月26日 下午4:42:03 
+ * 上传返回对象
+ */
+public class UploadReturnBean {
+
+	public UploadReturnBean(String url, boolean status, String message) {
+		super();
+		this.url = url;
+		this.status = status;
+		this.message = message;
+	}
+
+	private String url;
+
+	private boolean status;// 上传状态
+
+	private String message;// 上传失败 返回原因
+
+	public String getUrl() {
+		return url;
+	}
+
+	public void setUrl(String url) {
+		this.url = url;
+	}
+
+	public boolean isStatus() {
+		return status;
+	}
+
+	public void setStatus(boolean status) {
+		this.status = status;
+	}
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+}

+ 113 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/service/impl/UploadFileService.java

@@ -0,0 +1,113 @@
+package com.ym.mec.common.service.impl;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import com.alibaba.nacos.api.config.ConfigService;
+import com.ym.mec.common.entity.UploadReturnBean;
+import com.ym.mec.common.exception.BizException;
+import com.ym.mec.thirdparty.storage.StoragePlugin;
+import com.ym.mec.util.upload.UploadUtil;
+
+/** 
+ * 上传工具服务层实现类
+ */
+@Service
+public class UploadFileService {
+
+	@Autowired
+	private ConfigService configService;
+
+	@Autowired
+	private StoragePlugin storagePlugin;
+
+	/** 最大上传大小,单位kb */
+	@Value("${common.upload.maxSize:10}")
+	private int maxSize;
+
+	/** 支持的扩展名 */
+	@Value("${common.upload.supportExtensions:jpg,jpeg,gif,png,mp3,mid,midi}")
+	private String supportExtensions;
+
+	/** 文件根目录 */
+	@Value("common.upload.fileRoot:/var/tmp/")
+	private String fileRoot;
+
+	public UploadReturnBean uploadFile(InputStream in, String ext) {
+
+		UploadReturnBean uploadReturn = new UploadReturnBean("", false, "");
+		String fileName = UploadUtil.getFileName(ext);
+
+		String supportType = supportExtensions;
+		if (!UploadUtil.validateImgFile(ext, supportType)) {
+			uploadReturn.setMessage("上传图片格式错误,目前只支持" + supportType);
+			return uploadReturn;
+		}
+
+		String root = fileRoot;
+		if (StringUtils.isBlank(root)) {
+			uploadReturn.setMessage("上传临时目录没有配置");
+			return uploadReturn;
+		}
+
+		String staticFloder = "";
+
+		String folder = UploadUtil.getFileFloder();
+		String filePath = UploadUtil.getFilePath(root, staticFloder, folder);
+
+		File file = uploadFile(in, filePath, fileName);
+
+		if (maxSize > 0 && maxSize < file.length() / 1024) {
+			FileUtils.deleteQuietly(file);
+			uploadReturn.setMessage("超出允许的大小限制");
+			return uploadReturn;
+		}
+
+		String url = storagePlugin.uploadFile(staticFloder + folder, file);
+
+		FileUtils.deleteQuietly(file);
+
+		uploadReturn.setStatus(true);
+		uploadReturn.setUrl(url);
+		return uploadReturn;
+	}
+
+	public void setMaxSize(int maxSize) {
+		this.maxSize = maxSize;
+	}
+
+	/**
+	 * 上传文件的工具方法
+	 * @param in
+	 * @param path
+	 * @return
+	 */
+	private File uploadFile(InputStream inputStream, String filePath, String fileName) {
+		File file = new File(filePath + "/" + fileName);
+		try {
+			if (!file.getParentFile().exists()) {
+				file.getParentFile().mkdirs();
+			}
+			FileOutputStream fos = new FileOutputStream(file);
+			IOUtils.copy(inputStream, fos);
+			if (!file.exists() || file.length() == 0) {
+				throw new BizException("图片上传出现错误,请重新上传");
+			}
+		} catch (IOException e) {
+			throw new BizException("图片上传失败", e);
+		} finally {
+			IOUtils.closeQuietly(inputStream);
+		}
+		return file;
+	}
+
+}

+ 0 - 78
mec-thirdpart/pom.xml

@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <artifactId>mec</artifactId>
-    <groupId>com.ym</groupId>
-    <version>1.0</version>
-  </parent>
-
-  <groupId>com.ym</groupId>
-  <artifactId>mec-thirdpart</artifactId>
-  <version>1.0</version>
-
-  <name>mec-thirdpart</name>
-  <!-- FIXME change it to the project's website -->
-  <url>http://www.example.com</url>
-
-  <properties>
-    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    <maven.compiler.source>1.7</maven.compiler.source>
-    <maven.compiler.target>1.7</maven.compiler.target>
-  </properties>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.11</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-  <build>
-    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
-      <plugins>
-        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
-        <plugin>
-          <artifactId>maven-clean-plugin</artifactId>
-          <version>3.1.0</version>
-        </plugin>
-        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
-        <plugin>
-          <artifactId>maven-resources-plugin</artifactId>
-          <version>3.0.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-compiler-plugin</artifactId>
-          <version>3.8.0</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.22.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-jar-plugin</artifactId>
-          <version>3.0.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-install-plugin</artifactId>
-          <version>2.5.2</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-deploy-plugin</artifactId>
-          <version>2.8.2</version>
-        </plugin>
-        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
-        <plugin>
-          <artifactId>maven-site-plugin</artifactId>
-          <version>3.7.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-project-info-reports-plugin</artifactId>
-          <version>3.0.0</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
-</project>

+ 36 - 0
mec-thirdpart/src/main/java/com/ym/mec/thirdparty/exception/ThirdpartyException.java

@@ -0,0 +1,36 @@
+package com.ym.mec.thirdpart.exception;
+
+import com.ym.mec.util.string.MessageFormatter;
+
+public class ThirdpartException extends RuntimeException {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -4562885563376566463L;
+
+	public ThirdpartException() {
+		super();
+	}
+
+	public ThirdpartException(String message) {
+		super(message);
+	}
+
+	public ThirdpartException(Throwable cause) {
+		super(cause);
+	}
+
+	public ThirdpartException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ThirdpartException(String message, Object... arguments) {
+		super(MessageFormatter.arrayFormat(message, arguments));
+	}
+
+	public ThirdpartException(String message, Throwable cause, Object... args) {
+		super(MessageFormatter.arrayFormat(message, args), cause);
+	}
+
+}

+ 24 - 0
mec-thirdpart/src/main/java/com/ym/mec/thirdparty/storage/StoragePlugin.java

@@ -0,0 +1,24 @@
+package com.ym.mec.thirdpart.storage;
+
+import java.io.File;
+import java.io.IOException;
+
+public interface StoragePlugin {
+
+	/**
+	 * 上传文件
+	 * @param folderName 文件夹
+	 * @param file 需要上传的文件
+	 * @return 返回文件路径
+	 */
+	String uploadFile(String folderName, File file);
+
+	/**
+	 * 下载文件
+	 * @param folderName 文件夹
+	 * @param fileName 文件名称
+	 * @return 返回文件内容
+	 * @throws IOException
+	 */
+	byte[] getFile(String folderName, String fileName) throws IOException;
+}

+ 79 - 0
mec-thirdpart/src/main/java/com/ym/mec/thirdparty/storage/StoragePluginContext.java

@@ -0,0 +1,79 @@
+package com.ym.mec.thirdpart.storage;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+import com.ym.mec.thirdpart.exception.ThirdpartException;
+import com.ym.mec.thirdpart.storage.vendors.AliyunOssStoragePlugin;
+
+@Component
+public class StoragePluginContext implements ApplicationContextAware {
+
+	private ApplicationContext applicationContext;
+
+	private final Map<String, String> mapper = new HashMap<String, String>() {
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = -9071481806931421021L;
+
+		{
+			put("aliyun", StringUtils.uncapitalize(AliyunOssStoragePlugin.class.getSimpleName()));
+		}
+	};
+
+	private StoragePlugin storagePlugin;
+
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+		this.applicationContext = applicationContext;
+	}
+
+	/**
+	 * 上传文件
+	 * @param vendors 供应商
+	 * @param folderName 文件夹
+	 * @param file 需要上传的文件
+	 * @return 返回文件路径
+	 */
+	public String uploadFile(String vendors, String folderName, File file) {
+
+		storagePlugin = getStoragePlugin(vendors);
+
+		return storagePlugin.uploadFile(folderName, file);
+	}
+
+	/**
+	 * 下载文件
+	 * @param vendors 供应商
+	 * @param folderName 文件夹
+	 * @param fileName 文件名称
+	 * @return 返回文件内容
+	 * @throws IOException
+	 */
+	public byte[] getFile(String vendors, String folderName, String fileName) throws IOException {
+
+		storagePlugin = getStoragePlugin(vendors);
+
+		return storagePlugin.getFile(folderName, fileName);
+	}
+
+	private StoragePlugin getStoragePlugin(String vendors) {
+		String beanId = mapper.get(vendors);
+
+		if (StringUtils.isBlank(beanId)) {
+			throw new ThirdpartException("存储供应商不存在");
+		}
+
+		return applicationContext.getBean(beanId, StoragePlugin.class);
+	}
+
+}

+ 123 - 0
mec-thirdpart/src/main/java/com/ym/mec/thirdparty/storage/vendors/AliyunOssStoragePlugin.java

@@ -0,0 +1,123 @@
+package com.ym.mec.thirdpart.storage.vendors;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.aliyun.oss.ClientConfiguration;
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.OSSObject;
+import com.ym.mec.thirdpart.exception.ThirdpartException;
+import com.ym.mec.thirdpart.storage.StoragePlugin;
+
+@Component
+public class AliyunOssStoragePlugin implements StoragePlugin, InitializingBean, DisposableBean {
+
+	@Value("${storage.oss.endpoint:oss-cn-beijing.aliyuncs.com}")
+	private String endpoint;
+
+	@Value("${storage.oss.accessKeyId:LTAIwZW9XqrfsZ4r}")
+	private String accessKeyId;
+
+	@Value("${storage.oss.accessKeySecret:5uDsNZmHMxcnxav8w9byII4zcPpu5G}")
+	private String accessKeySecret;
+
+	@Value("${storage.oss.bucketName:yooma-test}")
+	private String bucketName;
+
+	private OSSClient ossClient;
+
+	@Override
+	public void afterPropertiesSet() throws Exception {
+		// 创建ClientConfiguration。ClientConfiguration是OSSClient的配置类,可配置代理、连接超时、最大连接数等参数。
+		ClientConfiguration conf = new ClientConfiguration();
+
+		// 设置OSSClient允许打开的最大HTTP连接数,默认为1024个。
+		conf.setMaxConnections(200);
+		// 设置Socket层传输数据的超时时间,默认为50000毫秒。
+		conf.setSocketTimeout(10000);
+		// 设置建立连接的超时时间,默认为50000毫秒。
+		conf.setConnectionTimeout(10000);
+		// 设置从连接池中获取连接的超时时间(单位:毫秒),默认不超时。
+		conf.setConnectionRequestTimeout(1000);
+		// 设置连接空闲超时时间。超时则关闭连接,默认为60000毫秒。
+		conf.setIdleConnectionTime(10000);
+		// 设置失败请求重试次数,默认为3次。
+		conf.setMaxErrorRetry(5);
+		// 设置是否支持将自定义域名作为Endpoint,默认支持。
+		conf.setSupportCname(true);
+
+		ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret, conf);
+	}
+
+	@Override
+	public String uploadFile(String folderName, File file) {
+		if (!file.exists()) {
+			throw new ThirdpartException("需要上传的文件[{}]不存在", file.getAbsolutePath());
+		}
+
+		if (folderName.endsWith("/")) {
+			folderName = folderName.substring(0, folderName.length() - 1);
+		}
+
+		ossClient.putObject(bucketName, folderName + "/" + file.getName(), file);
+
+		return "https://" + bucketName + "." + endpoint + "/" + folderName + "/" + file.getName();
+	}
+
+	@Override
+	public byte[] getFile(String folderName, String fileName) throws IOException {
+		OSSObject ossObject = ossClient.getObject(bucketName, folderName + "/" + fileName);
+		try {
+			return IOUtils.toByteArray(ossObject.getObjectContent());
+		} finally {
+			if (ossObject != null) {
+				ossObject.close();
+			}
+		}
+	}
+
+	@Override
+	public void destroy() throws Exception {
+		if (ossClient != null) {
+			ossClient.shutdown();
+		}
+	}
+
+	public void setEndpoint(String endpoint) {
+		this.endpoint = endpoint;
+	}
+
+	public void setAccessKeyId(String accessKeyId) {
+		this.accessKeyId = accessKeyId;
+	}
+
+	public void setAccessKeySecret(String accessKeySecret) {
+		this.accessKeySecret = accessKeySecret;
+	}
+
+	public void setBucketName(String bucketName) {
+		this.bucketName = bucketName;
+	}
+
+	public static void main(String[] args) throws Exception {
+		AliyunOssStoragePlugin aliyunOssStorageService = new AliyunOssStoragePlugin();
+		aliyunOssStorageService.setAccessKeyId("LTAIwZW9XqrfsZ4r");
+		aliyunOssStorageService.setAccessKeySecret("5uDsNZmHMxcnxav8w9byII4zcPpu5G");
+		aliyunOssStorageService.setBucketName("yooma-test");
+		aliyunOssStorageService.setEndpoint("oss-cn-beijing.aliyuncs.com");
+		aliyunOssStorageService.afterPropertiesSet();
+
+		File file = new File("e:/var/2.jpg");
+		System.out.println(aliyunOssStorageService.uploadFile("aaa", file));
+
+		System.err.println("***********" + aliyunOssStorageService.getFile("aaa", file.getName()).length);
+
+		aliyunOssStorageService.destroy();
+	}
+}

+ 84 - 0
mec-thirdparty/pom.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<artifactId>mec</artifactId>
+		<groupId>com.ym</groupId>
+		<version>1.0</version>
+	</parent>
+
+	<artifactId>mec-thirdparty</artifactId>
+
+	<name>mec-thirdparty</name>
+	<!-- FIXME change it to the project's website -->
+	<url>http://www.example.com</url>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<maven.compiler.source>1.8</maven.compiler.source>
+		<maven.compiler.target>1.8</maven.compiler.target>
+	</properties>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>com.ym</groupId>
+			<artifactId>mec-util</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.aliyun.oss</groupId>
+			<artifactId>aliyun-sdk-oss</artifactId>
+			<version>2.8.3</version>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<pluginManagement><!-- lock down plugins versions to avoid using Maven 
+				defaults (may be moved to parent pom) -->
+			<plugins>
+				<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
+				<plugin>
+					<artifactId>maven-clean-plugin</artifactId>
+					<version>3.1.0</version>
+				</plugin>
+				<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
+				<plugin>
+					<artifactId>maven-resources-plugin</artifactId>
+					<version>3.0.2</version>
+				</plugin>
+				<plugin>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<version>3.8.0</version>
+				</plugin>
+				<plugin>
+					<artifactId>maven-surefire-plugin</artifactId>
+					<version>2.22.1</version>
+				</plugin>
+				<plugin>
+					<artifactId>maven-jar-plugin</artifactId>
+					<version>3.0.2</version>
+				</plugin>
+				<plugin>
+					<artifactId>maven-install-plugin</artifactId>
+					<version>2.5.2</version>
+				</plugin>
+				<plugin>
+					<artifactId>maven-deploy-plugin</artifactId>
+					<version>2.8.2</version>
+				</plugin>
+				<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
+				<plugin>
+					<artifactId>maven-site-plugin</artifactId>
+					<version>3.7.1</version>
+				</plugin>
+				<plugin>
+					<artifactId>maven-project-info-reports-plugin</artifactId>
+					<version>3.0.0</version>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+</project>

+ 36 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/exception/ThirdpartyException.java

@@ -0,0 +1,36 @@
+package com.ym.mec.thirdparty.exception;
+
+import com.ym.mec.util.string.MessageFormatter;
+
+public class ThirdpartyException extends RuntimeException {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -4562885563376566463L;
+
+	public ThirdpartyException() {
+		super();
+	}
+
+	public ThirdpartyException(String message) {
+		super(message);
+	}
+
+	public ThirdpartyException(Throwable cause) {
+		super(cause);
+	}
+
+	public ThirdpartyException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public ThirdpartyException(String message, Object... arguments) {
+		super(MessageFormatter.arrayFormat(message, arguments));
+	}
+
+	public ThirdpartyException(String message, Throwable cause, Object... args) {
+		super(MessageFormatter.arrayFormat(message, args), cause);
+	}
+
+}

+ 24 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/StoragePlugin.java

@@ -0,0 +1,24 @@
+package com.ym.mec.thirdparty.storage;
+
+import java.io.File;
+import java.io.IOException;
+
+public interface StoragePlugin {
+
+	/**
+	 * 上传文件
+	 * @param folderName 文件夹
+	 * @param file 需要上传的文件
+	 * @return 返回文件路径
+	 */
+	String uploadFile(String folderName, File file);
+
+	/**
+	 * 下载文件
+	 * @param folderName 文件夹
+	 * @param fileName 文件名称
+	 * @return 返回文件内容
+	 * @throws IOException
+	 */
+	byte[] getFile(String folderName, String fileName) throws IOException;
+}

+ 97 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/StoragePluginContext.java

@@ -0,0 +1,97 @@
+package com.ym.mec.thirdparty.storage;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.stereotype.Component;
+
+import com.ym.mec.thirdparty.exception.ThirdpartyException;
+import com.ym.mec.thirdparty.storage.vendors.AliyunOssStoragePlugin;
+
+@Component
+public class StoragePluginContext implements ApplicationContextAware, InitializingBean {
+
+	@Value("${thirdparty.storagePluginName:aliyun}")
+	private String storagePluginName;
+
+	private ApplicationContext applicationContext;
+
+	private final Map<String, String> mapper = new HashMap<String, String>() {
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = -9071481806931421021L;
+
+		{
+			put("aliyun", StringUtils.uncapitalize(AliyunOssStoragePlugin.class.getSimpleName()));
+		}
+	};
+
+	private StoragePlugin storagePlugin;
+
+	@Override
+	public void afterPropertiesSet() throws Exception {
+		if (StringUtils.isBlank(storagePluginName)) {
+			throw new ThirdpartyException("存储插件变量thirdparty.storagePlugName不能为空");
+		}
+
+		storagePlugin = getStoragePlugin(storagePluginName);
+
+		if (storagePlugin == null) {
+			throw new ThirdpartyException("存储插件{}不存在", storagePluginName);
+		}
+	}
+
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+		this.applicationContext = applicationContext;
+	}
+
+	/**
+	 * 上传文件
+	 * @param vendors 供应商
+	 * @param folderName 文件夹
+	 * @param file 需要上传的文件
+	 * @return 返回文件路径
+	 */
+	public String uploadFile(String folderName, File file) {
+
+		return storagePlugin.uploadFile(folderName, file);
+	}
+
+	/**
+	 * 下载文件
+	 * @param vendors 供应商
+	 * @param folderName 文件夹
+	 * @param fileName 文件名称
+	 * @return 返回文件内容
+	 * @throws IOException
+	 */
+	public byte[] getFile(String folderName, String fileName) throws IOException {
+
+		return storagePlugin.getFile(folderName, fileName);
+	}
+
+	public void setStoragePluginName(String storagePluginName) {
+		this.storagePluginName = storagePluginName;
+	}
+
+	private StoragePlugin getStoragePlugin(String vendors) {
+		String beanId = mapper.get(vendors);
+
+		if (StringUtils.isBlank(beanId)) {
+			throw new ThirdpartyException("存储供应商不存在");
+		}
+
+		return applicationContext.getBean(beanId, StoragePlugin.class);
+	}
+
+}

+ 123 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/vendors/AliyunOssStoragePlugin.java

@@ -0,0 +1,123 @@
+package com.ym.mec.thirdparty.storage.vendors;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.IOUtils;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import com.aliyun.oss.ClientConfiguration;
+import com.aliyun.oss.OSSClient;
+import com.aliyun.oss.model.OSSObject;
+import com.ym.mec.thirdparty.exception.ThirdpartyException;
+import com.ym.mec.thirdparty.storage.StoragePlugin;
+
+@Component
+public class AliyunOssStoragePlugin implements StoragePlugin, InitializingBean, DisposableBean {
+
+	@Value("${storage.oss.endpoint:oss-cn-beijing.aliyuncs.com}")
+	private String endpoint;
+
+	@Value("${storage.oss.accessKeyId:LTAIwZW9XqrfsZ4r}")
+	private String accessKeyId;
+
+	@Value("${storage.oss.accessKeySecret:5uDsNZmHMxcnxav8w9byII4zcPpu5G}")
+	private String accessKeySecret;
+
+	@Value("${storage.oss.bucketName:yooma-test}")
+	private String bucketName;
+
+	private OSSClient ossClient;
+
+	@Override
+	public void afterPropertiesSet() throws Exception {
+		// 创建ClientConfiguration。ClientConfiguration是OSSClient的配置类,可配置代理、连接超时、最大连接数等参数。
+		ClientConfiguration conf = new ClientConfiguration();
+
+		// 设置OSSClient允许打开的最大HTTP连接数,默认为1024个。
+		conf.setMaxConnections(200);
+		// 设置Socket层传输数据的超时时间,默认为50000毫秒。
+		conf.setSocketTimeout(10000);
+		// 设置建立连接的超时时间,默认为50000毫秒。
+		conf.setConnectionTimeout(10000);
+		// 设置从连接池中获取连接的超时时间(单位:毫秒),默认不超时。
+		conf.setConnectionRequestTimeout(1000);
+		// 设置连接空闲超时时间。超时则关闭连接,默认为60000毫秒。
+		conf.setIdleConnectionTime(10000);
+		// 设置失败请求重试次数,默认为3次。
+		conf.setMaxErrorRetry(5);
+		// 设置是否支持将自定义域名作为Endpoint,默认支持。
+		conf.setSupportCname(true);
+
+		ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret, conf);
+	}
+
+	@Override
+	public String uploadFile(String folderName, File file) {
+		if (!file.exists()) {
+			throw new ThirdpartyException("需要上传的文件[{}]不存在", file.getAbsolutePath());
+		}
+
+		if (folderName.endsWith("/")) {
+			folderName = folderName.substring(0, folderName.length() - 1);
+		}
+
+		ossClient.putObject(bucketName, folderName + "/" + file.getName(), file);
+
+		return "https://" + bucketName + "." + endpoint + "/" + folderName + "/" + file.getName();
+	}
+
+	@Override
+	public byte[] getFile(String folderName, String fileName) throws IOException {
+		OSSObject ossObject = ossClient.getObject(bucketName, folderName + "/" + fileName);
+		try {
+			return IOUtils.toByteArray(ossObject.getObjectContent());
+		} finally {
+			if (ossObject != null) {
+				ossObject.close();
+			}
+		}
+	}
+
+	@Override
+	public void destroy() throws Exception {
+		if (ossClient != null) {
+			ossClient.shutdown();
+		}
+	}
+
+	public void setEndpoint(String endpoint) {
+		this.endpoint = endpoint;
+	}
+
+	public void setAccessKeyId(String accessKeyId) {
+		this.accessKeyId = accessKeyId;
+	}
+
+	public void setAccessKeySecret(String accessKeySecret) {
+		this.accessKeySecret = accessKeySecret;
+	}
+
+	public void setBucketName(String bucketName) {
+		this.bucketName = bucketName;
+	}
+
+	public static void main(String[] args) throws Exception {
+		AliyunOssStoragePlugin aliyunOssStorageService = new AliyunOssStoragePlugin();
+		aliyunOssStorageService.setAccessKeyId("LTAIwZW9XqrfsZ4r");
+		aliyunOssStorageService.setAccessKeySecret("5uDsNZmHMxcnxav8w9byII4zcPpu5G");
+		aliyunOssStorageService.setBucketName("yooma-test");
+		aliyunOssStorageService.setEndpoint("oss-cn-beijing.aliyuncs.com");
+		aliyunOssStorageService.afterPropertiesSet();
+
+		File file = new File("e:/var/2.jpg");
+		System.out.println(aliyunOssStorageService.uploadFile("aaa", file));
+
+		System.err.println("***********" + aliyunOssStorageService.getFile("aaa", file.getName()).length);
+
+		aliyunOssStorageService.destroy();
+	}
+}

+ 36 - 0
mec-util/src/main/java/com/ym/mec/util/exception/UtilException.java

@@ -0,0 +1,36 @@
+package com.ym.mec.util.exception;
+
+import com.ym.mec.util.string.MessageFormatter;
+
+public class UtilException extends RuntimeException {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -4562885563376566463L;
+
+	public UtilException() {
+		super();
+	}
+
+	public UtilException(String message) {
+		super(message);
+	}
+
+	public UtilException(Throwable cause) {
+		super(cause);
+	}
+
+	public UtilException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public UtilException(String message, Object... arguments) {
+		super(MessageFormatter.arrayFormat(message, arguments));
+	}
+
+	public UtilException(String message, Throwable cause, Object... args) {
+		super(MessageFormatter.arrayFormat(message, args), cause);
+	}
+
+}

+ 258 - 0
mec-util/src/main/java/com/ym/mec/util/image/VerifyCodeUtils.java

@@ -0,0 +1,258 @@
+package com.ym.mec.util.image;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.Random;
+
+import javax.imageio.ImageIO;
+
+/**
+ * 验证码工具类
+ */
+public class VerifyCodeUtils {
+
+	public static final String VERIFY_CODES = "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
+	private static Random random = new Random();
+
+	/**
+	 * 使用系统默认字符源生成验证码
+	 * @param verifySize	验证码长度
+	 * @return
+	 */
+	public static String generateVerifyCode(int verifySize) {
+		return generateVerifyCode(verifySize, VERIFY_CODES);
+	}
+
+	/**
+	 * 使用指定源生成验证码
+	 * @param verifySize	验证码长度
+	 * @param sources	验证码字符源
+	 * @return
+	 */
+	public static String generateVerifyCode(int verifySize, String sources) {
+		if (sources == null || sources.length() == 0) {
+			sources = VERIFY_CODES;
+		}
+		int codesLen = sources.length();
+		Random rand = new Random();
+		StringBuilder verifyCode = new StringBuilder(verifySize);
+		for (int i = 0; i < verifySize; i++) {
+			verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1)));
+		}
+		return verifyCode.toString();
+	}
+
+	/**
+	 * 生成随机验证码文件,并返回验证码值
+	 * @param w
+	 * @param h
+	 * @param outputFile
+	 * @param verifySize
+	 * @return
+	 * @throws IOException
+	 */
+	public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException {
+		String verifyCode = generateVerifyCode(verifySize);
+		outputImage(w, h, outputFile, verifyCode);
+		return verifyCode;
+	}
+
+	/**
+	 * 输出随机验证码图片流,并返回验证码值
+	 * @param w
+	 * @param h
+	 * @param os
+	 * @param verifySize
+	 * @return
+	 * @throws IOException
+	 */
+	public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException {
+		String verifyCode = generateVerifyCode(verifySize);
+		outputImage(w, h, os, verifyCode);
+		return verifyCode;
+	}
+
+	/**
+	 * 生成指定验证码图像文件
+	 * @param w
+	 * @param h
+	 * @param outputFile
+	 * @param code
+	 * @throws IOException
+	 */
+	public static void outputImage(int w, int h, File outputFile, String code) throws IOException {
+		if (outputFile == null) {
+			return;
+		}
+		File dir = outputFile.getParentFile();
+		if (!dir.exists()) {
+			dir.mkdirs();
+		}
+		try {
+			outputFile.createNewFile();
+			FileOutputStream fos = new FileOutputStream(outputFile);
+			outputImage(w, h, fos, code);
+			fos.close();
+		} catch (IOException e) {
+			throw e;
+		}
+	}
+
+	/**
+	 * 输出指定验证码图片流
+	 * @param w
+	 * @param h
+	 * @param os
+	 * @param code
+	 * @throws IOException
+	 */
+	public static void outputImage(int w, int h, OutputStream os, String code) throws IOException {
+		int verifySize = code.length();
+		BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
+		Random rand = new Random();
+		Graphics2D g2 = image.createGraphics();
+		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		Color[] colors = new Color[5];
+		Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE, Color.PINK, Color.YELLOW };
+		float[] fractions = new float[colors.length];
+		for (int i = 0; i < colors.length; i++) {
+			colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)];
+			fractions[i] = rand.nextFloat();
+		}
+		Arrays.sort(fractions);
+
+		g2.setColor(Color.GRAY);// 设置边框色
+		g2.fillRect(0, 0, w, h);
+
+		Color c = getRandColor(200, 250);
+		g2.setColor(c);// 设置背景色
+		g2.fillRect(0, 2, w, h - 4);
+
+		// 绘制干扰线
+		Random random = new Random();
+		g2.setColor(getRandColor(160, 200));// 设置线条的颜色
+		for (int i = 0; i < 20; i++) {
+			int x = random.nextInt(w - 1);
+			int y = random.nextInt(h - 1);
+			int xl = random.nextInt(6) + 1;
+			int yl = random.nextInt(12) + 1;
+			g2.drawLine(x, y, x + xl + 40, y + yl + 20);
+		}
+
+		// 添加噪点
+		float yawpRate = 0.05f;// 噪声率
+		int area = (int) (yawpRate * w * h);
+		for (int i = 0; i < area; i++) {
+			int x = random.nextInt(w);
+			int y = random.nextInt(h);
+			int rgb = getRandomIntColor();
+			image.setRGB(x, y, rgb);
+		}
+
+		shear(g2, w, h, c);// 使图片扭曲
+
+		g2.setColor(getRandColor(100, 160));
+		int fontSize = h - 4;
+		Font font = new Font("Arial", Font.ITALIC, fontSize);
+		g2.setFont(font);
+		char[] chars = code.toCharArray();
+		for (int i = 0; i < verifySize; i++) {
+			AffineTransform affine = new AffineTransform();
+			affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize / 2, h / 2);
+			g2.setTransform(affine);
+			g2.drawChars(chars, i, 1, ((w - 10) / verifySize) * i + 5, h / 2 + fontSize / 2 - 10);
+		}
+
+		g2.dispose();
+		ImageIO.write(image, "jpg", os);
+	}
+
+	private static Color getRandColor(int fc, int bc) {
+		if (fc > 255)
+			fc = 255;
+		if (bc > 255)
+			bc = 255;
+		int r = fc + random.nextInt(bc - fc);
+		int g = fc + random.nextInt(bc - fc);
+		int b = fc + random.nextInt(bc - fc);
+		return new Color(r, g, b);
+	}
+
+	private static int getRandomIntColor() {
+		int[] rgb = getRandomRgb();
+		int color = 0;
+		for (int c : rgb) {
+			color = color << 8;
+			color = color | c;
+		}
+		return color;
+	}
+
+	private static int[] getRandomRgb() {
+		int[] rgb = new int[3];
+		for (int i = 0; i < 3; i++) {
+			rgb[i] = random.nextInt(255);
+		}
+		return rgb;
+	}
+
+	private static void shear(Graphics g, int w1, int h1, Color color) {
+		shearX(g, w1, h1, color);
+		shearY(g, w1, h1, color);
+	}
+
+	private static void shearX(Graphics g, int w1, int h1, Color color) {
+
+		int period = random.nextInt(2);
+
+		boolean borderGap = true;
+		int frames = 1;
+		int phase = random.nextInt(2);
+
+		for (int i = 0; i < h1; i++) {
+			double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames);
+			g.copyArea(0, i, w1, 1, (int) d, 0);
+			if (borderGap) {
+				g.setColor(color);
+				g.drawLine((int) d, i, 0, i);
+				g.drawLine((int) d + w1, i, w1, i);
+			}
+		}
+
+	}
+
+	private static void shearY(Graphics g, int w1, int h1, Color color) {
+
+		int period = random.nextInt(40) + 10; // 50;
+
+		boolean borderGap = true;
+		int frames = 20;
+		int phase = 7;
+		for (int i = 0; i < w1; i++) {
+			double d = (double) (period >> 1) * Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames);
+			g.copyArea(i, 0, 1, h1, 0, (int) d);
+			if (borderGap) {
+				g.setColor(color);
+				g.drawLine(i, (int) d, i, 0);
+				g.drawLine(i, (int) d + h1, i, h1);
+			}
+
+		}
+
+	}
+
+	public static void main(String[] args) throws IOException {
+		String verifyCode = generateVerifyCode(4);
+		System.out.println(verifyCode);
+	}
+}

+ 80 - 0
mec-util/src/main/java/com/ym/mec/util/image/WatermarkUtils.java

@@ -0,0 +1,80 @@
+package com.ym.mec.util.image;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+
+/**
+ * 添加水印的工具类
+ */
+public class WatermarkUtils {
+
+	/**
+	 * Embeds a textual watermark over a source image to produce
+	 * a watermarked one.
+	 * @param text The text to be embedded as watermark.
+	 * @param sourceImageFile The source image file.
+	 * @param destImageFile The output image file.
+	 * @throws IOException 
+	 */
+	public static void addTextWatermark(String text, File sourceImageFile, File destImageFile) throws IOException {
+
+		BufferedImage sourceImage = ImageIO.read(sourceImageFile);
+		Graphics2D g2d = (Graphics2D) sourceImage.getGraphics();
+
+		// initializes necessary graphic properties
+		AlphaComposite alphaChannel = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.1f);
+		g2d.setComposite(alphaChannel);
+		g2d.setColor(Color.BLUE);
+		g2d.setFont(new Font("Arial", Font.BOLD, 64));
+		FontMetrics fontMetrics = g2d.getFontMetrics();
+		Rectangle2D rect = fontMetrics.getStringBounds(text, g2d);
+
+		// calculates the coordinate where the String is painted
+		int centerX = (sourceImage.getWidth() - (int) rect.getWidth()) / 2;
+		int centerY = sourceImage.getHeight() / 2;
+
+		// paints the textual watermark
+		g2d.drawString(text, centerX, centerY);
+
+		ImageIO.write(sourceImage, "png", destImageFile);
+		g2d.dispose();
+
+	}
+
+	/**
+	 * Embeds an image watermark over a source image to produce
+	 * a watermarked one.
+	 * @param watermarkImageFile The image file used as the watermark.
+	 * @param sourceImageFile The source image file.
+	 * @param destImageFile The output image file.
+	 * @throws IOException 
+	 */
+	public static void addImageWatermark(File watermarkImageFile, File sourceImageFile, File destImageFile) throws IOException {
+		BufferedImage sourceImage = ImageIO.read(sourceImageFile);
+		BufferedImage watermarkImage = ImageIO.read(watermarkImageFile);
+
+		// initializes necessary graphic properties
+		Graphics2D g2d = (Graphics2D) sourceImage.getGraphics();
+		AlphaComposite alphaChannel = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f);
+		g2d.setComposite(alphaChannel);
+
+		// calculates the coordinate where the image is painted
+		int topLeftX = (sourceImage.getWidth() - watermarkImage.getWidth()) / 2;
+		int topLeftY = (sourceImage.getHeight() - watermarkImage.getHeight()) / 2;
+
+		// paints the image watermark
+		g2d.drawImage(watermarkImage, topLeftX, topLeftY, null);
+
+		ImageIO.write(sourceImage, "png", destImageFile);
+		g2d.dispose();
+	}
+}

+ 161 - 0
mec-util/src/main/java/com/ym/mec/util/upload/UploadUtil.java

@@ -0,0 +1,161 @@
+package com.ym.mec.util.upload;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+
+import com.ym.mec.util.exception.UtilException;
+import com.yqh.p2p.utils.codec.NumEncodeUtil;
+
+/** 
+ * @author sunzl 
+ * 2015年7月20日 上午11:56:51 
+ * 上传工具类
+ */
+public class UploadUtil {
+
+	/**
+	 * 日期格式化工具
+	 */
+
+
+	/**
+	 * 校验上传文件的合法性
+	 * @param fileName
+	 * @param puffixs
+	 * @return
+	 */
+	public static boolean validateImgFile(String ext, String puffixs) {
+
+		String[] puffixArr = puffixs.split(",");
+
+		List<String> puffixList = Arrays.asList(puffixArr);
+
+		if (StringUtils.isBlank(ext)) {
+			return false;
+		}
+		if (puffixList.contains(ext.toLowerCase())) {
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * 获得文件的扩展名
+	 * @param fileName
+	 * @return
+	 */
+	public static String getExtension(String fileName) {
+		if (StringUtils.isBlank(fileName)) {
+			return "";
+		}
+		if (fileName.lastIndexOf(".") != -1 && fileName.lastIndexOf(".") != 0) {
+			return fileName.substring(fileName.lastIndexOf(".") + 1);
+		}
+
+		return "";
+	}
+
+	/**
+	 * 获得文件原名称
+	 * @param fileName
+	 * @return
+	 */
+	public static String getOriFileName(String fileName) {
+		if (StringUtils.isBlank(fileName)) {
+			return "";
+		}
+		if (fileName.lastIndexOf(".") != -1 && fileName.lastIndexOf(".") != 0) {
+			return fileName.substring(0, fileName.lastIndexOf("."));
+		}
+
+		return "";
+	}
+
+	/**
+	 * 获取文件名称
+	 * @param path
+	 * @param dir
+	 * @param ext
+	 * @return
+	 */
+	public static String getFileName(String ext) {
+		String fileName = "";
+		fileName = NumEncodeUtil.longToN62(System.currentTimeMillis()) + "." + ext;
+		return fileName;
+	}
+
+	/**
+	 * 获得上传路径
+	 * @param root
+	 * @param dir
+	 * @return
+	 */
+	public static String getFilePath(String root, String dir, String floder) {
+		String path = root + dir + floder;
+		return path;
+	}
+
+	/**
+	 * 获得上传图片的文件夹
+	 * @return
+	 */
+	public static String getFileFloder() {
+		DateFormat format = new SimpleDateFormat("yyyyMM/");
+		String floder = format.format(new Date());
+		return floder;
+	}
+
+	/**
+	 * 获得上传zip的文件夹
+	 * @return
+	 */
+	public static String getZipFloder() {
+		DateFormat format = new SimpleDateFormat("yyyyMMddhhmmss/");
+		String floder = format.format(new Date());
+		return floder;
+	}
+
+	/**
+	 * 创建zip解压后的文件夹
+	 * @return
+	 */
+	public static String getZipFolder(String root, String dir, String dataStr) {
+		String folder = root + dir + dataStr;
+		return folder;
+	}
+
+	/**
+	 * 上传文件的工具方法
+	 * @param in
+	 * @param path
+	 * @return
+	 */
+	public static boolean uploadFile(InputStream inputStream, String filePath, String fileName) {
+		try {
+			File file = new File(filePath + "/" + fileName);
+			if (!file.getParentFile().exists()) {
+				file.getParentFile().mkdirs();
+			}
+			FileOutputStream fos = new FileOutputStream(file);
+			IOUtils.copy(inputStream, fos);
+			if (!file.exists() || file.length() == 0) {
+				throw new UtilException("图片上传出现错误,请重新上传");
+			}
+		} catch (IOException e) {
+			throw new UtilException("图片上传失败", e);
+		} finally {
+			IOUtils.closeQuietly(inputStream);
+		}
+		return true;
+	}
+}

+ 148 - 0
mec-util/src/main/java/com/yqh/p2p/utils/codec/NumEncodeUtil.java

@@ -0,0 +1,148 @@
+package com.yqh.p2p.utils.codec;
+
+/**
+ * 62进制数字
+ */
+public class NumEncodeUtil {
+	/**
+	 * 62个字母和数字,含大小写
+	 */
+	public static final char[] N62_CHARS = { '0', '1', '2', '3', '4', '5', '6',
+			'7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
+			'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
+			'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+			'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
+			'x', 'y', 'z' };
+	/**
+	 * 36个小写字母和数字
+	 */
+	public static final char[] N36_CHARS = { '0', '1', '2', '3', '4', '5', '6',
+			'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+			'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
+			'x', 'y', 'z' };
+	/**
+	 * 长整型用N36表示的最大长度
+	 */
+	public static final int LONG_N36_LEN = 13;
+	/**
+	 * 长整型用N62表示的最大长度
+	 */
+	public static final int LONG_N62_LEN = 11;
+
+	/**
+	 * 长整型转换成字符串
+	 * 
+	 * @param l
+	 * @param chars
+	 * @return
+	 */
+	private static StringBuilder longToNBuf(long l, char[] chars) {
+		int upgrade = chars.length;
+		StringBuilder result = new StringBuilder();
+		int last;
+		while (l > 0) {
+			last = (int) (l % upgrade);
+			result.append(chars[last]);
+			l /= upgrade;
+		}
+		return result;
+	}
+
+	/**
+	 * 长整数转换成N62
+	 * 
+	 * @param l
+	 * @return
+	 */
+	public static String longToN62(long l) {
+		return longToNBuf(l, N62_CHARS).reverse().toString();
+	}
+
+	/**
+	 * 长整型转换成N36
+	 * 
+	 * @param l
+	 * @return
+	 */
+	public static String longToN36(long l) {
+		return longToNBuf(l, N36_CHARS).reverse().toString();
+	}
+
+	/**
+	 * 长整数转换成N62
+	 * 
+	 * @param l
+	 * @param length
+	 *            如不足length长度,则补足0。
+	 * @return
+	 */
+	public static String longToN62(long l, int length) {
+		StringBuilder sb = longToNBuf(l, N62_CHARS);
+		for (int i = sb.length(); i < length; i++) {
+			sb.append('0');
+		}
+		return sb.reverse().toString();
+	}
+
+	/**
+	 * 长整型转换成N36
+	 * 
+	 * @param l
+	 * @param length
+	 *            如不足length长度,则补足0。
+	 * @return
+	 */
+	public static String longToN36(long l, int length) {
+		StringBuilder sb = longToNBuf(l, N36_CHARS);
+		for (int i = sb.length(); i < length; i++) {
+			sb.append('0');
+		}
+		return sb.reverse().toString();
+	}
+
+	/**
+	 * N62转换成整数
+	 * 
+	 * @param n62
+	 * @return
+	 */
+	public static long n62ToLong(String n62) {
+		return nToLong(n62, N62_CHARS);
+	}
+
+	/**
+	 * N36转换成整数
+	 * 
+	 * @param n36
+	 * @return
+	 */
+	public static long n36ToLong(String n36) {
+		return nToLong(n36, N36_CHARS);
+	}
+
+	private static long nToLong(String s, char[] chars) {
+		char[] nc = s.toCharArray();
+		long result = 0;
+		long pow = 1;
+		for (int i = nc.length - 1; i >= 0; i--, pow *= chars.length) {
+			int n = findNIndex(nc[i], chars);
+			result += n * pow;
+		}
+		return result;
+	}
+
+	private static int findNIndex(char c, char[] chars) {
+		for (int i = 0; i < chars.length; i++) {
+			if (c == chars[i]) {
+				return i;
+			}
+		}
+		throw new RuntimeException("N62(N36)非法字符:" + c);
+	}
+
+	public static void main(String[] args) {
+		String str = longToN62(13720176797l);
+		System.out.println(str);
+		System.out.println(n62ToLong(str));
+	}
+}

+ 12 - 20
mec-web/src/main/java/com/ym/mec/web/controller/TeacherController.java

@@ -1,8 +1,9 @@
 package com.ym.mec.web.controller;
 
 import com.ym.mec.common.controller.BaseController;
-import com.ym.mec.common.security.SecurityUtils;
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.web.dal.entity.Teacher;
+import com.ym.mec.web.dal.page.TeacherCourseQueryInfo;
 import com.ym.mec.web.dal.page.TeacherQueryInfo;
 import com.ym.mec.web.service.ClassGroupService;
 import com.ym.mec.web.service.TeacherService;
@@ -37,40 +38,25 @@ public class TeacherController extends BaseController {
         return succeed();
     }
 
-    @ApiOperation(value = "删除教师")
-    @PostMapping("/del/{id}")
-    public Object del(@ApiParam(value = "教师编号", required = true) @PathVariable("id") Integer id) {
-        teacherService.delete(id);
-        return succeed();
-    }
-
     @ApiOperation(value = "修改教师")
     @PostMapping("/update")
     public Object update(Teacher teacher) {
-        Integer organId = SecurityUtils.getUser().getOrganId();
-        if(organId != null){
-            teacher.setOrganId(organId);
-        }
-        Teacher teacherServiceByCertificateNum = teacherService.findByCertificateNum(teacher.getCertificateNum());
-        if (teacherServiceByCertificateNum != null && !teacherServiceByCertificateNum.getId().equals(teacher.getId())) {
-            return failed("系统已存在该证件号的老师,请核查");
-        }
         teacher.setUpdateTime(new Date());
-        teacherService.update(teacher);
+        teacherService.updateTea(teacher);
         return succeed();
     }
 
-    @ApiOperation(value = "根据教师编号查询教师")
+    @ApiOperation(value = "根据教师编号查询教师基本信息")
     @GetMapping("/get/{id}")
     @ApiParam(value = "教师编号", required = true)
     public Object get(@PathVariable("id") Integer id) {
-        return succeed(teacherService.get(id));
+        return succeed(teacherService.getDetail(id));
     }
 
     @ApiOperation(value = "分页查询教师列表")
     @GetMapping("/queryPage")
     public Object queryPage(TeacherQueryInfo queryInfo) {
-        return succeed(teacherService.queryPage(queryInfo));
+        return succeed(teacherService.queryPageDetail(queryInfo));
     }
 
     @ApiOperation(value = "根据教师编号查询教师课程班列表")
@@ -79,4 +65,10 @@ public class TeacherController extends BaseController {
     public Object getClassGroup(@PathVariable("id") Integer id) {
         return succeed(classGroupService.findClassGroup4Teacher(id));
     }
+
+    @ApiOperation(value = "获取老师课程信息列表")
+    @GetMapping("/getTeaCourseInfos")
+    public Object getTeaCourseInfos(QueryInfo queryInfo){
+        return succeed(classGroupService.getTeaCourseInfos(queryInfo));
+    }
 }

+ 48 - 0
mec-web/src/main/java/com/ym/mec/web/controller/UploadFileController.java

@@ -0,0 +1,48 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiParam;
+
+import org.apache.commons.lang.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.UploadReturnBean;
+import com.ym.mec.common.service.impl.UploadFileService;
+import com.ym.mec.util.upload.UploadUtil;
+
+/** 
+ * 上传控制层
+ */
+@RestController
+@Api(tags = "文件上传服务")
+public class UploadFileController extends BaseController {
+
+	private final static Logger LOGGER = LoggerFactory.getLogger(UploadFileController.class);
+
+	@Autowired
+	private UploadFileService uploadFileService;
+
+	@PostMapping(value = "uploadFile", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	public Object uploadFile(@ApiParam(value = "上传的文件", required = true) @RequestParam("file") MultipartFile file) {
+		try {
+			if (file != null && StringUtils.isNotBlank(file.getOriginalFilename())) {
+				UploadReturnBean bean = uploadFileService.uploadFile(file.getInputStream(), UploadUtil.getExtension(file.getOriginalFilename()));
+				if (bean.isStatus()) {
+					return succeed(bean);
+				}
+				return failed(bean.getMessage());
+			}
+		} catch (Exception e) {
+			LOGGER.error("上传失败", e);
+		}
+		return failed("上传失败");
+	}
+}

+ 33 - 0
mec-web/src/main/java/com/ym/mec/web/controller/student/HotWordLabelController.java

@@ -0,0 +1,33 @@
+package com.ym.mec.web.controller.student;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.service.HotWordsLabelService;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/21
+ */
+@Api("热词标签")
+@RequestMapping("hotWordLabel")
+@RestController
+public class HotWordLabelController extends BaseController {
+
+    @Autowired
+    private HotWordsLabelService hotWordsLabelService;
+
+    @ApiOperation("分页查询热词列表")
+    @PostMapping("/queryPage")
+    public Object queryPage(QueryInfo queryInfo){
+        return succeed(hotWordsLabelService.queryPage(queryInfo));
+    }
+
+}

+ 56 - 0
mec-web/src/main/java/com/ym/mec/web/controller/student/SuggestionController.java

@@ -0,0 +1,56 @@
+package com.ym.mec.web.controller.student;
+
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.SysSuggestion;
+import com.ym.mec.web.service.SysSuggestionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import static com.ym.mec.common.controller.BaseController.succeed;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/21
+ */
+@Api("平台建议")
+@RequestMapping("suggestion")
+@RestController
+public class SuggestionController {
+
+    @Autowired
+    private SysSuggestionService suggestionService;
+
+    @ApiOperation(value = "新增建议")
+    @PostMapping("/add")
+    public Object add(SysSuggestion SysSuggestion) {
+        suggestionService.insert(SysSuggestion);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除建议")
+    @PostMapping("/del/{id}")
+    public Object del(@ApiParam(value = "建议编号", required = true) @PathVariable("id") Integer id) {
+        suggestionService.delete(Long.valueOf(id));
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改建议")
+    @PostMapping("/update")
+    public Object update(SysSuggestion SysSuggestion) {
+        suggestionService.update(SysSuggestion);
+        return succeed();
+    }
+
+
+    @ApiOperation("分页查询建议列表")
+    @PostMapping("/queryPage")
+    public Object queryPage(QueryInfo queryInfo){
+        return succeed(suggestionService.queryPage(queryInfo));
+    }
+}

+ 63 - 0
mec-web/src/main/java/com/ym/mec/web/controller/system/HotWordLabelManageController.java

@@ -0,0 +1,63 @@
+package com.ym.mec.web.controller.system;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+
+import java.util.Date;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.HotWordsLabel;
+import com.ym.mec.web.service.HotWordsLabelService;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/21
+ */
+@Api("热词标签管理")
+@RequestMapping("hotWordLabelManage")
+@RestController
+public class HotWordLabelManageController extends BaseController {
+
+    @Autowired
+    private HotWordsLabelService hotWordsLabelService;
+
+
+
+    @ApiOperation(value = "新增热词标签")
+    @PostMapping("/add")
+    public Object add(HotWordsLabel hotWordsLabel) {
+        hotWordsLabelService.insert(hotWordsLabel);
+        return succeed();
+    }
+
+    @ApiOperation(value = "删除热词标签")
+    @PostMapping("/del/{id}")
+    public Object del(@ApiParam(value = "热词标签编号", required = true) @PathVariable("id") Integer id) {
+        hotWordsLabelService.delete(id);
+        return succeed();
+    }
+
+    @ApiOperation(value = "修改热词标签")
+    @PostMapping("/update")
+    public Object update(HotWordsLabel hotWordsLabel) {
+        hotWordsLabel.setUpdateTime(new Date());
+        hotWordsLabelService.update(hotWordsLabel);
+        return succeed();
+    }
+
+
+    @ApiOperation("分页查询热词列表")
+    @PostMapping("/queryPage")
+    public Object queryPage(QueryInfo queryInfo){
+        return succeed(hotWordsLabelService.queryPage(queryInfo));
+    }
+
+}

+ 16 - 0
mec-web/src/main/java/com/ym/mec/web/controller/system/StudentManageController.java

@@ -5,6 +5,7 @@ import com.ym.mec.web.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageCourseQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageQueryInfo;
 import com.ym.mec.web.service.StudentManageService;
+import com.ym.mec.web.service.SysUserCashAccountService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -23,6 +24,9 @@ public class StudentManageController extends BaseController {
     @Autowired
     private StudentManageService studentManageService;
 
+    @Autowired
+    private SysUserCashAccountService sysUserCashAccountService;
+
     @ApiOperation(value = "获取学生列表")
     @GetMapping("/queryStudentList")
     public Object queryStudentList(@RequestBody StudentManageQueryInfo queryInfo){
@@ -53,4 +57,16 @@ public class StudentManageController extends BaseController {
         return succeed(studentManageService.findStudentAttendances(queryInfo));
     }
 
+    @ApiOperation(value = "获取学生vip课")
+    @PostMapping("/findStudentVipGroups")
+    public Object findStudentVipGroups(Long userId){
+        return succeed(studentManageService.findStudentVipGroups(userId));
+    }
+
+    @ApiOperation(value = "获取用户默认账户基本信息")
+    @PostMapping("/getUserCashAccountBaseInfo/{userID}")
+    public Object getUserCashAccountBaseInfo(@PathVariable("userID") Long userID){
+        return succeed(studentManageService.getStudentAccountBaseInfo(userID));
+    }
+
 }

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherAttendanceController.java

@@ -25,14 +25,14 @@ public class TeacherAttendanceController extends BaseController {
     }
 
     @ApiOperation(value = "分页查询教师签到列表")
-    @PostMapping("/queryPage")
-    public Object queryPage(@RequestBody TeacherAttendanceQueryInfo queryInfo) {
+    @GetMapping("/queryPage")
+    public Object queryPage(TeacherAttendanceQueryInfo queryInfo) {
         return succeed(teacherAttendanceService.queryPage(queryInfo));
     }
 
     @ApiOperation(value = "查询教师签到记录")
     @GetMapping("/getTeacherPersonalAttendances")
-    public Object getTeacherPersonalAttendances(@RequestBody TeacherAttendanceQueryInfo queryInfo){
+    public Object getTeacherPersonalAttendances(TeacherAttendanceQueryInfo queryInfo){
         return teacherAttendanceService.getTeacherPersonalAttendances(queryInfo);
     }
 

+ 3 - 3
mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherCourseHomeworkReplyController.java

@@ -24,19 +24,19 @@ public class TeacherCourseHomeworkReplyController extends BaseController {
 
     @ApiOperation(value = "新增回复")
     @PostMapping("/add")
-    public Object add(@RequestBody StudentCourseHomeworkReply studentCourseHomeworkReply) {
+    public Object add(StudentCourseHomeworkReply studentCourseHomeworkReply) {
         studentCourseHomeworkReplyService.insert(studentCourseHomeworkReply);
         return succeed();
     }
 
     @ApiOperation(value = "回复查询")
     @GetMapping("/queryPage")
-    public Object queryPage(@RequestBody StudentCourseHomeworkReplyQueryInfo queryInfo){
+    public Object queryPage(StudentCourseHomeworkReplyQueryInfo queryInfo){
         return succeed(studentCourseHomeworkReplyService.queryPage(queryInfo));
     }
 
     @ApiOperation(value = "删除回复")
-    @DeleteMapping("/del/{id}")
+    @PostMapping("/del/{id}")
     public Object del(@ApiParam(value = "回复ID", required = true) @PathVariable("id") Long id){
         studentCourseHomeworkReplyService.delete(id);
         return succeed();

+ 34 - 0
mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherDefaultMusicGroupSalaryController.java

@@ -0,0 +1,34 @@
+package com.ym.mec.web.controller.teacher;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary;
+import com.ym.mec.web.service.TeacherDefaultMusicGroupSalaryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RequestMapping("teacherDefaultMusicGroupSalary")
+@Api(tags = "教师薪酬服务")
+@RestController
+public class TeacherDefaultMusicGroupSalaryController extends BaseController {
+
+    @Autowired
+    private TeacherDefaultMusicGroupSalaryService teacherDefaultMusicGroupSalaryService;
+
+    @ApiOperation(value = "批量新增、修改、删除教师乐团课薪酬")
+    @PostMapping("/batchUpset")
+    public Object batchUpset(@RequestBody List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalaries) {
+        teacherDefaultMusicGroupSalaryService.batchUpset(teacherDefaultMusicGroupSalaries);
+        return succeed();
+    }
+
+    @ApiOperation(value = "分页查询教师薪酬")
+    @GetMapping("/queryPage")
+    public Object queryPage(QueryInfo queryInfo) {
+        return succeed(teacherDefaultMusicGroupSalaryService.queryPage(queryInfo));
+    }
+}

+ 40 - 0
mec-web/src/main/java/com/ym/mec/web/controller/teacher/TeacherLeaveRecordController.java

@@ -0,0 +1,40 @@
+package com.ym.mec.web.controller.teacher;
+
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.entity.TeacherLeaveRecord;
+import com.ym.mec.web.service.TeacherLeaveRecordService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RequestMapping("teacherLeaveRecord")
+@Api(tags = "教师请假记录服务")
+@RestController
+public class TeacherLeaveRecordController extends BaseController {
+
+    @Autowired
+    private TeacherLeaveRecordService teacherLeaveRecordService;
+
+    @ApiOperation(value = "新增教师请假记录")
+    @PostMapping("/add")
+    public Object add(TeacherLeaveRecord teacherLeaveRecord){
+        teacherLeaveRecordService.insert(teacherLeaveRecord);
+        return succeed();
+    }
+
+    @ApiOperation(value = "根据教师请假记录编号查询教师请假记录")
+    @GetMapping("/get/{id}")
+    public Object get(@ApiParam(value = "教师请假记录编号", required = true) @PathVariable("id") Long id){
+        return succeed(teacherLeaveRecordService.get(id));
+    }
+
+    @ApiOperation(value = "分页查询教师请假记录列表")
+    @GetMapping("/queryPage")
+    public Object queryPage(QueryInfo queryInfo){
+        return succeed(teacherLeaveRecordService.queryPage(queryInfo));
+    }
+
+}

+ 3 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/ClassGroupDao.java

@@ -54,4 +54,7 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
      * @return
      */
     List<ClassGroup> findClassGroupByIds(@Param("ids") String ids);
+
+    void queryGroupCourses();
+
 }

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/HotWordsLabelDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.web.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.entity.HotWordsLabel;
+
+public interface HotWordsLabelDao extends BaseDAO<Integer, HotWordsLabel> {
+
+	
+}

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/OrganizationDao.java

@@ -15,4 +15,11 @@ public interface OrganizationDao extends BaseDAO<Integer, Organization> {
      * @return
      */
     List<Organization> findByParentId(@Param("parentId") Integer parentId, @Param("delFlag") String delFlag);
+
+    /**
+     * 根据分部id字符串查询
+     * @param organIds
+     * @return
+     */
+    List<String> findByOrganIds(String organIds);
 }

+ 8 - 4
mec-web/src/main/java/com/ym/mec/web/dal/dao/StudentManageDao.java

@@ -1,9 +1,6 @@
 package com.ym.mec.web.dal.dao;
 
-import com.ym.mec.web.dal.dto.StudentManageBaseDto;
-import com.ym.mec.web.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
-import com.ym.mec.web.dal.dto.StudentManageCourseListDto;
-import com.ym.mec.web.dal.dto.StudentManageListDto;
+import com.ym.mec.web.dal.dto.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -78,4 +75,11 @@ public interface StudentManageDao {
      */
     int countStudentAttendances(Map<String,Object> params);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/21
+     * 获取学上账户基本信息
+     */
+    StudentManageAccountBaseInfoDto getStudentAccountBaseInfo(Long userID);
+
 }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/SubjectDao.java

@@ -51,4 +51,11 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
      * @return
      */
     List<SubjectApplyDetailDto> findSubApplyDetail(Integer musicGroupId);
+
+    /**
+     * 根据声部id字符串查询
+     * @param subIds
+     * @return
+     */
+    List<String> findBySubIds(String subIds);
 }

+ 7 - 1
mec-web/src/main/java/com/ym/mec/web/dal/dao/TeacherDao.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.dal.dao;
 
+import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.web.dal.entity.Teacher;
 import org.apache.ibatis.annotations.Param;
@@ -12,5 +13,10 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
      * @return Teacher 老师信息
      */
     Teacher findByCertificateNum(@Param("certificateNum") String certificateNum);
-	
+
+    /**
+     * 修改用户信息
+     * @param user
+     */
+    void updateUser(SysUser user);
 }

+ 9 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dao/VipGroupCategoryDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.web.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.entity.VipGroupCategory;
+
+public interface VipGroupCategoryDao extends BaseDAO<Integer, VipGroupCategory> {
+
+	
+}

+ 10 - 1
mec-web/src/main/java/com/ym/mec/web/dal/dao/VipGroupDao.java

@@ -1,9 +1,18 @@
 package com.ym.mec.web.dal.dao;
 
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.web.dal.dto.StudentManageVipGroupDto;
 import com.ym.mec.web.dal.entity.VipGroup;
 
+import java.util.List;
+
 public interface VipGroupDao extends BaseDAO<Long, VipGroup> {
 
-	
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/20
+     * 获取对应学生vip课
+     */
+	List<StudentManageVipGroupDto> findStudentVipGroups(Long userID);
+
 }

+ 45 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentManageAccountBaseInfoDto.java

@@ -0,0 +1,45 @@
+package com.ym.mec.web.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/21
+ */
+public class StudentManageAccountBaseInfoDto {
+
+    @ApiModelProperty(value = "账户余额",required = false)
+    private BigDecimal balance;
+
+    @ApiModelProperty(value = "银行名称",required = false)
+    private String bankName;
+
+    @ApiModelProperty(value = "银行卡号",required = false)
+    private String cardNo;
+
+    public BigDecimal getBalance() {
+        return balance;
+    }
+
+    public void setBalance(BigDecimal balance) {
+        this.balance = balance;
+    }
+
+    public String getBankName() {
+        return bankName;
+    }
+
+    public void setBankName(String bankName) {
+        this.bankName = bankName;
+    }
+
+    public String getCardNo() {
+        return cardNo;
+    }
+
+    public void setCardNo(String cardNo) {
+        this.cardNo = cardNo;
+    }
+}

+ 22 - 0
mec-web/src/main/java/com/ym/mec/web/dal/dto/StudentManageVipGroupDto.java

@@ -0,0 +1,22 @@
+package com.ym.mec.web.dal.dto;
+
+import com.ym.mec.web.dal.entity.VipGroup;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/9/20
+ */
+public class StudentManageVipGroupDto extends VipGroup {
+
+    @ApiModelProperty(value = "课程类型",required = false)
+    private String vipGroupCategory;
+
+    public String getVipGroupCategory() {
+        return vipGroupCategory;
+    }
+
+    public void setVipGroupCategory(String vipGroupCategory) {
+        this.vipGroupCategory = vipGroupCategory;
+    }
+}

+ 16 - 8
mec-web/src/main/java/com/ym/mec/web/dal/entity/ClassGroupTeacherMapper.java

@@ -1,7 +1,10 @@
 package com.ym.mec.web.dal.entity;
 
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(class_group_teacher_mapper):
  */
@@ -11,19 +14,24 @@ public class ClassGroupTeacherMapper {
 	private Long id;
 	
 	/**  */
+	@ApiModelProperty(value = "乐团编号",required = false)
 	private Integer musicGroupId;
 	
 	/**  */
+	@ApiModelProperty(value = "班级编号",required = false)
 	private Integer classGroupId;
 	
 	/** 老师角色(主教、助教) */
+	@ApiModelProperty(value = "老师角色",required = false)
 	private String teacherRole;
 	
 	/**  */
+	@ApiModelProperty(value = "用户编号",required = false)
 	private Integer userId;
 	
 	/** 薪酬 */
-	private long salary;
+	@ApiModelProperty(value = "薪酬",required = false)
+	private BigDecimal salary;
 	
 	/**  */
 	private java.util.Date createTime;
@@ -70,15 +78,15 @@ public class ClassGroupTeacherMapper {
 	public Integer getUserId(){
 		return this.userId;
 	}
-			
-	public void setSalary(long salary){
-		this.salary = salary;
+
+	public BigDecimal getSalary() {
+		return salary;
 	}
-	
-	public long getSalary(){
-		return this.salary;
+
+	public void setSalary(BigDecimal salary) {
+		this.salary = salary;
 	}
-			
+
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}

+ 1 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/CourseSchedule.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.dal.entity;
 
 import com.ym.mec.web.dal.enums.CourseStatusEnum;
+import com.ym.mec.web.dal.enums.TeachModeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 

+ 70 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/HotWordsLabel.java

@@ -0,0 +1,70 @@
+package com.ym.mec.web.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(hot_words_label):
+ */
+public class HotWordsLabel {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private String name;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private String delFlag;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setDelFlag(String delFlag){
+		this.delFlag = delFlag;
+	}
+	
+	public String getDelFlag(){
+		return this.delFlag;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 14 - 2
mec-web/src/main/java/com/ym/mec/web/dal/entity/Teacher.java

@@ -40,12 +40,16 @@ public class Teacher extends SysUser {
 	@ApiModelProperty(value = "技术职称", required = false)
 	private String technicalTitles;
 
+	/** 所属分部名称 */
+	@ApiModelProperty(value = "所属分部名称", required = false)
+	private String organName;
+
 	/** 工作单位 */
 	@ApiModelProperty(value = "工作单位", required = false)
 	private String workUnit;
 
 	/** 专业技能(支持多个,用|分隔),对应科目表编号 */
-	@ApiModelProperty(value = "专业技能(支持多个,用|分隔),对应科目表编号", required = false)
+	@ApiModelProperty(value = "专业技能(支持多个,用逗号分隔),对应科目表编号", required = false)
 	private String subjectId;
 
 	/** 入职时间 */
@@ -61,7 +65,7 @@ public class Teacher extends SysUser {
 	private String certificateNum;
 
 	/** 流动范围(多个用|分开) */
-	@ApiModelProperty(value = "流动范围(多个用|分开)", required = false)
+	@ApiModelProperty(value = "流动范围(多个用逗号分开)", required = false)
 	private String flowOrganRange;
 
 	@ApiModelProperty(value = "老师介绍", required = false)
@@ -70,6 +74,14 @@ public class Teacher extends SysUser {
 	@ApiModelProperty(value = "离职时间", required = false)
 	private Date demissionDate;
 
+	public String getOrganName() {
+		return organName;
+	}
+
+	public void setOrganName(String organName) {
+		this.organName = organName;
+	}
+
 	public JobTypeEnum getJobType() {
 		return jobType;
 	}

+ 44 - 23
mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherDefaultMusicGroupSalary.java

@@ -1,7 +1,12 @@
 package com.ym.mec.web.dal.entity;
 
+import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.web.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.math.BigDecimal;
+
 /**
  * 对应数据库表(teacher_default_music_group_salary):
  */
@@ -11,26 +16,42 @@ public class TeacherDefaultMusicGroupSalary {
 	private Long id;
 	
 	/**  */
+	@ApiModelProperty(value = "教师编号",required = false)
 	private Integer userId;
 	
 	/** 班级类型(参照 class_group表的type_字段) */
-	private String classGroupType;
+	@ApiModelProperty(value = "班级类型",required = false)
+	private ClassGroupTypeEnum classGroupType;
 	
 	/**  */
+	@ApiModelProperty(value = "专业技能",required = false)
 	private Integer subjectId;
 	
 	/** 主教薪酬 */
-	private long mainTeacherSalary;
+	@ApiModelProperty(value = "主教薪酬",required = false)
+	private BigDecimal mainTeacherSalary;
 	
 	/** 助教薪酬 */
-	private long assistantTeacherSalary;
+	@ApiModelProperty(value = "助教薪酬",required = false)
+	private BigDecimal assistantTeacherSalary;
+
+	@ApiModelProperty(value = "是否删除该条数据",required = false)
+	private YesOrNoEnum delFlag;
 	
 	/**  */
 	private java.util.Date createTime;
 	
 	/**  */
 	private java.util.Date updateTime;
-	
+
+	public YesOrNoEnum getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(YesOrNoEnum delFlag) {
+		this.delFlag = delFlag;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}
@@ -46,15 +67,15 @@ public class TeacherDefaultMusicGroupSalary {
 	public Integer getUserId(){
 		return this.userId;
 	}
-			
-	public void setClassGroupType(String classGroupType){
-		this.classGroupType = classGroupType;
+
+	public ClassGroupTypeEnum getClassGroupType() {
+		return classGroupType;
 	}
-	
-	public String getClassGroupType(){
-		return this.classGroupType;
+
+	public void setClassGroupType(ClassGroupTypeEnum classGroupType) {
+		this.classGroupType = classGroupType;
 	}
-			
+
 	public void setSubjectId(Integer subjectId){
 		this.subjectId = subjectId;
 	}
@@ -62,23 +83,23 @@ public class TeacherDefaultMusicGroupSalary {
 	public Integer getSubjectId(){
 		return this.subjectId;
 	}
-			
-	public void setMainTeacherSalary(long mainTeacherSalary){
+
+	public BigDecimal getMainTeacherSalary() {
+		return mainTeacherSalary;
+	}
+
+	public void setMainTeacherSalary(BigDecimal mainTeacherSalary) {
 		this.mainTeacherSalary = mainTeacherSalary;
 	}
-	
-	public long getMainTeacherSalary(){
-		return this.mainTeacherSalary;
+
+	public BigDecimal getAssistantTeacherSalary() {
+		return assistantTeacherSalary;
 	}
-			
-	public void setAssistantTeacherSalary(long assistantTeacherSalary){
+
+	public void setAssistantTeacherSalary(BigDecimal assistantTeacherSalary) {
 		this.assistantTeacherSalary = assistantTeacherSalary;
 	}
-	
-	public long getAssistantTeacherSalary(){
-		return this.assistantTeacherSalary;
-	}
-			
+
 	public void setCreateTime(java.util.Date createTime){
 		this.createTime = createTime;
 	}

+ 10 - 9
mec-web/src/main/java/com/ym/mec/web/dal/entity/TeacherLeaveRecord.java

@@ -1,5 +1,6 @@
 package com.ym.mec.web.dal.entity;
 
+import com.ym.mec.web.dal.enums.AuditStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -24,8 +25,8 @@ public class TeacherLeaveRecord {
 	private String type;
 	
 	/** 请假状态(审批中、拒绝、通过) */
-	@ApiModelProperty(value = "请假状态",required = false)
-	private String status;
+	@ApiModelProperty(value = "请假审核状态",required = false)
+	private AuditStatusEnum status;
 	
 	/** 备注 */
 	@ApiModelProperty(value = "备注",required = false)
@@ -68,15 +69,15 @@ public class TeacherLeaveRecord {
 	public String getType(){
 		return this.type;
 	}
-			
-	public void setStatus(String status){
-		this.status = status;
+
+	public AuditStatusEnum getStatus() {
+		return status;
 	}
-	
-	public String getStatus(){
-		return this.status;
+
+	public void setStatus(AuditStatusEnum status) {
+		this.status = status;
 	}
-			
+
 	public void setRemark(String remark){
 		this.remark = remark;
 	}

+ 13 - 3
mec-web/src/main/java/com/ym/mec/web/dal/entity/VipGroup.java

@@ -1,11 +1,10 @@
 package com.ym.mec.web.dal.entity;
 
-import java.util.Date;
-
 import io.swagger.annotations.ApiModelProperty;
-
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
+import java.util.Date;
+
 /**
  * 对应数据库表(vip_group):
  */
@@ -14,6 +13,9 @@ public class VipGroup {
 	/**  */
 	private Long id;
 
+	@ApiModelProperty(value = "课程名称",required = false)
+	private String name;
+
 	/**  */
 	@ApiModelProperty(value = "用户编号", required = false)
 	private Integer userId;
@@ -51,6 +53,14 @@ public class VipGroup {
 	@ApiModelProperty(value = "线下课课时数", required = false)
 	private Integer offlineClassesNum;
 
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
 	public void setId(Long id) {
 		this.id = id;
 	}

+ 92 - 0
mec-web/src/main/java/com/ym/mec/web/dal/entity/VipGroupCategory.java

@@ -0,0 +1,92 @@
+package com.ym.mec.web.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(vip_group_category):
+ */
+public class VipGroupCategory {
+
+	/**  */
+	private Integer id;
+	
+	/** 名称 */
+	private String name;
+	
+	/** 线上薪水 */
+	private long onlineClassesSalary;
+	
+	/** 线下薪水 */
+	private long offlineClassesSalary;
+	
+	/**  */
+	private String delFlag;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setOnlineClassesSalary(long onlineClassesSalary){
+		this.onlineClassesSalary = onlineClassesSalary;
+	}
+	
+	public long getOnlineClassesSalary(){
+		return this.onlineClassesSalary;
+	}
+			
+	public void setOfflineClassesSalary(long offlineClassesSalary){
+		this.offlineClassesSalary = offlineClassesSalary;
+	}
+	
+	public long getOfflineClassesSalary(){
+		return this.offlineClassesSalary;
+	}
+			
+	public void setDelFlag(String delFlag){
+		this.delFlag = delFlag;
+	}
+	
+	public String getDelFlag(){
+		return this.delFlag;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 36 - 0
mec-web/src/main/java/com/ym/mec/web/dal/enums/AuditStatusEnum.java

@@ -0,0 +1,36 @@
+package com.ym.mec.web.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/**
+ * 审核状态枚举(审批中、拒绝、通过)
+ */
+public enum AuditStatusEnum implements BaseEnum<String, AuditStatusEnum> {
+	ING("ING", "审核中"), REJECT("REJECT", "拒绝"), PASS("PASS", "通过");
+
+	private String code;
+
+	private String msg;
+
+	AuditStatusEnum(String code, String msg) {
+		this.code = code;
+		this.msg = msg;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getMsg() {
+		return msg;
+	}
+
+	public void setMsg(String msg) {
+		this.msg = msg;
+	}
+
+	@Override
+	public String getCode() {
+		return this.code;
+	}
+}

+ 47 - 0
mec-web/src/main/java/com/ym/mec/web/dal/enums/UserLockFlag.java

@@ -0,0 +1,47 @@
+package com.ym.mec.web.dal.enums;
+
+import com.ym.mec.common.enums.BaseEnum;
+
+/** 
+ * @author sunzl 
+ * 2015年8月25日 下午4:19:00 
+ * 会员状态枚举类
+ */
+public enum UserLockFlag implements BaseEnum<Integer, UserLockFlag> {
+
+	NOACTIVATED(0, "正常"), CANCELLED(1, "冻结"), NORMAL(9, "锁定");
+
+	private int code;
+
+	private UserLockFlag(int code, String remark) {
+		this.code = code;
+		this.remark = remark;
+	}
+
+	private String remark;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public void setCode(int code) {
+		this.code = code;
+	}
+
+	public String getRemark() {
+		return remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public static UserLockFlag codeOf(int code) {
+		for (UserLockFlag userStatus : UserLockFlag.values()) {
+			if (code == userStatus.getCode()) {
+				return userStatus;
+			}
+		}
+		return null;
+	}
+}

+ 11 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/StudentManageCourseQueryInfo.java

@@ -14,6 +14,9 @@ public class StudentManageCourseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "学生id",required = true)
     private Long studentId;
 
+    @ApiModelProperty(value = "vip课程ID",required = false)
+    private Long vipGroupId;
+
     @ApiModelProperty(value = "乐团ID",required = true)
     private Long musicGroupId;
 
@@ -29,6 +32,14 @@ public class StudentManageCourseQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "老师名称",required = false)
     private String teacherName;
 
+    public Long getVipGroupId() {
+        return vipGroupId;
+    }
+
+    public void setVipGroupId(Long vipGroupId) {
+        this.vipGroupId = vipGroupId;
+    }
+
     public Long getStudentId() {
         return studentId;
     }

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherAttendanceQueryInfo.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.dal.page;
 
 import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.web.dal.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -18,6 +19,28 @@ public class TeacherAttendanceQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "签到状态")
     private YesOrNoEnum attendanceStatus;
 
+    @ApiModelProperty(value = "班级类型")
+    private ClassGroupTypeEnum classGroupType;
+
+    @ApiModelProperty(value = "班级名称")
+    private String classGroupName;
+
+    public ClassGroupTypeEnum getClassGroupType() {
+        return classGroupType;
+    }
+
+    public void setClassGroupType(ClassGroupTypeEnum classGroupType) {
+        this.classGroupType = classGroupType;
+    }
+
+    public String getClassGroupName() {
+        return classGroupName;
+    }
+
+    public void setClassGroupName(String classGroupName) {
+        this.classGroupName = classGroupName;
+    }
+
     public Long getTeacherId() {
         return teacherId;
     }

+ 19 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherCourseQueryInfo.java

@@ -0,0 +1,19 @@
+package com.ym.mec.web.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+public class TeacherCourseQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "课程类型")
+    private ClassGroupTypeEnum type;
+
+    public ClassGroupTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(ClassGroupTypeEnum type) {
+        this.type = type;
+    }
+}

+ 59 - 0
mec-web/src/main/java/com/ym/mec/web/dal/page/TeacherQueryInfo.java

@@ -1,6 +1,65 @@
 package com.ym.mec.web.dal.page;
 
+import com.ym.mec.auth.api.enums.UserLockFlag;
 import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.web.dal.enums.JobNatureEnum;
+import com.ym.mec.web.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
 
 public class TeacherQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "科目编号")
+    private Integer subjectId;
+
+    @ApiModelProperty(value = "机构编号")
+    private Integer organId;
+
+    @ApiModelProperty(value = "教师工作性质")
+    private JobNatureEnum jobNature;
+
+    @ApiModelProperty(value = "是否试用期")
+    private YesOrNoEnum isProbationPeriod;
+
+    @ApiModelProperty(value = "账号状态")
+    private UserLockFlag lockFlag;
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public JobNatureEnum getJobNature() {
+        return jobNature;
+    }
+
+    public void setJobNature(JobNatureEnum jobNature) {
+        this.jobNature = jobNature;
+    }
+
+    public YesOrNoEnum getIsProbationPeriod() {
+        return isProbationPeriod;
+    }
+
+    public void setIsProbationPeriod(YesOrNoEnum isProbationPeriod) {
+        this.isProbationPeriod = isProbationPeriod;
+    }
+
+    public UserLockFlag getLockFlag() {
+        return lockFlag;
+    }
+
+    public void setLockFlag(UserLockFlag lockFlag) {
+        this.lockFlag = lockFlag;
+    }
 }

+ 9 - 1
mec-web/src/main/java/com/ym/mec/web/service/ClassGroupService.java

@@ -1,10 +1,13 @@
 package com.ym.mec.web.service;
 
+import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.dto.HighClassGroup;
 import com.ym.mec.web.dal.entity.ClassGroup;
 import com.ym.mec.web.dal.entity.ClassGroupRelation;
+import com.ym.mec.web.dal.page.TeacherCourseQueryInfo;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Page;
 
 import java.util.List;
 
@@ -77,5 +80,10 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
      */
     List<HighClassGroup> addHighClassGroup(List<HighClassGroup> highClassGroupList) throws Exception;
 
-
+    /**
+     * 获取老师课程信息列表
+     * @param queryInfo
+     * @return
+     */
+    Object getTeaCourseInfos(QueryInfo queryInfo);
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/HotWordsLabelService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.web.service;
+
+import com.ym.mec.common.service.BaseService;
+import com.ym.mec.web.dal.entity.HotWordsLabel;
+
+public interface HotWordsLabelService extends BaseService<Integer, HotWordsLabel> {
+
+}

+ 16 - 0
mec-web/src/main/java/com/ym/mec/web/service/StudentManageService.java

@@ -1,8 +1,10 @@
 package com.ym.mec.web.service;
 
 import com.ym.mec.common.page.PageInfo;
+import com.ym.mec.web.dal.dto.StudentManageAccountBaseInfoDto;
 import com.ym.mec.web.dal.dto.StudentManageBaseDto;
 import com.ym.mec.web.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
+import com.ym.mec.web.dal.dto.StudentManageVipGroupDto;
 import com.ym.mec.web.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageCourseQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageQueryInfo;
@@ -50,4 +52,18 @@ public interface StudentManageService {
      */
     PageInfo findStudentAttendances(StudentManageAttendanceQueryInfo queryInfo);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/20
+     * 获取学生vip课
+     */
+    List<StudentManageVipGroupDto> findStudentVipGroups(Long userID);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/21
+     * 获取学上账户基本信息
+     */
+    StudentManageAccountBaseInfoDto getStudentAccountBaseInfo(Long userID);
+
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/TeacherDefaultMusicGroupSalaryService.java

@@ -4,6 +4,8 @@ import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary;
 import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
 
+import java.util.List;
+
 public interface TeacherDefaultMusicGroupSalaryService extends BaseService<Long, TeacherDefaultMusicGroupSalary> {
 
 
@@ -14,4 +16,10 @@ public interface TeacherDefaultMusicGroupSalaryService extends BaseService<Long,
      * @return
      */
     TeacherDefaultMusicGroupSalary getTeacherSalaryByUserIdAndType(int userId,ClassGroupTypeEnum classGroupType);
+
+    /**
+     * 批量新增修改教师薪酬设置
+     * @param teacherDefaultMusicGroupSalaries
+     */
+    void batchUpset(List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalaries);
 }

+ 22 - 0
mec-web/src/main/java/com/ym/mec/web/service/TeacherService.java

@@ -1,8 +1,10 @@
 package com.ym.mec.web.service;
 
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
 import com.ym.mec.web.dal.dto.TeacherUserDto;
 import com.ym.mec.web.dal.entity.Teacher;
+import com.ym.mec.web.dal.page.TeacherQueryInfo;
 
 public interface TeacherService extends BaseService<Integer, Teacher> {
 
@@ -18,4 +20,24 @@ public interface TeacherService extends BaseService<Integer, Teacher> {
      * @param teacher
      */
     void add(Teacher teacher) throws Exception;
+
+    /**
+     * 修改教师信息
+     * @param teacher
+     */
+    void updateTea(Teacher teacher);
+
+    /**
+     * 分页查询教师列表
+     * @param queryInfo
+     * @return
+     */
+    PageInfo<Teacher> queryPageDetail(TeacherQueryInfo queryInfo);
+
+    /**
+     * 获取教师详情
+     * @param id
+     * @return
+     */
+    Teacher getDetail(Integer id);
 }

+ 8 - 0
mec-web/src/main/java/com/ym/mec/web/service/VipGroupCategoryService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.web.service;
+
+import com.ym.mec.common.service.BaseService;
+import com.ym.mec.web.dal.entity.VipGroupCategory;
+
+public interface VipGroupCategoryService extends BaseService<Integer, VipGroupCategory> {
+
+}

+ 13 - 7
mec-web/src/main/java/com/ym/mec/web/service/impl/ClassGroupServiceImpl.java

@@ -1,5 +1,9 @@
 package com.ym.mec.web.service.impl;
 
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.page.QueryInfo;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.ClassGroupDao;
 import com.ym.mec.web.dal.dto.HighClassGroup;
 import com.ym.mec.web.dal.entity.*;
 import com.ym.mec.web.dal.enums.ClassGroupStudentStatusEnum;
@@ -7,16 +11,12 @@ import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.web.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-
-import com.ym.mec.common.dal.BaseDAO;
-import com.ym.mec.common.service.impl.BaseServiceImpl;
-import com.ym.mec.web.dal.dao.ClassGroupDao;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.time.DayOfWeek;
 import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 @Service
 public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup> implements ClassGroupService {
@@ -178,4 +178,10 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         return highClassGroupList;
     }
 
+    @Override
+    public Object getTeaCourseInfos(QueryInfo queryInfo) {
+        classGroupDao.queryGroupCourses();
+        return null;
+    }
+
 }

+ 19 - 9
mec-web/src/main/java/com/ym/mec/web/service/impl/EmployeeServiceImpl.java

@@ -1,5 +1,24 @@
 package com.ym.mec.web.service.impl;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.stereotype.Service;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.page.PageInfo;
@@ -13,15 +32,6 @@ import com.ym.mec.web.dal.enums.EmployeeOperateEnum;
 import com.ym.mec.web.dal.enums.ParamEnum;
 import com.ym.mec.web.dal.page.EmployeeQueryInfo;
 import com.ym.mec.web.service.EmployeeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.*;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.stereotype.Service;
-import org.springframework.util.MultiValueMap;
-import org.springframework.web.client.RestTemplate;
-
-import java.io.IOException;
-import java.util.*;
 
 @Service
 public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee>  implements EmployeeService {

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/HotWordsLabelServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.web.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.HotWordsLabelDao;
+import com.ym.mec.web.dal.entity.HotWordsLabel;
+import com.ym.mec.web.service.HotWordsLabelService;
+
+@Service
+public class HotWordsLabelServiceImpl extends BaseServiceImpl<Integer, HotWordsLabel>  implements HotWordsLabelService {
+	
+	@Autowired
+	private HotWordsLabelDao hotWordsLabelDao;
+
+	@Override
+	public BaseDAO<Integer, HotWordsLabel> getDAO() {
+		return hotWordsLabelDao;
+	}
+	
+}

+ 14 - 3
mec-web/src/main/java/com/ym/mec/web/service/impl/StudentManageServiceImpl.java

@@ -5,9 +5,8 @@ import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.web.dal.dao.StudentManageDao;
-import com.ym.mec.web.dal.dto.StudentManageBaseDto;
-import com.ym.mec.web.dal.dto.StudentManageBaseInfoOfMusicGroupDto;
-import com.ym.mec.web.dal.dto.StudentManageListDto;
+import com.ym.mec.web.dal.dao.VipGroupDao;
+import com.ym.mec.web.dal.dto.*;
 import com.ym.mec.web.dal.page.StudentManageAttendanceQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageCourseQueryInfo;
 import com.ym.mec.web.dal.page.StudentManageQueryInfo;
@@ -31,6 +30,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     private StudentManageDao studentManageDao;
     @Autowired
     private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private VipGroupDao vipGroupDao;
 
     @Override
     public PageInfo findStudentsByOrganId(StudentManageQueryInfo queryInfo) {
@@ -108,4 +109,14 @@ public class StudentManageServiceImpl implements StudentManageService {
         pageInfo.setRows(dataList);
         return pageInfo;
     }
+
+    @Override
+    public List<StudentManageVipGroupDto> findStudentVipGroups(Long userID) {
+        return vipGroupDao.findStudentVipGroups(userID);
+    }
+
+    @Override
+    public StudentManageAccountBaseInfoDto getStudentAccountBaseInfo(Long userID) {
+        return studentManageDao.getStudentAccountBaseInfo(userID);
+    }
 }

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherDefaultMusicGroupSalaryServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ym.mec.web.service.impl;
 
 import com.ym.mec.web.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.web.dal.enums.YesOrNoEnum;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -10,6 +11,9 @@ import com.ym.mec.web.dal.dao.TeacherDefaultMusicGroupSalaryDao;
 import com.ym.mec.web.dal.entity.TeacherDefaultMusicGroupSalary;
 import com.ym.mec.web.service.TeacherDefaultMusicGroupSalaryService;
 
+import java.util.Date;
+import java.util.List;
+
 @Service
 public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<Long, TeacherDefaultMusicGroupSalary>  implements TeacherDefaultMusicGroupSalaryService {
 	
@@ -25,4 +29,23 @@ public class TeacherDefaultMusicGroupSalaryServiceImpl extends BaseServiceImpl<L
     public TeacherDefaultMusicGroupSalary getTeacherSalaryByUserIdAndType(int userId,ClassGroupTypeEnum classGroupType) {
         return teacherDefaultMusicGroupSalaryDao.getTeacherSalaryByUserIdAndType(userId, classGroupType);
     }
+
+	@Override
+	public void batchUpset(List<TeacherDefaultMusicGroupSalary> teacherDefaultMusicGroupSalaries) {
+		if(teacherDefaultMusicGroupSalaries != null && teacherDefaultMusicGroupSalaries.size() > 0){
+			Date date = new Date();
+			teacherDefaultMusicGroupSalaries.forEach(e->{
+				if(e.getId() == null){
+					teacherDefaultMusicGroupSalaryDao.insert(e);
+				}else{
+					if(e.getDelFlag() == YesOrNoEnum.YES){
+						teacherDefaultMusicGroupSalaryDao.delete(e.getId());
+					}else {
+						e.setUpdateTime(date);
+						teacherDefaultMusicGroupSalaryDao.update(e);
+					}
+				}
+			});
+		}
+	}
 }

+ 50 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/TeacherServiceImpl.java

@@ -1,22 +1,35 @@
 package com.ym.mec.web.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.OrganizationDao;
+import com.ym.mec.web.dal.dao.SubjectDao;
 import com.ym.mec.web.dal.dao.TeacherDao;
 import com.ym.mec.web.dal.entity.Teacher;
+import com.ym.mec.web.dal.page.TeacherQueryInfo;
 import com.ym.mec.web.service.TeacherService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
+import java.util.List;
+
 @Service
 public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  implements TeacherService {
 	
 	@Autowired
 	private TeacherDao teacherDao;
 	@Autowired
+	private SubjectDao subjectDao;
+	@Autowired
+	private OrganizationDao organizationDao;
+	@Autowired
 	private SysUserFeignService sysUserFeignService;
 
 	@Override
@@ -44,4 +57,41 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher>  imple
 		teacherDao.insert(teacher);
 	}
 
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void updateTea(Teacher teacher) {
+		teacher.setUpdateTime(new Date());
+		teacherDao.update(teacher);
+		teacherDao.updateUser(teacher);
+	}
+
+	@Override
+	public PageInfo<Teacher> queryPageDetail(TeacherQueryInfo queryInfo) {
+		PageInfo<Teacher> pageInfo = queryPage(queryInfo);
+		List<Teacher> teachers = pageInfo.getRows();
+		if(teachers != null && teachers.size() > 0){
+			teachers.forEach(e->{
+				if(StringUtils.isNotEmpty(e.getSubjectId())){
+					e.setSubjectId(JSON.toJSONString(subjectDao.findBySubIds(e.getSubjectId())));
+				}
+			});
+		}
+		return pageInfo;
+	}
+
+	@Override
+	public Teacher getDetail(Integer id) {
+		Teacher teacher = teacherDao.get(id);
+		if(teacher != null){
+			if(StringUtils.isNotEmpty(teacher.getFlowOrganRange())){
+				List<String> organNames = organizationDao.findByOrganIds(teacher.getFlowOrganRange());
+				teacher.setFlowOrganRange(JSON.toJSONString(organNames));
+			}
+			if(StringUtils.isNotEmpty(teacher.getSubjectId())){
+				teacher.setSubjectId(JSON.toJSONString(subjectDao.findBySubIds(teacher.getSubjectId())));
+			}
+		}
+		return teacher;
+	}
+
 }

+ 23 - 0
mec-web/src/main/java/com/ym/mec/web/service/impl/VipGroupCategoryServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.web.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.web.dal.dao.VipGroupCategoryDao;
+import com.ym.mec.web.dal.entity.VipGroupCategory;
+import com.ym.mec.web.service.VipGroupCategoryService;
+
+@Service
+public class VipGroupCategoryServiceImpl extends BaseServiceImpl<Integer, VipGroupCategory>  implements VipGroupCategoryService {
+	
+	@Autowired
+	private VipGroupCategoryDao vipGroupCategoryDao;
+
+	@Override
+	public BaseDAO<Integer, VipGroupCategory> getDAO() {
+		return vipGroupCategoryDao;
+	}
+	
+}

+ 3 - 0
mec-web/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -175,4 +175,7 @@
     <select id="findClassGroupByIds" resultMap="ClassGroup">
         SELECT * FROM class_group WHERE FIND_IN_SET(id_,#{ids})
     </select>
+    <select id="queryGroupCourses">
+
+    </select>
 </mapper>

+ 72 - 0
mec-web/src/main/resources/config/mybatis/HotWordsLabelMapper.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.web.dal.dao.HotWordsLabelDao">
+	
+	<resultMap type="com.ym.mec.web.dal.entity.HotWordsLabel" id="HotWordsLabel">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="del_flag_" property="delFlag" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="HotWordsLabel" >
+		SELECT * FROM hot_words_label WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="HotWordsLabel">
+		SELECT * FROM hot_words_label ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.web.dal.entity.HotWordsLabel" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO hot_words_label (id_,name_,create_time_,update_time_,del_flag_) VALUES(#{id},#{name},#{createTime},#{updateTime},#{delFlag})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.web.dal.entity.HotWordsLabel">
+		UPDATE hot_words_label <set>
+<if test="delFlag != null">
+del_flag_ = #{delFlag},
+</if>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="updateTime != null">
+update_time_ = #{updateTime},
+</if>
+<if test="name != null">
+name_ = #{name},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM hot_words_label WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="HotWordsLabel" parameterType="map">
+		SELECT * FROM hot_words_label ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM hot_words_label
+	</select>
+</mapper>

+ 3 - 0
mec-web/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -97,4 +97,7 @@
     <select id="findByParentId" resultMap="Organization">
         SELECT * FROM organization <include refid="queryPageSql"/>
     </select>
+    <select id="findByOrganIds" resultType="java.lang.String">
+        SELECT name_ FROM organization IN (#{organIds}) WHERE del_flag_ = 0
+    </select>
 </mapper>

+ 28 - 0
mec-web/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -41,6 +41,12 @@
         <result property="attendanceStatus" column="status_" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
+    <resultMap id="studentManageAccountBaseInfo" type="com.ym.mec.web.dal.dto.StudentManageAccountBaseInfoDto">
+        <result property="balance" column="balance_"/>
+        <result property="bankName" column="bank_name_"/>
+        <result property="cardNo" column="card_no_"/>
+    </resultMap>
+
     <sql id="queryCondition">
         <where>
             cgsm.user_id_ IS NOT NULL
@@ -171,6 +177,9 @@
             <if test="teacherName!=null">
                 and su.username_ like CONCAT("%",#{teacherName},"%")
             </if>
+            <if test="vipGroupId!=null">
+                and vgcgm.vip_group_id_=#{vipGroupId}
+            </if>
         </where>
     </sql>
 
@@ -185,6 +194,9 @@
         FROM
             class_group cg
             LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
+            <if test="vipGroupId!=null">
+                LEFT JOIN vip_group_class_group_mapper vgcgm ON cgsm.class_group_id_=vgcgm.class_group_id_
+            </if>
             LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
             LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
         <include refid="studentManageCourseQueryCondition"/>
@@ -198,6 +210,9 @@
         FROM
         class_group cg
         LEFT JOIN class_group_student_mapper cgsm ON cg.id_=cgsm.class_group_id_
+        <if test="vipGroupId!=null">
+            LEFT JOIN vip_group_class_group_mapper vgcgm ON cgsm.class_group_id_=vgcgm.class_group_id_
+        </if>
         LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
         LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
         <include refid="studentManageCourseQueryCondition"/>
@@ -252,4 +267,17 @@
         <include refid="studentManageAttendanceQueryCondition"/>
     </select>
 
+    <select id="getStudentAccountBaseInfo" resultMap="studentManageAccountBaseInfo">
+        SELECT
+            suca.balance_,
+            subc.bank_name_,
+            subc.card_no_
+        FROM
+            sys_user_cash_account suca
+            LEFT JOIN sys_user_bank_card subc ON suca.user_id_ = subc.user_id_
+            AND subc.is_default_ = 1
+        WHERE
+            suca.user_id_ =#{userID}
+    </select>
+
 </mapper>

+ 3 - 0
mec-web/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -120,6 +120,9 @@
         LEFT JOIN `subject` s ON mgsp.subject_id_ = s.id_
         WHERE mgsp.music_group_id_ =
     </select>
+    <select id="findBySubIds" resultType="java.lang.String">
+        SELECT name_ FROM `subject` IN (#{subIds}) WHERE del_flag_ = 0
+    </select>
 
     <sql id="querySubPageSql">
         <where>

+ 9 - 3
mec-web/src/main/resources/config/mybatis/TeacherAttendanceMapper.xml

@@ -101,13 +101,19 @@
                 and ta.teacher_id_ = #{teacherId}
             </if>
             <if test="musicGroupId != null">
-                and ta.music_group_id_ #{musicGroupId}
+                and ta.music_group_id_ = #{musicGroupId}
             </if>
             <if test="classGroupId != null">
-                and ta.class_group_id_ like #{classGroupId}
+                and ta.class_group_id_ = #{classGroupId}
             </if>
             <if test="attendanceStatus != null">
-                and ta.status_ like #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+                and ta.status_ = #{attendanceStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="classGroupType != null">
+                and cg.type_ = #{classGroupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="classGroupName != null">
+                and cg.name_ like CONCAT('%',#{classGroupName},'%')
             </if>
         </where>
     </sql>

+ 1 - 7
mec-web/src/main/resources/config/mybatis/TeacherDefaultMusicGroupSalaryMapper.xml

@@ -34,7 +34,7 @@
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO teacher_default_music_group_salary
 		(id_,user_id_,class_group_type_,subject_id_,main_teacher_salary_,assistant_teacher_salary_,create_time_,update_time_)
-		VALUES(#{id},#{userId},#{classGroupType},#{subjectId},#{mainTeacherSalary},#{assistantTeacherSalary},#{createTime},#{updateTime})
+		VALUES(#{id},#{userId},#{classGroupType},#{subjectId},#{mainTeacherSalary},#{assistantTeacherSalary},now(),now())
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -48,9 +48,6 @@
 			<if test="userId != null">
 				user_id_ = #{userId},
 			</if>
-			<if test="id != null">
-				id_ = #{id},
-			</if>
 			<if test="updateTime != null">
 				update_time_ = #{updateTime},
 			</if>
@@ -63,9 +60,6 @@
 			<if test="assistantTeacherSalary != null">
 				assistant_teacher_salary_ = #{assistantTeacherSalary},
 			</if>
-			<if test="createTime != null">
-				create_time_ = #{createTime},
-			</if>
 		</set>
 		WHERE id_ = #{id}
 	</update>

+ 67 - 68
mec-web/src/main/resources/config/mybatis/TeacherLeaveRecordMapper.xml

@@ -5,80 +5,79 @@
 不要修改此文件。所有改动将在下次重新自动生成时丢失。
 -->
 <mapper namespace="com.ym.mec.web.dal.dao.TeacherLeaveRecordDao">
-	
-	<resultMap type="com.ym.mec.web.dal.entity.TeacherLeaveRecord" id="TeacherLeaveRecord">
-		<result column="id_" property="id" />
-		<result column="user_id_" property="userId" />
-		<result column="days_" property="days" />
-		<result column="type_" property="type" />
-		<result column="status_" property="status" />
-		<result column="remark_" property="remark" />
-		<result column="create_time_" property="createTime" />
-		<result column="update_time_" property="updateTime" />
-	</resultMap>
-	
-	<!-- 根据主键查询一条记录 -->
-	<select id="get" resultMap="TeacherLeaveRecord" >
+
+    <resultMap type="com.ym.mec.web.dal.entity.TeacherLeaveRecord" id="TeacherLeaveRecord">
+        <result column="id_" property="id"/>
+        <result column="user_id_" property="userId"/>
+        <result column="days_" property="days"/>
+        <result column="type_" property="type"/>
+        <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="remark_" property="remark"/>
+        <result column="create_time_" property="createTime"/>
+        <result column="update_time_" property="updateTime"/>
+    </resultMap>
+
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="TeacherLeaveRecord">
 		SELECT * FROM teacher_leave_record WHERE id_ = #{id} 
 	</select>
-	
-	<!-- 全查询 -->
-	<select id="findAll" resultMap="TeacherLeaveRecord">
+
+    <!-- 全查询 -->
+    <select id="findAll" resultMap="TeacherLeaveRecord">
 		SELECT * FROM teacher_leave_record ORDER BY id_
 	</select>
-	
-	<!-- 向数据库增加一条记录 -->
-	<insert id="insert" parameterType="com.ym.mec.web.dal.entity.TeacherLeaveRecord" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		<!--
-		<selectKey resultClass="int" keyProperty="id" > 
-		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
-		</selectKey>
-		-->
-		INSERT INTO teacher_leave_record (id_,user_id_,days_,type_,status_,remark_,create_time_,update_time_) VALUES(#{id},#{userId},#{days},#{type},#{status},#{remark},#{createTime},#{updateTime})
-	</insert>
-	
-	<!-- 根据主键查询一条记录 -->
-	<update id="update" parameterType="com.ym.mec.web.dal.entity.TeacherLeaveRecord">
-		UPDATE teacher_leave_record <set>
-<if test="status != null">
-status_ = #{status},
-</if>
-<if test="userId != null">
-user_id_ = #{userId},
-</if>
-<if test="remark != null">
-remark_ = #{remark},
-</if>
-<if test="id != null">
-id_ = #{id},
-</if>
-<if test="days != null">
-days_ = #{days},
-</if>
-<if test="updateTime != null">
-update_time_ = #{updateTime},
-</if>
-<if test="type != null">
-type_ = #{type},
-</if>
-<if test="createTime != null">
-create_time_ = #{createTime},
-</if>
-</set> WHERE id_ = #{id} 
-	</update>
-	
-	<!-- 根据主键删除一条记录 -->
-	<delete id="delete" >
+
+    <!-- 向数据库增加一条记录 -->
+    <insert id="insert" parameterType="com.ym.mec.web.dal.entity.TeacherLeaveRecord" useGeneratedKeys="true"
+            keyColumn="id" keyProperty="id">
+        <!--
+        <selectKey resultClass="int" keyProperty="id" >
+        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
+        </selectKey>
+        -->
+        INSERT INTO teacher_leave_record (id_,user_id_,days_,type_,status_,remark_,create_time_,update_time_)
+        VALUES(#{id},#{userId},#{days},#{type},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{remark},now(),now())
+    </insert>
+
+    <!-- 根据主键查询一条记录 -->
+    <update id="update" parameterType="com.ym.mec.web.dal.entity.TeacherLeaveRecord">
+        UPDATE teacher_leave_record
+        <set>
+            <if test="status != null">
+                status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="userId != null">
+                user_id_ = #{userId},
+            </if>
+            <if test="remark != null">
+                remark_ = #{remark},
+            </if>
+            <if test="days != null">
+                days_ = #{days},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+            <if test="type != null">
+                type_ = #{type},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
+
+    <!-- 根据主键删除一条记录 -->
+    <delete id="delete">
 		DELETE FROM teacher_leave_record WHERE id_ = #{id} 
 	</delete>
-	
-	<!-- 分页查询 -->
-	<select id="queryPage" resultMap="TeacherLeaveRecord" parameterType="map">
-		SELECT * FROM teacher_leave_record ORDER BY id_ <include refid="global.limit"/>
-	</select>
-	
-	<!-- 查询当前表的总记录数 -->
-	<select id="queryCount" resultType="int">
+
+    <!-- 分页查询 -->
+    <select id="queryPage" resultMap="TeacherLeaveRecord" parameterType="map">
+        SELECT * FROM teacher_leave_record ORDER BY id_
+        <include refid="global.limit"/>
+    </select>
+
+    <!-- 查询当前表的总记录数 -->
+    <select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM teacher_leave_record
 	</select>
 </mapper>

+ 114 - 11
mec-web/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -9,6 +9,7 @@
     <resultMap type="com.ym.mec.web.dal.entity.Teacher" id="Teacher">
         <result column="id_" property="id"/>
         <result column="organ_id_" property="organId"/>
+        <result column="organ_name_" property="organName"/>
         <result column="job_type_" property="jobType"/>
         <result column="job_nature_" property="jobNature"/>
         <result column="is_probation_period_" property="isProbationPeriod" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
@@ -25,11 +26,33 @@
         <result column="introduction_" property="introduction"/>
         <result column="update_time_" property="updateTime"/>
         <result column="create_time_" property="createTime"/>
+
+        <result column="username_" property="username"/>
+        <result column="password_" property="password"/>
+        <result column="salt_" property="salt"/>
+        <result column="phone_" property="phone"/>
+        <result column="avatar_" property="avatar"/>
+        <result column="lock_flag_" property="lockFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="del_flag_" property="delFlag" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="wx_openid_" property="wxOpenid"/>
+        <result column="qq_openid_" property="qqOpenid"/>
+        <result column="user_type_" property="userType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="gender_" property="gender" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="nation_" property="nation"/>
+        <result column="birthdate_" property="birthdate"/>
+        <result column="email_" property="email"/>
+        <result column="im_token_" property="imToken"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="Teacher">
-		SELECT * FROM teacher WHERE user_id_ = #{userId} 
+		SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
+        su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
+        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_
+        FROM teacher t
+        LEFT JOIN sys_user su ON t.id_ = su.id_
+        LEFT JOIN organization o ON t.organ_id_ = o.id_
+        WHERE t.user_id_ = #{userId} AND o.del_flag_ = 0
 	</select>
 
     <!-- 全查询 -->
@@ -40,11 +63,6 @@
     <!-- 向数据库增加一条记录 -->
     <insert id="insert" parameterType="com.ym.mec.web.dal.entity.Teacher" useGeneratedKeys="true" keyColumn="id"
             keyProperty="id">
-        <!--
-        <selectKey resultClass="int" keyProperty="id" >
-        SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
-        </selectKey>
-        -->
         INSERT INTO teacher
         (id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_)
         VALUES(#{id},#{organId},#{jobType},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now())
@@ -107,19 +125,104 @@
     </update>
 
     <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-		DELETE FROM teacher WHERE user_id_ = #{userId} 
-	</delete>
+    <update id="delete">
+		DELETE FROM teacher WHERE user_id_ = #{userId}
+	</update>
+
+    <update id="updateUser" parameterType="com.ym.mec.auth.api.entity.SysUser">
+        UPDATE sys_user
+        <set>
+            <if test="delFlag != null">
+                del_flag_ = #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="wxOpenid != null">
+                wx_openid_ = #{wxOpenid},
+            </if>
+            <if test="avatar != null">
+                avatar_ = #{avatar},
+            </if>
+            <if test="email != null">
+                email_ = #{email},
+            </if>
+            <if test="gender != null">
+                gender_ = #{gender, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="salt != null">
+                salt_ = #{salt},
+            </if>
+            <if test="username != null">
+                username_ = #{username},
+            </if>
+            <if test="userType != null">
+                user_type_ = #{userType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+            <if test="lockFlag != null">
+                lock_flag_ = #{lockFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+            </if>
+            <if test="birthdate != null">
+                birthdate_ = #{birthdate},
+            </if>
+            <if test="phone != null">
+                phone_ = #{phone},
+            </if>
+            <if test="qqOpenid != null">
+                qq_openid_ = #{qqOpenid},
+            </if>
+            <if test="nation != null">
+                nation_ = #{nation},
+            </if>
+            <if test="organId != null">
+                organ_id_ = #{organId},
+            </if>
+            <if test="imToken != null">
+                im_token_ = #{imToken},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
 
     <!-- 分页查询 -->
     <select id="queryPage" resultMap="Teacher" parameterType="map">
-        SELECT * FROM teacher ORDER BY user_id_
+        SELECT t.*,su.username_,su.password_,su.salt_,su.phone_,su.avatar_,
+        su.lock_flag_,su.del_flag_,su.wx_openid_,su.qq_openid_,su.user_type_,
+        su.gender_,su.nation_,su.birthdate_,su.email_,su.im_token_,t.subject_id_,t.organ_id_,o.name_ organ_name_
+        FROM teacher t
+        LEFT JOIN sys_user su ON t.id_ = su.id_
+        LEFT JOIN organization o ON t.organ_id_ = o.id_
+        <include refid="queryPageMap"/>
         <include refid="global.limit"/>
     </select>
 
+    <sql id="queryPageMap">
+        <where>
+            <if test="lockFlag != null">
+                AND su.lock_flag_ = #{lockFlag}
+            </if>
+            <if test="subjectId != null">
+                AND t.subject_id_ LIKE CONCAT('%',#{subjectId},'%')
+            </if>
+            <if test="organId != null">
+                AND o.organ_id_ = #{organId}
+            </if>
+            <if test="jobNature != null">
+                AND t.job_nature_ = #{jobNature}
+            </if>
+            <if test="isProbationPeriod != null">
+                AND t.is_probation_period_ = #{isProbationPeriod}
+            </if>
+        </where>
+    </sql>
+
     <!-- 查询当前表的总记录数 -->
     <select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM teacher
+        SELECT COUNT(t.id_) FROM teacher t
+        LEFT JOIN sys_user su ON t.id_ = su.id_
+        LEFT JOIN `subject` s ON t.subject_id_ = s.id_
+        LEFT JOIN organization o ON t.organ_id_ = o.id_
+        <include refid="queryPageMap"/>
 	</select>
 
     <!-- 根据证件号查询老师 -->

+ 80 - 0
mec-web/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.web.dal.dao.VipGroupCategoryDao">
+	
+	<resultMap type="com.ym.mec.web.dal.entity.VipGroupCategory" id="VipGroupCategory">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="online_classes_salary_" property="onlineClassesSalary" />
+		<result column="offline_classes_salary_" property="offlineClassesSalary" />
+		<result column="del_flag_" property="delFlag" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="VipGroupCategory" >
+		SELECT * FROM vip_group_category WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="VipGroupCategory">
+		SELECT * FROM vip_group_category ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.web.dal.entity.VipGroupCategory" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!--
+		<selectKey resultClass="int" keyProperty="id" > 
+		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
+		</selectKey>
+		-->
+		INSERT INTO vip_group_category (id_,name_,online_classes_salary_,offline_classes_salary_,del_flag_,create_time_,update_time_) VALUES(#{id},#{name},#{onlineClassesSalary},#{offlineClassesSalary},#{delFlag},#{createTime},#{updateTime})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.web.dal.entity.VipGroupCategory">
+		UPDATE vip_group_category <set>
+<if test="delFlag != null">
+del_flag_ = #{delFlag},
+</if>
+<if test="id != null">
+id_ = #{id},
+</if>
+<if test="onlineClassesSalary != null">
+online_classes_salary_ = #{onlineClassesSalary},
+</if>
+<if test="updateTime != null">
+update_time_ = #{updateTime},
+</if>
+<if test="offlineClassesSalary != null">
+offline_classes_salary_ = #{offlineClassesSalary},
+</if>
+<if test="name != null">
+name_ = #{name},
+</if>
+<if test="createTime != null">
+create_time_ = #{createTime},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM vip_group_category WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="VipGroupCategory" parameterType="map">
+		SELECT * FROM vip_group_category ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM vip_group_category
+	</select>
+</mapper>

+ 16 - 0
mec-web/src/main/resources/config/mybatis/VipGroupMapper.xml

@@ -20,11 +20,27 @@
         <result column="offline_classes_num_" property="offlineClassesNum"/>
     </resultMap>
 
+    <resultMap id="studentManageVipGroup" type="com.ym.mec.web.dal.dto.StudentManageVipGroupDto" extends="VipGroup">
+        <result property="vipGroupCategory" column="vip_group_category_"/>
+    </resultMap>
+
     <!-- 根据主键查询一条记录 -->
     <select id="get" resultMap="VipGroup">
 		SELECT * FROM vip_group WHERE id_ = #{id} 
 	</select>
 
+    <select id="findStudentVipGroups" resultMap="studentManageVipGroup">
+        SELECT
+            vg.*,
+            vgc.name_ vip_group_category_
+        FROM
+            class_group_student_mapper cgsm
+            LEFT JOIN vip_group_class_group_mapper vgcgm ON cgsm.class_group_id_=vgcgm.class_group_id_
+            LEFT JOIN vip_group vg ON vgcgm.vip_group_id_=vg.id_
+            LEFT JOIN vip_group_category vgc ON vg.vip_group_category_id_=vgc.id_
+        WHERE cgsm.class_group_id_=vgcgm.class_group_id_ AND cgsm.user_id_=#{userID}
+    </select>
+
     <!-- 全查询 -->
     <select id="findAll" resultMap="VipGroup">
 		SELECT * FROM vip_group ORDER BY id_

+ 12 - 5
pom.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>com.ym</groupId>
@@ -72,6 +73,12 @@
 
 			<dependency>
 				<groupId>com.ym</groupId>
+				<artifactId>mec-thirdparty</artifactId>
+				<version>1.0</version>
+			</dependency>
+
+			<dependency>
+				<groupId>com.ym</groupId>
 				<artifactId>snakerflowy</artifactId>
 				<version>1.0</version>
 			</dependency>
@@ -317,8 +324,8 @@
 		<module>cms</module>
 		<module>mec-im</module>
 		<module>workflowy</module>
-	  <module>mec-workflow</module>
-    <module>mec-thirdpart</module>
-    <module>mec-client-api</module>
-  </modules>
+		<module>mec-workflow</module>
+		<module>mec-thirdparty</module>
+		<module>mec-client-api</module>
+	</modules>
 </project>