Преглед изворни кода

部分短信调整,学生vip列表更改

zouxuan пре 5 година
родитељ
комит
f8d0fb081d

+ 14 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentManageDao.java

@@ -154,4 +154,18 @@ public interface StudentManageDao {
      * @param sysUser
      */
     void updateUser(SysUser sysUser);
+
+    /**
+     * 获取学员的vip列表
+     * @param params
+     * @return
+     */
+    List<StudentManageVipGroupClassDto> findStudentVipGroupClass(Map<String, Object> params);
+
+    /**
+     * count学员vip列表
+     * @param params
+     * @return
+     */
+    int countStudentVipGroupClass(Map<String, Object> params);
 }

+ 86 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentManageVipGroupClassDto.java

@@ -0,0 +1,86 @@
+package com.ym.mec.biz.dal.dto;
+
+import java.util.Date;
+
+public class StudentManageVipGroupClassDto {
+
+    private Long vipGroupId;
+
+    private String vipGroupName;
+
+    private String vipGroupStatus;
+
+    private Integer teacherId;
+
+    private String teacherName;
+
+    private Integer studentNum;
+
+    private String activeName;
+
+    private Date courseStartDate;
+
+    public Long getVipGroupId() {
+        return vipGroupId;
+    }
+
+    public void setVipGroupId(Long vipGroupId) {
+        this.vipGroupId = vipGroupId;
+    }
+
+    public String getVipGroupName() {
+        return vipGroupName;
+    }
+
+    public void setVipGroupName(String vipGroupName) {
+        this.vipGroupName = vipGroupName;
+    }
+
+    public String getVipGroupStatus() {
+        return vipGroupStatus;
+    }
+
+    public void setVipGroupStatus(String vipGroupStatus) {
+        this.vipGroupStatus = vipGroupStatus;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public Integer getStudentNum() {
+        return studentNum;
+    }
+
+    public void setStudentNum(Integer studentNum) {
+        this.studentNum = studentNum;
+    }
+
+    public String getActiveName() {
+        return activeName;
+    }
+
+    public void setActiveName(String activeName) {
+        this.activeName = activeName;
+    }
+
+    public Date getCourseStartDate() {
+        return courseStartDate;
+    }
+
+    public void setCourseStartDate(Date courseStartDate) {
+        this.courseStartDate = courseStartDate;
+    }
+}

+ 0 - 4
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentManageVipGroupDto.java

@@ -1,9 +1,5 @@
 package com.ym.mec.biz.dal.dto;
 
-import io.swagger.annotations.ApiModelProperty;
-
-import com.ym.mec.biz.dal.entity.VipGroup;
-
 /**
  * @Author Joburgess
  * @Date 2019/9/20

+ 40 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentManageVipClassQueryInfo.java

@@ -0,0 +1,40 @@
+package com.ym.mec.biz.dal.page;
+
+import com.ym.mec.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+public class StudentManageVipClassQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "学生id",required = true)
+    private Integer studentId;
+
+    @ApiModelProperty(value = "vip课名称",required = true)
+    private String vipGroupName;
+
+    @ApiModelProperty(value = "vip课状态",required = true)
+    private String vipGroupStatus;
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getVipGroupName() {
+        return vipGroupName;
+    }
+
+    public void setVipGroupName(String vipGroupName) {
+        this.vipGroupName = vipGroupName;
+    }
+
+    public String getVipGroupStatus() {
+        return vipGroupStatus;
+    }
+
+    public void setVipGroupStatus(String vipGroupStatus) {
+        this.vipGroupStatus = vipGroupStatus;
+    }
+}

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

@@ -2,11 +2,8 @@ package com.ym.mec.biz.service;
 
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dto.*;
-import com.ym.mec.biz.dal.entity.ClassGroup;
 import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.common.page.PageInfo;
-import com.ym.mec.common.page.QueryInfo;
-import org.snaker.engine.access.Page;
 
 import java.util.List;
 
@@ -112,5 +109,5 @@ public interface StudentManageService {
      * @param queryInfo
      * @return
      */
-    PageInfo<StudentManageVipGroupDto> findStudentVipGroupClass(QueryInfo queryInfo);
+    PageInfo<StudentManageVipGroupClassDto> findStudentVipGroupClass(StudentManageVipClassQueryInfo queryInfo);
 }

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

@@ -1482,8 +1482,8 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
         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_BASICS_SKILL_APPLY_MESSAGE,
-                    map,null,0,"",musicGroup.getName(),studentApplyUrl,serverPhone);
+            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);

+ 27 - 6
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentManageServiceImpl.java

@@ -12,15 +12,13 @@ import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.page.QueryInfo;
 import com.ym.mec.util.collection.MapUtil;
+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.Transactional;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -33,6 +31,8 @@ public class StudentManageServiceImpl implements StudentManageService {
     @Autowired
     private StudentManageDao studentManageDao;
     @Autowired
+    private TeacherDao teacherDao;
+    @Autowired
     private StudentRegistrationDao studentRegistrationDao;
     @Autowired
     private ClassGroupDao classGroupDao;
@@ -244,7 +244,28 @@ public class StudentManageServiceImpl implements StudentManageService {
     }
 
     @Override
-    public PageInfo<StudentManageVipGroupDto> findStudentVipGroupClass(QueryInfo queryInfo) {
-        return null;
+    public PageInfo<StudentManageVipGroupClassDto> findStudentVipGroupClass(StudentManageVipClassQueryInfo queryInfo) {
+        PageInfo<StudentManageVipGroupClassDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+        Map<String, Object> params = new HashMap<>();
+        MapUtil.populateMap(params, queryInfo);
+
+        List<StudentManageVipGroupClassDto> dataList = null;
+        int count = studentManageDao.countStudentVipGroupClass(params);
+        if (count > 0) {
+            pageInfo.setTotal(count);
+            params.put("offset", pageInfo.getOffset());
+            dataList = studentManageDao.findStudentVipGroupClass(params);
+            Set<Integer> teacherIds = dataList.stream().map(e -> e.getTeacherId()).collect(Collectors.toSet());
+            List<Map<Integer, String>> maps = teacherDao.queryNameByIds(StringUtils.join(teacherIds, ","));
+            Map<Integer, String> teacherNameMap = MapUtil.convertMybatisMap(maps);
+            dataList.forEach(e->{
+                e.setTeacherName(teacherNameMap.get(e.getTeacherId()));
+            });
+        }
+        if (count == 0) {
+            dataList = new ArrayList<>();
+        }
+        pageInfo.setRows(dataList);
+        return pageInfo;
     }
 }

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

@@ -658,8 +658,9 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
             studentRegistrationDao.updateCurrentClass(studentRegistration);
             Map<Integer, String> receivers = new HashMap<>(1);
             receivers.put(studentRegistration.getUserId(), studentRegistration.getParentsPhone());
+            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());
+                    receivers, null, 0, null, studentRegistration.getParentsName(), studentRegistration.getName(), musicGroup.getName(),HttpUtil.getSortUrl(studentApplyUrl));
             return userId;
         }
     }

+ 38 - 0
mec-biz/src/main/resources/config/mybatis/StudentManageDao.xml

@@ -470,5 +470,43 @@
         LEFT JOIN course_schedule cs ON sa.course_schedule_id_ = cs.id_
         <include refid="queryMusicGroupStudentsSignSql"/>
     </select>
+    <resultMap id="StudentManageVipGroupClassDto" type="com.ym.mec.biz.dal.dto.StudentManageVipGroupClassDto">
+        <result property="vipGroupId" column="id_"/>
+        <result property="vipGroupName" column="vip_group_name_"/>
+        <result property="vipGroupStatus" column="status_"/>
+        <result property="teacherId" column="user_id_"/>
+        <result property="studentNum" column="student_num_"/>
+        <result property="activeName" column="name_"/>
+        <result property="courseStartDate" column="courses_start_date"/>
+    </resultMap>
+    <select id="findStudentVipGroupClass" resultMap="StudentManageVipGroupClassDto">
+        SELECT vg.id_,vg.name_ vip_group_name_,vg.status_,cgtm.user_id_,cg.student_num_,vgc.name_,vg.courses_start_date
+        FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_
+        LEFT JOIN class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_
+        LEFT JOIN vip_group_activity vgc ON vgc.id_ = vg.vip_group_activity_id_
+        WHERE cg.group_type_ = 'VIP' AND cgtm.teacher_role_ = 'BISHOP' AND cgsm.user_id_ = #{studentId}
+        <if test="vipGroupName != null">
+            AND vg.name_ LIKE CONCAT('%',#{vipGroupName},'%')
+        </if>
+        <if test="vipGroupStatus != null">
+            AND vg.status_ = #{vipGroupStatus}
+        </if>
+    </select>
+    <select id="countStudentVipGroupClass" resultType="java.lang.Integer">
+        SELECT COUNT(vg.id_)
+        FROM class_group_student_mapper cgsm
+        LEFT JOIN class_group cg ON cgsm.class_group_id_ = cg.id_
+        LEFT JOIN vip_group vg ON cg.music_group_id_ = vg.id_
+        LEFT JOIN class_group_teacher_mapper cgtm ON cgtm.class_group_id_ = cg.id_
+        WHERE cg.group_type_ = 'VIP' AND cgtm.teacher_role_ = 'BISHOP' AND cgsm.user_id_ = #{studentId}
+        <if test="vipGroupName != null">
+            AND vg.name_ LIKE CONCAT('%',#{vipGroupName},'%')
+        </if>
+        <if test="vipGroupStatus != null">
+            AND vg.status_ = #{vipGroupStatus}
+        </if>
+    </select>
 
 </mapper>

+ 9 - 21
mec-web/src/main/java/com/ym/mec/web/controller/StudentManageController.java

@@ -1,32 +1,20 @@
 package com.ym.mec.web.controller;
 
-import com.ym.mec.common.page.QueryInfo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
 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.entity.Employee;
-import com.ym.mec.biz.dal.page.MusicGroupStudentQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageAttendanceQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageCourseQueryInfo;
-import com.ym.mec.biz.dal.page.StudentManageQueryInfo;
-import com.ym.mec.biz.dal.page.StudentSignQueryInfo;
-import com.ym.mec.biz.dal.page.TeacherPaymentRecordInfo;
+import com.ym.mec.biz.dal.page.*;
 import com.ym.mec.biz.service.StudentManageService;
 import com.ym.mec.biz.service.StudentRegistrationService;
 import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.*;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+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;
@@ -140,7 +128,7 @@ public class StudentManageController extends BaseController {
     @ApiOperation(value = "获取学生vip班级列表")
     @GetMapping("/findStudentVipGroupClass")
     @PreAuthorize("@pcs.hasPermissions('studentManage/findStudentVipGroupClass')")
-    public Object findStudentVipGroupClass(QueryInfo queryInfo){
+    public Object findStudentVipGroupClass(StudentManageVipClassQueryInfo queryInfo){
         return succeed(studentManageService.findStudentVipGroupClass(queryInfo));
     }