From da7a4d799034ca244467665827bae91ca3c0252c Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 16 八月 2024 10:31:55 +0800
Subject: [PATCH] feat:数据中心展示
---
ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java
index 6a877dc..52af163 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java
@@ -64,6 +64,9 @@
@Override
public Result add(YwPointForm form) {
YwPoint entity = YwPointForm.getEntityByForm(form, null);
+ Date now = new Date();
+ entity.setCreateTime(now);
+ entity.setUpdateTime(now);
if(baseMapper.insert(entity) > 0) {
return Result.ok("娣诲姞鎴愬姛");
}
@@ -77,6 +80,9 @@
.forEach(form -> {
YwPoint entity = YwPointForm.getEntityByForm(form, null);
entity.setStatus("鏈紑濮�");
+ Date now = new Date();
+ entity.setCreateTime(now);
+ entity.setUpdateTime(now);
baseMapper.insert(entity);
});
return Result.ok("娣诲姞鎴愬姛");
@@ -89,6 +95,7 @@
new LambdaUpdateChainWrapper<>(baseMapper)
.in(YwPoint::getId, form.getIds())
.set(YwPoint::getUnitId, form.getUnitId())
+ .set(YwPoint::getUpdateTime, new Date())
.update();
} else {
new LambdaUpdateChainWrapper<>(baseMapper)
@@ -96,6 +103,7 @@
.set(YwPoint::getUnitId, form.getUnitId())
.set(YwPoint::getStartTime, null)
.set(YwPoint::getEndTime, null)
+ .set(YwPoint::getUpdateTime, new Date())
.update();
}
return Result.ok("淇敼鎴愬姛");
@@ -111,6 +119,8 @@
YwPoint entity = baseMapper.selectById(form.getId());
Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
BeanUtils.copyProperties(form, entity);
+ Date now = new Date();
+ entity.setUpdateTime(now);
baseMapper.updateById(entity);
return Result.ok("淇敼鎴愬姛");
}
@@ -214,6 +224,7 @@
return new LambdaUpdateChainWrapper<>(baseMapper)
.in(YwPoint::getSerialNumber, serialNumberList)
.set(YwPoint::getRecovery, recovery)
+ .set(YwPoint::getUpdateTime, new Date())
.set(recovery == 0, YwPoint::getRecoveryTime, DateUtils.getNowDate())
.update();
}
--
Gitblit v1.8.0