|
@@ -21,8 +21,6 @@ import com.qmth.sop.common.util.FileUtil;
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
-import org.apache.ibatis.annotations.Param;
|
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -31,7 +29,6 @@ import java.io.IOException;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 考勤打卡表 服务实现.
|
|
* 考勤打卡表 服务实现.
|
|
@@ -508,24 +505,22 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
}
|
|
}
|
|
List<DingElementResult> dingElementResultList = this.baseMapper.findDingResultByUserId(userId, serviceUnitId);
|
|
List<DingElementResult> dingElementResultList = this.baseMapper.findDingResultByUserId(userId, serviceUnitId);
|
|
List<Long> dingGroupIds = dingElementResultList.stream().map(DingElementResult::getDingGroupId).distinct().collect(Collectors.toList());
|
|
List<Long> dingGroupIds = dingElementResultList.stream().map(DingElementResult::getDingGroupId).distinct().collect(Collectors.toList());
|
|
- if (CollectionUtils.isEmpty(dingGroupIds)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("缺少考勤组id");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- List<SysDingObj> sysDingObjList = sysDingObjService.list(new QueryWrapper<SysDingObj>()
|
|
|
|
- .lambda()
|
|
|
|
- .in(SysDingObj::getDingGroupId, dingGroupIds)
|
|
|
|
- .in(SysDingObj::getRoleId, roleIdList)
|
|
|
|
- .eq(SysDingObj::getType, DingObjTypeEnum.DING));
|
|
|
|
-
|
|
|
|
- if (CollectionUtils.isNotEmpty(sysDingObjList) && sysDingObjList.size() == 1) {
|
|
|
|
- dingElementResultList = dingElementResultList
|
|
|
|
- .stream()
|
|
|
|
- .filter(e -> e.getDingGroupId()
|
|
|
|
- .equals(sysDingObjList.get(0).getDingGroupId()))
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
- if (dingElementResultList.size() == 1) {
|
|
|
|
- return dingElementResultList.get(0);
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dingGroupIds)) {
|
|
|
|
+ List<SysDingObj> sysDingObjList = sysDingObjService.list(new QueryWrapper<SysDingObj>()
|
|
|
|
+ .lambda()
|
|
|
|
+ .in(SysDingObj::getDingGroupId, dingGroupIds)
|
|
|
|
+ .in(SysDingObj::getRoleId, roleIdList)
|
|
|
|
+ .eq(SysDingObj::getType, DingObjTypeEnum.DING));
|
|
|
|
+
|
|
|
|
+ if (CollectionUtils.isNotEmpty(sysDingObjList) && sysDingObjList.size() == 1) {
|
|
|
|
+ dingElementResultList = dingElementResultList
|
|
|
|
+ .stream()
|
|
|
|
+ .filter(e -> e.getDingGroupId()
|
|
|
|
+ .equals(sysDingObjList.get(0).getDingGroupId()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ if (dingElementResultList.size() == 1) {
|
|
|
|
+ return dingElementResultList.get(0);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return null;
|
|
return null;
|