瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java
周箭河 5 年之前
父節點
當前提交
dff22d98ad

+ 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);
 }

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

@@ -28,10 +28,16 @@ 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;
@@ -48,6 +54,22 @@ public class EndCourseScheduleQueryInfo extends QueryInfo {
     @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;
     }
@@ -96,20 +118,20 @@ public class EndCourseScheduleQueryInfo extends QueryInfo {
         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() {

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

@@ -2174,6 +2174,14 @@ 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) {

+ 85 - 109
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -1,54 +1,16 @@
 package com.ym.mec.biz.service.impl;
 
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
-import com.ym.mec.biz.dal.dao.*;
-import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.*;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-
 import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUserRole;
+import com.ym.mec.biz.dal.dao.*;
+import com.ym.mec.biz.dal.dto.*;
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee.PaymentStatus;
-import com.ym.mec.biz.dal.enums.ClassGroupStudentStatusEnum;
-import com.ym.mec.biz.dal.enums.ClassGroupTypeEnum;
-import com.ym.mec.biz.dal.enums.CourseStatusEnum;
-import com.ym.mec.biz.dal.enums.DealStatusEnum;
-import com.ym.mec.biz.dal.enums.GoodsType;
-import com.ym.mec.biz.dal.enums.GroupType;
-import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
-import com.ym.mec.biz.dal.enums.MessageTypeEnum;
-import com.ym.mec.biz.dal.enums.MusicGroupStatusEnum;
-import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
-import com.ym.mec.biz.dal.enums.OrderTypeEnum;
-import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
-import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
+import com.ym.mec.biz.dal.enums.*;
 import com.ym.mec.biz.dal.page.MusicGroupQueryInfo;
-import com.ym.mec.biz.service.ClassGroupService;
-import com.ym.mec.biz.service.GoodsService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
-import com.ym.mec.biz.service.MusicGroupService;
-import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
-import com.ym.mec.biz.service.PayService;
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.StudentRegistrationService;
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysMessageService;
-import com.ym.mec.biz.service.SysUserCashAccountDetailService;
-import com.ym.mec.biz.service.SysUserCashAccountService;
+import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImGroupMember;
 import com.ym.mec.common.entity.ImGroupModel;
@@ -61,6 +23,18 @@ import com.ym.mec.thirdparty.message.MessageSenderPluginContext.MessageSender;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
 import com.ym.mec.util.http.HttpUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> implements MusicGroupService {
@@ -540,19 +514,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        String orderSubject = "乐团报名";
-        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)){
-            orderSubject = "乐团相关费用";
-        }
-
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         Map payMap = payService.getPayMap(
                 amount,
                 orderNo,
                 baseApiUrl + "/api-student/studentOrder/notify",
                 baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
-                orderSubject,
-                orderSubject,
+                "乐团报名",
+                "乐团报名",
                 userId,
                 classFee,
                 musicGroup.getOrganId()
@@ -736,18 +705,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             }
         }
 
-        String orderSubject = "乐团报名";
-        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType().equals(CooperationOrgan.OwnershipType.COOPERATION)){
-            orderSubject = "乐团相关费用";
-        }
         String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
         Map payMap = payService.getPayMap(
                 amount,
                 orderNo,
                 baseApiUrl + "/api-student/studentOrder/notify",
                 baseApiUrl + "/api-student/studentOrder/paymentResult?orderNo=" + orderNo,
-                orderSubject,
-                orderSubject,
+                "乐团报名",
+                "乐团报名",
                 userId,
                 classFee,
                 musicGroup.getOrganId()
@@ -944,15 +909,17 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
     @Override
     public void pushMessage(String musicGroupId) throws IOException {
         MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
-        //3.0发送该消息
-        if (new Integer(3).equals(musicGroup.getChargeTypeId())) {
-            Map<Integer, String> studentMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findIdMapByMusicGroupId(musicGroupId, 2))), HashMap.class);
-            if (studentMap != null && studentMap.size() > 0) {
-                String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-                String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
-                String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
-                sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
-                        studentMap, null, 0, "5?" + url, musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
+        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+            //3.0发送该消息
+            if (new Integer(3).equals(musicGroup.getChargeTypeId())) {
+                Map<Integer, String> studentMap = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findIdMapByMusicGroupId(musicGroupId, 2))), HashMap.class);
+                if (studentMap != null && studentMap.size() > 0) {
+                    String baseURL = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+                    String url = baseURL + "/#/smallRegister?musicGroupId=" + musicGroupId;
+                    String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
+                    sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE,
+                            studentMap, null, 0, "5?" + url, musicGroup.getName(), HttpUtil.getSortUrl(url), serverPhone);
+                }
             }
         }
     }
@@ -1053,14 +1020,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                     + musicGroupId, "", PlatformCashAccountDetailTypeEnum.REFUNDS, null, DealStatusEnum.SUCCESS, "取消乐团");
         }
         //获取当前乐团所有已报名学员
-        List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
-        if (registrations != null && registrations.size() > 0) {
-            Map<Integer, String> map = new HashMap<>(registrations.size());
-            registrations.forEach(e -> {
-                map.put(e.getUserId(), e.getUserId().toString());
-            });
-            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE,
-                    map, null, 0, "1", musicGroup.getName(), sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
+        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+            List<StudentRegistration> registrations = studentRegistrationDao.findClassGroupStu(musicGroupId, null);
+            if (registrations != null && registrations.size() > 0) {
+                Map<Integer, String> map = new HashMap<>(registrations.size());
+                registrations.forEach(e -> {
+                    map.put(e.getUserId(), e.getUserId().toString());
+                });
+                sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_CLOSE,
+                        map, null, 0, "1", musicGroup.getName(), sysConfigDao.findConfigValue(SysConfigService.REFUND_PERIOD));
+            }
         }
         //记录建团日志
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, "取消乐团", sysUser.getId(), ""));
@@ -1606,12 +1575,14 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
             paymentDetail.setComAmount(studentPaymentOrder.getComAmount().negate());
             paymentDetail.setPerAmount(studentPaymentOrder.getPerAmount().negate());
             sysUserCashAccountDetailService.insert(paymentDetail);
-
-            // 发送续费结果通知
-            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, push, null, 0, "1",
-                    studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
-            sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, yimei, null, 0, "1",
-                    studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
+            MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+            if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+                // 发送续费结果通知
+                sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, push, null, 0, "1",
+                        studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
+                sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.STUDENT_SMS_MUSIC_GROUP_RENEW_SUCCESS, yimei, null, 0, "1",
+                        studentRegistration.getParentsName(), studentPaymentOrder.getActualAmount());
+            }
             return true;
         } else {
             if (studentPaymentOrder.getBalancePaymentAmount() != null && studentPaymentOrder.getBalancePaymentAmount().doubleValue() > 0) {
@@ -1619,13 +1590,16 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
                         "乐团续费失败");
             }
         }
-        if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
-            String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
-            String memo = baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
-            //4?http://mstudev.dayaedu.com/#/renew?musicGroupId=" +musicGroupId
-            sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_RENEW_FAILED, push, null, 0, "4?" + memo,
-                    HttpUtil.getSortUrl(memo));
-            return false;
+        MusicGroup musicGroup = musicGroupDao.get(musicGroupId);
+        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+            if (studentPaymentOrder.getStatus() == DealStatusEnum.CLOSE || studentPaymentOrder.getStatus() == DealStatusEnum.FAILED) {
+                String baseUrl = sysConfigDao.findConfigValue(SysConfigService.BASE_API_URL);
+                String memo = baseUrl + "/#/renew?musicGroupId=" + musicGroupId;
+                //4?http://mstudev.dayaedu.com/#/renew?musicGroupId=" +musicGroupId
+                sysMessageService.batchSendMessage(MessageSender.JIGUANG, MessageTypeEnum.STUDENT_PUSH_MUSIC_GROUP_RENEW_FAILED, push, null, 0, "4?" + memo,
+                        HttpUtil.getSortUrl(memo));
+                return false;
+            }
         }
         return false;
     }
@@ -1864,20 +1838,21 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroup.setPaymentExpireDate(DateUtil.toDate(expireDate));
         musicGroup.setStatus(MusicGroupStatusEnum.PAY);
         musicGroupDao.update(musicGroup);
-
-        //获取所有已报名学员列表
-        HashMap<Integer, String> map = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findMapByMusicGroupId(musicGroupId, 0))), HashMap.class);
-        if (map != null && map.size() > 0) {
-            String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
-            String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
-            sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.SMS_PAYMENT_MESSAGE,
-                    map, null, 0, "", musicGroup.getName(), studentApplyUrl, DateUtil.format(musicGroup.getPaymentExpireDate(), DateUtil.DATE_FORMAT_MIN), serverPhone);
+        //三方乐团不发送缴费通知
+        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+            //获取所有已报名学员列表
+            HashMap<Integer,String> map = JSONObject.parseObject(JSONObject.toJSONString(MapUtil.convertMybatisMap(studentRegistrationDao.findMapByMusicGroupId(musicGroupId,0))), HashMap.class);
+            if(map != null && map.size() > 0){
+                String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
+                String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
+                sysMessageService.batchSendMessage(MessageSender.YIMEI,MessageTypeEnum.SMS_PAYMENT_MESSAGE,
+                        map,null,0,"",musicGroup.getName(),studentApplyUrl,DateUtil.format(musicGroup.getPaymentExpireDate(),DateUtil.DATE_FORMAT_MIN),serverPhone);
+            }
         }
         Set<Integer> roleIds = new HashSet<>(3);
         roleIds.add(SysUserRole.SECTION_MANAGER);
         roleIds.add(SysUserRole.EDUCATIONAL_TEACHER);
         roleIds.add(SysUserRole.OPERATION_EXECUTIVE);
-
         sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId() + ""), MessageTypeEnum.BACKSTAGE_ACTION_PAYMENT, "", musicGroup.getName());
         //所有人开启缴费
         studentRegistrationDao.musicGroupOpenPay(musicGroupId, PaymentStatusEnum.OPEN);
@@ -1947,24 +1922,25 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         musicGroupBuildLogDao.insert(new MusicGroupBuildLog(musicGroupId, event, sysUser.getId(), ""));
         musicGroup.setStatus(MusicGroupStatusEnum.PREPARE);
         musicGroupDao.update(musicGroup);
-        //给家长发送乐团基础训练课短信
-        //获取所有乐团学员列表
-        List<StudentRegistration> students = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupId);
-        if (students != null && students.size() > 0) {
-            // 获取所有家长电话
-            Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
-            // 获取对应家长的用户编号
-            Map<Integer, String> userIds = MapUtil.convertMybatisMap(studentRegistrationDao.findParentId(StringUtils.join(parentsPhones, ",")));
-            userIds = JSONObject.parseObject(JSONObject.toJSONString(userIds), HashMap.class);
-            if (userIds != null && userIds.size() > 0) {
-                String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
-                String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
-                sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE, userIds, null, 0, "", musicGroup.getName(), studentApplyUrl, serverPhone);
+        if(musicGroup.getOwnershipType() != null && musicGroup.getOwnershipType() == CooperationOrgan.OwnershipType.OWN){
+            //给家长发送乐团基础训练课短信
+            //获取所有乐团学员列表
+            List<StudentRegistration> students = studentRegistrationDao.queryStudentByMusicGroupId(musicGroupId);
+            if (students != null && students.size() > 0) {
+                // 获取所有家长电话
+                Set<String> parentsPhones = students.stream().map(StudentRegistration::getParentsPhone).collect(Collectors.toSet());
+                // 获取对应家长的用户编号
+                Map<Integer, String> userIds = MapUtil.convertMybatisMap(studentRegistrationDao.findParentId(StringUtils.join(parentsPhones, ",")));
+                userIds = JSONObject.parseObject(JSONObject.toJSONString(userIds), HashMap.class);
+                if (userIds != null && userIds.size() > 0) {
+                    String studentApplyUrl = sysConfigDao.findConfigValue(SysConfigService.STUDENT_APPLY_URL) + musicGroupId;
+                    String serverPhone = sysConfigDao.findConfigValue(SysConfigService.SERVER_PHONE);
+                    sysMessageService.batchSendMessage(MessageSender.YIMEI, MessageTypeEnum.SMS_BASICS_SKILL_APPLY_MESSAGE, userIds, null, 0, "", musicGroup.getName(), studentApplyUrl, serverPhone);
+                }
             }
         }
         Set<Integer> roleIds = new HashSet<>(1);
         roleIds.add(SysUserRole.SECTION_MANAGER);
-
         sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId() + ""), MessageTypeEnum.BACKSTAGE_MUSIC_GROUP_MARKING, "", musicGroup.getName());
     }
 }

+ 49 - 53
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,19 +836,22 @@ 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());
@@ -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);
     }

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

@@ -115,7 +115,7 @@
         1、乙方在签订本协议、交纳乐器使用押金¥${depositFee?string("0.00")}元(大写人民币${depositFeeFmt})后,享有所借用乐器在学校乐团期间的免费使用权。乙方应当爱惜乐器并妥善保管,不得将该乐器转租、借用、出售、典当、质押或抵押,也不得将乐器交于非专业人士使用。乐器借用政策,每位团员仅可享受一次,退团后再次加入乐团的,将无法享受乐器借用政策。<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>

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

@@ -1881,6 +1881,9 @@
                     #{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>
@@ -1891,13 +1894,13 @@
                 AND cs.class_group_id_=#{classGroupId}
             </if>
             <if test="startTime!=null and endTime==null">
-                AND CONCAT(cs.class_date_,' ',cs.start_class_time_) &gt; #{startTime}
+                AND cs.class_date_ &gt; DATE_FORMAT(#{startTime},"%Y-%m-%d")
             </if>
             <if test="startTime==null and endTime!=null">
-                AND CONCAT(cs.class_date_,' ',cs.start_class_time_) &lt; #{endTime}
+                AND cs.class_date_ &lt; DATE_FORMAT(#{endTime},"%Y-%m-%d")
             </if>
             <if test="startTime!=null and endTime!=null">
-                AND CONCAT(cs.class_date_,' ',cs.start_class_time_) BETWEEN #{startTime} AND #{endTime}
+                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}

+ 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>

+ 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("禁止访问");