feat(oa): 新增报工补录功能

- 在IOaProjectReportService接口中添加insertReportSupplement方法
- 在OaProjectReportController中新增reportSupplement接口- 在OaProjectReportServiceImpl中实现补录逻辑
- 支持前端传入经办人ID和报工时间
- 添加数据校验和保存逻辑
- 返回保存结果标志位
This commit is contained in:
2025-10-15 10:45:35 +08:00
parent 0717f05cf6
commit 048b9c5f14
3 changed files with 23 additions and 0 deletions

View File

@@ -199,4 +199,13 @@ public class OaProjectReportController extends BaseController {
OaProjectReportVo todayReport = iOaProjectReportService.getTodayReportByCurrentUser();
return R.ok(todayReport);
}
//补录接口新增接口
@Log(title = "报工补录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> reportSupplement(@Validated(AddGroup.class) @RequestBody OaProjectReportBo bo) {
return toAjax(iOaProjectReportService.insertReportSupplement(bo));
}
}

View File

@@ -73,4 +73,6 @@ public interface IOaProjectReportService {
* 查询当前登录用户今日的报工记录
*/
OaProjectReportVo getTodayReportByCurrentUser();
Boolean insertReportSupplement(OaProjectReportBo bo);
}

View File

@@ -253,4 +253,16 @@ public class OaProjectReportServiceImpl implements IOaProjectReportService {
// 转换为VO对象
return baseMapper.selectVoByIdPlus(report.getReportId());
}
@Override
public Boolean insertReportSupplement(OaProjectReportBo bo) {
//补录接口前端会传入经办人id还有报工时间也就是创建时间
OaProjectReport add = BeanUtil.toBean(bo, OaProjectReport.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setReportId(add.getReportId());
}
return flag;
}
}