소스 검색

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

zouxuan 3 년 전
부모
커밋
21f29a5d80

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentOperatingVisitDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.biz.dal.entity.StudentOperatingVisit;
+
+public interface StudentOperatingVisitDao extends BaseDAO<Long, StudentOperatingVisit> {
+
+	
+}

+ 70 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentOperatingVisit.java

@@ -0,0 +1,70 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(student_operating_visit):
+ */
+public class StudentOperatingVisit {
+
+	/**  */
+	private Long id;
+	
+	/** 学员编号 */
+	private Integer userId;
+	
+	/** 当前月 */
+	private java.util.Date month;
+	
+	/** 是否回访 */
+	private boolean visitFlag;
+	
+	/** 分部 */
+	private Integer organId;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setUserId(Integer userId){
+		this.userId = userId;
+	}
+	
+	public Integer getUserId(){
+		return this.userId;
+	}
+			
+	public void setMonth(java.util.Date month){
+		this.month = month;
+	}
+	
+	public java.util.Date getMonth(){
+		return this.month;
+	}
+			
+	public void setVisitFlag(boolean visitFlag){
+		this.visitFlag = visitFlag;
+	}
+	
+	public boolean isVisitFlag(){
+		return this.visitFlag;
+	}
+			
+	public void setOrganId(Integer organId){
+		this.organId = organId;
+	}
+	
+	public Integer getOrganId(){
+		return this.organId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 13 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/StudentVipGroupQueryInfo.java

@@ -3,6 +3,8 @@ package com.ym.mec.biz.dal.page;
 import com.ym.mec.common.page.QueryInfo;
 import io.swagger.annotations.ApiModelProperty;
 
+import java.util.Date;
+
 /**
  * @Author Joburgess
  * @Date 2019/9/25
@@ -24,6 +26,17 @@ public class StudentVipGroupQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "分部编号")
     private Integer organId;
 
+    @ApiModelProperty(value = "是否剔除已缴费截止数据")
+    private Boolean expireFlag = false;
+
+    public Boolean getExpireFlag() {
+        return expireFlag;
+    }
+
+    public void setExpireFlag(Boolean expireFlag) {
+        this.expireFlag = expireFlag;
+    }
+
     public Integer getOrganId() {
         return organId;
     }

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

@@ -4194,6 +4194,7 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 
     @Override
     public List<StudentVipGroupShowListDto> queryVipPracticeGroups(StudentVipGroupQueryInfo queryInfo) {
+        queryInfo.setExpireFlag(true);
         Map<String, Object> params = new HashMap<String, Object>();
         MapUtil.populateMap(params, queryInfo);
         List<StudentVipGroupShowListDto> vipGroups = vipGroupDao.findVipGroups(params);

+ 9 - 12
mec-biz/src/main/resources/config/mybatis/CourseScheduleMapper.xml

@@ -583,7 +583,7 @@
                 AND cs.group_type_ = #{type}
             </if>
             <if test="search != null and search != ''">
-                AND (cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',${search},'%'))
+                AND (cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%'))
             </if>
             <if test="musicGroupId!=null">
                 AND cs.music_group_id_=#{musicGroupId} AND cs.group_type_='MUSIC'
@@ -597,16 +597,13 @@
     </select>
 
     <select id="countCourseSchedulesWithDate" resultType="int">
-        SELECT
-        count(*)
-        FROM
-            course_schedule cs
-            <if test="classGroupIds != null and organIdList!=null">
-                LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
-            </if>
-            <if test="transactionTeacherId!=null">
-                LEFT JOIN music_group mg ON cs.music_group_id_=mg.id_
-            </if>
+        SELECT count(*) FROM course_schedule cs
+        <if test="classGroupIds != null and organIdList!=null">
+            LEFT JOIN class_group cg ON cs.class_group_id_ = cg.id_
+        </if>
+        <if test="transactionTeacherId!=null">
+            LEFT JOIN music_group mg ON cs.music_group_id_=mg.id_
+        </if>
         WHERE
         (cs.del_flag_ != 1 OR cs.del_flag_ IS NULL) AND cs.pre_course_flag_ = 0 and cs.tenant_id_ = #{tenantId}
         AND cs.id_ IS NOT NULL
@@ -626,7 +623,7 @@
             </foreach>
         </if>
         <if test="search != null and search != ''">
-            AND (cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',${search},'%'))
+            AND (cs.id_ = #{search} OR cs.name_ LIKE CONCAT('%',#{search},'%'))
         </if>
         <if test="musicGroupId!=null">
             AND cs.music_group_id_=#{musicGroupId} AND cs.group_type_='MUSIC'

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -830,6 +830,9 @@
         <if test="search != null">
             AND pg.name_ LIKE concat('%',#{search},'%')
         </if>
+        <if test="expireFlag != null and expireFlag == true">
+            AND pg.payment_expire_date_ >= NOW()
+        </if>
     </select>
     <select id="getPracticeGroupDetail" resultMap="com.ym.mec.biz.dal.dao.VipGroupDao.studentVipGroupDetailDto">
         SELECT pg.name_,pg.total_price_,pg.user_id_,pg.single_class_minutes_,pg.course_num_ online_classes_num_,0 offline_classes_num_,pg.id_,

+ 64 - 0
mec-biz/src/main/resources/config/mybatis/StudentOperatingVisitMapper.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.ym.mec.biz.dal.dao.StudentOperatingVisitDao">
+	
+	<resultMap type="com.ym.mec.biz.dal.entity.StudentOperatingVisit" id="StudentOperatingVisit">
+		<result column="id_" property="id" />
+		<result column="user_id_" property="userId" />
+		<result column="month_" property="month" />
+		<result column="visit_flag_" property="visitFlag" />
+		<result column="organ_id_" property="organId" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="StudentOperatingVisit" >
+		SELECT * FROM student_operating_visit WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="StudentOperatingVisit">
+		SELECT * FROM student_operating_visit ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentOperatingVisit" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO student_operating_visit (user_id_,month_,visit_flag_,organ_id_) VALUES(#{userId},#{month},#{visitFlag},#{organId})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentOperatingVisit">
+		UPDATE student_operating_visit <set>
+<if test="userId != null">
+user_id_ = #{userId},
+</if>
+<if test="organId != null">
+organ_id_ = #{organId},
+</if>
+<if test="visitFlag != null">
+visit_flag_ = #{visitFlag},
+</if>
+<if test="month != null">
+month_ = #{month},
+</if>
+</set> WHERE id_ = #{id} 
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM student_operating_visit WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="StudentOperatingVisit" parameterType="map">
+		SELECT * FROM student_operating_visit ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM student_operating_visit
+	</select>
+</mapper>

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

@@ -362,6 +362,12 @@
             AND status_='SUCCESS') = 0
             AND IF(vg.student_id_list_ IS NULL, vg.organ_id_ = #{organId}, FIND_IN_SET(#{userId},
             vg.student_id_list_))
+            <if test="expireFlag != null and expireFlag == true">
+                AND vg.payment_expire_date_ >= NOW()
+            </if>
+            <if test="subjectId!=null">
+                AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
+            </if>
             <if test="subjectId!=null">
                 AND FIND_IN_SET(#{subjectId},cg.subject_id_list_)
             </if>

+ 15 - 11
mec-web/src/main/java/com/ym/mec/web/controller/education/EducationCourseScheduleController.java

@@ -1,13 +1,14 @@
 package com.ym.mec.web.controller.education;
 
-import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
-import com.ym.mec.auth.api.entity.SysUserRole;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.dto.CourseMergeDto;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.CourseScheduleQueryInfo;
 import com.ym.mec.biz.service.CourseScheduleService;
+import com.ym.mec.biz.service.SysUserService;
 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;
@@ -33,17 +34,23 @@ public class EducationCourseScheduleController extends BaseController {
     @Autowired
     private CourseScheduleService scheduleService;
     @Autowired
-    private SysUserFeignService sysUserFeignService;
+    private SysUserService sysUserService;
     @Autowired
     private EmployeeDao employeeDao;
+    @Autowired
+    private CourseScheduleService courseScheduleService;
+
+    @ApiOperation(value = "课程合并")
+    @PostMapping(value = "/courseMerge",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    public HttpResponseResult courseMerge(CourseMergeDto courseMergeInfo){
+        courseMergeInfo.setOperatorId(sysUserService.getUserId());
+        return courseScheduleService.courseMerge(courseMergeInfo);
+    }
 
     @ApiOperation(value = "根据月份获取乐团在该月有课的日期")
     @GetMapping("/getCourseScheduleDateByMonth")
     public Object getCourseScheduleDateByMonth(@ApiParam(value = "月份", required = true) @RequestParam Date month,String type) {
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if (null == user) {
-            throw new BizException("请登录");
-        }
+        SysUser user = sysUserService.getUser();
         Employee employee = employeeDao.get(user.getId());
         if(Objects.isNull(employee)){
             throw new BizException("员工信息不存在");
@@ -60,10 +67,7 @@ public class EducationCourseScheduleController extends BaseController {
     @ApiOperation(value = "根据日期获取当日排课")
     @GetMapping("/getCourseSchedulesWithDate")
     public Object getCourseSchedulesWithDate(CourseScheduleQueryInfo queryInfo) {
-        SysUser user = sysUserFeignService.queryUserInfo();
-        if (null == user) {
-            throw new BizException("请登录");
-        }
+        SysUser user = sysUserService.getUser();
         Employee employee = employeeDao.get(user.getId());
         if(Objects.nonNull(employee)){
             queryInfo.setOrganIdList(employee.getOrganIdList());