From 3a583ac09f217667cb00276ccf66c750c9e931b8 Mon Sep 17 00:00:00 2001 From: yanyang Date: Sun, 25 Jun 2023 15:28:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=9A=E7=94=A8=E4=BD=9C=E4=B8=9A=20?= =?UTF-8?q?=E6=A3=80=E9=AA=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InspectionSheetServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java index 6ff548f..0399913 100644 --- a/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java +++ b/ym-process-inspection/src/main/java/com/cnbm/processInspection/service/impl/InspectionSheetServiceImpl.java @@ -39,10 +39,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestBody; import javax.annotation.Resource; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.time.ZoneOffset; +import java.time.*; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -79,6 +77,12 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + if(params.get("startTime")!=null && params.get("endTime")!=null){ + LocalDateTime startTime = LocalDate.parse(params.get("startTime").toString(),df).atStartOfDay(); + LocalDateTime endTime = LocalDate.parse(params.get("endTime").toString(),df).atStartOfDay(); + wrapper.between(startTime!=null && endTime!=null,"create_time", startTime, endTime); + } wrapper.like(ObjectUtils.isNotNull(id), "id", id); wrapper.like(StringUtils.isNotBlank(inspectionSite), "inspection_stage", inspectionSite); wrapper.like(StringUtils.isNotBlank(orderNumber), "order_number", orderNumber); -- 2.45.2 From 32647c035c43bdf8429f9862ee7b0389edf6e44f Mon Sep 17 00:00:00 2001 From: yanyang Date: Sun, 25 Jun 2023 16:34:35 +0800 Subject: [PATCH 2/2] CommonField --- .../com/cnbm/basic/service/impl/FactoryServiceImpl.java | 3 +++ .../impl/FeaturesStageProcedureRelationServiceImpl.java | 4 ++++ .../com/cnbm/basic/service/impl/MachineServiceImpl.java | 3 +++ .../com/cnbm/basic/service/impl/MeasureToolServiceImpl.java | 3 +++ .../com/cnbm/basic/service/impl/PlatformServiceImpl.java | 3 +++ .../service/impl/ProductFactoryRelationServiceImpl.java | 4 ++++ .../basic/service/impl/ProductFeaturesHisServiceImpl.java | 3 +++ .../cnbm/basic/service/impl/ProductFeaturesServiceImpl.java | 4 ++++ .../com/cnbm/basic/service/impl/ProductServiceImpl.java | 3 +++ .../com/cnbm/basic/service/impl/ProductTypeServiceImpl.java | 3 +++ .../impl/ProductWorkingprocedureRelationServiceImpl.java | 4 ++++ .../java/com/cnbm/basic/service/impl/ShiftServiceImpl.java | 3 +++ .../java/com/cnbm/basic/service/impl/TeamServiceImpl.java | 3 +++ .../java/com/cnbm/basic/service/impl/UnitServiceImpl.java | 3 +++ .../basic/service/impl/WorkingProcedureServiceImpl.java | 3 +++ .../basic/service/impl/WorkingProcedureTypeServiceImpl.java | 3 +++ .../service/impl/InspectionSheetServiceImpl.java | 6 +++++- 17 files changed, 57 insertions(+), 1 deletion(-) diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/FactoryServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/FactoryServiceImpl.java index 88db7a0..6a45608 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/FactoryServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/FactoryServiceImpl.java @@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.cnbm.admin.utils.BaseSupportUtils; import com.cnbm.basic.dto.MachineDTO; import com.cnbm.basic.dto.ProductTypeDTO; import com.cnbm.basic.entity.ProductType; @@ -67,6 +68,7 @@ public class FactoryServiceImpl extends CrudServiceImpl @Transactional(rollbackFor = Exception.class) public void save(TeamDTO dto) { Team entity = ConvertUtils.sourceToTarget(dto, Team.class); + BaseSupportUtils.setCommonField(entity); insert(entity); } @@ -67,6 +69,7 @@ public class TeamServiceImpl extends CrudServiceImpl @Transactional(rollbackFor = Exception.class) public void update(TeamDTO dto) { Team entity = ConvertUtils.sourceToTarget(dto, Team.class); + BaseSupportUtils.setUpdateCommonField(entity); updateById(entity); } diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java index d8ead65..0022850 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/UnitServiceImpl.java @@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.cnbm.admin.utils.BaseSupportUtils; import com.cnbm.basic.dto.FactoryDTO; import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; @@ -64,6 +65,7 @@ public class UnitServiceImpl extends CrudServiceImpl @Transactional(rollbackFor = Exception.class) public void save(UnitDTO dto) { Unit entity = ConvertUtils.sourceToTarget(dto, Unit.class); + BaseSupportUtils.setCommonField(entity); insert(entity); } @@ -71,6 +73,7 @@ public class UnitServiceImpl extends CrudServiceImpl @Transactional(rollbackFor = Exception.class) public void update(UnitDTO dto) { Unit entity = ConvertUtils.sourceToTarget(dto, Unit.class); + BaseSupportUtils.setUpdateCommonField(entity); updateById(entity); } diff --git a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java index 07008f9..76ec41c 100644 --- a/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java +++ b/ym-baisc/src/main/java/com/cnbm/basic/service/impl/WorkingProcedureServiceImpl.java @@ -3,6 +3,7 @@ package com.cnbm.basic.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.cnbm.admin.utils.BaseSupportUtils; import com.cnbm.basic.dto.UnitDTO; import com.cnbm.basic.dto.WorkingProcedureTypeDTO; import com.cnbm.basic.entity.Machine; @@ -107,6 +108,7 @@ public class WorkingProcedureServiceImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - if(params.get("startTime")!=null && params.get("endTime")!=null){ + if( ObjectUtils.isNotNull(params.get("startTime")) && ObjectUtils.isNotNull(params.get("endTime"))){ LocalDateTime startTime = LocalDate.parse(params.get("startTime").toString(),df).atStartOfDay(); LocalDateTime endTime = LocalDate.parse(params.get("endTime").toString(),df).atStartOfDay(); wrapper.between(startTime!=null && endTime!=null,"create_time", startTime, endTime); @@ -191,6 +192,7 @@ public class InspectionSheetServiceImpl extends CrudServiceImpl