|
@@ -121,9 +121,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
}
|
|
}
|
|
Task task = new Task();
|
|
Task task = new Task();
|
|
BeanUtils.copyProperties(taskDto,task);
|
|
BeanUtils.copyProperties(taskDto,task);
|
|
- task.setCreateDate(LocalDate.now());//任务的创建时间
|
|
|
|
|
|
+ task.setCreateDate(new Date());//任务的创建时间
|
|
//根据任务的开始时间与当下时间判断任务的状态
|
|
//根据任务的开始时间与当下时间判断任务的状态
|
|
- if (taskDto.getStartDate()==null||taskDto.getStartDate().isAfter(LocalDate.now())){
|
|
|
|
|
|
+ if (taskDto.getStartDate()==null||taskDto.getStartDate().after(new Date())){
|
|
task.setStatus(0);
|
|
task.setStatus(0);
|
|
}else {
|
|
}else {
|
|
task.setStatus(1);
|
|
task.setStatus(1);
|
|
@@ -163,7 +163,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
taskLog.setContent("创建了任务");
|
|
taskLog.setContent("创建了任务");
|
|
taskLog.setUserId(userId);
|
|
taskLog.setUserId(userId);
|
|
taskLog.setUserName(user.getName());
|
|
taskLog.setUserName(user.getName());
|
|
- taskLog.setModTime(LocalDateTime.now());
|
|
|
|
taskLog.setCompanyId(user.getCompanyId());
|
|
taskLog.setCompanyId(user.getCompanyId());
|
|
taskLogMapper.insert(taskLog);
|
|
taskLogMapper.insert(taskLog);
|
|
|
|
|
|
@@ -181,9 +180,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()));
|
|
List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()));
|
|
List<TasKVo> taskVoList =taskMapper.getPageListTask(taskDto);
|
|
List<TasKVo> taskVoList =taskMapper.getPageListTask(taskDto);
|
|
for (TasKVo tasKVo : taskVoList) {
|
|
for (TasKVo tasKVo : taskVoList) {
|
|
- System.out.println(tasKVo.getStartDate());
|
|
|
|
- System.out.println(tasKVo.getEndDate());
|
|
|
|
- System.out.println(tasKVo.getCreateDate());
|
|
|
|
if (!taskExecutorList.isEmpty()){
|
|
if (!taskExecutorList.isEmpty()){
|
|
List<TaskExecutor> collect = taskExecutorList.stream().
|
|
List<TaskExecutor> collect = taskExecutorList.stream().
|
|
filter(taskExecutor -> taskExecutor.getTaskId().equals(tasKVo.getId())).
|
|
filter(taskExecutor -> taskExecutor.getTaskId().equals(tasKVo.getId())).
|
|
@@ -204,17 +200,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- if (!taskVoList.isEmpty()){
|
|
|
|
- taskVoList.forEach(tasKVo -> {
|
|
|
|
- if (!tasKVo.getTaskExecutors().isEmpty()){
|
|
|
|
- Integer taskId = tasKVo.getId();
|
|
|
|
- LambdaQueryWrapper<TaskExecutor> lqw = new LambdaQueryWrapper<>();
|
|
|
|
- lqw.eq(TaskExecutor::getTaskId,taskId);
|
|
|
|
- List<TaskExecutor> taskExecutors = taskExecutorMapper.selectList(lqw);
|
|
|
|
- tasKVo.setTaskExecutors(taskExecutors);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
List<TasKVo> taskVoTotalList= taskMapper.getPageListTotalTask(taskDto);
|
|
List<TasKVo> taskVoTotalList= taskMapper.getPageListTotalTask(taskDto);
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
HashMap<String, Object> map = new HashMap<>();
|
|
@@ -272,7 +257,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
taskLog.setContent("修改了任务");
|
|
taskLog.setContent("修改了任务");
|
|
taskLog.setUserId(user.getId());
|
|
taskLog.setUserId(user.getId());
|
|
taskLog.setUserName(user.getName());
|
|
taskLog.setUserName(user.getName());
|
|
- taskLog.setModTime(LocalDateTime.now());
|
|
|
|
taskLogMapper.insert(taskLog);
|
|
taskLogMapper.insert(taskLog);
|
|
|
|
|
|
return msg;
|
|
return msg;
|
|
@@ -414,7 +398,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
Task task=new Task();
|
|
Task task=new Task();
|
|
task.setCompanyId(companyId);
|
|
task.setCompanyId(companyId);
|
|
task.setCreaterId(user.getId());
|
|
task.setCreaterId(user.getId());
|
|
- task.setCreateDate(LocalDate.now());
|
|
|
|
|
|
+ task.setCreateDate(new Date());
|
|
for (int i = 0; i < cellNum; i++) {
|
|
for (int i = 0; i < cellNum; i++) {
|
|
JSONObject item = configObJSONArray.getJSONObject(i);
|
|
JSONObject item = configObJSONArray.getJSONObject(i);
|
|
String modelName = item.getString("model");
|
|
String modelName = item.getString("model");
|
|
@@ -518,7 +502,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
if (cell.getCellTypeEnum() == CellType.NUMERIC){
|
|
if (cell.getCellTypeEnum() == CellType.NUMERIC){
|
|
double numericCellValue = cell.getNumericCellValue();
|
|
double numericCellValue = cell.getNumericCellValue();
|
|
long daysSince1900 = (long) numericCellValue - 2;
|
|
long daysSince1900 = (long) numericCellValue - 2;
|
|
- task.setStartDate(LocalDate.of(1900, 1, 1).plusDays(daysSince1900));
|
|
|
|
|
|
+ task.setStartDate(new Date(daysSince1900));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -527,7 +511,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
if (cell.getCellTypeEnum() == CellType.NUMERIC){
|
|
if (cell.getCellTypeEnum() == CellType.NUMERIC){
|
|
double numericCellValue = cell.getNumericCellValue();
|
|
double numericCellValue = cell.getNumericCellValue();
|
|
long daysSince1900 = (long) numericCellValue - 2;
|
|
long daysSince1900 = (long) numericCellValue - 2;
|
|
- task.setEndDate(LocalDate.of(1900, 1, 1).plusDays(daysSince1900));
|
|
|
|
|
|
+ task.setEndDate(new Date(daysSince1900));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -687,7 +671,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
TaskLog taskLog = new TaskLog();
|
|
TaskLog taskLog = new TaskLog();
|
|
taskLog.setTaskId(task.getId());
|
|
taskLog.setTaskId(task.getId());
|
|
taskLog.setContent("通过文件导入任务");
|
|
taskLog.setContent("通过文件导入任务");
|
|
- taskLog.setModTime(LocalDateTime.now());
|
|
|
|
taskLog.setUserName(user.getName());
|
|
taskLog.setUserName(user.getName());
|
|
taskLog.setUserId(user.getId());
|
|
taskLog.setUserId(user.getId());
|
|
taskLog.setCompanyId(user.getCompanyId());
|
|
taskLog.setCompanyId(user.getCompanyId());
|
|
@@ -783,16 +766,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
}
|
|
}
|
|
if(model.equals("startDate")){
|
|
if(model.equals("startDate")){
|
|
if (tasKVo.getStartDate()!=null){
|
|
if (tasKVo.getStartDate()!=null){
|
|
- LocalDate startDate = tasKVo.getStartDate();
|
|
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
- value=startDate.format(dateTimeFormatter);
|
|
|
|
|
|
+ Date startDate = tasKVo.getStartDate();
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ value=format.format(startDate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(model.equals("endDate")){
|
|
if(model.equals("endDate")){
|
|
if (tasKVo.getEndDate()!=null){
|
|
if (tasKVo.getEndDate()!=null){
|
|
- LocalDate endDate = tasKVo.getEndDate();
|
|
|
|
- DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
- value=endDate.format(dateTimeFormatter);
|
|
|
|
|
|
+ Date endDate = tasKVo.getEndDate();
|
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ value=format.format(endDate);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
item.add(value);
|
|
item.add(value);
|
|
@@ -816,7 +799,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
taskMapper.update(null,luw);
|
|
taskMapper.update(null,luw);
|
|
TaskLog taskLog = new TaskLog();
|
|
TaskLog taskLog = new TaskLog();
|
|
taskLog.setUserId(user.getId()).setTaskId(taskDto.getId()).setUserName(user.getName())
|
|
taskLog.setUserId(user.getId()).setTaskId(taskDto.getId()).setUserName(user.getName())
|
|
- .setContent("修改任务状态").setModTime(LocalDateTime.now());
|
|
|
|
|
|
+ .setContent("修改任务状态");
|
|
taskLogMapper.insert(taskLog);
|
|
taskLogMapper.insert(taskLog);
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|