|
@@ -4,9 +4,13 @@ import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
+import com.fs.company.service.impl.CompanyDeptServiceImpl;
|
|
|
+import com.fs.framework.security.LoginUser;
|
|
|
import com.fs.framework.service.TokenService;
|
|
|
import com.fs.qw.param.QwGroupChatParam;
|
|
|
import com.fs.qw.service.IQwGroupChatService;
|
|
|
+import com.fs.qw.service.IQwUserService;
|
|
|
import com.fs.qw.vo.QwGroupChatOptionsVO;
|
|
|
import com.fs.qw.vo.QwGroupChatVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -16,6 +20,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -33,6 +38,14 @@ public class QwGroupChatController extends BaseController
|
|
|
|
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CompanyDeptServiceImpl companyDeptService;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IQwUserService iQwUserService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询客户群详情列表
|
|
|
*/
|
|
@@ -45,6 +58,35 @@ public class QwGroupChatController extends BaseController
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询我的部门客户群详情列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:groupChat:deptList')")
|
|
|
+ @GetMapping("/deptList")
|
|
|
+ public TableDataInfo deptList(QwGroupChatParam qwGroupChat)
|
|
|
+ {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+
|
|
|
+ List<Long> combinedList = new ArrayList<>();
|
|
|
+ //本部门
|
|
|
+ Long deptId = loginUser.getUser().getDeptId();
|
|
|
+ if (deptId!=null){
|
|
|
+ combinedList.add(deptId);
|
|
|
+ }
|
|
|
+ //本部门的下级部门
|
|
|
+ List<Long> deptList = companyDeptService.selectCompanyDeptByParentId(deptId);
|
|
|
+ if (!deptList.isEmpty()){
|
|
|
+ combinedList.addAll(deptList);
|
|
|
+ }
|
|
|
+ qwGroupChat.setCuDeptIdList(combinedList);
|
|
|
+ qwGroupChat.setUserType(loginUser.getUser().getUserType());
|
|
|
+
|
|
|
+
|
|
|
+ startPage();
|
|
|
+ List<QwGroupChatVO> list = qwGroupChatService.selectQwGroupChatList(qwGroupChat);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 我的-查询客户群详情列表
|
|
@@ -53,6 +95,9 @@ public class QwGroupChatController extends BaseController
|
|
|
@GetMapping("/myList")
|
|
|
public TableDataInfo myList(QwGroupChatParam qwGroupChat)
|
|
|
{
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ qwGroupChat.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+ qwGroupChat.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
startPage();
|
|
|
List<QwGroupChatVO> list = qwGroupChatService.selectQwGroupChatList(qwGroupChat);
|
|
|
return getDataTable(list);
|
|
@@ -77,8 +122,21 @@ public class QwGroupChatController extends BaseController
|
|
|
|
|
|
// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
// Long companyId = loginUser.getCompany().getCompanyId();
|
|
|
+ List<String> qwUserIdList=new ArrayList<>();
|
|
|
+ return qwGroupChatService.cogradientGroupChat(corpId,qwUserIdList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 同步 我的客户群信息
|
|
|
+ */
|
|
|
+ @GetMapping("/cogradientMyGroupChat/{corpId}")
|
|
|
+ public R cogradientMyGroupChat(@PathVariable("corpId") String corpId) throws Exception {
|
|
|
+
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+
|
|
|
+ List<String> qwUserIdList = iQwUserService.selectQwUserListByCompanyUserId(loginUser.getUser().getUserId(), corpId);
|
|
|
|
|
|
- return qwGroupChatService.cogradientGroupChat(corpId);
|
|
|
+ return qwGroupChatService.cogradientGroupChat(corpId,qwUserIdList);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/allList/{corpId}")
|