Преглед на файлове

云账户批量支付回调接口

liangpeile преди 1 година
родител
ревизия
01165e3dbf

+ 46 - 31
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/impl/AdminUserServiceImpl.java

@@ -35,6 +35,7 @@ import org.jeecg.modules.pay.sdk.base.YzhResponse;
 import org.jeecg.modules.pay.sdk.payment.PaymentClient;
 import org.jeecg.modules.pay.sdk.payment.domain.CreateBankpayOrderRequest;
 import org.jeecg.modules.pay.sdk.payment.domain.CreateBankpayOrderResponse;
+import org.jeecg.modules.system.util.SecurityUtil;
 import org.jeecg.modules.utils.HttpClientUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -86,6 +87,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
     private RedisUtil redisUtil;
     @Autowired
     private AdminTransferAccountsMapper adminTransferAccountsMapper;
+    @Autowired
+    private IAdminUserService adminUserService;
 
 
     @Override
@@ -117,6 +120,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             adminUser.setPassword("123456");
         }
         adminUser.setWisMhu("允许");
+        adminUser.setIsTrue("1");
         adminUser.setYzh(user.getYzh());
         adminUser.setWisWjdc("允许");
         String passwordEncode = PasswordUtil.encrypt(adminUser.getPhone(), adminUser.getPassword(), salt);
@@ -234,25 +238,25 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
     @Override
     public Result<?> perfectInformation(AdminUserVO adminUserVO, String authorization) {
 
-        if (authorization.equals("")) {
-            return Result.error("token不能为空");
-        }
-        String userPhone = JwtUtil.getUsername(authorization);
-        //校验token==================
-        if (!redisUtil.hasKey(CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone)) {
-            return Result.error("TOKEN失效");
-        }
+//        if (authorization.equals("")) {
+//            return Result.error("token不能为空");
+//        }
+//        String userPhone = JwtUtil.getUsername(authorization);
+//        //校验token==================
+//        if (!redisUtil.hasKey(CommonConstant.PREFIX_NFT_USER_TOKEN + userPhone)) {
+//            return Result.error("TOKEN失效");
+//        }
         try {
             //1. 校验用户是否有效
-            //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
-            QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("phone", userPhone);
-            queryWrapper.eq("is_true", "1");
-            AdminUser storeMember1 = this.getOne(queryWrapper);
-            if (storeMember1 == null) {
-                baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
-                return Result.error("token校验该用户不存在");
-            }
+//            //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
+//            QueryWrapper<AdminUser> queryWrapper = new QueryWrapper<>();
+//            queryWrapper.eq("phone", userPhone);
+//            queryWrapper.eq("is_true", "1");
+//            AdminUser storeMember1 = this.getOne(queryWrapper);
+//            if (storeMember1 == null) {
+//                baseCommonService.addLog("用户校验失败,用户不存在!", CommonConstant.LOG_TYPE_1, null);
+//                return Result.error("token校验该用户不存在");
+//            }
             //银行卡四要素认证(下发验证码)
             return this.bankCardFourAuthVerify(adminUserVO);
         } catch (Exception e) {
@@ -315,7 +319,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
                 return Result.error("token校验该用户不存在");
             }
             //银行卡四要素认证(上传验证码)
-            return this.bankCardFourAuthConfirm(adminUserVO);
+           return this.bankCardFourAuthConfirm(adminUserVO,storeMember1);
         } catch (Exception e) {
             return Result.error("请求失败");
         }
@@ -372,7 +376,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         }
     }
 
-    private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO) {
+    private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO,AdminUser adminUser) {
         BankCardFourAuthConfirmRequest request = new BankCardFourAuthConfirmRequest();
         request.setCardNo(adminUserVO.getBackCard());
         request.setIdCard(adminUserVO.getCard());
@@ -381,6 +385,8 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         request.setCaptcha(adminUserVO.getCode());
         request.setRef(adminUserVO.getRef());
         YzhResponse<BankCardFourAuthConfirmResponse> response = null;
+
+
         try {
             String requestId = BaseUtil.getRandomStr("requestId");
             // request-id:每次请求的唯一标识
@@ -391,7 +397,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
                 BankCardFourAuthConfirmResponse data = response.getData();
                 baseCommonService.addLog("银行卡四要素认证(上传验证码)请求的唯一标识request-id: " + requestId, CommonConstant.LOG_TYPE_2, 2);
                 System.out.println("请求成功:" + data);
-                this.saveAdminUserVO(adminUserVO);
+                this.saveAdminUserVO(adminUserVO,adminUser);
                 return Result.ok("请求成功:" + data);
 
             } else {
@@ -405,17 +411,26 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         }
     }
 
-    public void saveAdminUserVO(AdminUserVO adminUserVO) {
-        AdminUser adminUser = new AdminUser();
-        adminUser.setName(adminUserVO.getName());
-        adminUser.setCard(adminUserVO.getCard());
-        adminUser.setBackCard(adminUserVO.getBackCard());
-        adminUser.setCardholderPhone(adminUserVO.getCardholderPhone());
-        adminUser.setDwname(adminUserVO.getDwname());
-        adminUser.setKsname(adminUserVO.getKsname());
-        adminUser.setDoctorAndSpecialist(adminUserVO.getDoctorAndSpecialist());
-        adminUser.setCardPic(adminUserVO.getCardPic());
-        this.saveAdminUserVO(adminUserVO);
+    public void saveAdminUserVO(AdminUserVO adminUserVO,AdminUser adminUser) {
+
+        String sysOrgCode = adminUser.getSysOrgCode();
+
+        QueryWrapper<AdminUser> adminUserQueryWrapper = new QueryWrapper<>();
+        adminUserQueryWrapper.eq("phone",adminUser.getPhone());
+        adminUserQueryWrapper.eq("sys_org_code",sysOrgCode);
+        AdminUser one = adminUserService.getOne(adminUserQueryWrapper);
+        if (null!=one){
+            one.setCard(adminUserVO.getCard());
+            one.setCardholderName(adminUserVO.getName());
+            one.setBackCard(adminUserVO.getBackCard());
+            one.setCardholderPhone(adminUserVO.getCardholderPhone());
+            one.setDwname(adminUserVO.getDwname());
+            one.setKsname(adminUserVO.getKsname());
+            one.setDoctorAndSpecialist(adminUserVO.getDoctorAndSpecialist());
+            one.setCardPic(adminUserVO.getCardPic());
+            this.updateById(one);
+        }
+
     }
 
 

+ 7 - 7
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/controller/APIController.java

@@ -1230,16 +1230,16 @@ public class APIController {
 
 
     @ApiOperation(value = "四要素验证(下发验证码)", notes = "四要素验证(下发验证码)")
-    @GetMapping(value = "perfectInformation")
-    public Result<?> perfectInformation(@RequestBody AdminUserVO adminUser,
-                                        @RequestHeader("Authorization") String Authorization) {
-        return adminUserService.perfectInformation(adminUser, Authorization);
+    @PostMapping(value = "perfectInformation")
+    public Result<?> perfectInformation(@RequestHeader("Authorization") String Authorization,
+                                        @RequestBody AdminUserVO adminUser) {
+        return adminUserService.perfectInformation(adminUser, "");
     }
 
     @ApiOperation(value = "完善个人信息", notes = "完善个人信息")
-    @GetMapping(value = "perfectInformationUpload")
-    public Result<?> perfectInformationUpload(@RequestBody AdminUserVO adminUser,
-                                        @RequestHeader("Authorization") String Authorization) {
+    @PostMapping(value = "perfectInformationUpload")
+    public Result<?> perfectInformationUpload(@RequestHeader("Authorization") String Authorization,
+                                              @RequestBody AdminUserVO adminUser) {
         return adminUserService.perfectInformationUpload(adminUser, Authorization);
     }
 

+ 5 - 0
medical_history/jeecg-boot-module-system/src/main/resources/application-dev.yml

@@ -380,4 +380,9 @@ yzh:
   # 云账户公钥。暂不支持以 -----BEGIN PUBLIC KEY----- 开头和以 -----END PUBLIC KEY----- 结尾的 PEM 格式。如密钥为 PEM 格式,需先删除头部的 -----BEGIN PUBLIC KEY-----、尾部的 -----END PUBLIC KEY----- 和密钥中的换行符
 #  rsa_public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvGRTVW1kq3+utimzm5whwMD2e0ESDp5GPjiPWhAFLwuHDfuEwjHxPprqGL+jln+Bnt+i5dGOiBhj+vYmBwan4Im8gURkHTfLQZf2zX1l3Zlva37RHefgovQe/MwgA1hHu9dQ6Kwa+Sa1TGQj88YwbryPYHaMNlawf9fTTfRxmthPMMyqauPS8E62vhqXRzC1kroP2FBFiOhROqbXfegw+NZFCT1fGqdPppg8w0/1RrZPhv14pUO7W4XycZM783//DlMuHRO36jHOMhz47m5sycIaiHsuo0ktZ/nX2irc4EywUNBdtTORlfQ3KOtz/AJp5zAnIUt1J6jwieG5s1C56wIDAQAB
   rsa_public_key: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDTj9YQ1H51L0IWV6mHa5TasGV7PF1VJu8RniVcGYkcvsyP+d5WzD5UT0BOC8kEJARaPvGTkCnfM36HKtnMHGhb4PIHUc12qb9LN030XQwZBRXGDbODq2m4gXii4dFWgBSg24eBCMAV0ZOuJayNB9M33GjLhXs1FQI2v4sZ0pqLwQIDAQAB
+ip:
+#  测试地址
+  ip: http://59.110.230.108:10001
+#  正式地址
+#  ip: http://47.96.249.184:10001