|
|
|
@ -1,6 +1,8 @@
|
|
|
|
|
package cn.iocoder.yudao.module.farm.service.task; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
|
import cn.hutool.core.date.DatePattern; |
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.core.text.StrBuilder; |
|
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
@ -8,6 +10,7 @@ import cn.hutool.system.oshi.CpuInfo;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.page.PageUtil; |
|
|
|
|
import cn.iocoder.yudao.framework.common.page.PageVO; |
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
|
|
|
|
import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
|
|
|
|
import cn.iocoder.yudao.framework.security.core.LoginUser; |
|
|
|
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; |
|
|
|
|
import cn.iocoder.yudao.module.farm.controller.admin.resource.dto.ResourceDTO; |
|
|
|
@ -34,6 +37,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.CpUser.CpUserMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; |
|
|
|
|
import cn.iocoder.yudao.module.system.service.CpUser.CpUserService; |
|
|
|
|
import com.alibaba.excel.annotation.format.DateTimeFormat; |
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
@ -44,6 +48,8 @@ import javax.annotation.Resource;
|
|
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
|
|
|
|
|
import java.text.DateFormat; |
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@ -472,6 +478,21 @@ public class TaskServiceImpl implements TaskService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, String>> whatDayHaveTask(){ |
|
|
|
|
LambdaQueryWrapperX<TaskDO> queryWrapperX = new LambdaQueryWrapperX<>(); |
|
|
|
|
queryWrapperX.ne(TaskDO::getDraft, true); |
|
|
|
|
queryWrapperX.ne(TaskDO::getPretendDelete, true); |
|
|
|
|
List<TaskDO> taskList = taskMapper.selectList(queryWrapperX); |
|
|
|
|
Map<Object, List<TaskDO>> dateMap = taskList.stream().collect(Collectors.groupingBy(item -> DateUtil.format(item.getPlanStartTime(), DatePattern.NORM_DATE_FORMAT))); |
|
|
|
|
List<Map<String, String>> list = new ArrayList<>(); |
|
|
|
|
dateMap.entrySet().stream().forEach(item ->{ |
|
|
|
|
Map map = new HashMap<String,String>() ; |
|
|
|
|
map.put("date", item.getKey().toString()); |
|
|
|
|
list.add(map); |
|
|
|
|
}); |
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|