|
@@ -270,10 +270,18 @@ public class TBDingSubmitServiceImpl extends ServiceImpl<TBDingSubmitMapper, TBD
|
|
private void dingSubmitOperate(DingSubmitParam dingSubmitParam, DingSubmitOperateEnum dingSubmitOperateType) {
|
|
private void dingSubmitOperate(DingSubmitParam dingSubmitParam, DingSubmitOperateEnum dingSubmitOperateType) {
|
|
SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
String sopNo = dingSubmitParam.getSopNo();
|
|
String sopNo = dingSubmitParam.getSopNo();
|
|
|
|
+ Long serviceId = dingSubmitParam.getServiceUnitId();
|
|
Long userArchivesId = dingSubmitParam.getUserArchivesId();
|
|
Long userArchivesId = dingSubmitParam.getUserArchivesId();
|
|
- List<DingSubmitResult> dingSubmitResultList = this.baseMapper.findDingSubmitList(null, null, null,
|
|
|
|
|
|
+
|
|
|
|
+ // sopNo 为空,则表示为区协操作
|
|
|
|
+ boolean coordinatorOperate = !SystemConstant.strNotNull(sopNo);
|
|
|
|
+ List<DingSubmitResult> dingSubmitResultList = this.baseMapper.findDingSubmitList(serviceId, null, null,
|
|
userArchivesId, null, null, null, sopNo, null, null, null, null);
|
|
userArchivesId, null, null, null, sopNo, null, null, null, null);
|
|
|
|
|
|
|
|
+ if (coordinatorOperate) {
|
|
|
|
+ // 如果是区协操作,只过滤出sopNo为空的数据
|
|
|
|
+ dingSubmitResultList = dingSubmitResultList.stream().filter(e -> !SystemConstant.strNotNull(e.getSopNo())).collect(Collectors.toList());
|
|
|
|
+ }
|
|
if (dingSubmitResultList.size() != 1) {
|
|
if (dingSubmitResultList.size() != 1) {
|
|
throw ExceptionResultEnum.ERROR.exception(
|
|
throw ExceptionResultEnum.ERROR.exception(
|
|
String.format("未找到sop流水号为[%s],用户档案号为[%s]的考勤信息", sopNo, userArchivesId));
|
|
String.format("未找到sop流水号为[%s],用户档案号为[%s]的考勤信息", sopNo, userArchivesId));
|
|
@@ -328,25 +336,27 @@ public class TBDingSubmitServiceImpl extends ServiceImpl<TBDingSubmitMapper, TBD
|
|
}
|
|
}
|
|
|
|
|
|
// 条件3 - SOP结束后的第二天才能提交考勤
|
|
// 条件3 - SOP结束后的第二天才能提交考勤
|
|
- TFFlowApprove tfFlowApproves = tbDingService.findFlowApproveBySopNo(sopNo);
|
|
|
|
- FlowStatusEnum flowStatus = tfFlowApproves.getStatus();
|
|
|
|
- if (!FlowStatusEnum.FINISH.equals(flowStatus)) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception(
|
|
|
|
- String.format("服务单元为[%s],sop流水号为[%s],用户档案为[%s]的sop状态为[%s],sop结束后次日才能提交考勤", serviceUnitName,
|
|
|
|
- sopNo, userArchivesName, flowStatus.getTitle()));
|
|
|
|
- }
|
|
|
|
- Long endTime = tfFlowApproves.getUpdateTime();
|
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
|
- calendar.setTimeInMillis(endTime);
|
|
|
|
- calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
- calendar.set(Calendar.MINUTE, 0);
|
|
|
|
- calendar.set(Calendar.SECOND, 0);
|
|
|
|
- calendar.add(Calendar.DATE, 1);
|
|
|
|
- long nextDayEarliestTime = calendar.getTimeInMillis();
|
|
|
|
- if (System.currentTimeMillis() < nextDayEarliestTime) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception(
|
|
|
|
- String.format("服务单元为[%s],sop流水号为[%s],用户档案为[%s]的考勤还未到提交时间,sop结束后次日才能提交考勤", serviceUnitName,
|
|
|
|
- sopNo, userArchivesName));
|
|
|
|
|
|
+ if (!coordinatorOperate) {
|
|
|
|
+ TFFlowApprove tfFlowApproves = tbDingService.findFlowApproveBySopNo(sopNo);
|
|
|
|
+ FlowStatusEnum flowStatus = tfFlowApproves.getStatus();
|
|
|
|
+ if (!FlowStatusEnum.FINISH.equals(flowStatus)) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(
|
|
|
|
+ String.format("服务单元为[%s],sop流水号为[%s],用户档案为[%s]的sop状态为[%s],sop结束后次日才能提交考勤", serviceUnitName,
|
|
|
|
+ sopNo, userArchivesName, flowStatus.getTitle()));
|
|
|
|
+ }
|
|
|
|
+ Long endTime = tfFlowApproves.getUpdateTime();
|
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
|
+ calendar.setTimeInMillis(endTime);
|
|
|
|
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
|
+ calendar.set(Calendar.MINUTE, 0);
|
|
|
|
+ calendar.set(Calendar.SECOND, 0);
|
|
|
|
+ calendar.add(Calendar.DATE, 1);
|
|
|
|
+ long nextDayEarliestTime = calendar.getTimeInMillis();
|
|
|
|
+ if (System.currentTimeMillis() < nextDayEarliestTime) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(
|
|
|
|
+ String.format("服务单元为[%s],sop流水号为[%s],用户档案为[%s]的考勤还未到提交时间,sop结束后次日才能提交考勤", serviceUnitName,
|
|
|
|
+ sopNo, userArchivesName));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
Long submitId = dingSubmitResult.getSubmitId();
|
|
Long submitId = dingSubmitResult.getSubmitId();
|