Browse Source

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/po/FileInfo.java
yingp 6 years ago
parent
commit
f151684375
29 changed files with 525 additions and 238 deletions
  1. 71 23
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/ImageFile.java
  2. 4 3
      applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java
  3. 25 2
      applications/device/device-server/src/test/java/com/usoftchina/smartschool/device/test/TestService.java
  4. 1 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/GradeServiceImpl.java
  5. 11 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysStudent.java
  6. 2 4
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TaskNotifyDO.java
  7. 3 0
      applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
  8. 2 0
      applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml
  9. 10 0
      applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml
  10. 18 1
      base-servers/file/file-api/src/main/java/com/usoftchina/smartschool/file/api/FileApi.java
  11. 4 0
      base-servers/file/file-dto/pom.xml
  12. 37 0
      base-servers/file/file-dto/src/main/java/com/usoftchina/smartschool/file/dto/ImageFile.java
  13. 126 0
      base-servers/file/file-dto/src/main/java/com/usoftchina/smartschool/file/dto/MyMultipartFile.java
  14. 13 3
      base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/controller/FileController.java
  15. 26 15
      base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/po/FileInfo.java
  16. 1 1
      frontend/pc-web/app/model/Subject.js
  17. 19 11
      frontend/pc-web/app/view/Interaction/homework/List.js
  18. 22 2
      frontend/pc-web/app/view/Interaction/homework/Release.js
  19. 5 1
      frontend/pc-web/app/view/basic/student/StudentDetail.js
  20. 4 1
      frontend/pc-web/app/view/basic/student/StudentList.js
  21. 0 1
      frontend/pc-web/app/view/core/form/field/SubjectComboBox.js
  22. 1 1
      frontend/wechat-web/public/index.html
  23. 5 5
      frontend/wechat-web/src/configs/api.config.js
  24. 2 4
      frontend/wechat-web/src/configs/router.config.js
  25. 1 0
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.css
  26. 0 104
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.js
  27. 111 0
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.jsx
  28. 0 55
      frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail1.jsx
  29. 1 1
      frontend/wechat-web/src/modules/home/HomePage.jsx

+ 71 - 23
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/po/ImageFile.java

@@ -1,6 +1,8 @@
 package com.usoftchina.smartschool.device.po;
 package com.usoftchina.smartschool.device.po;
 
 
 import org.springframework.lang.Nullable;
 import org.springframework.lang.Nullable;
+import org.springframework.util.Assert;
+import org.springframework.util.FileCopyUtils;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
 import java.io.*;
 import java.io.*;
@@ -9,55 +11,101 @@ import java.io.*;
  * @author: guq
  * @author: guq
  * @create: 2019-03-08 16:42
  * @create: 2019-03-08 16:42
  **/
  **/
-public class ImageFile implements MultipartFile{
+public class ImageFile implements MultipartFile {
 
 
-    private final byte[] imgContent;
-    private final String header;
+    private final String name;
 
 
-    public ImageFile(byte[] imgContent, String header) {
-        this.imgContent = imgContent;
-        this.header = header.split(";")[0];
+    private String originalFilename;
+
+    @Nullable
+    private String contentType;
+
+    private final byte[] content;
+
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param content the content of the file
+     */
+    public ImageFile(String name, @Nullable byte[] content) {
+        this(name, "", null, content);
+    }
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param contentStream the content of the file as stream
+     * @throws IOException if reading from the stream failed
+     */
+    public ImageFile(String name, InputStream contentStream) throws IOException {
+        this(name, "", null, FileCopyUtils.copyToByteArray(contentStream));
+    }
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param originalFilename the original filename (as on the client's machine)
+     * @param contentType the content type (if known)
+     * @param content the content of the file
+     */
+    public ImageFile(
+            String name, @Nullable String originalFilename, @Nullable String contentType, @Nullable byte[] content) {
+
+        Assert.hasLength(name, "Name must not be null");
+        this.name = name;
+        this.originalFilename = (originalFilename != null ? originalFilename : "");
+        this.contentType = contentType;
+        this.content = (content != null ? content : new byte[0]);
+    }
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param originalFilename the original filename (as on the client's machine)
+     * @param contentType the content type (if known)
+     * @param contentStream the content of the file as stream
+     * @throws IOException if reading from the stream failed
+     */
+    public ImageFile(
+            String name, @Nullable String originalFilename, @Nullable String contentType, InputStream contentStream)
+            throws IOException {
+
+        this(name, originalFilename, contentType, FileCopyUtils.copyToByteArray(contentStream));
     }
     }
 
 
-    @Override
+
     public String getName() {
     public String getName() {
-        return System.currentTimeMillis() + Math.random() + "." + header.split("/")[1];
+        return this.name;
     }
     }
 
 
-    @Nullable
-    @Override
     public String getOriginalFilename() {
     public String getOriginalFilename() {
-        return System.currentTimeMillis() + (int)Math.random() * 10000 + "." + header.split("/")[1];
+        return this.originalFilename;
     }
     }
 
 
     @Nullable
     @Nullable
-    @Override
     public String getContentType() {
     public String getContentType() {
-        return header.split(":")[1];
+        return this.contentType;
     }
     }
 
 
-    @Override
     public boolean isEmpty() {
     public boolean isEmpty() {
-        return imgContent == null || imgContent.length == 0;
+        return (this.content.length == 0);
     }
     }
 
 
-    @Override
     public long getSize() {
     public long getSize() {
-        return imgContent.length;
+        return this.content.length;
     }
     }
 
 
-    @Override
     public byte[] getBytes() throws IOException {
     public byte[] getBytes() throws IOException {
-        return imgContent;
+        return this.content;
     }
     }
 
 
-    @Override
     public InputStream getInputStream() throws IOException {
     public InputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(imgContent);
+        return new ByteArrayInputStream(this.content);
     }
     }
 
 
-    @Override
     public void transferTo(File dest) throws IOException, IllegalStateException {
     public void transferTo(File dest) throws IOException, IllegalStateException {
-        new FileOutputStream(dest).write(imgContent);
+        FileCopyUtils.copy(this.content, dest);
     }
     }
+
 }
 }

+ 4 - 3
applications/device/device-server/src/main/java/com/usoftchina/smartschool/device/service/impl/AccessControlServiceImpl.java

@@ -5,11 +5,11 @@ import com.usoftchina.smartschool.device.dto.AccessControlInfo;
 import com.usoftchina.smartschool.device.mapper.AccessControlRecordMapper;
 import com.usoftchina.smartschool.device.mapper.AccessControlRecordMapper;
 import com.usoftchina.smartschool.device.mapper.StudentInfoMapper;
 import com.usoftchina.smartschool.device.mapper.StudentInfoMapper;
 import com.usoftchina.smartschool.device.po.AccessControlRecord;
 import com.usoftchina.smartschool.device.po.AccessControlRecord;
-import com.usoftchina.smartschool.device.po.ImageFile;
 import com.usoftchina.smartschool.device.po.StudentInfo;
 import com.usoftchina.smartschool.device.po.StudentInfo;
 import com.usoftchina.smartschool.device.service.AccessControlService;
 import com.usoftchina.smartschool.device.service.AccessControlService;
 import com.usoftchina.smartschool.file.api.FileApi;
 import com.usoftchina.smartschool.file.api.FileApi;
 import com.usoftchina.smartschool.file.dto.FileInfoDTO;
 import com.usoftchina.smartschool.file.dto.FileInfoDTO;
+import com.usoftchina.smartschool.file.dto.ImageFile;
 import com.usoftchina.smartschool.utils.DateUtils;
 import com.usoftchina.smartschool.utils.DateUtils;
 import com.usoftchina.smartschool.utils.StringUtils;
 import com.usoftchina.smartschool.utils.StringUtils;
 import com.usoftchina.smartschool.wechat.api.WechatApi;
 import com.usoftchina.smartschool.wechat.api.WechatApi;
@@ -18,6 +18,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.MediaType;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
@@ -68,10 +69,10 @@ public class AccessControlServiceImpl implements AccessControlService{
          */
          */
         byte[] imageData = info.getImageData();
         byte[] imageData = info.getImageData();
         if (null != imageData && imageData.length > 0) {
         if (null != imageData && imageData.length > 0) {
-            MultipartFile file = new ImageFile(imageData, information.get(0).getStuName());
+            ImageFile file = new ImageFile(information.get(0).getStuName(), imageData);
             Result<FileInfoDTO> fileInfo = null;
             Result<FileInfoDTO> fileInfo = null;
             try {
             try {
-                fileInfo = fileApi.upload(0L, file);
+                fileInfo = fileApi.imageUpload(file);
                 filePath = fileInfo.getData().getFullPath();
                 filePath = fileInfo.getData().getFullPath();
             }catch (Exception ex) {
             }catch (Exception ex) {
                 logger.error(ex.getMessage());
                 logger.error(ex.getMessage());

+ 25 - 2
applications/device/device-server/src/test/java/com/usoftchina/smartschool/device/test/TestService.java

@@ -1,7 +1,12 @@
 package com.usoftchina.smartschool.device.test;
 package com.usoftchina.smartschool.device.test;
 
 
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.alibaba.fastjson.JSON;
+import com.usoftchina.smartschool.base.Result;
+import com.usoftchina.smartschool.device.DeviceApplication;
 import com.usoftchina.smartschool.device.dto.AccessControlInfo;
 import com.usoftchina.smartschool.device.dto.AccessControlInfo;
+import com.usoftchina.smartschool.file.api.FileApi;
+import com.usoftchina.smartschool.file.dto.FileInfoDTO;
+import com.usoftchina.smartschool.file.dto.ImageFile;
 import com.usoftchina.smartschool.utils.DateUtils;
 import com.usoftchina.smartschool.utils.DateUtils;
 import com.usoftchina.smartschool.wechat.api.WechatApi;
 import com.usoftchina.smartschool.wechat.api.WechatApi;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
 import com.usoftchina.smartschool.wechat.dto.MessageInfoDTO;
@@ -11,18 +16,22 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 import org.springframework.test.context.junit4.SpringRunner;
 
 
+import java.io.*;
+
 /**
 /**
  * @author: guq
  * @author: guq
  * @create: 2019-03-12 09:48
  * @create: 2019-03-12 09:48
  **/
  **/
 @RunWith(SpringRunner.class)
 @RunWith(SpringRunner.class)
-@SpringBootTest
+@SpringBootTest(classes = DeviceApplication.class)
 public class TestService {
 public class TestService {
 
 
   /*  @Autowired
   /*  @Autowired
     AccessService accessService;*/
     AccessService accessService;*/
     @Autowired
     @Autowired
     WechatApi wechatApi;
     WechatApi wechatApi;
+    @Autowired
+    private FileApi fileApi;
 
 
     @Test
     @Test
     public void testa_accessservice() {
     public void testa_accessservice() {
@@ -46,4 +55,18 @@ public class TestService {
         msg.setRemark("您好! 你的孩子: ");
         msg.setRemark("您好! 你的孩子: ");
         wechatApi.sendMsg(msg);
         wechatApi.sendMsg(msg);
     }
     }
+
+    @Test
+    public void testC() throws IOException {
+        InputStream in = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\cw.jpg"));
+        int len = 0;
+        byte[] bytes = new byte[1024 * 1024];
+        while ((len = in.read(bytes)) != -1) {
+            in.read(bytes);
+        }
+        in.close();
+        Result<FileInfoDTO> result = fileApi.imageUpload(new ImageFile("测试", bytes));
+        System.out.println(JSON.toJSONString(result));
+    }
+
 }
 }

+ 1 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/GradeServiceImpl.java

@@ -121,6 +121,7 @@ public class GradeServiceImpl implements GradeService{
                     sysGrade.setGrade_status(1);
                     sysGrade.setGrade_status(1);
                     sysGradeMapper.insertSelective(sysGrade);
                     sysGradeMapper.insertSelective(sysGrade);
                     grade_id = sysGrade.getGrade_id();
                     grade_id = sysGrade.getGrade_id();
+                    grade = sysGrade;
                     //年纪存在、需要更新
                     //年纪存在、需要更新
                 } else if (update){
                 } else if (update){
                     grade.setSchool_id(schoolId);
                     grade.setSchool_id(schoolId);

+ 11 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/SysStudent.java

@@ -49,6 +49,17 @@ public class SysStudent {
 
 
     private String stu_political;
     private String stu_political;
 
 
+    private String stu_cardNo;
+
+
+    public String getStu_cardNo() {
+        return stu_cardNo;
+    }
+
+    public void setStu_cardNo(String stu_cardNo) {
+        this.stu_cardNo = stu_cardNo;
+    }
+
     public String getStu_classnickname() {
     public String getStu_classnickname() {
         return stu_classnickname;
         return stu_classnickname;
     }
     }

+ 2 - 4
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/po/TaskNotifyDO.java

@@ -41,13 +41,11 @@ public class TaskNotifyDO implements Serializable {
 	private Long schoolId;
 	private Long schoolId;
 	//通知人
 	//通知人
 	private String taskNotifier;
 	private String taskNotifier;
-	//班级
+
 	private String classzName;
 	private String classzName;
-	//年级
 	private String gradeName;
 	private String gradeName;
-	//创建人姓名
 	private String creator;
 	private String creator;
-
 	private Date publishDate;
 	private Date publishDate;
 
 
+
 }
 }

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

@@ -73,6 +73,9 @@ public class WxPrincipalMailboxServiceImpl implements WxPrincipalMailboxService
 				principalMailboxDO.setMbGrade(wxGradeMapper.get(clazzDO.getGradeId()).getGradeName());
 				principalMailboxDO.setMbGrade(wxGradeMapper.get(clazzDO.getGradeId()).getGradeName());
 			}
 			}
 		}
 		}
+
+
+
 		int save = principalMailboxMapper.save(principalMailboxDO);
 		int save = principalMailboxMapper.save(principalMailboxDO);
 		if (save>0){
 		if (save>0){
 			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
 			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

+ 2 - 0
applications/school/school-server/src/main/resources/mapper/HomeWorkMapper.xml

@@ -19,6 +19,8 @@
         <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP"/>
         <result column="publish_date" property="publish_date" jdbcType="TIMESTAMP"/>
         <result column="creator" property="creator" jdbcType="VARCHAR"/>
         <result column="creator" property="creator" jdbcType="VARCHAR"/>
         <result column="accessory" property="accessory" jdbcType="VARCHAR"/>
         <result column="accessory" property="accessory" jdbcType="VARCHAR"/>
+        <result property="task_classid" column="task_classid" jdbcType="BIGINT"/>
+        <result property="task_gradeid" column="task_gradeid" jdbcType="BIGINT"/>
     </resultMap>
     </resultMap>
 
 
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">

+ 10 - 0
applications/school/school-server/src/main/resources/mapper/SysStudentMapper.xml

@@ -23,6 +23,7 @@
     <result column="stu_native" property="stu_native" jdbcType="VARCHAR" />
     <result column="stu_native" property="stu_native" jdbcType="VARCHAR" />
     <result column="stu_nation" property="stu_nation" jdbcType="VARCHAR" />
     <result column="stu_nation" property="stu_nation" jdbcType="VARCHAR" />
     <result column="stu_political" property="stu_political" jdbcType="VARCHAR" />
     <result column="stu_political" property="stu_political" jdbcType="VARCHAR" />
+    <result property="stu_cardNo" column="stu_cardNo" jdbcType="VARCHAR"/>
   </resultMap>
   </resultMap>
 
 
   <sql id="Base_Column_List" >
   <sql id="Base_Column_List" >
@@ -120,6 +121,9 @@
       <if test="stu_political != null" >
       <if test="stu_political != null" >
         stu_political,
         stu_political,
       </if>
       </if>
+      <if test="stu_cardNo != null" >
+        stu_cardNo,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="stu_number != null" >
       <if test="stu_number != null" >
@@ -182,6 +186,9 @@
       <if test="stu_political != null" >
       <if test="stu_political != null" >
         #{stu_political,jdbcType=VARCHAR},
         #{stu_political,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="stu_cardNo != null" >
+        #{stu_cardNo,jdbcType=VARCHAR},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.SysStudent" >
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.smartschool.school.po.SysStudent" >
@@ -247,6 +254,9 @@
       <if test="stu_political != null" >
       <if test="stu_political != null" >
         stu_political = #{stu_political,jdbcType=VARCHAR},
         stu_political = #{stu_political,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="stu_cardNo != null" >
+        stu_cardNo = #{stu_cardNo,jdbcType=VARCHAR},
+      </if>
     </set>
     </set>
     where stu_id = #{stu_id,jdbcType=BIGINT}
     where stu_id = #{stu_id,jdbcType=BIGINT}
   </update>
   </update>

+ 18 - 1
base-servers/file/file-api/src/main/java/com/usoftchina/smartschool/file/api/FileApi.java

@@ -4,9 +4,14 @@ import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.file.dto.FileInfoDTO;
 import com.usoftchina.smartschool.file.dto.FileInfoDTO;
 import com.usoftchina.smartschool.file.dto.FolderDTO;
 import com.usoftchina.smartschool.file.dto.FolderDTO;
 import com.usoftchina.smartschool.file.dto.FolderSaveDTO;
 import com.usoftchina.smartschool.file.dto.FolderSaveDTO;
+import com.usoftchina.smartschool.file.dto.ImageFile;
 import feign.codec.Encoder;
 import feign.codec.Encoder;
 import feign.form.spring.SpringFormEncoder;
 import feign.form.spring.SpringFormEncoder;
+import org.springframework.beans.factory.ObjectFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.cloud.openfeign.support.SpringEncoder;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.MediaType;
 import org.springframework.http.MediaType;
@@ -26,9 +31,13 @@ public interface FileApi {
 
 
     @Configuration
     @Configuration
     class MultipartSupportConfig {
     class MultipartSupportConfig {
+
+        @Autowired
+        private ObjectFactory<HttpMessageConverters> messageConverters;
+
         @Bean
         @Bean
         public Encoder feignFormEncoder() {
         public Encoder feignFormEncoder() {
-            return new SpringFormEncoder();
+            return new SpringFormEncoder(new SpringEncoder(messageConverters));
         }
         }
     }
     }
 
 
@@ -79,6 +88,14 @@ public interface FileApi {
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     Result<FileInfoDTO> upload(@RequestParam("folderId") Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception;
     Result<FileInfoDTO> upload(@RequestParam("folderId") Long folderId, @RequestPart(value = "file") MultipartFile file) throws Exception;
 
 
+    /**
+     * 上传图片文件
+     * @param file
+     * @return
+     */
+    @PostMapping(value = "/imageUpload")
+    Result<FileInfoDTO> imageUpload(@RequestBody ImageFile file);
+
     /**
     /**
      * 文件下载
      * 文件下载
      *
      *

+ 4 - 0
base-servers/file/file-dto/pom.xml

@@ -17,6 +17,10 @@
             <artifactId>springfox-swagger2</artifactId>
             <artifactId>springfox-swagger2</artifactId>
             <scope>compile</scope>
             <scope>compile</scope>
         </dependency>
         </dependency>
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-web</artifactId>
+      </dependency>
     </dependencies>
     </dependencies>
 
 
 </project>
 </project>

+ 37 - 0
base-servers/file/file-dto/src/main/java/com/usoftchina/smartschool/file/dto/ImageFile.java

@@ -0,0 +1,37 @@
+package com.usoftchina.smartschool.file.dto;
+
+/**
+ * @Author chenwei
+ * @Date 2019-03-14
+ */
+public class ImageFile {
+
+    private String name;
+
+    private byte[] content;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public byte[] getContent() {
+        return content;
+    }
+
+    public void setContent(byte[] content) {
+        this.content = content;
+    }
+
+    public ImageFile() {
+    }
+
+    public ImageFile(String name, byte[] content) {
+
+        this.name = name;
+        this.content = content;
+    }
+}

+ 126 - 0
base-servers/file/file-dto/src/main/java/com/usoftchina/smartschool/file/dto/MyMultipartFile.java

@@ -0,0 +1,126 @@
+package com.usoftchina.smartschool.file.dto;
+
+import org.springframework.lang.Nullable;
+import org.springframework.util.Assert;
+import org.springframework.util.FileCopyUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @Author chenwei
+ * @Date 2019-03-14
+ */
+public class MyMultipartFile implements MultipartFile {
+
+    private final String name;
+
+    private String originalFilename;
+
+    @Nullable
+    private String contentType;
+
+    private final byte[] content;
+
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param content the content of the file
+     */
+    public MyMultipartFile(String name, @Nullable byte[] content) {
+        this(name, "", null, content);
+    }
+
+    public MyMultipartFile(String name, String originalName, @Nullable byte[] content) {
+        this(name, originalName, null, content);
+    }
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param contentStream the content of the file as stream
+     * @throws IOException if reading from the stream failed
+     */
+    public MyMultipartFile(String name, InputStream contentStream) throws IOException {
+        this(name, "", null, FileCopyUtils.copyToByteArray(contentStream));
+    }
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param originalFilename the original filename (as on the client's machine)
+     * @param contentType the content type (if known)
+     * @param content the content of the file
+     */
+    public MyMultipartFile(
+            String name, @Nullable String originalFilename, @Nullable String contentType, @Nullable byte[] content) {
+
+        Assert.hasLength(name, "Name must not be null");
+        this.name = name;
+        this.originalFilename = (originalFilename != null ? originalFilename : "");
+        this.contentType = contentType;
+        this.content = (content != null ? content : new byte[0]);
+    }
+
+    /**
+     * Create a new MockMultipartFile with the given content.
+     * @param name the name of the file
+     * @param originalFilename the original filename (as on the client's machine)
+     * @param contentType the content type (if known)
+     * @param contentStream the content of the file as stream
+     * @throws IOException if reading from the stream failed
+     */
+    public MyMultipartFile(
+            String name, @Nullable String originalFilename, @Nullable String contentType, InputStream contentStream)
+            throws IOException {
+
+        this(name, originalFilename, contentType, FileCopyUtils.copyToByteArray(contentStream));
+    }
+
+
+    @Override
+    public String getName() {
+        return this.name;
+    }
+
+    @Override
+    public String getOriginalFilename() {
+        return this.originalFilename;
+    }
+
+    @Override
+    @Nullable
+    public String getContentType() {
+        return this.contentType;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return (this.content.length == 0);
+    }
+
+    @Override
+    public long getSize() {
+        return this.content.length;
+    }
+
+    @Override
+    public byte[] getBytes() throws IOException {
+        return this.content;
+    }
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        return new ByteArrayInputStream(this.content);
+    }
+
+    @Override
+    public void transferTo(File dest) throws IOException, IllegalStateException {
+        FileCopyUtils.copy(this.content, dest);
+    }
+
+}

+ 13 - 3
base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/controller/FileController.java

@@ -4,9 +4,7 @@ import com.usoftchina.smartschool.base.Result;
 import com.usoftchina.smartschool.exception.BizException;
 import com.usoftchina.smartschool.exception.BizException;
 import com.usoftchina.smartschool.exception.ExceptionCode;
 import com.usoftchina.smartschool.exception.ExceptionCode;
 import com.usoftchina.smartschool.file.constant.FileConstant;
 import com.usoftchina.smartschool.file.constant.FileConstant;
-import com.usoftchina.smartschool.file.dto.FileInfoDTO;
-import com.usoftchina.smartschool.file.dto.FolderDTO;
-import com.usoftchina.smartschool.file.dto.FolderSaveDTO;
+import com.usoftchina.smartschool.file.dto.*;
 import com.usoftchina.smartschool.file.po.FileInfo;
 import com.usoftchina.smartschool.file.po.FileInfo;
 import com.usoftchina.smartschool.file.service.FileInfoService;
 import com.usoftchina.smartschool.file.service.FileInfoService;
 import com.usoftchina.smartschool.file.storage.FileStorageClient;
 import com.usoftchina.smartschool.file.storage.FileStorageClient;
@@ -101,6 +99,18 @@ public class FileController {
         return Result.success(BeanMapper.map(info, FileInfoDTO.class));
         return Result.success(BeanMapper.map(info, FileInfoDTO.class));
     }
     }
 
 
+    @ApiOperation(value = "上传文件")
+    @PostMapping(value = "/imageUpload")
+    public Result<FileInfoDTO> imageUpload(@RequestBody ImageFile imageFile) throws Exception {
+        // 检查父文件夹
+        FileInfo parent = checkFolder(0L);
+        MultipartFile file = new MyMultipartFile(imageFile.getName(), imageFile.getName()+ ".jpg", imageFile.getContent()) ;
+        FileInfo info = FileInfo.newFile(file).folder(parent.getId())
+                .storeBy(storageClient).build();
+        fileService.save(info);
+        return Result.success(BeanMapper.map(info, FileInfoDTO.class));
+    }
+
     @ApiOperation(value = "下载文件")
     @ApiOperation(value = "下载文件")
     @GetMapping(value = "/download/{id}")
     @GetMapping(value = "/download/{id}")
     public void download(@PathVariable("id") Long id, HttpServletResponse response) throws Exception {
     public void download(@PathVariable("id") Long id, HttpServletResponse response) throws Exception {

+ 26 - 15
base-servers/file/file-server/src/main/java/com/usoftchina/smartschool/file/po/FileInfo.java

@@ -1,14 +1,14 @@
 package com.usoftchina.smartschool.file.po;
 package com.usoftchina.smartschool.file.po;
 
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.github.tobato.fastdfs.domain.StorePath;
+import com.github.tobato.fastdfs.service.FastFileStorageClient;
 import com.usoftchina.smartschool.base.entity.CommonBaseEntity;
 import com.usoftchina.smartschool.base.entity.CommonBaseEntity;
 import com.usoftchina.smartschool.context.BaseContextHolder;
 import com.usoftchina.smartschool.context.BaseContextHolder;
-import com.usoftchina.smartschool.file.storage.FileMetadata;
-import com.usoftchina.smartschool.file.storage.FileStorageClient;
-import com.usoftchina.smartschool.file.storage.util.FileType;
-import com.usoftchina.smartschool.file.storage.util.FileTypeUtils;
-import com.usoftchina.smartschool.file.storage.util.FilenameUtils;
+import com.usoftchina.smartschool.file.constant.FileType;
+import com.usoftchina.smartschool.file.util.FileTypeUtils;
 import com.usoftchina.smartschool.utils.StringUtils;
 import com.usoftchina.smartschool.utils.StringUtils;
+import org.apache.commons.io.FilenameUtils;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
 import java.io.IOException;
 import java.io.IOException;
@@ -19,7 +19,7 @@ import java.util.Date;
  * @author yingp
  * @author yingp
  * @date 2018/9/29
  * @date 2018/9/29
  */
  */
-public class FileInfo extends CommonBaseEntity implements Serializable {
+public class FileInfo extends CommonBaseEntity implements Serializable{
     /**
     /**
      * 文件夹id
      * 文件夹id
      */
      */
@@ -47,8 +47,7 @@ public class FileInfo extends CommonBaseEntity implements Serializable {
     private long size;
     private long size;
     /**
     /**
      * 类型
      * 类型
-     *
-     * @see com.usoftchina.smartschool.file.storage.util.FileType
+     * @see com.usoftchina.smartschool.file.constant.FileType
      */
      */
     private String type;
     private String type;
 
 
@@ -212,7 +211,7 @@ public class FileInfo extends CommonBaseEntity implements Serializable {
         return info;
         return info;
     }
     }
 
 
-    public static Builder newFile(MultipartFile file) {
+    public static Builder newFile(MultipartFile file){
         return new Builder(file);
         return new Builder(file);
     }
     }
 
 
@@ -228,7 +227,7 @@ public class FileInfo extends CommonBaseEntity implements Serializable {
         private long size;
         private long size;
         private String type;
         private String type;
         private MultipartFile multipartFile;
         private MultipartFile multipartFile;
-        private FileStorageClient storageClient;
+        private FastFileStorageClient storageClient;
         private String baseUrl;
         private String baseUrl;
 
 
         public Builder(MultipartFile file) {
         public Builder(MultipartFile file) {
@@ -275,7 +274,7 @@ public class FileInfo extends CommonBaseEntity implements Serializable {
             return this;
             return this;
         }
         }
 
 
-        public Builder storeBy(FileStorageClient storageClient) {
+        public Builder storeBy(FastFileStorageClient storageClient){
             this.storageClient = storageClient;
             this.storageClient = storageClient;
             return this;
             return this;
         }
         }
@@ -285,11 +284,23 @@ public class FileInfo extends CommonBaseEntity implements Serializable {
             return this;
             return this;
         }
         }
 
 
-        public FileInfo build() throws IOException {
+        public FileInfo build() throws IOException{
             if (null != storageClient) {
             if (null != storageClient) {
-                this.fullPath = StringUtils.nullIf(baseUrl) +
-                        storageClient.uploadFile(multipartFile.getInputStream(),
-                                new FileMetadata(mime, ext, size));
+                StorePath storePath;
+                if (FileType.of(type) == FileType.IMAGE) {
+                    // 保存图片 + 生成缩略图
+                    try {
+                        storePath = storageClient.uploadImageAndCrtThumbImage(multipartFile.getInputStream(),
+                                size, ext, null);
+                    }catch (Exception e) {
+                        storePath = storageClient.uploadFile(multipartFile.getInputStream(),
+                                size, ext, null);
+                    }
+                } else {
+                    storePath = storageClient.uploadFile(multipartFile.getInputStream(),
+                            size, ext, null);
+                }
+                this.fullPath = StringUtils.nullIf(baseUrl) + storePath.getFullPath();
             }
             }
 
 
             return new FileInfo(folderId, name, fullPath, mime, ext, type, size);
             return new FileInfo(folderId, name, fullPath, mime, ext, type, size);

+ 1 - 1
frontend/pc-web/app/model/Subject.js

@@ -5,7 +5,7 @@ Ext.define('school.model.Subject', {
     extend: 'school.model.Base',
     extend: 'school.model.Base',
     fields: [{
     fields: [{
         name: 'subject_id', // 学科代码
         name: 'subject_id', // 学科代码
-        type: 'string'
+        type: 'int'
     }, {
     }, {
         name: 'subject_name', // 学科名称
         name: 'subject_name', // 学科名称
         type: 'string'
         type: 'string'

+ 19 - 11
frontend/pc-web/app/view/Interaction/homework/List.js

@@ -174,19 +174,26 @@ Ext.define('school.view.interaction.homework.List', {
                 }, {
                 }, {
                     text: '班级',
                     text: '班级',
                     dataIndex: 'classz_name'
                     dataIndex: 'classz_name'
+                }, {
+                    text: '学科',
+                    dataIndex: 'subject_id',
+                    renderer: function(v) {
+                        let store = Ext.StoreMgr.get('store_subject');
+                        let idx = store.findBy(function(r) {
+                            return r.get('subject_id') == v
+                        });
+                        let record;
+                        if(idx >= 0) {
+                            record = store.getAt(idx);
+                            return record.get('subject_name')
+                        }else {
+                            return v;
+                        }
+                    }
                 }, {
                 }, {
                     text: '标题',
                     text: '标题',
                     dataIndex: 'task_title',
                     dataIndex: 'task_title',
-                    width: 120,
-                    // tdCls: 'x-detail-column',
-                    // listeners: {
-                    //     click: function (view, td, row, col, e, record, tr, eOpts, event) {
-                    //         let gridConfig = me.gridConfig;
-                    //         school.util.BaseUtil.openTab(gridConfig.addXtype, gridConfig.addTitle + '(' + record.get('task_title') + ')', gridConfig.addXtype + '-' + record.get(gridConfig.idField), {
-                    //             initId: record.get(gridConfig.idField)
-                    //         });
-                    //     }
-                    // }
+                    width: 120
                 }, {
                 }, {
                     text: '内容',
                     text: '内容',
                     dataIndex: 'task_context',
                     dataIndex: 'task_context',
@@ -205,7 +212,7 @@ Ext.define('school.view.interaction.homework.List', {
                 }, {
                 }, {
                     text: '发布时间',
                     text: '发布时间',
                     dataIndex: 'publish_date',
                     dataIndex: 'publish_date',
-                    width: 120
+                    width: 150,
                 }, ]
                 }, ]
             },
             },
         });
         });
@@ -213,6 +220,7 @@ Ext.define('school.view.interaction.homework.List', {
     },
     },
 
 
     refresh: function() {
     refresh: function() {
+        Ext.StoreMgr.get('store_subject').load();
         Ext.StoreMgr.get('store_grade').load();
         Ext.StoreMgr.get('store_grade').load();
         Ext.StoreMgr.get('store_class').load();
         Ext.StoreMgr.get('store_class').load();
         this.items.items[0].store.load();
         this.items.items[0].store.load();

+ 22 - 2
frontend/pc-web/app/view/Interaction/homework/Release.js

@@ -19,6 +19,7 @@ Ext.define('school.view.interaction.homework.Release', {
     _deleteUrl: '/api/school/homework/delete',
     _deleteUrl: '/api/school/homework/delete',
     initId: 0,
     initId: 0,
     initComponent: function () {
     initComponent: function () {
+        var me = this;
         Ext.apply(this, {
         Ext.apply(this, {
             defaultItems: [{
             defaultItems: [{
                 xtype: 'hidden',
                 xtype: 'hidden',
@@ -36,16 +37,27 @@ Ext.define('school.view.interaction.homework.Release', {
                 fieldLabel: "发布人",
                 fieldLabel: "发布人",
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,
                 defaultValue: school.util.BaseUtil.getCurrentUser().username,
                 readOnly: true
                 readOnly: true
+            }, {
+                xtype: 'hidden',
+                name: 'task_gradeid',
+                fieldLabel: '年级ID'
             }, {
             }, {
                 xtype: 'gradecombo',
                 xtype: 'gradecombo',
                 name: 'grade_name',
                 name: 'grade_name',
                 fieldLabel: '年级',
                 fieldLabel: '年级',
                 listeners: {
                 listeners: {
                     select: function (combo, record, eOpts) {
                     select: function (combo, record, eOpts) {
-                        combo.up('form').getForm().findField('classz_name').setValue(null);
+                        let viewModel = me.getViewModel();
+                        viewModel.set('task_gradeid', record.get('grade_id'));
+                        viewModel.set('task_classid', null);
+                        viewModel.set('classz_name', null);
                     }
                     }
                 },
                 },
                 allowBlank: false
                 allowBlank: false
+            }, {
+                xtype: 'hidden',
+                name: 'task_classid',
+                fieldLabel: '班级ID'
             }, {
             }, {
                 xtype: 'classcombo',
                 xtype: 'classcombo',
                 name: 'classz_name',
                 name: 'classz_name',
@@ -67,10 +79,17 @@ Ext.define('school.view.interaction.homework.Release', {
                         }
                         }
                     },
                     },
                     select: function (combo, record, eOpts) {
                     select: function (combo, record, eOpts) {
-                        combo.up('form').getForm().findField('grade_name').setValue(record.get('clazz_grade'));
+                        let viewModel = me.getViewModel();
+                        viewModel.set('task_classid', record.get('clazz_id'));
+                        viewModel.set('task_gradeid', record.get('grade_id'));
+                        viewModel.set('grade_name', record.get('clazz_grade'));
                     }
                     }
                 },
                 },
                 allowBlank: false
                 allowBlank: false
+            }, {
+                xtype: 'subjectcombo',
+                name: 'subject_id',
+                fieldLabel: '学科'
             }, {
             }, {
                 xtype: 'datefield',
                 xtype: 'datefield',
                 name: 'start_date',
                 name: 'start_date',
@@ -156,6 +175,7 @@ Ext.define('school.view.interaction.homework.Release', {
     },
     },
 
 
     refresh: function() {
     refresh: function() {
+        Ext.StoreMgr.get('store_subject').load();
         Ext.StoreMgr.get('store_grade').load();
         Ext.StoreMgr.get('store_grade').load();
         Ext.StoreMgr.get('store_class').load();
         Ext.StoreMgr.get('store_class').load();
     }
     }

+ 5 - 1
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -13,7 +13,7 @@ Ext.define('school.view.basic.student.StudentDetail', {
     _statusCodeField: null,
     _statusCodeField: null,
     _auditmanField: null,
     _auditmanField: null,
     _auditdateField: null,
     _auditdateField: null,
-    // _readUrl: 'http://10.1.80.47:9560/student/read',
+    // _readUrl: 'http://10.1.80.47:9520/api/shcool/student/read',
     _readUrl: '/api/school/student/read',
     _readUrl: '/api/school/student/read',
     // _saveUrl: 'http://10.1.80.36:9520/api/school/student/save',
     // _saveUrl: 'http://10.1.80.36:9520/api/school/student/save',
     _saveUrl: '/api/school/student/save',
     _saveUrl: '/api/school/student/save',
@@ -140,6 +140,10 @@ Ext.define('school.view.basic.student.StudentDetail', {
                     }
                     }
                 },
                 },
                 allowBlank: false
                 allowBlank: false
+            }, {
+                xtype: 'textfield',
+                name: 'stu_cardNo',
+                fieldLabel: '校园卡通号',
             }, {
             }, {
                 name: "parent",
                 name: "parent",
                 xtype: "detailGridField",
                 xtype: "detailGridField",

+ 4 - 1
frontend/pc-web/app/view/basic/student/StudentList.js

@@ -5,8 +5,8 @@ Ext.define('school.view.basic.student.StudentList', {
     extend: 'school.view.core.base.BasePanel',
     extend: 'school.view.core.base.BasePanel',
     xtype: 'basic-student-studentlist',
     xtype: 'basic-student-studentlist',
 
 
+    // dataUrl: 'http://10.1.80.47:9560/student/list',
     dataUrl: '/api/school/student/list',
     dataUrl: '/api/school/student/list',
-    // dataUrl: 'http:/api/school/student/list',
     _title: '学生信息',
     _title: '学生信息',
     caller: 'Student',
     caller: 'Student',
     pathKey: 'student',
     pathKey: 'student',
@@ -183,6 +183,9 @@ Ext.define('school.view.basic.student.StudentList', {
                     width: 120,
                     width: 120,
                     xtype: 'datecolumn',
                     xtype: 'datecolumn',
                     format: 'Y-m-d'
                     format: 'Y-m-d'
+                }, {
+                    text: '校园卡通号',
+                    dataIndex: 'stu_cardNo'
                 }]
                 }]
             },
             },
         });
         });

+ 0 - 1
frontend/pc-web/app/view/core/form/field/SubjectComboBox.js

@@ -11,7 +11,6 @@ Ext.define('school.view.core.form.field.SubjectComboBox', {
     initComponent: function() {
     initComponent: function() {
         var me = this;
         var me = this;
         var store = Ext.StoreMgr.get('store_subject');
         var store = Ext.StoreMgr.get('store_subject');
-        store.load();
         Ext.apply(me, {
         Ext.apply(me, {
             store: store,
             store: store,
         });
         });

+ 1 - 1
frontend/wechat-web/public/index.html

@@ -20,7 +20,7 @@
       work correctly both with client-side routing and a non-root public URL.
       work correctly both with client-side routing and a non-root public URL.
       Learn how to configure a non-root public URL by running `npm run build`.
       Learn how to configure a non-root public URL by running `npm run build`.
     -->
     -->
-    <title>智慧校园</title>
+    <title>云平安校园</title>
 </head>
 </head>
 <body>
 <body>
 <noscript>
 <noscript>

+ 5 - 5
frontend/wechat-web/src/configs/api.config.js

@@ -7,10 +7,9 @@ import store from './../redux/store/store'
  * Created by RaoMeng on 2018/11/21
  * Created by RaoMeng on 2018/11/21
  * Desc: 项目接口
  * Desc: 项目接口
  */
  */
-// export const _baseURL = 'https://tmobile.ydyhz.com/school'
-// export const _baseURL = 'http://10.1.80.101:9560'
-export const _baseURL = 'https://school-api.ubtob.com/api/school'
-// export const _baseURL = 'https://school-api.ydyhz.com/api/school/grade/read/1'
+export const _host = 'https://school-api.ubtob.com'
+// export const _host = 'http://10.1.80.36:9520'
+export const _baseURL = _host + '/api/school'
 
 
 export const API = {
 export const API = {
     //获取openId
     //获取openId
@@ -136,6 +135,7 @@ export const API = {
     //删除校长信箱历史投递
     //删除校长信箱历史投递
     NOTIFY_DELETEMAIL: _baseURL + '/wxSchool/principalMailbox/deleteMailParent',
     NOTIFY_DELETEMAIL: _baseURL + '/wxSchool/principalMailbox/deleteMailParent',
     //出入校单次记录详情
     //出入校单次记录详情
+    INOUT_RECORD_DETAIL: _baseURL + '/wxSchool/outInRecord/inout/detail',
 
 
     //更改手机号是获取验证码
     //更改手机号是获取验证码
     SEND_CODEUPDATE: _baseURL + '/wxSchool/user/sendCodeUpdate',
     SEND_CODEUPDATE: _baseURL + '/wxSchool/user/sendCodeUpdate',
@@ -163,7 +163,7 @@ export const API = {
     //获取学生班级列表
     //获取学生班级列表
     GET_STU_CLASS_LIST: _baseURL + '/wxSchool/clazz/selectClazzByStu',
     GET_STU_CLASS_LIST: _baseURL + '/wxSchool/clazz/selectClazzByStu',
     //文件上传地址
     //文件上传地址
-    UPLOAD_FILE: 'https://school-api.ubtob.com/api/file/upload',
+    UPLOAD_FILE: _host + '/api/file/upload',
     //新建相册
     //新建相册
     NEW_CLASS_ALBUM: _baseURL + '/wxSchool/clazzAlbum/createAlbum',
     NEW_CLASS_ALBUM: _baseURL + '/wxSchool/clazzAlbum/createAlbum',
     //修改相册
     //修改相册

+ 2 - 4
frontend/wechat-web/src/configs/router.config.js

@@ -60,10 +60,9 @@ import NotifyBoardDetail from "../modules/notificationCenter/NotifyBoardDetail";
 import PhonesSearch from "../modules/phonesBook/PhonesSearch";
 import PhonesSearch from "../modules/phonesBook/PhonesSearch";
 import ChangePhoneNumber from '../modules/hiPages/changephonenumber/ChangePhoneNumber';
 import ChangePhoneNumber from '../modules/hiPages/changephonenumber/ChangePhoneNumber';
 import ScoreNotification from '../modules/hiPages/scorenotification/ScoreNotification';
 import ScoreNotification from '../modules/hiPages/scorenotification/ScoreNotification';
-import AccessNoticeDetail from '../modules/hiPages/accessnoticedetail/AccessNoticeDetail';
 import ChartDemo from "../modules/chart/ChartDemo";
 import ChartDemo from "../modules/chart/ChartDemo";
 import {connect} from "react-redux";
 import {connect} from "react-redux";
-import AccessNoticeDetail1 from "../modules/hiPages/accessnoticedetail/AccessNoticeDetail1";
+import AccessNoticeDetail from "../modules/hiPages/accessnoticedetail/AccessNoticeDetail";
 
 
 class RouteConfig extends Component {
 class RouteConfig extends Component {
 
 
@@ -138,8 +137,7 @@ class RouteConfig extends Component {
                         <Route path='/leavedetail/:role/:lvId' component={LeaveDetail}/> {/*学生请假详情*/}
                         <Route path='/leavedetail/:role/:lvId' component={LeaveDetail}/> {/*学生请假详情*/}
                         <Route path="/changephonenumber" component={ChangePhoneNumber}/> {/*更换手机号码*/}
                         <Route path="/changephonenumber" component={ChangePhoneNumber}/> {/*更换手机号码*/}
                         <Route path="/scorenotification/:stuId?" component={ScoreNotification}/> {/*成绩通知*/}
                         <Route path="/scorenotification/:stuId?" component={ScoreNotification}/> {/*成绩通知*/}
-                        <Route path="/accessnoticedetail/:stuId/:anId?" component={AccessNoticeDetail1}/> {/*出入校通知详情*/}
-                        {/*<Route path="/accessnoticedetail" component={AccessNoticeDetail}/> /!*出入校通知详情*!/*/}
+                        <Route path="/accessnoticedetail/:anId" component={AccessNoticeDetail}/> {/*出入校通知详情*/}
                         <Route path='/leaveAddC' component={LeaveAddCPage}/>{/*老师请假*/}
                         <Route path='/leaveAddC' component={LeaveAddCPage}/>{/*老师请假*/}
                         <Route path='/leaveAdd' component={LeaveAddPage}/> {/*学生请假*/}
                         <Route path='/leaveAdd' component={LeaveAddPage}/> {/*学生请假*/}
                         <Route path='/leaveList/:role' component={LeaveListPage}/>{/*学生请假列表*/}
                         <Route path='/leaveList/:role' component={LeaveListPage}/>{/*学生请假列表*/}

+ 1 - 0
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.css

@@ -82,6 +82,7 @@
     justify-content: center;
     justify-content: center;
     align-items: center;
     align-items: center;
     padding: 10px 15px;
     padding: 10px 15px;
+    width: 100vw;
 }
 }
 
 
 .access-notice-img {
 .access-notice-img {

+ 0 - 104
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.js

@@ -1,104 +0,0 @@
-/**
- *   Created by FANGlh on 2019/1/17 8:57.
- *   Desc: 进出校通知详情
- */
-
-import React, {Component} from 'react';
-import {connect} from 'react-redux';
-import './AccessNoticeDetail.css';
-import {isObjEmpty, getIntValue, getStrValue} from '../../../utils/common';
-import {fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
-import {API, _baseURL} from '../../../configs/api.config';
-
-
-class AccessNoticeDetail extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            studentName: '',
-            studentType: '出校时间',
-            studentPhoto: 'http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark',
-            studentHourMinues: '',
-            studentgrade:'三年八班'
-        }
-    }
-
-    componentWillMount() {
-    }
-
-    componentDidMount() {
-        let stuId = this.props.match.params.stuId
-        let anId = this.props.match.params.anId
-
-        if (!isObjEmpty(stuId)) {
-            this.getANDetail(stuId, anId)
-        }
-
-        let curDay = new Date().getDay()
-        if (curDay == 1) {
-            curDay = '星期一'
-        } else if (curDay == 2) {
-            curDay = '星期二'
-        } else if (curDay == 3) {
-            curDay = '星期三'
-        } else if (curDay == 4) {
-            curDay = '星期四'
-        } else if (curDay == 5) {
-            curDay = '星期五'
-        } else if (curDay == 6) {
-            curDay = '星期六'
-        } else if (curDay == 7) {
-            curDay = '星期日'
-        }
-
-        let date = new Date().toLocaleDateString() + curDay
-        let hout_min = new Date().getHours() + ':' + new Date().getMinutes()
-
-        this.setState({
-            studentName: this.props.userInfo.user.student.stuName,
-            studentType: '出校时间',
-            studentPhoto: 'http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark',
-            studentTime: hout_min,
-            studentDate: date,
-        })
-    }
-
-    render() {
-        const {studentName, studentType, studentPhoto, studentTime, studentDate,studentgrade} = this.state
-        return (
-            <div style={{textAlign: 'center',}}>
-                <div className="an_student_name">
-                    <span style={{fontSize:18}}>{studentName} <span style={{marginLeft:20,fontSize:12,color:"#666666"}}>{studentgrade}</span></span>
-                </div>
-                <img className="an_student_photo" src={studentPhoto} alt=""/>
-                <div className="an_student_type">{studentType}</div>
-                <div className='an_student_foot_time'>
-                    <span style={{color: '#222222', fontSize: 24, paddingRight: 10,}}>{studentTime}</span>
-                    <span style={{color: '#666666', fontsize: 12,}}>{studentDate}</span>
-                </div>
-            </div>
-        )
-    }
-
-    getANDetail = (stuId, anId) => {
-        fetchGet(API.leaveDetail, {
-            stuId: stuId,
-            anId: anId
-        }).then((response) => {
-            if (response.success && !isObjEmpty(response.data)) {
-
-            }
-        }).catch((error) => {
-            console.log("error:", JSON.stringify(error));
-        })
-    }
-}
-
-
-let mapStateToProps = (state) => ({
-    userInfo: {...state.redUserInfo}
-})
-
-let mapDispatchToProps = (dispatch) => ({})
-
-export default connect(mapStateToProps, mapDispatchToProps)(AccessNoticeDetail)

+ 111 - 0
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail.jsx

@@ -0,0 +1,111 @@
+/**
+ * Created by RaoMeng on 2019/3/13
+ * Desc:出入校通知详情
+ */
+
+import React, {Component} from 'react'
+import {connect} from 'react-redux';
+import {Toast} from 'antd-mobile'
+import {fetchGet} from "../../../utils/fetchRequest";
+import {_host, API} from "../../../configs/api.config";
+import moment from 'moment';
+import './AccessNoticeDetail.css'
+
+class AccessNoticeDetail extends Component {
+
+    constructor() {
+        super()
+
+        this.state = {
+            recordType: 0,
+            stuName: '',
+            date: '',
+            time: '',
+            week: '',
+            pic: '',
+        }
+    }
+
+    componentDidMount() {
+        document.title = '出入校通知'
+        this.anId = this.props.match.params.anId
+
+        this.getInoutDetail()
+    }
+
+    componentWillUnmount() {
+        Toast.hide()
+    }
+
+    render() {
+        const {recordType, stuName, date, time, week, pic} = this.state
+
+        return (
+            <div className='common-flex-column' style={{background: 'white'}}>
+                <div className='access-notice-top-layout'>
+                    {recordType == 0 ? '' :
+                        <div className={recordType == 1 ?
+                            'access-notice-icon-in' : 'access-notice-icon-out'}>
+                            {recordType == 1 ? '进' : '出'}
+                        </div>}
+                    <span className='access-notice-name'>{stuName}</span>
+                </div>
+
+                <div style={{padding: '6px 15px', background: '#f7f7f7'}}>
+                    <span className='access-notice-time'>{time}</span>
+                    <span className='access-notice-date'>{date}</span>
+                    <span className='access-notice-date'>{week}</span>
+                </div>
+
+                <div className='access-notice-img-layout'>
+                    <img className='access-notice-img'
+                         src={_host + '/api/file/download?path=' + pic}/>
+                </div>
+            </div>
+        )
+    }
+
+    getInoutDetail() {
+        Toast.show('', 0)
+
+        fetchGet(API.INOUT_RECORD_DETAIL + '/' + this.anId, {})
+            .then(response => {
+                Toast.hide()
+
+                if (response && response.data) {
+                    let data = response.data
+                    let recordDate = data.recordDate
+
+                    let date = moment(recordDate).format('YYYY-MM-DD');
+                    let time = moment(recordDate).format('HH:mm');
+
+                    this.setState({
+                        recordType: data.recordType,
+                        stuName: data.recordName,
+                        date: date,
+                        time: time,
+                        week: data.weekDays,
+                        pic: data.recordFile,
+                    })
+                }
+            })
+            .catch(error => {
+                Toast.hide()
+
+                if (typeof error === 'string') {
+                    Toast.fail(error, 2)
+                } else {
+                    Toast.fail('请求异常', 2)
+                }
+            })
+    }
+}
+
+
+let mapStateToProps = (state) => ({
+    userInfo: {...state.redUserInfo}
+})
+
+let mapDispatchToProps = (dispatch) => ({})
+
+export default connect(mapStateToProps, mapDispatchToProps)(AccessNoticeDetail)

+ 0 - 55
frontend/wechat-web/src/modules/hiPages/accessnoticedetail/AccessNoticeDetail1.jsx

@@ -1,55 +0,0 @@
-/**
- * Created by RaoMeng on 2019/3/13
- * Desc:出入校通知详情
- */
-
-import React, {Component} from 'react'
-import {connect} from 'react-redux';
-
-class AccessNoticeDetail1 extends Component {
-
-    constructor() {
-        super()
-
-        this.state = {}
-    }
-
-    componentDidMount() {
-        document.title = '出入校通知'
-    }
-
-    componentWillUnmount() {
-
-    }
-
-    render() {
-        return (
-            <div className='common-flex-column' style={{background: 'white'}}>
-                <div className='access-notice-top-layout'>
-                    <div className='access-notice-icon-in'>进</div>
-                    <span className='access-notice-name'>陈小龙</span>
-                </div>
-
-                <div style={{padding: '6px 15px', background: '#f7f7f7'}}>
-                    <span className='access-notice-time'>12:07:06</span>
-                    <span className='access-notice-date'>2019-1-30</span>
-                    <span className='access-notice-date'>星期天</span>
-                </div>
-
-                <div className='access-notice-img-layout'>
-                    <img className='access-notice-img'
-                         src='http://pic.vjshi.com/2018-08-28/8b163ad1a98e567f26cea40f34d56a27/00001.jpg?x-oss-process=style/watermark'/>
-                </div>
-            </div>
-        )
-    }
-}
-
-
-let mapStateToProps = (state) => ({
-    userInfo: {...state.redUserInfo}
-})
-
-let mapDispatchToProps = (dispatch) => ({})
-
-export default connect(mapStateToProps, mapDispatchToProps)(AccessNoticeDetail1)

+ 1 - 1
frontend/wechat-web/src/modules/home/HomePage.jsx

@@ -43,7 +43,7 @@ class HomePage extends Component {
         //清除班级缓存数据
         //清除班级缓存数据
         clearClassData()()
         clearClassData()()
 
 
-        document.title = "智慧校园";
+        document.title = "云平安校园";
         // document.domain = ''
         // document.domain = ''
 
 
         this.mySwiper = new Swiper('.home-swiper-container', {
         this.mySwiper = new Swiper('.home-swiper-container', {