Quellcode durchsuchen

按周填报报错bug,赛元考勤处理

QuYueTing vor 2 Monaten
Ursprung
Commit
9ab988fca9

+ 7 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -498,6 +498,13 @@ public class ReportController {
                 //自动扩充数组大小
                 projectAuditorId = Arrays.copyOf(projectAuditorId, projectId.length);
             }
+        } else {
+            //检查是否有为-的,表示没有审核人,需要手动转为null
+            for (int i = 0; i < projectAuditorId.length; i++) {
+                if (projectAuditorId[i].equals("-")) {
+                    projectAuditorId[i] = null;
+                }
+            }
         }
 
         if (overtimeHours == null) {

+ 10 - 5
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -1696,8 +1696,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                     //检查请假时间段是否在打卡的时间范围内
                                     if (baseMorningStart.equals(leaveStart) && baseMorningEnd.equals(leaveEnd)) {
                                         morningLeave = true;
-                                    } else if ((baseAfternoonStart.equals(leaveStart) || "14:00".equals(leaveStart)) && baseAfternoonEnd.equals(leaveEnd)) {
-                                        //补充14:00是因为企业微信传递的数据不规则,有时候下午请假正常是13:00-18:00,有时候是14:00-18:00
+                                    } else if ((baseAfternoonStart.equals(leaveStart) || (corpInfo.getCompanyId() != 469 && "14:00".equals(leaveStart))) && baseAfternoonEnd.equals(leaveEnd)) {
+                                        //补充14:00是因为企业微信传递的数据不规则(赛元微电子除外),有时候下午请假正常是13:00-18:00,有时候是14:00-18:00
                                         afternoonLeave = true;
                                     }
 
@@ -1745,6 +1745,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             timeDelta += ct.getOutdoorTime();
                         }
                         double workHours = 0;
+                        if (corpInfo.getCompanyId() == 469) {
+                            timeDelta = DateTimeUtil.getHoursFromDouble(timeDelta);
+                        }
+                        System.out.println("上下班间隔时长======="+timeDelta);
                         if (needRecaculate) {
                             workHours = timeDelta - ct.getAskLeaveTime();
                         } else {
@@ -1760,13 +1764,14 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                             ct.setStartTime(baseMorningStart);
                             ct.setEndTime(baseAfternoonEnd);
                         }
-                        if (showLog) System.out.println("工作时长==" + workHours);
-
                         if (corpInfo.getCompanyId() == 481) {
                             //给盛立安元0.5单位进位
                             ct.setWorkHours(DateTimeUtil.getHalfHoursFromDouble(workHours));
+                        } else if (corpInfo.getCompanyId() == 469) {
+                            //赛元微电子之前计算完间隔后,已经四舍五入过了,此处不需要再处理了
+                            ct.setWorkHours(workHours);
                         } else {
-                            ct.setWorkHours(DateTimeUtil.getHoursFromDouble(workHours));
+                            ct.setWorkHours(DateTimeUtil.getHalfHoursFromDouble(workHours));
                         }
 //                        if (showLog) System.out.println("ct.getStartTime()==" + ct.getStartTime()+", ct.getEndTime()="+ct.getEndTime());
 

+ 11 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1040,7 +1040,7 @@
                             <div v-if="scope.row.canFill == 1">
                                 <template v-if="user.company.packageProject == 0 && user.timeType.type == 1">
                                     <div v-if="reportTimeType.multiWorktime == 0" slot="reference">
-                                        <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)"></el-input-number>
+                                        <el-input-number v-model="scope.row[item.projectName].workingTime" size="small" :step="0.5" controls-position="right" step-strictly :min="0" :max="20" :disabled="[0, 1, '0', '1'].includes(scope.row[item.projectName].state)" @change="fillInThePedometerOnAWeeklyBasis(scope.$index)" @input="onInputWorkTime(scope.$index)"></el-input-number>
                                         <span v-if="scope.row[item.projectName].state != 3 && workReportStateString[scope.row[item.projectName].state]" :class="statusStyle[scope.row[item.projectName].state]">({{workReportStateString[scope.row[item.projectName].state]}})</span>
                                         <el-link type="primary" style="margin-left: 10px" @click="showWeekItemEdit(scope.row[item.projectName], scope.$index, item.id, item.projectName, workForm.domains)">编辑</el-link>
                                     </div>
@@ -6737,6 +6737,10 @@
                 const totalNum = collectionArray.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
                 this.zhoData[index].he = totalNum
             },
+            //输入工时触发
+            onInputWorkTime(index) {
+                const weeklyItem = this.zhoData[index] || {}
+            },
 
             // 按周填报里内容的填写
             showWeekItemEdit(item, i, projectId,names, row) {
@@ -7762,6 +7766,9 @@
                                         formData.append("createDate",zhoD.zhoDataTime)
                                         if (zhoD[j].projectAuditorId) {
                                             formData.append("projectAuditorId",zhoD[j].projectAuditorId)
+                                        } else {
+                                            //对齐数据
+                                            formData.append("projectAuditorId",'-');
                                         }
                                         if(zhoD[j].basecostId) {
                                             formData.append("basecostId", zhoD[j].basecostId);
@@ -7859,6 +7866,9 @@
                                         formData.append("createDate",zhoD.zhoDataTime)
                                         if (zhoD[j].projectAuditorId) {
                                             formData.append("projectAuditorId",zhoD[j].projectAuditorId)
+                                        } else {
+                                            //对齐数据
+                                            formData.append("projectAuditorId",'-')
                                         }
                                         if(zhoD[j].basecostId) {
                                             formData.append("basecostId", zhoD[j].basecostId);