|
@@ -133,6 +133,7 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public DingStatisticResult findDingStatistic(Long serviceId, String sopNo, Long userId) {
|
|
public DingStatisticResult findDingStatistic(Long serviceId, String sopNo, Long userId) {
|
|
|
|
+ boolean isCoordinator = tbUserArchivesService.containsRegionCoordinator(userId);
|
|
// 截取年分割截止
|
|
// 截取年分割截止
|
|
final int yearEnd = 4;
|
|
final int yearEnd = 4;
|
|
// 截取日分割开始
|
|
// 截取日分割开始
|
|
@@ -214,11 +215,14 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
String endDate = dateFormDto.getEndDate();
|
|
String endDate = dateFormDto.getEndDate();
|
|
endDate = endDate.substring(dayStart);
|
|
endDate = endDate.substring(dayStart);
|
|
|
|
|
|
- // TODO: 2024/9/4 更改补卡记录
|
|
|
|
// 查询正在补卡中的记录
|
|
// 查询正在补卡中的记录
|
|
- List<TBDingApply> resigningList = tbDingApplyService.list(
|
|
|
|
- new QueryWrapper<TBDingApply>().lambda().select(TBDingApply::getType, TBDingApply::getApplyTime).eq(TBDingApply::getSopNo, sopNo).eq(TBDingApply::getCreateId, userId)
|
|
|
|
- .isNull(TBDingApply::getApprove));
|
|
|
|
|
|
+ QueryWrapper<TBDingApply> dingApplyQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ dingApplyQueryWrapper.lambda().select(TBDingApply::getType, TBDingApply::getApplyTime).eq(TBDingApply::getServiceId, serviceId).eq(TBDingApply::getCreateId, userId)
|
|
|
|
+ .isNull(TBDingApply::getApprove);
|
|
|
|
+ if (SystemConstant.strNotNull(sopNo)) {
|
|
|
|
+ dingApplyQueryWrapper.lambda().eq(TBDingApply::getSopNo, sopNo);
|
|
|
|
+ }
|
|
|
|
+ List<TBDingApply> resigningList = tbDingApplyService.list(dingApplyQueryWrapper);
|
|
|
|
|
|
for (String date : dateFormList) {
|
|
for (String date : dateFormList) {
|
|
String year = date.substring(0, yearEnd);
|
|
String year = date.substring(0, yearEnd);
|
|
@@ -295,7 +299,7 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
dingStatisticResult.setDingFormList(formList);
|
|
dingStatisticResult.setDingFormList(formList);
|
|
dingStatisticResult.setWorkDays(workCount);
|
|
dingStatisticResult.setWorkDays(workCount);
|
|
dingStatisticResult.setExceptionCount(exceptionCount);
|
|
dingStatisticResult.setExceptionCount(exceptionCount);
|
|
- dingStatisticResult.setRemainCount(this.findRemainCount(userId, sopNo));
|
|
|
|
|
|
+ dingStatisticResult.setRemainCount(this.findRemainCount(userId, serviceId, sopNo));
|
|
return dingStatisticResult;
|
|
return dingStatisticResult;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -624,8 +628,9 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
Long endTime = dingTimeDto.getEndTime();
|
|
Long endTime = dingTimeDto.getEndTime();
|
|
- result.setDateFormList(DateDisposeUtils.getDaysBetween(startTime, Math.min(currentTime, endTime),
|
|
|
|
- SystemConstant.DEFAULT_DATE_YMD_S_PATTERN));
|
|
|
|
|
|
+ dateList = DateDisposeUtils.getDaysBetween(startTime, Math.min(currentTime, endTime),
|
|
|
|
+ SystemConstant.DEFAULT_DATE_YMD_S_PATTERN);
|
|
|
|
+ result.setDateFormList(dateList);
|
|
}
|
|
}
|
|
if (CollectionUtils.isNotEmpty(dateList)) {
|
|
if (CollectionUtils.isNotEmpty(dateList)) {
|
|
result.setEndDate(dateList.get(0));
|
|
result.setEndDate(dateList.get(0));
|
|
@@ -642,14 +647,20 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public DingElementResult findDingRule(Long userId, Long serviceUnitId) {
|
|
public DingElementResult findDingRule(Long userId, Long serviceUnitId) {
|
|
|
|
+ boolean isCoordinator = tbUserArchivesService.containsRegionCoordinator(userId);
|
|
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.isNotEmpty(dingGroupIds)) {
|
|
if (CollectionUtils.isNotEmpty(dingGroupIds)) {
|
|
- List<SysDingObj> sysDingObjList = sysDingObjService.list(
|
|
|
|
- new QueryWrapper<SysDingObj>().lambda().in(SysDingObj::getDingGroupId, dingGroupIds)
|
|
|
|
- .eq(SysDingObj::getSopRoleType, SopRoleTypeEnum.ENGINEER)
|
|
|
|
- .eq(SysDingObj::getType, DingObjTypeEnum.DING));
|
|
|
|
|
|
+ QueryWrapper<SysDingObj> sysDingObjQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ sysDingObjQueryWrapper.lambda().in(SysDingObj::getDingGroupId, dingGroupIds)
|
|
|
|
+ .eq(SysDingObj::getType, DingObjTypeEnum.DING);
|
|
|
|
+ if (isCoordinator) {
|
|
|
|
+ sysDingObjQueryWrapper.lambda().eq(SysDingObj::getSopRoleType, SopRoleTypeEnum.REGION_COORDINATOR);
|
|
|
|
+ } else {
|
|
|
|
+ sysDingObjQueryWrapper.lambda().eq(SysDingObj::getSopRoleType, SopRoleTypeEnum.ENGINEER);
|
|
|
|
+ }
|
|
|
|
+ List<SysDingObj> sysDingObjList = sysDingObjService.list(sysDingObjQueryWrapper);
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(sysDingObjList) && sysDingObjList.size() == 1) {
|
|
if (CollectionUtils.isNotEmpty(sysDingObjList) && sysDingObjList.size() == 1) {
|
|
dingElementResultList = dingElementResultList.stream()
|
|
dingElementResultList = dingElementResultList.stream()
|
|
@@ -664,10 +675,10 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public int findRemainCount(Long userId, String sopNo) {
|
|
|
|
- DingElementResult dingElementResult = this.findDingRule(userId, sopNo);
|
|
|
|
|
|
+ public int findRemainCount(Long userId, Long serviceId, String sopNo) {
|
|
|
|
+ DingElementResult dingElementResult = this.findDingRule(userId, serviceId);
|
|
int reissueCardCount = dingElementResult != null ? dingElementResult.getReissueCardCount() : 0;
|
|
int reissueCardCount = dingElementResult != null ? dingElementResult.getReissueCardCount() : 0;
|
|
- int applyCount = this.baseMapper.findDingExceptionApplyCount(userId, sopNo);
|
|
|
|
|
|
+ int applyCount = this.baseMapper.findDingExceptionApplyCount(userId, serviceId, sopNo);
|
|
return reissueCardCount != 0 ? reissueCardCount - applyCount : 0;
|
|
return reissueCardCount != 0 ? reissueCardCount - applyCount : 0;
|
|
}
|
|
}
|
|
|
|
|