feat(oa): 添加今日报工重复检查及排班列表排序

- 在项目报工插入已报工前增加今日是否的检查逻辑- 若今日已存在报工记录,则抛出异常阻止重复提交
- 对排班列表查询条件增加按创建时间倒序排列功能
This commit is contained in:
2025-10-11 15:14:19 +08:00
parent d5ec37ffcf
commit 5c54e9e169
2 changed files with 14 additions and 0 deletions

View File

@@ -114,6 +114,17 @@ public class OaProjectReportServiceImpl implements IOaProjectReportService {
*/
@Override
public Boolean insertByBo(OaProjectReportBo bo) {
// 检查今日是否已报工
OaProjectReportBo checkBo = new OaProjectReportBo();
checkBo.setUserId(LoginHelper.getUserId());
checkBo.setCreateTime(new Date());
QueryWrapper<OaProjectReport> queryWrapper = ClearbuildQueryWrapper(checkBo);
long count = baseMapper.selectCount(queryWrapper);
if (count > 0) {
throw new RuntimeException("今日已报工,不允许重复报工");
}
OaProjectReport add = BeanUtil.toBean(bo, OaProjectReport.class);
validEntityBeforeSave(add);
add.setUserId(LoginHelper.getUserId());
@@ -124,6 +135,7 @@ public class OaProjectReportServiceImpl implements IOaProjectReportService {
return flag;
}
/**
* 修改项目报工
*/

View File

@@ -87,6 +87,8 @@ public class OaReportScheduleServiceImpl implements IOaReportScheduleService {
lqw.eq(StringUtils.isNotBlank(bo.getAccessory()), OaReportSchedule::getAccessory, bo.getAccessory());
lqw.eq(bo.getSort() != null, OaReportSchedule::getSort, bo.getSort());
lqw.eq(bo.getStatus() != null, OaReportSchedule::getStatus, bo.getStatus());
// 按照创建时间倒序排列
lqw.orderByDesc(OaReportSchedule::getCreateTime);
return lqw;
}