Browse Source

Merge branch 'master' into feature-goods-river

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
周箭河 5 years ago
parent
commit
30b081a095
48 changed files with 1056 additions and 519 deletions
  1. 1 1
      cms/src/main/resources/logback-spring.xml
  2. 1 1
      mec-auth/mec-auth-server/src/main/resources/logback-spring.xml
  3. 3 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GroupDao.java
  4. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SporadicChargeInfoDao.java
  5. 8 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/dao/TeacherDao.java
  6. 40 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java
  7. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SuperClassGroupDto.java
  8. 24 2
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Group.java
  9. 11 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java
  10. 12 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java
  11. 10 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/entity/VipGroupActivity.java
  12. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/dal/enums/OrderTypeEnum.java
  13. 103 10
      mec-biz/src/main/java/com/ym/mec/biz/dal/page/EndCourseScheduleQueryInfo.java
  14. 29 0
      mec-biz/src/main/java/com/ym/mec/biz/service/PayService.java
  15. 2 0
      mec-biz/src/main/java/com/ym/mec/biz/service/SporadicChargeInfoService.java
  16. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/UploadFileService.java
  17. 2 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java
  18. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java
  19. 35 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleServiceImpl.java
  20. 344 343
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
  21. 101 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java
  22. 9 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java
  23. 4 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentAttendanceServiceImpl.java
  24. 3 0
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderDetailServiceImpl.java
  25. 1 1
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentOrderServiceImpl.java
  26. 50 54
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java
  27. 3 3
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/VipGroupServiceImpl.java
  28. 4 4
      mec-biz/src/main/resources/config/contracts/goods.ftl
  29. 17 2
      mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml
  30. 35 3
      mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml
  31. 29 4
      mec-biz/src/main/resources/config/mybatis/GroupMapper.xml
  32. 10 2
      mec-biz/src/main/resources/config/mybatis/SporadicChargeInfo.xml
  33. 4 5
      mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml
  34. 11 0
      mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml
  35. 6 1
      mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml
  36. 2 1
      mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java
  37. 4 1
      mec-gateway/mec-gateway-web/src/main/resources/application.yml
  38. 1 1
      mec-gateway/mec-gateway-web/src/main/resources/logback-spring.xml
  39. 1 1
      mec-im/src/main/resources/logback-spring.xml
  40. 1 0
      mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java
  41. 83 59
      mec-student/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java
  42. 4 1
      mec-student/src/main/resources/application.yml
  43. 1 1
      mec-student/src/main/resources/logback-spring.xml
  44. 1 1
      mec-task/src/main/resources/logback-spring.xml
  45. 22 0
      mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java
  46. 1 1
      mec-teacher/src/main/resources/logback-spring.xml
  47. 6 0
      mec-web/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java
  48. 1 1
      mec-web/src/main/resources/logback-spring.xml

+ 1 - 1
cms/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/cms-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/cms-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

+ 1 - 1
mec-auth/mec-auth-server/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/auth-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/auth-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

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

@@ -4,6 +4,7 @@ import com.ym.mec.biz.dal.entity.Group;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author Joburgess
@@ -15,10 +16,10 @@ public interface GroupDao {
      * @describe 搜索团体
      * @author Joburgess
      * @date 2019/12/30
-     * @param search: 关键字
+     * @param params: 查询参数
      * @return java.util.List<com.ym.mec.biz.dal.entity.Group>
      */
-    List<Group> searchGroups(@Param("search") String search);
+    List<Group> searchGroups(Map<String, Object> params);
 
     /**
      * @describe 根据团体编号获取团体

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

@@ -8,4 +8,6 @@ import java.util.List;
 
 public interface SporadicChargeInfoDao extends BaseDAO<Integer, SporadicChargeInfo> {
     SporadicChargeInfo findInfoById(@Param("id") Integer id);
+
+    SporadicChargeInfo findByOrganIdAndType(@Param("organId") Integer organId, @Param("chargeType") Integer chargeType);
 }

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

@@ -223,5 +223,12 @@ public interface TeacherDao extends BaseDAO<Integer, Teacher> {
      */
     List<Map<Integer, String>> queryUsernameByIds(@Param("userIds") List<Integer> userIds);
 
-
+    /**
+     * @describe 教师搜索
+     * @author Joburgess
+     * @date 2020/1/7
+     * @param params: 搜索参数
+     * @return java.util.List<com.ym.mec.biz.dal.entity.Teacher>
+     */
+    List<TeacherBasicDto> searchTeachers(Map<String, Object> params);
 }

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseScheduleEndDto.java

@@ -12,6 +12,46 @@ public class CourseScheduleEndDto extends CourseSchedule {
 
     private String teacherName;
 
+    private String organName;
+
+    private int isSignIn;
+
+    private int isSignOut;
+
+    private int isCallNames;
+
+    public int getIsSignIn() {
+        return isSignIn;
+    }
+
+    public void setIsSignIn(int isSignIn) {
+        this.isSignIn = isSignIn;
+    }
+
+    public int getIsSignOut() {
+        return isSignOut;
+    }
+
+    public void setIsSignOut(int isSignOut) {
+        this.isSignOut = isSignOut;
+    }
+
+    public int getIsCallNames() {
+        return isCallNames;
+    }
+
+    public void setIsCallNames(int isCallNames) {
+        this.isCallNames = isCallNames;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getTeacherName() {
         return teacherName;
     }

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/SuperClassGroupDto.java

@@ -14,6 +14,16 @@ public class SuperClassGroupDto extends ClassGroup {
 
     private String teachingTeacherNames;
 
+    private String organName;
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getBishopTeacherNames() {
         return bishopTeacherNames;
     }

+ 24 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/Group.java

@@ -11,10 +11,16 @@ public class Group {
     @ApiModelProperty(value = "编号")
     private String id;
 
-    @ApiModelProperty(value = "名称")
+    @ApiModelProperty(value = "部门编号")
+    private Integer organId;
+
+    @ApiModelProperty(value = "部门名称")
+    private String organName;
+
+    @ApiModelProperty(value = "团体名称")
     private String groupName;
 
-    @ApiModelProperty(value = "类型")
+    @ApiModelProperty(value = "团体类型")
     private GroupType groupType;
 
     public Group() {
@@ -25,6 +31,22 @@ public class Group {
         this.groupType = groupType;
     }
 
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
     public String getId() {
         return id;
     }

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/SporadicChargeInfo.java

@@ -24,6 +24,9 @@ public class SporadicChargeInfo {
 
 	private BigDecimal amount;
 
+	//优惠金额
+	private BigDecimal discountAmount;
+
 	private BigDecimal balance;
 
 	private Integer userId;
@@ -165,4 +168,12 @@ public class SporadicChargeInfo {
 	public void setOperatorId(Integer operatorId) {
 		this.operatorId = operatorId;
 	}
+
+	public BigDecimal getDiscountAmount() {
+		return discountAmount;
+	}
+
+	public void setDiscountAmount(BigDecimal discountAmount) {
+		this.discountAmount = discountAmount;
+	}
 }

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRegistration.java

@@ -11,6 +11,7 @@ import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.KitPurchaseMethodEnum;
 import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.entity.CooperationOrgan.OwnershipType;
 
 /**
  * 对应数据库表(student_registration):
@@ -109,6 +110,9 @@ public class StudentRegistration {
 
     private BigDecimal depositFee;
 
+    //乐团
+    private OwnershipType ownershipType;
+
     public BigDecimal getBalance() {
         return balance;
     }
@@ -371,4 +375,12 @@ public class StudentRegistration {
     public void setDepositFee(BigDecimal depositFee) {
         this.depositFee = depositFee;
     }
+
+    public OwnershipType getOwnershipType() {
+        return ownershipType;
+    }
+
+    public void setOwnershipType(OwnershipType ownershipType) {
+        this.ownershipType = ownershipType;
+    }
 }

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

@@ -49,6 +49,8 @@ public class VipGroupActivity {
 	
 	/** 薪水只读标识(1-只读 0-可写) */
 	private String salaryReadonlyFlag;
+
+	private String paymentReadonlyFlag;
 	
 	/** 赠送课时支付薪水标识(1-计课酬  0-不计课酬) */
 	private String giveClassPaySalaryFlag;
@@ -68,6 +70,14 @@ public class VipGroupActivity {
 
 	private Integer enable;
 
+	public String getPaymentReadonlyFlag() {
+		return paymentReadonlyFlag;
+	}
+
+	public void setPaymentReadonlyFlag(String paymentReadonlyFlag) {
+		this.paymentReadonlyFlag = paymentReadonlyFlag;
+	}
+
 	public Integer getEnable() {
 		return enable;
 	}

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

@@ -10,7 +10,8 @@ public enum OrderTypeEnum implements BaseEnum<String, OrderTypeEnum> {
 	RENEW("RENEW", "续费"),
 	SPORADIC("SPORADIC", "零星收费"),
 	OTHER("OTHER", "其他"),
-	SMALL_CLASS_TO_BUY("SMALL_CLASS_TO_BUY", "小课购买");
+	SMALL_CLASS_TO_BUY("SMALL_CLASS_TO_BUY", "小课购买"),
+	LUCK("LUCK", "福袋活动");
 
 	private String code;
 

+ 103 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/page/EndCourseScheduleQueryInfo.java

@@ -1,15 +1,23 @@
 package com.ym.mec.biz.dal.page;
 
+import com.ym.mec.biz.dal.entity.CourseSchedule;
+import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
+import com.ym.mec.biz.dal.enums.CourseStatusEnum;
 import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.Date;
+
 /**
  * @Author Joburgess
  * @Date 2019/12/27
  */
 public class EndCourseScheduleQueryInfo extends QueryInfo {
 
+    @ApiModelProperty(value = "部门编号列表")
+    private String organIdList;
+
     @ApiModelProperty(value = "团体类型")
     private GroupType groupType;
 
@@ -20,25 +28,110 @@ public class EndCourseScheduleQueryInfo extends QueryInfo {
     private Integer classGroupId;
 
     @ApiModelProperty(value = "学生编号")
-    private Integer studentId;
+    private String studentIdList;
+
+    @ApiModelProperty(value = "学生名称")
+    private String studentName;
 
     @ApiModelProperty(value = "教师编号")
-    private Integer teacherId;
+    private String teacherIdList;
+
+    @ApiModelProperty(value = "教师名称")
+    private String teacherName;
+
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "课程状态")
+    private CourseStatusEnum courseStatus;
+
+    @ApiModelProperty(value = "课程类型")
+    private CourseSchedule.CourseScheduleType courseType;
+
+    @ApiModelProperty(value = "班级类型")
+    private ClassGroupTypeEnum classGroupType;
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public ClassGroupTypeEnum getClassGroupType() {
+        return classGroupType;
+    }
+
+    public void setClassGroupType(ClassGroupTypeEnum classGroupType) {
+        this.classGroupType = classGroupType;
+    }
+
+    public CourseStatusEnum getCourseStatus() {
+        return courseStatus;
+    }
+
+    public void setCourseStatus(CourseStatusEnum courseStatus) {
+        this.courseStatus = courseStatus;
+    }
+
+    public CourseSchedule.CourseScheduleType getCourseType() {
+        return courseType;
+    }
+
+    public void setCourseType(CourseSchedule.CourseScheduleType courseType) {
+        this.courseType = courseType;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getOrganIdList() {
+        return organIdList;
+    }
+
+    public void setOrganIdList(String organIdList) {
+        this.organIdList = organIdList;
+    }
 
-    public Integer getStudentId() {
-        return studentId;
+    public String getStudentIdList() {
+        return studentIdList;
     }
 
-    public void setStudentId(Integer studentId) {
-        this.studentId = studentId;
+    public void setStudentIdList(String studentIdList) {
+        this.studentIdList = studentIdList;
     }
 
-    public Integer getTeacherId() {
-        return teacherId;
+    public String getTeacherIdList() {
+        return teacherIdList;
     }
 
-    public void setTeacherId(Integer teacherId) {
-        this.teacherId = teacherId;
+    public void setTeacherIdList(String teacherIdList) {
+        this.teacherIdList = teacherIdList;
     }
 
     public GroupType getGroupType() {

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/PayService.java

@@ -35,8 +35,37 @@ public interface PayService {
     Map<String, Object> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, Integer userId) throws Exception;
 
 
+    /**
+     *
+     * @param amount BigDecimal 支付金额
+     * @param orderNo String 订单号
+     * @param notifyUrl String 异步通知地址
+     * @param returnUrl string 支付返回地址
+     * @param orderSubject String 订单标题
+     * @param orderBody String 订单内容
+     * @param userId int 用户id
+     * @param fee 各种费用
+     * @param organId 机构id
+     * @return
+     * @throws Exception
+     */
     Map<String, Object> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, Integer userId,Map<String,BigDecimal> fee,Integer organId) throws Exception;
 
+    /**
+     *
+     * @param amount BigDecimal 支付金额
+     * @param orderNo String 订单号
+     * @param notifyUrl String 异步通知地址
+     * @param returnUrl string 支付返回地址
+     * @param orderSubject String 订单标题
+     * @param orderBody String 订单内容
+     * @param userId int 用户id
+     * @param fee Map 各种费用
+     * @param organId int 机构id
+     * @return
+     * @throws Exception
+     */
+    Map<String, Object> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, Integer userId,Map<String,BigDecimal> fee,Integer organId,String receiver) throws Exception;
 
     Map query(String orderNo) throws Exception;
 

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

@@ -27,4 +27,6 @@ public interface SporadicChargeInfoService extends BaseService<Integer, Sporadic
      * @return
      */
     SporadicChargeInfo getDetail(Integer id);
+
+    SporadicChargeInfo findByOrganIdAndType(Integer organId,Integer type);
 }

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

@@ -62,7 +62,7 @@ public class UploadFileService {
 		File file = uploadFile(in, filePath, fileName);
 		if (maxSize > 0 && maxSize < file.length() / 1024) {
 			FileUtils.deleteQuietly(file);
-			uploadReturn.setMessage("超出允许的大小(50M)限制");
+			uploadReturn.setMessage("超出允许的大小(" + (maxSize / 1024) + "M)限制");
 			return uploadReturn;
 		}
 

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

@@ -2226,7 +2226,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         MapUtil.populateMap(params, queryInfo);
 
         if(StringUtils.isNotBlank(queryInfo.getSearch())){
-            List<Group> groups = groupDao.searchGroups(queryInfo.getSearch());
+            List<Group> groups = groupDao.searchGroups(params);
             if(!CollectionUtils.isEmpty(groups)){
                 params.put("groups", groups);
             }
@@ -2263,6 +2263,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                     List<Group> groupTemps = groupsTypeMap.get(result.getGroupType());
                     if(!CollectionUtils.isEmpty(groupTemps)){
                         result.setGroupName(groupTemps.get(0).getGroupName());
+                        result.setOrganName(groupTemps.get(0).getOrganName());
                     }
                 }
                 Map<TeachTypeEnum, List<ClassGroupTeacherMapDto>> teachTypeEnumListMap = classTeacherTypeMaps.get(result.getId());

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

@@ -407,7 +407,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
 		// 课程费用
 		StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(userId, musicGroupId);
 		if (studentRegistration == null) {
-			throw new BizException("用户 报名信息不存在");
+			throw new BizException("用户报名信息不存在");
 		}
 		MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeDao.findByUser(userId, musicGroupId);
 		if (musicGroupStudentFee == null) {

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

@@ -712,10 +712,10 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         for (CourseSchedule newCourseSchedule : courseSchedules) {
             exitNode:
             for (CourseSchedule existCourseSchedule : existCourseSchedules) {
-                if (newCourseSchedule.getEndClassTime().before(existCourseSchedule.getStartClassTime())) {
+                if(newCourseSchedule.getEndClassTime().compareTo(existCourseSchedule.getStartClassTime()) <= 0){
                     continue newNode;
                 }
-                if (existCourseSchedule.getEndClassTime().before(newCourseSchedule.getStartClassTime())) {
+                if(existCourseSchedule.getEndClassTime().compareTo(newCourseSchedule.getStartClassTime()) <= 0){
                     continue exitNode;
                 }
 
@@ -2157,10 +2157,14 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
         Map<String, Object> params = new HashMap<>(16);
         MapUtil.populateMap(params, queryInfo);
 
-        if(StringUtils.isNotBlank(queryInfo.getSearch())){
-            List<Group> groups = groupDao.searchGroups(queryInfo.getSearch());
+        if(StringUtils.isNotBlank(queryInfo.getSearch())||StringUtils.isNotBlank(queryInfo.getOrganIdList())){
+            List<Group> groups = groupDao.searchGroups(params);
             if(!CollectionUtils.isEmpty(groups)){
                 params.put("groups", groups);
+            }else{
+                if(StringUtils.isNotBlank(queryInfo.getOrganIdList())){
+                    return pageInfo;
+                }
             }
             List<Integer> studentCourseIds=courseScheduleDao.findCourseIdsByStudent(queryInfo.getSearch());
             List<Integer> teacherCourseIds=courseScheduleDao.findCourseIdsByTeacher(queryInfo.getSearch());
@@ -2170,12 +2174,25 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             }
         }
 
+        if(StringUtils.isNotBlank(queryInfo.getTeacherName())){
+            List<TeacherBasicDto> teachers = teacherDao.searchTeachers(params);
+            if(!CollectionUtils.isEmpty(teachers)){
+                List<Integer> teacherIds = teachers.stream().map(TeacherBasicDto::getId).collect(Collectors.toList());
+                params.put("teacherIdList",StringUtils.join(teacherIds.toArray(),","));
+            }
+        }
+
         List<CourseScheduleEndDto> results = new ArrayList<>();
         int count = courseScheduleDao.endCountCourseSchedules(params);
         if (count > 0) {
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             results = courseScheduleDao.endFindCourseSchedules(params);
+            List<Long> courseScheduleIds = results.stream().map(CourseScheduleEndDto::getId).collect(Collectors.toList());
+            List<TeacherAttendance> teacherAttendances = teacherAttendanceDao.findTeacherIdByCourseSchedule(courseScheduleIds);
+            Map<Long, List<TeacherAttendance>> courseTeacherAttendanceMap = teacherAttendances.stream().collect(Collectors.groupingBy(TeacherAttendance::getCourseScheduleId));
+            List<Map<Integer, Integer>> studentNumCourseMaps = studentAttendanceDao.countStudentAttendancesByCourses(courseScheduleIds);
+            Map<Integer, Long> studentNumCourseMap = MapUtil.convertIntegerMap(studentNumCourseMaps);
             List<Group> groups=new ArrayList<>();
             groups.add(null);
             List<Integer> teacherIds=new ArrayList<>();
@@ -2190,13 +2207,27 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
             Map<String, Map<GroupType, List<Group>>> groupsGroupByGroup = groups.stream().collect(Collectors.groupingBy(Group::getId, Collectors.groupingBy(Group::getGroupType)));
             results.forEach(result -> {
                 Map<GroupType, List<Group>> groupsTypeMap = groupsGroupByGroup.get(result.getMusicGroupId());
+                result.setTeacher(null);
                 if(Objects.nonNull(groupsTypeMap)){
                     List<Group> groupTemps = groupsTypeMap.get(result.getGroupType());
                     if(!CollectionUtils.isEmpty(groupTemps)){
                         result.setGroupName(groupTemps.get(0).getGroupName());
+                        result.setOrganName(groupTemps.get(0).getOrganName());
                     }
                     result.setTeacherName(nameIdMap.get(result.getActualTeacherId()));
                 }
+                List<TeacherAttendance> courseTeacherAttendances = courseTeacherAttendanceMap.get(result.getId());
+                if(!CollectionUtils.isEmpty(courseTeacherAttendances)){
+                    TeacherAttendance teacherAttendance=courseTeacherAttendances.get(0);
+                    result.setIsSignIn(Objects.isNull(teacherAttendance.getSignInStatus())?3:teacherAttendance.getSignInStatus().getCode());
+                    result.setIsSignOut(Objects.isNull(teacherAttendance.getSignOutStatus())?3:teacherAttendance.getSignOutStatus().getCode());
+                }
+                Long studentNum = studentNumCourseMap.get(result.getId());
+                if (Objects.nonNull(studentNum)) {
+                    result.setIsCallNames(studentNum > 0 ? 0 : 1);
+                } else {
+                    result.setIsCallNames(1);
+                }
             });
         }
         pageInfo.setRows(results);

File diff suppressed because it is too large
+ 344 - 343
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java


+ 101 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -140,6 +140,53 @@ public class PayServiceImpl implements PayService {
     }
 
     @Override
+    public Map<String, Object> getPayMap(BigDecimal amount, String orderNo, String notifyUrl, String returnUrl, String orderSubject, String orderBody, Integer userId, Map<String, BigDecimal> fee, Integer organId, String receiver) throws Exception {
+        String company = "daya";
+        if (userId != null) {
+            MusicGroup musicGroup = musicGroupDao.findUserMusicGroup(userId);
+            if (musicGroup != null && musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)) {
+                company = "yadie";
+            }
+        }
+
+        //支付通道决策
+        Map unionPay = new HashMap();
+        Map<String, BigDecimal> routingFee = getRoutingFee(company, amount, fee, organId,receiver);
+        List<SysAccount> accounts = getRoutingAccount(routingFee, company);
+        SysAccount routingAccount = accounts.get(0);
+
+        Map payMap = null;
+        String type = null;
+        if (routingAccount.getChannel().equals("YQPAY")) {
+            List<Map> tempRoutingList = new ArrayList();
+            for (SysAccount account : accounts) {
+                Map<String, Object> routingList = new HashMap<>();
+                routingList.put("routingMerNo", account.getRoutingMerNo());//分佣账户
+                routingList.put("routingFee", account.getRoutingFee().subtract((account.getRoutingFee().multiply(new BigDecimal("0.28")).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_UP))); //分佣金额
+                tempRoutingList.add(routingList);
+            }
+            if(accounts.size() ==1 && routingAccount.getMerNo().equals(routingAccount.getRoutingMerNo())){
+                tempRoutingList = null;
+            }
+
+            payMap = YqPayUtil.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routingAccount.getMerNo(), tempRoutingList);
+            type = "YQPAY";
+        } else {
+            payMap = new Pay().getPayMap(amount, orderNo, notifyUrl, orderSubject, orderBody);
+            type = "ADAPAY";
+        }
+
+        String routingMerNos = accounts.stream().map(sysAccount -> sysAccount.getRoutingMerNo()).collect(Collectors.joining(","));
+
+        unionPay.put("orderNo", orderNo);
+        unionPay.put("type", type);
+        unionPay.put("payMap", payMap);
+        unionPay.put("routingFee",routingFee);
+        unionPay.put("routingMerNos",routingMerNos);
+        return unionPay;
+    }
+
+    @Override
     public Map<String, Object> query(String orderNo) throws Exception {
         return new UnionPay(unionPayFeignService).query(orderNo);
     }
@@ -265,4 +312,58 @@ public class PayServiceImpl implements PayService {
     }
 
 
+    private Map<String, BigDecimal> getRoutingFee(String company, BigDecimal amount, Map<String, BigDecimal> fee, Integer organId,String receiver) {
+        Map<String, BigDecimal> routingFee = new HashMap<>(2);
+        routingFee.put("COM", BigDecimal.ZERO);
+        routingFee.put("PER", BigDecimal.ZERO);
+        if (company.equals("yadie")) {
+            routingFee.put("PER", amount);
+            return routingFee;
+        }
+
+        if(receiver != null){
+            routingFee.put(receiver, amount);
+            return routingFee;
+        }
+
+        SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(organId);
+
+        int payOrderNums = studentPaymentOrderService.findPayOrderNum(); //获取支付中和成功的订单数
+        //前几笔收入私户
+        Integer nums = Integer.parseInt(sysConfigDao.findConfigValue("per_account_nums"));
+        if (paymentConfig != null && paymentConfig.getType().equals(1)) {
+            nums = paymentConfig.getPerScale();
+        }
+
+        String type = null;
+        int rem = (payOrderNums + 1) % 10;
+        if (rem > 0 && rem <= nums) { //私人账户
+            type = "PER";
+        } else {
+            type = "COM";
+        }
+        routingFee.put(type, amount);
+
+        if (paymentConfig == null || !paymentConfig.getType().equals(2)) {
+            return routingFee;
+        }
+        routingFee.put(type, BigDecimal.ZERO);
+        for (Map.Entry<String, BigDecimal> feeEntry : fee.entrySet()) {
+            if (feeEntry.getKey().equals("course")) {
+                BigDecimal RoutingFee = routingFee.get(paymentConfig.getCourseFee()).add(feeEntry.getValue());
+                routingFee.put(paymentConfig.getCourseFee(), RoutingFee);
+            } else if (feeEntry.getKey().equals("instrument")) {
+                BigDecimal RoutingFee = routingFee.get(paymentConfig.getInstrumentFee()).add(feeEntry.getValue());
+                routingFee.put(paymentConfig.getInstrumentFee(), RoutingFee);
+            } else if (feeEntry.getKey().equals("accessories")) {
+                BigDecimal RoutingFee = routingFee.get(paymentConfig.getAccessoriesFee()).add(feeEntry.getValue());
+                routingFee.put(paymentConfig.getAccessoriesFee(), RoutingFee);
+            } else if (feeEntry.getKey().equals("other")) {
+                BigDecimal RoutingFee = routingFee.get(paymentConfig.getOtherFee()).add(feeEntry.getValue());
+                routingFee.put(paymentConfig.getOtherFee(), RoutingFee);
+            }
+        }
+        return routingFee;
+    }
+
 }

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SporadicChargeInfoImpl.java

@@ -66,6 +66,10 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
 		Map<Integer,String> yimei = new HashMap();
 		map.put(userId,userId.toString());
 		if(studentPaymentOrder.getStatus() == DealStatusEnum.SUCCESS){
+			//活动,增加课程余额
+			if(info.getChargeType().equals("6")){
+				sysUserCashAccountService.appendCourseBalance(userId,info.getAmount());
+			}
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.SMS_SPORADIC_PAYMENT_SUCCESS, map, null, 0, "1",
 					studentPaymentOrder.getActualAmount(),info.getTitle());
 			sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_SPORADIC_PAYMENT_SUCCESS, yimei, null, 0, "1",
@@ -117,4 +121,9 @@ public class SporadicChargeInfoImpl extends BaseServiceImpl<Integer, SporadicCha
 		}
 		return sporadicChargeInfo;
 	}
+
+	@Override
+	public SporadicChargeInfo findByOrganIdAndType(Integer organId, Integer type) {
+		return sporadicChargeInfoDao.findByOrganIdAndType(organId,type);
+	}
 }

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

@@ -271,14 +271,14 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 
 		Date date = new Date();
 		
-		int days = 1;
+		int hours = 4;
 		String str = sysConfigDao.findConfigValue(SysConfigService.ADVANCE_LEAVE_HOURS);
 		if (StringUtils.isNotBlank(str)) {
-			days = Integer.parseInt(str);
+			hours = Integer.parseInt(str);
 		}
 
-		if(DateUtil.addDays1(date, days).after(courseSchedule.getStartClassTime())){
-			throw new BizException("开课{}天之前才可以请假",days);
+		if(DateUtil.addHours(date, hours).after(courseSchedule.getStartClassTime())){
+			throw new BizException("开课{}小时之前才可以请假",hours);
 		}
 		
 		StudentAttendance studentAttendance  = studentAttendanceDao.findByStatusAndCourseScheduleId(userId,courseScheduleId.intValue());

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

@@ -145,6 +145,9 @@ public class StudentPaymentOrderDetailServiceImpl extends BaseServiceImpl<Long,
                 goodsIdsStr += studentPaymentOrderDetail.getGoodsIdList() + ",";
             }
         }
+        if(goodsIdsStr.isEmpty()){
+            return null;
+        }
         goodsIdsStr = goodsIdsStr.substring(0, goodsIdsStr.length() - 1);
 
         String[] goodSIdArr = goodsIdsStr.split(",");

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

@@ -201,7 +201,7 @@ public class StudentPaymentOrderServiceImpl extends BaseServiceImpl<Long, Studen
             vipGroupService.orderCallback(order);
         } else if (order.getType().equals(OrderTypeEnum.RENEW)) {
             musicGroupService.renewForCallback(order);
-        }else if (order.getType().equals(OrderTypeEnum.SPORADIC)){
+        }else if (order.getType().equals(OrderTypeEnum.SPORADIC)||order.getType().equals(OrderTypeEnum.LUCK)){
             sporadicChargeInfoService.renewForCallback(order);
         }
     }

+ 50 - 54
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -15,6 +15,7 @@ import java.util.stream.Collectors;
 
 import javax.annotation.Resource;
 
+import com.ym.mec.biz.dal.entity.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,21 +40,6 @@ import com.ym.mec.biz.dal.dto.StudentAddDto;
 import com.ym.mec.biz.dal.dto.StudentApplyDetailDto;
 import com.ym.mec.biz.dal.dto.StudentFeeDetailDto;
 import com.ym.mec.biz.dal.dto.StudentInfo;
-import com.ym.mec.biz.dal.entity.ClassGroup;
-import com.ym.mec.biz.dal.entity.ClassGroupStudentMapper;
-import com.ym.mec.biz.dal.entity.CourseSchedule;
-import com.ym.mec.biz.dal.entity.CourseScheduleStudentPayment;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.MusicGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
-import com.ym.mec.biz.dal.entity.StudentRegistration;
-import com.ym.mec.biz.dal.entity.Subject;
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
-import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
 import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
 import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
@@ -670,14 +656,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 e.setPaymentOrderId(studentPaymentOrder.getId());
             });
             studentPaymentOrderDetailService.batchAdd(studentPaymentOrderDetails);
-            Map<Integer, String> receivers = new HashMap<>(1);
-            receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
-            if (reduce == BigDecimal.ZERO) {
-                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT_FREE,
-                        receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName());
-            }else {
-                String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
-                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT,receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName(),HttpUtil.getSortUrl(studentApplyUrl));
+            if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+                Map<Integer, String> receivers = new HashMap<>(1);
+                receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
+                if (reduce == BigDecimal.ZERO) {
+                    sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT_FREE,
+                            receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName());
+                }else {
+                    String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
+                    sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI, MessageTypeEnum.SMS_MUSIC_GROUP_ADD_STUDENT,receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName(),HttpUtil.getSortUrl(studentApplyUrl));
+                }
             }
             return userId;
         }
@@ -848,24 +836,27 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
 
             sysUserCashAccountDetailService.insert(paymentDetail);
 
-            //发送缴费成功通知(短信 + push)
-            Map<Integer, String> map = new HashMap<>(1);
-            map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
-                    MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map, null, 0, "1",
-                    studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
-            //push
-            Map<Integer, String> map1 = new HashMap<>(1);
-            map1.put(studentPaymentOrder.getUserId(), studentPaymentOrder.getUserId().toString());
-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
-                    MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map1, null, 0, "1",
-                    studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
-
+            MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
+            //三方乐团不发送缴费通知
+            if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+                //发送缴费成功通知(短信 + push)
+                Map<Integer, String> map = new HashMap<>(1);
+                map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
+                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
+                        MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map, null, 0, "1",
+                        studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
+                //push
+                Map<Integer, String> map1 = new HashMap<>(1);
+                map1.put(studentPaymentOrder.getUserId(), studentPaymentOrder.getUserId().toString());
+                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
+                        MessageTypeEnum.STUDENT_SMS_PAYMENT_SUCCESS, map1, null, 0, "1",
+                        studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
+            }
 //            //生成课程协议
 			try {
 				contractService.transferMusicGroupCoursesContract(studentRegistration.getUserId(), studentRegistration.getMusicGroupId());
 				// 商品协议(租赁时候有)
-				if (musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
+				if (musicOneSubjectClassPlan.getKitGroupPurchaseType()!= null && musicOneSubjectClassPlan.getKitGroupPurchaseType().equals(KitGroupPurchaseTypeEnum.LEASE)) {
 					StudentPaymentOrderDetail applyOrderMusical = studentPaymentOrderDetailService.findApplyOrderMusical(studentPaymentOrder.getId());
 					if (applyOrderMusical != null && applyOrderMusical.getGoodsIdList() != null && !applyOrderMusical.getGoodsIdList().equals("")) {
 						contractService.transferGoodsContract(studentPaymentOrder.getUserId(), studentPaymentOrder.getMusicGroupId(),
@@ -890,15 +881,16 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             if(studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().compareTo(BigDecimal.ZERO) >0 ){
                 sysUserCashAccountService.updateBalance(studentPaymentOrder.getUserId(), studentPaymentOrder.getBalancePaymentAmount(),PlatformCashAccountDetailTypeEnum.REFUNDS,"报名缴费失败");
             }
-
-            //发送缴费成功通知(短信 + push)
-            String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + studentRegistration.getMusicGroupId();
-
-            Map<Integer, String> map = new HashMap<>(1);
-            map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
-                    MessageTypeEnum.STUDENT_SMS_PAYMENT_FAILED, map, null, 0, "1",
-                    HttpUtil.getSortUrl(studentApplyUrl));
+            MusicGroup musicGroup = musicGroupDao.get(studentRegistration.getMusicGroupId());
+            //三方乐团不发送缴费通知
+            if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+                String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + studentRegistration.getMusicGroupId();
+                Map<Integer, String> map = new HashMap<>(1);
+                map.put(studentPaymentOrder.getUserId(), studentRegistration.getParentsPhone());
+                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
+                        MessageTypeEnum.STUDENT_SMS_PAYMENT_FAILED, map, null, 0, "1",
+                        HttpUtil.getSortUrl(studentApplyUrl));
+            }
 //            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG,
 //                    MessageTypeEnum.STUDENT_SMS_PAYMENT_FAILED,map,null,0,"1",
 //                    studentApplyUrl);
@@ -962,15 +954,19 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         if(StringUtils.isNotEmpty(ids)){
             //发送短信通知
             List<Long> list = JSONObject.parseArray(JSONObject.toJSONString(Arrays.asList(ids.split(","))),Long.class);
-            List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByIdList(list);
             MusicGroup musicGroup = musicGroupDao.findMusicGroup(list);
-            String configValue = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL);
-            HashMap<Integer,String> receivers = new HashMap<>(registrations.size());
-            registrations.forEach(e->{
-                receivers.put(e.getUserId(),e.getParentsPhone());
-            });
-            sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
-                    MessageTypeEnum.SMS_STUDENT_OPEN_PAYMENT,receivers,null,0,null,musicGroup.getName(),HttpUtil.getSortUrl(configValue + musicGroup.getId()));
+            //三方乐团不发送缴费通知
+            if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+                List<StudentRegistration> registrations = studentRegistrationDao.findStudentListByIdList(list);
+                String configValue = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL);
+                HashMap<Integer,String> receivers = new HashMap<>(registrations.size());
+                registrations.forEach(e->{
+                    receivers.put(e.getUserId(),e.getParentsPhone());
+                });
+                sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.YIMEI,
+                        MessageTypeEnum.SMS_STUDENT_OPEN_PAYMENT,receivers,null,0,null,
+                        musicGroup.getName(),HttpUtil.getSortUrl(configValue + musicGroup.getId()));
+            }
         }
         return studentRegistrationDao.batchOpenPay(ids, PaymentStatusEnum.OPEN);
     }

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

@@ -258,8 +258,8 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //		}
 
 		//如果默认课酬与实际课酬不匹配则需要审批
-		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())>0||
-			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())>0
+		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())<0||
+			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())<0
 			&&StringUtils.isBlank(studentIds)){
 			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
 		}else{
@@ -1169,7 +1169,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(!isOk){
 			updateVipGroupStudentNumAndStatus(vipGroupId,classGroup,-1,false);
 			classGroupStudentMapperDao.deleteStudentByMusicGroupId(vipGroupId.toString(),userId);
-			if (studentPaymentOrder.getBalancePaymentAmount().doubleValue() > 0) {
+			if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().doubleValue() > 0) {
 				sysUserCashAccountService.updateBalance(userId, studentPaymentOrder.getBalancePaymentAmount(), PlatformCashAccountDetailTypeEnum.REFUNDS,
 						"VIP课购买失败");
 			}

+ 4 - 4
mec-biz/src/main/resources/config/contracts/goods.ftl

@@ -110,12 +110,12 @@
 1、乙方所借用的乐器为甲方资产,乐器所有权归属甲方所有,甲方有权在必要时向乙方收回借用乐器并退还押金。<br/>
 2、甲方所提供乐器为全新的KEY品牌乐器。在乙方签订本协议、交纳乐器使用押金后,甲方即将乐器交付给乙方供其在学校乐团期间免费使用。<br/>
         3、乙方归还乐器时,双方当面当场验收,经甲方维修技师检验确认乐器无人为损坏、可正常使用后,甲方在七个工作日内全额不计息退还乙方已交纳的押金。<br/>
-        4、如乙方已购买甲方乐器保养服务,甲方需在乙方借用期间协助乙方处理乐器维修和保养问题。
+        4、如乙方已购买甲方乐器维护服务,甲方需在乙方借用期间协助乙方处理乐器维修和保养问题。
         <h2>二、乙方权利与义务:</h2>
         1、乙方在签订本协议、交纳乐器使用押金¥${depositFee?string("0.00")}元(大写人民币${depositFeeFmt})后,享有所借用乐器在学校乐团期间的免费使用权。乙方应当爱惜乐器并妥善保管,不得将该乐器转租、借用、出售、典当、质押或抵押,也不得将乐器交于非专业人士使用。乐器借用政策,每位团员仅可享受一次,退团后再次加入乐团的,将无法享受乐器借用政策。<br/>
-        2、乐器日常维护由乙方自行完成,每次练习完毕后需按老师要求对乐器进行擦拭并装箱保管。如因人为原因(包括但不限于磕、碰、摔等)造成乐器损坏的,乙方需自行承担维修费用;如因非甲方原因导致乐器无法正常使用(正常使用磨损除外)或乐器毁损、灭失、遗失的,乙方须按本协议中明示的乐器团购价格进行赔付。<br/>
+        2、乐器日常维护由乙方自行完成,每次练习完毕后需按老师要求对乐器进行擦拭并装箱保管。如因人为原因(包括但不限于磕、碰、摔等)造成乐器损坏的,乙方需自行承担维修费用;如因非甲方原因导致乐器无法正常使用(正常使用磨损除外)或乐器毁损、灭失、遗失的,乙方须按本协议中明示的乐器价格进行赔付。<br/>
         3、当乙方决定不再继续乐团学习时,应在退团之日起1日内将其借用的乐器归还甲方,双方当面当场验收,经甲方维修技师检验确认乐器无人为损坏、可正常使用后,乙方可按照本协议约定获得已交纳的押金;经甲方维修技师检验,乐器存在损坏的,乙方应承担相应的维修费用,如乐器已经无法正常使用的,乙方须按本协议中明示的乐器团购价格进行赔付,甲方有权从应退还乙方的押金中先行扣除维修费用、赔付费用,如甲方扣除押金后仍然不足以弥补维修费用、赔付费用的,甲方有权继续要求乙方支付剩余费用。<br/>
-        4、乙方终止乐团学习2个月内,仍未将乐器归还给甲方的,则视为乙方违约,乙方所交押金甲方有权不予退还,同时乙方须按乐器团购价格进行赔付。
+        4、乙方终止乐团学习2个月内,仍未将乐器归还给甲方的,则视为乙方违约,乙方所交押金甲方有权不予退还,同时乙方须按乐器价格进行赔付。
         <h2>三、乐器标准:</h2> 
         <div class="iInfo">
             <span>名称:<#if (goodsList?size > 0)> ${goodsList[0].name} </#if></span>
@@ -123,7 +123,7 @@
         </div>
         <div class="iInfo">
             <span>型号:<#if (goodsList?size > 0)> ${goodsList[0].specification} </#if></span>
-            <span>团购价格:<#if (goodsList?size > 0)> ${goodsList[0].groupPurchasePrice?string("0.00")}元 </#if></span>
+            <span>乐器价格:<#if (goodsList?size > 0)> ${goodsList[0].groupPurchasePrice?string("0.00")}元 </#if></span>
         </div>
 
         <h2>四、违约责任</h2>  

+ 17 - 2
mec-biz/src/main/resources/config/mybatis/ClassGroupMapper.xml

@@ -928,13 +928,13 @@
         <where>
             <if test="search != null">
                 AND (cg.name_ LIKE CONCAT('%',#{search},'%') OR cg.id_ = #{search}
-                <if test="groups != null">
+                <if test="groups != null and organIdList==null">
                     OR cg.music_group_id_ IN
                     <foreach collection="groups" item="group" open="(" close=")" separator=",">
                         #{group.id}
                     </foreach>
                 </if>
-                <if test="classGroupIds != null">
+                <if test="classGroupIds != null and organIdList==null">
                     OR cg.id_ IN
                     <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
                         #{classGroupId}
@@ -942,6 +942,18 @@
                 </if>
                 )
             </if>
+            <if test="groups != null and organIdList!=null">
+                AND cg.music_group_id_ IN
+                <foreach collection="groups" item="group" open="(" close=")" separator=",">
+                    #{group.id}
+                </foreach>
+            </if>
+            <if test="classGroupIds != null and organIdList!=null">
+                AND cg.id_ IN
+                <foreach collection="classGroupIds" item="classGroupId" open="(" close=")" separator=",">
+                    #{classGroupId}
+                </foreach>
+            </if>
             <if test="groupType != null">
                 AND cg.group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
@@ -951,6 +963,9 @@
             <if test="classGroupId != null">
                 AND cg.id_=#{classGroupId}
             </if>
+            <if test="classGroupType!=null">
+                AND cg.type_=#{classGroupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         </where>
     </sql>
     <select id="superFindClassGroups" resultMap="SuperClassGroupInfo">

+ 35 - 3
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -1855,13 +1855,13 @@
         <where>
             <if test="search != null">
                 AND (cs.name_ LIKE CONCAT('%',#{search},'%') OR cs.id_ = #{search}
-                  <if test="groups != null">
+                  <if test="groups != null and organIdList==null">
                       OR cs.music_group_id_ IN
                       <foreach collection="groups" item="group" open="(" close=")" separator=",">
                           #{group.id}
                       </foreach>
                   </if>
-                  <if test="courseIds != null">
+                  <if test="courseIds != null and organIdList==null">
                     OR cs.id_ IN
                     <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
                         #{courseId}
@@ -1869,6 +1869,21 @@
                   </if>
                 )
             </if>
+            <if test="groups != null and organIdList!=null">
+                AND cs.music_group_id_ IN
+                <foreach collection="groups" item="group" open="(" close=")" separator=",">
+                    #{group.id}
+                </foreach>
+            </if>
+            <if test="courseIds != null and organIdList!=null">
+                AND cs.id_ IN
+                <foreach collection="courseIds" item="courseId" open="(" close=")" separator=",">
+                    #{courseId}
+                </foreach>
+            </if>
+            <if test="teacherIdList != null">
+                AND FIND_IN_SET(cs.actual_teacher_id_,#{teacherIdList})
+            </if>
             <if test="groupType != null">
                 AND cs.group_type_=#{groupType, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
             </if>
@@ -1878,6 +1893,21 @@
             <if test="classGroupId != null">
                 AND cs.class_group_id_=#{classGroupId}
             </if>
+            <if test="startTime!=null and endTime==null">
+                AND cs.class_date_ &gt; DATE_FORMAT(#{startTime},"%Y-%m-%d")
+            </if>
+            <if test="startTime==null and endTime!=null">
+                AND cs.class_date_ &lt; DATE_FORMAT(#{endTime},"%Y-%m-%d")
+            </if>
+            <if test="startTime!=null and endTime!=null">
+                AND cs.class_date_ BETWEEN DATE_FORMAT(#{startTime},"%Y-%m-%d") AND DATE_FORMAT(#{endTime},"%Y-%m-%d")
+            </if>
+            <if test="courseStatus!=null">
+                AND cs.status_ = #{courseStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="courseType!=null">
+                AND cs.type_ = #{courseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
         </where>
     </sql>
 
@@ -1895,10 +1925,12 @@
             cs.teach_mode_,
             cs.type_,
             cs.schoole_id_,
-            cg.name_ class_group_name_
+            cg.name_ class_group_name_,
+            s.name_ schoole_name_
         FROM
           course_schedule cs
           LEFT JOIN class_group cg ON cg.id_=cs.class_group_id_
+          LEFT JOIN school s ON cs.schoole_id_=s.id_
         <include refid="endFindCourseSchedulesCondition"/>
           ORDER BY course_start_time_
         <include refid="global.limit"/>

+ 29 - 4
mec-biz/src/main/resources/config/mybatis/GroupMapper.xml

@@ -7,17 +7,40 @@
 <mapper namespace="com.ym.mec.biz.dal.dao.GroupDao">
 
     <resultMap type="com.ym.mec.biz.dal.entity.Group" id="Group">
+        <result column="organ_id_" property="organId"/>
+        <result column="organ_name_" property="organName"/>
         <result column="id_" property="id"/>
         <result column="group_name_" property="groupName"/>
         <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
     </resultMap>
 
+    <sql id="searchGroupsCondition">
+        <where>
+            <if test="search!=null">
+                AND g.id_ = #{search} OR g.name_ LIKE CONCAT( '%', #{search}, '%' )
+            </if>
+            <if test="organIdList!=null">
+                AND FIND_IN_SET(g.organ_id_,#{organIdList})
+            </if>
+        </where>
+    </sql>
+
     <select id="searchGroups" resultMap="Group">
-        ( SELECT id_, name_ group_name_, 'MUSIC' group_type_ FROM music_group WHERE id_ = #{search} OR name_ LIKE CONCAT( '%', #{search}, '%' ) ) UNION
-        ( SELECT id_, name_ group_name_, 'VIP' group_type_ FROM vip_group WHERE id_ = #{search} OR name_ LIKE CONCAT( '%', #{search}, '%' ) );
+        ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'MUSIC' group_type_
+        FROM music_group g
+        LEFT JOIN organization o ON g.organ_id_ = o.id_
+        <include refid="searchGroupsCondition"/> )
+        UNION
+        ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'VIP' group_type_
+        FROM vip_group g
+        LEFT JOIN organization o ON g.organ_id_ = o.id_
+        <include refid="searchGroupsCondition"/> );
     </select>
     <select id="findByGroupIds" resultMap="Group">
-      ( SELECT id_, name_ group_name_, 'MUSIC' group_type_ FROM music_group WHERE id_ IN
+      ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'MUSIC' group_type_
+        FROM music_group g
+        LEFT JOIN organization o ON g.organ_id_ = o.id_
+        WHERE g.id_ IN
         <foreach collection="groups" item="group" open="(" close=")" separator=",">
             <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@MUSIC">
                 #{group.id}
@@ -28,7 +51,9 @@
         </foreach>
       )
       UNION
-      ( SELECT id_, name_ group_name_, 'VIP' group_type_ FROM vip_group WHERE id_ IN
+      ( SELECT o.id_ organ_id_,o.name_ organ_name_,g.id_, g.name_ group_name_, 'VIP' group_type_
+      FROM vip_group g LEFT JOIN organization o ON g.organ_id_ = o.id_
+      WHERE g.id_ IN
         <foreach collection="groups" item="group" open="(" close=")" separator=",">
             <if test="group != null and group.groupType == @com.ym.mec.biz.dal.enums.GroupType@VIP">
                 #{group.id}

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

@@ -9,6 +9,7 @@
 		<result column="charge_type_" property="chargeType"/>
 		<result column="organ_id_" property="organId"/>
 		<result column="amount_" property="amount" />
+		<result column="discount_amount_" property="discountAmount" />
 		<result column="detail_" property="detail" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -32,8 +33,8 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SporadicChargeInfo"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO sporadic_charge_info
-		(title_,charge_type_,organ_id_,amount_,detail_,create_time_,update_time_,operator_id_,user_id_)
-		VALUES(#{title},#{chargeType},#{organId},#{amount},#{detail},now(),now(),#{operatorId},#{userId})
+		(title_,charge_type_,organ_id_,amount_,discount_amount_,detail_,create_time_,update_time_,operator_id_,user_id_)
+		VALUES(#{title},#{chargeType},#{organId},#{amount},#{discountAmount},#{detail},now(),now(),#{operatorId},#{userId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -52,6 +53,9 @@
 			<if test="amount != null">
 				amount_ = #{amount},
 			</if>
+			<if test="discountAmount != null">
+				discount_amount_ = #{discountAmount},
+			</if>
 			<if test="detail != null">
 				detail_ = #{detail},
 			</if>
@@ -112,4 +116,8 @@
 	<select id="findInfoById" resultMap="SporadicChargeInfo">
 		SELECT * FROM sporadic_charge_info where id_ = #{id}
 	</select>
+	<!-- 根据类型和分部id查询活动 -->
+	<select id="findByOrganIdAndType" resultMap="SporadicChargeInfo">
+		SELECT * FROM sporadic_charge_info where organ_id_=#{organId} AND charge_type_=#{chargeType} AND del_flag_=0
+	</select>
 </mapper>

+ 4 - 5
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -518,20 +518,20 @@
         <result property="totalClassTimes" column="total_class_times_"/>
     </resultMap>
     <select id="findStudentVipGroupClass" resultMap="StudentManageVipGroupClassDto">
-        SELECT vg.id_,vg.name_ vip_group_name_,vg.status_,cgtm.user_id_,cg.student_num_,
+        SELECT vg.id_,vg.name_ vip_group_name_,vg.status_,vg.user_id_,cg.student_num_,
         vgc.name_,vg.courses_start_date,cg.current_class_times_,cg.total_class_times_
         FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_
-        LEFT JOIN class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_
         LEFT JOIN vip_group_activity vgc ON vgc.id_ = vg.vip_group_activity_id_
-        WHERE cg.group_type_ = 'VIP' AND cgtm.teacher_role_ = 'BISHOP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
+        WHERE cg.group_type_ = 'VIP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
         <if test="vipGroupName != null">
             AND vg.name_ LIKE CONCAT('%',#{vipGroupName},'%')
         </if>
         <if test="vipGroupStatus != null">
             AND vg.status_ = #{vipGroupStatus}
         </if>
+        ORDER BY vg.create_time_ DESC
         <include refid="global.limit"/>
     </select>
     <select id="countStudentVipGroupClass" resultType="java.lang.Integer">
@@ -539,8 +539,7 @@
         FROM class_group_student_mapper cgsm
         LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
         LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_
-        LEFT JOIN class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_
-        WHERE cg.group_type_ = 'VIP' AND cgtm.teacher_role_ = 'BISHOP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
+        WHERE cg.group_type_ = 'VIP' AND cgsm.user_id_ = #{studentId} AND vg.status_ != 3
         <if test="vipGroupName != null">
             AND vg.name_ LIKE CONCAT('%',#{vipGroupName},'%')
         </if>

+ 11 - 0
mec-biz/src/main/resources/config/mybatis/TeacherMapper.xml

@@ -601,4 +601,15 @@
             #{item}
         </foreach>
     </select>
+    <select id="searchTeachers" resultMap="TeacherBasicDto">
+        SELECT su.id_,su.username_,su.real_name_ FROM teacher t
+        LEFT JOIN sys_user su ON t.id_ = su.id_
+        WHERE su.del_flag_ != 1
+        <if test="organId != null">
+            AND FIND_IN_SET(t.organ_id_,#{organId})
+        </if>
+        <if test="teacherName != null">
+            AND su.real_name_ LIKE CONCAT('%',#{teacherName},'%')
+        </if>
+    </select>
 </mapper>

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

@@ -21,6 +21,7 @@
 		<result column="attribute2_" property="attribute2" />
 		<result column="attribute3_" property="attribute3" />
 		<result column="salary_readonly_flag_" property="salaryReadonlyFlag" />
+		<result column="payment_readonly_flag_" property="paymentReadonlyFlag" />
 		<result column="give_class_pay_salary_flag_" property="giveClassPaySalaryFlag" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
@@ -47,7 +48,8 @@
 		SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL 
 		</selectKey>
 		-->
-		INSERT INTO vip_group_activity (id_,name_,description_,vip_group_category_id_list_,start_time_,end_time_,organ_id_,courses_start_time_,courses_end_time_,type_,attribute1_,attribute2_,attribute3_,salary_readonly_flag_,give_class_pay_salary_flag_,create_time_,update_time_,salary_settlement_json_,del_flag_) VALUES(#{id},#{name},#{description},#{vipGroupCategoryIdList},#{startTime},#{endTime},#{organId},#{coursesStartTime},#{coursesEndTime},#{type},#{attribute1},#{attribute2},#{attribute3},#{salaryReadonlyFlag},#{giveClassPaySalaryFlag},now(),now(),#{salarySettlementJson},#{delFlag})
+		INSERT INTO vip_group_activity (id_,name_,description_,vip_group_category_id_list_,start_time_,end_time_,organ_id_,courses_start_time_,courses_end_time_,type_,attribute1_,attribute2_,attribute3_,salary_readonly_flag_,give_class_pay_salary_flag_,create_time_,update_time_,salary_settlement_json_,del_flag_,payment_readonly_flag_)
+		VALUES(#{id},#{name},#{description},#{vipGroupCategoryIdList},#{startTime},#{endTime},#{organId},#{coursesStartTime},#{coursesEndTime},#{type},#{attribute1},#{attribute2},#{attribute3},#{salaryReadonlyFlag},#{giveClassPaySalaryFlag},now(),now(),#{salarySettlementJson},#{delFlag},#{paymentReadonlyFlag})
 	</insert>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -110,6 +112,9 @@
 			<if test="delFlag != null">
 			del_flag_ = #{delFlag},
 			</if>
+			<if test="paymentReadonlyFlag != null">
+				payment_readonly_flag_ = #{paymentReadonlyFlag},
+			</if>
 			</set> WHERE id_ = #{id}
 	</update>
 	

+ 2 - 1
mec-common/common-core/src/main/java/com/ym/mec/common/controller/BaseController.java

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
 
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.thirdparty.exception.ThirdpartyException;
 
 @ControllerAdvice
 public class BaseController {
@@ -70,7 +71,7 @@ public class BaseController {
 		}
 		logger.error("System Error", e);
 //		return failed(e.getMessage());
-		if(e instanceof BizException){
+		if(e instanceof BizException || e instanceof ThirdpartyException){
 			return failed(e.getMessage());
 		}else if(e instanceof AccessDeniedException){
 			return failed("禁止访问");

+ 4 - 1
mec-gateway/mec-gateway-web/src/main/resources/application.yml

@@ -19,7 +19,10 @@ spring:
 
   servlet:
     multipart:
-      max-file-size: 10MB
+      # 最大支持文件大小
+      max-file-size: 50MB
+      # 最大支持请求大小
+      max-request-size: 50MB
 
 eureka:
   client:

+ 1 - 1
mec-gateway/mec-gateway-web/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/gateway-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/gateway-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

+ 1 - 1
mec-im/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/im-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/im-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

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

@@ -129,6 +129,7 @@ public class MusicGroupController extends BaseController {
         if (!studentRegistration.getPaymentStatus().equals(PaymentStatusEnum.OPEN)) {
             return failed("乐团还未开启缴费,请等待通知");
         }
+        studentRegistration.setOwnershipType(musicGroup.getOwnershipType());
 
         return succeed(studentRegistration);
     }

+ 83 - 59
mec-student/src/main/java/com/ym/mec/student/controller/SporadicChargeInfoController.java

@@ -18,7 +18,10 @@ import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import org.apache.poi.util.Internal;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
@@ -31,67 +34,88 @@ import java.util.Map;
 @RestController
 public class SporadicChargeInfoController extends BaseController {
 
-	@Autowired
-	private SporadicChargeInfoService sporadicChargeInfoService;
-	@Autowired
-	private SysUserFeignService sysUserFeignService;
-	@Autowired
-	private SysUserCashAccountDao sysUserCashAccountDao;
-	@Autowired
-	private StudentPaymentOrderService studentPaymentOrderService;
-	@Autowired
-	private MusicGroupService musicGroupService;
+    @Autowired
+    private SporadicChargeInfoService sporadicChargeInfoService;
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private SysUserCashAccountDao sysUserCashAccountDao;
+    @Autowired
+    private StudentPaymentOrderService studentPaymentOrderService;
+    @Autowired
+    private MusicGroupService musicGroupService;
 
-	@ApiOperation(value = "单查询")
-	@GetMapping("/get")
-	public Object get(Integer id,Integer userId) {
-		if(userId == null){
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			if (sysUser == null || sysUser.getId() == null) {
-				return failed("用户不存在");
-			}
-			userId = sysUser.getId();
-		}
-		SporadicChargeInfo chargeInfo = sporadicChargeInfoService.get(id);
-		if(chargeInfo != null){
-			SysUserCashAccount locked = sysUserCashAccountDao.getLocked(userId);
-			chargeInfo.setBalance(locked.getBalance());
-		}else {
-			throw new BizException("信息不存在");
-		}
-		return succeed(chargeInfo);
-	}
+    @ApiOperation(value = "单查询")
+    @GetMapping("/get")
+    public Object get(Integer id, Integer userId) {
+        if (userId == null) {
+            SysUser sysUser = sysUserFeignService.queryUserInfo();
+            if (sysUser == null || sysUser.getId() == null) {
+                return failed("用户不存在");
+            }
+            userId = sysUser.getId();
+        }
+        SporadicChargeInfo chargeInfo = sporadicChargeInfoService.get(id);
+        if (chargeInfo != null) {
+            SysUserCashAccount locked = sysUserCashAccountDao.getLocked(userId);
+            chargeInfo.setBalance(locked.getBalance());
+        } else {
+            throw new BizException("信息不存在");
+        }
+        return succeed(chargeInfo);
+    }
 
 
-	@ApiOperation(value = "零星支付")
-	@PostMapping("/sporadicPay")
-	public HttpResponseResult sporadicPay(@RequestBody SporadicPayDto sporadicPayDto) throws Exception {
-		if(sporadicPayDto == null ||
-				sporadicPayDto.getSporadicId() == null ||
-				sporadicPayDto.getAmount() == null){
-			throw new BizException("参数校验失败");
-		}
-		if(sporadicPayDto.getUserId() == null){
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			if (sysUser == null || sysUser.getId() == null) {
-				return failed("用户不存在");
-			}
-			if(sysUser.getUserType() != SysUserType.STUDENT){
-				return failed("用户信息异常");
-			}
-			sporadicPayDto.setUserId(sysUser.getId());
-		}
-		if (sporadicPayDto.getIsRepeatPay() == false) {
-			Integer ingOrder = studentPaymentOrderService.findOrderByGroupType(sporadicPayDto.getUserId(),sporadicPayDto.getSporadicId(),"SPORADIC", DealStatusEnum.ING);
-			if (ingOrder != null && ingOrder > 0) {
-				return failed(HttpStatus.CONTINUE, "您有待支付的订单");
-			}
-		}
-		Map payMap = musicGroupService.sporadicPay(sporadicPayDto);
-		if(payMap.containsKey("tradeState")){
-			return failed(HttpStatus.CREATED, "恭喜您,购买成功!");
-		}
-		return succeed(payMap);
-	}
+    @ApiOperation(value = "零星支付")
+    @PostMapping("/sporadicPay")
+    public HttpResponseResult sporadicPay(@RequestBody SporadicPayDto sporadicPayDto) throws Exception {
+        if (sporadicPayDto == null ||
+                sporadicPayDto.getSporadicId() == null ||
+                sporadicPayDto.getAmount() == null) {
+            throw new BizException("参数校验失败");
+        }
+        if (sporadicPayDto.getUserId() == null) {
+            SysUser sysUser = sysUserFeignService.queryUserInfo();
+            if (sysUser == null || sysUser.getId() == null) {
+                return failed("用户不存在");
+            }
+            if (sysUser.getUserType() != SysUserType.STUDENT) {
+                return failed("用户信息异常");
+            }
+            sporadicPayDto.setUserId(sysUser.getId());
+        }
+        if (sporadicPayDto.getIsRepeatPay() == false) {
+            Integer ingOrder = studentPaymentOrderService.findOrderByGroupType(sporadicPayDto.getUserId(), sporadicPayDto.getSporadicId(), "SPORADIC", DealStatusEnum.ING);
+            if (ingOrder != null && ingOrder > 0) {
+                return failed(HttpStatus.CONTINUE, "您有待支付的订单");
+            }
+        }
+        Map payMap = musicGroupService.sporadicPay(sporadicPayDto);
+        if (payMap.containsKey("tradeState")) {
+            return failed(HttpStatus.CREATED, "恭喜您,支付成功!");
+        }
+        return succeed(payMap);
+    }
+
+
+    @ApiOperation(value = "福袋活动信息")
+    @GetMapping("/activityInfo")
+    @ApiImplicitParams({@ApiImplicitParam(name = "type", value = "类型(福袋活动6)", required = true, dataType = "String")})
+    public HttpResponseResult activityInfo(Integer type) throws Exception {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null || sysUser.getId() == null) {
+            return failed("请先登录");
+        }
+        if (sysUser.getOrganId() == null || sysUser.getOrganId().isEmpty()) {
+            return failed("用户信息有误,没有分部信息");
+        }
+        Integer organId = Integer.parseInt(sysUser.getOrganId());
+
+        if (type == null || type <= 0) {
+            return failed("参数不合法");
+        }
+        SporadicChargeInfo chargeInfo = sporadicChargeInfoService.findByOrganIdAndType(organId, type);
+        return succeed(chargeInfo);
+    }
 
 }

+ 4 - 1
mec-student/src/main/resources/application.yml

@@ -26,7 +26,10 @@ spring:
     
   servlet:
     multipart:
-      max-file-size: 5MB
+      # 最大支持文件大小
+      max-file-size: 50MB
+      # 最大支持请求大小
+      max-request-size: 50MB
     
   datasource:
     name: test

+ 1 - 1
mec-student/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/student-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/student-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

+ 1 - 1
mec-task/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/task-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/task-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

+ 22 - 0
mec-teacher/src/main/java/com/ym/mec/teacher/controller/TeacherCourseScheduleController.java

@@ -9,14 +9,17 @@ import com.ym.mec.biz.dal.entity.SysConfig;
 import com.ym.mec.biz.dal.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.biz.dal.page.CourseHomeworkQueryInfo;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
+import com.ym.mec.biz.dal.page.EndCourseScheduleQueryInfo;
 import com.ym.mec.biz.dal.page.StudentAttendanceQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
 import com.ym.mec.biz.service.StudentAttendanceService;
 import com.ym.mec.biz.service.SysConfigService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.MediaType;
@@ -149,6 +152,19 @@ public class TeacherCourseScheduleController extends BaseController {
         if(Objects.isNull(classDateAdjustDto.getClassGroupId())){
             classDateAdjustDto.setClassGroupId(oldCourseSchedule.getClassGroupId());
         }
+        Date now=new Date();
+        if(DateUtils.isSameDay(now,oldCourseSchedule.getClassDate())){
+            return failed("不能调整今天的课程");
+        }
+        Date tomorrow = DateUtil.addDays1(now, 1);
+        if(DateUtils.isSameDay(tomorrow,oldCourseSchedule.getClassDate())){
+            Calendar calendar=Calendar.getInstance();
+            calendar.setTime(now);
+            System.out.println(calendar.get(Calendar.HOUR_OF_DAY));
+            if(calendar.get(Calendar.HOUR_OF_DAY)>22){
+                return failed("当前时间不可对此课程进行课程调整");
+            }
+        }
         List<CourseSchedule> courseSchedules=new ArrayList<>();
         courseSchedules.add(classDateAdjustDto);
         scheduleService.courseAdjust(courseSchedules);
@@ -177,4 +193,10 @@ public class TeacherCourseScheduleController extends BaseController {
         return succeed(studentAttendanceService.statisticsList(queryInfo));
     }
 
+    @ApiOperation(value = "终极课表获取")
+    @GetMapping("/superFindCourseSchedules")
+    public Object superFindCourseSchedules(EndCourseScheduleQueryInfo queryInfo){
+        return succeed(scheduleService.endFindCourseSchedules(queryInfo));
+    }
+
 }

+ 1 - 1
mec-teacher/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/teacher-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/teacher-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

+ 6 - 0
mec-web/src/main/java/com/ym/mec/web/controller/SporadicChargeInfoController.java

@@ -87,6 +87,12 @@ public class SporadicChargeInfoController extends BaseController {
 			}
 			sporadicChargeInfo.setOrganId(Integer.parseInt(user.getOrganId()));
 		}
+		if(sporadicChargeInfo.getChargeType().equals("6")){
+			SporadicChargeInfo info = sporadicChargeInfoService.findByOrganIdAndType(sporadicChargeInfo.getOrganId(), Integer.parseInt(sporadicChargeInfo.getChargeType()));
+			if(info != null){
+				return failed("分部活动已存在,请勿重复创建");
+			}
+		}
 		return succeed(sporadicChargeInfoService.insert(sporadicChargeInfo));
 	}
 

+ 1 - 1
mec-web/src/main/resources/logback-spring.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="10 seconds">
 
-	<property name="LOG_HOME" value="/var/logs/web-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="LOG_HOME" value="/mdata/logs/web-%d{yyyy-MM-dd_HH}-%i.log" />
 	<property name="CONSOLE_LOG_PATTERN"
 		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
 

Some files were not shown because too many files changed in this diff