From 8b249f37a0a4720861adaaf52fd22a4757333b20 Mon Sep 17 00:00:00 2001 From: ljw Date: Tue, 11 Nov 2025 11:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=90=A5=E6=94=B6=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../money/pojo/entity/MoneyAccountEntity.java | 7 ++++++- .../order/service/AccountRegulationService.java | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/njzscloud-svr/src/main/java/com/njzscloud/supervisory/money/pojo/entity/MoneyAccountEntity.java b/njzscloud-svr/src/main/java/com/njzscloud/supervisory/money/pojo/entity/MoneyAccountEntity.java index 8dc59f2..e0bbff3 100644 --- a/njzscloud-svr/src/main/java/com/njzscloud/supervisory/money/pojo/entity/MoneyAccountEntity.java +++ b/njzscloud-svr/src/main/java/com/njzscloud/supervisory/money/pojo/entity/MoneyAccountEntity.java @@ -36,10 +36,15 @@ public class MoneyAccountEntity { private Long stationId; /** - * 资金 + * 余额 */ private BigDecimal money; + /** + * 营收 + */ + private BigDecimal revenue; + /** * 修改时间 */ diff --git a/njzscloud-svr/src/main/java/com/njzscloud/supervisory/order/service/AccountRegulationService.java b/njzscloud-svr/src/main/java/com/njzscloud/supervisory/order/service/AccountRegulationService.java index 439c83d..107d5a4 100644 --- a/njzscloud-svr/src/main/java/com/njzscloud/supervisory/order/service/AccountRegulationService.java +++ b/njzscloud-svr/src/main/java/com/njzscloud/supervisory/order/service/AccountRegulationService.java @@ -47,14 +47,14 @@ public class AccountRegulationService { .eq(OrderInfoEntity::getTransCompanyId, param.getCompanyId())); Assert.notNull(order, () -> Exceptions.clierr("当前客户不存在该笔订单,请检查订单号是否正确")); - // 判断订单创建时间是否在当月 + // 判断订单创建时间是否在上个月1号和本月26号之间 LocalDateTime createTime = order.getCreateTime(); if (createTime != null) { - YearMonth orderMonth = YearMonth.from(createTime); - YearMonth currentMonth = YearMonth.now(); - boolean isCurrentMonth = orderMonth.equals(currentMonth); - if (!isCurrentMonth) { - throw Exceptions.clierr("只能对当月订单调账"); + LocalDateTime lastMonthFirstDay = YearMonth.now().minusMonths(1).atDay(1).atStartOfDay(); + LocalDateTime currentMonth26th = YearMonth.now().atDay(26).atTime(23, 59, 59); + boolean isInRange = !createTime.isBefore(lastMonthFirstDay) && !createTime.isAfter(currentMonth26th); + if (!isInRange) { + throw Exceptions.clierr("只能对上月1号至本月26号之间的订单调账"); } }