fanxw %!s(int64=2) %!d(string=hai) anos
pai
achega
8afebeaf1e

+ 2 - 0
src/main/java/com/chinaitop/depot/system/controller/UserInfoController.java

@@ -3,6 +3,7 @@ package com.chinaitop.depot.system.controller;
3 3
 import java.awt.image.BufferedImage;
4 4
 import java.io.ByteArrayOutputStream;
5 5
 import java.io.IOException;
6
+import java.util.Date;
6 7
 import java.util.HashMap;
7 8
 import java.util.List;
8 9
 import java.util.Map;
@@ -629,6 +630,7 @@ public class UserInfoController {
629 630
 				String md5_pwd = userInfoService.getMD5(newPassword);
630 631
 				String sha1_pwd = SHA1Util.encode(md5_pwd);
631 632
 				userInfo.setPassword(sha1_pwd);
633
+				userInfo.setUpdateTime(new Date());
632 634
 				//userInfo.setPassword(userInfoService.getMD5(newPassword));
633 635
 				userInfoService.update(userInfo);
634 636
 				

+ 22 - 6
src/main/java/com/chinaitop/depot/system/mapper/UserInfoMapper.xml

@@ -35,6 +35,7 @@
35 35
     <result column="rzrq" jdbcType="TIMESTAMP" property="rzrq" />
36 36
     <result column="gwxz" property="gwxz" jdbcType="VARCHAR" />
37 37
     <result column="qdzgzchzyzgsj" property="qdzgzchzyzgsj" jdbcType="TIMESTAMP" />
38
+    <result column="zy" property="zy" jdbcType="VARCHAR" />
38 39
   </resultMap>
39 40
   <sql id="Example_Where_Clause">
40 41
     <where>
@@ -97,7 +98,7 @@
97 98
   <sql id="Base_Column_List">
98 99
     user_id, username, password, org_id, real_name, user_alias, sex, telphone, mobile, address, email, 
99 100
     qq_number, img_url, signature, create_time, create_user_id, update_time, update_user_id, 
100
-    status, del_flag, bmmc, zgzt, lzrq, mz, rylb, sfzhm, zzmm, zc, xl, zw, rzrq, gwxz, qdzgzchzyzgsj
101
+    status, del_flag, bmmc, zgzt, lzrq, mz, rylb, sfzhm, zzmm, zc, xl, zw, rzrq, gwxz, qdzgzchzyzgsj, zy
101 102
   </sql>
102 103
   <select id="selectByExample" parameterType="com.chinaitop.depot.system.model.UserInfoExample" resultMap="BaseResultMap">
103 104
     select
@@ -153,7 +154,8 @@
153 154
       email, qq_number, img_url, 
154 155
       signature, create_time, create_user_id, 
155 156
       update_time, update_user_id, status, 
156
-      del_flag, bmmc, zgzt, lzrq, mz, rylb, sfzhm, zzmm, zc, xl, zw, rzrq, gwxz, qdzgzchzyzgsj)
157
+      del_flag, bmmc, zgzt, lzrq, mz, rylb, sfzhm, zzmm, zc, 
158
+      xl, zw, rzrq, gwxz, qdzgzchzyzgsj, zy)
157 159
     values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
158 160
       #{orgId,jdbcType=INTEGER}, #{realName,jdbcType=VARCHAR}, #{userAlias,jdbcType=VARCHAR}, #{sex,jdbcType=INTEGER}, 
159 161
       #{telphone,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, 
@@ -163,7 +165,7 @@
163 165
       #{delFlag,jdbcType=INTEGER}, #{bmmc,jdbcType=VARCHAR}, #{zgzt,jdbcType=VARCHAR}, #{lzrq,jdbcType=TIMESTAMP},
164 166
       #{mz,jdbcType=INTEGER}, #{rylb,jdbcType=INTEGER}, #{sfzhm,jdbcType=VARCHAR}, #{zzmm,jdbcType=INTEGER},
165 167
       #{zc,jdbcType=VARCHAR}, #{xl,jdbcType=INTEGER}, #{zw,jdbcType=VARCHAR}, #{rzrq,jdbcType=TIMESTAMP},
166
-      #{gwxz,jdbcType=VARCHAR}, #{qdzgzchzyzgsj,jdbcType=TIMESTAMP})
168
+      #{gwxz,jdbcType=VARCHAR}, #{qdzgzchzyzgsj,jdbcType=TIMESTAMP}, #{zy,jdbcType=VARCHAR})
167 169
   </insert>
168 170
   <insert id="insertSelective" parameterType="com.chinaitop.depot.system.model.UserInfo" useGeneratedKeys="true" keyProperty="userId">
169 171
     insert into user_info
@@ -267,6 +269,9 @@
267 269
       <if test="qdzgzchzyzgsj != null">
268 270
         qdzgzchzyzgsj,
269 271
       </if>
272
+      <if test="zy != null">
273
+        zy,
274
+      </if>
270 275
     </trim>
271 276
     <trim prefix="values (" suffix=")" suffixOverrides=",">
272 277
       <if test="userId != null">
@@ -368,6 +373,9 @@
368 373
       <if test="qdzgzchzyzgsj != null">
369 374
         #{qdzgzchzyzgsj,jdbcType=TIMESTAMP},
370 375
       </if>
376
+      <if test="zy != null">
377
+        #{zy,jdbcType=VARCHAR},
378
+      </if>
371 379
     </trim>
372 380
   </insert>
373 381
   <select id="countByExample" parameterType="com.chinaitop.depot.system.model.UserInfoExample" resultType="java.lang.Integer">
@@ -478,6 +486,9 @@
478 486
       <if test="record.qdzgzchzyzgsj != null">
479 487
         qdzgzchzyzgsj = #{record.qdzgzchzyzgsj,jdbcType=TIMESTAMP},
480 488
       </if>
489
+      <if test="record.zy != null">
490
+        zy = #{record.zy,jdbcType=VARCHAR},
491
+      </if>
481 492
     </set>
482 493
     <if test="_parameter != null">
483 494
       <include refid="Update_By_Example_Where_Clause" />
@@ -517,7 +528,8 @@
517 528
       zw = #{record.zw,jdbcType=VARCHAR},
518 529
       rzrq = #{record.rzrq,jdbcType=TIMESTAMP},
519 530
       gwxz = #{record.gwxz,jdbcType=VARCHAR},
520
-      qdzgzchzyzgsj = #{record.qdzgzchzyzgsj,jdbcType=TIMESTAMP}
531
+      qdzgzchzyzgsj = #{record.qdzgzchzyzgsj,jdbcType=TIMESTAMP},
532
+      zy = #{record.zy,jdbcType=VARCHAR}
521 533
     <if test="_parameter != null">
522 534
       <include refid="Update_By_Example_Where_Clause" />
523 535
     </if>
@@ -621,6 +633,9 @@
621 633
       <if test="qdzgzchzyzgsj != null">
622 634
         qdzgzchzyzgsj = #{qdzgzchzyzgsj,jdbcType=TIMESTAMP},
623 635
       </if>
636
+      <if test="zy != null">
637
+        zy = #{zy,jdbcType=VARCHAR},
638
+      </if>
624 639
     </set>
625 640
     where user_id = #{userId,jdbcType=INTEGER}
626 641
   </update>
@@ -657,7 +672,8 @@
657 672
       zw = #{zw,jdbcType=VARCHAR},
658 673
       rzrq = #{rzrq,jdbcType=TIMESTAMP},
659 674
       gwxz = #{gwxz,jdbcType=VARCHAR},
660
-      qdzgzchzyzgsj = #{qdzgzchzyzgsj,jdbcType=TIMESTAMP}
675
+      qdzgzchzyzgsj = #{qdzgzchzyzgsj,jdbcType=TIMESTAMP},
676
+      zy = #{zy,jdbcType=VARCHAR}
661 677
     where user_id = #{userId,jdbcType=INTEGER}
662 678
   </update>
663 679
    <resultMap id="UserRoleOrgMap" type="com.chinaitop.depot.system.model.UserInfo">
@@ -692,7 +708,7 @@
692 708
                      #{item}
693 709
                    </foreach>
694 710
                  </if>
695
-                 and length(ui.real_name) &lt; 12
711
+                 and length(ui.real_name) &lt; 13
696 712
 		 </where>
697 713
     ) A LEFT JOIN (
698 714
 		 SELECT

+ 24 - 4
src/main/java/com/chinaitop/depot/system/model/UserInfo.java

@@ -5,10 +5,10 @@ import java.util.ArrayList;
5 5
 import java.util.Date;
6 6
 import java.util.List;
7 7
 
8
+import com.fasterxml.jackson.annotation.JsonFormat;
9
+
8 10
 public class UserInfo implements Serializable{
9
-    /**
10
-	 * 
11
-	 */
11
+
12 12
 	private static final long serialVersionUID = 1L;
13 13
 
14 14
 	private Integer userId;
@@ -39,10 +39,12 @@ public class UserInfo implements Serializable{
39 39
 
40 40
     private String signature;
41 41
 
42
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
42 43
     private Date createTime;
43 44
 
44 45
     private Integer createUserId;
45 46
 
47
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
46 48
     private Date updateTime;
47 49
 
48 50
     private Integer updateUserId;
@@ -76,7 +78,9 @@ public class UserInfo implements Serializable{
76 78
     private String gwxz;
77 79
 
78 80
     private Date qdzgzchzyzgsj;
79
-    
81
+
82
+    private String zy;
83
+
80 84
     private List<String> roleIds = new ArrayList<String>();
81 85
     
82 86
     //业务字段
@@ -541,4 +545,20 @@ public class UserInfo implements Serializable{
541 545
     public void setQdzgzchzyzgsj(Date qdzgzchzyzgsj) {
542 546
         this.qdzgzchzyzgsj = qdzgzchzyzgsj;
543 547
     }
548
+
549
+    /**
550
+     * 专业
551
+     * @return
552
+     */
553
+	public String getZy() {
554
+		return zy;
555
+	}
556
+
557
+	/**
558
+	 * 专业
559
+	 * @param zy
560
+	 */
561
+	public void setZy(String zy) {
562
+		this.zy = zy;
563
+	}
544 564
 }

+ 5 - 0
src/main/java/com/chinaitop/depot/system/service/impl/UserInfoServiceImpl.java

@@ -3,6 +3,7 @@ package com.chinaitop.depot.system.service.impl;
3 3
 import java.math.BigInteger;
4 4
 import java.security.MessageDigest;
5 5
 import java.util.ArrayList;
6
+import java.util.Date;
6 7
 import java.util.HashMap;
7 8
 import java.util.List;
8 9
 import java.util.Map;
@@ -94,6 +95,8 @@ public class UserInfoServiceImpl implements UserInfoService {
94 95
 		//把密码再用SHA1加密一次
95 96
 		String sha1_pwd = SHA1Util.encode(userInfo.getPassword());
96 97
 		userInfo.setPassword(sha1_pwd);
98
+		userInfo.setCreateTime(new Date());
99
+		userInfo.setUpdateTime(userInfo.getCreateTime());
97 100
 		UserInfoMapper.insert(userInfo);
98 101
 		// 添加用户角色信息
99 102
 		for (String roleId : userInfo.getRoleIds()) {
@@ -182,6 +185,7 @@ public class UserInfoServiceImpl implements UserInfoService {
182 185
 		//再用SHA1加密一次
183 186
 		String sha1_pwd = SHA1Util.encode(userPwd);
184 187
 	    userInfo.setPassword(sha1_pwd);
188
+	    userInfo.setUpdateTime(new Date());
185 189
 	    UserInfoMapper.updateByPrimaryKey(userInfo);
186 190
     }
187 191
 
@@ -277,6 +281,7 @@ public class UserInfoServiceImpl implements UserInfoService {
277 281
 			UserInfo newuser = UserInfoMapper.selectByPrimaryKey(userid);
278 282
 			//谷歌浏览器在修改当前登录用户的时候传到后台的密码是明文,所以这个地方用原来的密码重新赋值一下,避免修改用户信息后密码成了明文
279 283
 			userInfo.setPassword(newuser.getPassword());
284
+			userInfo.setUpdateTime(new Date());
280 285
 			this.update(userInfo);
281 286
 			userRoleMapper.deleteById(userInfo.getUserId());
282 287
 		}

+ 7 - 5
src/main/resources/application.properties

@@ -2,24 +2,26 @@
2 2
 server.port=9023
3 3
 
4 4
 #gbase8s的数据库配置
5
+spring.application.name=depot-system
5 6
 spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
6 7
 spring.datasource.url=jdbc:gbasedbt-sqli://101.36.160.140:19089/depot:INFORMIXSERVER=ol_gbasedbt1210;NEWCODESET=GB18030,GB18030-2000,5488;DB_LOCALE=zh_cn.GB18030-2000;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
7 8
 spring.datasource.username=gbasedbt
8 9
 spring.datasource.password=cDbK2S0go8
10
+#spring.datasource.url=jdbc:gbasedbt-sqli://111.164.113.172:666/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
11
+#spring.datasource.username=gbasedbt
12
+#spring.datasource.password=GBase123
9 13
 spring.datasource.driverClassName=com.gbasedbt.jdbc.IfxDriver
10 14
 mybatis.config-location=classpath:mybatis/mybatis-config.xml
11 15
 
12
-
13
-eureka.client.serviceUrl.defaultZone=http://172.16.0.16:9001/eureka/
14
-
16
+eureka.instance.ip-address=172.16.0.16
15 17
 # 每隔10s发送一次心跳(默认30s)
16 18
 eureka.instance.lease-renewal-interval-in-seconds=10
17 19
 # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
18 20
 eureka.instance.lease-expiration-duration-in-seconds=30
21
+eureka.client.serviceUrl.defaultZone=http://${eureka.instance.ip-address}:${server.port}/eureka/
22
+eureka.instance.status-page-url=http://${eureka.instance.ip-address}:${server.port}/swagger-ui.html
19 23
 
20
-spring.application.name=depot-system
21 24
 
22
-eureka.instance.status-page-url=http://localhost:${server.port}/swagger-ui.html
23 25
 
24 26
 # Redis数据库索引(默认为0)
25 27
 spring.redis.database=3