From 4ab942df06d2f7d6f2df1102ef5b83d6a1696763 Mon Sep 17 00:00:00 2001
From: lyfO_o <764716047@qq.com>
Date: 星期一, 20 二月 2023 17:14:14 +0800
Subject: [PATCH] 人员文件上传

---
 src/main/webapp/WEB-INF/guotai/guotai.properties                       |    5 
 src/main/webapp/WEB-INF/web.xml                                        |    2 
 src/main/webapp/WEB-INF/gcs/gcs.properties                             |    1 
 src/main/webapp/WEB-INF/lzhws/lzhws.properties                         |    1 
 src/main/webapp/WEB-INF/shgjs/shgjs.properties                         |    1 
 src/main/webapp/WEB-INF/xjdx/xjdx.properties                           |    1 
 src/main/webapp/WEB-INF/zkysh/zkysh.properties                         |    1 
 src/main/webapp/user_mng.xhtml                                         |   48 +++++++++++
 src/main/webapp/WEB-INF/zkdsz/zkdsz.properties                         |    1 
 src/main/webapp/WEB-INF/lhs/lhs.properties                             |    1 
 src/main/webapp/WEB-INF/sds/sds.properties                             |    3 
 src/main/webapp/WEB-INF/hws/hws.properties                             |    1 
 src/main/webapp/WEB-INF/spring-mvc.xml                                 |    8 +
 src/main/webapp/WEB-INF/silkroad/silkroad.properties                   |    1 
 src/main/webapp/WEB-INF/szygs/szygs.properties                         |    1 
 src/main/java/com/nanometer/smartlab/controller/UserMngController.java |   58 ++++++++++++++
 src/main/webapp/WEB-INF/zkyshs/zkyshs.properties                       |    1 
 src/main/webapp/WEB-INF/gslab/gslab.properties                         |    1 
 src/main/java/com/nanometer/smartlab/entity/SysUser.java               |   21 +++++
 src/main/webapp/WEB-INF/qhyhs/qhyhs.properties                         |    1 
 src/main/webapp/WEB-INF/twt/twt.properties                             |    1 
 src/main/webapp/WEB-INF/aky/aky.properties                             |    1 
 src/main/java/com/nanometer/smartlab/dao/SysUserDao.xml                |   14 ++-
 src/main/webapp/WEB-INF/cq/cq.properties                               |    1 
 src/main/webapp/WEB-INF/sin/sin.properties                             |    1 
 src/main/webapp/WEB-INF/test/test.properties                           |    5 
 26 files changed, 169 insertions(+), 12 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/controller/UserMngController.java b/src/main/java/com/nanometer/smartlab/controller/UserMngController.java
index 03b33ba..6f95ba8 100644
--- a/src/main/java/com/nanometer/smartlab/controller/UserMngController.java
+++ b/src/main/java/com/nanometer/smartlab/controller/UserMngController.java
@@ -27,11 +27,15 @@
 import org.primefaces.model.LazyDataModel;
 import org.primefaces.model.SortOrder;
 import org.primefaces.model.UploadedFile;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;
 
 import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.InputStream;
+import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.nio.charset.CharacterCodingException;
 import java.security.NoSuchAlgorithmException;
@@ -54,6 +58,9 @@
     private BaseRoleService baseRoleService;
     @Resource
     private SysProjectService sysProjectService;
+
+    @Value("${personImgPath}")
+    private String personImgPath;
 
     private LazyDataModel<SysUser> dataModel;
     private SysUser sysUser;
@@ -566,6 +573,57 @@
         }
     }
 
+    // 文件上传
+    public void handleImageUpload(FileUploadEvent event) {
+        UploadedFile file = event.getFile();
+        try {
+            // 1.上传文件
+            InputStream is = file.getInputstream();
+            String oldName = file.getFileName();
+            String newName = new Date().getTime() + oldName.substring(oldName.lastIndexOf("."));
+            String realPath = personImgPath  + "/";
+            File dest = new File(realPath, newName);
+            if (!dest.getParentFile().exists()) {
+                boolean rel = dest.getParentFile().mkdirs();
+                if (!rel) {
+                    throw new Exception("文件夹创建失败");
+                }
+            }
+
+            OutputStream os = new FileOutputStream(dest);
+            try {
+                byte[] buffer = new byte[8 * 1024];
+                int bytesRead;
+                while ((bytesRead = is.read(buffer)) != -1) {
+                    os.write(buffer, 0, bytesRead);
+                }
+                // 更新用户url
+                sysUser.setUrl("upload/upload/" + newName);
+                // 清空图片文件以便再次上传
+                RequestContext.getCurrentInstance().update("dialogForm2");
+                // 更新用户表单
+                RequestContext.getCurrentInstance().update("dialogForm");
+                // 隐藏上传框
+                RequestContext.getCurrentInstance().execute("PF('imgDialog').hide()");
+
+            } catch (Exception e) {
+                FacesUtils.warn("文件上传失败。");
+                throw e;
+            } finally {
+                if (is != null) {
+                    is.close();
+                }
+                if (os != null) {
+                    os.close();
+                }
+            }
+
+        } catch (Exception e) {
+            FacesUtils.warn("操作失败。");
+            return;
+        }
+    }
+
 
     public void initPage() {
         sysUser = sysUserService.getSysUser(getUser().getId());
diff --git a/src/main/java/com/nanometer/smartlab/dao/SysUserDao.xml b/src/main/java/com/nanometer/smartlab/dao/SysUserDao.xml
index f77d627..1c0d0ef 100644
--- a/src/main/java/com/nanometer/smartlab/dao/SysUserDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/SysUserDao.xml
@@ -23,6 +23,8 @@
     <result property="roleName" column="roleName"></result>
     <result property="containerCodeList" column="containerCodeList"></result>
     <result property="project" column="project"></result>
+    <result property="url" column="url"></result>
+    <result property="score" column="score"></result>
     <result property="waster" column="waster" typeHandler="com.nanometer.smartlab.entity.handler.WasterHandler"></result>
   </resultMap>
 
@@ -163,7 +165,9 @@
   </select>
 
   <select id="getSysUserInfoList" parameterType="java.util.Map" resultMap="SysUser">
-    select u.name,u.see_flag,u.role_id,u.valid_flag,u.id_card,u.point,group_concat(container_code SEPARATOR ',') containerCodeList ,u.arp, bm1.meta_value department,bm2.meta_value company,u.project_id projectId from sys_user u
+    select u.name,u.see_flag,u.role_id,u.valid_flag,u.id_card,u.point,group_concat(container_code SEPARATOR ',') containerCodeList ,u.arp, bm1.meta_value department,bm2.meta_value company,u.project_id projectId,
+    u.url,u.score
+    from sys_user u
     left join sys_laboratory l on l.department = u.department and l.valid_flag = 1
     left join sys_laboratory_container c on c.laboratory_id = l.id and c.valid_flag = 1
     left join base_meta bm1 on bm1.id = u.department
@@ -184,13 +188,15 @@
   </select>
 
   <insert id="insertSysUser" parameterType="com.nanometer.smartlab.entity.SysUser">
-    insert into sys_user(id, arp, account, password, company, department, name, phone, email, memo, id_card, approver_flag, see_flag, role_id, valid_flag, create_time, update_time,project,waster)
-    values (#{id}, #{arp}, #{account}, #{password}, #{company}, #{department}, #{name}, #{phone}, #{email}, #{memo}, #{idCard}, #{approverFlag}, #{seeFlag}, #{roleId}, 1, now(), now(),#{project},#{waster})
+    insert into sys_user(id, arp, account, password, company, department, name, phone, email, memo, id_card, approver_flag, see_flag, role_id, valid_flag, create_time, update_time,project,waster,url,score)
+    values (#{id}, #{arp}, #{account}, #{password}, #{company}, #{department}, #{name}, #{phone}, #{email}, #{memo}, #{idCard}, #{approverFlag}, #{seeFlag}, #{roleId}, 1, now(), now(),#{project},#{waster},#{url},#{score})
   </insert>
 
   <update id="updateSysUser" parameterType="com.nanometer.smartlab.entity.SysUser">
     update sys_user set arp=#{arp}, account=#{account}, password=#{password}, company=#{company}, department=#{department}, name=#{name}, phone=#{phone},
-    email=#{email}, memo=#{memo}, id_card=#{idCard}, approver_flag=#{approverFlag}, see_flag=#{seeFlag}, role_id=#{roleId}, point=#{point},update_time=now(),project=#{project},waster=#{waster}
+    email=#{email}, memo=#{memo}, id_card=#{idCard}, approver_flag=#{approverFlag}, see_flag=#{seeFlag}, role_id=#{roleId}, point=#{point},update_time=now(),project=#{project},waster=#{waster},
+    url= #{url},
+    score = #{score}
     where id=#{id}
   </update>
 
diff --git a/src/main/java/com/nanometer/smartlab/entity/SysUser.java b/src/main/java/com/nanometer/smartlab/entity/SysUser.java
index 30c124f..f934346 100644
--- a/src/main/java/com/nanometer/smartlab/entity/SysUser.java
+++ b/src/main/java/com/nanometer/smartlab/entity/SysUser.java
@@ -1,6 +1,7 @@
 package com.nanometer.smartlab.entity;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.sql.Timestamp;
 
 import com.nanometer.smartlab.entity.enumtype.ApproverFlag;
@@ -35,6 +36,10 @@
     private String roleName;
     private String project;
     private Waster waster;
+    // 图片的相对地址
+    private String url;
+    // 考试分数
+    private BigDecimal score;
 
     public String getId() {
         return id;
@@ -211,4 +216,20 @@
     public void setWaster(Waster waster) {
         this.waster = waster;
     }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public BigDecimal getScore() {
+        return score;
+    }
+
+    public void setScore(BigDecimal score) {
+        this.score = score;
+    }
 }
diff --git a/src/main/webapp/WEB-INF/aky/aky.properties b/src/main/webapp/WEB-INF/aky/aky.properties
index 5c8f99c..ad373a3 100644
--- a/src/main/webapp/WEB-INF/aky/aky.properties
+++ b/src/main/webapp/WEB-INF/aky/aky.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u65B0\u7586\u7EF4\u543E\u5C14\u81EA\u6CBB\u533A\u5B89\u5168\u79D1\u5B66\u6280\u672F\u7814\u7A76\u9662\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/cq/cq.properties b/src/main/webapp/WEB-INF/cq/cq.properties
index ffb1fa6..cb1cb1e 100644
--- a/src/main/webapp/WEB-INF/cq/cq.properties
+++ b/src/main/webapp/WEB-INF/cq/cq.properties
@@ -13,3 +13,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u7EB3\u7C73\u6280\u672F\u4E0E\u7EB3\u7C73\u4EFF\u751F\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/gcs/gcs.properties b/src/main/webapp/WEB-INF/gcs/gcs.properties
index 481c6d9..30f184c 100644
--- a/src/main/webapp/WEB-INF/gcs/gcs.properties
+++ b/src/main/webapp/WEB-INF/gcs/gcs.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u5317\u4EAC\u8FC7\u7A0B\u5DE5\u7A0B\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/gslab/gslab.properties b/src/main/webapp/WEB-INF/gslab/gslab.properties
index bc83984..a2d297c 100644
--- a/src/main/webapp/WEB-INF/gslab/gslab.properties
+++ b/src/main/webapp/WEB-INF/gslab/gslab.properties
@@ -13,3 +13,4 @@
 institute.copyright= Copyright\u00A92021 \u6750\u6599\u79D1\u5B66\u59D1\u82CF\u5B9E\u9A8C\u5BA4\u00A0\u82CFICP\u590720047331\u53F7-1
 
 message.url= http://aq.gusulab.ac.cn:18084/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/guotai/guotai.properties b/src/main/webapp/WEB-INF/guotai/guotai.properties
index 9dc3805..3f1f110 100644
--- a/src/main/webapp/WEB-INF/guotai/guotai.properties
+++ b/src/main/webapp/WEB-INF/guotai/guotai.properties
@@ -3,12 +3,13 @@
 jdbc.password=NMS@uss20201!
 
 institute.id = 10
-institute.name = \u65b0\u7586\u56fd\u6cf0\u65b0\u534e\u77ff\u4e1a\u80a1\u4efd\u6709\u9650\u516c\u53f8
+institute.name = \u65B0\u7586\u56FD\u6CF0\u65B0\u534E\u77FF\u4E1A\u80A1\u4EFD\u6709\u9650\u516C\u53F8
 institute.url  = http://222.92.213.22:18001
 institute.app.id = wxef5464cb3cd407ea
 institute.app.secret = f0b8dec4bc340a9863ed7de08cf2dcf1
 alarm.url =
 reagent.detail.price.api =
-institute.copyright= Copyright\u00A92017 \u65b0\u7586\u56fd\u6cf0\u65b0\u534e\u77ff\u4e1a\u80a1\u4efd\u6709\u9650\u516c\u53f8\u00A0\u82CFICP\u590710220403\u53F7-6
+institute.copyright= Copyright\u00A92017 \u65B0\u7586\u56FD\u6CF0\u65B0\u534E\u77FF\u4E1A\u80A1\u4EFD\u6709\u9650\u516C\u53F8\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/hws/hws.properties b/src/main/webapp/WEB-INF/hws/hws.properties
index 99ceb19..e47dcdc 100644
--- a/src/main/webapp/WEB-INF/hws/hws.properties
+++ b/src/main/webapp/WEB-INF/hws/hws.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u5927\u8FDE\u5316\u5B66\u7269\u7406\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/lhs/lhs.properties b/src/main/webapp/WEB-INF/lhs/lhs.properties
index 2dc45db..6f9de38 100644
--- a/src/main/webapp/WEB-INF/lhs/lhs.properties
+++ b/src/main/webapp/WEB-INF/lhs/lhs.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u65B0\u7586\u7406\u5316\u6280\u672F\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/lzhws/lzhws.properties b/src/main/webapp/WEB-INF/lzhws/lzhws.properties
index 42ad704..d9c97b5 100644
--- a/src/main/webapp/WEB-INF/lzhws/lzhws.properties
+++ b/src/main/webapp/WEB-INF/lzhws/lzhws.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u5170\u5DDE\u5316\u5B66\u7269\u7406\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/qhyhs/qhyhs.properties b/src/main/webapp/WEB-INF/qhyhs/qhyhs.properties
index b8accbd..24cbff8 100644
--- a/src/main/webapp/WEB-INF/qhyhs/qhyhs.properties
+++ b/src/main/webapp/WEB-INF/qhyhs/qhyhs.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u9752\u6D77\u76D0\u6E56\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/sds/sds.properties b/src/main/webapp/WEB-INF/sds/sds.properties
index bf3d7d3..ac9061b 100644
--- a/src/main/webapp/WEB-INF/sds/sds.properties
+++ b/src/main/webapp/WEB-INF/sds/sds.properties
@@ -1,4 +1,4 @@
-jdbc.url=jdbc:mysql://localhost:3306/smartlabdb?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
+jdbc.url=jdbc:mysql://sds.sinanoaq.com:13306/smartlabdb?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
 jdbc.username=root
 jdbc.password=Sinanoaq#415
 #\uFFFD\u0439\uFFFD\uFFFD\uFFFD\u0467\u053A\uFFFD\u00BD\uFFFD\uFFFD\uFFFD\u032C\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u043E\uFFFD\uFFFD\uFFFD
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u65B0\u7586\u751F\u6001\u4E0E\u5730\u7406\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/shgjs/shgjs.properties b/src/main/webapp/WEB-INF/shgjs/shgjs.properties
index d26aa5c..6b10f11 100644
--- a/src/main/webapp/WEB-INF/shgjs/shgjs.properties
+++ b/src/main/webapp/WEB-INF/shgjs/shgjs.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u4E0A\u6D77\u5149\u5B66\u7CBE\u5BC6\u673A\u68B0\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/silkroad/silkroad.properties b/src/main/webapp/WEB-INF/silkroad/silkroad.properties
index ad77330..7a618bc 100644
--- a/src/main/webapp/WEB-INF/silkroad/silkroad.properties
+++ b/src/main/webapp/WEB-INF/silkroad/silkroad.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E1D\u7EF8\u4E4B\u8DEF\u521B\u65B0\u53D1\u5C55\u7814\u7A76\u9662\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/sin/sin.properties b/src/main/webapp/WEB-INF/sin/sin.properties
index aa826c1..19c027b 100644
--- a/src/main/webapp/WEB-INF/sin/sin.properties
+++ b/src/main/webapp/WEB-INF/sin/sin.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u7EB3\u7C73\u6280\u672F\u4E0E\u7EB3\u7C73\u4EFF\u751F\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/spring-mvc.xml b/src/main/webapp/WEB-INF/spring-mvc.xml
index f4d9967..00bb5d0 100644
--- a/src/main/webapp/WEB-INF/spring-mvc.xml
+++ b/src/main/webapp/WEB-INF/spring-mvc.xml
@@ -19,8 +19,7 @@
 	<context:component-scan base-package="com.nanometer.smartlab.api"/>
 	<context:component-scan base-package="com.nanometer.smartlab.controller"/>
 
-	<!-- 静态资源(js、image等)的访问 -->
-	<mvc:default-servlet-handler/>
+
 	<context:property-placeholder ignore-unresolvable="true"        location="WEB-INF/config.properties" file-encoding="UTF-8"/>
 	<!-- 开启注解 -->
 	<!-- 默认的注解映射的支持,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping -->
@@ -54,4 +53,9 @@
 	<mvc:cors>
 		<mvc:mapping path="/**" allowed-origins="*" allow-credentials="true" max-age="1800" allowed-methods="GET,POST"/>
 	</mvc:cors>
+
+
+	<mvc:resources mapping="/upload/**"  location="file:///d:/opt/file/smartlab/img/" />
+	<!-- 静态资源(js、image等)的访问 -->
+	<mvc:default-servlet-handler/>
 </beans>
diff --git a/src/main/webapp/WEB-INF/szygs/szygs.properties b/src/main/webapp/WEB-INF/szygs/szygs.properties
index 20e92f7..ae73751 100644
--- a/src/main/webapp/WEB-INF/szygs/szygs.properties
+++ b/src/main/webapp/WEB-INF/szygs/szygs.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u751F\u7269\u533B\u5B66\u5DE5\u7A0B\u6280\u672F\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/test/test.properties b/src/main/webapp/WEB-INF/test/test.properties
index d676ea0..c60c50b 100644
--- a/src/main/webapp/WEB-INF/test/test.properties
+++ b/src/main/webapp/WEB-INF/test/test.properties
@@ -1,6 +1,6 @@
-jdbc.url=jdbc:mysql://139.196.181.203:3306/smartlabdb_test?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true&amp;useSSL=false
+jdbc.url=jdbc:mysql://localhost:3306/smartlabdb?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true&amp;useSSL=false
 jdbc.username=root
-jdbc.password=GKHY@root20201!
+jdbc.password=123456
 
 institute.id = 2
 institute.name = \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u7EB3\u7C73\u6280\u672F\u4E0E\u7EB3\u7C73\u4EFF\u751F\u7814\u7A76\u6240
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u7EB3\u7C73\u6280\u672F\u4E0E\u7EB3\u7C73\u4EFF\u751F\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = file:///d:/opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/twt/twt.properties b/src/main/webapp/WEB-INF/twt/twt.properties
index f262b05..27b1ac1 100644
--- a/src/main/webapp/WEB-INF/twt/twt.properties
+++ b/src/main/webapp/WEB-INF/twt/twt.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u65B0\u7586\u5929\u6587\u53F0\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
index 8369db9..bef408e 100644
--- a/src/main/webapp/WEB-INF/web.xml
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -73,6 +73,8 @@
     <servlet-mapping>
         <servlet-name>MVC Servlet</servlet-name>
         <url-pattern>/api/*</url-pattern>
+        <url-pattern>/upload/*</url-pattern>
+
     </servlet-mapping>
 
     <context-param>
diff --git a/src/main/webapp/WEB-INF/xjdx/xjdx.properties b/src/main/webapp/WEB-INF/xjdx/xjdx.properties
index 930df4d..86f2a34 100644
--- a/src/main/webapp/WEB-INF/xjdx/xjdx.properties
+++ b/src/main/webapp/WEB-INF/xjdx/xjdx.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u65B0\u7586\u5927\u5B66\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/zkdsz/zkdsz.properties b/src/main/webapp/WEB-INF/zkdsz/zkdsz.properties
index ccc6edb..713346a 100644
--- a/src/main/webapp/WEB-INF/zkdsz/zkdsz.properties
+++ b/src/main/webapp/WEB-INF/zkdsz/zkdsz.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u6280\u672F\u5927\u5B66\u82CF\u5DDE\u9AD8\u7B49\u7814\u7A76\u9662\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/zkysh/zkysh.properties b/src/main/webapp/WEB-INF/zkysh/zkysh.properties
index 7d4b604..adad57c 100644
--- a/src/main/webapp/WEB-INF/zkysh/zkysh.properties
+++ b/src/main/webapp/WEB-INF/zkysh/zkysh.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u751F\u6001\u73AF\u5883\u7814\u7A76\u4E2D\u5FC3\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/WEB-INF/zkyshs/zkyshs.properties b/src/main/webapp/WEB-INF/zkyshs/zkyshs.properties
index c361250..5433aa9 100644
--- a/src/main/webapp/WEB-INF/zkyshs/zkyshs.properties
+++ b/src/main/webapp/WEB-INF/zkyshs/zkyshs.properties
@@ -12,3 +12,4 @@
 institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u6C34\u751F\u751F\u7269\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6
 
 message.url= https://sinanoaq.com:8095/api/sendmessage
+personImgPath = /opt/file/smartlab/img/
diff --git a/src/main/webapp/user_mng.xhtml b/src/main/webapp/user_mng.xhtml
index 4764996..3071e72 100644
--- a/src/main/webapp/user_mng.xhtml
+++ b/src/main/webapp/user_mng.xhtml
@@ -83,6 +83,9 @@
                     white-space: normal;
                     word-break: break-all;
                 }
+                #dialogForm\:img-pic > tbody > tr > td:nth-child(2):has(img) {
+                    width: 200px !important;
+                }
             </style>
             <p:dataTable id="userMngDataTable" styleClass="data-table"
                          paginator="true" paginatorAlwaysVisible="false" paginatorPosition="bottom"
@@ -162,7 +165,8 @@
 
     <p:dialog modal="true" header="#{userMngController.action==constants.ACTION_ADD?'新建':'修改'}" appendTo="@(body)"
               id="dialog" widgetVar="dialog"
-              resizable="false" width="800">
+              resizable="false" width="900">
+
         <h:form id="dialogForm">
             <p:panelGrid columns="4" styleClass="content2 grid-padding-bottom2">
                 <p:outputLabel value="单位"></p:outputLabel>
@@ -250,6 +254,26 @@
                     <f:selectItems value="#{userMngController.wasterSelectList}"
                                    var="item" itemLabel="#{item.text}" itemValue="#{item}"></f:selectItems>
                 </p:selectOneMenu>
+
+                <p:outputLabel value="考试分数"/>
+                <p:inputNumber value="#{userMngController.sysUser.score}"  decimalPlaces="0" minValue="0"
+                               > </p:inputNumber>
+
+                <p:outputLabel />
+                <p:outputLabel />
+
+            </p:panelGrid>
+            <p:panelGrid columns="4" styleClass="content2 grid-padding-bottom2" id="img-pic">
+            <p:outputLabel value="图片"/>
+
+            <p:graphicImage  rendered="#{userMngController.sysUser.url ne null and userMngController.sysUser.url ne ''}"
+                         url="#{userMngController.sysUser.url}"
+                         width="120"
+                         height="120"/>
+
+            <p:commandButton value="点击上传"
+                             oncomplete="PF('imgDialog').show();"/>
+
             </p:panelGrid>
             <p:panel styleClass="btn">
                 <p:commandButton value="保存" actionListener="#{userMngController.onSaveBtnClick}"
@@ -259,5 +283,27 @@
             </p:panel>
         </h:form>
     </p:dialog>
+    <p:dialog modal="true" header="图片上传" appendTo="@(body)"
+              id="imgDialog" widgetVar="imgDialog"
+              resizable="false" width="700">
+        <p:panelGrid columns="1" styleClass="content2 grid-padding-bottom2">
+            <h:form id="dialogForm2">
+                <p:fileUpload fileUploadListener="#{userMngController.handleImageUpload}"
+                              mode="advanced"
+                              dragDropSupport="false"
+                              uploadLabel="上传"
+                              cancelLabel="取消"
+                              label="浏览"
+                              invalidFileMessage="请上传gif、jpe、jpg、png文件"
+                              multiple="false"
+                              sizeLimit="10000000"
+                              fileLimit="1"
+                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
+                > </p:fileUpload>
+            </h:form>
+
+        </p:panelGrid>
+
+    </p:dialog>
 </ui:composition>
 </html>

--
Gitblit v1.9.2