浏览代码

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 年之前
父节点
当前提交
7018de31ee

+ 22 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1155,7 +1155,7 @@ public class ReportController {
         }
         //校验工作时长
         for (Report report : reportList) {
-            if (report.getWorkingTime() == null || report.getWorkingTime() <= 0.0) {
+            if (report.getWorkingTime() == null) {
                 HttpRespMsg httpRespMsg = new HttpRespMsg();
                 //httpRespMsg.setError("请填写工作时长");
                 httpRespMsg.setError(MessageUtils.message("profession.duration"));
@@ -1281,21 +1281,35 @@ public class ReportController {
         }
 
         //如果锁定工作时长上限的话,需要校验每日的合计工作时长
-        if (comTimeType.getLockWorktime() == 1) {
-            for (Report report : reportList) {
-                String creatorId = report.getCreatorId();
-                LocalDate cDate = report.getCreateDate();
-                //查找同一个人同一天的日报合计工作时长
-                double dailyWorktime = reportList.stream().filter(r->r.getCreatorId().equals(creatorId) && r.getCreateDate().isEqual(cDate)).mapToDouble(Report::getWorkingTime).sum();
-
+        for (Report report : reportList) {
+            String creatorId = report.getCreatorId();
+            LocalDate cDate = report.getCreateDate();
+            //查找同一个人同一天的日报合计工作时长
+            double dailyWorktime = reportList.stream().filter(r->r.getCreatorId().equals(creatorId) && r.getCreateDate().isEqual(cDate)).mapToDouble(Report::getWorkingTime).sum();
+            if (comTimeType.getLockWorktime() == 1) {
                 if (dailyWorktime > comTimeType.getAllday()) {
                     HttpRespMsg httpRespMsg = new HttpRespMsg();
                     //httpRespMsg.setError("每日工作时长不得超过"+comTimeType.getAllday()+"小时");
                     httpRespMsg.setError(MessageUtils.message("profession.MaxReportTimeError",comTimeType.getAllday()));
                     return httpRespMsg;
                 }
+            } else {
+                //校验上下限
+                if (dailyWorktime < comTimeType.getMinReportTime()) {
+                    HttpRespMsg httpRespMsg = new HttpRespMsg();
+                    //httpRespMsg.setError("每日工作时长不得超过"+comTimeType.getAllday()+"小时");
+                    httpRespMsg.setError("每日工作时长不得少于" + comTimeType.getMinReportTime() + "小时");
+                    return httpRespMsg;
+                } else if (dailyWorktime > comTimeType.getMaxReportTime()) {
+                    HttpRespMsg httpRespMsg = new HttpRespMsg();
+                    //httpRespMsg.setError("每日工作时长不得超过"+comTimeType.getAllday()+"小时");
+                    httpRespMsg.setError("每日工作时长不得超过" + comTimeType.getMaxReportTime() + "小时");
+                    return httpRespMsg;
+                }
             }
         }
+
+
         //校验填报工时
         List<Report> checkedUserDayList = new ArrayList<>();
         for (Report report : reportList) {

+ 4 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java

@@ -76,6 +76,7 @@ public class ExcelExportServiceImpl implements ExcelExportService {
         if(wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1){
             String mediaId = wxCorpInfoService.getTranslationMediaId(fileUrlSuffix);
             String jobId = wxCorpInfoService.syncTranslation(wxCorpInfo.getCorpid(),mediaId,fileUrlSuffix, null);
+            System.out.println("上传待转译文件到企业微信, jobId==" + jobId);
             int i = 0;
             String syncTranslationResult = null;
             /**
@@ -86,8 +87,10 @@ public class ExcelExportServiceImpl implements ExcelExportService {
             while (i < 30) {
                 if (i < 10) {
                     Thread.sleep(300);
-                } else {
+                } else if (i < 20){
                     Thread.sleep(1000);
+                } else {
+                    Thread.sleep(3000);
                 }
                 System.out.println("i=="+i+", "+LocalDateTime.now());
                 CorpwxJobResult corpwxJobResult = corpwxJobCenter.get(jobId);

+ 27 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -7383,8 +7383,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         //需要填报的最后一天
         LocalDate lastDayOfWeek = sunday;
         int days = sunday.lengthOfMonth() - sunday.getDayOfMonth();
-        if (days <= 2) {
-            //周日距离月底相差天数在2天以内,比如周日是10.29,则10.30和10.31也算在本周内
+        if (days <= 3) {
+            //周日距离月底相差天数在3天以内,比如周日是10.28,则10.29,10.30和10.31也算在本周内
             lastDayOfWeek = sunday.plusDays(days);
         }
         //如果上周只有2天以内工作日,需要并到这周来
@@ -7392,7 +7392,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         LocalDate lastSaturday = lastSunday.with(DayOfWeek.SATURDAY);
 
         if (WorkDayCalculateUtils.isWorkDay(lastSunday) && WorkDayCalculateUtils.isWorkDay(lastSaturday)) {
-            //上周周末两天是工作日,并且只有2天以内工作日,需要并到这周来
+            //合并上周的工作日的情况:上周周末两天是工作日,并且只有2天以内工作日,需要并到这周来
             LocalDate lastMonday = lastSunday.with(DayOfWeek.MONDAY);
             boolean hasMoreWorkDays = false;
             while (lastMonday.isBefore(lastSaturday)) {
@@ -7405,15 +7405,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             if (!hasMoreWorkDays) {
                 firstDayOfWeek = lastSaturday;
             }
-        }
-        //如果本周一周二中有工作日,但是是上个月的月末,会被合并到上周去,本周要去掉
-        if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
-            firstDayOfWeek = firstDayOfWeek.plusDays(1);
-            if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
-                firstDayOfWeek = firstDayOfWeek.plusDays(1);
+        } else {
+            //剔除被合并到上周的情况,如果本周一周二周三中有工作日,但是是上个月的月末,会被合并到上周去,本周要去掉
+            boolean hasFirstDayOfMonth = false;
+            LocalDate checkDate = firstDayOfWeek;
+            int beforeDays = 0;
+            while (!checkDate.isAfter(lastDayOfWeek)) {
+                if (checkDate.getDayOfMonth() == 1) {
+                    hasFirstDayOfMonth = true;
+                    break;
+                } else {
+                    beforeDays++;
+                }
+                checkDate = checkDate.plusDays(1);
+            }
+            if (hasFirstDayOfMonth && beforeDays <= 3) {
+                firstDayOfWeek = checkDate;
             }
         }
 
+//        if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
+//            firstDayOfWeek = firstDayOfWeek.plusDays(1);
+//            if (WorkDayCalculateUtils.isWorkDay(firstDayOfWeek) && firstDayOfWeek.getDayOfMonth() >= 30) {
+//                firstDayOfWeek = firstDayOfWeek.plusDays(1);
+//            }
+//        }
+
+
         //再按照当前用户的入职离职日期进行过滤
         LocalDate entryDate = user.getInductionDate();
         LocalDate leaveDate = user.getInactiveDate();

+ 1 - 10
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -142,18 +142,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         if (report.getFinishNum() == null) {
             report.setFinishNum(0.0);
         }
-//        LocalDate today = LocalDate.now();
         LocalDate targetDate = report.getCreateDate();
-//        if (report.getId() == null) {
-//            report.setCreateDate(today);
-//            targetDate = today;
-//        } else {
-//            Report report1 = reportMapper.selectById(report.getId());
-//            targetDate = report1.getCreateDate();
-//            report.setCreateDate(report1.getCreateDate());
-//        }
         report.setCompanyId(companyId);
-
         Plan plan = planMapper.selectById(report.getPlanId());
         if (plan.getNum() == 0) {
             httpRespMsg.setError("该计划件数为0,无法报工");
@@ -270,6 +260,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         if (isAllFinish) {
             //该计划下的所有工序都已经完成了,那么该计划就是完成状态
             plan.setRealEndDate(LocalDate.now());
+            plan.setHideState(1);//完成的隐藏掉
             planMapper.updateById(plan);
         }
         return httpRespMsg;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/workView/fillReport.vue

@@ -182,7 +182,7 @@ export default {
         //完成件数为小数时,如果勾选了钢印号需要二次确认
         this.$dialog.confirm({
                     title: '提醒',
-                    message: '检测到件数为小数同时勾选了钢印号,确认该钢印号已完成吗?'
+                    message: '检测到件数为小数同时勾选了钢印号,确认该钢印号已完成吗?'
                 }).then(() => {
                     this.submitData();
                 }).catch(() => {});

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -911,7 +911,7 @@
   "imitillingtime": "Max report time",
   "minReportTime": "Min report time",
   "lockingworkinghours": "Lock working hours",
-  "chargedtocost": "Overtime hours charged to cost",
+  "chargedtocost": "Overtime hours produce extra cost",
   "hourscanbereported": "Reportable overtime hours",
   "workSettings": "Overtime settings",
   "bei-gong-zi": "double salary",

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -917,7 +917,7 @@
   "minReportTime": "工时下限",
   "workSettings": "加班设置",
   "hourscanbereported": "可填报加班时长",
-  "chargedtocost": "加班工时记入成本",
+  "chargedtocost": "加班产生额外成本",
   "bei-gong-zi": "倍工资",
   "visittwo": "方式二:直接录入时薪",
   "timeemployees": "(适合计时发放酬劳的小时工,兼职员工)",