|
|
@@ -502,9 +502,7 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
List<Long> pids=new ArrayList<>();
|
|
|
for (ProjectStaffRecordOut p : list){
|
|
|
try {
|
|
|
- if (pids.contains(p.getPid())){
|
|
|
- pids.add(p.getPid());
|
|
|
- }
|
|
|
+
|
|
|
// 验证是否存在
|
|
|
ProjectStaffRecord projectStaffRecord = projectStaffRecordMapper.selectByPrimaryKey(p.getId());
|
|
|
if (StringUtils.isNull(projectStaffRecord)){
|
|
|
@@ -520,10 +518,14 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(p.getProjectNumber())){
|
|
|
ProjectTask projectTask = projectTaskMapper.selectByProjectNumber(p.getProjectNumber(),companyId);
|
|
|
+
|
|
|
if (StringUtils.isNull(projectTask)){
|
|
|
throw new ServiceException(String.format("项目[%s]不存在",p.getProjectName()));
|
|
|
}
|
|
|
p.setPid(projectTask.getId());
|
|
|
+ if (!pids.contains(p.getPid())){
|
|
|
+ pids.add(p.getPid());
|
|
|
+ }
|
|
|
}else {
|
|
|
throw new ServiceException(String.format("新增必须知道打卡项目编号"));
|
|
|
}
|