From 97a1bd98d49ea311ae0316a4de47fb4a621b04aa Mon Sep 17 00:00:00 2001 From: YXY <932687738@qq.com> Date: Tue, 10 Oct 2023 23:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=9B=9E=E8=B0=83=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flyingbook/controller/EdiController.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) 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 87418d4..0405e87 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 @@ -4,14 +4,17 @@ import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.constant.RedisConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.enums.FlagStatus; import com.ruoyi.common.utils.PdfUtils; import com.ruoyi.flyingbook.LarkHelper.LarkFileHelper; +import com.ruoyi.flyingbook.domain.ErpLarkTempRelation; import com.ruoyi.flyingbook.domain.EventLog; import com.ruoyi.flyingbook.domain.edi.CJTEdiCallbackRequestVo; import com.ruoyi.flyingbook.domain.edi.EdiResponseVo; import com.ruoyi.flyingbook.domain.edi.SyncToTableRequest; import com.ruoyi.flyingbook.domain.edi.CJTEdiRequestVo; import com.ruoyi.flyingbook.edi.EdiOperateService; +import com.ruoyi.flyingbook.mapper.ErpLarkTempRelationMapper; import com.ruoyi.flyingbook.service.IEventLogService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; @@ -24,6 +27,7 @@ import javax.crypto.Cipher; import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.Date; import java.util.concurrent.TimeUnit; @Slf4j @@ -42,6 +46,8 @@ public class EdiController extends BaseController { private IEventLogService iEventLogService; @Autowired private RedisCache redisCache; + @Autowired + private ErpLarkTempRelationMapper erpLarkTempRelationMapper; /** * 同步数据到飞书表格 @@ -101,9 +107,26 @@ public class EdiController extends BaseController { String voucherCode = bizContent.getString("voucherCode"); CJTEdiCallbackRequestVo cjtEdiCallbackRequestVo = new CJTEdiCallbackRequestVo(msgType, voucherCode); ediOperateService.cjtCallback(cjtEdiCallbackRequestVo); + cacheInfo(jsonObject); } + } + private void cacheInfo(JSONObject jsonObject){ + try { + Date date = new Date(); + ErpLarkTempRelation erpLarkTempRelation = new ErpLarkTempRelation(); + erpLarkTempRelation.setKey(jsonObject.getString("requestId")); + erpLarkTempRelation.setMethod(jsonObject.getString("msgType")); + erpLarkTempRelation.setLarkKey(jsonObject.getString("appId")); + erpLarkTempRelation.setRemark(jsonObject.toJSONString()); + erpLarkTempRelation.setCreateBy("System"); + erpLarkTempRelation.setCreateTime(date); + erpLarkTempRelation.setUpdateTime(date); + erpLarkTempRelation.setFlag(FlagStatus.DELETED.getCode()); + erpLarkTempRelationMapper.insertErpLarkTempRelation(erpLarkTempRelation); + }catch (Exception e){ + } } private String buildUniqueKey(String key, String appKey) {