Commit 6d880f79 authored by wangyihao's avatar wangyihao

解绑 系统用户和店铺管理员之间的联系

parent e9324205
...@@ -80,7 +80,7 @@ public class SysUserController extends BaseController { ...@@ -80,7 +80,7 @@ public class SysUserController extends BaseController {
sysUser.setMobilePhone(sysUserRoleIds.getMobilePhone()); sysUser.setMobilePhone(sysUserRoleIds.getMobilePhone());
sysUser.setSex(sysUserRoleIds.getSex()); sysUser.setSex(sysUserRoleIds.getSex());
sysUser.setDeptId(sysUserRoleIds.getDeptId()); sysUser.setDeptId(sysUserRoleIds.getDeptId());
sysUser.setAdministratorsId(sysUserRoleIds.getAdministratorsId()); // sysUser.setAdministratorsId(sysUserRoleIds.getAdministratorsId());
if (sysUserRoleIds.getSysRole()!=null) { if (sysUserRoleIds.getSysRole()!=null) {
String[] roleIds = sysUserRoleIds.getSysRole(); String[] roleIds = sysUserRoleIds.getSysRole();
List<SysRole> sysRoles = new ArrayList<SysRole>(); List<SysRole> sysRoles = new ArrayList<SysRole>();
......
...@@ -82,13 +82,13 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -82,13 +82,13 @@ public class SysUserServiceImpl implements SysUserService {
sysUser.setIsDeleted(0); sysUser.setIsDeleted(0);
sysUser.setCreateTime(now); sysUser.setCreateTime(now);
sysUser.setUpdateTime(now); sysUser.setUpdateTime(now);
int count1 = sysUserDao.add(sysUser); sysUserDao.add(sysUser);
if(count1>0) { // if(count1>0) {
Administrators administrators = new Administrators(); // Administrators administrators = new Administrators();
administrators.setAdministratorsId(sysUser.getAdministratorsId()); // administrators.setAdministratorsId(sysUser.getAdministratorsId());
administrators.setSystemId(sysUser.getUserId()); // administrators.setSystemId(sysUser.getUserId());
administratorsDao.update(administrators); // administratorsDao.update(administrators);
} // }
for (int i = 0; i < sysUser.getSysRole().size(); i++) { for (int i = 0; i < sysUser.getSysRole().size(); i++) {
SysRole sysRole = sysUser.getSysRole().get(i); SysRole sysRole = sysUser.getSysRole().get(i);
...@@ -156,19 +156,19 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -156,19 +156,19 @@ public class SysUserServiceImpl implements SysUserService {
// 调用Dao执行更新操作,并判断更新语句执行结果 // 调用Dao执行更新操作,并判断更新语句执行结果
int count = sysUserDao.update(sysUser); int count = sysUserDao.update(sysUser);
if (count == 1) { if (count == 1) {
SysUser su = sysUserDao.get(userId); // SysUser su = sysUserDao.get(userId);
if(null != su) { // if(null != su) {
Administrators admin= new Administrators(); // Administrators admin= new Administrators();
admin.setAdministratorsId(su.getAdministratorsId()); // admin.setAdministratorsId(su.getAdministratorsId());
admin.setSystemId(null); // admin.setSystemId(null);
int count1=administratorsDao.update(admin); // int count1=administratorsDao.update(admin);
if(count1 == 1) { // if(count1 == 1) {
resultInfo.setCode(Constant.SUCCESS); // resultInfo.setCode(Constant.SUCCESS);
}else { // }else {
resultInfo.setCode(Constant.FAIL); // resultInfo.setCode(Constant.FAIL);
resultInfo.setMsg("未释放店铺管理员!"); // resultInfo.setMsg("未释放店铺管理员!");
} // }
} // }
resultInfo.setCode(Constant.SUCCESS); resultInfo.setCode(Constant.SUCCESS);
} else { } else {
resultInfo.setCode(Constant.FAIL); resultInfo.setCode(Constant.FAIL);
......
...@@ -99,7 +99,7 @@ POWER,SYSTEM_ID,CREATE_TIME,UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,ADMINISTRATORS ...@@ -99,7 +99,7 @@ POWER,SYSTEM_ID,CREATE_TIME,UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,ADMINISTRATORS
<if test="power!=null and power!=''"> <if test="power!=null and power!=''">
POWER=#{power,jdbcType = VARCHAR}, POWER=#{power,jdbcType = VARCHAR},
</if> </if>
<if test="systemId!=''"> <if test="systemId!=null and systemId!=''">
SYSTEM_ID=#{systemId,jdbcType = VARCHAR}, SYSTEM_ID=#{systemId,jdbcType = VARCHAR},
</if> </if>
<if test="createTime!=null "> <if test="createTime!=null ">
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
<result column="OPERATOR_ID" property="operatorId" javaType="java.lang.String" jdbcType="VARCHAR"/> <result column="OPERATOR_ID" property="operatorId" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="FLAG" property="flag" javaType="java.lang.String" jdbcType="VARCHAR"/> <result column="FLAG" property="flag" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="ADMINISTRATORS_ID" property="administratorsId" javaType="java.lang.String" jdbcType="VARCHAR"/> <result column="ADMINISTRATORS_ID" property="administratorsId" javaType="java.lang.String" jdbcType="VARCHAR"/>
<result column="ADMINISTRATORS_NAME" property="administratorsName" javaType="java.lang.String" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<resultMap type="SysUser" id="SysUserAss" extends="SysUser"> <resultMap type="SysUser" id="SysUserAss" extends="SysUser">
<association property="sysRole" column="USER_ID" <association property="sysRole" column="USER_ID"
...@@ -164,11 +163,7 @@ ...@@ -164,11 +163,7 @@
</select> </select>
<select id="count2" parameterType="Query" resultType="Long"> <select id="count2" parameterType="Query" resultType="Long">
select select count(*) from T_SYS_USER
count(*)
FROM
t_sys_user u
LEFT JOIN t_administrators a ON u.ADMINISTRATORS_ID = a.ADMINISTRATORS_ID
<where> <where>
<include refid="listCommonWhere2"/> <include refid="listCommonWhere2"/>
</where> </where>
...@@ -190,12 +185,7 @@ ...@@ -190,12 +185,7 @@
</select> </select>
<select id="pageList2" parameterType="Query" resultMap="SysUserAss"> <select id="pageList2" parameterType="Query" resultMap="SysUserAss">
SELECT select * from T_SYS_USER
u.*,
a.ADMINISTRATORS_NAME
FROM
t_sys_user u
LEFT JOIN t_administrators a ON u.ADMINISTRATORS_ID = a.ADMINISTRATORS_ID
<where> <where>
<include refid="listCommonWhere2"/> <include refid="listCommonWhere2"/>
</where> </where>
...@@ -288,7 +278,7 @@ ...@@ -288,7 +278,7 @@
AND IS_AVAILABLE=#{q.isAvailable} AND IS_AVAILABLE=#{q.isAvailable}
</if> </if>
<if test="q.isDeleted!=null "> <if test="q.isDeleted!=null ">
AND u.IS_DELETED=#{q.isDeleted} AND IS_DELETED=#{q.isDeleted}
</if> </if>
<if test="q.createTime!=null "> <if test="q.createTime!=null ">
AND CREATE_TIME=#{q.createTime} AND CREATE_TIME=#{q.createTime}
......
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