|
@@ -22,7 +22,6 @@ import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
@@ -174,24 +173,26 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
String endDate = dateFormDto.getEndDate();
|
|
|
|
|
|
for (String date : dateFormList) {
|
|
|
+ String year = date.substring(0, 4);
|
|
|
+ String signDate = date.substring(5);
|
|
|
+
|
|
|
List<DingFormResult> dingFormResultList = formDingList.stream()
|
|
|
- .filter(e -> date.equals(e.getSignDate()))
|
|
|
+ .filter(e -> signDate.equals(e.getSignDate()))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
DingFormResult dingFormResult = new DingFormResult();
|
|
|
- dingFormResult.setSignDate(date);
|
|
|
if (CollectionUtils.isNotEmpty(dingFormResultList)) {
|
|
|
// 有这一天的打卡记录
|
|
|
dingFormResult = dingFormResultList.get(0);
|
|
|
// 考勤异常天数增加
|
|
|
if (dingFormResult.getSignInInfo().getStatus().equals(DingStatusEnum.NO_SIGN)) {
|
|
|
- if (!endDate.equals(date)) {
|
|
|
+ if (!endDate.equals(signDate)) {
|
|
|
exceptionCount++;
|
|
|
dingFormResult.getSignInInfo().setStatus(DingStatusEnum.RE_SIGN);
|
|
|
}
|
|
|
}
|
|
|
if (dingFormResult.getSignOutInfo().getStatus().equals(DingStatusEnum.NO_SIGN)) {
|
|
|
- if (!endDate.equals(date)) {
|
|
|
+ if (!endDate.equals(signDate)) {
|
|
|
exceptionCount++;
|
|
|
dingFormResult.getSignOutInfo().setStatus(DingStatusEnum.RE_SIGN);
|
|
|
}
|
|
@@ -211,20 +212,21 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
dingFormResult.setSignOutInfo(out);
|
|
|
exceptionCount = exceptionCount + 2;
|
|
|
}
|
|
|
+ dingFormResult.setYear(year);
|
|
|
formList.add(dingFormResult);
|
|
|
}
|
|
|
}
|
|
|
SopCrmInfo sopCrmInfo = tbCrmService.findSopCrmInfoBySop(sopNo);
|
|
|
Long serviceUnitId = sopCrmInfo.getServiceUnitId();
|
|
|
DingElementResult dingElementResult = this.baseMapper.findDingResultByUserId(userId, serviceUnitId);
|
|
|
- Integer reissueCardCount = dingElementResult!=null?dingElementResult.getReissueCardCount():0;
|
|
|
+ int reissueCardCount = dingElementResult != null ? dingElementResult.getReissueCardCount() : 0;
|
|
|
int applyCount = this.baseMapper.findDingExceptionApplyCount(userId, sopNo);
|
|
|
|
|
|
DingStatisticResult dingStatisticResult = new DingStatisticResult();
|
|
|
dingStatisticResult.setDingFormList(formList);
|
|
|
dingStatisticResult.setWorkDays(workCount);
|
|
|
dingStatisticResult.setExceptionCount(exceptionCount);
|
|
|
- dingStatisticResult.setRemainCount(reissueCardCount!=0?reissueCardCount - applyCount:0);
|
|
|
+ dingStatisticResult.setRemainCount(reissueCardCount != 0 ? reissueCardCount - applyCount : 0);
|
|
|
return dingStatisticResult;
|
|
|
}
|
|
|
|
|
@@ -300,7 +302,7 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
history.setCreateId(userId);
|
|
|
tbDingHistoryService.save(history);
|
|
|
|
|
|
- if (faceOpen && !facePass){
|
|
|
+ if (faceOpen && !facePass) {
|
|
|
log.error("人脸识别不通过,score :" + score);
|
|
|
throw ExceptionResultEnum.ERROR.exception("人脸识别不通过!");
|
|
|
}
|
|
@@ -402,7 +404,7 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
public List<TBDingSubmitQueryResult> query(SysUser account, Long serviceId, String status, Long createId, String userName, Long supplierId, String custom, String sopNo, Long days) {
|
|
|
Long userId = account.getId();
|
|
|
DataPermissionDto dpr = sysUserService.buildUserDataPermission(userId);
|
|
|
- return this.baseMapper.query(serviceId, status, createId, userName, supplierId, custom, sopNo, days,dpr);
|
|
|
+ return this.baseMapper.query(serviceId, status, createId, userName, supplierId, custom, sopNo, days, dpr);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -451,10 +453,10 @@ public class TBDingServiceImpl extends ServiceImpl<TBDingMapper, TBDing> impleme
|
|
|
Long currentTime = System.currentTimeMillis();
|
|
|
|
|
|
if (FlowStatusEnum.FINISH.equals(flowStatusEnum)) {
|
|
|
- dateList = DateDisposeUtils.getDaysBetween(createTime, updateTime, SystemConstant.DEFAULT_DATE_DAY_PATTERN);
|
|
|
+ dateList = DateDisposeUtils.getDaysBetween(createTime, updateTime, SystemConstant.DEFAULT_DATE_YMD_S_PATTERN);
|
|
|
result.setSopIsEnd(true);
|
|
|
} else {
|
|
|
- dateList = DateDisposeUtils.getDaysBetween(createTime, currentTime, SystemConstant.DEFAULT_DATE_DAY_PATTERN);
|
|
|
+ dateList = DateDisposeUtils.getDaysBetween(createTime, currentTime, SystemConstant.DEFAULT_DATE_YMD_S_PATTERN);
|
|
|
result.setSopIsEnd(false);
|
|
|
}
|
|
|
dateList.sort(Collections.reverseOrder());
|