Browse Source

Lpr接口

wanglang 2 months ago
parent
commit
4be5e8a050

BIN
lib/snb-fsos-openapi-citp-0.0.1.jar


+ 8 - 0
src/main/java/com/sunxung/factoring/service/smbApi/api/SMBApiService.java

@@ -158,4 +158,12 @@ public interface SMBApiService {
      * @return 借据查询响应
      */
     List<DuebillQueryResp> duebillQuery(DuebillQuery duebillQuery, String openId);
+
+    /**
+     * Lpr 利率查询
+     * 
+     * @param intRateTerm 利率期限 输入的实际贷款期限,单位必须是M且必须大于0M,例如3M、13M
+     * @return
+     */
+    String smbLprRateQuery(String intRateTerm);
 }

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

@@ -353,6 +353,23 @@ public class SMBApiServiceImpl implements SMBApiService {
         return JSONObject.parseArray(jsonObject.getJSONArray("duebList").toString(), DuebillQueryResp.class);
     }
 
+    @Override
+    public String smbLprRateQuery(String intRateTerm) {
+        LprRateQuery lprRateQuery = new LprRateQuery();
+        lprRateQuery.setMerchantId(smbConfiguration.getMerchantId());
+        lprRateQuery.setProductCode(smbConfiguration.getProductCode());
+        lprRateQuery.setSysCode(smbConfiguration.getSysCode());
+        lprRateQuery.setPlatformCode(smbConfiguration.getPlatformCode());
+        SnbRequestBean snbRequestBean = new SnbRequestBean();
+        snbRequestBean.setPayLoadBean(lprRateQuery);
+        snbRequestBean.setTransCode(TransCodeEnum.LPR_RATE_QUERY.getCode());
+        CommonResponse commonResponse = sendToSmb(snbRequestBean, null);
+        if (!SMBConstants.RESP_SUCCESS.equals(commonResponse.getRespCode())) {
+            throw new ValidatorException(CodeUtil.FAIL, commonResponse.getRespMsg());
+        }
+        return JSON.parseObject(commonResponse.getPayload()).getString("intRate");
+    }
+
     /**
      * 发送业务请求到SMB 仅处理业务请求,不处理业务逻辑 业务逻辑请根据业务需求自行处理
      *

+ 1 - 0
src/main/java/com/sunxung/factoring/service/smbApi/constants/TransCodeEnum.java

@@ -23,6 +23,7 @@ public enum TransCodeEnum {
     ACCOUNT_INFO_QUERY("snb.eloan.ecpms.account.info.query", "账户信息查询V1.0", "smb"),
     REPAY_TRIAL("snb.eloan.ecpms.repay.trial", "还款试算V1.0", "smb"),
     DUEBILL_QUERY("snb.eloan.ecpms.duebill.query", "借据列表查询V1.0", "smb"),
+    LPR_RATE_QUERY("snb.eloan.ecpms.lpr.rate.query", "LPR利率查询V1.0", "smb"),
     ;
 
     TransCodeEnum(String code, String description, String provider){