|
@@ -10,6 +10,7 @@ import com.usky.oa.mapper.OaFormDefinitionMapper;
|
|
import com.usky.oa.mapper.SysUserMapper;
|
|
import com.usky.oa.mapper.SysUserMapper;
|
|
import com.usky.oa.service.enums.OaBuiltInDocument;
|
|
import com.usky.oa.service.enums.OaBuiltInDocument;
|
|
import com.usky.system.RemoteMceService;
|
|
import com.usky.system.RemoteMceService;
|
|
|
|
+import com.usky.system.domain.MceRequestVO;
|
|
import com.usky.system.domain.SysUser;
|
|
import com.usky.system.domain.SysUser;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -49,44 +50,59 @@ public class OaSendMessageCenter {
|
|
* 异步发送消息
|
|
* 异步发送消息
|
|
*
|
|
*
|
|
* @param username 提交人账号名
|
|
* @param username 提交人账号名
|
|
- * @param submitterId 提交人id
|
|
|
|
|
|
+ * @param approvalUid 审批人userId
|
|
* @param id 数据id
|
|
* @param id 数据id
|
|
* @param receivers 接收人userId集合
|
|
* @param receivers 接收人userId集合
|
|
* @param isPass 是否通过(0:不通过,1:通过)
|
|
* @param isPass 是否通过(0:不通过,1:通过)
|
|
|
|
+ * @param sign 申请单类型
|
|
*/
|
|
*/
|
|
@Async
|
|
@Async
|
|
- public void sendAsyncMessage(String username, Long submitterId, Integer id, List<Long> receivers, Integer isPass, String sign) {
|
|
|
|
|
|
+ public void sendAsyncMessage(String username, Long approvalUid, Integer id, List<Long> receivers, Integer isPass, String sign) {
|
|
|
|
|
|
log.info(username + "的申请开始发送消息中心-----------------------------------");
|
|
log.info(username + "的申请开始发送消息中心-----------------------------------");
|
|
|
|
|
|
LambdaQueryWrapper<SysUser> nickNameQuery = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<SysUser> nickNameQuery = Wrappers.lambdaQuery();
|
|
nickNameQuery.select(SysUser::getNickName)
|
|
nickNameQuery.select(SysUser::getNickName)
|
|
- .eq(SysUser::getUserId, submitterId);
|
|
|
|
- SysUser nickName = sysUserMapper.selectOne(nickNameQuery);
|
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
|
- jsonObject.put("infoTitle", INFO_TITLE);
|
|
|
|
|
|
+ .eq(SysUser::getUserId, approvalUid);
|
|
|
|
+ SysUser user = sysUserMapper.selectOne(nickNameQuery);
|
|
|
|
+
|
|
|
|
+ // JSONObject jsonObject = new JSONObject();
|
|
|
|
+ // jsonObject.put("infoTitle", INFO_TITLE);
|
|
|
|
+
|
|
|
|
+ MceRequestVO mceRequestVO = new MceRequestVO();
|
|
|
|
+ mceRequestVO.setInfoTitle(INFO_TITLE);
|
|
|
|
|
|
switch (isPass) {
|
|
switch (isPass) {
|
|
case 0:
|
|
case 0:
|
|
- jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_FAIL);
|
|
|
|
|
|
+ // jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_FAIL);
|
|
|
|
+ mceRequestVO.setInfoContent(user.getNickName() + INFO_APPROVE_FAIL);
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_SUCCESS);
|
|
|
|
|
|
+ // jsonObject.put("infoContent", nickName.getNickName() + INFO_APPROVE_SUCCESS);
|
|
|
|
+ mceRequestVO.setInfoContent(user.getNickName() + INFO_APPROVE_SUCCESS);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
OaBuiltInDocument oaBuiltInDocument = OaBuiltInDocument.valueOf(sign);
|
|
OaBuiltInDocument oaBuiltInDocument = OaBuiltInDocument.valueOf(sign);
|
|
String name = oaBuiltInDocument.getName();
|
|
String name = oaBuiltInDocument.getName();
|
|
- jsonObject.put("infoContent", nickName.getNickName() + "的" + name + INFO_CONTENT);
|
|
|
|
|
|
+ // jsonObject.put("infoContent", username + "的" + name + INFO_CONTENT);
|
|
|
|
+ mceRequestVO.setInfoContent(username + "的" + name + INFO_CONTENT);
|
|
}
|
|
}
|
|
|
|
|
|
- jsonObject.put("infoType", INFO_TYPE);
|
|
|
|
- jsonObject.put("id", id);
|
|
|
|
- jsonObject.put("infoTypeName", INFO_TITLE);
|
|
|
|
- jsonObject.put("userName", username);
|
|
|
|
- jsonObject.put("userIds", receivers);
|
|
|
|
|
|
+ // jsonObject.put("infoType", INFO_TYPE);
|
|
|
|
+ // jsonObject.put("id", id);
|
|
|
|
+ // jsonObject.put("infoTypeName", INFO_TITLE);
|
|
|
|
+ // jsonObject.put("userName", username);
|
|
|
|
+ // jsonObject.put("userIds", receivers);
|
|
|
|
+
|
|
|
|
+ mceRequestVO.setInfoType(String.valueOf(INFO_TYPE));
|
|
|
|
+ mceRequestVO.setId(id);
|
|
|
|
+ mceRequestVO.setInfoTypeName(INFO_TITLE);
|
|
|
|
+ mceRequestVO.setUserName(username);
|
|
|
|
+ mceRequestVO.setUserIds(receivers);
|
|
try {
|
|
try {
|
|
// 推送消息中心
|
|
// 推送消息中心
|
|
- ApiResult<Void> voidApiResult = remoteMceService.addMce(jsonObject.toString());
|
|
|
|
|
|
+ //ApiResult<Void> voidApiResult = remoteMceService.addMce(jsonObject.toString());
|
|
|
|
+ ApiResult<Void> voidApiResult = remoteMceService.addMceReceive(mceRequestVO);
|
|
|
|
|
|
if (voidApiResult.isSuccess()) {
|
|
if (voidApiResult.isSuccess()) {
|
|
log.info("申请消息发送成功!");
|
|
log.info("申请消息发送成功!");
|