Procházet zdrojové kódy

修改导入项目,导入日志,新增工时计算。

anderx před 1 rokem
rodič
revize
c5e828ca4a

+ 5 - 3
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -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("新增必须知道打卡项目编号"));
                     }

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectTaskServiceImpl.java

@@ -180,7 +180,7 @@ public class ProjectTaskServiceImpl   implements ProjectTaskService {
                         p.setAdminName(sysUser.getNickName());
                     }
                     projectTaskMapper.updateByPrimaryKeySelective(p);
-                    if (pids.contains(p.getId())){
+                    if (!pids.contains(p.getId())){
                         pids.add(p.getId());
                     }
                     successNum++;