|
|
@@ -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())){
|