增加营收字段
parent
d6cbc62e5c
commit
8b249f37a0
|
|
@ -36,10 +36,15 @@ public class MoneyAccountEntity {
|
|||
private Long stationId;
|
||||
|
||||
/**
|
||||
* 资金
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 营收
|
||||
*/
|
||||
private BigDecimal revenue;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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号之间的订单调账");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue