From 67b1045bcfebf5207b58784f3348ab3732f929e1 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Thu, 11 Jan 2024 11:46:28 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=B7=A5=E4=BD=9C=E4=BB=BB=E5=8A=A1=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/ticket/repair/vo/WorkTaskVO.java | 8 ++++++ .../repair/controller/WorkTaskController.java | 10 ++++++++ .../ticket/repair/service/IWorkTaskService.java | 3 +++ .../repair/service/impl/WorkTaskServiceImpl.java | 30 ++++++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskVO.java b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskVO.java index 2c37e32..1a1808a 100644 --- a/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskVO.java +++ b/hzims-service-api/ticket-api/src/main/java/com/hnac/hzims/ticket/repair/vo/WorkTaskVO.java @@ -1,6 +1,7 @@ package com.hnac.hzims.ticket.repair.vo; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -11,5 +12,12 @@ import lombok.EqualsAndHashCode; @Data public class WorkTaskVO extends WorkTaskEntity { + @ApiModelProperty(value = "开始时间") + private String startTime; + @ApiModelProperty(value = "结束时间") + private String endTime; + + @ApiModelProperty(value = "机构ID") + private Long deptId; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java index 4ca1e79..062489b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/controller/WorkTaskController.java @@ -5,7 +5,9 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; +import com.hnac.hzims.operational.access.vo.ConstructionVo; import com.hnac.hzims.ticket.repair.entity.RepairEntity; +import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.service.IOperRepairService; import com.hnac.hzims.ticket.repair.service.IWorkTaskService; import com.hnac.hzims.ticket.repair.service.impl.WorkTaskServiceImpl; @@ -16,6 +18,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.flow.core.vo.ComleteTask; @@ -39,6 +42,13 @@ public class WorkTaskController extends BladeController { private final IWorkTaskService workTaskService; + @GetMapping("/list") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页") + public R> list(WorkTaskVO workTask, Query query) { + return R.data(workTaskService.workTaskService(Condition.getPage(query), workTask)); + } + /** * 工作任务单-开启流程 * @param workTask diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java index aab73e2..fce0901 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/IWorkTaskService.java @@ -1,9 +1,11 @@ package com.hnac.hzims.ticket.repair.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.vo.WorkTaskVO; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; /** * @author ysj @@ -14,4 +16,5 @@ public interface IWorkTaskService extends BaseService { boolean listener(ProcessWorkFlowResponse processWorkFlowResponse); + IPage workTaskService(IPage page, WorkTaskVO workTask); } \ No newline at end of file diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java index c95c627..a394dfd 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java @@ -2,6 +2,8 @@ package com.hnac.hzims.ticket.repair.service.impl; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.repair.entity.WorkTaskEntity; import com.hnac.hzims.ticket.repair.mapper.WorkTaskMapper; @@ -11,9 +13,12 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Condition; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.utils.FlowUtil; @@ -33,6 +38,31 @@ public class WorkTaskServiceImpl extends BaseServiceImpl workTaskService(IPage page, WorkTaskVO workTask) { + QueryWrapper wrapper = Condition.getQueryWrapper(workTask); + if(StringUtil.isNotBlank(workTask.getStartTime())){ + wrapper.ge("CREATE_TIME",workTask.getStartTime()); + } + if(StringUtil.isNotBlank(workTask.getEndTime())){ + wrapper.le("CREATE_TIME",workTask.getEndTime()); + } + if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ + wrapper.eq("GROUP_ID",workTask.getGroupId()); + } + if(ObjectUtil.isNotEmpty(workTask.getGroupId())){ + wrapper.eq("CREATE_DEPT",workTask.getDeptId()); + } + return super.page(page, wrapper); + } + /** * 工作任务单-开启流程 * @param workTask