Lijy 7 kuukautta sitten
vanhempi
commit
1d6628264a

+ 47 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -356,6 +356,53 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     DecimalFormat df = new DecimalFormat("0.00");
                     memb.put("reportTime", df.format(reportTime));
                 }
+                //显示考勤数据
+                if (timeType.getShowCorpwxCardtime() == 1) {
+                    List<User> userList = userMapper.selectList(new QueryWrapper<User>().in("id", userIds));
+                    if (companyId == 469) {
+                        //赛元微电子,需要按照corpwxUserid或者姓名匹配
+                        List<String> corpwxUserIds = userList.stream().map(User::getCorpwxUserid).collect(Collectors.toList());
+                        List<UserCorpwxTime> corpwxTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", companyId).in("corpwx_userid", corpwxUserIds).eq("create_date", date));
+                        for (Map<String, Object> memb : nameList) {
+                            userList.stream().filter(u->u.getId().equals(memb.get("id"))).findFirst().ifPresent(u->{
+                                memb.put("corpwxUserId", u.getCorpwxUserid());
+                            });
+                            String corpwxUserId = (String)memb.get("corpwxUserId");
+                            Optional<UserCorpwxTime> first = corpwxTimeList.stream().filter(u -> u.getCorpwxUserid().equals(corpwxUserId)).findFirst();
+                            if (first.isPresent()) {
+                                UserCorpwxTime corpwxTime = first.get();
+                                memb.put("cardTime", corpwxTime.getWorkHours());
+                            }
+                        }
+                        //再匹配corpwxUserid为null的,需要按照姓名匹配
+                        List<String> userNameList = userList.stream().filter(u->u.getCorpwxUserid() == null).map(User::getName).collect(Collectors.toList());
+                        List<UserCorpwxTime> corpwxTimeList2 = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", companyId).in("name", userNameList).eq("create_date", date));
+                        for (Map<String, Object> memb : nameList) {
+                            if (memb.get("corpwxUserId") == null) {
+                                String name = (String)memb.get("name");
+                                Optional<UserCorpwxTime> first = corpwxTimeList2.stream().filter(u -> u.getName().equals(name)).findFirst();
+                                if (first.isPresent()) {
+                                    UserCorpwxTime corpwxTime = first.get();
+                                    memb.put("cardTime", corpwxTime.getWorkHours());
+                                }
+                            }
+                        }
+                    } else {
+                        List<String> corpwxUserIds = userList.stream().map(User::getCorpwxUserid).collect(Collectors.toList());
+                        List<UserCorpwxTime> corpwxTimeList = userCorpwxTimeMapper.selectList(new QueryWrapper<UserCorpwxTime>().eq("company_id", companyId).in("corpwx_userid", corpwxUserIds).eq("create_date", date));
+                        for (Map<String, Object> memb : nameList) {
+                            userList.stream().filter(u->u.getId().equals(memb.get("id"))).findFirst().ifPresent(u->{
+                                memb.put("corpwxUserId", u.getCorpwxUserid());
+                            });
+                            String corpwxUserId = (String)memb.get("corpwxUserId");
+                            Optional<UserCorpwxTime> first = corpwxTimeList.stream().filter(u -> u.getCorpwxUserid().equals(corpwxUserId)).findFirst();
+                            if (first.isPresent()) {
+                                UserCorpwxTime corpwxTime = first.get();
+                                memb.put("cardTime", corpwxTime.getWorkHours());
+                            }
+                        }
+                    }
+                }
             }
 
             //处理项目专业进度的数据展示

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

@@ -169,9 +169,10 @@
                                         <span style="margin-right:20px;" v-if="user.timeType.onlyShowPercent==0">
                                             <!-- <i v-if="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5" style="color:red;margin-right:8px;" class="fa fa-exclamation-triangle"></i> -->
                                             <!-- 工作总时长: -->
-                                            {{$t('other.totalWorkingHours')}}
+                                            {{$t('other.totalWorkingHours')}}:
                                             <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
                                             <span >{{item1.reportTime | amounts}}</span>h
+                                            <span v-if="user.timeType.showCorpwxCardtime" :style="item1.cardTime !=item1.reportTime?'margin-left:10px;color:#ff0000;':'margin-left:10px;'">考勤时长:{{item1.cardTime | amounts}}h</span>
                                         </span>
                                         <span class="approvalProcessBox" v-if="user.timeType.showFillauditTime == 1">
                                             <i class="iconfont firerock-iconliucheng1"></i>
@@ -180,6 +181,7 @@
                                                 {{$t('other.approvalProcess')}}
                                             </span>
                                         </span>
+                                        
                                     </span>
                                     <div class="checkbtn" style="padding-right:20px;">
                                         <!--编辑和删除日报-->