|
@@ -6,7 +6,10 @@ import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.company.domain.CompanyUser;
|
|
|
+import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.framework.security.LoginUser;
|
|
|
import com.fs.framework.service.TokenService;
|
|
|
import com.fs.qw.domain.QwUserVoiceLog;
|
|
@@ -24,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 企微用户通话记录Controller
|
|
@@ -44,6 +48,9 @@ public class QwUserVoiceLogController extends BaseController
|
|
|
@Autowired
|
|
|
private IQwTagService iQwTagService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICompanyUserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询企微用户通话记录列表
|
|
|
*/
|
|
@@ -66,6 +73,16 @@ public class QwUserVoiceLogController extends BaseController
|
|
|
@PostMapping("/newList")
|
|
|
public TableDataInfo newList(@RequestBody QwUserVoiceLogVo qwUserVoiceLog)
|
|
|
{
|
|
|
+ if(qwUserVoiceLog.getCompanyUserId() == null && qwUserVoiceLog.getDeptId() != null){
|
|
|
+ //获取部门下的所有用户
|
|
|
+ CompanyUser usermap=new CompanyUser();
|
|
|
+ usermap.setDeptId(qwUserVoiceLog.getDeptId());
|
|
|
+ List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
+ List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
+ if (!userIds.isEmpty()) {
|
|
|
+ qwUserVoiceLog.setCompanyUserIds(userIds.toArray(new Long[0]));
|
|
|
+ }
|
|
|
+ }
|
|
|
PageHelper.startPage(qwUserVoiceLog.getPageNum(), qwUserVoiceLog.getPageSize());
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
qwUserVoiceLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
@@ -149,6 +166,17 @@ public class QwUserVoiceLogController extends BaseController
|
|
|
@GetMapping("/sellTotalList")
|
|
|
public TableDataInfo sellTotalList(QwUserVoiceLogTotalVo qwUserVoiceLog)
|
|
|
{
|
|
|
+ if(qwUserVoiceLog.getCompanyUserId() == null && qwUserVoiceLog.getDeptId() != null){
|
|
|
+ //获取部门下的所有用户
|
|
|
+ CompanyUser usermap=new CompanyUser();
|
|
|
+ usermap.setDeptId(qwUserVoiceLog.getDeptId());
|
|
|
+ List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
+ List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
+ if (!userIds.isEmpty()) {
|
|
|
+ qwUserVoiceLog.setCompanyUserIds(userIds.toArray(new Long[0]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
startPage();
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
qwUserVoiceLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
@@ -161,6 +189,16 @@ public class QwUserVoiceLogController extends BaseController
|
|
|
@GetMapping("/sellTotalExport")
|
|
|
public AjaxResult sellTotalExport(QwUserVoiceLogTotalVo qwUserVoiceLog)
|
|
|
{
|
|
|
+ if(qwUserVoiceLog.getCompanyUserId() == null && qwUserVoiceLog.getDeptId() != null){
|
|
|
+ //获取部门下的所有用户
|
|
|
+ CompanyUser usermap=new CompanyUser();
|
|
|
+ usermap.setDeptId(qwUserVoiceLog.getDeptId());
|
|
|
+ List<CompanyUser> users = userService.getUserListByDeptId(usermap);
|
|
|
+ List<Long> userIds = users.stream().map(element -> element.getUserId()).collect(Collectors.toList());
|
|
|
+ if (!userIds.isEmpty()) {
|
|
|
+ qwUserVoiceLog.setCompanyUserIds(userIds.toArray(new Long[0]));
|
|
|
+ }
|
|
|
+ }
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
qwUserVoiceLog.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
List<QwUserVoiceLogTotalVo> list = qwUserVoiceLogService.selectQwUserVoiceLogTotalList(qwUserVoiceLog);
|