|
@@ -0,0 +1,59 @@
|
|
|
+package com.fdkankan.contro.service.impl;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.fdkankan.contro.entity.LocalFdageLog;
|
|
|
+import com.fdkankan.contro.mapper.ILocalFdageLogMapper;
|
|
|
+import com.fdkankan.contro.service.ILocalFdageLogService;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fdkankan.contro.vo.LocalfdageLogParamVo;
|
|
|
+import com.fdkankan.dingtalk.DingTalkSendUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 四维看看本地版问题上报表 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author
|
|
|
+ * @since 2025-09-19
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class LocalFdageLogServiceImpl extends ServiceImpl<ILocalFdageLogMapper, LocalFdageLog> implements ILocalFdageLogService {
|
|
|
+
|
|
|
+ @Value("${localfdage:dingding.access-token:xxxxxx}")
|
|
|
+ private String localfdageAccessToken;
|
|
|
+ @Value("${localfdage:dingding.access-secret:xxxxxx}")
|
|
|
+ private String localfdageAccessSecret;
|
|
|
+
|
|
|
+ @Value("${env:gn}")
|
|
|
+ private String env;
|
|
|
+ @Resource
|
|
|
+ private DingTalkSendUtils dingTalkSendUtils;
|
|
|
+
|
|
|
+ public static final String DINGTALK_MSG_PATTERN =
|
|
|
+ "**环境**: %s\n\n" +
|
|
|
+ "**联系方式**: %s\n\n" +
|
|
|
+ "**场景名称**: %s\n\n" +
|
|
|
+ "**场景码**: %s\n\n" +
|
|
|
+ "**本地路径**: %s\n\n" +
|
|
|
+ "**云端路径**: %s\n\n";
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void noticeLocalfdageLogs(LocalfdageLogParamVo param) throws Exception {
|
|
|
+ LocalFdageLog log = BeanUtil.toBean(param, LocalFdageLog.class);
|
|
|
+ this.save(log);
|
|
|
+ String content = String.format(DINGTALK_MSG_PATTERN,
|
|
|
+ env.equals("gn") ? "中国区" : "非中国区",
|
|
|
+ log.getContact(),
|
|
|
+ log.getSceneName(),
|
|
|
+ log.getSceneCode(),
|
|
|
+ log.getLocalPath(),
|
|
|
+ log.getCloudPath());
|
|
|
+ dingTalkSendUtils.sendActioncardMsgToDingRobot(localfdageAccessToken, localfdageAccessSecret, content, "本地版问题上报");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|