Sfoglia il codice sorgente

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

zouxuan 5 anni fa
parent
commit
ea27a2d72a

+ 66 - 49
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -551,14 +551,18 @@ 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()
@@ -741,15 +745,18 @@ 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()
@@ -946,15 +953,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);
+                }
             }
         }
     }
@@ -1055,14 +1064,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(), ""));
@@ -1608,12 +1619,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) {
@@ -1621,13 +1634,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;
     }
@@ -1951,24 +1967,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());
     }
 }

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

@@ -652,14 +652,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;
         }

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