Browse Source

Merge remote-tracking branch 'origin/children_day' into children_day

zouxuan 4 years ago
parent
commit
1cc33d2f0c

+ 15 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ChildrenDayReserveDao.java

@@ -1,6 +1,7 @@
 package com.ym.mec.biz.dal.dao;
 
 
+import com.ym.mec.biz.dal.dto.ChildrenDayMsgDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDetailDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDto;
 import com.ym.mec.biz.dal.entity.ChildrenDayReserve;
@@ -15,6 +16,7 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
 
     /**
      * 获取后台考级活动列表
+     *
      * @param params
      * @return
      */
@@ -22,6 +24,7 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
 
     /**
      * 获取后台考级活动列表
+     *
      * @param params
      * @return
      */
@@ -29,6 +32,7 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
 
     /**
      * 根据用户id获取用户预约信息
+     *
      * @param userId
      * @return
      */
@@ -36,6 +40,7 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
 
     /**
      * 获取后台考级活动详情列表
+     *
      * @param params
      * @return
      */
@@ -43,6 +48,7 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
 
     /**
      * 获取后台考级活动详情列表
+     *
      * @param params
      * @return
      */
@@ -50,6 +56,7 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
 
     /**
      * 统计
+     *
      * @param params
      * @return
      */
@@ -61,4 +68,12 @@ public interface ChildrenDayReserveDao extends BaseDAO<Integer, ChildrenDayReser
      * @return
      */
     List<ChildrenStatisticsDetailDto> exportStatisticsDetail(ChildrenReserveQueryInfo queryInfo);
+
+    /**
+     * 获取发送的信息的用户
+     *
+     * @param msgDtos
+     * @return
+     */
+    List<ChildrenStatisticsDetailDto> getSendMsgList(@Param("msgDtos") List<ChildrenDayMsgDto> msgDtos);
 }

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

@@ -11,6 +11,9 @@ public class ChildrenDayDetailDto {
     @ApiModelProperty(value = "用户信息", required = false)
     private SysUser user;
 
+    @ApiModelProperty(value = "声部id", required = false)
+    private Integer subjectId;
+
     @ApiModelProperty(value = "购买信息详情", required = false)
     private List<ChildrenDayDegreeDetail> childrenDayDegreeDetails;
 
@@ -22,6 +25,14 @@ public class ChildrenDayDetailDto {
         this.user = user;
     }
 
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
     public List<ChildrenDayDegreeDetail> getChildrenDayDegreeDetails() {
         return childrenDayDegreeDetails;
     }

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ChildrenDayMsgDto.java

@@ -0,0 +1,29 @@
+package com.ym.mec.biz.dal.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+
+public class ChildrenDayMsgDto {
+
+    @ApiModelProperty(value = "分部id", required = false)
+    private Integer organId;
+
+    @ApiModelProperty(value = "乐团id", required = false)
+    private String musicGroupId;
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(String musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+}

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

@@ -169,7 +169,9 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     BACKSTAGE_STUDENT_APPLY_QUIT_GROUP("BACKSTAGE_STUDENT_APPLY_QUIT_GROUP", "学员申请退团"),
 
     BACKSTAGE_STUDENT_APPLY_QUIT_COURSE("BACKSTAGE_STUDENT_APPLY_QUIT_COURSE", "学员申请退课"),
-    BACKSTAGE_STUDENT_APPLY_WITHDRAW("BACKSTAGE_STUDENT_APPLY_WITHDRAW", "学员申请提现");
+    BACKSTAGE_STUDENT_APPLY_WITHDRAW("BACKSTAGE_STUDENT_APPLY_WITHDRAW", "学员申请提现"),
+    CHILDREN_DAY_NOTICE_PUSH("CHILDREN_DAY_NOTICE_PUSH", "技能评测考级报名推送"),
+    CHILDREN_DAY_NOTICE_MSG("CHILDREN_DAY_NOTICE_MSG", "技能评测考级报名短信");
 
     MessageTypeEnum(String code, String msg) {
         this.code = code;

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

@@ -73,4 +73,12 @@ public interface ChildrenDayReserveService extends BaseService<Integer, Children
      * @return
      */
     List<ChildrenStatisticsDetailDto> exportStatisticsDetail(ChildrenReserveQueryInfo queryInfo);
+
+    /**
+     * 发送短信和推送
+     *
+     * @param msgDtos
+     * @return
+     */
+    Boolean sendMsg(List<ChildrenDayMsgDto> msgDtos);
 }

+ 38 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ChildrenDayReserveServiceImpl.java

@@ -15,6 +15,7 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.date.DateUtil;
+import com.ym.mec.util.http.HttpUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -172,10 +173,6 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
     public Map pay(DegreePayDto degreePayDto) throws Exception {
         studentDao.lockUser(degreePayDto.getUserId());
 
-        if (degreePayDto.getTheoryLevel() != null && !degreePayDto.getTheoryCourse()) {
-            throw new BizException("参加乐理考试,请选乐理考级专项训练课");
-        }
-
         //检查进行中的订单
         List<ChildrenDayDegreeDetail> details = childrenDayDegreeDetailService.getByUserIdAndStatus(degreePayDto.getUserId(), 1);
 
@@ -190,9 +187,18 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
             }
         }
 
+        //获取课程的价格
+        OrganizationDegreeCourseFee courseFee = organizationDegreeCourseFeeDao.getByOrganId(degreePayDto.getOrganId());
+
         //检查已经购买的课程(不能重复)
         details = childrenDayDegreeDetailService.getByUserIdAndStatus(degreePayDto.getUserId(), 2);
         Set<Integer> detailTypes = details.stream().map(ChildrenDayDegreeDetail::getType).collect(Collectors.toSet());
+
+        if (degreePayDto.getTheoryLevel() != null && degreePayDto.getTheoryLevel() > 0 &&
+                courseFee != null && !degreePayDto.getTheoryCourse() && !detailTypes.contains(5)) {
+            throw new BizException("参加乐理考试,请选乐理考级专项训练课");
+        }
+
         if (degreePayDto.getVip1v1() && detailTypes.contains(3)) {
             throw new BizException("您已购买过VIP 1V1课程,请勿重复选择");
         }
@@ -214,12 +220,16 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
             if (hasList.size() > 0) {
                 throw new BizException("您已报考同声部同等级,请勿重复报考");
             }
+
+            if (degreePayDto.getNeedVipCourse() && !detailTypes.contains(3) && !detailTypes.contains(4)) {
+                throw new BizException("请选择VIP课程");
+            }
         }
 
         //检查乐理考级等级是否重复
         if (degreePayDto.getTheoryLevel() != null && degreePayDto.getTheoryLevel() > 0) {
             List<ChildrenDayDegreeDetail> hasList = details.stream().filter(e -> e.getType().equals(2))
-                    .filter(e -> e.getLevel().equals(degreePayDto.getMusicGradeLevel())).collect(Collectors.toList());
+                    .filter(e -> e.getLevel().equals(degreePayDto.getTheoryLevel())).collect(Collectors.toList());
             if (hasList.size() > 0) {
                 throw new BizException("您已报考同等级乐理,请勿重复报考");
             }
@@ -232,13 +242,6 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
         }
         degreePayDto.setReserveId(userReserve.getId());
 
-        //获取课程的价格
-        OrganizationDegreeCourseFee courseFee = organizationDegreeCourseFeeDao.getByOrganId(degreePayDto.getOrganId());
-
-        if (courseFee == null) {
-            throw new BizException("刚前分部不参与,谢谢关注");
-        }
-
         List<DegreeLevelFee> degreeLevelFees = degreeLevelFeeDao.getAll();
 
         //订单总金额
@@ -437,4 +440,27 @@ public class ChildrenDayReserveServiceImpl extends BaseServiceImpl<Integer, Chil
     public List<ChildrenStatisticsDetailDto> exportStatisticsDetail(ChildrenReserveQueryInfo queryInfo) {
         return childrenDayReserveDao.exportStatisticsDetail(queryInfo);
     }
+
+    @Override
+    public Boolean sendMsg(List<ChildrenDayMsgDto> msgDtos) {
+        List<ChildrenStatisticsDetailDto> reserves = childrenDayReserveDao.getSendMsgList(msgDtos);
+
+        Map<Integer, String> userMap = new HashMap<>();
+        Map<Integer, String> userPhoneMap = new HashMap<>();
+
+        for (ChildrenStatisticsDetailDto reserve : reserves) {
+            userMap.put(reserve.getUserId(), reserve.getUserId().toString());
+            userPhoneMap.put(reserve.getUserId(), reserve.getPhone());
+        }
+
+        String baseApiUrl = sysConfigDao.findConfigValue("base_api_url");
+        String pushUrl = baseApiUrl + "/#/childrenPayment";
+
+        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.JIGUANG, MessageTypeEnum.CHILDREN_DAY_NOTICE_PUSH,
+                userMap, null, 0, "5?" + pushUrl, "STUDENT");
+
+        sysMessageService.batchSendMessage(MessageSenderPluginContext.MessageSender.AWSMS, MessageTypeEnum.CHILDREN_DAY_NOTICE_MSG,
+                userPhoneMap, null, 0, null, null, pushUrl);
+        return true;
+    }
 }

+ 32 - 15
mec-biz/src/main/resources/config/mybatis/ChildrenDayReserveMapper.xml

@@ -124,20 +124,20 @@
     </select>
 
     <select id="childrenStatistics" resultMap="ChildrenStatisticsDtoMap">
-        SELECT  SUM(CASE WHEN cdd.grade_price_ > 0 THEN 1 ELSE NULL END) 'instrumental_music_num_',
-                SUM(CASE WHEN cdd.theory_price_ > 0 THEN 1 ELSE NULL END) 'music_theory_num_',
-                SUM(CASE WHEN cdd.vip_1v1_price_ > 0 THEN 1 ELSE NULL END) 'buy_vip1_num_',
-                SUM(cdd.vip_1v1_price_) 'buy_vip1_amount_',
-                SUM(CASE WHEN cdd.vip_1v2_price_ > 0 THEN 1 ELSE NULL END) 'buy_vip2_num_',
-                SUM(cdd.vip_1v2_price_) 'buy_vip2_amount_',
-                SUM(CASE WHEN cdd.theory_course_price_ > 0 THEN 1 ELSE NULL END) 'buy_music_theory_num_',
-                SUM(cdd.theory_course_price_) 'buy_music_theory_amount_',
-                SUM(cdd.total_amount_) 'total_amount_'
+        SELECT SUM(CASE WHEN cdd.grade_price_ > 0 THEN 1 ELSE NULL END) 'instrumental_music_num_',
+        SUM(CASE WHEN cdd.theory_price_ > 0 THEN 1 ELSE NULL END) 'music_theory_num_',
+        SUM(CASE WHEN cdd.vip_1v1_price_ > 0 THEN 1 ELSE NULL END) 'buy_vip1_num_',
+        SUM(cdd.vip_1v1_price_) 'buy_vip1_amount_',
+        SUM(CASE WHEN cdd.vip_1v2_price_ > 0 THEN 1 ELSE NULL END) 'buy_vip2_num_',
+        SUM(cdd.vip_1v2_price_) 'buy_vip2_amount_',
+        SUM(CASE WHEN cdd.theory_course_price_ > 0 THEN 1 ELSE NULL END) 'buy_music_theory_num_',
+        SUM(cdd.theory_course_price_) 'buy_music_theory_amount_',
+        SUM(cdd.total_amount_) 'total_amount_'
         FROM children_day_reserve cdr
-                 LEFT JOIN children_day_degree_info cdd ON cdr.id_ = cdd.reserve_id_
-                 LEFT JOIN music_group mg ON mg.id_ = cdr.music_group_id_
-                 LEFT JOIN cooperation_organ co ON co.id_ = cdr.cooperation_organ_id_
-                 LEFT JOIN organization o ON o.id_ = cdr.organ_id_
+        LEFT JOIN children_day_degree_info cdd ON cdr.id_ = cdd.reserve_id_
+        LEFT JOIN music_group mg ON mg.id_ = cdr.music_group_id_
+        LEFT JOIN cooperation_organ co ON co.id_ = cdr.cooperation_organ_id_
+        LEFT JOIN organization o ON o.id_ = cdr.organ_id_
         <include refid="queryChildrenStatisticsSql"/>
     </select>
     <sql id="queryChildrenStatisticsSql">
@@ -184,7 +184,8 @@
         <include refid="queryChildrenStatisticsDetailSql"/>
     </select>
     <select id="queryChildrenStatisticsDetail" resultMap="ChildrenStatisticsDetailDtoMap">
-        SELECT su.username_,su.phone_,cdr.user_id_,cdr.is_reserve_,s.name_ subject_name_,cdd.grade_level_,cdd.theory_level_,
+        SELECT su.username_,su.phone_,cdr.user_id_,cdr.is_reserve_,s.name_
+        subject_name_,cdd.grade_level_,cdd.theory_level_,
         CASE WHEN cdd.vip_1v1_price_ > 0 OR cdd.vip_1v2_price_ > 0 THEN 1 ELSE 0 END buy_vip_flag_,
         CASE WHEN cdd.theory_course_price_ > 0 THEN 1 ELSE 0 END buy_theory_course_flag_,cdd.total_amount_
         FROM children_day_reserve cdr
@@ -225,7 +226,8 @@
     <sql id="queryChildrenStatisticsDetailSql">
         <where>
             <if test="search != null and search != ''">
-                AND (cdr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
+                AND (cdr.user_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE
+                CONCAT('%',#{search},'%'))
             </if>
             <if test="isReserve != null">
                 AND cdr.is_reserve_ = #{isReserve}
@@ -282,4 +284,19 @@
             </if>
         </where>
     </sql>
+
+    <select id="getSendMsgList" resultMap="ChildrenStatisticsDetailDtoMap">
+        SELECT cdr.*,su.phone_ FROM children_day_reserve cdr
+        LEFT JOIN sys_user su ON su.id_ = cdr.user_id_
+        <where>
+            <foreach collection="msgDtos" item="msgDto" separator=",">
+                <if test="msgDto.musicGroupId != null">
+                    OR (cdr.organ_id_=#{msgDto.organId} AND cdr.music_group_id_ = #{msgDto.musicGroupId})
+                </if>
+                <if test="msgDto.musicGroupId == null">
+                    OR (cdr.organ_id_=#{msgDto.organId} AND cdr.music_group_id_ IS NULL)
+                </if>
+            </foreach>
+        </where>
+    </select>
 </mapper>

+ 11 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayController.java

@@ -3,6 +3,7 @@ package com.ym.mec.student.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.StudentDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.DegreeFeeDto;
 import com.ym.mec.biz.dal.dto.DegreePayDto;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
@@ -13,12 +14,14 @@ import com.ym.mec.biz.service.ChildrenDayReserveService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -35,6 +38,8 @@ public class ChildrenDayController extends BaseController {
     private StudentDao studentDao;
     @Autowired
     private ChildrenDayDegreeDetailService childrenDayDegreeDetailService;
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
     @ApiOperation(value = "占位")
     @PostMapping("/reserve")
@@ -74,6 +79,12 @@ public class ChildrenDayController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败,请重新登陆");
         }
+        Date nowTime = new Date();
+        String endTimeStr = sysConfigDao.findConfigValue("children_day_end_time");
+        Date endTime = DateUtil.stringToDate(endTimeStr);
+        if (endTime.compareTo(nowTime) <= 0) {
+            throw new BizException("活动已结束,谢谢关注");
+        }
         studentDao.lockUser(sysUser.getId());
 
         degreePayDto.setUserId(sysUser.getId());

+ 13 - 9
mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayDegreeDetailController.java

@@ -4,24 +4,22 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.StudentDao;
 import com.ym.mec.biz.dal.dto.ChildrenDayDetailDto;
-import com.ym.mec.biz.dal.dto.DegreeFeeDto;
-import com.ym.mec.biz.dal.dto.DegreePayDto;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
-import com.ym.mec.biz.dal.entity.ChildrenDayReserve;
-import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import com.ym.mec.biz.dal.entity.Student;
 import com.ym.mec.biz.service.ChildrenDayDegreeDetailService;
-import com.ym.mec.biz.service.ChildrenDayReserveService;
 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.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Arrays;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 
 @RequestMapping("childrenDayDegreeDetail")
@@ -32,7 +30,8 @@ public class ChildrenDayDegreeDetailController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private ChildrenDayDegreeDetailService childrenDayDegreeDetailService;
-
+    @Autowired
+    private StudentDao studentDao;
 
     @ApiOperation(value = "获取用户已报名的详情,类型 1-乐器考级 2-乐理考级 3-vip1v1,4-vip1v2 5-乐理课")
     @GetMapping("/getUserDegreeInfo")
@@ -45,6 +44,11 @@ public class ChildrenDayDegreeDetailController extends BaseController {
         ChildrenDayDetailDto childrenDayDetailDto = new ChildrenDayDetailDto();
         childrenDayDetailDto.setUser(user);
         childrenDayDetailDto.setChildrenDayDegreeDetails(userDegreeInfo);
+        Student student = studentDao.get(user.getId());
+        if (student != null && StringUtils.isNotBlank(student.getSubjectIdList())) {
+            List<String> subjectIds = Arrays.asList(student.getSubjectIdList().split(","));
+            childrenDayDetailDto.setSubjectId(Integer.parseInt(subjectIds.get(0)));
+        }
         return succeed(childrenDayDetailDto);
     }
 

+ 4 - 0
mec-student/src/main/java/com/ym/mec/student/controller/StudentOrderController.java

@@ -89,6 +89,8 @@ public class StudentOrderController extends BaseController {
     private MusicGroupPaymentCalenderCourseSettingsDao musicGroupPaymentCalenderCourseSettingsDao;
     @Autowired
     private ReplacementInstrumentActivityDao replacementInstrumentActivityDao;
+    @Autowired
+    private ChildrenDayDegreeDetailDao childrenDayDegreeDetailDao;
 
 
     @Value("${spring.profiles.active:dev}")
@@ -182,6 +184,8 @@ public class StudentOrderController extends BaseController {
             orderDetail.put("detail", studentGoodsSellDao.getStudentGoodsSellDto(orderNo));
         } else if (orderByOrderNo.getGroupType().equals(GroupType.REPLACEMENT)) {
             orderDetail.put("detail", replacementInstrumentActivityDao.getInfo(Integer.parseInt(orderByOrderNo.getMusicGroupId())));
+        } else if (orderByOrderNo.getGroupType().equals(GroupType.DEGREE)) {
+            orderDetail.put("detail", childrenDayDegreeDetailDao.getByOrderId(orderByOrderNo.getId()));
         }
         return succeed(orderDetail);
     }

+ 12 - 3
mec-web/src/main/java/com/ym/mec/web/controller/ChildrenReserveController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dto.ChildrenDayMsgDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDetailDto;
 import com.ym.mec.biz.dal.dto.ChildrenStatisticsDto;
 import com.ym.mec.biz.dal.entity.Employee;
@@ -44,11 +45,11 @@ public class ChildrenReserveController extends BaseController {
         Employee employee = employeeDao.get(sysUser.getId());
         if (StringUtils.isEmpty(queryInfo.getOrganId())) {
             queryInfo.setOrganId(employee.getOrganIdList());
-        }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+        } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
             return failed("用户所在分部异常");
-        }else {
+        } else {
             List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-            if(!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))){
+            if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
                 return failed("非法请求");
             }
         }
@@ -61,4 +62,12 @@ public class ChildrenReserveController extends BaseController {
     public HttpResponseResult<PageInfo<ChildrenStatisticsDetailDto>> queryStatisticsDetailPage(ChildrenReserveQueryInfo queryInfo) {
         return succeed(childrenDayReserveService.queryStatisticsDetailPage(queryInfo));
     }
+
+
+    @ApiOperation(value = "发送短信和推送")
+    @PostMapping("/sendMsg")
+    @PreAuthorize("@pcs.hasPermissions('childrenReserve/sendMsg')")
+    public HttpResponseResult sendMsg(@RequestBody List<ChildrenDayMsgDto> msgDto) {
+        return succeed(childrenDayReserveService.sendMsg(msgDto));
+    }
 }