feat(oa): 添加今日报工重复检查及排班列表排序
- 在项目报工插入已报工前增加今日是否的检查逻辑- 若今日已存在报工记录,则抛出异常阻止重复提交 - 对排班列表查询条件增加按创建时间倒序排列功能
This commit is contained in:
@@ -114,6 +114,17 @@ public class OaProjectReportServiceImpl implements IOaProjectReportService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(OaProjectReportBo bo) {
|
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);
|
OaProjectReport add = BeanUtil.toBean(bo, OaProjectReport.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
add.setUserId(LoginHelper.getUserId());
|
add.setUserId(LoginHelper.getUserId());
|
||||||
@@ -124,6 +135,7 @@ public class OaProjectReportServiceImpl implements IOaProjectReportService {
|
|||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改项目报工
|
* 修改项目报工
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ public class OaReportScheduleServiceImpl implements IOaReportScheduleService {
|
|||||||
lqw.eq(StringUtils.isNotBlank(bo.getAccessory()), OaReportSchedule::getAccessory, bo.getAccessory());
|
lqw.eq(StringUtils.isNotBlank(bo.getAccessory()), OaReportSchedule::getAccessory, bo.getAccessory());
|
||||||
lqw.eq(bo.getSort() != null, OaReportSchedule::getSort, bo.getSort());
|
lqw.eq(bo.getSort() != null, OaReportSchedule::getSort, bo.getSort());
|
||||||
lqw.eq(bo.getStatus() != null, OaReportSchedule::getStatus, bo.getStatus());
|
lqw.eq(bo.getStatus() != null, OaReportSchedule::getStatus, bo.getStatus());
|
||||||
|
// 按照创建时间倒序排列
|
||||||
|
lqw.orderByDesc(OaReportSchedule::getCreateTime);
|
||||||
|
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user