|
|
@@ -5,6 +5,8 @@ import cc.uncarbon.framework.core.exception.BusinessException;
|
|
|
import cc.uncarbon.framework.crud.entity.HelioBaseEntity;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.jtzx.crm.module.sys.entity.SysCustomerTodoEntity;
|
|
|
@@ -46,7 +48,10 @@ public class SysCustomerTodoService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<BindUserBO> queryMemberData() {
|
|
|
+ public List<BindUserBO> queryMemberData(String dateStr) {
|
|
|
+
|
|
|
+ DateTime startDateTime = DateUtil.beginOfMonth(DateUtil.parse(dateStr));
|
|
|
+ DateTime endDateTime = DateUtil.endOfMonth(DateUtil.parse(dateStr));
|
|
|
List<SysCustomerTodoEntity> todoEntityList =
|
|
|
sysCustomerTodoMapper.selectList(
|
|
|
new LambdaQueryWrapper<>(SysCustomerTodoEntity.class)
|
|
|
@@ -55,24 +60,26 @@ public class SysCustomerTodoService {
|
|
|
SysCustomerTodoEntity::getClaimUserName
|
|
|
)
|
|
|
.eq(SysCustomerTodoEntity::getOrderStatus, 0)
|
|
|
+ .ge(SysCustomerTodoEntity::getOrderDatetime, DateUtil.toLocalDateTime(startDateTime))
|
|
|
+ .le(SysCustomerTodoEntity::getOrderDatetime, DateUtil.toLocalDateTime(endDateTime))
|
|
|
.orderByDesc(HelioBaseEntity::getCreatedAt)
|
|
|
);
|
|
|
List<BindUserBO> ret = Lists.newArrayList();
|
|
|
- SysCustomerFollowHistorySelectBO sysCustomerFollowHistorySelectBO = sysCustomerDataFollowService.queryCustomerOrderSelectData(1, false);
|
|
|
+ SysCustomerFollowHistorySelectBO sysCustomerFollowHistorySelectBO = sysCustomerDataFollowService.queryCustomerOrderSelectData(1, false, startDateTime, endDateTime);
|
|
|
if (sysCustomerFollowHistorySelectBO != null && CollUtil.isNotEmpty(sysCustomerFollowHistorySelectBO.getMemberData())) {
|
|
|
ret.addAll(sysCustomerFollowHistorySelectBO.getMemberData());
|
|
|
- if (CollUtil.isNotEmpty(todoEntityList)) {
|
|
|
- todoEntityList.forEach(
|
|
|
- entity -> {
|
|
|
- if (CollUtil.isEmpty(ret) || ret.stream().noneMatch(bo -> bo.getId().equals(entity.getClaimUserId()))) {
|
|
|
- BindUserBO bo = new BindUserBO();
|
|
|
- bo.setId(entity.getClaimUserId());
|
|
|
- bo.setUsername(entity.getClaimUserName());
|
|
|
- ret.add(bo);
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (CollUtil.isNotEmpty(todoEntityList)) {
|
|
|
+ todoEntityList.forEach(
|
|
|
+ entity -> {
|
|
|
+ if (CollUtil.isEmpty(ret) || ret.stream().noneMatch(bo -> bo.getId().equals(entity.getClaimUserId()))) {
|
|
|
+ BindUserBO bo = new BindUserBO();
|
|
|
+ bo.setId(entity.getClaimUserId());
|
|
|
+ bo.setUsername(entity.getClaimUserName());
|
|
|
+ ret.add(bo);
|
|
|
}
|
|
|
- );
|
|
|
- }
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
return ret;
|
|
|
}
|