浏览代码

研发打卡修改

anderx 2 年之前
父节点
当前提交
36518e282b

+ 9 - 2
ruoyi-system/src/main/java/com/ruoyi/project/service/impl/ProjectStaffRecordServiceImpl.java

@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
 
 import javax.validation.Validator;
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicReference;
@@ -106,10 +107,16 @@ public class ProjectStaffRecordServiceImpl implements ProjectStaffRecordService
     public boolean updateCheckMaxDuation(ProjectStaffRecord in) {
         BigDecimal maxDuration= new BigDecimal(SecurityUtils.getLoginUser().getUser().getDept().getMaxDuration());
         String maxDurationProjectFlag = configService.selectConfigByKey("maxDurationProject");
-        Boolean maxflag = Boolean.parseBoolean(maxDurationProjectFlag);
         AtomicReference<Double> aDouble = new AtomicReference<>(0d);
         String date=DateUtils.getDate();
-        List<ProjectStaffRecord> projectStaffRecords = projectStaffRecordMapper.selectByPidAndAid(in.getPid(),in.getAid());
+        Boolean maxflag = Boolean.parseBoolean(maxDurationProjectFlag);
+        List<ProjectStaffRecord> projectStaffRecords;
+        if (maxflag){
+             projectStaffRecords = projectStaffRecordMapper.selectByPidAndAid(in.getPid(),in.getAid());
+        }else {
+            projectStaffRecords = projectStaffRecordMapper.selectByPidAndAid(null,in.getAid());
+        }
+
         projectStaffRecords.stream().forEach(e ->{
             String eDate= DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, e.getRecordTime());
             if (!e.getId().equals(in.getId())){