Commit 6d880f79 authored by wangyihao's avatar wangyihao

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

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