From 092149f70c076d0a83a009ba4c55726fcba82140 Mon Sep 17 00:00:00 2001 From: YXY <932687738@qq.com> Date: Sat, 21 Oct 2023 17:38:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E6=97=B6=E9=97=B4=E5=86=85=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=92=8C=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=87=B4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/flyingbook/controller/EdiController.java | 12 +++++------- .../strategy/cjt/CJTOperateCallBackAbstract.java | 6 ++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java index 23c4e8a..3e12aff 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/controller/EdiController.java @@ -85,7 +85,11 @@ public class EdiController extends BaseController { // public void receiveCjtTicket(Long id) { // ErpLarkTempRelation erpLarkTempRelation = erpLarkTempRelationMapper.selectErpLarkTempRelationById(id); // JSONObject jsonObject = JSONObject.parseObject(erpLarkTempRelation.getRemark()); -// execeuteByType(jsonObject); +// JSONObject req = new JSONObject(); +// req.put("appKey",erpLarkTempRelation.getLarkKey()); +// req.put("msgType",erpLarkTempRelation.getMethod()); +// req.put("bizContent",jsonObject); +// execeuteByType(req); // } /** @@ -124,12 +128,6 @@ public class EdiController extends BaseController { redisCache.setCacheObject(buildUniqueKey(RedisConstants.CJT_TICKET_CACHE_KEY, appKey), appTicket, 24, TimeUnit.HOURS); } } -// else if ("SaleDispatchVoucher_Delete".equals(msgType)){ -// log.info("畅捷通删除接口回调"); -// String voucherCode = bizContent.getString("voucherCode"); -// CJTEdiCallbackRequestVo cjtEdiCallbackRequestVo = new CJTEdiCallbackRequestVo(msgType, voucherCode); -// ediOperateService.cjtCallback(cjtEdiCallbackRequestVo); -// } else{ cjtOperateCallBackFactory.handle(jsonObject); } diff --git a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/cjt/CJTOperateCallBackAbstract.java b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/cjt/CJTOperateCallBackAbstract.java index 61322a6..8d4acf1 100644 --- a/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/cjt/CJTOperateCallBackAbstract.java +++ b/ruoyi-flyingbook/src/main/java/com/ruoyi/flyingbook/strategy/cjt/CJTOperateCallBackAbstract.java @@ -62,7 +62,7 @@ public abstract class CJTOperateCallBackAbstract { protected static final String REQUEST_ROOT_PATH = "https://openapi.chanjet.com"; public void execute(CJTEdiCallbackRequestVo req) { - String operateCallBackFlag = buildCacheUniqueKey(RedisConstants.CJT_CALLBACK_OPERATE, req.getAppId() + req.getMsgType() + req.getVoucherId()); + String operateCallBackFlag = buildCacheUniqueKey(RedisConstants.CJT_CALLBACK_OPERATE, req.getAppId() + req.getVoucherId()); try { Boolean operateFlag = redisCache.setCacheObjectIfAbsent(operateCallBackFlag, operateCallBackFlag, 10L, TimeUnit.MINUTES); if (!operateFlag) { @@ -228,15 +228,13 @@ public abstract class CJTOperateCallBackAbstract { Map larkBody = buildLarkBody(header, detail, cjtAccountEnum); request.setBody(larkBody); CreateAppTableRecordRespBody respBody = larkTableHelper.addTableRecord(request); + req.setRetry(Boolean.FALSE); String larkKey = respBody.getRecord().getRecordId(); relationList.add(buildErpLarkRelation(uniqueKey, larkKey, cjtAccountEnum.getCode(), toTableId, req.getVoucherId())); } catch (Exception e) { errorList.add(e.getMessage()); } } - if (CollectionUtils.isEmpty(errorList)) { - req.setRetry(Boolean.FALSE); - } if (!org.springframework.util.CollectionUtils.isEmpty(relationList)) { erpLarkRelationMapper.batchInsert(relationList); }