浏览代码

sz 设备加字段

xiao547607 5 年之前
父节点
当前提交
c3d7c5bdca

+ 6 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/PersonDeviceRelation.java

@@ -87,4 +87,10 @@ public class PersonDeviceRelation {
 	public void setPersonInfo(PersonInfo personInfo) {
 		this.personInfo = personInfo;
 	}
+
+	/**
+	 *人脸信息是否绑定到终端
+	 */
+	@ApiModelProperty(value = "人脸信息是否绑定到终端")
+	private String isBound;
 }

+ 6 - 1
common/src/main/resources/mapper/base/PersonDeviceRelation.xml

@@ -24,6 +24,7 @@
 			<result property="createTime" column="create_time" />
 			<result property="updateBy" column="update_by" />
 			<result property="updateTime" column="update_time" />
+		    <result property="isBound" column="is_bound" />
 			<association property="deviceInfo" column="device_id"
 					 select="com.jpsoft.smart.modules.base.dao.DeviceInfoDAO.get"></association>
 			<association property="personInfo" column="person_id"
@@ -37,7 +38,7 @@
 	-->
 	<![CDATA[
 		insert into base_person_device_relation
-	    (id_,device_id,person_id,del_flag,create_by,create_time,update_by,update_time)
+	    (id_,device_id,person_id,del_flag,create_by,create_time,update_by,update_time,is_bound)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -48,6 +49,7 @@
 ,#{createTime,jdbcType= TIMESTAMP }
 ,#{updateBy,jdbcType=VARCHAR}
 ,#{updateTime,jdbcType= TIMESTAMP }
+,#{isBound,jdbcType=VARCHAR}
 		)
 	]]>
 	</insert>
@@ -78,6 +80,9 @@
 				<if test="updateTime!=null">
 		update_time=#{updateTime,jdbcType= TIMESTAMP },
 		</if>
+			<if test="isBound!=null">
+				is_bound=#{isBound,jdbcType= VARCHAR },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 36 - 0
web/src/main/java/com/jpsoft/smart/modules/sys/controller/UserController.java

@@ -283,4 +283,40 @@ public class UserController {
 
         return msgResult;
     }
+
+    @ApiOperation(value="修改用户密码")
+    @PostMapping("changeUserPassword")
+    public MessageResult<Integer> changeUserPassword(String userId,String newPwd,@RequestAttribute String subject) {
+
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+
+            User user = userService.get(userId);
+
+            DES3 des3 = new DES3();
+
+            user.setPassword(des3.encrypt(jwtSecret, newPwd));
+            user.setUpdateBy(subject);
+            user.setUpdateTime(new Date());
+
+            int affectCount = userService.update(user);
+
+            if(affectCount>0){
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            }
+            else{
+                msgResult.setResult(false);
+                msgResult.setMessage("修改失败!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }