|
@@ -1,13 +1,22 @@
|
|
|
package com.xjrsoft.module.oa.service.impl;
|
|
package com.xjrsoft.module.oa.service.impl;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
|
|
import com.xjrsoft.module.oa.entity.OfficialDocumentReceived;
|
|
|
import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedMapper;
|
|
import com.xjrsoft.module.oa.mapper.OfficialDocumentReceivedMapper;
|
|
|
import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
|
|
import com.xjrsoft.module.oa.service.IOfficialDocumentReceivedService;
|
|
|
import com.xjrsoft.module.oa.utils.PostNumberUtil;
|
|
import com.xjrsoft.module.oa.utils.PostNumberUtil;
|
|
|
|
|
+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 lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @title: 公文收文
|
|
* @title: 公文收文
|
|
|
* @Author szs
|
|
* @Author szs
|
|
@@ -19,6 +28,9 @@ import org.springframework.stereotype.Service;
|
|
|
public class OfficialDocumentReceivedServiceImpl extends MPJBaseServiceImpl<OfficialDocumentReceivedMapper, OfficialDocumentReceived> implements IOfficialDocumentReceivedService {
|
|
public class OfficialDocumentReceivedServiceImpl extends MPJBaseServiceImpl<OfficialDocumentReceivedMapper, OfficialDocumentReceived> implements IOfficialDocumentReceivedService {
|
|
|
private final OfficialDocumentReceivedMapper officialDocumentReceivedMapper;
|
|
private final OfficialDocumentReceivedMapper officialDocumentReceivedMapper;
|
|
|
|
|
|
|
|
|
|
+ private final IWeChatService weChatService;
|
|
|
|
|
+ private final UserMapper userMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public String getMaxReceivedNumber() {
|
|
public String getMaxReceivedNumber() {
|
|
|
Integer maxReceivedNumber = officialDocumentReceivedMapper.getMaxReceivedNumber();
|
|
Integer maxReceivedNumber = officialDocumentReceivedMapper.getMaxReceivedNumber();
|
|
@@ -30,4 +42,35 @@ public class OfficialDocumentReceivedServiceImpl extends MPJBaseServiceImpl<Offi
|
|
|
Integer maxReceivedNumber = officialDocumentReceivedMapper.getMaxMeetingNumber();
|
|
Integer maxReceivedNumber = officialDocumentReceivedMapper.getMaxMeetingNumber();
|
|
|
return PostNumberUtil.initMaxPostNumber(maxReceivedNumber, 3);
|
|
return PostNumberUtil.initMaxPostNumber(maxReceivedNumber, 3);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean noticeHandleDutyUser(Long formId) {
|
|
|
|
|
+
|
|
|
|
|
+ OfficialDocumentReceived documentReceived = this.getById(formId);
|
|
|
|
|
+ if(documentReceived.getHandleDutyUserId() != null){
|
|
|
|
|
+ User user = userMapper.selectById(documentReceived.getHandleDutyUserId());
|
|
|
|
|
+
|
|
|
|
|
+ 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;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|