肖玮 hace 5 años
padre
commit
d60fa91171
Se han modificado 15 ficheros con 273 adiciones y 37 borrados
  1. 124 0
      mec-education/src/main/java/com/ym/mec/education/entity/MusicGroupQuit.java
  2. 49 8
      mec-education/src/main/java/com/ym/mec/education/entity/MusicGroupStudentFee.java
  3. 7 7
      mec-education/src/main/java/com/ym/mec/education/entity/VipGroup.java
  4. 13 0
      mec-education/src/main/java/com/ym/mec/education/mapper/MusicGroupQuitMapper.java
  5. 1 2
      mec-education/src/main/java/com/ym/mec/education/mapper/MusicGroupStudentFeeMapper.java
  6. 4 1
      mec-education/src/main/java/com/ym/mec/education/mapper/xml/MusicGroupStudentFeeMapper.xml
  7. 1 1
      mec-education/src/main/java/com/ym/mec/education/resp/StudentAttendanceStatisticsResp.java
  8. 1 1
      mec-education/src/main/java/com/ym/mec/education/resp/StudentListResp.java
  9. 14 0
      mec-education/src/main/java/com/ym/mec/education/service/IMusicGroupQuitService.java
  10. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/IMusicGroupStudentFeeService.java
  11. 19 12
      mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java
  12. 7 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java
  13. 18 0
      mec-education/src/main/java/com/ym/mec/education/service/impl/MusicGroupQuitServiceImpl.java
  14. 1 1
      mec-education/src/main/java/com/ym/mec/education/service/impl/MusicGroupStudentFeeServiceImpl.java
  15. 13 2
      mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

+ 124 - 0
mec-education/src/main/java/com/ym/mec/education/entity/MusicGroupQuit.java

@@ -0,0 +1,124 @@
+package com.ym.mec.education.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.util.Date;
+
+/**
+ * @program: mec
+ * @description: 退团
+ * @author: xw
+ * @create: 2019-09-29 12:52
+ */
+public class MusicGroupQuit extends Model<MusicGroupQuit> {
+
+    @TableId(value = "id_", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 学生id
+     */
+    @TableField("user_id_")
+    private Integer userId;
+
+    /**
+     * 乐团编号
+     */
+    @TableField("music_group_id_")
+    private Integer musicGroupId;
+
+    /**
+     * 加入时间
+     */
+    @TableField("join_date_")
+    private Date joinDate;
+
+    /**
+     * 退出时间
+     */
+    @TableField("quit_date_")
+    private Date quitDate;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time_")
+    private Date createTime;
+
+    /**
+     * 原因
+     */
+    @TableField("reason_")
+    private String reason;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(Integer musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public Date getJoinDate() {
+        return joinDate;
+    }
+
+    public void setJoinDate(Date joinDate) {
+        this.joinDate = joinDate;
+    }
+
+    public Date getQuitDate() {
+        return quitDate;
+    }
+
+    public void setQuitDate(Date quitDate) {
+        this.quitDate = quitDate;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    @Override
+    public String toString() {
+        return "MusicGroupQuit{" +
+                "id=" + id +
+                ", userId=" + userId +
+                ", musicGroupId=" + musicGroupId +
+                ", joinDate=" + joinDate +
+                ", quitDate=" + quitDate +
+                ", createTime=" + createTime +
+                ", reason='" + reason + '\'' +
+                '}';
+    }
+}

+ 49 - 8
mec-education/src/main/java/com/ym/mec/education/entity/MusicGroupStudentFee.java

@@ -37,7 +37,21 @@ public class MusicGroupStudentFee extends Model<MusicGroupStudentFee> {
     private Date createTime;
     @TableField("update_time_")
     private Date updateTime;
-
+    /**
+     * 下次缴费日期
+     */
+    @TableField("next_payment_date_")
+    private Date nextPaymentDate;
+    /**
+     * 最近已缴费时间
+     */
+    @TableField("latest_paid_time_")
+    private Date latestPaidTime;
+    /**
+     * 连续旷课次数
+     */
+    @TableField("continuous_absenteeism_times_")
+    private Integer continuousAbsenteeismTimes;
 
     public Long getId() {
         return id;
@@ -93,6 +107,30 @@ public class MusicGroupStudentFee extends Model<MusicGroupStudentFee> {
         return this;
     }
 
+    public Date getNextPaymentDate() {
+        return nextPaymentDate;
+    }
+
+    public void setNextPaymentDate(Date nextPaymentDate) {
+        this.nextPaymentDate = nextPaymentDate;
+    }
+
+    public Date getLatestPaidTime() {
+        return latestPaidTime;
+    }
+
+    public void setLatestPaidTime(Date latestPaidTime) {
+        this.latestPaidTime = latestPaidTime;
+    }
+
+    public Integer getContinuousAbsenteeismTimes() {
+        return continuousAbsenteeismTimes;
+    }
+
+    public void setContinuousAbsenteeismTimes(Integer continuousAbsenteeismTimes) {
+        this.continuousAbsenteeismTimes = continuousAbsenteeismTimes;
+    }
+
     @Override
     protected Serializable pkVal() {
         return this.id;
@@ -101,12 +139,15 @@ public class MusicGroupStudentFee extends Model<MusicGroupStudentFee> {
     @Override
     public String toString() {
         return "MusicGroupStudentFee{" +
-        ", id=" + id +
-        ", musicGroupId=" + musicGroupId +
-        ", userId=" + userId +
-        ", courseFee=" + courseFee +
-        ", createTime=" + createTime +
-        ", updateTime=" + updateTime +
-        "}";
+                "id=" + id +
+                ", musicGroupId=" + musicGroupId +
+                ", userId=" + userId +
+                ", courseFee=" + courseFee +
+                ", createTime=" + createTime +
+                ", updateTime=" + updateTime +
+                ", nextPaymentDate=" + nextPaymentDate +
+                ", latestPaidTime=" + latestPaidTime +
+                ", continuousAbsenteeismTimes=" + continuousAbsenteeismTimes +
+                '}';
     }
 }

+ 7 - 7
mec-education/src/main/java/com/ym/mec/education/entity/VipGroup.java

@@ -75,8 +75,8 @@ public class VipGroup extends Model<VipGroup> {
     /**
      * 价格
      */
-    @TableField("price_")
-    private BigDecimal price;
+    @TableField("unit_price_")
+    private BigDecimal unitPrice;
     /**
      * 审核状态
      */
@@ -206,12 +206,12 @@ public class VipGroup extends Model<VipGroup> {
         return this;
     }
 
-    public BigDecimal getPrice() {
-        return price;
+    public BigDecimal getUnitPrice() {
+        return unitPrice;
     }
 
-    public VipGroup setPrice(BigDecimal price) {
-        this.price = price;
+    public VipGroup setUnitPrice(BigDecimal unitPrice) {
+        this.unitPrice = unitPrice;
         return this;
     }
 
@@ -254,7 +254,7 @@ public class VipGroup extends Model<VipGroup> {
         ", registrationStartTime=" + registrationStartTime +
         ", name=" + name +
         ", vipGroupCategoryId=" + vipGroupCategoryId +
-        ", price=" + price +
+        ", unitPrice=" + unitPrice +
         ", auditStatus=" + auditStatus +
         ", organIdList=" + organIdList +
         "}";

+ 13 - 0
mec-education/src/main/java/com/ym/mec/education/mapper/MusicGroupQuitMapper.java

@@ -0,0 +1,13 @@
+package com.ym.mec.education.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.education.entity.MusicGroupQuit;
+
+/**
+ * @program: mec
+ * @description: 退团mapper
+ * @author: xw
+ * @create: 2019-09-29 13:02
+ */
+public interface MusicGroupQuitMapper extends BaseMapper<MusicGroupQuit> {
+}

+ 1 - 2
mec-education/src/main/java/com/ym/mec/education/mapper/MusicGroupStudentFeeMapper.java

@@ -1,8 +1,7 @@
 package com.ym.mec.education.mapper;
 
 import com.ym.mec.education.entity.MusicGroupStudentFee;
-import com.baomidou.mybatisplus.mapper.BaseMapper;
-
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 /**
  * <p>
  * 乐团学生费用表 Mapper 接口

+ 4 - 1
mec-education/src/main/java/com/ym/mec/education/mapper/xml/MusicGroupStudentFeeMapper.xml

@@ -10,11 +10,14 @@
         <result column="course_fee_" property="courseFee" />
         <result column="create_time_" property="createTime" />
         <result column="update_time_" property="updateTime" />
+        <result column="next_payment_date_" property="nextPaymentDate" />
+        <result column="latest_paid_time_" property="latestPaidTime" />
+        <result column="continuous_absenteeism_times_" property="continuousAbsenteeismTimes" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id_, music_group_id_, user_id_, course_fee_, create_time_, update_time_
+        id_, music_group_id_, user_id_, course_fee_, create_time_, update_time_, next_payment_date_, latest_paid_time_, continuous_absenteeism_times_
     </sql>
 
 </mapper>

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/resp/StudentAttendanceStatisticsResp.java

@@ -22,7 +22,7 @@ public class StudentAttendanceStatisticsResp implements Serializable {
     private String studentName;
 
     @ApiModelProperty(value = "是否连续旷课")
-    private boolean isTruant;
+    private boolean isTruant = false;
 
     @ApiModelProperty(value = "声部名称")
     private List<String> subjectName;

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/resp/StudentListResp.java

@@ -20,6 +20,6 @@ public class StudentListResp implements Serializable {
     @ApiModelProperty(value = "学员名称",required = true)
     private String studentName;
 
-    @ApiModelProperty(value = "学员迟到情况",required = true)
+    @ApiModelProperty(value = "学员连续迟到情况",required = true)
     private String studentAttendance;
 }

+ 14 - 0
mec-education/src/main/java/com/ym/mec/education/service/IMusicGroupQuitService.java

@@ -0,0 +1,14 @@
+package com.ym.mec.education.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.education.entity.MusicGroupQuit;
+
+/**
+ * @program: mec
+ * @description: 退团
+ * @author: xw
+ * @create: 2019-09-29 12:52
+ */
+public interface IMusicGroupQuitService extends IService<MusicGroupQuit> {
+
+}

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/IMusicGroupStudentFeeService.java

@@ -1,7 +1,7 @@
 package com.ym.mec.education.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ym.mec.education.entity.MusicGroupStudentFee;
-import com.baomidou.mybatisplus.service.IService;
 
 /**
  * <p>

+ 19 - 12
mec-education/src/main/java/com/ym/mec/education/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -6,22 +6,24 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.google.common.collect.Lists;
 import com.ym.mec.education.base.PageResponse;
+import com.ym.mec.education.entity.ClassGroup;
 import com.ym.mec.education.entity.ClassGroupStudentMapper;
-import com.ym.mec.education.entity.StudentAttendance;
+import com.ym.mec.education.entity.MusicGroupStudentFee;
 import com.ym.mec.education.entity.SysUser;
-import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
 import com.ym.mec.education.mapper.ClassGroupStudentMapperMapper;
 import com.ym.mec.education.req.ClassGroupReq;
 import com.ym.mec.education.resp.ClassStudentResp;
 import com.ym.mec.education.resp.StudentListResp;
+import com.ym.mec.education.service.IClassGroupService;
 import com.ym.mec.education.service.IClassGroupStudentMapperService;
-import com.ym.mec.education.service.IStudentAttendanceService;
+import com.ym.mec.education.service.IMusicGroupStudentFeeService;
 import com.ym.mec.education.service.ISysUserService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import java.util.List;
 import java.util.Objects;
+import java.util.Optional;
 
 /**
  * <p>
@@ -35,9 +37,11 @@ import java.util.Objects;
 public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupStudentMapperMapper, ClassGroupStudentMapper> implements IClassGroupStudentMapperService {
 
     @Autowired
-    private IStudentAttendanceService studentAttendanceService;
-    @Autowired
     private ISysUserService sysUserService;
+    @Autowired
+    private IClassGroupService classGroupService;
+    @Autowired
+    private IMusicGroupStudentFeeService musicGroupStudentFeeService;
 
 
     @Override
@@ -45,6 +49,7 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
         if (Objects.isNull(classGroupReq.getGroupId())) {
             return PageResponse.errorParam();
         }
+        ClassGroup classGroup = classGroupService.getById(classGroupReq.getGroupId());
         Page<ClassGroupStudentMapper> classGroupStudentMapperPage = new Page<ClassGroupStudentMapper>(classGroupReq.getPageNo(), classGroupReq.getPageSize());
         QueryWrapper<ClassGroupStudentMapper> classGroupStudentMapperQueryWrapper = new QueryWrapper<>();
         classGroupStudentMapperQueryWrapper.lambda().eq(true, ClassGroupStudentMapper::getClassGroupId, classGroupReq.getGroupId());
@@ -53,15 +58,17 @@ public class ClassGroupStudentMapperServiceImpl extends ServiceImpl<ClassGroupSt
         BeanUtils.copyProperties(page, studentListRespPage);
         List<StudentListResp> list = Lists.newArrayList();
         page.getRecords().forEach(item -> {
-            QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<>();
-            //请假 旷课正常上课次数
-            queryWrapper.lambda().eq(true, StudentAttendance::getUserId, item.getUserId())
-                    .in(true, StudentAttendance::getStatus, StudentAttendanceStatusEnum.TRUANT.getCode(),
-                            StudentAttendanceStatusEnum.LEAVE.getCode());
-            int count = studentAttendanceService.count(queryWrapper);
             SysUser sysUser = sysUserService.getById(item.getUserId());
             StudentListResp studentRegistrationResp = new StudentListResp()
-                    .setStudentName(sysUser.getRealName()).setStudentAttendance("连续缺到" + count + "次");
+                    .setStudentName(sysUser.getRealName());
+            if (Objects.nonNull(classGroup) && Objects.nonNull(classGroup.getMusicGroupId())) {
+                QueryWrapper<MusicGroupStudentFee> musicGroupStudentFeeQueryWrapper = new QueryWrapper<MusicGroupStudentFee>();
+                musicGroupStudentFeeQueryWrapper.lambda().eq(true, MusicGroupStudentFee::getMusicGroupId, classGroup.getMusicGroupId())
+                        .eq(true, MusicGroupStudentFee::getUserId, item.getUserId());
+                MusicGroupStudentFee musicGroupStudentFee = musicGroupStudentFeeService.getOne(musicGroupStudentFeeQueryWrapper);
+                Optional.of(musicGroupStudentFee).ifPresent(groupStudentFee -> studentRegistrationResp.
+                        setStudentAttendance("连续缺到" + groupStudentFee.getContinuousAbsenteeismTimes() + "次"));
+            }
             list.add(studentRegistrationResp);
         });
         studentListRespPage.setRecords(list);

+ 7 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/CourseScheduleServiceImpl.java

@@ -46,6 +46,8 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
     private ISubjectService subjectService;
     @Autowired
     private IStudentAttendanceService studentAttendanceService;
+    @Autowired
+    private IMusicGroupQuitService musicGroupQuitService;
 
     @Override
     public PageResponse getPage(ClassGroupReq classGroupReq) {
@@ -158,7 +160,11 @@ public class CourseScheduleServiceImpl extends ServiceImpl<CourseScheduleMapper,
                     courseScheduleResp.setStudentNum(classGroup.getStudentNum());
                 }
             }
-            //TODO 暂缺退团人数
+            //退团人数
+            QueryWrapper<MusicGroupQuit> musicGroupQuitQueryWrapper = new QueryWrapper<>();
+            musicGroupQuitQueryWrapper.lambda().eq(true, MusicGroupQuit::getMusicGroupId, classGroup.getMusicGroupId());
+            int leagueNum = musicGroupQuitService.count(musicGroupQuitQueryWrapper);
+            courseScheduleResp.setLeagueNum(leagueNum);
         }
         return BaseResponse.success(courseScheduleResp);
     }

+ 18 - 0
mec-education/src/main/java/com/ym/mec/education/service/impl/MusicGroupQuitServiceImpl.java

@@ -0,0 +1,18 @@
+package com.ym.mec.education.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.education.entity.MusicGroupQuit;
+import com.ym.mec.education.mapper.MusicGroupQuitMapper;
+import com.ym.mec.education.service.IMusicGroupQuitService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @program: mec
+ * @description: 退团实现类
+ * @author: xw
+ * @create: 2019-09-29 12:52
+ */
+@Service("IMusicGroupQuitService")
+public class MusicGroupQuitServiceImpl extends ServiceImpl<MusicGroupQuitMapper, MusicGroupQuit> implements IMusicGroupQuitService {
+
+}

+ 1 - 1
mec-education/src/main/java/com/ym/mec/education/service/impl/MusicGroupStudentFeeServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ym.mec.education.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ym.mec.education.entity.MusicGroupStudentFee;
 import com.ym.mec.education.mapper.MusicGroupStudentFeeMapper;
 import com.ym.mec.education.service.IMusicGroupStudentFeeService;
-import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
 /**

+ 13 - 2
mec-education/src/main/java/com/ym/mec/education/service/impl/StudentAttendanceServiceImpl.java

@@ -21,8 +21,10 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
+
 import java.util.List;
 import java.util.Objects;
+import java.util.Optional;
 
 /**
  * <p>
@@ -45,10 +47,12 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
     private ISysUserService userService;
     @Autowired
     private IClassGroupStudentMapperService classGroupStudentMapperService;
+    @Autowired
+    private IMusicGroupStudentFeeService musicGroupStudentFeeService;
 
     @Override
     public PageResponse getPage(ClassGroupReq classGroupReq) {
-        if (Objects.isNull(classGroupReq.getGroupId())){
+        if (Objects.isNull(classGroupReq.getGroupId())) {
             return PageResponse.errorParam();
         }
         Page<StudentAttendance> pageParam = new Page(classGroupReq.getPageNo(), classGroupReq.getPageSize());
@@ -153,7 +157,14 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
                             resp.setStudentName(user.getRealName());
                         }
                         resp.setSubjectName(subjectNameList);
-                        //TODO 暂时缺少是否连续旷课
+                        //是否连续旷课
+                        QueryWrapper<MusicGroupStudentFee> musicGroupStudentFeeQueryWrapper = new QueryWrapper<MusicGroupStudentFee>();
+                        musicGroupStudentFeeQueryWrapper.lambda().eq(true, MusicGroupStudentFee::getMusicGroupId, classGroup.getMusicGroupId())
+                                .eq(true, MusicGroupStudentFee::getUserId, item.getUserId());
+                        if (Optional.of(musicGroupStudentFeeService.getOne(musicGroupStudentFeeQueryWrapper)).get()
+                                .getContinuousAbsenteeismTimes() > 1) {
+                            resp.setTruant(true);
+                        }
                         //到课天数
                         QueryWrapper<StudentAttendance> normalWrapper = new QueryWrapper<>();
                         normalWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId())