|
@@ -236,9 +236,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
|
|
|
//新增或编辑报告
|
|
|
@Override
|
|
|
- public HttpRespMsg editReport(List<Report> reportList) {
|
|
|
+ public HttpRespMsg editReport(Integer[] projectIds, List<Report> reportList, String date) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
for (Report report : reportList) {
|
|
|
+ //获取一下信息
|
|
|
if (report.getWorkingTime() <= 0.0) {
|
|
|
httpRespMsg.setError("工作时长必须大于零");
|
|
|
return httpRespMsg;
|
|
@@ -255,6 +256,18 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (reportList.size() > 0 && date != null) {
|
|
|
+ List<Integer> idList = new ArrayList<>();
|
|
|
+ for (Integer id : projectIds) {
|
|
|
+ if (id != -1) {
|
|
|
+ idList.add(id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reportMapper.delete(new QueryWrapper<Report>()
|
|
|
+ .eq("create_date", date)
|
|
|
+ .eq("creator_id", reportList.get(0).getCreatorId())
|
|
|
+ .notIn("id", idList));
|
|
|
+ }
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|