Commit 94ed271c by leialin

Merge branch 'lal' into 'develop'

提交

See merge request 8timerv2/8timerapiv200!469
parents 6f5a57b4 eafbbb2d
...@@ -508,12 +508,12 @@ public class CrmController { ...@@ -508,12 +508,12 @@ public class CrmController {
// 归属我的客户 // 归属我的客户
private List<CrmClientData> getMyCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status, private List<CrmClientData> getMyCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,
String like,String startCreateTime, String endCreateTime, String startFollowTime, String endFollowTime) { String like,String startCreateTime, String endCreateTime, String startFollowTime, String endFollowTime,Integer typei) {
return CrmClientData.builder().build() return CrmClientData.builder().build()
.selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getOrgCode, orgCode) .selectList(new QueryWrapper<CrmClientData>().lambda().eq(CrmClientData::getOrgCode, orgCode)
.eq(CrmClientData::getBelongUser, empNum) .eq(CrmClientData::getBelongUser, empNum)
.eq(groupId != null && groupId >= 0, CrmClientData::getBelongGroup, groupId) .eq(groupId != null && groupId > 0, CrmClientData::getBelongGroup, groupId)
.eq(status != null && status >= 0, CrmClientData::getClientStatus, status) .eq(status != null && status > 0, CrmClientData::getClientStatus, status).eq(typei != null && typei > 0, CrmClientData::getClientType, typei)
.ge(StringUtils.isNotBlank(startCreateTime), CrmClientData::getCreateTime, startCreateTime) .ge(StringUtils.isNotBlank(startCreateTime), CrmClientData::getCreateTime, startCreateTime)
.le(StringUtils.isNotBlank(endCreateTime), CrmClientData::getCreateTime, endCreateTime) .le(StringUtils.isNotBlank(endCreateTime), CrmClientData::getCreateTime, endCreateTime)
.ge(StringUtils.isNotBlank(startFollowTime), CrmClientData::getCreateTime, startFollowTime) .ge(StringUtils.isNotBlank(startFollowTime), CrmClientData::getCreateTime, startFollowTime)
...@@ -546,21 +546,21 @@ public class CrmController { ...@@ -546,21 +546,21 @@ public class CrmController {
// 我的全部客户 // 我的全部客户
private List<CrmClientData> getMyTotalCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status, private List<CrmClientData> getMyTotalCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,
String like) { String like,Integer type) {
return CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status, like,null,null,null,null), return CheckUtil.distinct(getMyCilent(empNum, orgCode, groupId, status, like,null,null,null,null,null),
getMyAssociateCilent(empNum, orgCode, groupId, status, like), true); getMyAssociateCilent(empNum, orgCode, groupId, status, like), true);
} }
// 我关注的客户 // 我关注的客户
private List<CrmClientData> getMyStarCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status) { private List<CrmClientData> getMyStarCilent(Integer empNum, Integer orgCode, Integer groupId, Integer status,Integer type) {
return getMyTotalCilent(empNum, orgCode, groupId, status, null).stream() return getMyTotalCilent(empNum, orgCode, groupId, status, null,null).stream()
.filter(item -> item.getStar().equals(1)).collect(Collectors.toList()); .filter(item -> item.getStar().equals(1)).collect(Collectors.toList());
} }
// 七天未跟进的客户 // 七天未跟进的客户
private List<CrmClientData> getCilentFollowOvertime(Integer empNum, Integer orgCode, Integer groupId, private List<CrmClientData> getCilentFollowOvertime(Integer empNum, Integer orgCode, Integer groupId,
Integer status) { Integer status,Integer type) {
return getMyTotalCilent(empNum, orgCode, groupId, status, null).stream() return getMyTotalCilent(empNum, orgCode, groupId, status, null,null).stream()
.filter(item -> item.getLastFollowTime() != null .filter(item -> item.getLastFollowTime() != null
&& item.getLastFollowTime().before(DateUtil.offsetDay(new Date(), -7))) && item.getLastFollowTime().before(DateUtil.offsetDay(new Date(), -7)))
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -575,7 +575,7 @@ public class CrmController { ...@@ -575,7 +575,7 @@ public class CrmController {
@GetMapping("getMyCilentTotal") @GetMapping("getMyCilentTotal")
@ApiOperation(value = "获取我的客户列表(全)", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "获取我的客户列表(全)", httpMethod = "GET", notes = "接口发布说明")
public Result<List<CrmClientData>> getMyCilentTotal(@CurrentUser UserBean userBean, public Result<List<CrmClientData>> getMyCilentTotal(@CurrentUser UserBean userBean,
@RequestParam(required = false, defaultValue = "0") Integer type, @RequestParam(required = false) Integer type,
@RequestParam(required = false) Integer groupId, @RequestParam(required = false) Integer status, @RequestParam(required = false) Integer groupId, @RequestParam(required = false) Integer status,
@RequestParam(required = false) String like, @RequestParam(required = false) String like,
@RequestParam(required = false, defaultValue = "1") int pageNumber, @RequestParam(required = false, defaultValue = "1") int pageNumber,
...@@ -583,7 +583,8 @@ public class CrmController { ...@@ -583,7 +583,8 @@ public class CrmController {
@RequestParam(required = false) String startCreateTime, @RequestParam(required = false) String startCreateTime,
@RequestParam(required = false) String endCreateTime, @RequestParam(required = false) String endCreateTime,
@RequestParam(required = false) String startFollowTime, @RequestParam(required = false) String startFollowTime,
@RequestParam(required = false) String endFollowTime) { @RequestParam(required = false) String endFollowTime,
@RequestParam(required = false) Integer typei) {
if(endCreateTime != null && !("").equals(endCreateTime)) { if(endCreateTime != null && !("").equals(endCreateTime)) {
endCreateTime = endCreateTime.substring(0, 10)+" 23:59:59"; endCreateTime = endCreateTime.substring(0, 10)+" 23:59:59";
...@@ -596,18 +597,18 @@ public class CrmController { ...@@ -596,18 +597,18 @@ public class CrmController {
Integer orgCode = getOrgCode(userBean); Integer orgCode = getOrgCode(userBean);
List<CrmClientData> crmClientDatas = null; List<CrmClientData> crmClientDatas = null;
if (type == null || type == 0) { // 全部客户(去重) if (type == null || type == 0) { // 全部客户(去重)
List<CrmClientData> myClient = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime); List<CrmClientData> myClient = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,typei);
List<CrmClientData> myAsso = getMyAssociateCilent(empNum, orgCode, groupId, status, like); List<CrmClientData> myAsso = getMyAssociateCilent(empNum, orgCode, groupId, status, like);
crmClientDatas = CheckUtil.distinct(myClient, myAsso, true).stream() crmClientDatas = CheckUtil.distinct(myClient, myAsso, true).stream()
.filter(CheckUtil.distinctByKey(CrmClientData::getId)).collect(Collectors.toList()); .filter(CheckUtil.distinctByKey(CrmClientData::getId)).collect(Collectors.toList());
} else if (type == 1) // 我负责的客户 } else if (type == 1) // 我负责的客户
crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime); crmClientDatas = getMyCilent(empNum, orgCode, groupId, status, like,startCreateTime,endCreateTime,startFollowTime,endFollowTime,type);
else if (type == 2) // 我协作的客户 else if (type == 2) // 我协作的客户
crmClientDatas = getMyAssociateCilent(empNum, orgCode, groupId, status, like); crmClientDatas = getMyAssociateCilent(empNum, orgCode, groupId, status, like);
else if (type == 3) // 我关注的客户 else if (type == 3) // 我关注的客户
crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status); crmClientDatas = getMyStarCilent(empNum, orgCode, groupId, status,type);
else if (type == 4) // 七天未跟进的客户 else if (type == 4) // 七天未跟进的客户
crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status); crmClientDatas = getCilentFollowOvertime(empNum, orgCode, groupId, status,type);
else else
return ResultUtil.error("查询失败"); return ResultUtil.error("查询失败");
// Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序 // Collections.sort(crmClientDatas, Comparator.comparing(CrmClientData::getCreateTime).reversed()); // 按时间降序排序
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment