wanglang пре 1 месец
родитељ
комит
2bc3383c91

+ 18 - 18
src/main/java/com/sunxung/factoring/service/smbApi/api/impl/SMBApiServiceImpl.java

@@ -138,7 +138,7 @@ public class SMBApiServiceImpl implements SMBApiService {
 
     @Override
     public ContractSignResp contractSign(SnbContractSign contractSign, ContractSignBizJsonDto contractSignBizJson,
-            String openId) {
+                                         String openId) {
         validateSubParams(contractSignBizJson);
         contractSign.setMerchantId(smbConfiguration.getMerchantId());
         contractSign.setPlatformCode(smbConfiguration.getPlatformCode());
@@ -175,7 +175,7 @@ public class SMBApiServiceImpl implements SMBApiService {
         httpPost.setEntity(multipartEntityBuilder.build());
         HttpResponse response = RequestHelp.httpConnectionManager.getHttpClient().execute(httpPost);
         try (InputStreamReader in = new InputStreamReader(response.getEntity().getContent());
-                BufferedReader bfin = new BufferedReader(in)) {
+             BufferedReader bfin = new BufferedReader(in)) {
             Map<String, Object> respMap = getRespMap(bfin);
             saveLogAsync(transCode, head, respMap);
             if (null != respMap.get("respCode") && !"00000000".equals(respMap.get("respCode"))) {
@@ -220,7 +220,7 @@ public class SMBApiServiceImpl implements SMBApiService {
         loanApplyStatusQuery.setSysCode(smbConfiguration.getSysCode());
         loanApplyStatusQuery.setPlatformCode(smbConfiguration.getPlatformCode());
         loanApplyStatusQuery.setPayoutNo(bizNo);
-      //  loanApplyStatusQuery.setBizNo(bizNo);
+        //  loanApplyStatusQuery.setBizNo(bizNo);
         SnbRequestBean snbRequestBean = new SnbRequestBean();
         snbRequestBean.setPayLoadBean(loanApplyStatusQuery);
         snbRequestBean.setOpenId(openId);
@@ -396,7 +396,7 @@ public class SMBApiServiceImpl implements SMBApiService {
      * 发送业务请求到SMB 仅处理业务请求,不处理业务逻辑 业务逻辑请根据业务需求自行处理
      *
      * @param snbRequestBean smb请求参数
-     * @param bizMap 业务字段 如用来保存日志
+     * @param bizMap         业务字段 如用来保存日志
      * @return SMB返回的数据
      */
     private CommonResponse sendToSmb(SnbRequestBean snbRequestBean, Map<String, Object> bizMap) {
@@ -421,13 +421,13 @@ public class SMBApiServiceImpl implements SMBApiService {
             commonResponse.setRespCode(responseMap.getOrDefault("respCode", "").toString());
             commonResponse.setRespMsg(responseMap.getOrDefault("respMsg", "").toString());
             commonResponse.setAlgorithm(
-                    responseMap.getOrDefault("algorithm", "") == null ? "" : responseMap.get("algorithm").toString());
-            commonResponse.setCharset(responseMap.getOrDefault("charset", "").toString());
-            commonResponse.setSerialNo(responseMap.getOrDefault("serialNo", "").toString());
-            commonResponse.setChannelSerialNo(responseMap.getOrDefault("channelSerialNo", "").toString());
-            commonResponse.setSecretKey(responseMap.getOrDefault("secretKey", "").toString());
-            commonResponse.setSignature(responseMap.getOrDefault("signature", "").toString());
-            commonResponse.setPayload(responseMap.getOrDefault("payload", "").toString());
+                    responseMap.get("algorithm") == null ? "" : responseMap.get("algorithm").toString());
+            commonResponse.setCharset(responseMap.get("charset") == null ? "" : responseMap.get("charset").toString());
+            commonResponse.setSerialNo(responseMap.get("serialNo") == null ? "" : responseMap.get("serialNo").toString());
+            commonResponse.setChannelSerialNo(responseMap.get("channelSerialNo") == null ? "" : responseMap.get("channelSerialNo").toString());
+            commonResponse.setSecretKey(responseMap.get("secretKey") == null ? "" : responseMap.get("secretKey").toString());
+            commonResponse.setSignature(responseMap.get("signature") == null ? "" : responseMap.get("signature").toString());
+            commonResponse.setPayload(responseMap.get("payload") == null ? "" : responseMap.get("payload").toString());
             smbRequestLogPO.setSmbSerialNo(commonResponse.getSerialNo());
             smbRequestLogPO.setRemark(commonResponse.getRespMsg());
             smbRequestLogPO.setResponsePayload(commonResponse.getPayload());
@@ -451,12 +451,12 @@ public class SMBApiServiceImpl implements SMBApiService {
     /**
      * 计算文件摘要
      *
-     * @param fileList 文件列表
+     * @param fileList               文件列表
      * @param multipartEntityBuilder 请求构造器
      * @return 文件摘要map
      */
     private Map<String, String> getFileDigestMap(List<SMBFileUpload> fileList,
-            MultipartEntityBuilder multipartEntityBuilder) {
+                                                 MultipartEntityBuilder multipartEntityBuilder) {
         Map<String, String> fileDigestMap = new HashMap<>();
         for (int i = 0; i < fileList.size(); i++) {
             SMBFileUpload file = fileList.get(i);
@@ -478,8 +478,8 @@ public class SMBApiServiceImpl implements SMBApiService {
 
     /**
      * 下载文件
-     * 
-     * @param fileType 文件类型
+     *
+     * @param fileType       文件类型
      * @param remoteFilePath 远程文件路径
      * @return 下载结果
      */
@@ -500,7 +500,7 @@ public class SMBApiServiceImpl implements SMBApiService {
         if (contentTypeHeader == null
                 || !contentTypeHeader.getValue().startsWith(MimeTypes.MIME_APPLICATION_OCTET_STREAM)) {
             try (InputStreamReader in = new InputStreamReader(response.getEntity().getContent(), InitData.CHARSET_UTF8);
-                    BufferedReader bfin = new BufferedReader(in)) {
+                 BufferedReader bfin = new BufferedReader(in)) {
                 Map<String, Object> responseMap = getRespMap(bfin);
                 saveLogAsync(transCode, head, responseMap);
                 responseMap.put("downloadResult", false);
@@ -546,8 +546,8 @@ public class SMBApiServiceImpl implements SMBApiService {
 
     /**
      * 组装请求报文
-     * 
-     * @param transCode 交易码
+     *
+     * @param transCode  交易码
      * @param payloadMap 业务数据
      * @return 请求报文
      */