|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.storlead.framework.common.constant.CommonConstant;
|
|
|
import com.storlead.framework.common.ecode.PasswordEncoder;
|
|
|
import com.storlead.framework.common.util.RsaUtils;
|
|
|
import com.storlead.framework.auth.vo.LoginUser;
|
|
|
@@ -153,7 +154,29 @@ public class UserServiceImpl extends MyBaseServiceImpl<UserMapper, UserEntity> i
|
|
|
|
|
|
@Override
|
|
|
public Boolean syncWxId() {
|
|
|
- return syncUserOpenIdFormTencent();
|
|
|
+ LambdaQueryWrapper<UserEntity> wp = new LambdaQueryWrapper<>();
|
|
|
+ wp.isNull(UserEntity::getXworkUserId);
|
|
|
+ wp.eq(UserEntity::getIsDelete, CommonConstant.DEL_FLAG_0);
|
|
|
+ wp.eq(UserEntity::getEnabled,true);
|
|
|
+ List<UserEntity> list = list(wp);
|
|
|
+
|
|
|
+ List<com.storlead.framework.common.vo.UserVo> us = new ArrayList<>();
|
|
|
+ List<com.storlead.framework.common.vo.UserVo> finalUs = us;
|
|
|
+ list.forEach(a -> {
|
|
|
+ com.storlead.framework.common.vo.UserVo v = new com.storlead.framework.common.vo.UserVo();
|
|
|
+ BeanUtils.copyProperties(a,v);
|
|
|
+ finalUs.add(v);
|
|
|
+ });
|
|
|
+ corpWeChatService.syncWxUserIdByMobile(finalUs);
|
|
|
+ for (com.storlead.framework.common.vo.UserVo user : us) {
|
|
|
+ if (Objects.nonNull(user.getXworkUserId())) {
|
|
|
+ LambdaUpdateWrapper<UserEntity> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.eq(UserEntity::getMobile,user.getMobile());
|
|
|
+ updateWrapper.set(UserEntity::getXworkUserId,user.getXworkUserId());
|
|
|
+ update(updateWrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return Boolean.TRUE;
|
|
|
}
|
|
|
/**
|
|
|
* 同步project公司
|