This commit is contained in:
lijiaqi 2023-06-15 17:10:34 +08:00
parent bef79707ff
commit ab5b421bf1
2 changed files with 19 additions and 5 deletions

View File

@ -1,5 +1,6 @@
package com.ydool.oa.workFlow.controller;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.github.xiaoymin.knife4j.annotations.DynamicParameter;
@ -15,15 +16,17 @@ import com.ydool.oa.workFlow.data.vo.WorkFlowStepVo;
import com.ydool.oa.workFlow.data.vo.WorkFlowVo;
import com.ydool.oa.workFlow.service.WorkFlowNoticeService;
import com.ydool.oa.workFlow.service.WorkFlowService;
import com.ydool.system.entity.Job;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
@RestController
@RequestMapping(UrlConstant.WORKFLOW)
@Api(tags = "工作流程申请", value = "工作流程申请")
@ -240,6 +243,8 @@ public class WorkFlowController extends BaseController {
@ApiImplicitParam(name = "type", value = "流程类型"),
@ApiImplicitParam(name = "userId", value = "发起人"),
@ApiImplicitParam(name = "status", value = "状态"),
@ApiImplicitParam(name = "startTime", value = "开始时间", dataType = "Date"),
@ApiImplicitParam(name = "endTime", value = "结束时间", dataType = "Date")
})
@ApiOperationSupport(
responses = @DynamicResponseParameters(properties = {
@ -248,8 +253,13 @@ public class WorkFlowController extends BaseController {
order = 12
)
public AjaxResult getAllWorkFlowList(String value, String column, String orderBy, String type,
String userId, String status) {
return workFlowService.getAllWorkFlowList(getPage(), value, column, orderBy, type, userId, status);
String userId, String status, @DateTimeFormat(pattern = "yyyy-MM-dd " +
"HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") LocalDateTime startTime,
@DateTimeFormat(pattern = "yyyy-MM-dd " +
"HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone =
"GMT+8") LocalDateTime endTime) {
return workFlowService.getAllWorkFlowList(getPage(), value, column, orderBy, type, userId, status, startTime,
endTime);
}
}

View File

@ -29,6 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
/**
* <p>
* 工作流程 服务类
@ -302,7 +304,7 @@ public class WorkFlowService extends BaseService<WorkFlowMapper, WorkFlow> {
* @return
*/
public AjaxResult getAllWorkFlowList(Page page, String value, String column, String orderBy, String type,
String userId, String status) {
String userId, String status, LocalDateTime startTime, LocalDateTime endTime) {
QueryWrapper<WorkFlow> qw = new QueryWrapper<WorkFlow>();
if (StrUtil.isNotBlank(value)) {
qw.lambda().like(WorkFlow::getData, value);
@ -311,7 +313,9 @@ public class WorkFlowService extends BaseService<WorkFlowMapper, WorkFlow> {
qw.lambda()
.eq(StrUtil.isNotBlank(status), WorkFlow::getStatus, status)
.eq(StrUtil.isNotBlank(type), WorkFlow::getType, type)
.eq(StrUtil.isNotBlank(userId), WorkFlow::getUserId, userId);
.eq(StrUtil.isNotBlank(userId), WorkFlow::getUserId, userId)
.ge(ObjUtil.isNotNull(startTime), WorkFlow::getCreatedAt, startTime)
.le(ObjUtil.isNotNull(endTime), WorkFlow::getCreatedAt, endTime);
if ("desc".equals(orderBy) && StrUtil.isNotBlank(column)) {