增加营收字段

master
ljw 2025-11-11 11:53:05 +08:00
parent d6cbc62e5c
commit 8b249f37a0
2 changed files with 12 additions and 7 deletions

View File

@ -36,10 +36,15 @@ public class MoneyAccountEntity {
private Long stationId; private Long stationId;
/** /**
* *
*/ */
private BigDecimal money; private BigDecimal money;
/**
*
*/
private BigDecimal revenue;
/** /**
* *
*/ */

View File

@ -47,14 +47,14 @@ public class AccountRegulationService {
.eq(OrderInfoEntity::getTransCompanyId, param.getCompanyId())); .eq(OrderInfoEntity::getTransCompanyId, param.getCompanyId()));
Assert.notNull(order, () -> Exceptions.clierr("当前客户不存在该笔订单,请检查订单号是否正确")); Assert.notNull(order, () -> Exceptions.clierr("当前客户不存在该笔订单,请检查订单号是否正确"));
// 判断订单创建时间是否在当月 // 判断订单创建时间是否在上个月1号和本月26号之间
LocalDateTime createTime = order.getCreateTime(); LocalDateTime createTime = order.getCreateTime();
if (createTime != null) { if (createTime != null) {
YearMonth orderMonth = YearMonth.from(createTime); LocalDateTime lastMonthFirstDay = YearMonth.now().minusMonths(1).atDay(1).atStartOfDay();
YearMonth currentMonth = YearMonth.now(); LocalDateTime currentMonth26th = YearMonth.now().atDay(26).atTime(23, 59, 59);
boolean isCurrentMonth = orderMonth.equals(currentMonth); boolean isInRange = !createTime.isBefore(lastMonthFirstDay) && !createTime.isAfter(currentMonth26th);
if (!isCurrentMonth) { if (!isInRange) {
throw Exceptions.clierr("只能对当月订单调账"); throw Exceptions.clierr("只能对上月1号至本月26号之间的订单调账");
} }
} }