From 8af79fb451ed4c3396002daa255635d883bb4046 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Tue, 4 Mar 2025 10:30:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=AD=A3=E5=85=83=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E8=B0=83=E7=94=A8=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/1000pjcloudx_thirdparty.sql | 30 ++++ .../constant/ThirdZyBizEnumType.java | 44 ++++++ .../entity/zy/ThirdZyLogEntity.java | 134 ++++++++++++++++++ .../pjcloud-thirdparty-biz/pom.xml | 4 + .../controller/zy/ThirdZyLogController.java | 84 +++++++++++ .../controller/zy/ZySelfController.java | 4 +- .../mapper/zy/ThirdZyLogMapper.java | 11 ++ .../thirdparty/service/ThirdZyLogService.java | 8 ++ .../impl/zy/ThirdZyLogServiceImpl.java | 16 +++ .../service/impl/zy/ZyForeignServiceImpl.java | 33 ++++- .../service/impl/zy/ZyMerServiceImpl.java | 67 +++++++-- .../service/impl/zy/ZySelfServiceImpl.java | 38 ++++- .../service/impl/zy/ZyStrideServiceImpl.java | 49 ++++++- .../resources/mapper/ThirdZyLogMapper.xml | 23 +++ .../admin/service/SysThirdZyService.java | 4 + .../impl/third/SysThirdZyServiceImpl.java | 4 + 16 files changed, 533 insertions(+), 20 deletions(-) create mode 100644 db/1000pjcloudx_thirdparty.sql create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/constant/ThirdZyBizEnumType.java create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/entity/zy/ThirdZyLogEntity.java create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ThirdZyLogController.java create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/mapper/zy/ThirdZyLogMapper.java create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/ThirdZyLogService.java create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ThirdZyLogServiceImpl.java create mode 100644 pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/resources/mapper/ThirdZyLogMapper.xml create mode 100644 pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/SysThirdZyService.java create mode 100644 pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/third/SysThirdZyServiceImpl.java diff --git a/db/1000pjcloudx_thirdparty.sql b/db/1000pjcloudx_thirdparty.sql new file mode 100644 index 00000000..92f7c435 --- /dev/null +++ b/db/1000pjcloudx_thirdparty.sql @@ -0,0 +1,30 @@ +create database `pjcloudx_thirdparty` default character set utf8mb4 collate utf8mb4_general_ci; + +-- ---------------------------- +-- Table structure for third_zy_log +-- ---------------------------- +DROP TABLE IF EXISTS `third_zy_log`; +CREATE TABLE `third_zy_log` +( + `id` bigint NOT NULL COMMENT '主键', + `biz_type` tinytext NOT NULL COMMENT '同步类型', + `biz_id` varchar(2048) NOT NULL COMMENT '同步类型id', + `api_url` text DEFAULT NULL COMMENT 'api url', + `org_res` text DEFAULT NULL COMMENT '原始res', + `encipher_res` text DEFAULT NULL COMMENT '加密res', + `org_req` text DEFAULT NULL COMMENT '原始req', + `encipher_req` text DEFAULT NULL COMMENT '加密req', + `error` text DEFAULT NULL COMMENT '调用错误', + `version` char(64) DEFAULT NULL COMMENT '同步版本格式化为14位字符串,如果是数字不足14位的,前面补0', + `time_consuming` char(64) DEFAULT NULL COMMENT '同步版本格式化为14位字符串,如果是数字不足14位的,前面补0', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + `create_by` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', + `update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人', + `del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '删除时间', + `tenant_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_general_ci + ROW_FORMAT = DYNAMIC COMMENT ='正元日志表'; \ No newline at end of file diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/constant/ThirdZyBizEnumType.java b/pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/constant/ThirdZyBizEnumType.java new file mode 100644 index 00000000..b308675c --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/constant/ThirdZyBizEnumType.java @@ -0,0 +1,44 @@ +package com.bsd.pjcloud.thirdparty.constant; + +import cn.hutool.core.util.ObjectUtil; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.Arrays; + +/** + * 打印状态 + */ +@AllArgsConstructor +@Getter +public enum ThirdZyBizEnumType { + + // 数据同步 + SYNC_DEALER_INFO("10", "商户信息同步"), + SYNC_ENTERPRISE_INFO("20", "已打印"), + SYNC_ACCOUNT_INFO("30", "账户信息同步"), + SYNC_ACC_CLASS_INFO("40", "身份信息同步"), + + // 跨单位交易 + AUTHENTICATION("50", "统一身份验证功能"), + CONSUMPTION("60", "智慧园区通刷平台提供消费接口"), + CORRECT("70", "智慧园区通刷平台提供冲正接口"), + + // 本地一卡通交易数据同步 + SYNC_NATIVE_CARD_INFO("80", "本地一卡通交易数据同步"), + GET_REGION_ID_BY_TOKEN("90", "获取区域编码"), + + // 第三方需提供的接口 + SELF_CHECK_SYSTEM_STATUS("100", "第三方url健康探测"), + SELF_CORRECT("110", "第三方一卡通系统提供冲正接口"), + SELF_PAY("120", "第三方一卡通系统提供扣费接口"), + SELF_GET_TOKEN("130", "第三方提供获取token"), + ; + private final String type; + private final String description; + + public static ThirdZyBizEnumType valueOfByType(String type) { + if (ObjectUtil.isEmpty(type)) return null; + return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get(); + } +} diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/entity/zy/ThirdZyLogEntity.java b/pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/entity/zy/ThirdZyLogEntity.java new file mode 100644 index 00000000..5e8b7f0f --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-api/src/main/java/com/bsd/pjcloud/thirdparty/entity/zy/ThirdZyLogEntity.java @@ -0,0 +1,134 @@ +package com.bsd.pjcloud.thirdparty.entity.zy; + +import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import com.bsd.pjcloud.common.core.util.TenantTable; + +import java.time.LocalDateTime; + +/** + * 正元日志表 + * + * @author dzc + * @date 2025-03-04 09:05:56 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@TenantTable +@TableName("third_zy_log") +@EqualsAndHashCode(callSuper = true) +@Schema(description = "正元日志表") +public class ThirdZyLogEntity extends Model { + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private Long id; + + /** + * 同步类型 + */ + @Schema(description = "同步类型") + private String bizType; + + /** + * api url + */ + @Schema(description = "apiUrl") + private String apiUrl; + + /** + * 同步类型id + */ + @Schema(description = "同步类型id") + private String bizId; + + /** + * 原始res + */ + @Schema(description = "原始res") + private String orgRes; + + /** + * 加密res + */ + @Schema(description = "加密res") + private String encipherRes; + + /** + * 原始req + */ + @Schema(description = "原始req") + private String orgReq; + + /** + * 加密req + */ + @Schema(description = "加密req") + private String encipherReq; + + /** + * 调用错误 + */ + @Schema(description = "调用错误") + private String error; + + /** + * 同步版本格式化为14位字符串,如果是数字不足14位的,前面补0 + */ + @Schema(description = "同步版本格式化为14位字符串,如果是数字不足14位的,前面补0") + private String version; + + /** + * 同步版本格式化为14位字符串,如果是数字不足14位的,前面补0 + */ + @Schema(description = "同步版本格式化为14位字符串,如果是数字不足14位的,前面补0") + private String timeConsuming; + + /** + * 创建人 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description = "创建人") + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + @Schema(description = "创建时间") + private LocalDateTime createTime; + + /** + * 更新人 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description = "更新人") + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @Schema(description = "更新时间") + private LocalDateTime updateTime; + + /** + * 删除时间 + */ + @TableLogic + @TableField(fill = FieldFill.INSERT) + @Schema(description = "删除时间") + private String delFlag; + + /** + * tenantId + */ + @Schema(description = "tenantId") + private Long tenantId; +} \ No newline at end of file diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml b/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml index 66154ccd..cff0d8c5 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/pom.xml @@ -115,6 +115,10 @@ jjwt 0.9.1 + + com.bsd + pjcloud-common-idempotent + diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ThirdZyLogController.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ThirdZyLogController.java new file mode 100644 index 00000000..04f45bca --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ThirdZyLogController.java @@ -0,0 +1,84 @@ +package com.bsd.pjcloud.thirdparty.controller.zy; + +import cn.hutool.core.util.ArrayUtil; +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.bsd.pjcloud.common.core.util.R; +import com.bsd.pjcloud.common.log.annotation.SysLog; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; +import com.bsd.pjcloud.thirdparty.service.ThirdZyLogService; +import org.springframework.security.access.prepost.PreAuthorize; +import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import org.springdoc.core.annotations.ParameterObject; +import org.springframework.http.HttpHeaders; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 正元日志表 + * + * @author dzc + * @date 2025-03-04 09:05:56 + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/third-zy-log") +@Tag(description = "thirdZyLog", name = "正元日志表管理") +@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) +public class ThirdZyLogController { + + private final ThirdZyLogService thirdZyLogService; + + @Operation(summary = "分页查询", description = "分页查询") + @GetMapping("/page") + @PreAuthorize("@pms.hasPermission('third_thirdZyLog_view')") + public R getThirdZyLogPage(@ParameterObject Page page, @ParameterObject ThirdZyLogEntity thirdZyLog) { + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); + return R.ok(thirdZyLogService.page(page, wrapper)); + } + + @Operation(summary = "通过id查询", description = "通过id查询") + @GetMapping("/{id}") + @PreAuthorize("@pms.hasPermission('third_thirdZyLog_view')") + public R getById(@PathVariable("id") Long id) { + return R.ok(thirdZyLogService.getById(id)); + } + + @Operation(summary = "新增正元日志表", description = "新增正元日志表") + @SysLog("新增正元日志表") + @PostMapping + @PreAuthorize("@pms.hasPermission('third_thirdZyLog_add')") + public R save(@RequestBody ThirdZyLogEntity thirdZyLog) { + return R.ok(thirdZyLogService.save(thirdZyLog)); + } + + @Operation(summary = "修改正元日志表", description = "修改正元日志表") + @SysLog("修改正元日志表") + @PutMapping + @PreAuthorize("@pms.hasPermission('third_thirdZyLog_edit')") + public R updateById(@RequestBody ThirdZyLogEntity thirdZyLog) { + return R.ok(thirdZyLogService.updateById(thirdZyLog)); + } + + @Operation(summary = "通过id删除正元日志表", description = "通过id删除正元日志表") + @SysLog("通过id删除正元日志表") + @DeleteMapping + @PreAuthorize("@pms.hasPermission('third_thirdZyLog_del')") + public R removeById(@RequestBody Long[] ids) { + return R.ok(thirdZyLogService.removeBatchByIds(CollUtil.toList(ids))); + } + + @ResponseExcel + @GetMapping("/export") + @PreAuthorize("@pms.hasPermission('third_thirdZyLog_export')") + public List export(ThirdZyLogEntity thirdZyLog, Long[] ids) { + return thirdZyLogService.list(Wrappers.lambdaQuery(thirdZyLog).in(ArrayUtil.isNotEmpty(ids), ThirdZyLogEntity::getId, ids)); + } +} \ No newline at end of file diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ZySelfController.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ZySelfController.java index 47e457af..d941e6ab 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ZySelfController.java +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/controller/zy/ZySelfController.java @@ -1,5 +1,6 @@ package com.bsd.pjcloud.thirdparty.controller.zy; +import com.bsd.pjcloud.common.idempotent.annotation.Idempotent; import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfCorrectDto; import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfGetTokenDto; import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfPayDto; @@ -14,7 +15,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.http.HttpHeaders; import org.springframework.web.bind.annotation.*; -import java.util.Date; import java.util.Map; @RestController @@ -28,6 +28,7 @@ public class ZySelfController { @GetMapping("/checkSystemStatus") @Operation(summary = "第三方url健康探测", description = "第三方url健康探测") + @Idempotent(expireTime = 10, info = "请勿重复调用") public Map checkSystemStatus() { return zySelfService.checkSystemStatus(); } @@ -47,6 +48,7 @@ public class ZySelfController { @PostMapping("/getToken") @Operation(summary = "第三方一卡通系统提供扣费接口", description = "第三方一卡通系统提供扣费接口") + @Idempotent(expireTime = 10, info = "请勿重复调用") public ZySelfPayVo pay(@RequestBody ZySelfPayDto params, @RequestParam(value = "access_token", required = false) String accessToken) { return zySelfService.pay(params, accessToken); } diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/mapper/zy/ThirdZyLogMapper.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/mapper/zy/ThirdZyLogMapper.java new file mode 100644 index 00000000..c9c517c7 --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/mapper/zy/ThirdZyLogMapper.java @@ -0,0 +1,11 @@ +package com.bsd.pjcloud.thirdparty.mapper.zy; + +import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ThirdZyLogMapper extends PjcloudBaseMapper { + + +} \ No newline at end of file diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/ThirdZyLogService.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/ThirdZyLogService.java new file mode 100644 index 00000000..1340bfd8 --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/ThirdZyLogService.java @@ -0,0 +1,8 @@ +package com.bsd.pjcloud.thirdparty.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; + +public interface ThirdZyLogService extends IService { + +} \ No newline at end of file diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ThirdZyLogServiceImpl.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ThirdZyLogServiceImpl.java new file mode 100644 index 00000000..289ed9fd --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ThirdZyLogServiceImpl.java @@ -0,0 +1,16 @@ +package com.bsd.pjcloud.thirdparty.service.impl.zy; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; +import com.bsd.pjcloud.thirdparty.mapper.zy.ThirdZyLogMapper; +import com.bsd.pjcloud.thirdparty.service.ThirdZyLogService; +import org.springframework.stereotype.Service; +/** + * 正元日志表 + * + * @author dzc + * @date 2025-03-04 09:05:56 + */ +@Service +public class ThirdZyLogServiceImpl extends ServiceImpl implements ThirdZyLogService { +} \ No newline at end of file diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyForeignServiceImpl.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyForeignServiceImpl.java index e8775f4b..0a81561b 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyForeignServiceImpl.java +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyForeignServiceImpl.java @@ -5,8 +5,8 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.http.HttpRequest; import cn.hutool.json.JSONUtil; import com.bsd.pjcloud.thirdparty.config.ZyConfig; -import com.bsd.pjcloud.thirdparty.dto.zy.foreign.ZyForeignGetRegionIdByTokenDto; import com.bsd.pjcloud.thirdparty.dto.zy.foreign.ZyForeignSyncNativeCardTradeInfoDto; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; import com.bsd.pjcloud.thirdparty.service.impl.ZyForeignService; import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApi; import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApiTool; @@ -18,6 +18,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -33,17 +34,24 @@ public class ZyForeignServiceImpl implements ZyForeignService { private final ZyApiTool zyApiTool; + private final ThirdZyLogServiceImpl thirdZyLogService; + /** * 本地一卡通交易数据同步 */ @Override public ZyForeignSyncNativeCardTradeInfoVo syncNativeCardTradeInfoApi(ZyForeignSyncNativeCardTradeInfoDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Foreign.SYNC_NATIVE_CARD_TRADE_INFO; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("regionCode", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -51,13 +59,21 @@ public class ZyForeignServiceImpl implements ZyForeignService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyForeignSyncNativeCardTradeInfoVo vo = JSONUtil.toBean(res, ZyForeignSyncNativeCardTradeInfoVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||syncNativeCardTradeInfoApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||syncNativeCardTradeInfoApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } @@ -67,13 +83,17 @@ public class ZyForeignServiceImpl implements ZyForeignService { */ @Override public ZyForeignGetRegionIdByTokenVo.VoData getRegionIdByToken() { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Foreign.GET_REGION_ID_BY_TOKEN; try { url = String.format(url, zyApiTool.getToken()); + entity.setApiUrl(url); String res = HttpRequest.get(url).execute().body(); if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyBaseEncryptVo baseEncryptVo = JSONUtil.toBean(res, ZyBaseEncryptVo.class); if (ObjectUtil.isEmpty(baseEncryptVo)) { throw new RuntimeException(String.format("解密错误res|%s|url|%s|res|%s|", res, url, baseEncryptVo)); @@ -83,9 +103,16 @@ public class ZyForeignServiceImpl implements ZyForeignService { } String json = Base64.decodeStr(baseEncryptVo.getData()); ZyForeignGetRegionIdByTokenVo.VoData vo = JSONUtil.toBean(json, ZyForeignGetRegionIdByTokenVo.VoData.class); + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||getRegionIdByToken|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||getRegionIdByToken|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyMerServiceImpl.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyMerServiceImpl.java index 6b84d152..5ccaf90d 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyMerServiceImpl.java +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyMerServiceImpl.java @@ -9,6 +9,7 @@ import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccClassInfoDto; import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncAccountInfoDto; import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncDealerInfoDto; import com.bsd.pjcloud.thirdparty.dto.zy.mer.ZyMerSyncEnterpriseInfoDto; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; import com.bsd.pjcloud.thirdparty.service.impl.ZyMerService; import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApi; import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApiTool; @@ -18,10 +19,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Service @Validated @@ -35,11 +33,15 @@ public class ZyMerServiceImpl implements ZyMerService { private final ZyApiTool zyApiTool; + private final ThirdZyLogServiceImpl thirdZyLogService; + /** * 商户信息同步 */ @Override public ZyMerSyncDealerInfoVo syncDealerInfoApi(List dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); if (ObjectUtil.isEmpty(dto)) { return null; } @@ -53,7 +55,10 @@ public class ZyMerServiceImpl implements ZyMerService { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("dealers", listMap); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .contentType("application/x-www-form-urlencoded") .body(body) @@ -62,13 +67,20 @@ public class ZyMerServiceImpl implements ZyMerService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyMerSyncDealerInfoVo vo = JSONUtil.toBean(res, ZyMerSyncDealerInfoVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||syncDealerInfoApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||syncNativeCardTradeInfoApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } @@ -78,12 +90,17 @@ public class ZyMerServiceImpl implements ZyMerService { */ @Override public ZyMerSyncEnterpriseInfoVo syncEnterpriseInfoApi(ZyMerSyncEnterpriseInfoDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_ENTERPRISE_INFO; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("enterprises", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -91,13 +108,21 @@ public class ZyMerServiceImpl implements ZyMerService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyMerSyncEnterpriseInfoVo vo = JSONUtil.toBean(res, ZyMerSyncEnterpriseInfoVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||syncEnterpriseInfoApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||syncEnterpriseInfoApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } @@ -107,12 +132,17 @@ public class ZyMerServiceImpl implements ZyMerService { */ @Override public ZyMerSyncAccountInfoVo syncAccountInfoApi(ZyMerSyncAccountInfoDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_ACCOUNT_INFO; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("accounts", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -120,13 +150,21 @@ public class ZyMerServiceImpl implements ZyMerService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyMerSyncAccountInfoVo vo = JSONUtil.toBean(res, ZyMerSyncAccountInfoVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||syncAccountInfoApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||syncAccountInfoApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + }finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } @@ -136,12 +174,17 @@ public class ZyMerServiceImpl implements ZyMerService { */ @Override public ZyMerSyncAccClassInfoVo syncAccClassInfoApi(ZyMerSyncAccClassInfoDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Mer.SYNC_ACC_CLASS_INFO; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("accClasses", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -149,13 +192,21 @@ public class ZyMerServiceImpl implements ZyMerService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyMerSyncAccClassInfoVo vo = JSONUtil.toBean(res, ZyMerSyncAccClassInfoVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||syncAccClassInfoApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||syncAccClassInfoApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + }finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZySelfServiceImpl.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZySelfServiceImpl.java index fc0b0009..1d69ac21 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZySelfServiceImpl.java +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZySelfServiceImpl.java @@ -10,7 +10,9 @@ import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfCorrectDto; import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfGetTokenDto; import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfPayDto; import com.bsd.pjcloud.thirdparty.dto.zy.self.ZySelfTokenDto; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; import com.bsd.pjcloud.thirdparty.service.impl.ZySelfService; +import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApi; import com.bsd.pjcloud.thirdparty.vo.zy.ZyBaseVo; import com.bsd.pjcloud.thirdparty.vo.zy.self.ZySelfCorrectVo; import com.bsd.pjcloud.thirdparty.vo.zy.self.ZySelfGetTokenVo; @@ -24,6 +26,7 @@ import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -41,15 +44,31 @@ public class ZySelfServiceImpl implements ZySelfService { private final StringRedisTemplate redisTemplate; + private final ThirdZyLogServiceImpl thirdZyLogService; + /** * 第三方url健康探测 */ @Override public Map checkSystemStatus() { - String systemTime = DateUtil.formatDateTime(new Date()); - Map result = Map.of("systemTime", systemTime); - log.info("|{}|checkSystemStatus res|{}|", TAG, JSONUtil.toJsonStr(result)); - return result; + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + entity.setApiUrl(ZyApi.Self.CHECK_SYSTEM_STATUS); + long startTime = System.currentTimeMillis(); + try { + String systemTime = DateUtil.formatDateTime(new Date()); + Map result = Map.of("systemTime", systemTime); + log.info("|{}|checkSystemStatus res|{}|", TAG, JSONUtil.toJsonStr(result)); + return result; + } catch (Exception e) { + String error = String.format("|%s||checkSystemStatus|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + return null; + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); + } } /** @@ -90,6 +109,9 @@ public class ZySelfServiceImpl implements ZySelfService { */ @Override public ZySelfGetTokenVo getToken(ZySelfGetTokenDto params) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + entity.setApiUrl(ZyApi.Self.GET_TOKEN); + long startTime = System.currentTimeMillis(); ZySelfGetTokenVo result = new ZySelfGetTokenVo(); result.setCode(ZyBaseVo.errorCode); if (ObjectUtil.isEmpty(params.getAppid()) || ObjectUtil.equals(params.getAppid(), zyConfig.getSelfAppId())) { @@ -110,9 +132,15 @@ public class ZySelfServiceImpl implements ZySelfService { result.setExpires_in(zyConfig.getSelfExpiresIn().toString()); return result; } catch (Exception e) { - log.error("|{}|getToken意外的错误dto|{}|error|{}|stack|{}|", TAG, JSONUtil.toJsonStr(params), e.getMessage(), e.getStackTrace()); + String error = String.format("|%s||getToken|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); result.setMsg(ZyBaseVo.defaultErrorMsg); return result; + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } } diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyStrideServiceImpl.java b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyStrideServiceImpl.java index ad8c5c93..84112c0f 100644 --- a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyStrideServiceImpl.java +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/java/com/bsd/pjcloud/thirdparty/service/impl/zy/ZyStrideServiceImpl.java @@ -7,6 +7,7 @@ import com.bsd.pjcloud.thirdparty.config.ZyConfig; import com.bsd.pjcloud.thirdparty.dto.zy.stride.ZyStrideAuthenticationDto; import com.bsd.pjcloud.thirdparty.dto.zy.stride.ZyStrideConsumptionDto; import com.bsd.pjcloud.thirdparty.dto.zy.stride.ZyStrideCorrectDto; +import com.bsd.pjcloud.thirdparty.entity.zy.ThirdZyLogEntity; import com.bsd.pjcloud.thirdparty.service.impl.ZyStrideService; import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApi; import com.bsd.pjcloud.thirdparty.utils.zy.api.ZyApiTool; @@ -19,6 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -34,17 +36,24 @@ public class ZyStrideServiceImpl implements ZyStrideService { private final ZyApiTool zyApiTool; + private final ThirdZyLogServiceImpl thirdZyLogService; + /** * 统一身份验证功能 */ @Override public ZyStrideAuthenticationVo authenticationApi(ZyStrideAuthenticationDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Stride.AUTHENTICATION; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("dealers", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -52,13 +61,21 @@ public class ZyStrideServiceImpl implements ZyStrideService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyStrideAuthenticationVo vo = JSONUtil.toBean(res, ZyStrideAuthenticationVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||authenticationApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||authenticationApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } @@ -68,12 +85,17 @@ public class ZyStrideServiceImpl implements ZyStrideService { */ @Override public ZyStrideConsumptionVo consumptionApi(ZyStrideConsumptionDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Stride.CONSUMPTION; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("dealers", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -81,13 +103,21 @@ public class ZyStrideServiceImpl implements ZyStrideService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyStrideConsumptionVo vo = JSONUtil.toBean(res, ZyStrideConsumptionVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||consumptionApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||syncNativeCardTradeInfoApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } @@ -97,12 +127,17 @@ public class ZyStrideServiceImpl implements ZyStrideService { */ @Override public ZyStrideCorrectVo correctApi(ZyStrideCorrectDto dto) { + ThirdZyLogEntity entity = new ThirdZyLogEntity(); + long startTime = System.currentTimeMillis(); String url = zyConfig.getBaseUrl() + ZyApi.Stride.CORRECT; try { url = String.format(url, zyApiTool.getToken()); Map encryptionBody = new HashMap<>(); encryptionBody.put("dealers", dto); + entity.setApiUrl(url); + entity.setOrgReq(JSONUtil.toJsonStr(encryptionBody)); String body = zyApiTool.getEncryptionDto(encryptionBody); + entity.setEncipherReq(body); String res = HttpRequest.post(url) .body(body) .execute() @@ -110,13 +145,21 @@ public class ZyStrideServiceImpl implements ZyStrideService { if (ObjectUtil.isEmpty(res)) { throw new RuntimeException("response is empty"); } + entity.setEncipherRes(res); ZyStrideCorrectVo vo = JSONUtil.toBean(res, ZyStrideCorrectVo.class); if (!vo.isSuccess()) { throw new RuntimeException(String.format("请求错误res|%s|url|%s|body|%s|", res, url, body)); } + entity.setOrgRes(JSONUtil.toJsonStr(vo)); return vo; } catch (Exception e) { - log.error("|{}||correctApi|意外的错误error|{}|", TAG, e.getMessage()); + String error = String.format("|%s||correctApi|意外的错误error|%s|stack|%s|", TAG, e.getMessage(), Arrays.toString(e.getStackTrace())); + log.error(error); + entity.setError(error); + } finally { + long elapsedTime = System.currentTimeMillis() - startTime; + entity.setTimeConsuming(Long.toString(elapsedTime)); + thirdZyLogService.save(entity); } return null; } diff --git a/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/resources/mapper/ThirdZyLogMapper.xml b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/resources/mapper/ThirdZyLogMapper.xml new file mode 100644 index 00000000..1f2eba52 --- /dev/null +++ b/pjcloud-thirdparty/pjcloud-thirdparty-biz/src/main/resources/mapper/ThirdZyLogMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/SysThirdZyService.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/SysThirdZyService.java new file mode 100644 index 00000000..923adab8 --- /dev/null +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/SysThirdZyService.java @@ -0,0 +1,4 @@ +package com.bsd.pjcloud.admin.service; + +public interface SysThirdZyService { +} diff --git a/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/third/SysThirdZyServiceImpl.java b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/third/SysThirdZyServiceImpl.java new file mode 100644 index 00000000..1ffc0a1a --- /dev/null +++ b/pjcloud-upms/pjcloud-upms-biz/src/main/java/com/bsd/pjcloud/admin/service/impl/third/SysThirdZyServiceImpl.java @@ -0,0 +1,4 @@ +package com.bsd.pjcloud.admin.service.impl.third; + +public class SysThirdZyServiceImpl { +}