时间戳处理

This commit is contained in:
tianfeng 2025-12-11 20:08:07 +08:00
parent 45e963bb0f
commit 99369493b4

View File

@ -16,6 +16,8 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import com.red.circle.tool.core.date.TimestampUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@ -154,8 +156,8 @@ public class CpRelationshipServiceImpl extends
.setAmount(BigDecimal.ZERO)
.setStatus(CpRelationshipStatus.NORMAL.name())
.setDismissTime(null);
cpUser.setCreateTime(LocalDateUtils.nowTimestamp());
cpUser.setUpdateTime(LocalDateUtils.nowTimestamp());
cpUser.setCreateTime(TimestampUtils.now());
cpUser.setUpdateTime(TimestampUtils.now());
return cpUser;
}
@ -181,11 +183,10 @@ public class CpRelationshipServiceImpl extends
@Override
public void updateToDismissing(Long userId, Long cpUserId) {
Timestamp now = LocalDateUtils.nowTimestamp();
update()
.set(CpRelationship::getStatus, CpRelationshipStatus.DISMISSING.name())
.set(CpRelationship::getDismissTime, now.getTime())
.set(CpRelationship::getUpdateTime, now)
.set(CpRelationship::getDismissTime, TimestampUtils.now().getTime())
.set(CpRelationship::getUpdateTime, TimestampUtils.now())
.and(where -> where
.nested(w -> w.eq(CpRelationship::getUserId, userId).eq(CpRelationship::getCpUserId, cpUserId))
.or()
@ -197,11 +198,10 @@ public class CpRelationshipServiceImpl extends
@Override
public void reconcile(Long userId, Long cpUserId) {
Timestamp now = LocalDateUtils.nowTimestamp();
update()
.set(CpRelationship::getStatus, CpRelationshipStatus.NORMAL.name())
.set(CpRelationship::getDismissTime, null)
.set(CpRelationship::getUpdateTime, now)
.set(CpRelationship::getUpdateTime, TimestampUtils.now())
.and(where -> where
.nested(w -> w.eq(CpRelationship::getUserId, userId).eq(CpRelationship::getCpUserId, cpUserId))
.or()