|
@@ -95,19 +95,22 @@ public class KwsUserService {
|
|
|
|
|
|
|
|
/*2、填充密码*/
|
|
/*2、填充密码*/
|
|
|
fillPassword(kwsUser);
|
|
fillPassword(kwsUser);
|
|
|
|
|
+ synchronized(this) {
|
|
|
|
|
+ //再次校验数据
|
|
|
|
|
+ checkAccountValid(kwsUser.getAccount(), kwsUser.getSystemType());
|
|
|
|
|
+ /*3、存库*/
|
|
|
|
|
+ long userId = new IdWorker(1).nextId();
|
|
|
|
|
+ kwsUser.setId(userId);
|
|
|
|
|
+ if (kwsUserDao.insert(kwsUser) <= 0) {
|
|
|
|
|
+ throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /*3、存库*/
|
|
|
|
|
- long userId = new IdWorker(1).nextId();
|
|
|
|
|
- kwsUser.setId(userId);
|
|
|
|
|
- if (kwsUserDao.insert(kwsUser) <= 0) {
|
|
|
|
|
- throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /*4、填充用户角色*/
|
|
|
|
|
- fillUserRole(reqVo.getRoleIds(), userId, reqVo.getSystemType());
|
|
|
|
|
|
|
+ /*4、填充用户角色*/
|
|
|
|
|
+ fillUserRole(reqVo.getRoleIds(), userId, reqVo.getSystemType());
|
|
|
|
|
|
|
|
- /*5、用户机构关系*/
|
|
|
|
|
- fillUserDept(kwsUser.getId(), reqVo.getDeptId());
|
|
|
|
|
|
|
+ /*5、用户机构关系*/
|
|
|
|
|
+ fillUserDept(kwsUser.getId(), reqVo.getDeptId());
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|