同步正元身份判断,有钱包的权限的才同步

This commit is contained in:
dzc committed 2025-03-24 20:00:49 +08:00
1 parent 8a16c5c946
commit 3f0cd01c41
3 files changed
+12 -3

No files matched your search

@@ -6,6 +6,7 @@ public interface CommonRoleConstant {
String DEPT_ADMIN = "DEPT_ADMIN";
// 自动创建钱包
String AUTO_CREATE_WALLET = "WALLET_AUTO_CREATE";
}
@@ -22,6 +22,7 @@ import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
import com.bsd.pjcloud.admin.api.utils.DataUtil;
import com.bsd.pjcloud.common.core.constant.CacheConstants;
import com.bsd.pjcloud.common.core.constant.CommonRoleConstant;
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
import com.bsd.pjcloud.common.core.util.BeanUtils;
import com.bsd.pjcloud.common.core.util.CollectionUtils;
@@ -102,7 +103,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
UserInfo user = null;
if (checkPermission) {
user = userService.getByUserId(userId).getData();
String autoWalletRoleCode = ParamResolver.getStr("WALLET_AUTO_CREATE");
String autoWalletRoleCode = ParamResolver.getStr(CommonRoleConstant.AUTO_CREATE_WALLET);
if (ObjectUtil.isEmpty(autoWalletRoleCode)) {
log.info("|{}|创建用户电子钱包失败,userId:{},WALLET_AUTO_CREATE参数未配置", TAG, userId);
return;
@@ -14,6 +14,7 @@ import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
import com.bsd.pjcloud.admin.api.feign.RemoteRoleService;
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
import com.bsd.pjcloud.admin.api.vo.UserVO;
import com.bsd.pjcloud.common.core.constant.CommonRoleConstant;
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
import com.bsd.pjcloud.thirdparty.api.feign.RemoterThirdZyService;
import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccClassInfoDto;
@@ -27,11 +28,9 @@ import com.bsd.pjcloud.thirdparty.vo.zy.mer.ZyMerSyncEnterpriseInfoVo;
import com.bsd.pjcloud.wallet.api.constant.WalleCardStatusEnum;
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
import com.bsd.pjcloud.wallet.api.dto.MchManageDto;
import com.bsd.pjcloud.wallet.api.dto.WalletManageDto;
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
import com.bsd.pjcloud.wallet.service.MchManageService;
import com.bsd.pjcloud.wallet.service.WalletThirdZyService;
import com.bsd.pjcloud.wallet.service.WalletManageService;
@@ -249,6 +248,14 @@ public class WalletThirdZyServiceImpl implements WalletThirdZyService {
List<ZyMerSyncAccountInfoDto> syncList = new ArrayList<>();
String syncAllMchVersion = getSyncAllMchVersion();
for (UserVO v : userVOList) {
if (ObjectUtil.isEmpty(v) || ObjectUtil.isEmpty(v.getUserId())) {
log.error("|{}|syncAllUserGroup用户不存在WalletManageVo|{}|", TAG, JSONUtil.toJsonStr(v));
continue;
}
if (ObjectUtil.isEmpty(v.getRoleList()) || !v.getRoleList().contains(CommonRoleConstant.AUTO_CREATE_WALLET)) {
log.error("|{}|syncAllUserGroup用户没有自动创建钱包权限|{}|", TAG, JSONUtil.toJsonStr(v));
continue;
}
MchManageVo mch = mchManageService.getFirstMchByDeptId(v.getDeptId());
// 查询是在商户下
if (ObjectUtil.isEmpty(mch)) {