@ -13,6 +13,7 @@ import com.biutag.exception.OperateException;
import com.biutag.lan.config.AdminThreadLocal ;
import com.biutag.lan.config.AdminThreadLocal ;
import com.biutag.lan.enums.PostEnums ;
import com.biutag.lan.enums.PostEnums ;
import com.biutag.lan.mapper.PoliceUserMapper ;
import com.biutag.lan.mapper.PoliceUserMapper ;
import com.biutag.lan.service.IDeptService ;
import com.biutag.lan.service.IPermService ;
import com.biutag.lan.service.IPermService ;
import com.biutag.lan.service.IPoliceUserService ;
import com.biutag.lan.service.IPoliceUserService ;
import com.biutag.lan.validate.commons.PageValidate ;
import com.biutag.lan.validate.commons.PageValidate ;
@ -20,10 +21,7 @@ import com.biutag.lan.validate.system.PoliceUserCreateValidate;
import com.biutag.lan.validate.system.PoliceUserSearchValidate ;
import com.biutag.lan.validate.system.PoliceUserSearchValidate ;
import com.biutag.lan.validate.system.PoliceUserUpInfoValidate ;
import com.biutag.lan.validate.system.PoliceUserUpInfoValidate ;
import com.biutag.lan.validate.system.PoliceUserUpdateValidate ;
import com.biutag.lan.validate.system.PoliceUserUpdateValidate ;
import com.biutag.lan.vo.system.PoliceUserDetailVo ;
import com.biutag.lan.vo.system.* ;
import com.biutag.lan.vo.system.PoliceUserInformVo ;
import com.biutag.lan.vo.system.PoliceUserListedVo ;
import com.biutag.lan.vo.system.PoliceUserSelvesVo ;
import com.biutag.mapper.system.MenuMapper ;
import com.biutag.mapper.system.MenuMapper ;
import com.biutag.mapper.system.PoliceDepartMapper ;
import com.biutag.mapper.system.PoliceDepartMapper ;
import com.biutag.mapper.system.PolicePositionMapper ;
import com.biutag.mapper.system.PolicePositionMapper ;
@ -61,6 +59,9 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
@Resource
@Resource
IPermService iPermService ;
IPermService iPermService ;
@Resource
IDeptService deptService ;
/ * *
/ * *
* 管理员列表
* 管理员列表
*
*
@ -74,7 +75,7 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
Integer page = pageValidate . getPageNo ( ) ;
Integer page = pageValidate . getPageNo ( ) ;
Integer limit = pageValidate . getPageSize ( ) ;
Integer limit = pageValidate . getPageSize ( ) ;
QueryWrapper < PoliceUser > queryWrapper = new QueryWrapper < > ( ) ;
QueryWrapper < PoliceUser > queryWrapper = new QueryWrapper < > ( ) ;
queryWrapper . eq ( StrUtil . isNotBlank ( searchValidate . getEmpNo ( ) ) , "u.emp_no" , searchValidate . getEmpNo ( ) )
queryWrapper . eq ( StrUtil . isNotBlank ( searchValidate . getEmpNo ( ) ) , "u.emp_no" , StrUtil . trim ( searchValidate . getEmpNo ( ) ) )
. like ( StrUtil . isNotBlank ( searchValidate . getName ( ) ) , "u.name" , searchValidate . getName ( ) )
. like ( StrUtil . isNotBlank ( searchValidate . getName ( ) ) , "u.name" , searchValidate . getName ( ) )
. like ( StrUtil . isNotBlank ( searchValidate . getIdCode ( ) ) , "u.id_code" , searchValidate . getIdCode ( ) )
. like ( StrUtil . isNotBlank ( searchValidate . getIdCode ( ) ) , "u.id_code" , searchValidate . getIdCode ( ) )
. eq ( Objects . nonNull ( searchValidate . getRole ( ) ) , "u.role_ids" , searchValidate . getRole ( ) )
. eq ( Objects . nonNull ( searchValidate . getRole ( ) ) , "u.role_ids" , searchValidate . getRole ( ) )
@ -134,7 +135,6 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
. like ( "emp_no" , searchName ) . or ( )
. like ( "emp_no" , searchName ) . or ( )
. like ( "mobile" , searchName )
. like ( "mobile" , searchName )
. orderByDesc ( "sort" ) ;
. orderByDesc ( "sort" ) ;
return policeUserMapper . selectList ( queryWrapper ) ;
return policeUserMapper . selectList ( queryWrapper ) ;
}
}
@ -276,8 +276,10 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
PoliceUser model = new PoliceUser ( ) ;
PoliceUser model = new PoliceUser ( ) ;
model . setRoleIds ( createValidate . getRoleIds ( ) . toString ( ) ) ;
model . setRoleIds ( createValidate . getRoleIds ( ) . toString ( ) ) ;
this . batchSaveRoleByEmpNo ( createValidate . getEmpNo ( ) , Arrays . asList ( createValidate . getRoleIds ( ) ) ) ;
DeptVo deptVo = deptService . detail ( createValidate . getDeptIds ( ) ) ;
model . setDeptIds ( createValidate . getDeptIds ( ) . toString ( ) ) ;
model . setDeptIds ( createValidate . getDeptIds ( ) . toString ( ) ) ;
model . setDeptName ( deptVo . getName ( ) ) ;
this . batchSaveDepartByEmpNo ( createValidate . getEmpNo ( ) , Arrays . asList ( createValidate . getDeptIds ( ) ) ) ;
this . batchSaveDepartByEmpNo ( createValidate . getEmpNo ( ) , Arrays . asList ( createValidate . getDeptIds ( ) ) ) ;
model . setPostIds ( createValidate . getPostIds ( ) . toString ( ) ) ;
model . setPostIds ( createValidate . getPostIds ( ) . toString ( ) ) ;
this . batchSavePositionByEmpNo ( createValidate . getEmpNo ( ) , Arrays . asList ( createValidate . getPostIds ( ) ) ) ;
this . batchSavePositionByEmpNo ( createValidate . getEmpNo ( ) , Arrays . asList ( createValidate . getPostIds ( ) ) ) ;
@ -331,18 +333,15 @@ public class PoliceUserServiceImpl implements IPoliceUserService {
Assert . notNull ( policeUser , "警号已存在换一个吧!" ) ;
Assert . notNull ( policeUser , "警号已存在换一个吧!" ) ;
PoliceUser model = new PoliceUser ( ) ;
PoliceUser model = new PoliceUser ( ) ;
model . setId ( updateValidate . getId ( ) ) ;
model . setId ( updateValidate . getId ( ) ) ;
if ( Objects . nonNull ( updateValidate . getRoleIds ( ) ) ) {
model . setRoleIds ( updateValidate . getRoleIds ( ) . toString ( ) ) ;
model . setRoleIds ( updateValidate . getRoleIds ( ) . toString ( ) ) ;
if ( ! policeUser . getRoleIds ( ) . equals ( model . getRoleIds ( ) ) ) {
if ( ! policeUser . getRoleIds ( ) . equals ( model . getRoleIds ( ) ) ) {
this . batchSaveRoleByEmpNo ( updateValidate . getEmpNo ( ) , Collections . singletonList ( updateValidate . getRoleIds ( ) ) ) ;
this . batchSaveRoleByEmpNo ( updateValidate . getEmpNo ( ) , Collections . singletonList ( updateValidate . getRoleIds ( ) ) ) ;
}
}
}
if ( StringUtils . isNotNull ( updateValidate . getDeptIds ( ) ) ) {
DeptVo deptVo = deptService . detail ( updateValidate . getDeptIds ( ) ) ;
if ( ! policeUser . getDeptIds ( ) . equals ( model . getDeptIds ( ) ) ) {
model . setDeptIds ( updateValidate . getDeptIds ( ) . toString ( ) ) ;
this . batchSaveDepartByEmpNo ( updateValidate . getEmpNo ( ) , Collections . singletonList ( updateValidate . getDeptIds ( ) ) ) ;
model . setDeptName ( deptVo . getName ( ) ) ;
}
}
if ( StringUtils . isNotNull ( updateValidate . getPostIds ( ) ) ) {
if ( StringUtils . isNotNull ( updateValidate . getPostIds ( ) ) ) {
if ( ! policeUser . getPostIds ( ) . equals ( model . getPostIds ( ) ) ) {
if ( ! policeUser . getPostIds ( ) . equals ( model . getPostIds ( ) ) ) {
this . batchSavePositionByEmpNo ( updateValidate . getEmpNo ( ) , Collections . singletonList ( updateValidate . getPostIds ( ) ) ) ;
this . batchSavePositionByEmpNo ( updateValidate . getEmpNo ( ) , Collections . singletonList ( updateValidate . getPostIds ( ) ) ) ;