Browse Source

task新加 unit单位字段,删除不用的projectId

zyh
小久哥 3 years ago
parent
commit
f29fa0b508
  1. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/TaskController.java
  2. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/dto/TaskAssemblyDTO.java
  3. 5
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateBaseVO.java
  4. 4
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateExcelVO.java
  5. 4
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateExportReqVO.java
  6. 5
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCatePageReqVO.java
  7. 7
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/taskCate/TaskCateDO.java
  8. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/taskCate/TaskCateMapper.java
  9. 2
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java
  10. 8
      zsw-farm/zsw-farm-impl/src/test/java/cn/iocoder/yudao/module/farm/service/taskCate/TaskCateServiceImplTest.java

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/TaskController.java

@ -96,7 +96,7 @@ public class TaskController {
}
@GetMapping("/apiPage")
@ApiOperation("获得农场项目分页及相关信息")
@ApiOperation("获得农场任务分页及相关信息")
@PreAuthorize("@ss.hasPermission('farm:task:query')")
public CommonResult<PageResult<TaskAssemblyDTO>> getAdminTaskPage(@Valid TaskPageReqVO pageVO) {
PageResult<TaskAssemblyDTO> pageResult = taskService.getAdminTaskPage(pageVO);

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/task/dto/TaskAssemblyDTO.java

@ -55,4 +55,6 @@ public class TaskAssemblyDTO extends TaskBaseVO {
//时间
@JsonFormat(pattern = "yyyy-MM-dd")
Date finishTime;
Date createTime;
}

5
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateBaseVO.java

@ -16,13 +16,12 @@ public class TaskCateBaseVO {
@ApiModelProperty(value = "")
private Long parentId;
@ApiModelProperty(value = "")
private Long projectId;
@ApiModelProperty(value = "", required = true)
@NotNull(message = "不能为空")
private String name;
private Boolean pretendDelete;
private String unit;
}

4
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateExcelVO.java

@ -17,9 +17,6 @@ public class TaskCateExcelVO {
@ExcelProperty("")
private Long parentId;
@ExcelProperty("")
private Long projectId;
@ExcelProperty("")
private String name;
@ -28,4 +25,5 @@ public class TaskCateExcelVO {
private Boolean pretendDelete;
private String unit;
}

4
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCateExportReqVO.java

@ -15,9 +15,6 @@ public class TaskCateExportReqVO {
@ApiModelProperty(value = "")
private Long parentId;
@ApiModelProperty(value = "")
private Long projectId;
@ApiModelProperty(value = "")
private String name;
@ -31,4 +28,5 @@ public class TaskCateExportReqVO {
private Boolean pretendDelete;
private String unit;
}

5
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/taskCate/vo/TaskCatePageReqVO.java

@ -17,9 +17,6 @@ public class TaskCatePageReqVO extends PageParam {
@ApiModelProperty(value = "")
private Long parentId;
@ApiModelProperty(value = "")
private Long projectId;
@ApiModelProperty(value = "")
private String name;
@ -33,4 +30,6 @@ public class TaskCatePageReqVO extends PageParam {
private Boolean pretendDelete = false;
private String unit;
}

7
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/dataobject/taskCate/TaskCateDO.java

@ -29,10 +29,6 @@ public class TaskCateDO extends BaseDO {
*
*/
private Long parentId;
/**
*
*/
private Long projectId;
/**
*
*/
@ -41,4 +37,7 @@ public class TaskCateDO extends BaseDO {
@ApiModelProperty("假装删除")
private Boolean pretendDelete;
@ApiModelProperty("任务单位, 亩,株")
private String unit;
}

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/taskCate/TaskCateMapper.java

@ -20,7 +20,6 @@ public interface TaskCateMapper extends BaseMapperX<TaskCateDO> {
default PageResult<TaskCateDO> selectPage(TaskCatePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<TaskCateDO>()
.eqIfPresent(TaskCateDO::getParentId, reqVO.getParentId())
.eqIfPresent(TaskCateDO::getProjectId, reqVO.getProjectId())
.likeIfPresent(TaskCateDO::getName, reqVO.getName())
.betweenIfPresent(TaskCateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.eqIfPresent(TaskCateDO::getPretendDelete, reqVO.getPretendDelete())
@ -30,7 +29,6 @@ public interface TaskCateMapper extends BaseMapperX<TaskCateDO> {
default List<TaskCateDO> selectList(TaskCateExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<TaskCateDO>()
.eqIfPresent(TaskCateDO::getParentId, reqVO.getParentId())
.eqIfPresent(TaskCateDO::getProjectId, reqVO.getProjectId())
.likeIfPresent(TaskCateDO::getName, reqVO.getName())
.betweenIfPresent(TaskCateDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
.eqIfPresent(TaskCateDO::getPretendDelete, reqVO.getPretendDelete())

2
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/task/TaskServiceImpl.java

@ -142,6 +142,7 @@ public class TaskServiceImpl implements TaskService {
newDTO.setTaskMsg(dto.getTaskMsg());
newDTO.setMainPersonName(dto.getMainPersonName());
newDTO.setCropName(dto.getCropName());
newDTO.setCreateTime(dto.getCreateTime());
list.add(newDTO);
}
});
@ -349,6 +350,7 @@ public class TaskServiceImpl implements TaskService {
if (taskDO.getStatus().equals(TaskStatus.COMPLETE)){
dto.setFinishTime(taskDO.getUpdateTime());
}
dto.setCreateTime(taskDO.getCreateTime());
map.put(taskDO.getId(), dto);
}
return map;

8
zsw-farm/zsw-farm-impl/src/test/java/cn/iocoder/yudao/module/farm/service/taskCate/TaskCateServiceImplTest.java

@ -109,15 +109,12 @@ public class TaskCateServiceImplTest extends BaseDbUnitTest {
// mock 数据
TaskCateDO dbTaskCate = randomPojo(TaskCateDO.class, o -> { // 等会查询到
o.setParentId(null);
o.setProjectId(null);
o.setName(null);
o.setCreateTime(null);
});
taskCateMapper.insert(dbTaskCate);
// 测试 parentId 不匹配
taskCateMapper.insert(cloneIgnoreId(dbTaskCate, o -> o.setParentId(null)));
// 测试 projectId 不匹配
taskCateMapper.insert(cloneIgnoreId(dbTaskCate, o -> o.setProjectId(null)));
// 测试 name 不匹配
taskCateMapper.insert(cloneIgnoreId(dbTaskCate, o -> o.setName(null)));
// 测试 createTime 不匹配
@ -125,7 +122,6 @@ public class TaskCateServiceImplTest extends BaseDbUnitTest {
// 准备参数
TaskCatePageReqVO reqVO = new TaskCatePageReqVO();
reqVO.setParentId(null);
reqVO.setProjectId(null);
reqVO.setName(null);
reqVO.setBeginCreateTime(null);
reqVO.setEndCreateTime(null);
@ -144,15 +140,12 @@ public class TaskCateServiceImplTest extends BaseDbUnitTest {
// mock 数据
TaskCateDO dbTaskCate = randomPojo(TaskCateDO.class, o -> { // 等会查询到
o.setParentId(null);
o.setProjectId(null);
o.setName(null);
o.setCreateTime(null);
});
taskCateMapper.insert(dbTaskCate);
// 测试 parentId 不匹配
taskCateMapper.insert(cloneIgnoreId(dbTaskCate, o -> o.setParentId(null)));
// 测试 projectId 不匹配
taskCateMapper.insert(cloneIgnoreId(dbTaskCate, o -> o.setProjectId(null)));
// 测试 name 不匹配
taskCateMapper.insert(cloneIgnoreId(dbTaskCate, o -> o.setName(null)));
// 测试 createTime 不匹配
@ -160,7 +153,6 @@ public class TaskCateServiceImplTest extends BaseDbUnitTest {
// 准备参数
TaskCateExportReqVO reqVO = new TaskCateExportReqVO();
reqVO.setParentId(null);
reqVO.setProjectId(null);
reqVO.setName(null);
reqVO.setBeginCreateTime(null);
reqVO.setEndCreateTime(null);

Loading…
Cancel
Save