|
|
@@ -2,6 +2,8 @@ package com.xjrsoft.module.oa.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
@@ -14,11 +16,16 @@ import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedHandleMapper;
|
|
|
import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedMapper;
|
|
|
import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedHandleService;
|
|
|
import com.xjrsoft.module.oa.vo.OfficialDocumentReceivedHandlePageVo;
|
|
|
+import com.xjrsoft.module.organization.dto.WeChatSendMessageDto;
|
|
|
+import com.xjrsoft.module.organization.entity.User;
|
|
|
+import com.xjrsoft.module.organization.mapper.UserMapper;
|
|
|
+import com.xjrsoft.module.organization.service.IWeChatService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -31,6 +38,8 @@ import java.util.List;
|
|
|
@AllArgsConstructor
|
|
|
public class OfficialDocumentReceivedHandleServiceImpl extends MPJBaseServiceImpl<OfficialDocumentReceivedHandleMapper, OfficialDocumentReceivedHandle> implements IOfficialDocumentReceivedHandleService {
|
|
|
private final OfficialDocumentReceivedMapper documentReceivedMapper;
|
|
|
+ private final IWeChatService weChatService;
|
|
|
+ private final UserMapper userMapper;
|
|
|
|
|
|
@Override
|
|
|
public Page<OfficialDocumentReceivedHandlePageVo> getPage(Page<OfficialDocumentReceivedHandlePageVo> page, OfficialDocumentReceivedHandlePageDto dto) {
|
|
|
@@ -84,6 +93,37 @@ public class OfficialDocumentReceivedHandleServiceImpl extends MPJBaseServiceImp
|
|
|
handle.setIsHandle(0);
|
|
|
handle.setIsTransfer(1);
|
|
|
this.save(handle);
|
|
|
+ this.noticeHandleUser(handle);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean noticeHandleUser(OfficialDocumentReceivedHandle handle) {
|
|
|
+ OfficialDocumentReceived documentReceived = documentReceivedMapper.selectById(handle.getOfficialDocumentReceivedId());
|
|
|
+ if(documentReceived.getHandleDutyUserId() != null){
|
|
|
+ User user = userMapper.selectById(handle.getReceiveUserId());
|
|
|
+
|
|
|
+ WeChatSendMessageDto weChatSendMessageDto = new WeChatSendMessageDto();
|
|
|
+ weChatSendMessageDto.setUserId(user.getOpenId());
|
|
|
+ weChatSendMessageDto.setTemplateId("qmpXORPM1Cocqn503Qa4On6BJhR92UZ00eod2-6IcGo");
|
|
|
+ //weChatSendMessageDto.setUrl(StrUtil.format("{}/pages/message/notice/detail?id={}", commonPropertiesConfig.getDomainApp(), id));
|
|
|
+ weChatSendMessageDto.setMsgId(IdUtil.getSnowflakeNextIdStr());
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+
|
|
|
+ JSONObject thing23 = new JSONObject();
|
|
|
+ thing23.put("value", "您有一个收文待处理");
|
|
|
+ data.put("thing23", thing23);
|
|
|
+
|
|
|
+ JSONObject data2 = new JSONObject();
|
|
|
+ data2.put("value", user.getName());
|
|
|
+ data.put("thing29", data2);
|
|
|
+
|
|
|
+ JSONObject data3 = new JSONObject();
|
|
|
+ data3.put("value", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
+ data.put("time17", data3);
|
|
|
+ weChatSendMessageDto.setContent(data);
|
|
|
+ weChatService.sendTemplateMessage(weChatSendMessageDto);
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
}
|