瀏覽代碼

钉钉考勤刷新

QuYueTing 8 月之前
父節點
當前提交
0e532a18d3

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java

@@ -190,6 +190,10 @@ public class DingDingController {
         dingDingService.syncCardTime(companyId, userId, startDate, endDate);
         return new HttpRespMsg();
     }
+    @RequestMapping("/refreshUserCardTime")
+    public HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date) {
+        return dingDingService.refreshUserCardTime(companyId, userId, date);
+    }
 //
 //    @RequestMapping("/syncLeaveTime")
 //    public HttpRespMsg syncLeaveTime(Integer companyId, String userId, String startDate, String endDate) {

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java

@@ -60,4 +60,6 @@ public interface DingDingService {
     String getSyncTranslationResult(String jobId,CompanyDingding dingding) throws Exception;
 
     HttpRespMsg getAuthInfo(String corpid) throws Exception;
+
+    HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date);
 }

+ 13 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -2714,6 +2714,19 @@ public class DingDingServiceImpl implements DingDingService {
         return msg;
     }
 
+    @Override
+    public HttpRespMsg refreshUserCardTime(Integer companyId, String userId, String date) {
+        CompanyDingding dingding = companyDingdingMapper.selectOne(new QueryWrapper<CompanyDingding>().eq("company_id", companyId));
+        syncOneComp(dingding, userId, date, date);
+        HttpRespMsg msg = new HttpRespMsg();
+        //查询考勤记录
+        List<UserDingdingTime> timeList = userDingdingTimeMapper.selectList(new QueryWrapper<UserDingdingTime>().eq("company_id", companyId).eq("user_id", userId).eq("work_date", date));
+        if (timeList.size() > 0) {
+            msg.setData(timeList.get(0));
+        }
+        return msg;
+    }
+
     private boolean judgeIsLeader(String userId) {
         int cnt = projectAuditorMapper.selectCount(new QueryWrapper<ProjectAuditor>().eq("auditor_id", userId));
         return cnt>0;

+ 37 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -395,10 +395,6 @@
                                 {{$t('defaultText.pleaseSelectAsubstitute')}}
                             </span>
                         </div>
-                        <!-- <el-radio-group v-model="singleDate" style="margin-left:10px;">
-                            <el-radio :label="1">单日代填</el-radio>
-                            <el-radio :label="2">多日代填</el-radio>
-                        </el-radio-group> -->
                     </el-form-item>
                     <el-form-item :label="$t('screening.workingDate')" prop="createDate">
                         <el-date-picker v-model="workForm.createDate" :editable="false" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
@@ -430,11 +426,15 @@
                         v-if="!isBatch && user.timeType.syncCorpwxTime==1 && !isSubstitude" icon="el-icon-refresh" 
                                 @click="refreshWXCardTime(workForm.createDate)"></el-button>
                         <el-button type="default" style="margin-left:5px;" size="small" :loading="syncTimeLoading" 
+                        v-if="!isBatch && user.timeType.syncDingding==1 && !isSubstitude" icon="el-icon-refresh" 
+                                @click="refreshDDCardTime(workForm.createDate)"></el-button>
+                        <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>
                         <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 -->
@@ -3167,6 +3167,39 @@
                 let ma = ms / 1000 / 60 / 60
                 return ma;  //小时
             },
+            refreshDDCardTime(workdate) {
+                if (!workdate) return;
+                this.syncTimeLoading = true;
+                this.http.post('/dingding/refreshUserCardTime',{
+                    companyId: this.user.companyId,
+                    userId: this.user.id,
+                    date: workdate,
+                },res => {
+                    this.syncTimeLoading = false;
+                    if(res.code == 'ok'){
+                        if (!res.data) {
+                            this.$message({
+                                message: '获取考勤失败',
+                                type: 'error'
+                            })
+                        } else {
+                            this.workForm.time = res.data;
+                        }
+                        
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.syncTimeLoading = false;
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
             refreshWXCardTime(workdate) {
                 if (!workdate) return;
                 this.syncTimeLoading = true;