Selaa lähdekoodia

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

chengpeng 5 vuotta sitten
vanhempi
commit
8ed5f51577
88 muutettua tiedostoa jossa 950 lisäystä ja 491 poistoa
  1. 2 0
      cms/src/main/resources/application.yml
  2. 13 7
      mec-auth/mec-auth-server/pom.xml
  3. 1 1
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/WebSecurityConfig.java
  4. 2 2
      mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java
  5. 12 9
      mec-auth/mec-auth-server/src/main/resources/application.yml
  6. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java
  7. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleComplaintsDao.java
  8. 17 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java
  9. 1 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupSubjectGoodsGroupDao.java
  10. 1 19
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRegistrationDao.java
  11. 16 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDefaultClassesCycleDao.java
  12. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleDto.java
  13. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfoDto.java
  14. 4 3
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleComplaints.java
  15. 12 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentAttendance.java
  16. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/GoodsType.java
  17. 11 2
      mec-biz/src/main/java/com/ym/mec/biz/service/ClassGroupService.java
  18. 0 1
      mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java
  19. 0 8
      mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java
  20. 6 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  21. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  22. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectGoodsGroupServiceImpl.java
  23. 4 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java
  24. 5 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  25. 10 22
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  26. 16 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupDefaultClassesCycleServiceImpl.java
  27. 5 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  28. 7 0
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  29. 3 0
      mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml
  30. 31 1
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  31. 3 5
      mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml
  32. 8 4
      mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml
  33. 11 13
      mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml
  34. 1 0
      mec-biz/src/main/resources/config/mybatis/VipGroupCategoryMapper.xml
  35. 33 1
      mec-biz/src/main/resources/config/mybatis/VipGroupDefaultClassesCycleMapper.xml
  36. 13 1
      mec-common/common-core/pom.xml
  37. 54 0
      mec-common/common-core/src/main/java/com/ym/mec/common/redis/config/RedisConfig.java
  38. 0 68
      mec-common/common-core/src/main/java/com/ym/mec/common/redis/config/RedisTemplateConfig.java
  39. 4 0
      mec-common/common-core/src/main/java/com/ym/mec/common/redis/service/RedisCache.java
  40. 8 12
      mec-common/common-core/src/main/java/com/ym/mec/common/validcode/impl/SmsCodeServiceImpl.java
  41. 2 12
      mec-education/src/main/java/com/ym/mec/education/EducationApplication.java
  42. 9 0
      mec-education/src/main/java/com/ym/mec/education/controller/StudentController.java
  43. 41 27
      mec-education/src/main/java/com/ym/mec/education/enums/TeachModeEnum.java
  44. 1 1
      mec-education/src/main/java/com/ym/mec/education/mapper/MusicGroupPaymentCalenderMapper.java
  45. 45 0
      mec-education/src/main/java/com/ym/mec/education/resp/StudentResp.java
  46. 12 0
      mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java
  47. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/IMusicGroupPaymentCalenderService.java
  48. 8 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java
  49. 166 28
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java
  50. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/MusicGroupPaymentCalenderServiceImpl.java
  51. 44 3
      mec-education/src/main/java/com/ym/mec/education/utils/DateUtil.java
  52. 3 0
      mec-gateway/mec-gateway-web/src/main/resources/application.yml
  53. 2 0
      mec-monitor/src/main/resources/application.yml
  54. 0 12
      mec-student/src/main/java/com/ym/mec/student/StudentApplication.java
  55. 1 1
      mec-student/src/main/java/com/ym/mec/student/config/ResourceServerConfig.java
  56. 9 11
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  57. 1 5
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java
  58. 1 1
      mec-student/src/main/java/com/ym/mec/student/controller/StudentCourseScheduleController.java
  59. 5 5
      mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java
  60. 2 0
      mec-student/src/main/resources/application.yml
  61. 2 0
      mec-task/src/main/resources/application.yml
  62. 3 13
      mec-teacher/src/main/java/com/ym/mec/teacher/TeacherApplication.java
  63. 2 0
      mec-teacher/src/main/resources/application.yml
  64. 6 48
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/YqPayUtil.java
  65. 0 4
      mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/payInfo.java
  66. 0 13
      mec-web/src/main/java/com/ym/mec/web/WebApplication.java
  67. 15 17
      mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java
  68. 9 15
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesCycleController.java
  69. 9 12
      mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesUnitPriceController.java
  70. 2 0
      mec-web/src/main/resources/application.yml
  71. 16 0
      mec-workflow/src/main/java/com/ym/mec/workfow/WorkflowApplication.java
  72. 1 1
      mec-workflow/src/main/java/com/ym/mec/workfow/controller/flow/OrderController.java
  73. 8 0
      mec-workflow/src/main/java/com/ym/mec/workfow/controller/flow/ProcessController.java
  74. 51 1
      mec-workflow/src/main/java/com/ym/mec/workfow/controller/flow/TaskController.java
  75. 20 0
      mec-workflow/src/main/resources/application.yml
  76. 2 2
      mec-workflow/src/main/resources/flows/leave.snaker
  77. 3 3
      mec-workflow/src/main/resources/flows/viprefund.snaker
  78. 2 0
      mec-zipkin/src/main/resources/application.yml
  79. 3 3
      pom.xml
  80. 9 1
      workflowy/src/main/java/org/snaker/SnakerFlowyApplication.java
  81. 1 1
      workflowy/src/main/java/org/snaker/engine/core/ManagerService.java
  82. 13 13
      workflowy/src/main/java/org/snaker/engine/core/OrderService.java
  83. 7 7
      workflowy/src/main/java/org/snaker/engine/core/ProcessService.java
  84. 16 16
      workflowy/src/main/java/org/snaker/engine/core/SnakerEngineImpl.java
  85. 17 17
      workflowy/src/main/java/org/snaker/engine/core/TaskService.java
  86. 0 5
      workflowy/src/main/java/org/snaker/engine/model/NodeModel.java
  87. 4 0
      workflowy/src/main/java/org/snaker/engine/model/ProcessModel.java
  88. 3 0
      workflowy/src/main/java/org/snaker/engine/model/TaskModel.java

+ 2 - 0
cms/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:

+ 13 - 7
mec-auth/mec-auth-server/pom.xml

@@ -33,7 +33,7 @@
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-security</artifactId>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-sleuth-zipkin</artifactId>
@@ -70,13 +70,19 @@
 			<artifactId>kaptcha</artifactId>
 			<version>2.3.2</version>
 		</dependency>
-        <dependency>
-            <groupId>com.ym</groupId>
-            <artifactId>mec-client-api</artifactId>
-        </dependency>
 
-    </dependencies>
-	
+		<dependency>
+			<groupId>com.ym</groupId>
+			<artifactId>mec-client-api</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.commons</groupId>
+			<artifactId>commons-pool2</artifactId>
+		</dependency>
+
+	</dependencies>
+
 	<build>
 		<plugins>
 			<plugin>

+ 1 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/config/WebSecurityConfig.java

@@ -70,7 +70,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 
 	@Override
 	public void configure(WebSecurity web) throws Exception {
-		web.ignoring().antMatchers("/usernameLogin", "/smsLogin", "/refreshToken", "/v2/api-docs","/loginIn","/code/*","/user/setPassword","/user/updatePassword");
+		web.ignoring().antMatchers("/usernameLogin", "/smsLogin", "/refreshToken", "/v2/api-docs","/loginIn","/code/*");
 	}
 
 	@Bean

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

@@ -78,7 +78,7 @@ public class UserController extends BaseController {
 	}
 
 	@ApiOperation(value = "设置密码")
-	@PostMapping(value = "/setPassword", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
+	@PostMapping(value = "/setPassword", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
 	@ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "password", value = "密码", required = true, dataType = "String") })
 	public Object setPassword(String mobile, String password) {
@@ -95,7 +95,7 @@ public class UserController extends BaseController {
 	}
 
 	@ApiOperation(value = "修改密码")
-	@PostMapping(value = "/updatePassword", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
+	@PostMapping(value = "/updatePassword", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
 	@ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "authCode", value = "验证码", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, dataType = "String") })

+ 12 - 9
mec-auth/mec-auth-server/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:
@@ -39,15 +41,16 @@ spring:
     database: 0
     #连接超时时间(毫秒)
     timeout: 10000
-    pool:
-      #连接池最大连接数(使用负值表示没有限制)
-      max-active: 10
-      #连接池最大阻塞等待时间(使用负值表示没有限制)
-      max-wait: -1
-      #连接池中的最大空闲连接
-      max-idle: 10
-      #连接池中的最小空闲连接
-      min-idle: 0
+    jedis:
+      pool:
+        #连接池最大连接数(使用负值表示没有限制)
+        max-active: 10
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1
+        #连接池中的最大空闲连接
+        max-idle: 10
+        #连接池中的最小空闲连接
+        min-idle: 1
 
 mybatis:
     mapperLocations: classpath:config/mybatis/*.xml

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupDao.java

@@ -30,6 +30,15 @@ public interface ClassGroupDao extends BaseDAO<Integer, ClassGroup> {
     List<ClassGroup> findAllMixClassGroup(@Param("musicGroupId") Integer musicGroupId);
 
     /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [musicGroupId]
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
+     * @describe 获取所有班级
+     */
+    List<ClassGroup> findAllClassGroupByMusicGroup(@Param("musicGroupId") Long musicGroupId);
+
+    /**
      * 根据合奏班ID查询该合奏班下的子班级
      *
      * @param mixClassGroupId

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleComplaintsDao.java

@@ -2,8 +2,17 @@ package com.ym.mec.biz.dal.dao;
 
 import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
 import com.ym.mec.common.dal.BaseDAO;
+import org.apache.ibatis.annotations.Param;
 
 public interface CourseScheduleComplaintsDao extends BaseDAO<Long, CourseScheduleComplaints> {
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [userId, courseScheduleId]
+     * @return com.ym.mec.biz.dal.entity.CourseScheduleComplaints
+     * @describe 根据用户和课程获取申诉详情
+     */
+    CourseScheduleComplaints findByUserAndCourse(@Param("userId") Long userId,@Param("courseScheduleId") Long courseScheduleId);
 	
 }

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleDao.java

@@ -159,4 +159,21 @@ public interface CourseScheduleDao extends BaseDAO<Long, CourseSchedule> {
     List<StudentCourseScheduleRecordDto> findStudentCourseScheduleNotStartRecords(@Param("userId") Long userId,
                                                                                   @Param("date") Date date);
 
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [classGroupId]
+     * @return int
+     * @describe 统计已上课次
+     */
+    int countClassTimes(Long classGroupId);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/9/17
+     * 获取课程信息
+     */
+    CourseScheduleDto getCourseSchedules(@Param("classDate") Long courseScheduleId);
+
+
 }

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

@@ -11,7 +11,6 @@ public interface MusicGroupSubjectGoodsGroupDao extends BaseDAO<Long, MusicGroup
 
     /**
      * 批量保存
-     *
      * @param musicGroupSubjectGoodsGroups
      * @return
      */
@@ -19,13 +18,13 @@ public interface MusicGroupSubjectGoodsGroupDao extends BaseDAO<Long, MusicGroup
 
     /**
      * 获取建团申请,声部设置已确认数据
-     *
      * @param musicGroupId
      * @param subId
      * @return
      */
     List<MusicGroupSubjectGoodsGroup> findGoodsGroup(@Param("musicGroupId") Integer musicGroupId, @Param("subId") Integer subId);
 
+
     /**
      * 根据ids获取打包商品
      *

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

@@ -72,29 +72,11 @@ public interface StudentRegistrationDao extends BaseDAO<Long, StudentRegistratio
      * @return
      */
     Integer updateByUserIdAndMusicGroupId(@Param("studentRegistration") StudentRegistration studentRegistration);
-
-
-    /**
-     * 查询手机是否已注册
-     *
-     * @param musicGroupId
-     * @param parentsPhone
-     * @return
-     */
-    StudentRegistration getByPhoneAndMusicGroupId(@Param("musicGroupId") Integer musicGroupId, @Param("parentsPhone") String parentsPhone);
-
-    /**
-     * 查询用户是否存在
-     * @param phone
-     * @return
-     */
-    Map getSysUserByPhone(String phone);
-
+    
     /**
      * 查询学生信息
      * @param userId
      * @return
      */
     StudentInfo queryStudentInfo(Integer userId);
-
 }

+ 16 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/VipGroupDefaultClassesCycleDao.java

@@ -5,5 +5,21 @@ import com.ym.mec.common.dal.BaseDAO;
 
 public interface VipGroupDefaultClassesCycleDao extends BaseDAO<Integer, VipGroupDefaultClassesCycle> {
 
+
+    VipGroupDefaultClassesCycle checkMaxClassTimes(Integer maxClassTimes);
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [maxClassTimes]
+     * @return com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle
+     * @describe 根据最大课次获取上一梯度信息
+     */
+    VipGroupDefaultClassesCycle findByMaxClassTimes(Integer maxClassTimes);
+
+
+    VipGroupDefaultClassesCycle findByMinClassTimes(Integer minClassTimes);
+
+    int countAll();
 	
 }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleDto.java

@@ -23,6 +23,17 @@ public class CourseScheduleDto extends CourseSchedule {
     @ApiModelProperty(value = "班级编号,房间号",required = false)
     private String sealClassId;
 
+    @ApiModelProperty(value = "课程结束后课申诉时间限制")
+    private Integer vipAppealDaysRange;
+
+    public Integer getVipAppealDaysRange() {
+        return vipAppealDaysRange;
+    }
+
+    public void setVipAppealDaysRange(Integer vipAppealDaysRange) {
+        this.vipAppealDaysRange = vipAppealDaysRange;
+    }
+
     public String getSealClassId() {
         return sealClassId;
     }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/MusicGroupSubjectGoodsAndInfoDto.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.dal.dto;
 
+import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 
@@ -20,6 +21,9 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     //乐团计划及收费信息
     private MusicGroupSubjectPlan musicGroupSubjectPlan;
 
+    //其他商品(教材、琴谱)
+    private List<Goods> otherGoods;
+
     public Map getCourseScheduleInfo() {
         return CourseScheduleInfo;
     }
@@ -43,4 +47,12 @@ public class MusicGroupSubjectGoodsAndInfoDto {
     public void setMusicGroupSubjectPlan(MusicGroupSubjectPlan musicGroupSubjectPlan) {
         this.musicGroupSubjectPlan = musicGroupSubjectPlan;
     }
+
+    public List<Goods> getOtherGoods() {
+        return otherGoods;
+    }
+
+    public void setOtherGoods(List<Goods> otherGoods) {
+        this.otherGoods = otherGoods;
+    }
 }

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

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.entity;
 
 import com.ym.mec.biz.dal.enums.AuditStatusEnum;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
 /**
@@ -11,13 +12,13 @@ public class CourseScheduleComplaints {
 	/**  */
 	private Long id;
 	
-	/**  */
+	@ApiModelProperty(value = "用户ID")
 	private Integer userId;
 	
-	/**  */
+	@ApiModelProperty(value = "课程ID")
 	private Long courseScheduleId;
 	
-	/**  */
+	@ApiModelProperty(value = "原因")
 	private String reason;
 	
 	/**  */

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

@@ -44,7 +44,18 @@ public class StudentAttendance {
 	/** 如果是请假状态,此字段就指请假原因 */
 	@ApiModelProperty(value = "如果是请假状态,此字段就指请假原因",required = false)
 	private String remark;
-	
+
+	@ApiModelProperty(value = "当前课时")
+	private Integer currentClassTimes;
+
+	public Integer getCurrentClassTimes() {
+		return currentClassTimes;
+	}
+
+	public void setCurrentClassTimes(Integer currentClassTimes) {
+		this.currentClassTimes = currentClassTimes;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}

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

@@ -4,7 +4,7 @@ import com.ym.mec.common.enums.BaseEnum;
 
 public enum GoodsType implements BaseEnum<String, GoodsType> {
 
-	INSTRUMENT("INSTRUMENT", "乐器"), ACCESSORIES("ACCESSORIES", "辅");
+	INSTRUMENT("INSTRUMENT", "乐器"), ACCESSORIES("ACCESSORIES", "辅件"),OTHER("OTHER", "其他");
 
 	private String code;
 

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

@@ -1,7 +1,5 @@
 package com.ym.mec.biz.service;
 
-import java.util.List;
-
 import com.ym.mec.biz.dal.dto.*;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.page.StudentPayLogQueryInfo;
@@ -12,6 +10,8 @@ import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.common.service.BaseService;
 
+import java.util.List;
+
 public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
 
     /**
@@ -48,6 +48,15 @@ public interface ClassGroupService extends BaseService<Integer, ClassGroup> {
     List<ClassGroup> findAllMixClassGroupByMusicGroupId(int musicGroupId);
 
     /**
+     * @Author: Joburgess
+     * @Date: 2019/10/8
+     * @params [musicGroupId]
+     * @return java.util.List<com.ym.mec.biz.dal.entity.ClassGroup>
+     * @describe 获取乐团下所有班级
+     */
+    List<ClassGroup> findAllClassGroupByMusicGroup(Long musicGroupId);
+
+    /**
      * 添加单技班
      *
      * @param classGroup

+ 0 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/MusicGroupSubjectGoodsGroupService.java

@@ -2,7 +2,6 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.common.service.BaseService;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 

+ 0 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRegistrationService.java

@@ -79,12 +79,4 @@ public interface StudentRegistrationService extends BaseService<Long, StudentReg
      */
     StudentInfo queryStudentInfo(Integer userId);
 
-    /**
-     * 查询手机是否已注册
-     * @param musicGroupId
-     * @param parentsPhone
-     * @return
-     */
-    StudentRegistration getByPhoneAndMusicGroupId(Integer musicGroupId,  String parentsPhone);
-
 }

+ 6 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -89,6 +89,12 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
     }
 
     @Override
+    public List<ClassGroup> findAllClassGroupByMusicGroup(Long musicGroupId) {
+        List<ClassGroup> allMixClassGroup = classGroupDao.findAllClassGroupByMusicGroup(musicGroupId);
+        return allMixClassGroup;
+    }
+
+    @Override
     @Transactional(rollbackFor = Exception.class)
     public ClassGroup addClassGroup(ClassGroup classGroup) throws Exception {
         Date date;

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java

@@ -339,6 +339,18 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 	@Override
 	public void courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints) {
 		SysUser user = sysUserFeignService.queryUserInfo();
+
+		CourseScheduleComplaints byUserAndCourse = courseScheduleComplaintsDao.findByUserAndCourse(courseScheduleComplaints.getUserId().longValue(), courseScheduleComplaints.getCourseScheduleId());
+		if(byUserAndCourse!=null){
+			throw new BizException("您已经对该课程进行过申诉操作!");
+		}
+
+		CourseScheduleDto courseSchedules = courseScheduleDao.getCourseSchedules(courseScheduleComplaints.getCourseScheduleId());
+		Date now=new Date();
+		int i = DateUtil.daysBetween(courseSchedules.getEndClassTime(), now);
+		if(i>courseSchedules.getVipAppealDaysRange()){
+			throw new BizException("该课程已超过可申诉时间范围!");
+		}
 		courseScheduleComplaints.setUserId(user.getId());
 		courseScheduleComplaints.setStatus(AuditStatusEnum.ING);
 		courseScheduleComplaintsDao.insert(courseScheduleComplaints);

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

@@ -27,9 +27,9 @@ public class MusicGroupSubjectGoodsGroupServiceImpl extends BaseServiceImpl<Long
         return musicGroupSubjectGoodsGroupDao.findGoodsGroup(musicGroupId, subId);
     }
 
-    @Override
-    public List<MusicGroupSubjectGoodsGroup> findGoodsGroupByIds(String ids) {
+	@Override
+	public List<MusicGroupSubjectGoodsGroup> findGoodsGroupByIds(String ids) {
 
-	    return musicGroupSubjectGoodsGroupDao.findGoodsGroupByIds(ids);
-    }
+		return musicGroupSubjectGoodsGroupDao.findGoodsGroupByIds(ids);
+	}
 }

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

@@ -76,10 +76,14 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
                 });
             }
         });
+        //获取声部(科目)下其他商品
+        List<Goods> otherGoods = goodsService.findGoodsBySubId(subjectId, "OTHER");
+
         MusicGroupSubjectGoodsAndInfoDto musicGroupSubjectGoodsAndInfo = new MusicGroupSubjectGoodsAndInfoDto();
         musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectPlan(musicOneSubjectClassPlan);
         musicGroupSubjectGoodsAndInfo.setCourseScheduleInfo(courseForm);
         musicGroupSubjectGoodsAndInfo.setMusicGroupSubjectGoodsGroupList(goodsGroups);
+        musicGroupSubjectGoodsAndInfo.setOtherGoods(otherGoods);
         return musicGroupSubjectGoodsAndInfo;
     }
 

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.biz.dal.dao.CourseScheduleDao;
 import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
 import com.ym.mec.biz.dal.dao.StudentAttendanceDao;
 import com.ym.mec.biz.dal.dto.StudentPersonalAttendanceDto;
@@ -29,6 +30,8 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	private StudentAttendanceDao studentAttendanceDao;
 	@Autowired
 	private MusicGroupStudentFeeDao studentFeeDao;
+	@Autowired
+	private CourseScheduleDao courseScheduleDao;
 
 	@Override
 	public BaseDAO<Long, StudentAttendance> getDAO() {
@@ -37,7 +40,9 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 	@Override
 	public void addStudentAttendances(List<StudentAttendance> studentAttendances) {
+		int classTimes=courseScheduleDao.countClassTimes(studentAttendances.get(0).getClassGroupId().longValue());
 		studentAttendances.forEach(studentAttendance -> {
+			studentAttendance.setCurrentClassTimes(classTimes);
 			StudentAttendance studentAttendanceInfo = studentAttendanceDao.getStudentAttendanceInfo(studentAttendance);
 			if (studentAttendance.getStatus() != StudentAttendanceStatusEnum.DROP_OUT) {
 				//判断是否为连续旷课

+ 10 - 22
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -8,8 +8,6 @@ import java.util.Map;
 
 import javax.annotation.Resource;
 
-import com.ym.mec.biz.dal.dao.TeacherDao;
-import com.ym.mec.biz.dal.entity.Teacher;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -37,7 +35,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Resource
     private StudentRegistrationDao studentRegistrationDao;
     @Autowired
-    private TeacherDao teacherDao;
+    private SysUserFeignService sysUserFeignService;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -105,10 +103,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     @Transactional(rollbackFor = Exception.class)
     public StudentRegistration addStudent(StudentRegistration studentRegistration) {
         Date date = new Date();
-        int userId = 0;
-        Map hasUser = studentRegistrationDao.getSysUserByPhone(studentRegistration.getParentsPhone());
-        if (hasUser == null) {
-            SysUser sysUser = new SysUser();
+        SysUser sysUser = sysUserFeignService.queryUserByMobile(studentRegistration.getParentsPhone());
+        if (sysUser == null) {
+            sysUser = new SysUser();
             sysUser.setPhone(studentRegistration.getParentsPhone());
             sysUser.setCreateTime(date);
             sysUser.setUpdateTime(date);
@@ -119,24 +116,15 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             sysUser.setOrganId(studentRegistration.getOrganId());
             sysUser.setRealName(studentRegistration.getName());
             sysUser.setIdCardNo(studentRegistration.getIdCardNo());
-            teacherDao.addSysUser(sysUser);
-            userId = sysUser.getId();
-        } else {
-            userId = (int) hasUser.get("id_");
+            sysUserFeignService.addUser(sysUser);
         }
-        studentRegistration.setUserId(userId);
+        studentRegistration.setUserId(sysUser.getId());
         studentRegistrationDao.insert(studentRegistration);
         return studentRegistration;
     }
 
-
-    @Override
-    public StudentRegistration getByPhoneAndMusicGroupId(Integer musicGroupId, String parentsPhone) {
-        return studentRegistrationDao.getByPhoneAndMusicGroupId(musicGroupId, parentsPhone);
-    }
-
-    @Override
-    public StudentInfo queryStudentInfo(Integer userId) {
-        return studentRegistrationDao.queryStudentInfo(userId);
-    }
+	@Override
+	public StudentInfo queryStudentInfo(Integer userId) {
+		return studentRegistrationDao.queryStudentInfo(userId);
+	}
 }

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

@@ -1,5 +1,6 @@
 package com.ym.mec.biz.service.impl;
 
+import com.ym.mec.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -19,5 +20,19 @@ public class VipGroupDefaultClassesCycleServiceImpl extends BaseServiceImpl<Inte
 	public BaseDAO<Integer, VipGroupDefaultClassesCycle> getDAO() {
 		return vipGroupDefaultClassesCycleDao;
 	}
-	
+
+	@Override
+	public long insert(VipGroupDefaultClassesCycle bean) {
+		if(vipGroupDefaultClassesCycleDao.countAll()>0){
+
+		}else{
+
+		}
+		VipGroupDefaultClassesCycle checkMaxClassTimes = vipGroupDefaultClassesCycleDao.checkMaxClassTimes(bean.getMaxClassTimes());
+		if(null!=checkMaxClassTimes){
+			throw new BizException("已存在包含该课次的设置!");
+		}
+		vipGroupDefaultClassesCycleDao.findByMaxClassTimes(bean.getMaxClassTimes());
+		return super.insert(bean);
+	}
 }

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

@@ -280,12 +280,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		}
 		StudentApplyRefunds studentApplyRefunds=new StudentApplyRefunds();
 		StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId,studentId);
+		if(null==studentPaymentOrder){
+			throw new BizException("未找到相关订单信息!");
+		}
 		VipGroup vipGroup=vipGroupDao.get(vipGroupId);
 		//剩余课时数
 		Map surplusClassTimes=MapUtil.convertMybatisMap(vipGroupDao.countSurplusClassTimes(vipGroupId));
 		studentApplyRefunds.setExpectAmount(countVipGroupPredictFee(vipGroup,
-				new BigDecimal(surplusClassTimes.get(TeachModeEnum.ONLINE.getMsg()).toString()),
-				new BigDecimal(surplusClassTimes.get(TeachModeEnum.OFFLINE.getMsg()).toString())));
+				new BigDecimal(surplusClassTimes.get(TeachModeEnum.ONLINE.getCode()).toString()),
+				new BigDecimal(surplusClassTimes.get(TeachModeEnum.OFFLINE.getCode()).toString())));
 		studentApplyRefunds.setStatus(AuditStatusEnum.ING);
 		String orderNo=StringUtils.join(new String[]{studentId.toString(),String.valueOf(System.currentTimeMillis())});
 		studentApplyRefunds.setOrderNo(orderNo);

+ 7 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -384,4 +384,11 @@
     <select id="countClassStudent" resultType="int">
         select count(*) from class_group_student_mapper where class_group_id_=#{classGroupId}
     </select>
+    <select id="findAllClassGroupByMusicGroup" resultMap="ClassGroup">
+        SELECT
+        *
+        FROM
+        class_group cg
+        WHERE cg.music_group_id_=#{musicGroupId} AND del_flag_='0'
+    </select>
 </mapper>

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleComplaintsMapper.xml

@@ -83,4 +83,7 @@
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM course_schedule_complaints
 	</select>
+    <select id="findByUserAndCourse" resultMap="CourseScheduleComplaints">
+		SELECT * FROM course_schedule_complaints WHERE user_id_=#{userId} AND course_schedule_id_=#{courseScheduleId}
+    </select>
 </mapper>

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

@@ -248,7 +248,8 @@
             CONCAT(cs.class_date_,' ',cs.end_class_time_) end_class_time_,
             cs.status_,
 	        su.username_ teacher_name_,
-	        sa.status_ attendance_status_
+	        sa.status_ attendance_status_,
+			sc.paran_value_
         FROM
             course_schedule cs
             LEFT JOIN sys_user su ON cs.teacher_id_=su.id_
@@ -494,4 +495,33 @@
             LEFT JOIN class_group cg ON cgsm.class_group_id_=cg.id_
         WHERE cs.status_='NOT_START' AND cgsm.user_id_=#{userId} AND cs.class_date_=DATE_FORMAT(#{date},'%Y%m%d')
     </select>
+    <select id="findCourseScheduleByMusicGroup" resultMap="CourseSchedule">
+        SELECT
+            cs.*
+        FROM
+            class_group cg
+            LEFT JOIN course_schedule cs ON cg.id_=cs.class_group_id_
+            WHERE  cg.music_group_id_=#{musicGroupId}
+    </select>
+    <select id="countClassTimes" resultType="int">
+        SELECT
+            COUNT(*)
+        FROM
+            course_schedule cs
+            WHERE cs.class_group_id_=#{classGroupId} AND cs.status_!="NOT_START"
+    </select>
+    <select id="getCourseSchedules" resultMap="courseScheduleDto">
+        SELECT
+            cs.type_,
+            cs.id_,
+            cs.class_date_,
+            CONCAT(cs.class_date_,' ',cs.start_class_time_) start_class_time_,
+            CONCAT(cs.class_date_,' ',cs.end_class_time_) end
+			sc.paran_value_
+        FROM
+            course_schedule cs
+			LEFT JOIN sys_config sc ON sc.param_name_="vip_appeal_days_range"
+        WHERE
+            cs.id_=#{courseScheduleId}
+    </select>
 </mapper>

+ 3 - 5
mec-biz/src/main/resources/config/mybatis/MusicGroupSubjectGoodsGroupMapper.xml

@@ -14,7 +14,6 @@
         <result column="create_time_" property="createTime"/>
         <result column="update_time_" property="updateTime"/>
         <result column="price_" property="price"/>
-        <result column="remission_course_fee_" property="remissionCourseFee"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -96,12 +95,11 @@
         FROM music_group_subject_goods_group
     </select>
 
-    <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" extends="MusicGroupSubjectGoodsGroup"
-               id="findGoodsGroupMap">
-        <collection property="goodsList" resultMap="com.ym.mec.biz.dal.dao.GoodsDao.Goods" columnPrefix="g_"/>
+    <resultMap type="com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup" extends="MusicGroupSubjectGoodsGroup" id="findGoodsGroupMap">
+        <collection property="goodsList" resultMap="com.ym.mec.biz.dal.dao.GoodsDao.Goods" columnPrefix="g_" />
     </resultMap>
     <select id="findGoodsGroup" resultMap="findGoodsGroupMap">
-        SELECT mgs.*, g.id_ g_id_,g.name_ g_name_,g.market_price_ g_market_price_,g.complement_goods_id_list_
+        SELECT mgs.*, g.id_ g_id_,g.name_ g_name_,g.image_ g_image_,g.brief_ g_brief_, g.group_purchase_price_ g_group_purchase_price_,g.market_price_ g_market_price_,g.complement_goods_id_list_
         g_complement_goods_id_list_
         FROM music_group_subject_goods_group mgs,goods g
         WHERE FIND_IN_SET (g.id_ ,mgs.goods_id_list_)

+ 8 - 4
mec-biz/src/main/resources/config/mybatis/StudentAttendanceMapper.xml

@@ -16,6 +16,7 @@
         <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
         <result column="create_time_" property="createTime"/>
         <result column="remark_" property="remark"/>
+        <result column="current_class_times_" property="currentClassTimes"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -37,15 +38,15 @@
         </selectKey>
         -->
         INSERT INTO student_attendance
-        (id_,music_group_id_,class_group_id_,course_schedule_id_,user_id_,teacher_id_,status_,create_time_,remark_)
-        VALUES(#{id},#{musicGroupId},#{classGroupId},#{courseScheduleId},#{userId},#{teacherId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),#{remark})
+        (id_,music_group_id_,class_group_id_,course_schedule_id_,user_id_,teacher_id_,status_,create_time_,remark_,current_class_times_)
+        VALUES(#{id},#{musicGroupId},#{classGroupId},#{courseScheduleId},#{userId},#{teacherId},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),#{remark},#{currentClassTimes})
     </insert>
 
     <insert id="addStudentAttendances" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id_">
-      INSERT INTO student_attendance ( music_group_id_, class_group_id_, course_schedule_id_, user_id_, teacher_id_, status_, create_time_, remark_ )
+      INSERT INTO student_attendance ( music_group_id_, class_group_id_, course_schedule_id_, user_id_, teacher_id_, status_, create_time_, remark_ ,current_class_times_)
       VALUES
 	  <foreach collection="list" item="studentAttendance" separator=",">
-          (#{studentAttendance.musicGroupId},#{studentAttendance.classGroupId},#{studentAttendance.courseScheduleId},#{studentAttendance.userId},#{studentAttendance.teacherId},#{studentAttendance.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),#{studentAttendance.remark})
+          (#{studentAttendance.musicGroupId},#{studentAttendance.classGroupId},#{studentAttendance.courseScheduleId},#{studentAttendance.userId},#{studentAttendance.teacherId},#{studentAttendance.status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},now(),#{studentAttendance.remark},#{studentAttendance.currentClassTimes})
       </foreach>
     </insert>
 
@@ -74,6 +75,9 @@
             <if test="musicGroupId != null">
                 music_group_id_ = #{musicGroupId},
             </if>
+            <if test="currentClassTimes != null">
+                current_class_times_ = #{currentClassTimes},
+            </if>
         </set>
         WHERE id_ = #{id}
     </update>

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

@@ -28,6 +28,8 @@
         <result column="parents_company_" property="parentsCompany"/>
         <result column="payment_status_" property="paymentStatus"
                 typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
+        <result column="last_payment_date_" property="lastPaymentDate"/>
+        <result column="next_payment_date_" property="nextPaymentDate"/>
     </resultMap>
     
     <resultMap type="com.ym.mec.biz.dal.dto.StudentInfo" id="StudentInfo">
@@ -75,9 +77,9 @@
     <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration" useGeneratedKeys="true"
             keyColumn="id" keyProperty="id">
         INSERT INTO student_registration
-        (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,actual_subject_id_)
+        (parents_phone_,id_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,is_allow_adjust_,kit_purchase_method_,remark_,create_time_,update_time_,parents_name_,parents_company_,payment_status_,last_payment_date_,next_payment_date_,actual_subject_id_)
         VALUES(#{parentsPhone},#{id},#{userId},#{name},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},#{isAllowAdjust,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{kitPurchaseMethod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subjectId})
+        #{remark},now(),now(),#{parentsName},#{parentsCompany},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{lastPaymentDate},#{nextPaymentDate},#{subjectId})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -90,9 +92,15 @@
             <if test="subjectId != null">
                 subject_id_ = #{subjectId},
             </if>
+            <if test="nextPaymentDate != null">
+                next_payment_date_ = #{nextPaymentDate},
+            </if>
             <if test="currentGrade != null">
                 current_grade_ = #{currentGrade},
             </if>
+            <if test="lastPaymentDate != null">
+                last_payment_date_ = #{lastPaymentDate},
+            </if>
             <if test="currentClass != null">
                 current_class_ = #{currentClass},
             </if>
@@ -238,18 +246,8 @@
     </select>
 
     <update id="updateByUserIdAndMusicGroupId" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
-        UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_
-        = #{musicGroupId}
+        UPDATE student_registration SET class_group_id_ = #{classGroupId} WHERE user_id_ = #{userId} AND music_group_id_ = #{musicGroupId}
     </update>
-
-    <!-- 根据乐团编号和手机号查询注册乐团注册信息-->
-    <select id="getByPhoneAndMusicGroupId" resultMap="StudentRegistration">
-        SELECT * FROM student_registration WHERE music_group_id_=#{musicGroupId} AND parents_phone_ = #{parentsPhone}
-    </select>
-
-    <select id="getSysUserByPhone" resultType="map">
-        SELECT * FROM sys_user WHERE phone_ = #{phone}
-    </select>
     
     <select id="queryStudentInfo" resultMap="StudentInfo">
         SELECT u.*,sr.name_,sr.current_class_,sr.current_grade_,sr.actual_subject_id_ FROM sys_user u left join student_registration  sr on u.id_ = sr.user_id_ where u.id_ = #{userId} order by sr.create_time_ desc limit 0,1

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

@@ -23,6 +23,7 @@
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="VipGroupCategory">
 		SELECT * FROM vip_group_category
+		WHERE del_flag_=0
 		ORDER BY id_
 	</select>
 

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

@@ -32,7 +32,7 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO vip_group_default_classes_cycle (id_,min_class_times_,max_class_times_,month_,create_time_,update_time_) VALUES(#{id},#{minClassTimes},#{maxClassTimes},#{month},#{createTime},#{updateTime})
+		INSERT INTO vip_group_default_classes_cycle (id_,min_class_times_,max_class_times_,month_,create_time_,update_time_) VALUES(#{id},#{minClassTimes},#{maxClassTimes},#{month},now(),now())
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -73,4 +73,36 @@ create_time_ = #{createTime},
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM vip_group_default_classes_cycle
 	</select>
+	<select id="checkMaxClassTimes" resultMap="VipGroupDefaultClassesCycle">
+		SELECT
+			*
+		FROM
+			vip_group_default_classes_cycle
+			WHERE min_class_times_&gt;#{minClassTimes}
+			AND min_class_times_&gt;#{minClassTimes}
+		ORDER BY min_class_times_ LIMIT 1
+	</select>
+	<select id="findByMaxClassTimes" resultMap="VipGroupDefaultClassesCycle">
+		SELECT
+		*
+		FROM
+		vip_group_default_classes_cycle
+		WHERE max_class_times_&lt;#{maxClassTimes}
+		ORDER BY max_class_times_ DESC LIMIT 1
+	</select>
+	<select id="findByMinClassTimes" resultMap="VipGroupDefaultClassesCycle">
+		SELECT
+			*
+		FROM
+			vip_group_default_classes_cycle
+			WHERE min_class_times_&gt;#{minClassTimes}
+		ORDER BY min_class_times_ LIMIT 1
+	</select>
+    <select id="countAll" resultType="int">
+		SELECT
+			count(*)
+		FROM
+			vip_group_default_classes_cycle
+		LIMIT 1
+    </select>
 </mapper>

+ 13 - 1
mec-common/common-core/pom.xml

@@ -26,6 +26,12 @@
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-data-redis</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>io.lettuce</groupId>
+					<artifactId>lettuce-core</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
 		<!-- Redis缓存整合结束 -->
 
@@ -38,16 +44,22 @@
 			<groupId>org.springframework.cloud</groupId>
 			<artifactId>spring-cloud-starter-openfeign</artifactId>
 		</dependency>
+		
 		<dependency>
 			<groupId>com.ym</groupId>
 			<artifactId>mec-thirdparty</artifactId>
 		</dependency>
+		
+		<dependency>
+			<groupId>redis.clients</groupId>
+			<artifactId>jedis</artifactId>
+		</dependency>
+		
 		<dependency>
 			<groupId>org.springframework.security.oauth</groupId>
 			<artifactId>spring-security-oauth2</artifactId>
 			<version>2.2.1.RELEASE</version>
 		</dependency>
 
-
 	</dependencies>
 </project>

+ 54 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/redis/config/RedisConfig.java

@@ -0,0 +1,54 @@
+package com.ym.mec.common.redis.config;
+
+import java.io.Serializable;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.RedisPassword;
+import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisConfig {
+
+	@Value("${spring.redis.host}")
+	private String host;
+	
+	@Value("${spring.redis.port}")
+	private int port;
+	
+	@Value("${spring.redis.password}")
+	private String password;
+	
+	@Value("${spring.redis.database}")
+	private int database;
+
+	@Bean
+	public RedisConnectionFactory jedisConnectionFactory() {
+		RedisStandaloneConfiguration config = new RedisStandaloneConfiguration();
+		config.setHostName(host);
+		config.setPort(port);
+		config.setPassword(RedisPassword.of(password));
+		config.setDatabase(database);
+
+		JedisConnectionFactory factory = new JedisConnectionFactory(config);
+		return factory;
+	}
+
+	@Bean
+	public RedisTemplate<String, Serializable> redisTemplate(JedisConnectionFactory connectionFactory) {
+		RedisTemplate<String, Serializable> redisTemplate = new RedisTemplate<>();
+		redisTemplate.setKeySerializer(new StringRedisSerializer());
+		redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+		redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer());
+		redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
+		redisTemplate.setConnectionFactory(jedisConnectionFactory());
+		return redisTemplate;
+	}
+
+}

+ 0 - 68
mec-common/common-core/src/main/java/com/ym/mec/common/redis/config/RedisTemplateConfig.java

@@ -1,68 +0,0 @@
-package com.ym.mec.common.redis.config;
-
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.core.HashOperations;
-import org.springframework.data.redis.core.ListOperations;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.SetOperations;
-import org.springframework.data.redis.core.ValueOperations;
-import org.springframework.data.redis.core.ZSetOperations;
-import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-
-/**
- * Redis 配置类
- */
-@EnableCaching
-@Configuration
-@AutoConfigureBefore(RedisAutoConfiguration.class)
-public class RedisTemplateConfig {
-
-	@Bean
-	@ConditionalOnMissingBean(name="redisTemplate")
-	public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
-		RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
-		redisTemplate.setKeySerializer(new StringRedisSerializer());
-		redisTemplate.setHashKeySerializer(new StringRedisSerializer());
-		redisTemplate.setValueSerializer(new JdkSerializationRedisSerializer());
-		redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
-		redisTemplate.setConnectionFactory(redisConnectionFactory);
-		return redisTemplate;
-	}
-
-	@Bean
-	@ConditionalOnMissingBean(name="hashOperations")
-	public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
-		return redisTemplate.opsForHash();
-	}
-
-	@Bean
-	@ConditionalOnMissingBean(name="valueOperations")
-	public ValueOperations<String, String> valueOperations(RedisTemplate<String, String> redisTemplate) {
-		return redisTemplate.opsForValue();
-	}
-
-	@Bean
-	@ConditionalOnMissingBean(name="listOperations")
-	public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
-		return redisTemplate.opsForList();
-	}
-
-	@Bean
-	@ConditionalOnMissingBean(name="setOperations")
-	public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
-		return redisTemplate.opsForSet();
-	}
-
-	@Bean
-	@ConditionalOnMissingBean(name="zSetOperations")
-	public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
-		return redisTemplate.opsForZSet();
-	}
-}

+ 4 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/redis/service/RedisCache.java

@@ -3,14 +3,18 @@ package com.ym.mec.common.redis.service;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ValueOperations;
+import org.springframework.stereotype.Service;
 
 import com.ym.mec.common.cache.Cache;
 import com.ym.mec.common.cache.CacheException;
 
+@Service
 public class RedisCache<K, V> implements Cache<K, V> {
 
+	@Autowired
 	private RedisTemplate<K, V> redisTemplate;
 
 	public RedisCache(RedisTemplate<K, V> redisTemplate) {

+ 8 - 12
mec-common/common-core/src/main/java/com/ym/mec/common/validcode/impl/SmsCodeServiceImpl.java

@@ -1,23 +1,19 @@
 package com.ym.mec.common.validcode.impl;
 
-import com.ym.mec.thirdparty.message.MessageSenderPlugin;
-import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 
 import com.ym.mec.common.redis.service.RedisCache;
 import com.ym.mec.common.validcode.SmsCodeService;
+import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 
 @Service
 public class SmsCodeServiceImpl implements SmsCodeService {
-
-	@Autowired
-	private RedisTemplate<String,String> redisTemplate;
 	
-	private RedisCache<String,String> redisCache = new RedisCache<String, String>(redisTemplate);
+	@Autowired
+	private RedisCache<String,Object> redisCache;
 	
 	private final String loginVerifyCodeKey = "loginVerifyCode:";
 	
@@ -28,7 +24,7 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 
 	@Override
 	public boolean verifyValidCode(String mobile, String authCode) {
-		String verifyCode = redisTemplate.opsForValue().get(loginVerifyCodeKey + mobile);
+		String verifyCode = (String) redisCache.get(loginVerifyCodeKey + mobile);
 		if(StringUtils.isNoneEmpty(verifyCode) && StringUtils.equalsIgnoreCase(verifyCode,authCode)){
 			return true;
 		}
@@ -40,19 +36,19 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 		String code = RandomStringUtils.randomNumeric(6);
 		// 发送验证码
 //		messageSenderPluginContext.send(MessageSenderPluginContext.MessageSender.YIMEI,"","",mobile,"");
-		redisTemplate.opsForValue().set(loginVerifyCodeKey + mobile, code, expireTime);
+		redisCache.put(loginVerifyCodeKey + mobile, code, expireTime);
 		return true;
 	}
 
 	@Override
 	public String getValidCode(String mobile) {
-		return redisTemplate.opsForValue().get(loginVerifyCodeKey + mobile);
+		return (String) redisCache.get(loginVerifyCodeKey + mobile);
 	}
 
 	@Override
 	public void removeValidCode(String mobile) {
-		if (redisTemplate.hasKey(loginVerifyCodeKey + mobile)) {
-			redisTemplate.delete(loginVerifyCodeKey + mobile);
+		if (redisCache.exists(loginVerifyCodeKey + mobile)) {
+			redisCache.delete(loginVerifyCodeKey + mobile);
 		}
 	}
 

+ 2 - 12
mec-education/src/main/java/com/ym/mec/education/EducationApplication.java

@@ -1,20 +1,17 @@
 package com.ym.mec.education;
 
-import com.spring4all.swagger.EnableSwagger2Doc;
-import com.ym.mec.common.redis.service.RedisCache;
 import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.client.RestTemplate;
 
+import com.spring4all.swagger.EnableSwagger2Doc;
+
 @MapperScan({"com.ym.mec.education.mapper", "com.ym.mec.biz.dal.dao"})
 @SpringBootApplication
 @EnableDiscoveryClient
@@ -22,8 +19,6 @@ import org.springframework.web.client.RestTemplate;
 @Configuration
 @EnableSwagger2Doc
 public class EducationApplication {
-    @Autowired
-    private RedisTemplate<String, Object> redisTemplate;
 
     public static void main(String[] args) {
         SpringApplication.run(EducationApplication.class, args);
@@ -35,9 +30,4 @@ public class EducationApplication {
         return new RestTemplate();
     }
 
-    @Bean
-    @ConditionalOnBean(RedisTemplate.class)
-    public RedisCache<String, Object> redisCache() {
-        return new RedisCache<String, Object>(redisTemplate);
-    }
 }

+ 9 - 0
mec-education/src/main/java/com/ym/mec/education/controller/StudentController.java

@@ -5,6 +5,7 @@ import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.StudentReq;
 import com.ym.mec.education.service.IClassGroupStudentMapperService;
+import com.ym.mec.education.service.ICourseScheduleService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -28,6 +29,8 @@ public class StudentController {
 
     @Autowired
     private IClassGroupStudentMapperService groupStudentMapperService;
+    @Autowired
+    private ICourseScheduleService courseScheduleService;
 
     @PostMapping("/list")
     @ApiOperation("学员名单列表")
@@ -47,4 +50,10 @@ public class StudentController {
         return groupStudentMapperService.getInfo(studentReq);
     }
 
+    @PostMapping("/course")
+    @ApiOperation("根据学员id查询进行中的课程计划和历史课程计划")
+    public BaseResponse courseInfo(@RequestBody StudentReq studentReq) {
+        return courseScheduleService.getCourseScheduleByStudent(studentReq);
+    }
+
 }

+ 41 - 27
mec-education/src/main/java/com/ym/mec/education/enums/TeachModeEnum.java

@@ -1,33 +1,47 @@
 package com.ym.mec.education.enums;
 
 import com.ym.mec.common.enums.BaseEnum;
+import java.util.Arrays;
 
 public enum TeachModeEnum implements BaseEnum<String, TeachModeEnum> {
-	ONLINE("ONLINE", "线上"), OFFLINE("OFFLINE", "线下");
-
-	private String code;
-
-	private String msg;
-
-	TeachModeEnum(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;
-	}
+    ONLINE("ONLINE", "线上"), OFFLINE("OFFLINE", "线下");
+
+    private String code;
+
+    private String msg;
+
+    TeachModeEnum(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;
+    }
+
+    /**
+     * 根据枚举值获取枚举信息
+     *
+     * @param code 枚举值
+     * @return 枚举信息
+     */
+    public static String getMsgByCode(String code) {
+        return Arrays.stream(TeachModeEnum.values())
+            .filter(TeachModeEnum -> TeachModeEnum.getCode().equals(code))
+            .findFirst()
+            .map(TeachModeEnum::getMsg).orElse(null);
+    }
 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/MusicGroupPaymentCalenderMapper.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ym.mec.education.entity.MusicGroupPaymentCalender;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
 
 /**
  * <p>

+ 45 - 0
mec-education/src/main/java/com/ym/mec/education/resp/StudentResp.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.experimental.Accessors;
+
 import java.io.Serializable;
 import java.util.List;
 
@@ -32,4 +33,48 @@ public class StudentResp implements Serializable {
     private String parentsPhone;
     @ApiModelProperty(value = "备注")
     private String remark;
+    @ApiModelProperty(value = "进行中课程计划")
+    private List<StudentCourseSchedule> inProgressCourseSchedule;
+    @ApiModelProperty(value = "已完成课程计划")
+    private List<StudentCourseSchedule> completedCourseSchedule;
+
+    @Data
+    @ApiModel(value = "课程计划")
+    @Accessors(chain = true)
+    public static class StudentCourseSchedule {
+        @ApiModelProperty(value = "乐团名称")
+        private String musicGroupName;
+        @ApiModelProperty(value = "乐团id", example = "1")
+        private Integer musicGroupId;
+        @ApiModelProperty(value = "课程名称", example = "基础知识课")
+        private String courseName;
+        @ApiModelProperty(value = "班级名称", example = "长笛1班")
+        private String className;
+        @ApiModelProperty(value = "课程日期", example = "9月19日")
+        private String classDate;
+        @ApiModelProperty(value = "课程星期", example = "星期一")
+        private String classWeek;
+        @ApiModelProperty(value = "课程时间", example = "12:00-17:00")
+        private String classTime;
+        @ApiModelProperty(value = "缴费状态,已缴费,待续费,已续费", example = "已续费")
+        private String renewStatus;
+        @ApiModelProperty(value = "学校经纬度", example = "118.800454,32.083998")
+        private String schoolLongitudeLatitude;
+        @ApiModelProperty(value = "课程类别 1 乐团 2 vip", example = "1")
+        private Integer courseType;
+        @ApiModelProperty(value = "讲课老师", example = "张老师")
+        private String teacher;
+        @ApiModelProperty(value = "教学形式 线上 线下", example = "线上")
+        private String teachMode;
+        @ApiModelProperty(value = "课程总数", example = "60分钟/次,共30节")
+        private String totalClassTimes;
+        @ApiModelProperty(value = "剩余课时", example = "20")
+        private Integer remainderClassTimes;
+        @ApiModelProperty(value = "上课学生")
+        private List<String> studentList;
+    }
+
+    public static StudentCourseSchedule getStudentCourseSchedule() {
+        return new StudentCourseSchedule();
+    }
 }

+ 12 - 0
mec-education/src/main/java/com/ym/mec/education/service/ICourseScheduleService.java

@@ -6,6 +6,7 @@ import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.CourseSchedule;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
+import com.ym.mec.education.req.StudentReq;
 
 /**
  * <p>
@@ -19,6 +20,7 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
 
     /**
      * 根据参数分页查询课程计划列表
+     *
      * @param classGroupReq
      * @return
      */
@@ -26,6 +28,7 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
 
     /**
      * 根据课程计划id获取课程计划详情
+     *
      * @param courseScheduleReq
      * @return
      */
@@ -33,11 +36,20 @@ public interface ICourseScheduleService extends IService<CourseSchedule> {
 
     /**
      * 历史考勤统计-头信息
+     *
      * @param classGroupReq
      * @return
      */
     BaseResponse getStatisticsInfo(ClassGroupReq classGroupReq);
 
+    /**
+     * 根据学生id查询进行中和已完成的课程计划
+     *
+     * @param studentReq
+     * @return
+     */
+    BaseResponse getCourseScheduleByStudent(StudentReq studentReq);
+
 
     /**
      * 根据课程计划id获取课程计划详情

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/IMusicGroupPaymentCalenderService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.MusicGroupPaymentCalender;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 8 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import com.ym.mec.biz.dal.enums.JobTypeEnum;
 import com.ym.mec.common.enums.UserGenderEnum;
+import com.ym.mec.common.security.AuthUser;
 import com.ym.mec.common.security.SecurityUtils;
 import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.base.PageResponse;
@@ -112,8 +113,14 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
 
     @Override
     public PageResponse getPageByTeacher(StudentReq studentReq) {
+        Teacher teacher;
         //判断当前登录人角色
-        Teacher teacher = teacherService.getById(SecurityUtils.getUser().getUserId());
+        AuthUser user = SecurityUtils.getUser();
+        if(Objects.nonNull(user)) {
+            teacher = teacherService.getById(user.getUserId());
+        }else {
+            teacher = teacherService.getById(studentReq.getTeacherId());
+        }
         if (Objects.nonNull(teacher)) {
             //教学主管
             QueryWrapper<MusicGroup> musicGroupQueryWrapper = new QueryWrapper<>();

+ 166 - 28
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java

@@ -8,13 +8,17 @@ import com.google.common.collect.Lists;
 import com.ym.mec.education.base.BaseResponse;
 import com.ym.mec.education.base.PageResponse;
 import com.ym.mec.education.entity.*;
+import com.ym.mec.education.enums.CourseStatusEnum;
 import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
+import com.ym.mec.education.enums.TeachModeEnum;
 import com.ym.mec.education.enums.TeachTypeEnum;
 import com.ym.mec.education.mapper.CourseScheduleMapper;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.req.CourseScheduleReq;
+import com.ym.mec.education.req.StudentReq;
 import com.ym.mec.education.resp.CourseInfoResp;
 import com.ym.mec.education.resp.CourseScheduleResp;
+import com.ym.mec.education.resp.StudentResp;
 import com.ym.mec.education.service.*;
 import com.ym.mec.education.utils.DateUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -22,11 +26,7 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -52,12 +52,20 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     private IStudentAttendanceService studentAttendanceService;
     @Autowired
     private IMusicGroupQuitService musicGroupQuitService;
-
+    @Autowired
+    private IClassGroupStudentMapperService classGroupStudentMapperService;
+    @Autowired
+    private IClassGroupService classGroupService;
     @Autowired
     private IMusicGroupService musicGroupService;
-
     @Autowired
     private ISchoolService schoolService;
+    @Autowired
+    private IMusicGroupStudentFeeService studentFeeService;
+    @Autowired
+    private IVipGroupClassGroupMapperService vipGroupClassGroupMapperService;
+    @Autowired
+    private IVipGroupService vipGroupService;
 
     @Override
     public PageResponse getPage(ClassGroupReq classGroupReq) {
@@ -77,11 +85,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
             courseScheduleResp.setId(item.getId());
             if (Objects.nonNull(item.getClassDate())) {
                 courseScheduleResp.setClassDate(DateUtil.date2String(item.getClassDate())
-                        + " " + DateUtil.date2Week(item.getClassDate()));
+                    + " " + DateUtil.date2Week(item.getClassDate()));
             }
             if (Objects.nonNull(item.getStartClassTime()) && Objects.nonNull(item.getEndClassTime())) {
                 courseScheduleResp.setClassTime(DateUtil.time2String(item.getStartClassTime()) + "-" +
-                        DateUtil.time2String(item.getEndClassTime()));
+                    DateUtil.time2String(item.getEndClassTime()));
             }
             if (StringUtils.isNotBlank(classGroup.getSubjectIdList())) {
                 List<String> subjectNameList = subjectService.getSubjectList(classGroup.getSubjectIdList()).stream().map(Subject::getName).collect(Collectors.toList());
@@ -91,8 +99,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
             }
             QueryWrapper<ClassGroupTeacherMapper> classGroupTeacherMapperQueryWrapper = new QueryWrapper<>();
             classGroupTeacherMapperQueryWrapper.lambda().eq(ClassGroupTeacherMapper::getClassGroupId, item.getClassGroupId())
-                    .eq(ClassGroupTeacherMapper::getTeacherRole, TeachTypeEnum.BISHOP.getCode())
-                    .eq(ClassGroupTeacherMapper::getUserId, item.getTeacherId());
+                .eq(ClassGroupTeacherMapper::getTeacherRole, TeachTypeEnum.BISHOP.getCode())
+                .eq(ClassGroupTeacherMapper::getUserId, item.getTeacherId());
             ClassGroupTeacherMapper classGroupTeacherMapper = classGroupTeacherMapperService.getOne(classGroupTeacherMapperQueryWrapper);
             if (Objects.nonNull(classGroupTeacherMapper)) {
                 SysUser sysUser = sysUserService.getById(classGroupTeacherMapper.getUserId());
@@ -116,24 +124,24 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
         if (Objects.nonNull(courseSchedule)) {
             if (Objects.nonNull(courseSchedule.getClassDate())) {
                 courseScheduleResp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate()) + "(" +
-                        DateUtil.date2Week(courseSchedule.getClassDate()) + ")");
+                    DateUtil.date2Week(courseSchedule.getClassDate()) + ")");
             }
             if (Objects.nonNull(courseSchedule.getStartClassTime()) &&
-                    Objects.nonNull(courseSchedule.getEndClassTime())) {
+                Objects.nonNull(courseSchedule.getEndClassTime())) {
                 courseScheduleResp.setClassTime(DateUtil.time2String(courseSchedule.getStartClassTime()) + "-" +
-                        DateUtil.time2String(courseSchedule.getEndClassTime()));
+                    DateUtil.time2String(courseSchedule.getEndClassTime()));
             }
             if (Objects.nonNull(courseSchedule.getTeacherId())) {
                 Optional.of(sysUserService.getById(courseSchedule.getTeacherId())).
-                        ifPresent(sysUser -> courseScheduleResp.setTeacher(sysUser.getRealName()));
+                    ifPresent(sysUser -> courseScheduleResp.setTeacher(sysUser.getRealName()));
             }
             QueryWrapper<StudentAttendance> studentAttendanceQueryWrapper = new QueryWrapper<>();
             studentAttendanceQueryWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId())
-                    .orderByDesc(true, StudentAttendance::getCreateTime);
+                .orderByDesc(true, StudentAttendance::getCreateTime);
             List<StudentAttendance> studentAttendanceList = studentAttendanceService.list(studentAttendanceQueryWrapper);
             if (!CollectionUtils.isEmpty(studentAttendanceList)) {
                 studentAttendanceList.stream().findFirst().ifPresent(studentAttendance ->
-                        courseScheduleResp.setLastCommitDate(DateUtil.date2String(studentAttendance.getCreateTime(), DateUtil.DATE_FORMAT_HOUR)));
+                    courseScheduleResp.setLastCommitDate(DateUtil.date2String(studentAttendance.getCreateTime(), DateUtil.DATE_FORMAT_HOUR)));
             }
             QueryWrapper<StudentAttendance> leaveWrapper = new QueryWrapper<>();
             QueryWrapper<StudentAttendance> normalWrapper = new QueryWrapper<>();
@@ -141,11 +149,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
             Integer totalCount = count();
             //请假
             leaveWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId())
-                    .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode());
+                .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.LEAVE.getCode());
             Integer leaveCount = studentAttendanceService.count(leaveWrapper);
             //正常
             normalWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId())
-                    .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.NORMAL.getCode());
+                .eq(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.NORMAL.getCode());
             Integer normalCount = studentAttendanceService.count(normalWrapper);
             courseScheduleResp.setLeaveNum(leaveCount);
             if (totalCount != 0) {
@@ -181,32 +189,162 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     }
 
     @Override
+    public BaseResponse getCourseScheduleByStudent(StudentReq studentReq) {
+        if (Objects.isNull(studentReq.getStudentId())) {
+            return BaseResponse.errorParam();
+        }
+        StudentResp studentResp = new StudentResp();
+        QueryWrapper<ClassGroupStudentMapper> classGroupStudentMapperQueryWrapper = new QueryWrapper<>();
+        classGroupStudentMapperQueryWrapper.lambda().eq(ClassGroupStudentMapper::getUserId, studentReq.getStudentId());
+        List<ClassGroupStudentMapper> classGroupStudentMapperList = classGroupStudentMapperService.list(classGroupStudentMapperQueryWrapper);
+        if (!CollectionUtils.isEmpty(classGroupStudentMapperList)) {
+            classGroupStudentMapperList.forEach(classGroupStudentMapper -> {
+                ClassGroup classGroup = classGroupService.getById(classGroupStudentMapper.getClassGroupId());
+                if (Objects.nonNull(classGroup)) {
+                    QueryWrapper<CourseSchedule> courseScheduleQueryWrapper = new QueryWrapper<>();
+                    courseScheduleQueryWrapper.lambda().eq(CourseSchedule::getClassGroupId, classGroup.getId())
+                        .in(CourseSchedule::getStatus, CourseStatusEnum.UNDERWAY.getCode(), CourseStatusEnum.OVER.getCode());
+                    List<CourseSchedule> courseScheduleList = list(courseScheduleQueryWrapper);
+                    //进行中的课程计划
+                    if (!CollectionUtils.isEmpty(courseScheduleList)) {
+                        List<StudentResp.StudentCourseSchedule> inProgressCourseSchedule = getCourseSchduleList(courseScheduleList.stream().filter(courseSchedule ->
+                            courseSchedule.getStatus().equals(CourseStatusEnum.UNDERWAY.getCode())).collect(Collectors.toList()), classGroup, studentReq);
+                        studentResp.setInProgressCourseSchedule(inProgressCourseSchedule);
+                        //已完成的课程计划
+                        List<StudentResp.StudentCourseSchedule> completedCourseSchedule = getCourseSchduleList(courseScheduleList.stream().filter(courseSchedule ->
+                            courseSchedule.getStatus().equals(CourseStatusEnum.OVER.getCode())).collect(Collectors.toList()), classGroup, studentReq);
+                        studentResp.setCompletedCourseSchedule(completedCourseSchedule);
+                    }
+                }
+            });
+        }
+        return BaseResponse.success(studentResp);
+    }
+
+    /**
+     * 获取课程计划
+     *
+     * @param courseScheduleList
+     * @param classGroup
+     * @return
+     */
+    private List<StudentResp.StudentCourseSchedule> getCourseSchduleList(List<CourseSchedule> courseScheduleList, ClassGroup classGroup, StudentReq studentReq) {
+        if (!CollectionUtils.isEmpty(courseScheduleList)) {
+            List<StudentResp.StudentCourseSchedule> studentCourseScheduleList = Lists.newArrayList();
+            courseScheduleList.forEach(courseSchedule -> {
+                StudentResp.StudentCourseSchedule studentCourseSchedule = StudentResp.getStudentCourseSchedule();
+                QueryWrapper<MusicGroupStudentFee> studentFeeQueryWrapper = new QueryWrapper<>();
+                studentFeeQueryWrapper.lambda().eq(MusicGroupStudentFee::getMusicGroupId, classGroup.getMusicGroupId())
+                    .eq(MusicGroupStudentFee::getUserId, studentReq.getStudentId());
+                MusicGroupStudentFee musicGroupStudentFee = studentFeeService.getOne(studentFeeQueryWrapper);
+                Optional.ofNullable(courseSchedule.getClassDate()).ifPresent(classDate ->
+                    studentCourseSchedule.setClassDate(DateUtil.date2String(courseSchedule.getClassDate()))
+                        .setClassWeek(DateUtil.date2Week2(courseSchedule.getClassDate())));
+                if (Objects.nonNull(courseSchedule.getStartClassTime()) && Objects.nonNull(courseSchedule.getEndClassTime())) {
+                    studentCourseSchedule.setClassTime(DateUtil.time2String(courseSchedule.getStartClassTime()) + "-"
+                        + DateUtil.time2String(courseSchedule.getEndClassTime()))
+                        .setTotalClassTimes(DateUtil.timeDifference(courseSchedule.getStartClassTime(), courseSchedule.getEndClassTime()) + "分钟/次,共" +
+                            classGroup.getTotalClassTimes() + "节");
+                }
+
+                //乐团课(单技课,合奏课,综合课,小班)
+                if (CourseSchedule.CourseScheduleType.SINGLE.getCode().equals(courseSchedule.getType()) ||
+                    CourseSchedule.CourseScheduleType.MIX.getCode().equals(courseSchedule.getType()) ||
+                    CourseSchedule.CourseScheduleType.COMPREHENSIVE.getCode().equals(courseSchedule.getType()) ||
+                    CourseSchedule.CourseScheduleType.HIGH.getCode().equals(courseSchedule.getType())) {
+                    MusicGroup musicGroup = musicGroupService.getById(classGroup.getMusicGroupId());
+                    Optional.ofNullable(musicGroup).ifPresent(musicGroupParam -> {
+                        studentCourseSchedule.setMusicGroupName(musicGroupParam.getName());
+                        studentCourseSchedule.setMusicGroupId(classGroup.getMusicGroupId());
+                        School school = schoolService.getById(musicGroup.getSchoolId());
+                        Optional.ofNullable(school).ifPresent(value -> studentCourseSchedule.
+                            setSchoolLongitudeLatitude(value.getLongitudeLatitude()));
+                    });
+                    QueryWrapper<MusicGroupPaymentCalender> paymentCalenderQueryWrapper = new QueryWrapper<>();
+                    paymentCalenderQueryWrapper.lambda().eq(MusicGroupPaymentCalender::getMusicGroupId, musicGroup.getId());
+                    studentCourseSchedule.setCourseType(1);
+                    //续费状态
+                    if (Objects.nonNull(musicGroupStudentFee)) {
+                        studentCourseSchedule.setRenewStatus("已缴费");
+                    }
+                } else if (CourseSchedule.CourseScheduleType.VIP.getCode().equals(courseSchedule.getType())) {
+                    //VIP
+                    studentCourseSchedule.setCourseName(courseSchedule.getName()).setClassName(classGroup.getName());
+                    if (Objects.nonNull(classGroup.getTotalClassTimes()) && Objects.nonNull(classGroup.getCurrentClassTimes())) {
+                        studentCourseSchedule.setRemainderClassTimes(classGroup.getTotalClassTimes() - classGroup.getCurrentClassTimes());
+                    }
+                    QueryWrapper<VipGroupClassGroupMapper> vipGroupClassGroupMapperQueryWrapper = new QueryWrapper<>();
+                    vipGroupClassGroupMapperQueryWrapper.lambda().eq(VipGroupClassGroupMapper::getClassGroupId, courseSchedule.getClassGroupId());
+                    VipGroupClassGroupMapper vipGroupClassGroupMapper = vipGroupClassGroupMapperService.getOne(vipGroupClassGroupMapperQueryWrapper);
+                    if (Objects.nonNull(vipGroupClassGroupMapper)) {
+                        VipGroup vipGroup = vipGroupService.getById(vipGroupClassGroupMapper.getVipGroupId());
+                        Optional.ofNullable(vipGroup).ifPresent(vipGroupParam -> {
+                            studentCourseSchedule.setMusicGroupId(classGroup.getMusicGroupId());
+                            School school = schoolService.getById(vipGroupParam.getTeacherSchoolId());
+                            Optional.ofNullable(school).ifPresent(value -> studentCourseSchedule.
+                                setSchoolLongitudeLatitude(value.getLongitudeLatitude()));
+                        });
+                    }
+                    studentCourseSchedule.setCourseType(2);
+                    if (Objects.isNull(musicGroupStudentFee.getNextPaymentDate())) {
+                        studentCourseSchedule.setRenewStatus("未续费");
+                    } else {
+                        studentCourseSchedule.setRenewStatus("已续费");
+                    }
+                    SysUser teacher = sysUserService.getById(courseSchedule.getTeacherId());
+                    if (Objects.nonNull(teacher)) {
+                        //讲课老师
+                        studentCourseSchedule.setTeacher(teacher.getRealName());
+                    }
+                    //教学形式
+                    studentCourseSchedule.setTeachMode(TeachModeEnum.getMsgByCode(courseSchedule.getTeachMode()));
+                    //上课学生
+                    QueryWrapper<ClassGroupStudentMapper> classGroupStudentMapperQueryWrapper = new QueryWrapper<>();
+                    classGroupStudentMapperQueryWrapper.lambda().eq(ClassGroupStudentMapper::getClassGroupId, courseSchedule.getClassGroupId());
+                    List<ClassGroupStudentMapper> groupStudentMapperList = classGroupStudentMapperService.list(classGroupStudentMapperQueryWrapper);
+                    if (!CollectionUtils.isEmpty(groupStudentMapperList)) {
+                        QueryWrapper<SysUser> sysUserQueryWrapper = new QueryWrapper<>();
+                        sysUserQueryWrapper.lambda().in(SysUser::getId, groupStudentMapperList.stream().map(ClassGroupStudentMapper::getUserId).collect(Collectors.toList()));
+                        List<SysUser> sysUserList = sysUserService.list(sysUserQueryWrapper);
+                        if (!CollectionUtils.isEmpty(sysUserList)) {
+                            studentCourseSchedule.setStudentList(sysUserList.stream().map(SysUser::getRealName).collect(Collectors.toList()));
+                        }
+                    }
+                }
+                studentCourseScheduleList.add(studentCourseSchedule);
+            });
+            return studentCourseScheduleList;
+        }
+        return Collections.emptyList();
+    }
+
+    @Override
     public BaseResponse courseInfo(CourseScheduleReq courseScheduleReq) {
 
 
-        if(courseScheduleReq.getCourseScheduleId() == null){
+        if (courseScheduleReq.getCourseScheduleId() == null) {
             return BaseResponse.failParams();
         }
         CourseInfoResp resp = new CourseInfoResp();
         CourseSchedule courseSchedule = this.baseMapper.selectById(courseScheduleReq.getCourseScheduleId());
-        if(courseSchedule != null){
+        if (courseSchedule != null) {
             resp.setCourseName(courseSchedule.getName());
-            resp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate(),DateUtil.DATE_FORMAT));
+            resp.setClassDate(DateUtil.date2String(courseSchedule.getClassDate(), DateUtil.DATE_FORMAT));
             resp.setCourseScheduleId(courseSchedule.getId());
-            resp.setStartClassTime(DateUtil.date2String(courseSchedule.getStartClassTime(),DateUtil.TIME_FORMAT));
-            resp.setEndClassTime(DateUtil.date2String(courseSchedule.getEndClassTime(),DateUtil.TIME_FORMAT));
+            resp.setStartClassTime(DateUtil.date2String(courseSchedule.getStartClassTime(), DateUtil.TIME_FORMAT));
+            resp.setEndClassTime(DateUtil.date2String(courseSchedule.getEndClassTime(), DateUtil.TIME_FORMAT));
             resp.setWeek(DateUtil.date2Week(courseSchedule.getClassDate()));
 
             SysUser sysUser = sysUserService.getById(courseSchedule.getTeacherId());
-            if(sysUser != null){
+            if (sysUser != null) {
                 resp.setRealName(sysUser.getRealName());
             }
             ClassGroup classGroup = groupService.getById(courseSchedule.getClassGroupId());
-            if(classGroup != null){
+            if (classGroup != null) {
                 MusicGroup musicGroup = musicGroupService.getById(courseSchedule.getClassGroupId());
-                if(musicGroup != null && musicGroup.getSchoolId()!= null){
+                if (musicGroup != null && musicGroup.getSchoolId() != null) {
                     School school = schoolService.getById(musicGroup.getSchoolId());
-                    if(school != null){
+                    if (school != null) {
                         resp.setSchoolName(school.getName());
                     }
                 }

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.MusicGroupPaymentCalender;
 import com.ym.mec.education.mapper.MusicGroupPaymentCalenderMapper;
 import com.ym.mec.education.service.IMusicGroupPaymentCalenderService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 44 - 3
mec-education/src/main/java/com/ym/mec/education/utils/DateUtil.java

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 import java.sql.Time;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
+import java.time.LocalTime;
 import java.time.format.DateTimeFormatter;
 import java.util.Calendar;
 import java.util.Date;
@@ -56,6 +57,21 @@ public class DateUtil {
         return format;
     }
 
+    /**
+     * 返回分钟差
+     *
+     * @param time1
+     * @param time2
+     * @return
+     */
+    public static Integer timeDifference(Time time1, Time time2) {
+        LocalTime localTime1 = time1.toLocalTime();
+        LocalTime localTime2 = time2.toLocalTime();
+        Integer hour = localTime2.getHour() - localTime1.getHour();
+        Integer minute = localTime2.getMinute() - localTime1.getMinute();
+        return hour * 60 + minute;
+    }
+
     public static String date2Week(Date date) {
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(date);
@@ -80,8 +96,33 @@ public class DateUtil {
         }
     }
 
+    public static String date2Week2(Date date) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        int i = calendar.get(Calendar.DAY_OF_WEEK);
+        switch (i) {
+            case 1:
+                return "周日";
+            case 2:
+                return "周一";
+            case 3:
+                return "周二";
+            case 4:
+                return "周三";
+            case 5:
+                return "周四";
+            case 6:
+                return "周五";
+            case 7:
+                return "周六";
+            default:
+                return "";
+        }
+    }
+
     /**
      * 获取下个月的第一天
+     *
      * @param date
      * @return
      */
@@ -98,12 +139,12 @@ public class DateUtil {
     }
 
 
-    public static Integer subMin(Date startTime,Date endTime){
+    public static Integer subMin(Date startTime, Date endTime) {
 
-        if(startTime != null && endTime != null){
+        if (startTime != null && endTime != null) {
             long from = startTime.getTime();
             long to = endTime.getTime();
-            Integer hours = (int) ((to - from)/(1000 * 60 * 60));
+            Integer hours = (int) ((to - from) / (1000 * 60 * 60));
 
             return hours;
         }

+ 3 - 0
mec-gateway/mec-gateway-web/src/main/resources/application.yml

@@ -7,8 +7,11 @@ spring:
 
 eureka:
   client:
+    registry-fetch-interval-seconds: 5
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 ribbon:
   eureka:

+ 2 - 0
mec-monitor/src/main/resources/application.yml

@@ -6,6 +6,8 @@ eureka:
     serviceUrl:
       ###配置中心的  用户名:密码@主机ip:端口/应用上下文/地址
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:

+ 0 - 12
mec-student/src/main/java/com/ym/mec/student/StudentApplication.java

@@ -1,21 +1,17 @@
 package com.ym.mec.student;
 
 import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.client.RestTemplate;
 
 import com.spring4all.swagger.EnableSwagger2Doc;
-import com.ym.mec.common.redis.service.RedisCache;
 
 @SpringBootApplication
 @EnableDiscoveryClient
@@ -26,9 +22,6 @@ import com.ym.mec.common.redis.service.RedisCache;
 @EnableSwagger2Doc
 public class StudentApplication {
 
-	@Autowired
-	private RedisTemplate<String, Object> redisTemplate;
-
 	public static void main(String[] args) {
 		SpringApplication.run(StudentApplication.class, args);
 	}
@@ -39,9 +32,4 @@ public class StudentApplication {
 		return new RestTemplate();
 	}
 
-	@Bean
-	@ConditionalOnBean(RedisTemplate.class)
-	public RedisCache<String, Object> redisCache() {
-		return new RedisCache<String, Object>(redisTemplate);
-	}
 }

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

@@ -22,7 +22,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/getMusicGroupRegInfo","/register/add").permitAll().anyRequest().authenticated().and().httpBasic();
+		http.csrf().disable().authorizeRequests().antMatchers("/v2/api-docs", "/register/findSubByMusicGroupId","/register/findGoodsGroups").permitAll().anyRequest().authenticated().and().httpBasic();
 	}
 
 	@Override

+ 9 - 11
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -18,13 +18,8 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
-import javax.xml.soap.Name;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.LinkedHashMap;
@@ -36,7 +31,7 @@ import java.util.Map;
 @RestController
 public class MusicGroupController extends BaseController {
 
-    @Resource
+    @Autowired
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private MusicGroupService musicGroupService;
@@ -48,6 +43,8 @@ public class MusicGroupController extends BaseController {
     private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
     @Autowired
     private GoodsService goodsService;
+    @Autowired
+    private StudentPaymentOrderService studentPaymentOrderService;
 
     @ApiOperation("获取学生所在乐团列表")
     @GetMapping(value = "/queryUserMusicGroups")
@@ -91,12 +88,14 @@ public class MusicGroupController extends BaseController {
     }
 
     @ApiOperation(value = "乐团报名支付")
-    @GetMapping("/pay")
+    @PostMapping("/pay")
     @ApiImplicitParams({@ApiImplicitParam(name = "registerPayDto", value = "支付信息", required = true, dataType = "Integer")})
     public HttpResponseResult pay(@RequestBody RegisterPayDto registerPayDto) {
+
         SysUser sysUser = sysUserFeignService.queryUserInfo();
+        Integer userId = sysUser.getId();
         StudentRegistration studentRegistration = studentRegistrationService.get(registerPayDto.getRegisterId().longValue());
-        if (!studentRegistration.getUserId().equals(sysUser.getId())) {
+        if (!studentRegistration.getUserId().equals(userId)) {
             return failed("报名信息有误,请核查");
         }
 
@@ -121,7 +120,7 @@ public class MusicGroupController extends BaseController {
                 if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {//租赁
                     orderAmount.add(musicOneSubjectClassPlan.getDepositFee());
                 } else if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.GROUP)) {//团购
-                    orderAmount.add(goodsGroup.getPrice()).subtract(goodsGroup.getRemissionCourseFee());
+                    orderAmount.add(goodsGroup.getPrice()).subtract(goodsGroup.getRemissionCourseFee());//团购减免课程费用
                 }
             });
         }
@@ -136,7 +135,6 @@ public class MusicGroupController extends BaseController {
         if (amount.compareTo(orderAmount) != 0) {
             return failed("商品价格不符");
         }
-
         Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
         rqMap.put("merNo", "07654478");
         rqMap.put("version", "v1");

+ 1 - 5
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupRegisterController.java

@@ -42,12 +42,8 @@ public class MusicGroupRegisterController extends BaseController {
 
     @ApiOperation(value = "新增学生报名信息")
     @PostMapping("/add")
-    public Object add(@RequestBody StudentRegistration studentRegistration) {
+    public Object add(StudentRegistration studentRegistration) {
         MusicGroup musicGroup = musicGroupService.get(studentRegistration.getMusicGroupId().toString());
-        StudentRegistration register = studentRegistrationService.getByPhoneAndMusicGroupId(studentRegistration.getMusicGroupId(), studentRegistration.getParentsPhone());
-        if (register != null) {
-            return failed("该乐团您已注册,请勿重复注册");
-        }
         studentRegistration.setOrganId(musicGroup.getOrganId());
         return succeed(studentRegistrationService.addStudent(studentRegistration));
     }

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

@@ -63,7 +63,7 @@ public class StudentCourseScheduleController extends BaseController {
         return succeed(scheduleService.findStudentCourseScheduleRecords(queryInfo));
     }
 
-    @ApiModelProperty("课程投诉")
+    @ApiModelProperty(value = "课程投诉")
     @PostMapping("/courseScheduleCommplaint")
     public Object courseScheduleCommplaint(CourseScheduleComplaints courseScheduleComplaints){
         scheduleService.courseScheduleCommplaint(courseScheduleComplaints);

+ 5 - 5
mec-student/src/main/java/com/ym/mec/student/controller/StudentVipGroupController.java

@@ -33,7 +33,7 @@ public class StudentVipGroupController extends BaseController {
     @Autowired
     private SubjectService subjectService;
 
-    @ApiOperation("获取vip课列表筛选条件")
+    @ApiOperation(value = "获取vip课列表筛选条件")
     @GetMapping(value = "/findQueryCondition")
     public Object findQueryCondition(){
         List<QueryConditionDto> conditions=new ArrayList<>();
@@ -45,7 +45,7 @@ public class StudentVipGroupController extends BaseController {
         return succeed(conditions);
     }
 
-    @ApiOperation("获取vip课列表")
+    @ApiOperation(value = "获取vip课列表")
     @PostMapping(value = "/queryVipGroups")
     public Object queryVipGroups(@RequestBody StudentVipGroupQueryInfo queryInfo){
         Map<String,Object> result=new HashMap<>();
@@ -54,20 +54,20 @@ public class StudentVipGroupController extends BaseController {
         return succeed(result);
     }
 
-    @ApiOperation("获取学生端vip课显示详情")
+    @ApiOperation(value = "获取学生端vip课显示详情")
     @GetMapping(value = "/getVipGroupShowDetail")
     public Object getVipGroupShowDetail(Long vipGroupId){
         return succeed(vipGroupService.getVipGroupShowDetail(vipGroupId));
     }
 
-    @ApiModelProperty("vip课购买")
+    @ApiModelProperty(value = "vip课购买")
     @PostMapping("/buyVipGroup")
     public Object buyVipGroup(VipGroupBuyParamsDto vipGroupBuyParams){
         vipGroupService.buyVipGroup(vipGroupBuyParams);
         return succeed();
     }
 
-    @ApiModelProperty("vip课购买")
+    @ApiModelProperty(value = "vip课退课")
     @PostMapping("/applyRefund")
     public Object applyRefund(Long vipGroupId){
         vipGroupService.applyRefund(vipGroupId,null);

+ 2 - 0
mec-student/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:

+ 2 - 0
mec-task/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:

+ 3 - 13
mec-teacher/src/main/java/com/ym/mec/teacher/TeacherApplication.java

@@ -1,21 +1,18 @@
 package com.ym.mec.teacher;
 
-import com.spring4all.swagger.EnableSwagger2Doc;
-import com.ym.mec.common.redis.service.RedisCache;
 import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.client.RestTemplate;
 
+import com.spring4all.swagger.EnableSwagger2Doc;
+
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
@@ -24,22 +21,15 @@ import org.springframework.web.client.RestTemplate;
 @Configuration
 @EnableSwagger2Doc
 public class TeacherApplication {
+	
 	public static void main(String[] args) {
 		SpringApplication.run(TeacherApplication.class, args);
 	}
 
-	@Autowired
-	private RedisTemplate<String, Object> redisTemplate;
-
 	@Bean
 	@LoadBalanced
 	public RestTemplate restTemplate() {
 		return new RestTemplate();
 	}
 
-	@Bean
-	@ConditionalOnBean(RedisTemplate.class)
-	public RedisCache<String, Object> redisCache() {
-		return new RedisCache<String, Object>(redisTemplate);
-	}
 }

+ 2 - 0
mec-teacher/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:

+ 6 - 48
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/YqPayUtil.java

@@ -2,8 +2,8 @@ package com.ym.mec.thirdparty.yqpay;
 
 import com.alibaba.fastjson.JSON;
 
-import java.math.BigDecimal;
-import java.util.*;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 public class YqPayUtil {
 
@@ -31,6 +31,10 @@ public class YqPayUtil {
         this.requestMap = rqMap;
     }
 
+    public Map<String, Object> getRequestMap() {
+        return this.requestMap;
+    }
+
     //验签
     public static boolean verify(Map<String, Object> rsMap) {
         String sign = (String) rsMap.get("sign");
@@ -43,50 +47,4 @@ public class YqPayUtil {
         }
     }
 
-    /**
-     * 返回订单提交数据
-     * @param amount 金额
-     * @param orderNo 订单编号
-     * @param notifyUrl 异步通知地址
-     * @param returnUrl 支付返回地址
-     * @param orderSubject 订单标题
-     * @param orderBody 订单内容
-     * @return
-     * @throws Exception
-     */
-    public Map getPayMap(BigDecimal amount,String orderNo,String notifyUrl,String returnUrl,String orderSubject,String orderBody) throws Exception {
-
-//        String notifyUrl = ""; //异步通知地址
-//        String returnUrl = ""; //还回地址
-//        String orderBody = "大雅乐盟培训课程";//订单内容
-//        String orderSubject = "培训订单";//订单标题
-//        String orderNo = "2019121263844";//订单编号
-//        BigDecimal amount = new BigDecimal("654369"); //订单金额
-
-        String payUrl = "https://qyfapi.95epay.com/api/api/hPay/toPayHtml";//支付提交地址
-        String payChannels = "{\"weChatPay\":true,\"weChatPayMobile\":false,\"aliPay\":true,\"fastpayXy\":true,\"aliPayMobile\":false,\"balancePay\":false}";//支付方式配置
-
-        List<Map> tempRoutingList = new ArrayList();
-//        Map<String, Object> routingList = new HashMap<>();
-//        routingList.put("routingMerNo", routingAccount.getSellerNo());//分佣账户
-//        routingList.put("routingFee", order.getAmount().subtract((order.getAmount().multiply(new BigDecimal(0.28)).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP))); //分佣金额
-//        tempRoutingList.add(routingList);
-
-        Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
-        resultMap.put("sellerNo", "0021677"); //收款商户号
-        resultMap.put("payChannels", payChannels); //支付方式
-        resultMap.put("orderBody", orderBody); //订单信息
-        resultMap.put("payAmount", amount); //支付金额
-        resultMap.put("apiPayType", "1"); //*API支付类型1-即时支付,2-担保支付,3-预授权支付*/
-        resultMap.put("tradeType", "0"); //*交易类型1—充值,0—收款*
-        resultMap.put("merMerOrderNo", orderNo); //商户订单号
-        resultMap.put("orderSubject", orderSubject); //订单标题
-        resultMap.put("returnUrl", returnUrl); //前台页面地址
-        resultMap.put("tempRoutingList", JSON.toJSONString(tempRoutingList));//分账设置
-        Map rqMap = new YqPayUtil(notifyUrl, resultMap).requestMap;
-        rqMap.put("host", payUrl);
-        return rqMap;
-    }
-
-
 }

+ 0 - 4
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/yqpay/payInfo.java

@@ -1,4 +0,0 @@
-package com.ym.mec.thirdparty.yqpay;
-
-public class payInfo {
-}

+ 0 - 13
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -1,21 +1,17 @@
 package com.ym.mec.web;
 
 import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.cloud.openfeign.EnableFeignClients;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.client.RestTemplate;
 
 import com.spring4all.swagger.EnableSwagger2Doc;
-import com.ym.mec.common.redis.service.RedisCache;
 
 @SpringBootApplication
 @EnableDiscoveryClient
@@ -26,9 +22,6 @@ import com.ym.mec.common.redis.service.RedisCache;
 @EnableSwagger2Doc
 public class WebApplication {
 
-	@Autowired
-	private RedisTemplate<String, Object> redisTemplate;
-	
 	public static void main(String[] args) {
 		SpringApplication.run(WebApplication.class, args);
 	}
@@ -38,10 +31,4 @@ public class WebApplication {
 	public RestTemplate restTemplate() {
 		return new RestTemplate();
 	}
-
-	@Bean
-	@ConditionalOnBean(RedisTemplate.class)
-	public RedisCache<String, Object> redisCache() {
-		return new RedisCache<String, Object>(redisTemplate);
-	}
 }

+ 15 - 17
mec-web/src/main/java/com/ym/mec/web/controller/ClassGroupController.java

@@ -1,22 +1,5 @@
 package com.ym.mec.web.controller;
 
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-import java.util.Date;
-import java.util.List;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
 import com.ym.mec.biz.dal.dto.HighClassGroupDto;
 import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.entity.ClassGroupTeacherMapper;
@@ -24,6 +7,15 @@ import com.ym.mec.biz.service.ClassGroupService;
 import com.ym.mec.biz.service.ClassGroupTeacherMapperService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
 
 @RequestMapping("classGroup")
 @Api(tags = "班级服务")
@@ -98,6 +90,12 @@ public class ClassGroupController extends BaseController {
         return succeed(classGroupService.findAllMixClassGroupByMusicGroupId(musicGroupId));
     }
 
+    @ApiOperation(value = "乐团所有班列表")
+    @GetMapping("/findAllClassGroupByMusicGroup")
+    public Object findAllClassGroupByMusicGroup(@ApiParam(value = "乐团编号", required = true) @RequestParam Long musicGroupId) {
+        return succeed(classGroupService.findAllClassGroupByMusicGroup(musicGroupId));
+    }
+
     @ApiOperation(value = "乐团班级老师设置")
     @GetMapping("/addClassGroupTeacher")
     public Object addClassGroupTeacher(@ApiParam(value = "乐团班级老师json", required = true) @RequestParam List<ClassGroupTeacherMapper> classGroupTeacherMapperList) {

+ 9 - 15
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesCycleController.java

@@ -1,20 +1,17 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesCycle;
+import com.ym.mec.biz.service.VipGroupDefaultClassesCycleService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.Date;
-
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.GetMapping;
 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.biz.dal.entity.VipGroupDefaultClassesCycle;
-import com.ym.mec.biz.service.VipGroupDefaultClassesCycleService;
-import com.ym.mec.common.controller.BaseController;
+import java.util.Date;
 
 @Api(tags = "vip课默认排课周期")
 @RequestMapping("vipGroupDefaultClassesCycle")
@@ -25,29 +22,26 @@ public class VipGroupDefaultClassesCycleController extends BaseController {
 	private VipGroupDefaultClassesCycleService vipGroupDefaultClassesCycleService;
 
 	@ApiOperation("单查询")
-	@GetMapping(value = "/query", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@GetMapping(value = "/query")
 	public Object query(int id) {
 		return succeed(vipGroupDefaultClassesCycleService.get(id));
 	}
 
 	@ApiOperation("全查询")
-	@GetMapping(value = "/queryAll", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@GetMapping(value = "/queryAll")
 	public Object queryAll() {
 		return succeed(vipGroupDefaultClassesCycleService.findAll(null));
 	}
 
 	@ApiOperation("新增")
-	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/add")
 	public Object add(VipGroupDefaultClassesCycle vipGroupDefaultClassesCycle) {
-		Date date = new Date();
-		vipGroupDefaultClassesCycle.setCreateTime(date);
-		vipGroupDefaultClassesCycle.setUpdateTime(date);
 		vipGroupDefaultClassesCycleService.insert(vipGroupDefaultClassesCycle);
 		return succeed();
 	}
 
 	@ApiOperation("修改")
-	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/update")
 	public Object update(VipGroupDefaultClassesCycle vipGroupDefaultClassesCycle) {
 		Date date = new Date();
 		vipGroupDefaultClassesCycle.setUpdateTime(date);
@@ -56,7 +50,7 @@ public class VipGroupDefaultClassesCycleController extends BaseController {
 	}
 
 	@ApiOperation("删除")
-	@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/delete")
 	public Object delete(int id) {
 		vipGroupDefaultClassesCycleService.delete(id);
 		return succeed();

+ 9 - 12
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupDefaultClassesUnitPriceController.java

@@ -1,20 +1,17 @@
 package com.ym.mec.web.controller;
 
+import com.ym.mec.biz.dal.entity.VipGroupDefaultClassesUnitPrice;
+import com.ym.mec.biz.service.VipGroupDefaultClassesUnitPriceService;
+import com.ym.mec.common.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-
-import java.util.Date;
-
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.GetMapping;
 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.biz.dal.entity.VipGroupDefaultClassesUnitPrice;
-import com.ym.mec.biz.service.VipGroupDefaultClassesUnitPriceService;
-import com.ym.mec.common.controller.BaseController;
+import java.util.Date;
 
 @Api(tags = "vip课默认单价")
 @RequestMapping("vipGroupDefaultClassesUnitPrice")
@@ -25,19 +22,19 @@ public class VipGroupDefaultClassesUnitPriceController extends BaseController {
 	private VipGroupDefaultClassesUnitPriceService vipGroupDefaultClassesUnitPriceService;
 
 	@ApiOperation("单查询")
-	@GetMapping(value = "/query", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@GetMapping(value = "/query")
 	public Object query(int id) {
 		return succeed(vipGroupDefaultClassesUnitPriceService.get(id));
 	}
 
 	@ApiOperation("全查询")
-	@GetMapping(value = "/queryAll", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@GetMapping(value = "/queryAll")
 	public Object queryAll() {
 		return succeed(vipGroupDefaultClassesUnitPriceService.findAll(null));
 	}
 
 	@ApiOperation("新增")
-	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/add")
 	public Object add(VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice) {
 		Date date = new Date();
 		vipGroupDefaultClassesUnitPrice.setCreateTime(date);
@@ -47,7 +44,7 @@ public class VipGroupDefaultClassesUnitPriceController extends BaseController {
 	}
 
 	@ApiOperation("修改")
-	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/update")
 	public Object update(VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice) {
 		Date date = new Date();
 		vipGroupDefaultClassesUnitPrice.setUpdateTime(date);
@@ -56,7 +53,7 @@ public class VipGroupDefaultClassesUnitPriceController extends BaseController {
 	}
 
 	@ApiOperation("删除")
-	@PostMapping(value = "/delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PostMapping(value = "/delete")
 	public Object delete(int id) {
 		vipGroupDefaultClassesUnitPriceService.delete(id);
 		return succeed();

+ 2 - 0
mec-web/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   servlet:

+ 16 - 0
mec-workflow/src/main/java/com/ym/mec/workfow/WorkflowApplication.java

@@ -1,12 +1,18 @@
 package com.ym.mec.workfow;
 
+import javax.sql.DataSource;
+
 import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
 
 import com.spring4all.swagger.EnableSwagger2Doc;
 
@@ -18,7 +24,17 @@ import com.spring4all.swagger.EnableSwagger2Doc;
 @Configuration
 @EnableSwagger2Doc
 public class WorkflowApplication {
+
+	@Autowired
+	private DataSource dataSource;
+	
 	public static void main(String[] args) {
 		SpringApplication.run(WorkflowApplication.class, args);
 	}
+
+	@Bean
+	public DataSourceTransactionManager transactionManager(DataSourceProperties properties) {
+		DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(this.dataSource);
+		return transactionManager;
+	}
 }

+ 1 - 1
mec-workflow/src/main/java/com/ym/mec/workfow/controller/flow/OrderController.java

@@ -60,7 +60,7 @@ public class OrderController extends BaseController {
 		return succeed();
 	}
 
-	@GetMapping(value = "json")
+	@GetMapping(value = "detail")
 	@ResponseBody
 	public Object json(String processId, String orderId) {
 		Process process = snakerEngine.process().getProcessById(processId);

+ 8 - 0
mec-workflow/src/main/java/com/ym/mec/workfow/controller/flow/ProcessController.java

@@ -16,19 +16,27 @@ package com.ym.mec.workfow.controller.flow;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
 import org.snaker.engine.SnakerEngine;
 import org.snaker.engine.access.Page;
 import org.snaker.engine.access.QueryFilter;
+import org.snaker.engine.entity.HistoryTask;
 import org.snaker.engine.entity.Process;
+import org.snaker.engine.entity.Task;
+import org.snaker.engine.helper.AssertHelper;
 import org.snaker.engine.helper.StringHelper;
+import org.snaker.engine.model.ProcessModel;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 

+ 51 - 1
mec-workflow/src/main/java/com/ym/mec/workfow/controller/flow/TaskController.java

@@ -9,6 +9,7 @@ import org.apache.commons.lang.StringUtils;
 import org.snaker.engine.SnakerEngine;
 import org.snaker.engine.access.Page;
 import org.snaker.engine.access.QueryFilter;
+import org.snaker.engine.core.AccessService;
 import org.snaker.engine.entity.HistoryOrder;
 import org.snaker.engine.entity.Task;
 import org.snaker.engine.entity.WorkItem;
@@ -39,7 +40,7 @@ public class TaskController extends BaseController {
 	@Autowired
 	private SysUserFeignService SysUserFeignService;
 
-	@GetMapping(value = "queryWaitList")
+	@GetMapping(value = "home")
 	public Object homeTaskList() {
 
 		SysUser user = SysUserFeignService.queryUserInfo();
@@ -70,6 +71,19 @@ public class TaskController extends BaseController {
 		return succeed(model);
 	}
 
+	/**
+	 * 根据当前用户查询待办任务列表
+	 * @param model
+	 * @return
+	 */
+	@GetMapping(value = "queryWaitList")
+	public Object queryWaitList(Page<WorkItem> page) {
+		SysUser user = SysUserFeignService.queryUserInfo();
+
+		snakerEngine.query().getWorkItems(page, new QueryFilter().setOperator(user.getUsername()));
+		return succeed(page);
+	}
+
 	@PostMapping(value = "actor/add")
 	public Object addTaskActor(String orderId, String taskName, String operator) {
 		List<Task> tasks = snakerEngine.query().getActiveTasks(new QueryFilter().setOrderId(orderId));
@@ -105,6 +119,42 @@ public class TaskController extends BaseController {
 	}
 
 	/**
+	 * 活动任务查询列表
+	 * @param model
+	 * @return
+	 */
+	@GetMapping(value = "active/more")
+	public Object activeTaskList(Page<WorkItem> page, Integer taskType) {
+		SysUser user = SysUserFeignService.queryUserInfo();
+
+		List<String> list = new ArrayList<String>();
+		list.add(user.getUsername());
+
+		String[] assignees = new String[list.size()];
+		list.toArray(assignees);
+		snakerEngine.query().getWorkItems(page, new QueryFilter().setOperators(assignees).setTaskType(taskType));
+		return succeed(page);
+	}
+
+	/**
+	 * 活动任务查询列表
+	 * @param model
+	 * @return
+	 */
+	@GetMapping(value = "active/ccmore")
+	public Object activeCCList(Page<HistoryOrder> page) {
+		SysUser user = SysUserFeignService.queryUserInfo();
+
+		List<String> list = new ArrayList<String>();
+		list.add(user.getUsername());
+
+		String[] assignees = new String[list.size()];
+		list.toArray(assignees);
+		snakerEngine.query().getCCWorks(page, new QueryFilter().setOperators(assignees).setState(AccessService.STATE_ACTIVE));
+		return succeed(page);
+	}
+
+	/**
 	 * 活动任务的驳回
 	 * @param model
 	 * @param taskId

+ 20 - 0
mec-workflow/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:
@@ -32,6 +34,24 @@ spring:
     poolPreparedStatements: true
     maxOpenPreparedStatements: 20
     
+  redis:
+    host: 120.26.238.168
+    port: 6379
+    password: ehjinrong
+    database: 0
+    #连接超时时间(毫秒)
+    timeout: 10000
+    jedis:
+      pool:
+        #连接池最大连接数(使用负值表示没有限制)
+        max-active: 10
+        #连接池最大阻塞等待时间(使用负值表示没有限制)
+        max-wait: -1
+        #连接池中的最大空闲连接
+        max-idle: 10
+        #连接池中的最小空闲连接
+        min-idle: 1
+    
 
 mybatis:
     mapperLocations: classpath:config/mybatis/*.xml

+ 2 - 2
mec-workflow/src/main/resources/flows/leave.snaker

@@ -11,8 +11,8 @@
 <transition g="" name="transition3" offset="0,0" to="decision1"/>
 </task>
 <decision displayName="decision1" layout="426,124,-1,-1" name="decision1">
-<transition displayName="&lt;=5天" expr="#days &lt;= 5" g="" name="transition4" offset="0,0" to="end1"/>
-<transition displayName="&gt;5天" expr="#days &gt; 5" g="" name="transition5" offset="0,0" to="approveBoss"/>
+<transition displayName="&lt;=5天" expr="${days} &lt;= 5" g="" name="transition4" offset="0,0" to="end1"/>
+<transition displayName="&gt;5天" expr="${days} &gt; 5" g="" name="transition5" offset="0,0" to="approveBoss"/>
 </decision>
 <task assignee="boss" displayName="总经理审批" layout="404,231,-1,-1" name="approveBoss" performType="ANY">
 <transition g="" name="transition6" offset="0,0" to="end1"/>

+ 3 - 3
mec-workflow/src/main/resources/flows/viprefund.snaker

@@ -4,13 +4,13 @@
 <transition g="" name="transition1" offset="0,0" to="apply"/>
 </start>
 <end displayName="end1" layout="785,160,-1,-1" name="end1"/>
-<task assignee="student" autoExecute="Y" displayName="学生申请" layout="280,158,-1,-1" name="apply" performType="ANY" taskType="Major">
+<task assignee="${student}" autoExecute="Y" displayName="学生申请" layout="280,158,-1,-1" name="apply" performType="ANY" taskType="Major">
 <transition g="" name="transition2" offset="0,0" to="task1"/>
 </task>
-<task assignee="eduTeacher" autoExecute="Y" displayName="教务老师审批" layout="425,157,-1,-1" name="task1" performType="ANY" taskType="Major">
+<task assignee="${eduTeacher}" autoExecute="Y" displayName="教务老师审批" layout="425,157,-1,-1" name="task1" performType="ANY" taskType="Major">
 <transition g="" name="transition3" offset="0,0" to="task2"/>
 </task>
-<task assignee="deptManager" autoExecute="Y" displayName="分部经理审批" layout="598,158,-1,-1" name="task2" performType="ANY" taskType="Major">
+<task assignee="${deptManager}" autoExecute="Y" displayName="分部经理审批" layout="598,158,-1,-1" name="task2" performType="ANY" taskType="Major">
 <transition g="" name="transition4" offset="0,0" to="end1"/>
 </task>
 </process>

+ 2 - 0
mec-zipkin/src/main/resources/application.yml

@@ -5,6 +5,8 @@ eureka:
   client:
     serviceUrl:
       defaultZone: http://admin:admin123@localhost:8761/eureka/eureka/
+    instance: 
+      lease-renewal-interval-in-seconds: 5
 
 spring:
   application:

+ 3 - 3
pom.xml

@@ -68,7 +68,7 @@
 			<dependency>
 				<groupId>com.ym</groupId>
 				<artifactId>mec-client-api</artifactId>
-					<version>1.0</version>
+				<version>1.0</version>
 			</dependency>
 
 			<dependency>
@@ -228,12 +228,12 @@
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-web</artifactId>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-actuator</artifactId>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-test</artifactId>

+ 9 - 1
workflowy/src/main/java/org/snaker/SnakerFlowyApplication.java

@@ -5,10 +5,12 @@ import javax.sql.DataSource;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.datasource.DataSourceTransactionManager;
 
 @SpringBootApplication
 @ComponentScan(basePackages = "org.snaker")
@@ -17,7 +19,7 @@ public class SnakerFlowyApplication {
 
 	@Autowired
 	private DataSource dataSource;
-
+	
 	public static void main(String[] args) {
 		SpringApplication.run(SnakerFlowyApplication.class, args);
 	}
@@ -26,4 +28,10 @@ public class SnakerFlowyApplication {
 	public JdbcTemplate getJdbcTemplate() {
 		return new JdbcTemplate(dataSource);
 	}
+
+	@Bean
+	public DataSourceTransactionManager transactionManager(DataSourceProperties properties) {
+		DataSourceTransactionManager transactionManager = new DataSourceTransactionManager(this.dataSource);
+		return transactionManager;
+	}
 }

+ 1 - 1
workflowy/src/main/java/org/snaker/engine/core/ManagerService.java

@@ -45,7 +45,7 @@ public class ManagerService extends AccessService implements IManagerService {
 		}
 	}
 
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void deleteSurrogate(String id) {
 		Surrogate surrogate = getSurrogate(id);
 		AssertHelper.notNull(surrogate);

+ 13 - 13
workflowy/src/main/java/org/snaker/engine/core/OrderService.java

@@ -44,7 +44,7 @@ public class OrderService extends AccessService implements IOrderService {
 	 * 创建活动实例
 	 * @see org.snaker.engine.core.OrderService#createOrder(Process, String, Map, String, String)
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order createOrder(Process process, String operator, Map<String, Object> args) {
 		return createOrder(process, operator, args, null, null);
 	}
@@ -52,7 +52,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 创建活动实例
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order createOrder(Process process, String operator, Map<String, Object> args, 
 			String parentId, String parentNodeName) {
 		Order order = new Order();
@@ -88,7 +88,7 @@ public class OrderService extends AccessService implements IOrderService {
      * @param orderId 实例id
      * @param args 变量数据
      */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public void addVariable(String orderId, Map<String, Object> args) {
         Order order = access().getOrder(orderId);
         Map<String, Object> data = order.getVariableMap();
@@ -100,7 +100,7 @@ public class OrderService extends AccessService implements IOrderService {
     /**
 	 * 创建实例的抄送
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void createCCOrder(String orderId, String creator, String... actorIds) {
 		for(String actorId : actorIds) {
 			CCOrder ccorder = new CCOrder();
@@ -116,7 +116,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 流程实例数据会保存至活动实例表、历史实例表
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void saveOrder(Order order) {
 		HistoryOrder history = new HistoryOrder(order);
 		history.setOrderState(STATE_ACTIVE);
@@ -127,7 +127,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 更新活动实例的last_Updator、last_Update_Time、expire_Time、version、variable
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void updateOrder(Order order) {
 		access().updateOrder(order);
 	}
@@ -135,7 +135,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 更新抄送记录状态为已阅
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void updateCCStatus(String orderId, String... actorIds) {
         List<CCOrder> ccorders = access().getCCOrder(orderId, actorIds);
         AssertHelper.notNull(ccorders);
@@ -149,7 +149,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 删除指定的抄送记录
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void deleteCCOrder(String orderId, String actorId) {
         List<CCOrder> ccorders = access().getCCOrder(orderId, actorId);
 		AssertHelper.notNull(ccorders);
@@ -161,7 +161,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 删除活动流程实例数据,更新历史流程实例的状态、结束时间
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void complete(String orderId) {
 		Order order = access().getOrder(orderId);
 		HistoryOrder history = access().getHistOrder(orderId);
@@ -180,7 +180,7 @@ public class OrderService extends AccessService implements IOrderService {
 	 * 强制中止流程实例
 	 * @see org.snaker.engine.core.OrderService#terminate(String, String)
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void terminate(String orderId) {
 		terminate(orderId, null);
 	}
@@ -188,7 +188,7 @@ public class OrderService extends AccessService implements IOrderService {
 	/**
 	 * 强制中止活动实例,并强制完成活动任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void terminate(String orderId, String operator) {
 		SnakerEngine engine = ServiceContext.getEngine();
 		List<Task> tasks = engine
@@ -215,7 +215,7 @@ public class OrderService extends AccessService implements IOrderService {
      * @param orderId 实例id
      * @return 活动实例对象
      */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public Order resume(String orderId) {
         HistoryOrder historyOrder = access().getHistOrder(orderId);
         Order order = historyOrder.undo();
@@ -241,7 +241,7 @@ public class OrderService extends AccessService implements IOrderService {
 	 * 4.wf_cc_order
 	 * @param id 实例id
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void cascadeRemove(String id) {
 		HistoryOrder historyOrder = access().getHistOrder(id);
 		AssertHelper.notNull(historyOrder);

+ 7 - 7
workflowy/src/main/java/org/snaker/engine/core/ProcessService.java

@@ -81,7 +81,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	/**
 	 * 保存process实体对象
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void saveProcess(Process process) {
 		access().saveProcess(process);
 	}
@@ -89,7 +89,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	/**
 	 * 更新process的类别
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void updateType(String id, String type) {
         Process entity = getProcessById(id);
         entity.setType(type);
@@ -177,7 +177,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	 * 根据流程定义xml的输入流解析为字节数组,保存至数据库中,并且put到缓存中
 	 * @param input 定义输入流
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public String deploy(InputStream input) {
 		return deploy(input, null);
 	}
@@ -187,7 +187,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	 * @param input 定义输入流
 	 * @param creator 创建人
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public String deploy(InputStream input, String creator) {
 		AssertHelper.notNull(input);
 		try {
@@ -219,7 +219,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	 * 根据流程定义id、xml的输入流解析为字节数组,保存至数据库中,并且重新put到缓存中
 	 * @param input 定义输入流
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void redeploy(String id, InputStream input) {
 		AssertHelper.notNull(input);
 		Process entity = access().getProcess(id);
@@ -248,7 +248,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	/**
 	 * 根据processId卸载流程
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void undeploy(String id) {
 		Process entity = access().getProcess(id);
 		entity.setState(STATE_FINISH);
@@ -259,7 +259,7 @@ public class ProcessService extends AccessService implements IProcessService, Ca
 	/**
 	 * 级联删除指定流程定义的所有数据
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void cascadeRemove(String id) {
 		Process entity = access().getProcess(id);
 		List<HistoryOrder> historyOrders = access().getHistoryOrders(null, new QueryFilter().setProcessId(id));

+ 16 - 16
workflowy/src/main/java/org/snaker/engine/core/SnakerEngineImpl.java

@@ -124,7 +124,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据流程定义ID启动流程实例
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceById(String id) {
 		return startInstanceById(id, null, null);
 	}
@@ -132,7 +132,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据流程定义ID,操作人ID启动流程实例
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceById(String id, String operator) {
 		return startInstanceById(id, operator, null);
 	}
@@ -140,7 +140,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据流程定义ID,操作人ID,参数列表启动流程实例
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceById(String id, String operator, Map<String, Object> args) {
 		if(args == null) args = new HashMap<String, Object>();
 		Process process = process().getProcessById(id);
@@ -152,7 +152,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * 根据流程名称启动流程实例
 	 * @since 1.3
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceByName(String name) {
 		return startInstanceByName(name, null, null, null);
 	}
@@ -161,7 +161,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * 根据流程名称、版本号启动流程实例
 	 * @since 1.3
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceByName(String name, Integer version) {
 		return startInstanceByName(name, version, null, null);
 	}
@@ -170,7 +170,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * 根据流程名称、版本号、操作人启动流程实例
 	 * @since 1.3
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceByName(String name, Integer version,
 			String operator) {
 		return startInstanceByName(name, version, operator, null);
@@ -180,7 +180,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * 根据流程名称、版本号、操作人、参数列表启动流程实例
 	 * @since 1.3
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceByName(String name, Integer version,
 			String operator, Map<String, Object> args) {
 		if(args == null) args = new HashMap<String, Object>();
@@ -189,7 +189,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 		return startProcess(process, operator, args);
 	}
 
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	private Order startProcess(Process process, String operator, Map<String, Object> args) {
 		Execution execution = execute(process, operator, args, null, null);
 		if(process.getModel() != null) {
@@ -204,7 +204,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据父执行对象启动子流程实例(用于启动子流程)
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Order startInstanceByExecution(Execution execution) {
 		Process process = execution.getProcess();
 		StartModel start = process.getModel().getStart();
@@ -225,7 +225,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * @param parentNodeName 启动子流程的父流程节点名称
 	 * @return Execution
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	private Execution execute(Process process, String operator, Map<String, Object> args, 
 			String parentId, String parentNodeName) {
 		Order order = order().createOrder(process, operator, args, parentId, parentNodeName);
@@ -240,7 +240,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据任务主键ID执行任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> executeTask(String taskId) {
 		return executeTask(taskId, null);
 	}
@@ -248,7 +248,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据任务主键ID,操作人ID执行任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> executeTask(String taskId, String operator) {
 		return executeTask(taskId, operator, null);
 	}
@@ -256,7 +256,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据任务主键ID,操作人ID,参数列表执行任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> executeTask(String taskId, String operator, Map<String, Object> args) {
 		//完成任务,并且构造执行对象
 		Execution execution = execute(taskId, operator, args);
@@ -275,7 +275,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * 1、nodeName为null时,则驳回至上一步处理
 	 * 2、nodeName不为null时,则任意跳转,即动态创建转移
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> executeAndJumpTask(String taskId, String operator, Map<String, Object> args, String nodeName) {
 		Execution execution = execute(taskId, operator, args);
 		if(execution == null) return Collections.emptyList();
@@ -300,7 +300,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	/**
 	 * 根据流程实例ID,操作人ID,参数列表按照节点模型model创建新的自由任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> createFreeTask(String orderId, String operator, Map<String, Object> args, TaskModel model) {
 		Order order = query().getOrder(orderId);
 		AssertHelper.notNull(order, "指定的流程实例[id=" + orderId + "]已完成或不存在");
@@ -319,7 +319,7 @@ public class SnakerEngineImpl implements SnakerEngine {
 	 * @param args 参数列表
 	 * @return Execution
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	private Execution execute(String taskId, String operator, Map<String, Object> args) {
 		if(args == null) args = new HashMap<String, Object>();
 		Task task = task().complete(taskId, operator, args);

+ 17 - 17
workflowy/src/main/java/org/snaker/engine/core/TaskService.java

@@ -48,7 +48,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 完成指定任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Task complete(String taskId) {
 		return complete(taskId, null, null);
 	}
@@ -56,7 +56,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 完成指定任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Task complete(String taskId, String operator) {
 		return complete(taskId, operator, null);
 	}
@@ -66,7 +66,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * 该方法仅仅结束活动任务,并不能驱动流程继续执行
 	 * @see SnakerEngineImpl#executeTask(String, String, java.util.Map)
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Task complete(String taskId, String operator, Map<String, Object> args) {
 		Task task = access().getTask(taskId);
 		AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在");
@@ -99,7 +99,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * 更新任务对象的finish_Time、operator、expire_Time、version、variable
 	 * @param task 任务对象
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void updateTask(Task task) {
 		access().updateTask(task);
 	}
@@ -110,7 +110,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * @param model 自定义节点模型
 	 * @return 历史任务对象
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public HistoryTask history(Execution execution, CustomModel model) {
 		HistoryTask historyTask = new HistoryTask();
 		historyTask.setId(StringHelper.getPrimaryKey());
@@ -132,7 +132,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 提取指定任务,设置完成时间及操作人,状态不改变
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Task take(String taskId, String operator) {
 		Task task = access().getTask(taskId);
 		AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在");
@@ -148,7 +148,7 @@ public class TaskService extends AccessService implements ITaskService {
     /**
      * 唤醒指定的历史任务
      */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
     public Task resume(String taskId, String operator) {
         HistoryTask histTask = access().getHistTask(taskId);
         AssertHelper.notNull(histTask, "指定的历史任务[id=" + taskId + "]不存在");
@@ -171,7 +171,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 向指定任务添加参与者
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void addTaskActor(String taskId, String... actors) {
 		addTaskActor(taskId, null, actors);
 	}
@@ -180,7 +180,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * 向指定任务添加参与者
 	 * 该方法根据performType类型判断是否需要创建新的活动任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void addTaskActor(String taskId, Integer performType, String... actors) {
 		Task task = access().getTask(taskId);
 		AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在");
@@ -221,7 +221,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 向指定任务移除参与者
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public void removeTaskActor(String taskId, String... actors) {
 		Task task = access().getTask(taskId);
 		AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在");
@@ -257,7 +257,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 撤回指定的任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Task withdrawTask(String taskId, String operator) {
 		HistoryTask hist = access().getHistTask(taskId);
 		AssertHelper.notNull(hist, "指定的历史任务[id=" + taskId + "]不存在");
@@ -286,7 +286,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 驳回任务
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public Task rejectTask(ProcessModel model, Task currentTask) {
 		String parentTaskId = currentTask.getParentTaskId();
 		if(StringHelper.isEmpty(parentTaskId) || parentTaskId.equals(START)) {
@@ -313,7 +313,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * @param taskId 任务id
 	 * @param actorIds 参与者id集合
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	private void assignTask(String taskId, String... actorIds) {
 		if(actorIds == null || actorIds.length == 0) return;
 		for(String actorId : actorIds) {
@@ -330,7 +330,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * 根据已有任务、任务类型、参与者创建新的任务
 	 * 适用于转派,动态协办处理
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> createNewTask(String taskId, int taskType, String... actors) {
 		Task task = access().getTask(taskId);
 		AssertHelper.notNull(task, "指定的任务[id=" + taskId + "]不存在");
@@ -374,7 +374,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * @param execution 执行对象
 	 * @return List<Task> 任务列表
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	public List<Task> createTask(TaskModel taskModel, Execution execution) {
 		List<Task> tasks = new ArrayList<Task>();
 		
@@ -421,7 +421,7 @@ public class TaskService extends AccessService implements ITaskService {
 	 * @param execution 执行对象
 	 * @return Task任务对象
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	private Task createTaskBase(TaskModel model, Execution execution) {
 		Task task = new Task();
 		task.setOrderId(execution.getOrder().getId());
@@ -442,7 +442,7 @@ public class TaskService extends AccessService implements ITaskService {
 	/**
 	 * 由DBAccess实现类持久化task对象
 	 */
-	@Transactional(propagation = Propagation.REQUIRED, noRollbackFor = Exception.class)
+	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
 	private Task saveTask(Task task, String... actors) {
 		task.setId(StringHelper.getPrimaryKey());
 		task.setPerformType(PerformType.ANY.ordinal());

+ 0 - 5
workflowy/src/main/java/org/snaker/engine/model/NodeModel.java

@@ -26,8 +26,6 @@ import org.snaker.engine.core.Execution;
 import org.snaker.engine.helper.ClassHelper;
 import org.snaker.engine.helper.StringHelper;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
 /**
  * 节点元素(存在输入输出的变迁)
  * @author yuqs
@@ -42,12 +40,10 @@ public abstract class NodeModel extends BaseModel implements Action {
 	/**
 	 * 输入变迁集合
 	 */
-	@JsonIgnore
 	private List<TransitionModel> inputs = new ArrayList<TransitionModel>();
 	/**
 	 * 输出变迁集合
 	 */
-	@JsonIgnore
 	private List<TransitionModel> outputs = new ArrayList<TransitionModel>();
 	/**
 	 * layout
@@ -141,7 +137,6 @@ public abstract class NodeModel extends BaseModel implements Action {
 		return result;
 	}
 
-	@JsonIgnore
     public <T> List<T> getNextModels(Class<T> clazz) {
         List<T> models = new ArrayList<T>();
         for(TransitionModel tm : this.getOutputs()) {

+ 4 - 0
workflowy/src/main/java/org/snaker/engine/model/ProcessModel.java

@@ -22,6 +22,8 @@ import org.snaker.engine.helper.ClassHelper;
 import org.snaker.engine.helper.StringHelper;
 import org.snaker.engine.impl.DefaultNoGenerator;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
 /**
  * 流程定义process元素
  * @author yuqs
@@ -36,6 +38,8 @@ public class ProcessModel extends BaseModel {
 	 * 节点元素集合
 	 */
 	private List<NodeModel> nodes = new ArrayList<NodeModel>();
+	
+	@JsonIgnore
     private List<TaskModel> taskModels = new ArrayList<TaskModel>();
 	/**
 	 * 流程实例启动url

+ 3 - 0
workflowy/src/main/java/org/snaker/engine/model/TaskModel.java

@@ -22,6 +22,8 @@ import org.snaker.engine.helper.ClassHelper;
 import org.snaker.engine.helper.StringHelper;
 import org.snaker.engine.scheduling.JobCallback;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -246,6 +248,7 @@ public class TaskModel extends WorkModel {
      * @return 模型集合
      * @deprecated
      */
+    @JsonIgnore
     public List<TaskModel> getNextTaskModels() {
         List<TaskModel> models = new ArrayList<TaskModel>();
         for(TransitionModel tm : this.getOutputs()) {