测试问题项修改
This commit is contained in:
parent
66fc5505eb
commit
f1584484ee
|
|
@ -226,7 +226,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
Long companyId = null;
|
||||
try {
|
||||
roles = SecurityUtils.getLoginUser().getRoles();
|
||||
userid = SecurityUtils.getLoginUser().getUserid();
|
||||
userid = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||
companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
|
|
@ -249,10 +249,8 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return AjaxResult.error("审核失败");
|
||||
}
|
||||
}
|
||||
if ((roles != null && roles.contains("jjfgs")) || (companyId != null && companyId.equals(101L))) {
|
||||
if (companyId != null) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
}
|
||||
if (companyId != null && companyId.equals(101L)) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
if (userid != null) {
|
||||
bean.setCreateBy(userid.toString());
|
||||
}
|
||||
|
|
@ -262,10 +260,8 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return AjaxResult.error("审核失败");
|
||||
}
|
||||
}
|
||||
if ((roles != null && roles.contains("tsfgs")) || (companyId != null && companyId.equals(102L))) {
|
||||
if (companyId != null) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
}
|
||||
if (companyId != null && companyId.equals(102L)) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
if (userid != null) {
|
||||
bean.setCreateBy(userid.toString());
|
||||
}
|
||||
|
|
@ -320,7 +316,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
for (int i = 0; i < ids.length; i++) {
|
||||
String id = ids[i];
|
||||
bean.setId(Long.valueOf(id));
|
||||
if (userId == 1) {
|
||||
if (roles.contains("admin")) {
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("2");
|
||||
int re = backApplyMapper.refuse(bean);
|
||||
|
|
@ -328,7 +324,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
if (roles.contains("jjfgs")) {
|
||||
if (companyId != null && companyId.equals(101L)) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("2");
|
||||
|
|
@ -337,7 +333,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return AjaxResult.error("驳回失败");
|
||||
}
|
||||
}
|
||||
if (roles.contains("tsfgs")) {
|
||||
if (companyId != null && companyId.equals(102L)) {
|
||||
bean.setCompanyId(companyId.toString());
|
||||
bean.setCreateBy(userId.toString());
|
||||
bean.setStatus("4");
|
||||
|
|
@ -426,7 +422,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
Long companyId = null;
|
||||
try {
|
||||
roles = SecurityUtils.getLoginUser().getRoles();
|
||||
userid = SecurityUtils.getLoginUser().getUserid();
|
||||
userid = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||
companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||
} catch (NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
|
|
@ -447,10 +443,8 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return AjaxResult.error("审核失败");
|
||||
}
|
||||
}
|
||||
if (roles != null && roles.contains("jjfgs")) {
|
||||
if (companyId != null) {
|
||||
dto.setCompanyId(companyId.toString());
|
||||
}
|
||||
if (companyId != null && companyId.equals(101L)) {
|
||||
dto.setCompanyId(companyId.toString());
|
||||
if (userid != null) {
|
||||
dto.setCreateBy(userid.toString());
|
||||
}
|
||||
|
|
@ -460,10 +454,8 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
return AjaxResult.error("审核失败");
|
||||
}
|
||||
}
|
||||
if (roles != null && roles.contains("tsfgs")) {
|
||||
if (companyId != null) {
|
||||
dto.setCompanyId(companyId.toString());
|
||||
}
|
||||
if (companyId != null && companyId.equals(102L)) {
|
||||
dto.setCompanyId(companyId.toString());
|
||||
if (userid != null) {
|
||||
dto.setCreateBy(userid.toString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -309,6 +309,18 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
userPostMapper.deleteUserPostByUserId(userId);
|
||||
// 新增用户与岗位管理
|
||||
insertUserPost(user);
|
||||
Long deptId = user.getDeptId();
|
||||
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||
String ancestors = sysDept.getAncestors();
|
||||
String[] split = ancestors.split(",");
|
||||
if (split.length == 2) {
|
||||
//表示属于分公司
|
||||
user.setCompanyId(sysDept.getDeptId());
|
||||
}
|
||||
if (split.length >= 3) {
|
||||
//表示属于分公司下的某个部门
|
||||
user.setCompanyId(Long.parseLong(split[2]));
|
||||
}
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="companyId != null">company_id = #{companyId},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue