Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
cc9b140c01

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/EmployeeDto.java

@@ -54,6 +54,26 @@ public class EmployeeDto {
     @ApiModelProperty(value = "部门名称",required = false)
     private List<String> organNameList;
 
+    private String contactAddress;
+
+    private String postalCode;
+
+    public String getContactAddress() {
+        return contactAddress;
+    }
+
+    public void setContactAddress(String contactAddress) {
+        this.contactAddress = contactAddress;
+    }
+
+    public String getPostalCode() {
+        return postalCode;
+    }
+
+    public void setPostalCode(String postalCode) {
+        this.postalCode = postalCode;
+    }
+
     public List<String> getRoleNames() {
         return roleNames;
     }

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

@@ -102,6 +102,11 @@ public class StudentRepair {
     private Integer payStatus;
 
     /**
+    * 支付状态 0维修中,1已完成
+    */
+    private Integer repairStatus;
+
+    /**
     * 送修时间
     */
     private Date createTime;

+ 52 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/RepairStudentQueryInfo.java

@@ -2,12 +2,64 @@ package com.ym.mec.biz.dal.page;
 
 import com.ym.mec.common.page.QueryInfo;
 
+import java.util.Date;
+
 public class RepairStudentQueryInfo extends QueryInfo {
 
     private Integer employeeId;
 
     private String organIdList;
 
+    private Integer subjectId;
+
+    private Integer type;
+
+    private Integer repairStatus;
+
+    private Date startTime;
+
+    private Date endTime;
+
+    public Integer getSubjectId() {
+        return subjectId;
+    }
+
+    public void setSubjectId(Integer subjectId) {
+        this.subjectId = subjectId;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public Integer getRepairStatus() {
+        return repairStatus;
+    }
+
+    public void setRepairStatus(Integer repairStatus) {
+        this.repairStatus = repairStatus;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
     public Integer getEmployeeId() {
         return employeeId;
     }

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

@@ -4168,7 +4168,7 @@ public class CourseScheduleServiceImpl extends BaseServiceImpl<Long, CourseSched
 		}
 
 		LocalDate courseStartDay = LocalDateTime.ofInstant(practiceGroup.getCoursesStartDate().toInstant(), DateUtil.zoneId).toLocalDate();
-		LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroup.getBuyMonths());
+		LocalDate currentExpiredDay = courseStartDay.plusMonths(practiceGroup.getBuyMonths()).plusDays(-1);
 		Date courseExpiredDateTemp=Date.from(currentExpiredDay.atStartOfDay(DateUtil.zoneId).toInstant());
 		if(coursesExpireDate.before(courseExpiredDateTemp)){
 			throw new BizException("课程结束时间不得早于,{}", DateUtil.dateToString(courseExpiredDateTemp, "yyyy年MM月dd日"));

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

@@ -285,6 +285,7 @@ public class ExtracurricularExercisesReplyServiceImpl extends BaseServiceImpl<Lo
 	@Transactional(rollbackFor = Exception.class)
 	public void exercisesSituationStatistics2() {
 		LocalDate nowDate = LocalDateTime.now(DateUtil.zoneId).toLocalDate();
+//		LocalDate nowDate = LocalDate.parse("2020-04-20", DateUtil.dateFormatter);
 		LocalDate monDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.MONDAY.getValue());
 		LocalDate sunDayDate = nowDate.with(DateUtil.weekFields.dayOfWeek(), DayOfWeek.SUNDAY.getValue());
 

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

@@ -43,6 +43,8 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 	@Autowired
 	private CourseScheduleStudentPaymentDao courseScheduleStudentPaymentDao;
 	@Autowired
+	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+	@Autowired
 	private ClassGroupDao classGroupDao;
 	@Autowired
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
@@ -231,6 +233,12 @@ public class StudentAttendanceServiceImpl extends BaseServiceImpl<Long, StudentA
 		if(Objects.isNull(courseSchedule)){
 			throw new BizException("课程不存在");
 		}
+
+		List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByCourseSchedule(studentAttendanceInfo.getCourseScheduleId());
+		if(CollectionUtils.isEmpty(courseScheduleTeacherSalaries)&&Objects.nonNull(courseScheduleTeacherSalaries.get(0).getSettlementTime())){
+			throw new BizException("此课程已结算");
+		}
+
 		List<Integer> userIds = studentAttendances.stream().map(StudentAttendance::getUserId).collect(Collectors.toList());
 		studentAttendanceDao.deleteStudentAttendancesByCourseAndUsers(studentAttendanceInfo.getCourseScheduleId().longValue(),userIds);
 		for (StudentAttendance studentAttendance : studentAttendances) {

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

@@ -50,6 +50,8 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 	@Autowired
 	private SysMessageService sysMessageService;
 	@Autowired
+	private CourseScheduleTeacherSalaryDao courseScheduleTeacherSalaryDao;
+	@Autowired
 	private ClassGroupDao classGroupDao;
 	@Autowired
 	private SubjectDao subjectDao;
@@ -484,6 +486,12 @@ public class TeacherAttendanceServiceImpl extends BaseServiceImpl<Long, TeacherA
 		if(Objects.isNull(courseSchedule)){
 			throw new BizException("课程不存在");
 		}
+
+		List<CourseScheduleTeacherSalary> courseScheduleTeacherSalaries = courseScheduleTeacherSalaryDao.findByCourseSchedule(teacherAttendanceInfo.getCourseScheduleId());
+		if(!CollectionUtils.isEmpty(courseScheduleTeacherSalaries)&&Objects.nonNull(courseScheduleTeacherSalaries.get(0).getSettlementTime())){
+			throw new BizException("此课程已结算");
+		}
+
 		if(Objects.isNull(teacherAttendanceInfo.getTeacherId())||teacherAttendanceInfo.getTeacherId()<=0){
 			if(Objects.isNull(courseSchedule.getActualTeacherId())){
 				throw new BizException("请指定教师");

+ 3 - 1
mec-biz/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -174,6 +174,8 @@
         <result property="jobNature" column="job_nature_"/>
         <result property="entryDate" column="entry_date_"/>
         <result property="demissionDate" column="demission_date_"/>
+        <result property="contactAddress" column="contact_address_"/>
+        <result property="postalCode" column="postal_code_"/>
         <collection property="roleNames" ofType="string" javaType="list">
             <result column="role_name_"/>
         </collection>
@@ -190,7 +192,7 @@
     <select id="queryEmployByOrganId" resultMap="EmployeeDto">
         SELECT ue.*,o.name_ organ_name_list_,o.id_ organ_id_list_,sr.role_name_,sr.id_ role_id_
         FROM (SELECT e.user_id_,su.real_name_,su.gender_,su.phone_,su.user_type_,e.job_nature_,su.lock_flag_,
-        e.entry_date_,e.demission_date_,e.organ_id_list_ organ_id_,e.create_time_
+        e.entry_date_,e.demission_date_,e.organ_id_list_ organ_id_,e.create_time_,e.contact_address_,e.postal_code_
         FROM employee e
         LEFT JOIN sys_user su ON e.user_id_ = su.id_
         <if test="roleId != null">

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/ExtracurricularExercisesReplyMapper.xml

@@ -425,7 +425,7 @@
 		FROM
 			extracurricular_exercises_reply eer
 		LEFT JOIN extracurricular_exercises ee ON ee.id_=eer.extracurricular_exercises_id_
-		LEFT JOIN sys_user tea ON eer.user_id_=tea.id_
+		LEFT JOIN sys_user tea ON ee.teacher_id_=tea.id_
 		WHERE
 			eer.user_id_=#{studentId} AND DATE_FORMAT( eer.create_time_, '%Y-%m-%d' ) BETWEEN #{monday} AND #{sunday})
 		UNION ALL

+ 44 - 2
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -22,6 +22,7 @@
         <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="repair_status_" jdbcType="INTEGER" property="repairStatus"/>
         <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
         <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
     </resultMap>
@@ -41,7 +42,7 @@
         description_, amount_, finish_time_,
         send_type_, contact_name_, contact_mobile_,
         address_, pay_status_, create_time_,
-        update_time_)
+        update_time_,repair_status_)
         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},
@@ -49,7 +50,7 @@
         #{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})
+        #{updateTime,jdbcType=TIMESTAMP},#{repairStatus})
     </insert>
     <update id="update" parameterType="com.ym.mec.biz.dal.entity.StudentRepair">
         <!--@mbg.generated-->
@@ -58,6 +59,9 @@
             <if test="transNo != null">
                 trans_no_ = #{transNo},
             </if>
+            <if test="repairStatus != null">
+                repair_status_ = #{repairStatus},
+            </if>
             <if test="organId != null">
                 organ_id_ = ##{organId},
             </if>
@@ -151,4 +155,42 @@
         AND mg.repair_user_id_ != #{employeeId}
         )
     </select>
+
+    <select id="queryPage" resultMap="StudentRepair">
+        SELECT * FROM student_repair sr
+        <include refid="queryPageSql"/>
+        <include refid="global.limit"/>
+    </select>
+    <sql id="queryPageSql">
+        <where>
+            <if test="search != null and search != ''">
+                AND (sr.trans_no_ LIKE CONCAT('%',#{search},'%') OR sr.student_id_ = #{search} OR sr.student_name_ LIKE CONCAT('%',#{search},'%'))
+            </if>
+            <if test="employeeId != null">
+                AND sr.employee_id_ = #{employeeId}
+            </if>
+            <if test="organIdList != null">
+                AND FIND_IN_SET(sr.organ_id_,#{organIdList})
+            </if>
+            <if test="subjectId != null">
+                AND sr.subject_id_ = #{subjectId}
+            </if>
+            <if test="type != null">
+                AND sr.type = #{type}
+            </if>
+            <if test="repairStatus != null">
+                AND sr.repair_status_ = #{repairStatus}
+            </if>
+            <if test="startTime != null">
+                AND sr.create_time_ >= #{startTime}
+            </if>
+            <if test="endTime != null">
+                AND sr.create_time_ &lt;= #{endTime}
+            </if>
+        </where>
+    </sql>
+    <select id="queryCount" resultType="int">
+        SELECT COUNT(id_) FROM student_repair sr
+        <include refid="queryPageSql"/>
+    </select>
 </mapper>

+ 59 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentRepairController.java

@@ -0,0 +1,59 @@
+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.entity.Employee;
+import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
+import com.ym.mec.biz.service.StudentRepairService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+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.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.Objects;
+
+@RequestMapping("studentRepair")
+@Api(tags = "维修服务")
+@RestController
+public class StudentRepairController extends BaseController {
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+    @Autowired
+    private StudentRepairService studentRepairService;
+    @Autowired
+    private EmployeeDao employeeDao;
+
+    @ApiOperation("获取维修列表")
+    @GetMapping(value = "/queryPage")
+    public HttpResponseResult queryPage(RepairStudentQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if(!sysUser.getIsSuperAdmin()){
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganIdList())) {
+                queryInfo.setOrganIdList(employee.getOrganIdList());
+            }else if(StringUtils.isEmpty(employee.getOrganIdList())){
+                return failed("用户所在分部异常");
+            }else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if(!list.containsAll(Arrays.asList(queryInfo.getOrganIdList().split(",")))){
+                    return failed("非法请求");
+                }
+            }
+        }
+        return succeed(studentRepairService.queryPage(queryInfo));
+    }
+}