增加营收字段

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 BigDecimal money;
/**
*
*/
private BigDecimal revenue;
/**
*
*/

View File

@ -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号之间的订单调账");
}
}