소스 검색

未填写人员增加考勤勾选

QuYueTing 4 달 전
부모
커밋
e3817931d2

+ 26 - 24
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ExcelExportServiceImpl.java

@@ -135,31 +135,33 @@ public class ExcelExportServiceImpl implements ExcelExportService {
                 System.out.println("i=="+i+", "+LocalDateTime.now());
                 System.out.println("i=="+i+", "+LocalDateTime.now());
                 //直接循环调用接口,后面需要改成通过redis获取jobId对应的消息,再去调用接口
                 //直接循环调用接口,后面需要改成通过redis获取jobId对应的消息,再去调用接口
                 Object map = redisUtil.getString("corpwxJobCenter"+jobId);
                 Object map = redisUtil.getString("corpwxJobCenter"+jobId);
-                JSONObject jsonObject = new JSONObject(map.toString());
-                System.out.println("通过redis获取到企业微信上传回调的数据=="+jsonObject);
-                String infoType = jsonObject.getString("InfoType");
-                if ("batch_job_result".equals(infoType)) {
-                    org.json.JSONObject batchJob = jsonObject.getJSONObject("BatchJob");
-                    String jobType = batchJob.getString("JobType");
-                    String authCorpId = jsonObject.getString("AuthCorpId");
-                    CorpwxJobResult corpwxJobResult = new CorpwxJobResult();
-                    corpwxJobResult.setAuthCorpId(authCorpId);
-                    corpwxJobResult.setErrCode(batchJob.getInt("ErrCode"));
-                    corpwxJobResult.setErrMsg(batchJob.getString("ErrMsg"));
-                    corpwxJobResult.setJobId(jobId);
-                    corpwxJobResult.setJobType(jobType);
-                    corpwxJobResultMapper.insert(corpwxJobResult);
-                    if (corpwxJobResult != null) {
-                        if (corpwxJobResult.getErrCode() == 0) {
-                            syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
-                            corpwxJobCenter.remove(jobId);
-                        } else {
-                            long t2 = System.currentTimeMillis();
-                            System.out.println("222企业微信转译报错:"+corpwxJobResult.getErrMsg()+",耗时:" + (t2 - t) + "ms");
-                            httpRespMsg.setError(corpwxJobResult.getErrMsg());
-                            return httpRespMsg;
+                if (map != null) {
+                    JSONObject jsonObject = new JSONObject(map.toString());
+                    System.out.println("通过redis获取到企业微信上传回调的数据=="+jsonObject);
+                    String infoType = jsonObject.getString("InfoType");
+                    if ("batch_job_result".equals(infoType)) {
+                        org.json.JSONObject batchJob = jsonObject.getJSONObject("BatchJob");
+                        String jobType = batchJob.getString("JobType");
+                        String authCorpId = jsonObject.getString("AuthCorpId");
+                        CorpwxJobResult corpwxJobResult = new CorpwxJobResult();
+                        corpwxJobResult.setAuthCorpId(authCorpId);
+                        corpwxJobResult.setErrCode(batchJob.getInt("ErrCode"));
+                        corpwxJobResult.setErrMsg(batchJob.getString("ErrMsg"));
+                        corpwxJobResult.setJobId(jobId);
+                        corpwxJobResult.setJobType(jobType);
+                        corpwxJobResultMapper.insert(corpwxJobResult);
+                        if (corpwxJobResult != null) {
+                            if (corpwxJobResult.getErrCode() == 0) {
+                                syncTranslationResult = wxCorpInfoService.getSyncTranslationResult(jobId);
+                                corpwxJobCenter.remove(jobId);
+                            } else {
+                                long t2 = System.currentTimeMillis();
+                                System.out.println("222企业微信转译报错:"+corpwxJobResult.getErrMsg()+",耗时:" + (t2 - t) + "ms");
+                                httpRespMsg.setError(corpwxJobResult.getErrMsg());
+                                return httpRespMsg;
+                            }
+                            break;
                         }
                         }
-                        break;
                     }
                     }
                 }
                 }
                 i++;
                 i++;

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

@@ -2403,13 +2403,13 @@ public class ReportController {
     }
     }
 
 
     @RequestMapping("/getNoReportUserList")
     @RequestMapping("/getNoReportUserList")
-    public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId) {
-        return reportService.getNoReportUserList(request, startDate, endDate,noReportDeptId);
+    public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, @RequestParam(required = false, defaultValue = "0") Integer onlyHaveAttendance) {
+        return reportService.getNoReportUserList(request, startDate, endDate,noReportDeptId, onlyHaveAttendance);
     }
     }
 
 
     @RequestMapping("/exportNoReportUserList")
     @RequestMapping("/exportNoReportUserList")
-    public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId) {
-        return reportService.exportNoReportUserList(request, startDate, endDate,noReportDeptId);
+    public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, @RequestParam(required = false, defaultValue = "0") Integer onlyHaveAttendance) {
+        return reportService.exportNoReportUserList(request, startDate, endDate,noReportDeptId, onlyHaveAttendance);
     }
     }
 
 
     @RequestMapping("/exportUserDailyWorkTime")
     @RequestMapping("/exportUserDailyWorkTime")

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

@@ -82,11 +82,11 @@ public interface ReportService extends IService<Report> {
 
 
     HttpRespMsg getlastWeekFillTime(String userId);
     HttpRespMsg getlastWeekFillTime(String userId);
 
 
-    HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId);
+    HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, Integer onlyHaveAttendance);
 
 
     List<Map<String, Object>> getNotFullReportUserList(Integer companyId, LocalDate startDate, LocalDate endDate);
     List<Map<String, Object>> getNotFullReportUserList(Integer companyId, LocalDate startDate, LocalDate endDate);
 
 
-    HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId);
+    HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, Integer onlyHaveAttendance);
 
 
     HttpRespMsg approveAllImport(HttpServletRequest request);
     HttpRespMsg approveAllImport(HttpServletRequest request);
 
 

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

@@ -5889,10 +5889,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     public HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate,Integer exportType, Integer projectId,Integer stateKey,String departmentIds, HttpServletRequest request) {
     public HttpRespMsg exportReport(@RequestParam String startDate, @RequestParam String endDate,Integer exportType, Integer projectId,Integer stateKey,String departmentIds, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         DateFormat timeDf = new SimpleDateFormat("yyyy-MM-dd");
         DateFormat timeDf = new SimpleDateFormat("yyyy-MM-dd");
-        long t0 = System.currentTimeMillis();
-        long fetchDataTime = 0;
         try {
         try {
-            long downloadCountStart = System.currentTimeMillis();
             String userId = request.getHeader("Token");
             String userId = request.getHeader("Token");
             User user = userMapper.selectById(userId);
             User user = userMapper.selectById(userId);
             //检查模式,是否是一个项目多个工作事项的情况
             //检查模式,是否是一个项目多个工作事项的情况
@@ -6096,15 +6093,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             }
             else {
             else {
                 //看公司所有人的
                 //看公司所有人的
-                long t1 = System.currentTimeMillis();
                 if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
                 if (exportType == 0 && timeType.getShowFillauditTime() == 1) {
                     allReportByDate = reportMapper.getAllReportByDateWithReportLog(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
                     allReportByDate = reportMapper.getAllReportByDateWithReportLog(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
                 } else {
                 } else {
                     allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
                     allReportByDate = reportMapper.getAllReportByDate(startDate, user.getCompanyId(), null, endDate, projectId,stateKey,branchDepartment);
                 }
                 }
-                long t2 = System.currentTimeMillis();
-                fetchDataTime = (t2-t1);
-                System.out.println("查数据库耗时:"+(t2-t1)/1000+"s");
             }
             }
             //获取企业微信考勤数据
             //获取企业微信考勤数据
             List<UserCorpwxTime> userCorpwxTimeList = new ArrayList<>();
             List<UserCorpwxTime> userCorpwxTimeList = new ArrayList<>();
@@ -6191,7 +6184,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             if (companyId == 4281) {
             if (companyId == 4281) {
                 //苏州博海,需要导出未填写的记录
                 //苏州博海,需要导出未填写的记录
                 //allReportByDate针对每一个员工,列表中没有的工作日要补上
                 //allReportByDate针对每一个员工,列表中没有的工作日要补上
-                HttpRespMsg noReportMsg = getNoReportUserList(request, startDate, endDate, null);
+                HttpRespMsg noReportMsg = getNoReportUserList(request, startDate, endDate, null, 0);
                 List<UserDailyWorkItem> noReportUserList = (List<UserDailyWorkItem>)noReportMsg.data;
                 List<UserDailyWorkItem> noReportUserList = (List<UserDailyWorkItem>)noReportMsg.data;
                 //追加到最后
                 //追加到最后
                 for (UserDailyWorkItem item : noReportUserList) {
                 for (UserDailyWorkItem item : noReportUserList) {
@@ -6815,7 +6808,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId) {
+    public HttpRespMsg getNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, Integer onlyHaveAttendance) {
         HttpRespMsg msg = new HttpRespMsg();
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("TOKEN"));
         User user = userMapper.selectById(request.getHeader("TOKEN"));
         List<User> allRangeUserList = new ArrayList<>();
         List<User> allRangeUserList = new ArrayList<>();
@@ -6987,8 +6980,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
                 }
             }
             }
         }
         }
-        //如果开启也企业微信考勤同步,没有企微考勤打卡记录的就不算未提交
-        if (timeType.getSyncCorpwxTime() == 1) {
+        //如果开启也企业微信考勤同步,仅仅显示有考勤记录的人员
+        if (timeType.getSyncCorpwxTime() == 1 && onlyHaveAttendance == 1) {
             noReportDataList = noReportDataList.stream().filter(item -> !(item.cardTime == null && item.status.equals(MessageUtils.message("leave.notFill")))).collect(Collectors.toList());
             noReportDataList = noReportDataList.stream().filter(item -> !(item.cardTime == null && item.status.equals(MessageUtils.message("leave.notFill")))).collect(Collectors.toList());
         }
         }
 
 
@@ -7086,8 +7079,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
     }
 
 
     @Override
     @Override
-    public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId) {
-        HttpRespMsg msg = getNoReportUserList(request, startDate, endDate,noReportDeptId);
+    public HttpRespMsg exportNoReportUserList(HttpServletRequest request, String startDate, String endDate,Integer noReportDeptId, Integer onlyHaveAttendance) {
+        HttpRespMsg msg = getNoReportUserList(request, startDate, endDate,noReportDeptId, onlyHaveAttendance);
         String token = request.getHeader("TOKEN");
         String token = request.getHeader("TOKEN");
         TimeType timeType = timeTypeMapper.selectById(userMapper.selectById(token).getCompanyId());
         TimeType timeType = timeTypeMapper.selectById(userMapper.selectById(token).getCompanyId());
         Integer companyId = userMapper.selectById(token).getCompanyId();
         Integer companyId = userMapper.selectById(token).getCompanyId();

+ 8 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -692,8 +692,14 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         } else {
         } else {
             //指定获取员工
             //指定获取员工
             User user = userMapper.selectById(userId);
             User user = userMapper.selectById(userId);
-            corpwxUserIds.add(user.getCorpwxUserid());
-            System.out.println("获取corpwxuserid==" + user.getCorpwxUserid() + "的考勤记录");
+            String corpwxUserid = user.getCorpwxUserid();
+            if (corpwxUserid != null) {
+                corpwxUserIds.add(corpwxUserid);
+                System.out.println("获取corpwxuserid==" + corpwxUserid + "的考勤记录");
+            } else {
+                msg.setError("该员工未绑定企业微信,无法获取考勤记录");
+                return msg;
+            }
         }
         }
         //按批调用
         //按批调用
         for (int i = 0; i < batchCount; i++) {
         for (int i = 0; i < batchCount; i++) {

+ 5 - 52
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1649,7 +1649,7 @@
                         <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
                         <el-button slot="append" @click="searchScreen(1)" icon="el-icon-search"></el-button>
                     </el-input>
                     </el-input>
                     <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
                     <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'13'" :clearable="true" @selectCal="selectCal"></selectCat>
-
+                    <el-checkbox v-model="onlyHaveAttendance" v-if="user.timeType.syncCorpwxTime == 1" style="margin-left:10px;" @change="showMonthNotWorkTime">仅显示有考勤的记录</el-checkbox>
                     <el-link
                     <el-link
                         type="primary"
                         type="primary"
                         style="float: right; vertical-align: middle;height:32px"
                         style="float: right; vertical-align: middle;height:32px"
@@ -1989,11 +1989,9 @@
         <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
         <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importWxDialog" :visible.sync="importWxDialog" customClass="customWidth" width="1100px">
             <el-steps :active="active" finish-status="success" style="margin-left:50px;">
             <el-steps :active="active" finish-status="success" style="margin-left:50px;">
             <el-step :title="$t('other.selectadaterangetoimporthours')">
             <el-step :title="$t('other.selectadaterangetoimporthours')">
-                
             </el-step>
             </el-step>
             <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
             <el-step :title="$t('other.downloadTemplateithattendancedata')"></el-step>
             <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
             <el-step :title="$t('other.filloutthetemplateanduploaddata')"></el-step>
-
             </el-steps>
             </el-steps>
             
             
                 
                 
@@ -2296,6 +2294,7 @@
         },
         },
         data() {
         data() {
             return {
             return {
+                onlyHaveAttendance: false,
                 notFullData:[],
                 notFullData:[],
                 notFullOriginList:[],
                 notFullOriginList:[],
                 singleDate:1,
                 singleDate:1,
@@ -4239,6 +4238,7 @@
           // month: this.date,
           // month: this.date,
           startDate: this.WorktimeDatepickValue[0],
           startDate: this.WorktimeDatepickValue[0],
           endDate: this.WorktimeDatepickValue[1],
           endDate: this.WorktimeDatepickValue[1],
+          onlyHaveAttendance: this.onlyHaveAttendance?1:0
         },
         },
         (res) => {
         (res) => {
           if (res.code == "ok") {
           if (res.code == "ok") {
@@ -4374,27 +4374,6 @@
         }
         }
       );
       );
     },
     },
-    // tableListener(){
-    //   let that = this;
-    //   let dom = that.$refs.hasworkTbl.bodyWrapper;
-    //   	  // 添加scroll监听事件
-    //       dom.addEventListener("scroll", function () {
-    //         const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
-    //         if (scrollDistance < 2) {
-    //           if (that.monthWorkDataS.length < that.monthWorkDataS1.length) {
-    //             that.monthTotalPage++; //当前页数自增
-    //             console.log(that.monthWorkDataS1.length, that.monthWorkDataS.length, that.monthTotalPage, that.monthTotalLages, that.monthTotalPage * that.monthTotalLages)
-    //             var arrList = JSON.parse(JSON.stringify(that.monthWorkDataS1))
-    //             var infoList = arrList.splice(
-    //               that.monthTotalPage * that.monthTotalLages,
-    //               that.monthTotalLages
-    //             );
-    //             // 数据添加
-    //             that.monthWorkDataS = that.monthWorkDataS.concat(infoList);
-    //           }
-    //         }
-    //       })
-    // },
     showMonthNotWorkTime() {
     showMonthNotWorkTime() {
       this.monthTotalPage = 0,
       this.monthTotalPage = 0,
       this.tbload = true,
       this.tbload = true,
@@ -4403,27 +4382,20 @@
         {
         {
           startDate: this.WorktimeDatepickValue[0],
           startDate: this.WorktimeDatepickValue[0],
           endDate: this.WorktimeDatepickValue[1],
           endDate: this.WorktimeDatepickValue[1],
-          noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null
+          noReportDeptId:this.deptIdForNoReport.length>0?this.deptIdForNoReport[this.deptIdForNoReport.length-1]:null,
+          onlyHaveAttendance:this.onlyHaveAttendance?1:0
         },
         },
         (res) => {
         (res) => {
           if (res.code == "ok") {
           if (res.code == "ok") {
               this.tbload = false
               this.tbload = false
             this.monthNotWorkDate = res.data;
             this.monthNotWorkDate = res.data;
-            // this.monthNotWorkDateS1 = res.data
             this.monthnotTotal = res.data.length
             this.monthnotTotal = res.data.length
-            // 2222111
             if (this.monthNotWorkDate.length > 50) {
             if (this.monthNotWorkDate.length > 50) {
                 this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
                 this.monthNotWorkDateS = this.monthNotWorkDate.slice(0,50);
             } else {
             } else {
                 this.monthNotWorkDateS = this.monthNotWorkDate
                 this.monthNotWorkDateS = this.monthNotWorkDate
             }
             }
             this.searchScreen(1)
             this.searchScreen(1)
-            // 判断
-            // if (this.monthnotworkDateS1.length > 0) {
-            //     setTimeout(() => {
-            //         this.tableListenernot()
-            //     }, 1000);
-            // }
             this.$nextTick(function(){
             this.$nextTick(function(){
                 this.$refs.hasworkTbl2.doLayout();
                 this.$refs.hasworkTbl2.doLayout();
             });
             });
@@ -4438,25 +4410,6 @@
         }
         }
       );
       );
     },
     },
-    // tableListenernot(){
-    //   let that = this;
-    //   let dom = that.$refs.hasworkTbl2.bodyWrapper;
-    //       dom.addEventListener("scroll", function () {
-    //       // scrollHeight-scrollTop-clientHeight=0 用来判断滚动条到底部
-    //         const scrollDistance2 = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
-    //         if (scrollDistance2 < 2) {
-    //           if (that.monthNotWorkDateS.length < that.monthNotWorkDateS1.length) {
-    //             that.monthnotTotalPage++; //当前页数自增
-    //             var arrList = JSON.parse(JSON.stringify(that.monthNotWorkDateS1))
-    //             var infoList = arrList.splice(
-    //               that.monthnotTotalPage * that.monthnotTotalLages,
-    //               that.monthnotTotalLages
-    //             );
-    //             that.monthNotWorkDateS = that.monthNotWorkDateS.concat(infoList);
-    //           }
-    //         }
-    //       })
-    // },
     listScroll(){
     listScroll(){
         if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
         if(this.monthWorkDataS.length == this.monthWorkDataS1.length){
             this.isMore = true
             this.isMore = true