|
|
@@ -1,15 +1,20 @@
|
|
|
package com.doc.biz.controller;
|
|
|
|
|
|
+import com.doc.biz.domain.DocInfo;
|
|
|
import com.doc.biz.domain.DocShare;
|
|
|
+import com.doc.biz.service.IDocInfoService;
|
|
|
import com.doc.biz.service.IDocShareService;
|
|
|
import com.doc.chat.domain.ChatMsg;
|
|
|
import com.doc.chat.service.IChatMsgService;
|
|
|
import com.doc.common.core.controller.BaseController;
|
|
|
import com.doc.common.core.domain.AjaxResult;
|
|
|
import com.doc.common.utils.SecurityUtils;
|
|
|
+import com.doc.sms.TencentSmsService;
|
|
|
+import com.doc.system.service.ISysUserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
+import javafx.util.Pair;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -30,6 +35,10 @@ public class DocShareController extends BaseController {
|
|
|
private IDocShareService docShareService;
|
|
|
@Resource
|
|
|
private IChatMsgService msgService;
|
|
|
+ @Resource
|
|
|
+ private ISysUserService userService;
|
|
|
+ @Resource
|
|
|
+ private IDocInfoService docInfoService;
|
|
|
|
|
|
/**
|
|
|
* 文件分享
|
|
|
@@ -71,6 +80,14 @@ public class DocShareController extends BaseController {
|
|
|
msg.setContent(docId + "");
|
|
|
msg.setFromId(SecurityUtils.getUserId());
|
|
|
msgService.send(msg);
|
|
|
+ Pair<Boolean, String> pair = userService.isOnline(uid);
|
|
|
+ if (!pair.getKey()) {
|
|
|
+ String fromUser = SecurityUtils.getLoginUser().getUser().getNickName();
|
|
|
+ DocInfo docInfo = docInfoService.selectDocInfoByDocId(docId);
|
|
|
+ String fileName = docInfo.getFileName();
|
|
|
+ //如果不在线发送短信
|
|
|
+ TencentSmsService.send(TencentSmsService.FILE_SHARE, fromUser, fileName);
|
|
|
+ }
|
|
|
|
|
|
//添加人员
|
|
|
DocShare share = new DocShare();
|