Преглед на файлове

Merge remote-tracking branch 'origin/master'

周箭河 преди 5 години
родител
ревизия
09b2e4a54d

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

@@ -23,11 +23,11 @@ public interface VipGroupDefaultClassesUnitPriceDao extends BaseDAO<Integer, Vip
      * @describe 根据vip课类型获取课时收费设置
      */
     VipGroupDefaultClassesUnitPrice getByVipGroupCategory(@Param("vipGroupCategoryId") Long vipGroupCategoryId,
-                                                          @Param("organId") Long organId);
+                                                          @Param("organId") Integer organId);
 
 
     int updateByVipGroupCategory(VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice);
 
     List<VipGroupDefaultClassesUnitPrice> findAllByOrgan(Long organId);
 
-}
+}

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

@@ -28,7 +28,7 @@ public class VipGroupDefaultClassesUnitPriceServiceImpl extends BaseServiceImpl<
 		if(Objects.isNull(bean.getOrganId())){
 			throw new BizException("请选择分部");
 		}
-		VipGroupDefaultClassesUnitPrice byVipGroupCategory = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory( bean.getVipGroupCategoryId().longValue(),bean.getOrganId().longValue());
+		VipGroupDefaultClassesUnitPrice byVipGroupCategory = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory( bean.getVipGroupCategoryId().longValue(),bean.getOrganId());
 		if(null!=byVipGroupCategory){
 			return vipGroupDefaultClassesUnitPriceDao.updateByVipGroupCategory(bean);
 		}else{

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

@@ -195,6 +195,15 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			throw new BizException("开课时间不能小于当前时间");
 		}
 
+		if(vipGroupApplyBaseInfoDto.getRegistrationStartTime().after(vipGroupApplyBaseInfoDto.getPaymentExpireDate())){
+		    throw new BizException("报名开始时间必须在报名截至时间之前");
+        }
+
+		if(vipGroupApplyBaseInfoDto.getPaymentExpireDate().after(firstCourseSchedule.getStartClassTime())
+            ||DateUtil.isSameDay(vipGroupApplyBaseInfoDto.getPaymentExpireDate(),firstCourseSchedule.getEndClassTime())){
+		    throw new BizException("创建失败,报名截止时间必须在开课时间前一天");
+        }
+
 		//判断课程安排是否超出范围
 		if(Objects.nonNull(vipGroupActivity.getCoursesEndTime())||Objects.nonNull(vipGroupActivity.getCoursesStartTime())){
 			if(latestCourseSchedule.getEndClassTime().after(vipGroupActivity.getCoursesEndTime())
@@ -251,13 +260,13 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 //			throw new BizException("教师总课酬不能高于课程总价60%");
 //		}
 
+        vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
+
 		//如果默认课酬与实际课酬不匹配则需要审批
 		if(costInfo.get("offlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOfflineTeacherSalary())<0||
 			costInfo.get("onlineTeacherSalary").compareTo(vipGroupApplyBaseInfoDto.getOnlineTeacherSalary())<0
 			&&StringUtils.isBlank(studentIds)){
 			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
-		}else{
-			vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.PASS);
 		}
 
 		vipGroupApplyBaseInfoDto.setTotalPrice(costInfo.get("totalPrice"));
@@ -266,19 +275,38 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		}else{
 			vipGroupApplyBaseInfoDto.setStatus(VipGroupStatusEnum.APPLYING);
 		}
-//        Teacher teacher = teacherService.get(sysUser.getId());
-//		if(teacher.getOrganId().indexOf(",")!=-1){
-//		    throw new BizException("教师部门异常");
-//        }
+        Teacher teacher = teacherService.get(vipGroupApplyBaseInfoDto.getUserId());
+		if(Objects.isNull(teacher)){
+		    throw new BizException("教师不存在");
+        }
+		if(Objects.isNull(teacher.getTeacherOrganId())){
+		    throw new BizException("教师部门异常");
+        }
 //        vipGroupApplyBaseInfoDto.setOrganId(Integer.parseInt(teacher.getOrganId()));
 		//开课时间为排课的第一节课的开始时间
 		vipGroupApplyBaseInfoDto.setCourseStartDate(firstCourseSchedule.getStartClassTime());
 		//课程结束时间为排课的最后一节课的结束时间
 		vipGroupApplyBaseInfoDto.setCoursesExpireDate(latestCourseSchedule.getEndClassTime());
-		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
 
-		//获取vip课类型信息
-		VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId().intValue());
+        //获取vip课类型信息
+        VipGroupCategory vipGroupCategory = vipGroupCategoryDao.get(vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId().intValue());
+
+        VipGroupDefaultClassesUnitPrice vipGroupDefaultClassesUnitPrice = vipGroupDefaultClassesUnitPriceDao.getByVipGroupCategory(vipGroup.getVipGroupApplyBaseInfo().getVipGroupCategoryId(), teacher.getTeacherOrganId());
+
+        if(Objects.isNull(vipGroupDefaultClassesUnitPrice)){
+            vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
+        }else{
+            if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice())
+                    &&vipGroupApplyBaseInfoDto.getOfflineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOfflineClassesUnitPrice())!=0){
+                vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
+            }
+            if(Objects.nonNull(vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice())
+                    &&vipGroupApplyBaseInfoDto.getOnlineClassesUnitPrice().compareTo(vipGroupDefaultClassesUnitPrice.getOnlineClassesUnitPrice())!=0){
+                vipGroupApplyBaseInfoDto.setAuditStatus(AuditStatusEnum.ING);
+            }
+        }
+
+		vipGroupDao.insert(vipGroupApplyBaseInfoDto);
 
 		//创建班级信息
 		ClassGroup classGroup=new ClassGroup();
@@ -347,7 +375,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		roleIds.add(SysUserRole.OPERATION_EXECUTIVE);
 		Map<String,Long> memo = new HashMap<>(1);
 		memo.put("vipGroupId",vipGroupApplyBaseInfoDto.getId());
-		Teacher teacher = teacherDao.get(vipGroup.getVipGroupApplyBaseInfo().getUserId());
 //		SysUser sysUser = sysUserFeignService.queryUserById(vipGroup.getVipGroupApplyBaseInfo().getUserId());
 		if(Objects.isNull(teacher)){
 			throw new BizException("该用户不存在");
@@ -1634,7 +1661,59 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		return studentRecoverInfoDto;
     }
 
-    @Override
+//    @Override
+//	@Transactional(rollbackFor = Exception.class)
+//	public Map<String, BigDecimal> getStudentSurplusCourseFee(Long vipGroupId, Integer studentId) {
+//		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){
+//			throw new BizException("请指定课程和学生");
+//		}
+//		VipGroup vipGroup = vipGroupDao.get(vipGroupId);
+//		if(Objects.isNull(vipGroup)){
+//			throw new BizException("未找到指定vip课");
+//		}
+//		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
+//			throw new BizException("不能对已停止的课程进行退课操作");
+//		}
+//		Date now = new Date();
+//        BigDecimal bigDecimal;
+//        List<StudentCourseInfoDto> userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.VIP, vipGroupId.toString(), studentId, null);
+//		if(CollectionUtils.isEmpty(userCourseInfos)&&vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
+//            StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
+//            if(Objects.isNull(studentPaymentOrder)){
+//                bigDecimal=new BigDecimal(0);
+//            }else{
+//                bigDecimal=studentPaymentOrder.getActualAmount();
+//            }
+//        }else if(!CollectionUtils.isEmpty(userCourseInfos)){
+//            BigDecimal historyPrice=new BigDecimal(0);
+//            BigDecimal allPrice=new BigDecimal(0);
+//            for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
+//                allPrice=allPrice.add(userCourseInfo.getExpectPrice());
+//                if(now.after(userCourseInfo.getStartClassTime())){
+//                    historyPrice=historyPrice.add(userCourseInfo.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
+//                }
+//            }
+//            bigDecimal=allPrice.subtract(historyPrice);
+//            if(bigDecimal.longValue()<0){
+//                bigDecimal=new BigDecimal(0);
+//            }
+//        }else{
+//		    bigDecimal=new BigDecimal(0);
+//        }
+//        Map<String,BigDecimal> result=new HashMap<>();
+//		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
+//		if(Objects.isNull(classGroup)){
+//			throw new BizException("未找到对应班级");
+//		}
+//		if(Objects.isNull(bigDecimal)){
+//			bigDecimal = new BigDecimal(0);
+//		}
+//		bigDecimal = bigDecimal.multiply(new BigDecimal(0.8)).setScale(CommonConstants.DECIMAL_FINAL_PLACE, BigDecimal.ROUND_HALF_UP);
+//		result.put("suplusCourseFee", bigDecimal);
+//		return result;
+//	}
+
+	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public Map<String, BigDecimal> getStudentSurplusCourseFee(Long vipGroupId, Integer studentId) {
 		if(Objects.isNull(vipGroupId)||Objects.isNull(studentId)){
@@ -1647,37 +1726,26 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
 			throw new BizException("不能对已停止的课程进行退课操作");
 		}
-		Date now = new Date();
-        BigDecimal bigDecimal;
-        List<StudentCourseInfoDto> userCourseInfos = courseScheduleDao.findUserCourseInfos(GroupType.VIP, vipGroupId.toString(), studentId, null);
-		if(CollectionUtils.isEmpty(userCourseInfos)&&vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
-            StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
-            if(Objects.isNull(studentPaymentOrder)){
-                bigDecimal=new BigDecimal(0);
-            }else{
-                bigDecimal=studentPaymentOrder.getActualAmount();
-            }
-        }else if(!CollectionUtils.isEmpty(userCourseInfos)){
-            BigDecimal historyPrice=new BigDecimal(0);
-            BigDecimal allPrice=new BigDecimal(0);
-            for (StudentCourseInfoDto userCourseInfo : userCourseInfos) {
-                allPrice=allPrice.add(userCourseInfo.getExpectPrice());
-                if(now.after(userCourseInfo.getStartClassTime())){
-                    historyPrice=historyPrice.add(userCourseInfo.getTeachMode().equals(TeachModeEnum.ONLINE)?vipGroup.getOnlineClassesUnitPrice():vipGroup.getOfflineClassesUnitPrice());
-                }
-            }
-            bigDecimal=allPrice.subtract(historyPrice);
-            if(bigDecimal.longValue()<0){
-                bigDecimal=new BigDecimal(0);
-            }
-        }else{
-		    bigDecimal=new BigDecimal(0);
-        }
-        Map<String,BigDecimal> result=new HashMap<>();
+		Map<String,BigDecimal> result=new HashMap<>();
+		if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
+			StudentPaymentOrder studentPaymentOrder = studentPaymentOrderDao.findByStudentVipGroup(vipGroupId, studentId, DealStatusEnum.SUCCESS.getCode());
+			if(Objects.isNull(studentPaymentOrder)){
+				BigDecimal surplusCourseFee = studentPaymentOrderDao.sumSurplusCourseFee(vipGroupId.toString(), studentId);
+				if(Objects.isNull(surplusCourseFee)){
+					result.put("suplusCourseFee",new BigDecimal(0));
+				}else{
+					result.put("suplusCourseFee",surplusCourseFee);
+				}
+			}else{
+				result.put("suplusCourseFee",studentPaymentOrder.getActualAmount());
+			}
+			return result;
+		}
 		ClassGroup classGroup = classGroupDao.findByVipGroup(vipGroupId, null);
 		if(Objects.isNull(classGroup)){
 			throw new BizException("未找到对应班级");
 		}
+		BigDecimal bigDecimal = courseScheduleStudentPaymentDao.countSurplusCourseFee(classGroup.getId(), studentId);
 		if(Objects.isNull(bigDecimal)){
 			bigDecimal = new BigDecimal(0);
 		}
@@ -2456,8 +2524,6 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 			noCreateSuccessVipGroup.setStatus(VipGroupStatusEnum.CANCEL);
 			List<StudentPaymentOrder> studentPaymentOrders = studentPaymentOrderDao.queryByDealStatus(noCreateSuccessVipGroup.getId().toString(),
 					OrderTypeEnum.SMALL_CLASS_TO_BUY, DealStatusEnum.SUCCESS);
-			//推送消息
-			stopVipPush(noCreateSuccessVipGroup.getId(),noCreateSuccessVipGroup.getName());
 
 			for (StudentPaymentOrder studentPaymentOrder:studentPaymentOrders){
 				//生成账户资金明细
@@ -2477,7 +2543,14 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if(!CollectionUtils.isEmpty(userCashAccountDetails)){
 			sysUserCashAccountDetailDao.batchInsert(userCashAccountDetails);
 		}
-		vipGroupDao.batchUpdate(noCreateSuccessVipGroups);
+		if(noCreateSuccessVipGroups != null && noCreateSuccessVipGroups.size() > 0){
+			vipGroupDao.batchUpdate(noCreateSuccessVipGroups);
+			
+			for (VipGroup noCreateSuccessVipGroup : noCreateSuccessVipGroups) {
+				//推送消息
+				stopVipPush(noCreateSuccessVipGroup.getId(),noCreateSuccessVipGroup.getName());
+			}
+		}
 	}
 
 	@Override
@@ -2496,47 +2569,35 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 		if (!CollectionUtils.isEmpty(normalVipGroupList)){
             Date now = new Date();
             List<VipGroup> needUpdateVipGroups = new ArrayList<>();
-            for (VipGroup vipGroup : normalVipGroupList) {
-                try {
-                	if(Objects.isNull(vipGroup.getRegistrationStartTime())){
-                		continue;
+			for (VipGroup vipGroup : normalVipGroupList) {
+				try {
+					if (Objects.isNull(vipGroup.getRegistrationStartTime())) {
+						continue;
 					}
-                	if(vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE)){
-                		continue;
+					if (vipGroup.getStatus().equals(VipGroupStatusEnum.PAUSE) || vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)
+							|| vipGroup.getStatus().equals(VipGroupStatusEnum.FINISHED) || vipGroup.getStatus().equals(VipGroupStatusEnum.PROGRESS)) {
+						continue;
 					}
-                	if(vipGroup.getStatus().equals(VipGroupStatusEnum.CANCEL)){
-                		continue;
+					if (now.before(vipGroup.getRegistrationStartTime())) {
+						vipGroup.setStatus(VipGroupStatusEnum.NOT_START);
+					} else if (vipGroup.getRegistrationStartTime().before(now) && vipGroup.getPaymentExpireDate().after(now)) {
+						vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
 					}
-                    if(now.before(vipGroup.getRegistrationStartTime())){
-                        if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)){
-							vipGroup.setStatus(VipGroupStatusEnum.NOT_START);
-						}
-                    }
-                    if(vipGroup.getRegistrationStartTime().before(now)&&vipGroup.getPaymentExpireDate().after(now)){
-                        if(vipGroup.getStatus().equals(VipGroupStatusEnum.NOT_START)){
-							vipGroup.setStatus(VipGroupStatusEnum.APPLYING);
-						}
-                    }
-                    if(vipGroup.getPaymentExpireDate().before(now)&&vipGroup.getCourseStartDate().after(now)){
-						if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING)) {
-							vipGroup.setStatus(VipGroupStatusEnum.APPLYING_END);
-						}
-                    }
-                    if(vipGroup.getCourseStartDate().before(now)&&vipGroup.getCoursesExpireDate().after(now)){
-						if(vipGroup.getStatus().equals(VipGroupStatusEnum.APPLYING_END)){
-							vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
-						}
-                    }
-                    VipGroup vipGroup1 = new VipGroup();
-                    vipGroup1.setId(vipGroup.getId());
-                    vipGroup1.setStatus(vipGroup.getStatus());
-                    vipGroup1.setUpdateTime(now);
-                    vipGroup1.setTotalPrice(vipGroup.getTotalPrice());
-                    needUpdateVipGroups.add(vipGroup1);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-            }
+					if (vipGroup.getPaymentExpireDate().before(now) && vipGroup.getCourseStartDate().after(now)) {
+						vipGroup.setStatus(VipGroupStatusEnum.APPLYING_END);
+					} else if (vipGroup.getCourseStartDate().before(now) && vipGroup.getCoursesExpireDate().after(now)) {
+						vipGroup.setStatus(VipGroupStatusEnum.PROGRESS);
+					}
+					VipGroup vipGroup1 = new VipGroup();
+					vipGroup1.setId(vipGroup.getId());
+					vipGroup1.setStatus(vipGroup.getStatus());
+					vipGroup1.setUpdateTime(now);
+					vipGroup1.setTotalPrice(vipGroup.getTotalPrice());
+					needUpdateVipGroups.add(vipGroup1);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
             vipGroupDao.batchUpdate(needUpdateVipGroups);
         }
 	}

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

@@ -473,7 +473,7 @@
             AND cg.group_type_ = #{type}
         </if>
         <if test="musicGroupId!=null">
-            AND cs.music_group_id_=#{music_group_id_} AND cs.group_type_='MUSIC'
+            AND cs.music_group_id_=#{musicGroupId} AND cs.group_type_='MUSIC'
         </if>
         AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
         ORDER BY CONCAT(cs.class_date_,' ',cs.start_class_time_)
@@ -498,6 +498,9 @@
                     #{group.id}
                 </foreach>
             </if>
+            <if test="musicGroupId!=null">
+                AND cs.music_group_id_=#{musicGroupId} AND cs.group_type_='MUSIC'
+            </if>
             AND cs.class_date_ = DATE_FORMAT(#{date},'%Y-%m-%d')
     </select>
 

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

@@ -313,6 +313,7 @@
             vg.audit_status_='PASS'
             AND vg.status_=1
             AND vg.courses_expire_date_ &gt;= DATE_FORMAT(NOW(),'%Y%m%d')
+            AND vg.registration_start_time_ &lt;= NOW()
             AND vg.courses_start_date &gt; NOW()
             AND (select count(1) as num from student_payment_order where vg.id_ = music_group_id_ AND user_id_=#{userId} AND status_='SUCCESS') = 0
             AND (vg.organ_id_ = #{organId} OR FIND_IN_SET(#{userId}, vg.student_id_list_))

+ 6 - 6
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/MessageSenderPluginContext.java

@@ -21,13 +21,13 @@ public class MessageSenderPluginContext implements ApplicationContextAware {
 
 	public enum MessageSender {
 
-		JIGUANG("PUSH"), MOXINGTONG("SMS"), SHIYUAN("SMS"),YIMEI("SMS");
-		
+		JIGUANG("PUSH"), MOXINGTONG("SMS"), SHIYUAN("SMS"), YIMEI("SMS");
+
 		/**
 		 * 发送模式(SMS,PUSH,EMAIL)
 		 */
 		private String sendMode;
-		
+
 		private MessageSender(String sendMode) {
 			this.sendMode = sendMode;
 		}
@@ -70,7 +70,7 @@ public class MessageSenderPluginContext implements ApplicationContextAware {
 
 		messageSenderPlugin = getMessageSenderPlugin(messageSender);
 
-		return messageSenderPlugin.send(subject, content, receiver, url,jpushType);
+		return messageSenderPlugin.send(subject, content, receiver, url, jpushType);
 	}
 
 	/**
@@ -87,7 +87,7 @@ public class MessageSenderPluginContext implements ApplicationContextAware {
 
 		messageSenderPlugin = getMessageSenderPlugin(messageSender);
 
-		return messageSenderPlugin.batchSend(subject, content, receivers, url,jpushType);
+		return messageSenderPlugin.batchSend(subject, content, receivers, url, jpushType);
 	}
 
 	@Override
@@ -99,7 +99,7 @@ public class MessageSenderPluginContext implements ApplicationContextAware {
 		String beanId = mapper.get(StringUtils.lowerCase(messageSender.name()));
 
 		if (StringUtils.isBlank(beanId)) {
-			throw new ThirdpartyException("消息提供方不存在");
+			throw new ThirdpartyException("消息提供方:{}不存在", beanId);
 		}
 
 		return applicationContext.getBean(beanId, MessageSenderPlugin.class);

+ 5 - 11
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/message/provider/JiguangPushPlugin.java

@@ -5,12 +5,16 @@ import com.alibaba.fastjson.JSONObject;
 import com.ym.mec.thirdparty.exception.ThirdpartyException;
 import com.ym.mec.thirdparty.message.MessageSenderPlugin;
 import com.ym.mec.util.http.HttpUtil;
+
 import org.apache.commons.codec.binary.Base64;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.stream.Collectors;
 
 /**
  * 极光推送
@@ -188,7 +192,7 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 		JSONObject json = JSONObject.parseObject(result);
 		if (json.containsKey("error")) {
 			JSONObject jsonObject = json.getJSONObject("error");
-			throw new ThirdpartyException(jsonObject.get("message").toString());
+			throw new ThirdpartyException(jsonObject.get("message").toString()+"["+Arrays.stream(receivers).collect(Collectors.joining(","))+"]");
 		}
 		return true;
 	}
@@ -229,14 +233,4 @@ public class JiguangPushPlugin implements MessageSenderPlugin, InitializingBean
 		this.reqURL = reqURL;
 	}
 
-	/*public static void main(String[] args) throws IOException {
-		
-		String str = "2094588";
-		
-		
-		JiguangPushPlugin plugin = new JiguangPushPlugin();
-		
-		plugin.batchSend("基础技能训练报名通知", "家长您好:经五路小学比赛团乐团基础技能训练已经开始缴费。请您在收到本通知后,点击http://mstuonline.dayaedu.com/#/smallRegister?musicGroupId=19121912014300001 进行缴费,若有疑问请咨询800-8208820", str.split(","), "5?http://mstudev.dayaedu.com/#/smallRegister?musicGroupId=19121912014300001");
-	}*/
-
 }

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

@@ -27,8 +27,29 @@
 		</encoder>
 	</appender>
 
+	<appender name="messagefile"
+		class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<FileNamePattern>/mdata/logs/message-%d{yyyy-MM-dd_HH}-%i.log</FileNamePattern>
+			<MaxHistory>90</MaxHistory>
+			<TimeBasedFileNamingAndTriggeringPolicy
+				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<MaxFileSize>20MB</MaxFileSize>
+			</TimeBasedFileNamingAndTriggeringPolicy>
+		</rollingPolicy>
+
+		<encoder>
+			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
+		</encoder>
+	</appender>
+
 	<logger name="com.ym.mec" level="INFO" />
 
+	<logger name="com.ym.mec.thirdparty" level="INFO"
+		additivity="false">
+		<appender-ref ref="messagefile" />
+	</logger>
+
 	<!--开发环境:打印控制台 -->
 	<springProfile name="dev">
 		<root level="INFO">