Commit ec892ccc authored by 赵啸非's avatar 赵啸非

添加初始化数据库脚本

parent 507758cd
......@@ -92,36 +92,6 @@ public class ResourceServiceImpl extends AbstractCRUDServiceImpl<ResourceDao,Res
return dao.getAll(userType);
}
@Override
public void updateUserList() {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
//更新本地用户信息,并且更新用户站点树
list.getData().getData().forEach(user -> {
UserEntity tempUserEntity =userService.selectOne(new UserQuery().loginName(user.getLoginName()));
if (ObjectUtils.isEmpty(tempUserEntity)) {
//新增
UserEntity entity = new UserEntity();
entity.initAttrValue();
BeanUtils.copyProperties(user, entity, BeanUtil.getNullPropertyNames(user));
userService.save(entity);
Context context = new Context();
context.setUser(entity);
ThreadPool.getInstance().execute(new SyncTreeSiteThread(siteService,context));
}else{
//更新
UserEntity userEntity = new UserEntity();
BeanUtils.copyProperties(user, userEntity, new String[]{"loginPwd","userType","status","lastLoginTime", "lastLoginAddress"});
userService.updateWidthDao(userEntity);
Context context = new Context();
context.setUser(userEntity);
ThreadPool.getInstance().execute(new SyncTreeSiteThread(siteService,context));
}
});
}
}
\ No newline at end of file
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