Преглед изворни кода

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

Min пре 1 година
родитељ
комит
2ed53f08a1

+ 10 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserWithBeisenController.java

@@ -234,11 +234,11 @@ public class UserWithBeisenController {
         JSONObject item = BeiSenUtils.getAttendanceStatisticWithUser(createDate,withBeisen.get().getUserId(), beisenConfig.getAppKey(), beisenConfig.getAppSecret());
         JSONArray allOverTimeList = BeiSenUtils.getScheduledOverTimeRangeList(createDate,createDate,withBeisen.get().getUserId(), beisenConfig.getAppKey(), beisenConfig.getAppSecret());
         //获取当前数据下的人员工号对应到工时管家
-        String cardNumber = item.getString("staffId");
-        Optional<User> first = userList.stream().filter(f -> f.getJobNumber().equals(cardNumber)).findFirst();
+        Optional<User> first = userList.stream().filter(f -> f.getJobNumber().equals(withBeisen.get().getJobNumber())).findFirst();
+        System.out.println("考勤数据:"+item.toString());
         //todo: 获取早晚打卡时间
-        String firstCard = item.getString("firstCard");
-        String lastCard = item.getString("lastCard");
+        String firstCard = item.getString("firstCardIncludeFillCheck").split(" ")[1];
+        String lastCard = item.getString("lastCardIncludeFillCheck").split(" ")[1];
         //获取最晚下班时间
         if(first.isPresent()){
             boolean workDay = WorkDayCalculateUtils.isWorkDay(LocalDate.parse(createDate,df));
@@ -249,6 +249,10 @@ public class UserWithBeisenController {
             if(beisen.isPresent()){
                 List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
                         && a.getIntValue("ApproveStatus") == 2).collect(Collectors.toList());
+                System.out.println("加班时长数据:"+overTimeList.toString());
+                for (JSONObject jsonObject : overTimeList) {
+                    System.out.println("加班时长:"+jsonObject.getDouble("ActualOverTimeDuration"));
+                }
                 if(overTimeList.size()>0){
                     double actualOverTimeDuration = overTimeList.stream().mapToDouble(i -> i.getDouble("ActualOverTimeDuration")).sum();
                     if(workDay){
@@ -271,6 +275,8 @@ public class UserWithBeisenController {
             }
             userFvTimeService.saveOrUpdate(userFvTime);
             msg.setData(userFvTime);
+        } else {
+            msg.setError("未找到对应员工信息:staffId="+withBeisen.get().getUserId());
         }
         return msg;
     }

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

@@ -182,6 +182,7 @@
     "exportingTimeStatistics": "Export labor statistics"
   },
   "other": {
+    "kaoqingTimeTip": "not include pending overtime and holiday time",
     "customerService": "Customer service",
     "sweepWeChatYards": "Sweep WeChat yards",
     "messageCenter": "message center",

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

@@ -184,6 +184,7 @@
     "exportingTimeStatistics": "导出工时统计"
   },
   "other": {
+    "kaoqingTimeTip": "工作时长不包含未审批加班及休假",
     "customerService": "咨询客服",
     "sweepWeChatYards": "微信扫码",
     "messageCenter": "消息中心",

+ 38 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -18,6 +18,9 @@
                                 <br>
                                 <span style="font-size:10px;text-align:center;color:#999;">{{item.weekDay}}</span>
                                 <span class="chooseDate" v-if="index == choseDay"></span>
+                                <!-- <el-tooltip v-if="index == choseDay" effect="dark" content="填报时长超过北森考勤时长" placement="top-start">
+                                <i class="el-icon-warning" style="color:red;"></i>
+                                </el-tooltip> -->
                                 </div>
                             </div>
                             </span>
@@ -401,7 +404,13 @@
                         <span v-if="reportTimeType.type == 3 && user.company.companyName != mingyiName">{{$t('time.hour')}}</span>
                         <!-- <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} {{jsTime.toFixed(1)}} {{$t('time.hour')}}</span> -->
                         <span v-if="isBatch && user.company.companyName != mingyiName">, {{$t('other.fillInTheTotal')}} <el-input v-model="jsTime" @change="onBatchTimeChange" style="width:80px;"/> {{$t('time.hour')}}</span>
-                        <span v-if="workForm.time">{{$t('other.attendancePunch')}}: {{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
+                        
+                        <!-- AI智能填报 -->
+                        <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
+                    </el-form-item>
+                    <!--考勤时长显示-->
+                    <el-form-item :label="$t('other.attendancePunch')" v-if="workForm.time || user.companyId == 5978">
+                        <span v-if="workForm.time">{{workForm.time.startTime}}-{{workForm.time.endTime}}, 工作{{workForm.time.workHours}}{{$t('time.hour')}}
                         <span v-if="workForm.time.askLeaveTime">|&nbsp;请假{{ workForm.time.askLeaveTime }}小时</span>
                         </span>
                         <!--批量填报和批量代填不显示考勤记录-->
@@ -414,8 +423,10 @@
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
                         v-if="isBatch && user.company.companyName === mingyiName" icon="el-icon-refresh" 
                                 @click="refreshAttendance(workForm.createDate)"></el-button>
-                        <!-- AI智能填报 -->
-                        <el-button type="primary" @click="getAIReport()" v-if="!hasWrittenReport" style="margin-left:5px;" >智能填报</el-button>
+                        <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
+                        v-if="!isBatch && user.companyId === 5978" icon="el-icon-refresh" 
+                                @click="refreshBeiSengAttendance(workForm.createDate)"></el-button>
+                        <span v-if="user.companyId==5978" style="margin-left:5px;color:#20a0ff;"><i class="el-icon-warning"></i>{{$t('other.kaoqingTimeTip')}}</span>
                     </el-form-item>
                     <!-- 000000 -->
                     <div v-for="(domain, index) in workForm.domains" :key="domain.id" :style="index>0?'margin-top:10px;':''">
@@ -2796,6 +2807,30 @@
                     })
                 })
             },
+            refreshBeiSengAttendance(workdate) {
+                 if (!workdate) return;
+                this.syncTimeLoading = true;
+                this.http.post('/user-with-beisen/syncAttendanceFromBeisen',{
+                    startDate: workdate,
+                    endDate: workdate
+                },res => {
+                    this.syncTimeLoading = false;
+                    if(res.code == 'ok'){
+                        this.workForm.time = res.data;
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.syncTimeLoading = false;
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
             weeklyFilledTimeClick(parameterDate){ //按周填报-已填工时-点击
                 this.weeklyFilledTimeDialog = true
                 this.weeklyFilledTimeLoading = true