| | |
| | | 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; |
| | |
| | | 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){ |
| | |
| | | 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 -> { |
| | |
| | | } |
| | | } 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("数据更新异常"); |
| | | } |
| | | } |
| | |
| | | public List<String> uploadWecomMediaFile(List<String> filePaths) { |
| | | try { |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(true); |
| | | wxCpService.getAccessToken(); |
| | | |
| | | // 提交临时素材文件 |
| | | return filePaths.stream().map(path -> { |
| | |
| | | }).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("文件上传准备异常"); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | // 获取企业微信Token |
| | | wxCpService.getAccessToken(true); |
| | | wxCpService.getAccessToken(); |
| | | // 初始化参数 |
| | | WxCpOaApplyEventRequest eventRequest = new WxCpOaApplyEventRequest(); |
| | | |
| | |
| | | } 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) { |
| | | // 解析后数据获取失败 |