|
@@ -18,6 +18,7 @@ import com.qmth.sop.business.service.*;
|
|
|
import com.qmth.sop.common.contant.SpringContextHolder;
|
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
|
import com.qmth.sop.common.enums.*;
|
|
|
+import com.qmth.sop.common.util.DateDisposeUtils;
|
|
|
import com.qmth.sop.common.util.GsonUtil;
|
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
|
import org.activiti.engine.TaskService;
|
|
@@ -89,6 +90,12 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
@Resource
|
|
|
TBDingStatisticService tbDingStatisticService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TBDingSubmitService tbDingSubmitService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ SysDingDateService sysDingDateService;
|
|
|
+
|
|
|
/**
|
|
|
* 新增考勤异常补卡申请
|
|
|
*
|
|
@@ -138,6 +145,10 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
tbDingApply.setCode(tfCustomFlowEntity.getCode(), tbDingApply.getAttachmentIdList(), sysUser.getId());
|
|
|
tfCustomFlowEntity.setObjId(tbDingApply.getId());
|
|
|
tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
|
|
|
+
|
|
|
+ if (!tbDingSubmitService.canUpdateDingSetting(sopNo, sysUser.getId())) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("考勤已提交,不能申请补卡");
|
|
|
+ }
|
|
|
TBUserArchives tbUserArchives = tbUserArchivesService.findByUserId(sysUser.getId());
|
|
|
tbDingStatisticService.buildDingStatistic(sopNo, tbUserArchives.getId());
|
|
|
return tbDingApplyService.save(tbDingApply);
|
|
@@ -328,6 +339,11 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
tbDing.setSignOutTime(tbDingApply.getApplyTime());
|
|
|
tbDing.setSignOutAddress("(补卡)");
|
|
|
}
|
|
|
+ if (Objects.isNull(tbDing.getDateType())) {
|
|
|
+ DingDateTypeEnum dateType = sysDingDateService.getDingDateType(
|
|
|
+ DateDisposeUtils.timestampToLocalDate(tbDingApply.getApplyTime()));
|
|
|
+ tbDing.setDateType(dateType);
|
|
|
+ }
|
|
|
tbDingService.updateById(tbDing);
|
|
|
} else {
|
|
|
TBCrm tbCrm = tbCrmService.getOne(
|
|
@@ -364,6 +380,9 @@ public class TBDingApplyServiceImpl extends ServiceImpl<TBDingApplyMapper, TBDin
|
|
|
tbDing.setSignOutTime(tbDingApply.getApplyTime());
|
|
|
tbDing.setSignOutAddress("(补卡)");
|
|
|
}
|
|
|
+ DingDateTypeEnum dateType = sysDingDateService.getDingDateType(
|
|
|
+ DateDisposeUtils.timestampToLocalDate(tbDingApply.getApplyTime()));
|
|
|
+ tbDing.setDateType(dateType);
|
|
|
tbDingService.save(tbDing);
|
|
|
tbDingApply.setDingId(tbDing.getId());
|
|
|
}
|