From 59ed4122cb34a450d4aae4a36e58820e5fc7471c Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Mon, 9 Oct 2023 15:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86-=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E9=A1=B9=E7=BB=B4=E6=8A=A4(=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/device/domain/EquCheckItem.java | 69 +++++++++++++++++++ .../service/impl/EquCheckItemServiceImpl.java | 18 +++++ .../mapper/device/EquCheckItemMapper.xml | 14 ++-- 3 files changed, 95 insertions(+), 6 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java index 4d3535af..c2c5ac97 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquCheckItem.java @@ -1,6 +1,8 @@ package com.op.device.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -81,6 +83,72 @@ public class EquCheckItem extends BaseEntity { @Excel(name = "更新人") private String updatedBy; + // 创建日期范围list + private List createdTimeArray; + + // 更新日期范围list + private List updateTimeArray; + + // 更新日期开始 + private String updateTimeStart; + + // 更新日期结束 + private String updateTimeEnd; + + public List getUpdateTimeArray() { + return updateTimeArray; + } + + public void setUpdateTimeArray(List updateTimeArray) { + this.updateTimeArray = updateTimeArray; + } + + public String getUpdateTimeStart() { + return updateTimeStart; + } + + public void setUpdateTimeStart(String updateTimeStart) { + this.updateTimeStart = updateTimeStart; + } + + public String getUpdateTimeEnd() { + return updateTimeEnd; + } + + public void setUpdateTimeEnd(String updateTimeEnd) { + this.updateTimeEnd = updateTimeEnd; + } + + // 创建日期开始 + private String createTimeStart; + + // 创建日期结束 + private String createTimeEnd; + + public String getCreateTimeStart() { + return createTimeStart; + } + + public void setCreateTimeStart(String createTimeStart) { + this.createTimeStart = createTimeStart; + } + + public String getCreateTimeEnd() { + return createTimeEnd; + } + + public void setCreateTimeEnd(String createTimeEnd) { + this.createTimeEnd = createTimeEnd; + } + + public List getCreatedTimeArray() { + return createdTimeArray; + } + + public void setCreatedTimeArray(List createdTimeArray) { + this.createdTimeArray = createdTimeArray; + } + public void setItemId(String itemId) { this.itemId = itemId; } @@ -213,6 +281,7 @@ public class EquCheckItem extends BaseEntity { .append("createdBy", getCreatedBy()) .append("updatedTime", getUpdatedTime()) .append("updatedBy", getUpdatedBy()) + .append("createdTimeArray",getCreatedTimeArray()) .toString(); } } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java index 96340fde..995a784a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquCheckItemServiceImpl.java @@ -1,8 +1,10 @@ package com.op.device.service.impl; +import java.text.SimpleDateFormat; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.log.annotation.Log; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.op.device.mapper.EquCheckItemMapper; @@ -41,6 +43,22 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService { @Override @DS("#header.poolName") public List selectEquCheckItemList(EquCheckItem equCheckItem) { + if (equCheckItem.getCreatedTimeArray() != null) { + // 设置创建日期开始和结束值 + if (equCheckItem.getCreatedTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equCheckItem.setCreateTimeStart(formatter.format(equCheckItem.getCreatedTimeArray().get(0))); + equCheckItem.setCreateTimeEnd(formatter.format(equCheckItem.getCreatedTimeArray().get(1))); + } + } + if (equCheckItem.getUpdateTimeArray() != null) { + // 设置更新日期开始和结束 + if (equCheckItem.getUpdateTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equCheckItem.setUpdateTimeStart(formatter.format(equCheckItem.getUpdateTimeArray().get(0))); + equCheckItem.setUpdateTimeEnd(formatter.format(equCheckItem.getUpdateTimeArray().get(1))); + } + } return equCheckItemMapper.selectEquCheckItemList(equCheckItem); } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml index dd80f567..d6f13f3b 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemMapper.xml @@ -30,9 +30,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"