chenw 7 лет назад
Родитель
Сommit
a22a6f0cd5

+ 58 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/InOutRecordDO.java

@@ -0,0 +1,58 @@
+package com.usoftchina.smartschool.school.po;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 出入校记录详细
+ * @Author chenwei
+ * @Date 2019-03-13
+ */
+public class InOutRecordDO implements Serializable {
+
+    private String recordName;
+    private Date recordDate;
+    private String recordType;
+    private String recordFile;
+    private String weekDays;
+
+    public String getWeekDays() {
+        return weekDays;
+    }
+
+    public void setWeekDays(String weekDays) {
+        this.weekDays = weekDays;
+    }
+
+    public String getRecordFile() {
+        return recordFile;
+    }
+
+    public void setRecordFile(String recordFile) {
+        this.recordFile = recordFile;
+    }
+
+    public String getRecordName() {
+        return recordName;
+    }
+
+    public void setRecordName(String recordName) {
+        this.recordName = recordName;
+    }
+
+    public Date getRecordDate() {
+        return recordDate;
+    }
+
+    public void setRecordDate(Date recordDate) {
+        this.recordDate = recordDate;
+    }
+
+    public String getRecordType() {
+        return recordType;
+    }
+
+    public void setRecordType(String recordType) {
+        this.recordType = recordType;
+    }
+}

+ 14 - 4
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/controller/WxOutInRecordController.java

@@ -5,10 +5,7 @@ import com.usoftchina.smartschool.school.wxschool.basic.service.WxOutInRecordSer
 import com.usoftchina.smartschool.school.wxschool.utils.ResultBean;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 import java.util.Map;
@@ -44,6 +41,19 @@ public class WxOutInRecordController {
 		}
 	}
 
+    /**
+     * 获取出入校记录
+     * @return
+     */
+    @GetMapping("/inout/detail/{id}")
+    public ResultBean getInOutDetail(@PathVariable("id") Long id){
+        try {
+            return new ResultBean(outInRecordService.getInOutRecordById(id));
+        }catch (Exception e){
+            return new ResultBean(e);
+        }
+    }
+
 	/**
 	 * 通知详情
 	 * @param recordId

+ 8 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/WxOutInRecordService.java

@@ -1,5 +1,6 @@
 package com.usoftchina.smartschool.school.wxschool.basic.service;
 
+import com.usoftchina.smartschool.school.po.InOutRecordDO;
 import com.usoftchina.smartschool.school.po.OutInRecordDO;
 import org.apache.ibatis.annotations.Param;
 
@@ -23,6 +24,13 @@ public interface WxOutInRecordService {
 	 */
 	public Map<String, Object> selectRecordOutgoingListByStuId(@Param("stuId") Long stuId, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);
 
+    /**
+     * 获取出入校详情
+     * @param id
+     * @return
+     */
+    InOutRecordDO getInOutRecordById(Long id);
+
 	/**
 	 * 通知详情
 	 * @param recordId

+ 17 - 3
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOutInRecordServiceImpl.java

@@ -1,6 +1,7 @@
 package com.usoftchina.smartschool.school.wxschool.basic.service.impl;
 
 import com.usoftchina.smartschool.school.po.ClazzDO;
+import com.usoftchina.smartschool.school.po.InOutRecordDO;
 import com.usoftchina.smartschool.school.po.OutInRecordDO;
 import com.usoftchina.smartschool.school.po.StudentDO;
 import com.usoftchina.smartschool.school.wxschool.basic.service.WxOutInRecordService;
@@ -13,9 +14,7 @@ import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 @Service
@@ -83,5 +82,20 @@ public class WxOutInRecordServiceImpl implements WxOutInRecordService {
 			throw new Exception("暂无数据");
 		}
 	}
+
+	@Override
+    public InOutRecordDO getInOutRecordById(Long id){
+        InOutRecordDO inOutRecordDO = outInRecordMapper.selectRecordById(id);
+        Date date = inOutRecordDO.getRecordDate();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        String[] weekDays = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
+        int weekday = calendar.get(Calendar.DAY_OF_WEEK) - 1;
+        if (weekday < 0) {
+            weekday = 0;
+        }
+        inOutRecordDO.setWeekDays(weekDays[weekday]);
+	    return inOutRecordDO;
+    }
 	
 }

+ 3 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxOutInRecordMapper.java

@@ -1,5 +1,6 @@
 package com.usoftchina.smartschool.school.wxschool.mapper;
 
+import com.usoftchina.smartschool.school.po.InOutRecordDO;
 import com.usoftchina.smartschool.school.po.OutInRecordDO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -18,4 +19,6 @@ public interface WxOutInRecordMapper {
 	OutInRecordDO get(Long recordId);
 
 	List<OutInRecordDO> selectOutInRecordDOListByStuId(@Param("stuId") Long stuId, @Param("pageStart") Integer pageStart, @Param("pageSize") Integer pageSize);
+
+    InOutRecordDO selectRecordById(Long id);
 }

+ 4 - 0
applications/school/school-server/src/main/resources/mapper/WxOutInRecordMapper.xml

@@ -17,4 +17,8 @@
 		limit #{pageStart},#{pageSize}
 	</select>
 
+  <select id="selectRecordById" resultType="com.usoftchina.smartschool.school.po.InOutRecordDO">
+    SELECT STUDENT.stu_name recordName,RECORD.record_date recordDate, RECORD.record_type recordType,RECORD.file_id recordFile  FROM OUT_IN_RECORD RECORD LEFT JOIN SYS_STUDENT STUDENT ON RECORD.STU_ID = STUDENT.STU_ID  WHERE RECORD.RECORD_ID = #{id}
+  </select>
+
 </mapper>