Parcourir la source

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan il y a 5 ans
Parent
commit
16b2815dbd

+ 12 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/StudentRepairDao.java

@@ -0,0 +1,12 @@
+package com.ym.mec.biz.dal.dao;
+
+
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.entity.StudentRepair;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface StudentRepairDao extends com.ym.mec.common.dal.BaseDAO<Integer, StudentRepair> {
+     List<BasicUserDto> getStudents(@Param("employeeId") Integer employeeId, @Param("organIdList") String organIdList);
+}

+ 1 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroup.java

@@ -24,7 +24,7 @@ public class ClassGroup {
 
 	/**  */
 	@ApiModelProperty(value = "上课模式", required = true)
-	private String teachMode;
+	private String teachMode = "OFFLINE";
 
 	/**  */
 	@ApiModelProperty(value = "科目编号(多个,号分割)", required = true)

+ 289 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/StudentRepair.java

@@ -0,0 +1,289 @@
+package com.ym.mec.biz.dal.entity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class StudentRepair {
+    private Integer id;
+
+    /**
+    * 维修单号
+    */
+    private String transNo;
+
+    /**
+    * 分部id
+    */
+    private Integer organId;
+
+    /**
+    * 学生id
+    */
+    private Integer studentId;
+
+    /**
+    * 学生姓名
+    */
+    private String studentName;
+
+    /**
+    * 学生学校
+    */
+    private String studentSchool;
+
+    /**
+    * 技师id
+    */
+    private Integer employeeId;
+
+    /**
+    * 技师名字
+    */
+    private String employeeName;
+
+    /**
+    * 乐器类型id
+    */
+    private Integer subjectId;
+
+    /**
+    * 乐器类型名称
+    */
+    private String subjectName;
+
+    /**
+    * 维修类型 0-线下 1-线上
+    */
+    private Integer type;
+
+    /**
+    * 乐器编号
+    */
+    private String instrumentNo;
+
+    /**
+    * 问题描述及解决方法
+    */
+    private String description;
+
+    /**
+    * 维修金额
+    */
+    private BigDecimal amount;
+
+    /**
+    * 维修完成时间
+    */
+    private Date finishTime;
+
+    /**
+    * 乐器取回方式 0-自取 1-快递
+    */
+    private Integer sendType;
+
+    /**
+    * 联系人
+    */
+    private String contactName;
+
+    /**
+    * 联系方式
+    */
+    private String contactMobile;
+
+    /**
+    * 快递地址
+    */
+    private String address;
+
+    /**
+    * 支付状态 0-未支付 1-已支付
+    */
+    private Integer payStatus;
+
+    /**
+    * 送修时间
+    */
+    private Date createTime;
+
+    /**
+    * 更新时间
+    */
+    private Date updateTime;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getTransNo() {
+        return transNo;
+    }
+
+    public void setTransNo(String transNo) {
+        this.transNo = transNo;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getStudentName() {
+        return studentName;
+    }
+
+    public void setStudentName(String studentName) {
+        this.studentName = studentName;
+    }
+
+    public String getStudentSchool() {
+        return studentSchool;
+    }
+
+    public void setStudentSchool(String studentSchool) {
+        this.studentSchool = studentSchool;
+    }
+
+    public Integer getEmployeeId() {
+        return employeeId;
+    }
+
+    public void setEmployeeId(Integer employeeId) {
+        this.employeeId = employeeId;
+    }
+
+    public String getEmployeeName() {
+        return employeeName;
+    }
+
+    public void setEmployeeName(String employeeName) {
+        this.employeeName = employeeName;
+    }
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getInstrumentNo() {
+        return instrumentNo;
+    }
+
+    public void setInstrumentNo(String instrumentNo) {
+        this.instrumentNo = instrumentNo;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public BigDecimal getAmount() {
+        return amount;
+    }
+
+    public void setAmount(BigDecimal amount) {
+        this.amount = amount;
+    }
+
+    public Date getFinishTime() {
+        return finishTime;
+    }
+
+    public void setFinishTime(Date finishTime) {
+        this.finishTime = finishTime;
+    }
+
+    public Integer getSendType() {
+        return sendType;
+    }
+
+    public void setSendType(Integer sendType) {
+        this.sendType = sendType;
+    }
+
+    public String getContactName() {
+        return contactName;
+    }
+
+    public void setContactName(String contactName) {
+        this.contactName = contactName;
+    }
+
+    public String getContactMobile() {
+        return contactMobile;
+    }
+
+    public void setContactMobile(String contactMobile) {
+        this.contactMobile = contactMobile;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public Integer getPayStatus() {
+        return payStatus;
+    }
+
+    public void setPayStatus(Integer payStatus) {
+        this.payStatus = payStatus;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/StudentRepairService.java

@@ -0,0 +1,18 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.entity.StudentRepair;
+import com.ym.mec.common.service.BaseService;
+
+import java.util.List;
+
+public interface StudentRepairService extends BaseService<Integer, StudentRepair> {
+
+    /**
+     * 根据维修技师获取相应学生列表
+     *
+     * @param employeeId
+     * @return
+     */
+    List<BasicUserDto> getStudents(Integer employeeId);
+}

+ 31 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRepairServiceImpl.java

@@ -0,0 +1,31 @@
+package com.ym.mec.biz.service.impl;
+
+import com.ym.mec.biz.dal.dao.StudentDao;
+import com.ym.mec.biz.dal.dao.StudentRepairDao;
+import com.ym.mec.biz.dal.dto.BasicUserDto;
+import com.ym.mec.biz.dal.entity.StudentRepair;
+import com.ym.mec.biz.service.StudentRepairService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRepair> implements StudentRepairService {
+
+    @Autowired
+    private StudentRepairDao studentRepairDao;
+
+
+    @Override
+    public BaseDAO<Integer, StudentRepair> getDAO() {
+        return studentRepairDao;
+    }
+
+    @Override
+    public List<BasicUserDto> getStudents(Integer employeeId) {
+       // 维修技师学生列表为所负责乐团学员+无乐团学员+乐团无技师学员
+
+        return null;
+    }
+}

+ 133 - 0
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -0,0 +1,133 @@
+<?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.StudentRepairDao">
+    <resultMap id="StudentRepair" type="com.ym.mec.biz.dal.entity.StudentRepair">
+        <result column="id_" jdbcType="INTEGER" property="id"/>
+        <result column="trans_no_" jdbcType="VARCHAR" property="transNo"/>
+        <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
+        <result column="student_id_" jdbcType="INTEGER" property="studentId"/>
+        <result column="student_name_" jdbcType="VARCHAR" property="studentName"/>
+        <result column="student_school_" jdbcType="VARCHAR" property="studentSchool"/>
+        <result column="employee_id_" jdbcType="INTEGER" property="employeeId"/>
+        <result column="employee_name_" jdbcType="VARCHAR" property="employeeName"/>
+        <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
+        <result column="subject_name_" jdbcType="VARCHAR" property="subjectName"/>
+        <result column="type_" jdbcType="INTEGER" property="type"/>
+        <result column="instrument_no_" jdbcType="VARCHAR" property="instrumentNo"/>
+        <result column="description_" jdbcType="VARCHAR" property="description"/>
+        <result column="amount_" jdbcType="DECIMAL" property="amount"/>
+        <result column="finish_time_" jdbcType="TIMESTAMP" property="finishTime"/>
+        <result column="send_type_" jdbcType="INTEGER" property="sendType"/>
+        <result column="contact_name_" jdbcType="VARCHAR" property="contactName"/>
+        <result column="contact_mobile_" jdbcType="VARCHAR" property="contactMobile"/>
+        <result column="address_" jdbcType="VARCHAR" property="address"/>
+        <result column="pay_status_" jdbcType="INTEGER" property="payStatus"/>
+        <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
+    </resultMap>
+    <!-- 根据主键查询一条记录 -->
+    <select id="get" resultMap="StudentRepair">
+        SELECT *
+        FROM school
+        WHERE id_ = #{id}
+    </select>
+
+    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
+        <!--@mbg.generated-->
+        insert into student_repair (id_, trans_no_, organ_id_,
+        student_id_, student_name_, student_school_,
+        employee_id_, employee_name_, subject_id_,
+        subject_name_, type_, instrument_no_,
+        description_, amount_, finish_time_,
+        send_type_, contact_name_, contact_mobile_,
+        address_, pay_status_, create_time_,
+        update_time_)
+        values (#{id,jdbcType=INTEGER}, #{transNo,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER},
+        #{studentId,jdbcType=INTEGER}, #{studentName,jdbcType=VARCHAR}, #{studentSchool,jdbcType=VARCHAR},
+        #{employeeId,jdbcType=INTEGER}, #{employeeName,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
+        #{subjectName,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{instrumentNo,jdbcType=VARCHAR},
+        #{description,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{finishTime,jdbcType=TIMESTAMP},
+        #{sendType,jdbcType=INTEGER}, #{contactName,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
+        #{address,jdbcType=VARCHAR}, #{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
+        #{updateTime,jdbcType=TIMESTAMP})
+    </insert>
+    <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
+        <!--@mbg.generated-->
+        UPDATE student_repair
+        <set>
+            <if test="transNo != null">
+                trans_no_ = #{transNo},
+            </if>
+            <if test="organId != null">
+                organ_id_ = ##{organId},
+            </if>
+            <if test="studentId != null">
+                student_id_ = #{studentId},
+            </if>
+            <if test="studentName != null">
+                student_name_ = #{studentName},
+            </if>
+            <if test="studentSchool != null">
+                student_school_ = #{studentSchool},
+            </if>
+            <if test="employeeId != null">
+                employee_id_ = #{employeeId},
+            </if>
+            <if test="employeeName != null">
+                employee_name_ = #{employeeName},
+            </if>
+            <if test="subjectId != null">
+                subject_id_ = #{subjectId},
+            </if>
+            <if test="subjectName != null">
+                subject_name_ = #{subjectName},
+            </if>
+            <if test="type != null">
+                type_ = #{type},
+            </if>
+            <if test="instrumentNo != null">
+                instrument_no_ = #{instrumentNo},
+            </if>
+            <if test="description != null">
+                description_ = #{description},
+            </if>
+            <if test="amount != null">
+                amount_ = #{amount},
+            </if>
+            <if test="finishTime != null">
+                finish_time_ = #{finishTime},
+            </if>
+            <if test="sendType != null">
+                send_type_ #{sendType},
+            </if>
+            <if test="contactName != null">
+                contact_name_ = #{contactName},
+            </if>
+            <if test="contactMobile != null">
+                contact_mobile_ = #{contactName},
+            </if>
+            <if test="address != null">
+                address_ = #{address},
+            </if>
+            <if test="payStatus != null">
+                pay_status_ = #{payStatus},
+            </if>
+            <if test="updateTime != null">
+                update_time_ = #{updateTime},
+            </if>
+        </set>
+        WHERE id_ = #{id}
+    </update>
+    <select id="getStudents" resultType="com.ym.mec.biz.dal.dto.BasicUserDto">
+        SELECT username_,id_ user_id_,avatar_ head_url_,gender_
+        FROM sys_user
+        WHERE FIND_IN_SET(organ_id_,#{organIdList})
+          AND id_ NOT IN (
+            SELECT cssp.user_id_
+            FROM music_group mg
+                     LEFT JOIN course_schedule_student_payment cssp ON mg.id_ = cssp.music_group_id_
+            WHERE cssp.group_type_ = 'MUSIC'
+              AND mg.repair_user_id_ != #{employeeId})
+        <include refid="global.limit"/>
+    </select>
+</mapper>

+ 47 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -0,0 +1,47 @@
+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.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
+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.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Objects;
+
+@RequestMapping("eduPracticeGroup")
+@Api(tags = "陪练课服务")
+@RestController
+public class EduRepairController extends BaseController {
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private EmployeeDao employeeDao;
+
+    @ApiOperation("获取学生的陪练课")
+    @GetMapping(value = "/getStudents")
+    public HttpResponseResult getStudents() {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+
+        Employee employee = employeeDao.get(sysUser.getId());
+        if(Objects.isNull(employee)){
+            return failed(HttpStatus.NOT_ACCEPTABLE, "员工信息不存在");
+        }
+
+        return null;
+    }
+}