Commit 46c29070 by Suvalue

后台修改

parent 7965da98
...@@ -48,7 +48,7 @@ public class UserController { ...@@ -48,7 +48,7 @@ public class UserController {
@Token @Token
@ApiOperation("查询用户详细信息") @ApiOperation("查询用户详细信息")
public Object getById(@RequestBody UserReq.InfoUserReq user) throws Exception { public Object getById(@RequestBody UserReq.InfoUserReq user) throws Exception {
SysUser info = userService.info(user.getUserId()); SysUserList info = userService.info(user.getUserId());
return Result.success(info); return Result.success(info);
} }
...@@ -82,7 +82,7 @@ public class UserController { ...@@ -82,7 +82,7 @@ public class UserController {
@Token @Token
@ApiOperation("修改用户") @ApiOperation("修改用户")
public Object updateUser(@Valid @RequestBody UpdateUserReq user) throws Exception { public Object updateUser(@Valid @RequestBody UpdateUserReq user) throws Exception {
SysUser reqUser = userService.info(user.getUserId()); SysUserList reqUser = userService.info(user.getUserId());
SysUser codeUser = userService.findByLoginName(user.getUserCode()); SysUser codeUser = userService.findByLoginName(user.getUserCode());
if (reqUser != null) { if (reqUser != null) {
if (codeUser != null && !codeUser.getUserCode().equals(reqUser.getUserCode())) { if (codeUser != null && !codeUser.getUserCode().equals(reqUser.getUserCode())) {
......
...@@ -20,4 +20,6 @@ public interface SysUserMapper { ...@@ -20,4 +20,6 @@ public interface SysUserMapper {
SysUser selectByCode(@Param("userCode") String loginName); SysUser selectByCode(@Param("userCode") String loginName);
List<SysUserList> selectUserList(); List<SysUserList> selectUserList();
SysUserList selectUserById(@Param("id") Integer id);
} }
\ No newline at end of file
...@@ -19,5 +19,5 @@ public interface UserService { ...@@ -19,5 +19,5 @@ public interface UserService {
List<SysUserList> getAll(UserReq.GetUserReq user); List<SysUserList> getAll(UserReq.GetUserReq user);
SysUser info(Integer userId); SysUserList info(Integer userId);
} }
...@@ -66,7 +66,7 @@ public class UserServiceImpl implements UserService { ...@@ -66,7 +66,7 @@ public class UserServiceImpl implements UserService {
if (user != null) { if (user != null) {
SysUser sysUser = sysUserMapper.selectByPrimaryKey(user.getUserId()); SysUser sysUser = sysUserMapper.selectByPrimaryKey(user.getUserId());
if (sysUser != null) { if (sysUser != null) {
sysUser.setState(sysUser.getState().equals((short) StateType.OFF.getValue()) ? (short) StateType.OFF.getValue() : (short) StateType.ON.getValue()); sysUser.setState(sysUser.getState().equals((short) StateType.OFF.getValue()) ? (short) StateType.ON.getValue() : (short) StateType.OFF.getValue());
sysUserMapper.updateByPrimaryKey(sysUser); sysUserMapper.updateByPrimaryKey(sysUser);
return true; return true;
} }
...@@ -90,10 +90,10 @@ public class UserServiceImpl implements UserService { ...@@ -90,10 +90,10 @@ public class UserServiceImpl implements UserService {
sysUserMapper.updateByPrimaryKey(sysUser); sysUserMapper.updateByPrimaryKey(sysUser);
//修改角色信息 //修改角色信息
sysRoleService.saveUserRole(null, (long) sysUser.getId(), user.getRoleId()); sysRoleService.saveUserRole(1l, (long) sysUser.getId(), user.getRoleId());
//修改科室信息 //修改科室信息
dicOrgService.saveUserOrg(null, (long) sysUser.getId(), user.getOrg()); dicOrgService.saveUserOrg(1l, (long) sysUser.getId(), user.getOrg());
return true; return true;
} }
...@@ -113,8 +113,8 @@ public class UserServiceImpl implements UserService { ...@@ -113,8 +113,8 @@ public class UserServiceImpl implements UserService {
} }
@Override @Override
public SysUser info(Integer userId) { public SysUserList info(Integer userId) {
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId); SysUserList sysUser = sysUserMapper.selectUserById(userId);
return sysUser; return sysUser;
} }
} }
#### \u6D4B\u8BD5\u73AF\u5883 ################################################### #### \u6D4B\u8BD5\u73AF\u5883 ###################################################
spring.datasource.url=jdbc:mysql://192.168.18.179:3306/scml_mzx_test2.0?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC spring.datasource.url=jdbc:mysql://192.168.18.176:3306/scml_sy2.0?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Suvalue2016 spring.datasource.password=Suvalue2016
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<resultMap id="SysUserList" extends="BaseResultMap" type="com.hs.admin.model.respmodel.SysUserList"> <resultMap id="SysUserList" extends="BaseResultMap" type="com.hs.admin.model.respmodel.SysUserList">
<result column="ROLE_ID" jdbcType="INTEGER" property="roleId"/> <result column="ROLE_ID" jdbcType="INTEGER" property="roleId"/>
<result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/> <result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/>
<result column="ROLE_ID" jdbcType="INTEGER" property="orgId"/> <result column="ORG_ID" jdbcType="INTEGER" property="orgId"/>
<result column="USER_CODE" jdbcType="VARCHAR" property="orgName"/> <result column="ORG_NAME" jdbcType="VARCHAR" property="orgName"/>
</resultMap> </resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete delete
...@@ -128,4 +128,14 @@ ...@@ -128,4 +128,14 @@
join sys_subject s on s.ID = us.ORG_ID and s.STATE = 1 and ((s.PARENT_ID != 0 and r.ROLE_CODE != 1) or join sys_subject s on s.ID = us.ORG_ID and s.STATE = 1 and ((s.PARENT_ID != 0 and r.ROLE_CODE != 1) or
(s.PARENT_ID = 0 and r.ROLE_CODE = 1)) (s.PARENT_ID = 0 and r.ROLE_CODE = 1))
</select> </select>
<select id="selectUserById" resultMap="SysUserList">
select r.ID as ROLE_ID, r.ROLE_NAME, s.ID as ORG_ID, s.ORG_NAME, u.*
from sys_user u
join sys_user_role_rs ur on ur.USER_ID = u.ID and ur.STATE = 1
join sys_role r on r.ID = ur.ROLE_ID and r.STATE = 1
join sys_user_sbj_rs us on us.USER_ID = u.ID and us.STATE = 1
join sys_subject s on s.ID = us.ORG_ID and s.STATE = 1 and ((s.PARENT_ID != 0 and r.ROLE_CODE != 1) or
(s.PARENT_ID = 0 and r.ROLE_CODE = 1))
where u.id = #{id}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,15 +2,16 @@ ...@@ -2,15 +2,16 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hs.admin.mapper.SysUserRoleRsMapper"> <mapper namespace="com.hs.admin.mapper.SysUserRoleRsMapper">
<resultMap id="BaseResultMap" type="com.hs.admin.model.SysUserRoleRs"> <resultMap id="BaseResultMap" type="com.hs.admin.model.SysUserRoleRs">
<id column="ID" jdbcType="INTEGER" property="id" /> <id column="ID" jdbcType="INTEGER" property="id"/>
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" /> <result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate"/>
<result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid" /> <result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid"/>
<result column="STATE" jdbcType="DECIMAL" property="state" /> <result column="STATE" jdbcType="DECIMAL" property="state"/>
<result column="USER_ID" jdbcType="DECIMAL" property="userId" /> <result column="USER_ID" jdbcType="DECIMAL" property="userId"/>
<result column="ROLE_ID" jdbcType="DECIMAL" property="roleId" /> <result column="ROLE_ID" jdbcType="DECIMAL" property="roleId"/>
</resultMap> </resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_user_role_rs delete
from sys_user_role_rs
where ID = #{id,jdbcType=INTEGER} where ID = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.hs.admin.model.SysUserRoleRs"> <insert id="insert" parameterType="com.hs.admin.model.SysUserRoleRs">
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
select d.*,d2.MDC_NAME as PARENT_MDC_NAME,d2.`LEVEL` as PARENT_MDC_LEVEL select d.*,d2.MDC_NAME as PARENT_MDC_NAME,d2.`LEVEL` as PARENT_MDC_LEVEL
from ( from (
SELECT null as PARENT_MDC_CODE,ZBZBM as MDC_CODE,ZBZ as MDC_NAME SELECT null as PARENT_MDC_CODE,ZBZBM as MDC_CODE,ZBZ as MDC_NAME
FROM `from_table_dept_dis` FROM `val_block_values_1_2_2`
where 1=1 where 1=1
<if test="date!=null"> <if test="date!=null">
and TIME = #{date} and TIME = #{date}
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
UNION UNION
SELECT ZBZBM as PARENT_MDC_CODE,YJBZBM as MDC_CODE,YJBZ as MDC_NAME SELECT ZBZBM as PARENT_MDC_CODE,YJBZBM as MDC_CODE,YJBZ as MDC_NAME
FROM `from_table_dept_dis_st` FROM `val_block_values_1_5_2`
where 1=1 where 1=1
<if test="date!=null"> <if test="date!=null">
and TIME = #{date} and TIME = #{date}
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<select id="selectLastDate" resultMap="BaseResultMap"> <select id="selectLastDate" resultMap="BaseResultMap">
select * select *
from sys_version from sys_version
order by UPDATE_TIME, BAH_DATE desc order by UPDATE_TIME desc, BAH_DATE desc
limit 0,1 limit 0,1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment