BAOLH
2026-11-10 4d730af0447c686133130d0116a0fa3dd82c2dca
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/approval/service/impl/TemplateControlFieldServiceImpl.java
@@ -37,6 +37,7 @@
import me.zhengjie.modules.approval.service.mapstruct.TemplateControlMapper;
import me.zhengjie.modules.approval.service.mapstruct.TemplateMapper;
import me.zhengjie.modules.constant.Constant;
import me.zhengjie.modules.quartz.service.impl.WeComServiceImpl;
import me.zhengjie.modules.system.domain.Dict;
import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.repository.DictRepository;
@@ -85,6 +86,7 @@
    private final DictService dictService;
    private final DictRepository dictRepository;
    private final DictDetailService dictDetailService;
    private final WeComServiceImpl weComService;
    @Override
    public Map<String,Object> queryAll(TemplateControlFieldQueryCriteria criteria, Pageable pageable){
@@ -202,7 +204,7 @@
            Dict dict = dictRepository.findByName(Constant.WECOM_LEAVE_TYPE);
            // 获取企业微信Token
            wxCpService.getAccessToken(true);
            wxCpService.getAccessToken();
            // 假勤组件需要获取假期相关配置
            WxCpCorpConfInfo corpConfInfo = wxCpService.getOaService().getCorpConf();
            List<DictDetail> newDictDetails = corpConfInfo.getLists().stream().map(m -> {
@@ -227,6 +229,9 @@
            }
        } catch (WxErrorException wxErrorException) {
            wxErrorException.printStackTrace();
            weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "updateWecomVacationType"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            throw new BadRequestException("数据更新异常");
        }
    }
@@ -299,7 +304,7 @@
    public List<String> uploadWecomMediaFile(List<String> filePaths) {
        try {
            // 获取企业微信Token
            wxCpService.getAccessToken(true);
            wxCpService.getAccessToken();
            // 提交临时素材文件
            return filePaths.stream().map(path -> {
@@ -314,6 +319,9 @@
            }).collect(Collectors.toList());
        } catch (Exception e) {
            e.printStackTrace();
            weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "uploadWecomMediaFile"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            throw new BadRequestException("文件上传准备异常");
        }
    }
@@ -780,7 +788,7 @@
            }
            // 获取企业微信Token
            wxCpService.getAccessToken(true);
            wxCpService.getAccessToken();
            // 初始化参数
            WxCpOaApplyEventRequest eventRequest = new WxCpOaApplyEventRequest();
@@ -802,6 +810,9 @@
        } catch (WxErrorException wxErrorException) {
            // 通信失败
            wxErrorException.printStackTrace();
            weComService.sendNotice(Arrays.asList("YueYuHuanXiangQinYuFenDou"), "企微通信异常", String.format("<div class=\"normal\">异常方法:%s</div>" +
                            "<div class=\"highlight\">请前往API服务查看LOG。</div>",
                    "sendApplyEvent"), Constant.WECOM_MESSAGE_TYPE_TEXTCARD);
            resultMap.put("error", "通信失败");
        } catch (IllegalAccessException illegalAccessException) {
            // 解析后数据获取失败