瀏覽代碼

工时导入,加入非工作日禁止填报的限制

seyason 1 周之前
父節點
當前提交
b99859610e

+ 6 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -5473,6 +5473,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
         CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, companyId));
         TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
+        Integer notAllowedOnNonWorkday = timeType.getNotAllowedOnNonWorkday();
         //对于存在预算成本的公司,暂不支持导入工时
         Company company = companyMapper.selectById(companyId);
         if (company.getPackageProject() == 1) {
@@ -5761,6 +5762,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                                 report.setCreateDate(LocalDate.parse(reportDate, dtf));
                                 report.setCost(reportCreator.getCost()==null?new BigDecimal(0) : reportCreator.getCost().multiply(new BigDecimal(time)));
+                                if (notAllowedOnNonWorkday == 1 && WorkDayCalculateUtils.isWorkDay(report.getCreateDate()) == false) {
+                                    //msg.setError("第"+dataCount+"行日期为非工作日,无法导入");
+                                    msg.setError(MessageUtils.message("report.nonWorkDay",dataCount, reportDate));
+                                    return msg;
+                                }
                                 reportList.add(report);
                                 curRowTotalTime += time;
                             } else if (time < 0) {

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties

@@ -338,6 +338,7 @@ report.hourReportNoFilled=您{0}的工时报告还未填写
 report.lackCardTime=缺少考勤时长: {0}
 report.timeReachLimitError=填报工时不可超过考勤时长: {0}
 report.financial_report=财务已完成对{0}月日报的审核,无法提交。
+report.nonWorkDay=第{0}行日期{1}为非工作日,无法导入
 #模板相关
 Template.subProject=子项目
 Template.AlreadyExists=该模板名称已存在

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties

@@ -338,6 +338,7 @@ report.hourReportNoFilled=Your work hour report for {0} has not been completed.
 report.lackCardTime=Lack attendance record: {0}
 report.timeReachLimitError=Report working time cannot be larger than attendance time: {0}
 report.financial_report=The financial department has completed the review of reports in {0}, it cannot be submitted.
+report.nonWorkDay=Line:{0},date[{1}] is not a workday, please check.
 #模板相关
 Template.subProject=subproject
 Template.AlreadyExists=The template name already exists.