Forráskód Böngészése

解决用户新增时,同步到本地时的cardId和cardNo重新生成的问题

xiari 1 éve
szülő
commit
31e92aff08

+ 1 - 1
ruoyi-api/ruoyi-api-backstage/src/main/java/org/dromara/backstage/api/RemoteUserAccountService.java

@@ -25,7 +25,7 @@ public interface RemoteUserAccountService {
 
     void insertByBo(RemoteUserAccountBo bo);
 
-    R<String> openAccount(RemoteUserAccountBo bo);
+    R<RemoteUserAccountBo> openAccount(RemoteUserAccountBo bo);
     Boolean batchOpenAccount(Long[] userIds);
     Boolean batchCloseAccount(Long[] userIds);
      void updateByBo(RemoteUserAccountBo bo);

+ 6 - 2
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/payment/dubbo/RemoteUserAccountServiceImpl.java

@@ -48,12 +48,16 @@ public class RemoteUserAccountServiceImpl implements RemoteUserAccountService {
     }
 
     @Override
-    public R<String> openAccount(RemoteUserAccountBo bo) {
+    public R<RemoteUserAccountBo> openAccount(RemoteUserAccountBo bo) {
         PtUserAccountBo ptUserAccountBo = BeanUtil.copyProperties(bo, PtUserAccountBo.class);
         R<String> rs = userAccountBusiness.openAccount(ptUserAccountBo);
         bo.setCardId(ptUserAccountBo.getCardId());
         bo.setCardNo(ptUserAccountBo.getCardNo());
-        return rs;
+        R<RemoteUserAccountBo> remoteUserAccountBoR = new R<>();
+        remoteUserAccountBoR.setCode(rs.getCode());
+        remoteUserAccountBoR.setMsg(rs.getMsg());
+        remoteUserAccountBoR.setData(bo);
+        return remoteUserAccountBoR;
     }
 
     @Override

+ 4 - 3
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java

@@ -370,10 +370,11 @@ public class SysUserServiceImpl implements ISysUserService {
             if (Constants.AUTO_USER_ACCOUNT.equals(autoUserAccount)) {
                 //自动开通一卡通账户
                 remoteUserAccountBo.setAccountStatus("1");
-                R<String> result = remoteUserAccountService.openAccount(remoteUserAccountBo);
+                R<RemoteUserAccountBo> result = remoteUserAccountService.openAccount(remoteUserAccountBo);
                 if (result.getCode() == HttpStatus.SUCCESS) {
-                    user.setCardId(remoteUserAccountBo.getCardId());
-                    user.setCardNo(remoteUserAccountBo.getCardNo());
+                    RemoteUserAccountBo data = result.getData();
+                    user.setCardId(data.getCardId());
+                    user.setCardNo(data.getCardNo());
                     return rows;
                 } else {
                     throw new UserException(result.getMsg());