From 20291e71a4e527678f3c21480e40e6c2d95a9183 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 15 Jun 2021 14:54:37 +0800 Subject: [PATCH] =?UTF-8?q?screen=5Fproject=5Fdata=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E4=BA=BAID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/screen/ScreenProjectDataDTO.java | 5 ++++- .../evaluationindex/screen/ScreenProjectDataEntity.java | 5 +++++ .../toscreen/impl/ScreenProjectSettleServiceImpl.java | 1 + .../screen/impl/ScreenProjectDataServiceImpl.java | 5 ++++- .../epmet/service/impl/StaffPatrolRecordServiceImpl.java | 8 ++++++-- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java index 6c292909d2..1d42d5964f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -83,7 +83,10 @@ public class ScreenProjectDataDTO implements Serializable { * 事件时间 */ private Date projectCreateTime; - + /** + * 上报人ID + */ + private String linkUserId; /** * 上报人 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java index f58769cfe1..52e28cc095 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java @@ -79,6 +79,11 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity { */ private String projectCreateTime; + /** + * 上报人ID + */ + private String linkUserId; + /** * 上报人 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 6da4882ef5..a5e7e1c2f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -87,6 +87,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic //直接立项的话 项目内容是项目背景 经纬度添加 if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())){ meta.setProjectContent(projectInfo.getBackGround()); + meta.setLinkUserId(projectInfo.getCreatedBy()); meta.setLinkName(projectInfo.getCreatedBy()); if (StringUtils.isNotBlank(projectInfo.getLocateDimension())){ meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index baf94d5929..bf8c212f6b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -272,7 +272,10 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); - partition.forEach(part -> baseDao.insertBatch(part)); + partition.forEach(part -> { + List list = ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class); + insertBatch(list); + }); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java index eb7a8bb590..0001d51549 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; @@ -34,6 +35,7 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -187,9 +189,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl 0) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "巡查结束时间不能小于巡查开始时间"); } - record.setActrualEndTime(new Date()); record.setUpdatedTime(null); record.setPatrolEndTime(DateUtils.parse(formDTO.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN));