feat(oa): 添加财务记录时间范围查询功能

- 在 SysOaFinanceBo 中增加 beginCreateTime 和 endCreateTime 字段
- 配置 JsonFormat 和 DateTimeFormat 注解以支持日期时间格式化
- 修改 SysOaFinanceServiceImpl 中的查询逻辑,使用 BO 对象中的时间字段进行范围查询
- 移除对 params 参数中时间字段的依赖,统一通过 BO 对象传递查询条件
This commit is contained in:
2025-12-13 11:35:57 +08:00
parent f70d330f91
commit cbd307160e
2 changed files with 11 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 进出账管理业务对象 sys_oa_finance
@@ -145,4 +146,12 @@ public class SysOaFinanceBo extends BaseEntity {
//cost_category varchar(32) 成本分类
private String costCategory;
//时间筛选 带时分秒的
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date beginCreateTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endCreateTime;
}

View File

@@ -199,8 +199,8 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
lqw.eq(StringUtils.isNotBlank(bo.getFinanceType()), "sof.finance_type", bo.getFinanceType());
lqw.eq(StringUtils.isNotBlank(bo.getSigningCompany()), "sof.signing_company", bo.getSigningCompany());
lqw.eq(Objects.nonNull(bo.getReceiveAccountId()) && bo.getReceiveAccountId()!=-1L, "sof.receive_account_id", bo.getReceiveAccountId());
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
"sof.create_time", params.get("beginCreateTime"), params.get("endCreateTime"));
lqw.between(bo.getBeginCreateTime()!= null && bo.getEndCreateTime()!= null,
"sof.create_time", bo.getBeginCreateTime(), bo.getEndCreateTime());
lqw.orderByDesc("create_time");
return lqw;
}