diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/lakala/LklLedgerMember.java b/mall-common/src/main/java/com/suisung/mall/common/modules/lakala/LklLedgerMember.java index 22ef965e..4617fff7 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/lakala/LklLedgerMember.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/lakala/LklLedgerMember.java @@ -44,6 +44,7 @@ public class LklLedgerMember implements Serializable { private String apply_id; private Integer audit_status; private String audit_status_text; + private String audit_resp; private String remark; private Long mch_id; private String version; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java b/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java index 3737c076..b6e32af2 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/merch/ShopMerchEntry.java @@ -213,6 +213,15 @@ public class ShopMerchEntry implements Serializable { @ApiModelProperty(value = "拉卡拉银联商户号(唯一)") private String lkl_mer_cup_no; + @ApiModelProperty(value = "拉卡拉审核状态:1-已通过;2-未通过") + private Integer lkl_tk_audit_status; + + @ApiModelProperty(value = "拉卡拉进件请求参数") + private String lkl_tk_reg_params; + + @ApiModelProperty(value = "拉卡拉进件成功返回的JSON数据") + private String lkl_tk_reg_resp; + @ApiModelProperty(value = "合同签署状态:0-无任何签署;1-一方签署;2-双方已签署;") private Integer signed_status; diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/RestTemplateHttpUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/RestTemplateHttpUtil.java index aa50bcfa..7a4215f8 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/RestTemplateHttpUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/RestTemplateHttpUtil.java @@ -91,6 +91,22 @@ public class RestTemplateHttpUtil { return response.getBody(); } + public static ResponseEntity sendPostBodyBackEntity(String url, JSONObject headers, JSONObject requestBody, Class responseType) { + HttpHeaders httpHeaders = new HttpHeaders(); + httpHeaders.setContentType(MediaType.MULTIPART_FORM_DATA); + if (headers != null) { + for (Map.Entry entry : headers.entrySet()) { + httpHeaders.add(entry.getKey(), (String) entry.getValue()); + } + } + + httpHeaders.setContentType(MediaType.APPLICATION_JSON); + HttpEntity entity = new HttpEntity<>(requestBody, httpHeaders); + + ResponseEntity response = restTemplate.postForEntity(url, entity, responseType); + return response; + } + /** * 发送带 header 的 POST form-data 请求 * diff --git a/mall-shop/pom.xml b/mall-shop/pom.xml index b21aa70c..1942428b 100644 --- a/mall-shop/pom.xml +++ b/mall-shop/pom.xml @@ -361,6 +361,7 @@ **/*.pem **/*.p12 **/*.cer + **/*.txt @@ -389,6 +390,7 @@ cer pem pfx + txt diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java index e1719698..106a1785 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LakalaController.java @@ -37,7 +37,6 @@ public class LakalaController extends BaseControllerImpl { return str; } - @ApiOperation(value = "获取银行卡的 BIN 信息", notes = "获取银行卡的 BIN 信息") @RequestMapping(value = "/bankCardBin", method = RequestMethod.POST) public JSONObject bankCardBin(@RequestBody JSONObject paramsJSON) { diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java index 0179718f..6f39485f 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/controller/mobile/LklTkController.java @@ -13,6 +13,8 @@ import com.suisung.mall.common.service.impl.BaseControllerImpl; import com.suisung.mall.shop.lakala.service.impl.LklTkServiceImpl; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @@ -32,8 +34,19 @@ public class LklTkController extends BaseControllerImpl { // https://mall.gpxscs.cn/api/mobile/shop/lakala/ledger/applyLedgerMerReceiverBindNotify @ApiOperation(value = "拉卡拉进件申请异步回调通知", notes = "拉卡拉进件申请异步回调通知") @RequestMapping(value = "/registrationMerchantNotify", method = {RequestMethod.POST, RequestMethod.GET}) - public JSONObject registrationMerchantNotify(HttpServletRequest request) { - return lklTkService.registrationMerchantNotify(request); + public ResponseEntity registrationMerchantNotify(HttpServletRequest request) { + JSONObject resp = lklTkService.registrationMerchantNotify(request); + if (resp != null && resp.get("code").equals("200")) { + return new ResponseEntity<>(resp, HttpStatus.OK); + } + + return new ResponseEntity<>(resp, HttpStatus.INTERNAL_SERVER_ERROR); + } + + @ApiOperation(value = "上传文件", notes = "上传文件") + @RequestMapping(value = "/uploadWithOCR", method = {RequestMethod.POST, RequestMethod.GET}) + public JSONObject uploadWithOCR(String fileURL) { + return lklTkService.uploadFileWithOcr("", fileURL, "ID_CARD_FRONT"); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java index 72a88d7b..b8b1587e 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LakalaApiServiceImpl.java @@ -439,7 +439,9 @@ public class LakalaApiServiceImpl implements LakalaApiService { req.setMerInnerNo(paramsJSON.getStr("merInnerNo")); req.setMerCupNo(paramsJSON.getStr("merCupNo")); req.setContactMobile(paramsJSON.getStr("contactMobile")); - req.setSplitLowestRatio(new BigDecimal(paramsJSON.getStr("splitLowestRatio"))); + // 分账比例为了考虑低价订单的运费占比高,分账比例暂时定70%分账给商户,30%分账给平台 + // new BigDecimal(paramsJSON.getStr("splitLowestRatio")) + req.setSplitLowestRatio(BigDecimal.valueOf(70)); String fileName = paramsJSON.getStr("splitEntrustFileName"); req.setSplitEntrustFileName(fileName); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java index c733ef64..acb1f521 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/lakala/service/impl/LklTkServiceImpl.java @@ -32,8 +32,14 @@ import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import javax.crypto.Cipher; import javax.servlet.http.HttpServletRequest; +import java.io.ByteArrayOutputStream; import java.io.File; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; import java.util.HashMap; import java.util.Map; @@ -56,6 +62,9 @@ public class LklTkServiceImpl { @Value("${lakala.org_code}") private String orgCode; + @Value("${lakala.tk.notify_pub_key_path}") + private String notifyPubKeyPath; + @Value("${spring.profiles.active}") private String profile; @@ -65,6 +74,41 @@ public class LklTkServiceImpl { @Autowired private RedisService redisService; + /** + * 拉卡拉异步通知数据公钥解密 + * + * @param pubKey Base64公钥 + * @param data Base64数据 + * @return 解密字符串 + */ + public String decryptNotifyData(String pubKey, String data) { + try { + Base64.Decoder decoder = Base64.getDecoder(); + byte[] keyBytes = decoder.decode(pubKey.getBytes()); + byte[] dataBytes = decoder.decode(data.getBytes()); + Cipher cipher = Cipher.getInstance("RSA"); + PublicKey publicKey = KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(keyBytes)); + cipher.init(Cipher.DECRYPT_MODE, publicKey); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] cache; + for (int i = 0, offset = 0, length = dataBytes.length; length - offset > 0; i++, offset = i * 128) { + if (length - offset > 128) { + cache = cipher.doFinal(dataBytes, offset, 128); + } else { + cache = cipher.doFinal(dataBytes, offset, length - offset); + } + out.write(cache, 0, cache.length); + } + return out.toString(); + } catch (IllegalArgumentException e) { + System.err.println("Base64 解码时出现非法参数异常: " + e.getMessage()); + } catch (Exception e) { + // 捕获其他可能的异常,如 NoSuchAlgorithmException、NoSuchPaddingException、InvalidKeySpecException、InvalidKeyException、BadPaddingException 等 + System.err.println("解密过程中出现异常: " + e.getMessage()); + } + return null; + } + protected String buildLklTkUrl(String urlPath) { return tkServerUrl + urlPath; } @@ -77,6 +121,40 @@ public class LklTkServiceImpl { return "prod".equalsIgnoreCase(profile); } + public JSONObject uploadFileWithOcr(String fileBase64, String fileURL, String imgType) { + String authorization = getLklTkAuthorization(); + if (StrUtil.isBlank(authorization)) { + return JSONUtil.createObj().set("code", 500).set("msg", "获取拉卡拉token失败"); + } + + JSONObject header = new JSONObject(); + header.put("Authorization", authorization); + + String urlPath = "/sit/htkregistration/file/upload"; + if (isProd()) { + urlPath = "/registration/file/upload"; + } + + if (StrUtil.isBlank(fileBase64)) { + fileBase64 = UploadUtil.URLFileToBase64(fileURL); + } + + JSONObject requestBody = new JSONObject(); + requestBody.put("fileBase64", fileBase64); +// requestBody.put("file", fileBase64); + requestBody.put("imgType", imgType); + requestBody.put("sourcechnl", "0"); + requestBody.put("isOcr", "true"); + + + ResponseEntity response = RestTemplateHttpUtil.sendPostBodyBackEntity("https://htkactvi.lakala.com/registration/file/upload", header, requestBody, JSONObject.class); + if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK || response.getBody() == null) { + return null; + } + + return response.getBody(); + } + /** * 请求获取token(商户进件) * @@ -94,7 +172,7 @@ public class LklTkServiceImpl { formData.put("client_id", clientId); formData.put("client_secret", clientSecret); - String response = RestTemplateHttpUtil.sendPostFormData(buildLklTkUrl("/oauth/token"), null, formData, String.class); + String response = RestTemplateHttpUtil.sendPostFormData(buildLklTkUrl("/sit/htkauth/oauth/token"), null, formData, String.class); if (ObjectUtil.isEmpty(response)) { return ""; } @@ -133,7 +211,7 @@ public class LklTkServiceImpl { JSONObject formData = new JSONObject(); formData.put("userNo", "29153396"); - formData.put("email", mchMobile + "@163.com"); + formData.put("email", shopMerchEntry.getEmail()); formData.put("busiCode", "B2B_SYT"); formData.put("merRegName", shopMerchEntry.getStore_name()); @@ -156,7 +234,7 @@ public class LklTkServiceImpl { formData.put("source", "H5"); - formData.put("larIdType", "01"); + formData.put("larIdType", "01"); // 01 身份证 ,02 护照,03 港澳通行证,04 台胞证,10 外国人永久居留身份证,11 港妨澳居民居住证,12 台湾居民居住证,13 执行事务合伙人,99 其它证件 String larName = isQy ? shopMerchEntry.getLegal_person_name() : shopMerchEntry.getContact_name(); String larIdCard = isQy ? shopMerchEntry.getLegal_person_id_number() : shopMerchEntry.getIndividual_id_number(); String larIdCardStart = isQy ? shopMerchEntry.getLegal_person_id_period_begin() : shopMerchEntry.getIndividual_id_period_begin(); @@ -277,9 +355,11 @@ public class LklTkServiceImpl { // 根据入驻商家的代理商或平台方,顺便新增一个接收方记录 - // TODO 新增 lkl_ledger_member 数据, 等待异步审核通知,更改状态 - // String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号 - return Pair.of(true, "进件成功!"); + // 更改入驻记录的拉卡拉内部商户号和进件请求参数 + String merchantNo = response.getBody().getStr("merchantNo"); //拉卡拉内部商户号 + shopMerchEntryService.updateMerchEntryLklMerCupNo(mchMobile, CommonConstant.Disable2, merchantNo, formData.toString()); + + return Pair.of(true, "提交成功待审核!"); } /** @@ -290,12 +370,37 @@ public class LklTkServiceImpl { */ public JSONObject registrationMerchantNotify(HttpServletRequest request) { log.debug("拉卡拉进件异步通知开始"); - // 验签 - String authorization = request.getHeader("Authorization"); - String requestBody = LakalaUtil.getBody(request); - log.debug("分账绑定关系申请业务回调返回参数:{}", requestBody); + JSONObject respData = new JSONObject(); - return new JSONObject().put("body", requestBody); + // 解密请求参数 + String requestBody = LakalaUtil.getBody(request); + log.debug("拉卡拉进件异步通知返回参数:{}", requestBody); + if (StrUtil.isBlank(requestBody)) { + return new JSONObject().set("code", "500").set("message", "返回参数为空"); + } + + JSONObject reqBodyJSON = JSONUtil.parseObj(requestBody); + if (reqBodyJSON.isEmpty() || reqBodyJSON.get("data") == null) { + return new JSONObject().set("code", "500").set("message", "参数格式有误"); + } + + // 公钥解密出来的数据 + String data = decryptNotifyData(notifyPubKeyPath, reqBodyJSON.getStr("data")); + if (StrUtil.isBlank(data)) { + return new JSONObject().set("code", "500").set("message", "参数解密出错"); + } + log.debug("拉卡拉进件异步通知返回解密后的参数:{}", data); + + // 逻辑处理 + JSONObject dataJSON = JSONUtil.parseObj(data); + if (respData.isEmpty() || StrUtil.isBlank(dataJSON.getStr("externalCustomerNo"))) { + return new JSONObject().set("code", "500").set("message", "参数解析出错"); + } + + String externalCustomerNo = dataJSON.getStr("externalCustomerNo"); //拉卡拉外部商户号 + shopMerchEntryService.updateMerchEntryLklAuditStatusByLklMerCupNo(externalCustomerNo, dataJSON.getStr("customerNo"), CommonConstant.Enable, data); + + return new JSONObject().set("code", "200").set("message", "成功"); } /** @@ -329,10 +434,15 @@ public class LklTkServiceImpl { countryName = areaNames[2]; } - String urlPath = "/organization"; - if (isBankArea) { - urlPath = "/organization/bank"; + String urlPath = "/sit/htkregistration/organization"; + if (isProd()) { + urlPath = "/registration/organization"; } + + if (isBankArea) { + urlPath += "/bank"; + } + String authorization = getLklTkAuthorization(); if (StrUtil.isBlank(authorization)) { log.error("获取拉卡拉token失败"); @@ -417,13 +527,16 @@ public class LklTkServiceImpl { formData.put("sourcechnl", "0"); formData.put("isOcr", isOcr); - String urlPath = "/file/upload"; + String urlPath = "/sit/htkregistration/file/upload"; + if (isProd()) { + urlPath = "/registration/file/upload"; + } ResponseEntity response = RestTemplateHttpUtil.sendPostFormDataBackEntity(buildLklTkUrl(urlPath), header, formData, JSONObject.class); if (ObjectUtil.isEmpty(response) || response.getStatusCode() != HttpStatus.OK) { return null; } JSONObject result = response.getBody(); - if (result == null) { + if (result.isEmpty()) { return null; } @@ -433,5 +546,4 @@ public class LklTkServiceImpl { return jsonObject; } - } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java index 0f81f231..d915c228 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopMerchEntryService.java @@ -131,10 +131,24 @@ public interface ShopMerchEntryService { * 更新商家入驻申请的拉卡拉商户号 * * @param loginMobile + * @param lklAuditStatus * @param lklMerCupNo + * @param lklTkRegParams * @return */ - Boolean updateMerchEntryLklMerCupNo(String loginMobile, String lklMerCupNo); + Boolean updateMerchEntryLklMerCupNo(String loginMobile, Integer lklAuditStatus, String lklMerCupNo, String lklTkRegParams); + + /** + * 更新商家入驻申请的拉卡拉审核状态和响应数据 + * + * @param lklMerCupNo + * @param lklInnerMerNo + * @param lklAuditStatus + * @param lklTkRegResp + * @return + */ + Boolean updateMerchEntryLklAuditStatusByLklMerCupNo(String lklMerCupNo, String lklInnerMerNo, Integer lklAuditStatus, String lklTkRegResp); + /** * 更新商家入驻申请的店铺 ID diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java index 4801005b..d09bef9b 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopMerchEntryServiceImpl.java @@ -687,13 +687,51 @@ public class ShopMerchEntryServiceImpl extends BaseServiceImpl updateWrapper = new UpdateWrapper<>(); - updateWrapper.eq("login_mobile", loginMobile).set("lkl_mer_cup_no", lklMerCupNo); + updateWrapper.eq("login_mobile", loginMobile); + if (ObjectUtil.isNotEmpty(lklAuditStatus)) { + updateWrapper.set("lkl_audit_status", lklAuditStatus); + } + if (StrUtil.isNotBlank(lklMerCupNo)) { + updateWrapper.set("lkl_mer_cup_no", lklMerCupNo); + } + if (StrUtil.isNotBlank(lklTkRegParams)) { + updateWrapper.set("lkl_tk_reg_params", lklTkRegParams); + } + return update(updateWrapper); + } + + /** + * 更新商家入驻申请的拉卡拉审核状态和响应数据 + * + * @param lklMerCupNo + * @param lklInnerMerNo + * @param lklAuditStatus + * @param lklTkRegResp + * @return + */ + @Override + public Boolean updateMerchEntryLklAuditStatusByLklMerCupNo(String lklMerCupNo, String lklInnerMerNo, Integer lklAuditStatus, String lklTkRegResp) { + if (StrUtil.isBlank(lklMerCupNo)) { + return false; + } + + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("lkl_mer_cup_no", lklMerCupNo); + if (ObjectUtil.isNotEmpty(lklAuditStatus)) { + updateWrapper.set("lkl_audit_status", lklAuditStatus); + } + if (StrUtil.isNotBlank(lklInnerMerNo)) { + updateWrapper.set("lkl_mer_inner_no", lklInnerMerNo); + } + if (StrUtil.isNotBlank(lklTkRegResp)) { + updateWrapper.set("lkl_tk_reg_resp", lklTkRegResp); + } return update(updateWrapper); } diff --git a/mall-shop/src/main/resources/bootstrap-dev.yml b/mall-shop/src/main/resources/bootstrap-dev.yml index 46679eb3..5d1d3cb7 100644 --- a/mall-shop/src/main/resources/bootstrap-dev.yml +++ b/mall-shop/src/main/resources/bootstrap-dev.yml @@ -169,6 +169,8 @@ lakala: client_secret: XPa1HB5d55Ig0qV8 api_pub_key_path: payKey/lakala/dev/tk_api_public_key.txt api_pri_key_path: payKey/lakala/dev/tk_api_private_key.txt + notify_pub_key_path: payKey/lakala/dev/tk_notify_public_key.txt + notify_pri_key_path: payKey/lakala/dev/tk_notify_private_key.txt #e签宝配置 esign: server_url: https://smlopenapi.esign.cn diff --git a/mall-shop/src/main/resources/bootstrap-local.yml b/mall-shop/src/main/resources/bootstrap-local.yml index 2a6dfea9..a809dd65 100644 --- a/mall-shop/src/main/resources/bootstrap-local.yml +++ b/mall-shop/src/main/resources/bootstrap-local.yml @@ -164,11 +164,13 @@ lakala: # 拉卡拉拓客进件配置 tk: #服务地址 - server_url: https://test.wsmsd.cn/sit/htkauth + server_url: https://test.wsmsd.cn client_id: lsycs client_secret: XPa1HB5d55Ig0qV8 api_pub_key_path: payKey/lakala/dev/tk_api_public_key.txt api_pri_key_path: payKey/lakala/dev/tk_api_private_key.txt + notify_pub_key_path: payKey/lakala/dev/tk_notify_public_key.txt + notify_pri_key_path: payKey/lakala/dev/tk_notify_private_key.txt #e签宝配置 esign: server_url: https://smlopenapi.esign.cn diff --git a/mall-shop/src/main/resources/bootstrap-prod.yml b/mall-shop/src/main/resources/bootstrap-prod.yml index 4a18fc04..e9dea6ae 100644 --- a/mall-shop/src/main/resources/bootstrap-prod.yml +++ b/mall-shop/src/main/resources/bootstrap-prod.yml @@ -196,6 +196,8 @@ lakala: client_secret: XPa1HB5d55Ig0qV8 api_pub_key_path: payKey/lakala/dev/tk_api_public_key.txt api_pri_key_path: payKey/lakala/dev/tk_api_private_key.txt + notify_pub_key_path: payKey/lakala/dev/tk_notify_public_key.txt + notify_pri_key_path: payKey/lakala/dev/tk_notify_private_key.txt #e签宝配置 esign: server_url: https://smlopenapi.esign.cn diff --git a/mall-shop/src/main/resources/bootstrap-test.yml b/mall-shop/src/main/resources/bootstrap-test.yml index 396c824d..f358d360 100644 --- a/mall-shop/src/main/resources/bootstrap-test.yml +++ b/mall-shop/src/main/resources/bootstrap-test.yml @@ -173,6 +173,8 @@ lakala: client_secret: XPa1HB5d55Ig0qV8 api_pub_key_path: payKey/lakala/dev/tk_api_public_key.txt api_pri_key_path: payKey/lakala/dev/tk_api_private_key.txt + notify_pub_key_path: payKey/lakala/dev/tk_notify_public_key.txt + notify_pri_key_path: payKey/lakala/dev/tk_notify_private_key.txt #e签宝配置 esign: server_url: https://smlopenapi.esign.cn diff --git a/mall-shop/src/main/resources/bootstrap-uat.yml b/mall-shop/src/main/resources/bootstrap-uat.yml index 396c824d..f358d360 100644 --- a/mall-shop/src/main/resources/bootstrap-uat.yml +++ b/mall-shop/src/main/resources/bootstrap-uat.yml @@ -173,6 +173,8 @@ lakala: client_secret: XPa1HB5d55Ig0qV8 api_pub_key_path: payKey/lakala/dev/tk_api_public_key.txt api_pri_key_path: payKey/lakala/dev/tk_api_private_key.txt + notify_pub_key_path: payKey/lakala/dev/tk_notify_public_key.txt + notify_pri_key_path: payKey/lakala/dev/tk_notify_private_key.txt #e签宝配置 esign: server_url: https://smlopenapi.esign.cn diff --git a/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml b/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml index 70aef115..1b90db8f 100644 --- a/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml +++ b/mall-shop/src/main/resources/mapper/order/ShopOrderBaseMapper.xml @@ -625,7 +625,9 @@ SELECT ob.order_id, ob.order_time, - oi.order_time + #{expireSeconds}*1000 as arrival_time, + + oi.order_time + #{expireSeconds}*1000 as arrival_time, + ob.order_product_amount, ob.order_payment_amount, ob.currency_id, @@ -714,12 +716,12 @@ - and arrival_time =]]> UNIX_TIMESTAMP() * 1000 + and (oi.order_time + #{expireSeconds}*1000) =]]> UNIX_TIMESTAMP() * 1000 - and arrival_time UNIX_TIMESTAMP() * 1000 + and (oi.order_time + #{expireSeconds}*1000) UNIX_TIMESTAMP() * 1000 diff --git a/mall-shop/src/main/resources/payKey/lakala/dev/tk_api_private_key.txt b/mall-shop/src/main/resources/payKey/lakala/dev/tk_api_private_key.txt new file mode 100644 index 00000000..a17740cc --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/dev/tk_api_private_key.txt @@ -0,0 +1 @@ +MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw== \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/dev/tk_api_public_key.txt b/mall-shop/src/main/resources/payKey/lakala/dev/tk_api_public_key.txt new file mode 100644 index 00000000..7f699e3a --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/dev/tk_api_public_key.txt @@ -0,0 +1 @@ +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/dev/tk_notify_private_key.txt b/mall-shop/src/main/resources/payKey/lakala/dev/tk_notify_private_key.txt new file mode 100644 index 00000000..f8561c8f --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/dev/tk_notify_private_key.txt @@ -0,0 +1 @@ +MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALKb2r7+J9aS9/aiDblUUlkMfU6XdIasmEm/GWVOAoIS+CGV+qItHrZ2uIxbdHGlQY0HBGGnPYNUDGipzQtgrEpzWFXvBkmO1tVLdUE5ZuQ6/6pzFgGJTOi9+ujSKE4hbPbTJ4y+/1qqVLypSV51j7m2QZREns8biKzuxKNRzDZFAgMBAAECgYAXLWtq+n8/9I1x92CRirQu8xR1tOi9qzsN4tsQTtm7eGuzrAs8rV89bVWQfTO0pa3Gd8ElTPcKCkeb82D014Qz4z7sLz3reNeYXay8PbCCegQxUn7xzykwckziydKw4cCBZQkmyCYtUZcyf+C2Z+0dX6dTO3Z7+/se0ndJleAbFwJBAO9omFP3+lxxXQgyv99+IJTRFp+xWZnfjWREU8aZQXy+QU1LYCxMafpaIJMOu4qwo1XwfLKelAuLc2kLQMhrEkcCQQC+/Jie67sp744bw2dBWo8LrghvIaPxkH9Sgkce3qHUPx4cK+tF/GtfujB4kKDhpQb4nEJtLhPEBjslL0bWkc0TAkAoRHBylx/+EncyXM7W+XDjdvOWMo8+iVJPzgpFOhvAroNvS8FGUif1GtmlwnGa1zDx0Hw40uFVu8PSpDjmPNQbAkEAsHBpiv/aVB6kmY+HF8BSwIaR8iEQ9Tz58z6595HTzWJWLc6BN5G/nJtE5k0u4+byrsClOXpE9maPQ4YOmnHuEwJAIEYvcN2Ju3on5wglbH2b9889zzg1P9z/1GbFPpi2kZeOZre2HQfojoU686oGBdvDe0BK6+jgir1hzwfJBB7fvQ== \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/dev/tk_notify_public_key.txt b/mall-shop/src/main/resources/payKey/lakala/dev/tk_notify_public_key.txt new file mode 100644 index 00000000..e035f0f4 --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/dev/tk_notify_public_key.txt @@ -0,0 +1 @@ +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCym9q+/ifWkvf2og25VFJZDH1Ol3SGrJhJvxllTgKCEvghlfqiLR62driMW3RxpUGNBwRhpz2DVAxoqc0LYKxKc1hV7wZJjtbVS3VBOWbkOv+qcxYBiUzovfro0ihOIWz20yeMvv9aqlS8qUledY+5tkGURJ7PG4is7sSjUcw2RQIDAQAB \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/prod/tk_api_private_key.txt b/mall-shop/src/main/resources/payKey/lakala/prod/tk_api_private_key.txt new file mode 100644 index 00000000..a17740cc --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/prod/tk_api_private_key.txt @@ -0,0 +1 @@ +MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw== \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/prod/tk_api_public_key.txt b/mall-shop/src/main/resources/payKey/lakala/prod/tk_api_public_key.txt new file mode 100644 index 00000000..7f699e3a --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/prod/tk_api_public_key.txt @@ -0,0 +1 @@ +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/prod/tk_notify_private_key.txt b/mall-shop/src/main/resources/payKey/lakala/prod/tk_notify_private_key.txt new file mode 100644 index 00000000..f8561c8f --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/prod/tk_notify_private_key.txt @@ -0,0 +1 @@ +MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALKb2r7+J9aS9/aiDblUUlkMfU6XdIasmEm/GWVOAoIS+CGV+qItHrZ2uIxbdHGlQY0HBGGnPYNUDGipzQtgrEpzWFXvBkmO1tVLdUE5ZuQ6/6pzFgGJTOi9+ujSKE4hbPbTJ4y+/1qqVLypSV51j7m2QZREns8biKzuxKNRzDZFAgMBAAECgYAXLWtq+n8/9I1x92CRirQu8xR1tOi9qzsN4tsQTtm7eGuzrAs8rV89bVWQfTO0pa3Gd8ElTPcKCkeb82D014Qz4z7sLz3reNeYXay8PbCCegQxUn7xzykwckziydKw4cCBZQkmyCYtUZcyf+C2Z+0dX6dTO3Z7+/se0ndJleAbFwJBAO9omFP3+lxxXQgyv99+IJTRFp+xWZnfjWREU8aZQXy+QU1LYCxMafpaIJMOu4qwo1XwfLKelAuLc2kLQMhrEkcCQQC+/Jie67sp744bw2dBWo8LrghvIaPxkH9Sgkce3qHUPx4cK+tF/GtfujB4kKDhpQb4nEJtLhPEBjslL0bWkc0TAkAoRHBylx/+EncyXM7W+XDjdvOWMo8+iVJPzgpFOhvAroNvS8FGUif1GtmlwnGa1zDx0Hw40uFVu8PSpDjmPNQbAkEAsHBpiv/aVB6kmY+HF8BSwIaR8iEQ9Tz58z6595HTzWJWLc6BN5G/nJtE5k0u4+byrsClOXpE9maPQ4YOmnHuEwJAIEYvcN2Ju3on5wglbH2b9889zzg1P9z/1GbFPpi2kZeOZre2HQfojoU686oGBdvDe0BK6+jgir1hzwfJBB7fvQ== \ No newline at end of file diff --git a/mall-shop/src/main/resources/payKey/lakala/prod/tk_notify_public_key.txt b/mall-shop/src/main/resources/payKey/lakala/prod/tk_notify_public_key.txt new file mode 100644 index 00000000..e035f0f4 --- /dev/null +++ b/mall-shop/src/main/resources/payKey/lakala/prod/tk_notify_public_key.txt @@ -0,0 +1 @@ +MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCym9q+/ifWkvf2og25VFJZDH1Ol3SGrJhJvxllTgKCEvghlfqiLR62driMW3RxpUGNBwRhpz2DVAxoqc0LYKxKc1hV7wZJjtbVS3VBOWbkOv+qcxYBiUzovfro0ihOIWz20yeMvv9aqlS8qUledY+5tkGURJ7PG4is7sSjUcw2RQIDAQAB \ No newline at end of file