Browse Source

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

cs 2 years ago
parent
commit
b97405bc11

+ 21 - 16
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -121,11 +121,20 @@ public class WeiXinCorpController {
     public static String PRE_AUTH_CODE = null;
     public static String PRE_AUTH_CODE = null;
     public static long expireTime = 0L;
     public static long expireTime = 0L;
 
 
+    // 随机数
+    String nonce_str = Sha1Util.getNonceStr();
+    String timestamp = Sha1Util.getTimeStamp();
+
     public static Map<String, Item> corpTicketMap = new HashMap<String,Item>();
     public static Map<String, Item> corpTicketMap = new HashMap<String,Item>();
     public class Item {
     public class Item {
         public String jsTicket = null;
         public String jsTicket = null;
         public LocalDateTime expireTime = null;
         public LocalDateTime expireTime = null;
     }
     }
+    public static Map<String, AgentItem> agentCorpTicketMap = new HashMap<String,AgentItem>();
+    public class AgentItem {
+        public String jsTicket = null;
+        public LocalDateTime expireTime = null;
+    }
 
 
     @Resource
     @Resource
     SysConfigMapper sysConfigMapper;
     SysConfigMapper sysConfigMapper;
@@ -151,7 +160,6 @@ public class WeiXinCorpController {
         try {
         try {
             User user = userMapper.selectById(token);
             User user = userMapper.selectById(token);
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-
             Item item = corpTicketMap.get(wxCorpInfo.getCorpid());
             Item item = corpTicketMap.get(wxCorpInfo.getCorpid());
             if (item == null || item.expireTime.isBefore(LocalDateTime.now())) {
             if (item == null || item.expireTime.isBefore(LocalDateTime.now())) {
                 //重新获取
                 //重新获取
@@ -177,8 +185,8 @@ public class WeiXinCorpController {
             }
             }
             log.info("jsTicket = " + item.jsTicket);
             log.info("jsTicket = " + item.jsTicket);
             // 随机数
             // 随机数
-            String nonce_str = Sha1Util.getNonceStr();
-            String timestamp = Sha1Util.getTimeStamp();
+/*            String nonce_str = Sha1Util.getNonceStr();
+            String timestamp = Sha1Util.getTimeStamp();*/
             // 对以下字段进行签名
             // 对以下字段进行签名
             SortedMap<String, String> packageParams = new TreeMap<String, String>();
             SortedMap<String, String> packageParams = new TreeMap<String, String>();
             packageParams.put("jsapi_ticket", item.jsTicket);
             packageParams.put("jsapi_ticket", item.jsTicket);
@@ -204,38 +212,35 @@ public class WeiXinCorpController {
         try {
         try {
             User user = userMapper.selectById(token);
             User user = userMapper.selectById(token);
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
             WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
-
-            Item item = corpTicketMap.get(wxCorpInfo.getCorpid());
-            if (item == null || item.expireTime.isBefore(LocalDateTime.now())) {
+            AgentItem agentItem = agentCorpTicketMap.get(wxCorpInfo.getCorpid());
+            if (agentItem == null || agentItem.expireTime.isBefore(LocalDateTime.now())) {
                 //重新获取
                 //重新获取
                 String getTicketUrl = "https://qyapi.weixin.qq.com/cgi-bin/ticket/get?access_token=ACCESS_TOKEN&type=agent_config";
                 String getTicketUrl = "https://qyapi.weixin.qq.com/cgi-bin/ticket/get?access_token=ACCESS_TOKEN&type=agent_config";
                 String corpToken = getCorpAccessToken(wxCorpInfo);
                 String corpToken = getCorpAccessToken(wxCorpInfo);
+                System.out.println(corpToken);
                 getTicketUrl = getTicketUrl.replace("ACCESS_TOKEN", corpToken);
                 getTicketUrl = getTicketUrl.replace("ACCESS_TOKEN", corpToken);
                 String forObject = this.restTemplate.getForObject(getTicketUrl, String.class);
                 String forObject = this.restTemplate.getForObject(getTicketUrl, String.class);
                 JSONObject json = JSONObject.parseObject(forObject);
                 JSONObject json = JSONObject.parseObject(forObject);
-                log.info("返回:"+json.toJSONString());
+                System.out.println("返回:"+json.toJSONString());
                 if (json.getIntValue("errcode") == 0) {
                 if (json.getIntValue("errcode") == 0) {
                     String ticket = json.getString("ticket");
                     String ticket = json.getString("ticket");
-                    Item it = new Item();
+                    AgentItem it = new AgentItem();
                     it.expireTime = LocalDateTime.now().plusSeconds(7200);
                     it.expireTime = LocalDateTime.now().plusSeconds(7200);
                     it.jsTicket = ticket;
                     it.jsTicket = ticket;
-                    corpTicketMap.put(wxCorpInfo.getCorpid(), it);
-                    item = it;
+                    agentCorpTicketMap.put(wxCorpInfo.getCorpid(), it);
+                    agentItem = it;
                 }
                 }
             }
             }
-            if (item == null) {
+            if (agentItem == null) {
                 //msg.setError("jsapiTicket获取失败");
                 //msg.setError("jsapiTicket获取失败");
                 msg.setError(MessageUtils.message("wx.TicketError"));
                 msg.setError(MessageUtils.message("wx.TicketError"));
                 return msg;
                 return msg;
             }
             }
-            log.info("jsTicket = " + item.jsTicket);
-            // 随机数
-            String nonce_str = Sha1Util.getNonceStr();
-            String timestamp = Sha1Util.getTimeStamp();
+            System.out.println("jsTicket = " + agentItem.jsTicket);
             // 对以下字段进行签名
             // 对以下字段进行签名
             SortedMap<String, String> packageParams = new TreeMap<String, String>();
             SortedMap<String, String> packageParams = new TreeMap<String, String>();
             SortedMap<String, String> packageParam = new TreeMap<String, String>();
             SortedMap<String, String> packageParam = new TreeMap<String, String>();
-            packageParam.put("jsapi_ticket", item.jsTicket);
+            packageParam.put("jsapi_ticket", agentItem.jsTicket);
             packageParam.put("noncestr", nonce_str);
             packageParam.put("noncestr", nonce_str);
             packageParam.put("timestamp", ""+timestamp);
             packageParam.put("timestamp", ""+timestamp);
             packageParam.put("url", url);
             packageParam.put("url", url);

+ 10 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -6465,12 +6465,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     project.setCompanyId(thirdPartyInterface.getCompanyId());
                     project.setCompanyId(thirdPartyInterface.getCompanyId());
                     inertProjectList.add(project);
                     inertProjectList.add(project);
                 }
                 }
-                if(saveBatch(inertProjectList)){
+                if(inertProjectList.size()>0&&saveBatch(inertProjectList)){
                     //message+="成功添加"+inertProjectList.size()+"条项目数据";
                     //message+="成功添加"+inertProjectList.size()+"条项目数据";
                     message+=MessageUtils.message("project.upDataSuc",inertProjectList.size());
                     message+=MessageUtils.message("project.upDataSuc",inertProjectList.size());
                 }
                 }
                 for (Project project : inertProjectList) {
                 for (Project project : inertProjectList) {
                     List<TaskGroup> taskGroupList = project.getTaskGroupList();
                     List<TaskGroup> taskGroupList = project.getTaskGroupList();
+                    if(taskGroupList==null){
+                        continue;
+                    }
                     taskGroupList.forEach(tl->tl.setProjectId(project.getId()));
                     taskGroupList.forEach(tl->tl.setProjectId(project.getId()));
                     taskGroupService.saveBatch(taskGroupList);
                     taskGroupService.saveBatch(taskGroupList);
                 }
                 }
@@ -6485,14 +6488,18 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         changeProjectList.add(project);
                         changeProjectList.add(project);
                     }else continue;
                     }else continue;
                 }
                 }
-                if(updateBatchById(changeProjectList)){
+                if(changeProjectList.size()>0&&updateBatchById(changeProjectList)){
                     //message+="成功更新"+changeProjectList.size()+"条项目数据";
                     //message+="成功更新"+changeProjectList.size()+"条项目数据";
                     message+=MessageUtils.message("project.upDataSuc",changeProjectList.size());
                     message+=MessageUtils.message("project.upDataSuc",changeProjectList.size());
                 }
                 }
                 List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
                 List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
+                idList.add(-1);
                 List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
                 List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
                 for (Project project : changeProjectList) {
                 for (Project project : changeProjectList) {
                     List<TaskGroup> taskGroupList = project.getTaskGroupList();
                     List<TaskGroup> taskGroupList = project.getTaskGroupList();
+                    if(taskGroupList==null){
+                        continue;
+                    }
                     for (TaskGroup taskGroup : taskGroupList) {
                     for (TaskGroup taskGroup : taskGroupList) {
                         taskGroup.setProjectId(project.getId());
                         taskGroup.setProjectId(project.getId());
                         Optional<TaskGroup> first = groupList.stream().filter(gl -> gl.getTaskGroupCode() != null && gl.getTaskGroupCode().equals(taskGroup.getTaskGroupCode())).findFirst();
                         Optional<TaskGroup> first = groupList.stream().filter(gl -> gl.getTaskGroupCode() != null && gl.getTaskGroupCode().equals(taskGroup.getTaskGroupCode())).findFirst();
@@ -6511,7 +6518,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     deleteProjectList.add(project);
                     deleteProjectList.add(project);
                 }else continue;
                 }else continue;
                 List<Integer> idList = deleteProjectList.stream().map(Project::getId).collect(Collectors.toList());
                 List<Integer> idList = deleteProjectList.stream().map(Project::getId).collect(Collectors.toList());
-                if(removeByIds(idList)){
+                if(deleteProjectList.size()>0&&removeByIds(idList)){
                     //message+="成功删除"+idList.size()+"条项目数据";
                     //message+="成功删除"+idList.size()+"条项目数据";
                     message+=MessageUtils.message("project.deleteDate",idList.size());
                     message+=MessageUtils.message("project.deleteDate",idList.size());
                 }
                 }

+ 33 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -34,10 +34,7 @@ import java.text.DecimalFormat;
 import java.time.*;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeFormatter;
 import java.time.temporal.TemporalAccessor;
 import java.time.temporal.TemporalAccessor;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
 import java.util.stream.IntStream;
 
 
@@ -190,7 +187,7 @@ public class TimingTask {
     }
     }
 
 
     //每天2:11 同步钉钉用户前2天到未来30天时间段的打卡,请假,出差数据
     //每天2:11 同步钉钉用户前2天到未来30天时间段的打卡,请假,出差数据
-    @Scheduled(cron = "0 30 2 ? * *")
+    @Scheduled(cron = "0 11 2 ? * *")
     private void synFanWeiWorkData() {
     private void synFanWeiWorkData() {
         if (isDev) return;
         if (isDev) return;
         List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_fanwei", 1));
         List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_fanwei", 1));
@@ -202,10 +199,13 @@ public class TimingTask {
         JSONObject jsonObject=new JSONObject();
         JSONObject jsonObject=new JSONObject();
         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
         DateTimeFormatter dtf1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter dtf1 = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-        DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("HH:mm:ss");
+        DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("HH:mm");
         LocalDateTime yesterday = LocalDateTime.now().minusDays(2);
         LocalDateTime yesterday = LocalDateTime.now().minusDays(2);
         String startDate = dtf.format(yesterday);
         String startDate = dtf.format(yesterday);
         String endDate = dtf.format(yesterday.plusDays(32));
         String endDate = dtf.format(yesterday.plusDays(32));
+        List<UserFvTime> oldUserFvTimeList = userFvTimeService.list(new QueryWrapper<UserFvTime>().in("company_id", compIds));
+        List<LeaveSheet> oldLeaveSheetList = leaveSheetService.list(new QueryWrapper<LeaveSheet>().in("company_id", compIds));
+        List<BusinessTrip> oldBusinessTripList = businessTripService.list(new QueryWrapper<BusinessTrip>().in("company_id", compIds));
         jsonObject.put("startDate",startDate);
         jsonObject.put("startDate",startDate);
         jsonObject.put("endDate",endDate);
         jsonObject.put("endDate",endDate);
         String jsonString = jsonObject.toJSONString();
         String jsonString = jsonObject.toJSONString();
@@ -222,19 +222,27 @@ public class TimingTask {
                 continue;
                 continue;
             }
             }
             if(compIds.contains(user.getCompanyId())){
             if(compIds.contains(user.getCompanyId())){
-                userFvTime.setWorkDate((LocalDate) map.get("workDate"));
+                userFvTime.setWorkDate(LocalDate.parse(String.valueOf(map.get("workDate")),dtf));
                 LocalTime startTime = LocalTime.parse(String.valueOf(map.get("startTime")), dtf2);
                 LocalTime startTime = LocalTime.parse(String.valueOf(map.get("startTime")), dtf2);
-                LocalTime endTime = LocalTime.parse(String.valueOf(map.get("startTime")), dtf2);
-                Duration between = Duration.between(startTime, endTime);
+                LocalTime endTime = LocalTime.parse(String.valueOf(map.get("endTime")), dtf2);
+                LocalDateTime time1= LocalDate.now().atTime(startTime);
+                LocalDateTime time2 = LocalDate.now().atTime(endTime);
+                Duration between = Duration.between(time1, time2);
                 userFvTime.setStartTime((String) map.get("startTime"));
                 userFvTime.setStartTime((String) map.get("startTime"));
                 userFvTime.setEndTime((String) map.get("endTime"));
                 userFvTime.setEndTime((String) map.get("endTime"));
                 userFvTime.setCompanyId(user.getCompanyId());
                 userFvTime.setCompanyId(user.getCompanyId());
                 userFvTime.setUserId(user.getId());
                 userFvTime.setUserId(user.getId());
-                userFvTime.setWorkHours((float) between.toHours());
+                userFvTime.setWorkHours((float)between.toHours());
+                Optional<UserFvTime> first = oldUserFvTimeList.stream().filter(ol -> ol.getWorkDate().isEqual(userFvTime.getWorkDate()) && ol.getUserId().equals(userFvTime.getUserId())).findFirst();
+                if(first.isPresent()){
+                    userFvTime.setId(first.get().getId());
+                }
                 userFvTimeList.add(userFvTime);
                 userFvTimeList.add(userFvTime);
             }
             }
         }
         }
-        userFvTimeService.saveBatch(userFvTimeList);
+        if(userFvTimeList.size()>0){
+            userFvTimeService.saveOrUpdateBatch(userFvTimeList);
+        }
         //Todo: 获取请假数据
         //Todo: 获取请假数据
         HttpRespMsg leaveRecordMsg = dockWithMLD.getResult("http://10.1.10.41:20170/api/cube/restful/interface/getModeDataPageList/getLeaveRecord", jsonString);
         HttpRespMsg leaveRecordMsg = dockWithMLD.getResult("http://10.1.10.41:20170/api/cube/restful/interface/getModeDataPageList/getLeaveRecord", jsonString);
         List<Map<String,Object>> leaveRecordList= (List<Map<String, Object>>) leaveRecordMsg.data;
         List<Map<String,Object>> leaveRecordList= (List<Map<String, Object>>) leaveRecordMsg.data;
@@ -257,10 +265,16 @@ public class TimingTask {
                leaveSheet.setLeaveType(Integer.parseInt(String.valueOf(map.get("leaveType"))));
                leaveSheet.setLeaveType(Integer.parseInt(String.valueOf(map.get("leaveType"))));
                leaveSheet.setProcinstId(String.valueOf(map.get("procinstId")));
                leaveSheet.setProcinstId(String.valueOf(map.get("procinstId")));
                leaveSheet.setGmtFinished(String.valueOf(map.get("gmtFinished")));
                leaveSheet.setGmtFinished(String.valueOf(map.get("gmtFinished")));
+                Optional<LeaveSheet> first = oldLeaveSheetList.stream().filter(ol -> ol.getStartDate().isEqual(leaveSheet.getStartDate())&&ol.getEndDate().isEqual(leaveSheet.getEndDate()) && ol.getOwnerId().equals(leaveSheet.getOwnerId())).findFirst();
+                if(first.isPresent()){
+                    leaveSheet.setId(first.get().getId());
+                }
                leaveSheetList.add(leaveSheet);
                leaveSheetList.add(leaveSheet);
             }
             }
         }
         }
-        leaveSheetService.saveBatch(leaveSheetList);
+        if(leaveSheetList.size()>0){
+            leaveSheetService.saveOrUpdateBatch(leaveSheetList);
+        }
         //Todo: 获取出差数据
         //Todo: 获取出差数据
         HttpRespMsg travelRecordMsg = dockWithMLD.getResult("http://10.1.10.41:20170/api/cube/restful/interface/getModeDataPageList/getTravelRecord", jsonString);
         HttpRespMsg travelRecordMsg = dockWithMLD.getResult("http://10.1.10.41:20170/api/cube/restful/interface/getModeDataPageList/getTravelRecord", jsonString);
         List<Map<String,Object>> travelRecordList= (List<Map<String, Object>>) travelRecordMsg.data;
         List<Map<String,Object>> travelRecordList= (List<Map<String, Object>>) travelRecordMsg.data;
@@ -281,10 +295,16 @@ public class TimingTask {
                 businessTrip.setDayCount(Integer.valueOf(String.valueOf(map.get("dayCount"))));
                 businessTrip.setDayCount(Integer.valueOf(String.valueOf(map.get("dayCount"))));
                 businessTrip.setProcinstId((String) map.get("procinstId"));
                 businessTrip.setProcinstId((String) map.get("procinstId"));
                 businessTrip.setGmtFinished((String)map.get("gmtFinished"));
                 businessTrip.setGmtFinished((String)map.get("gmtFinished"));
+                Optional<BusinessTrip> first = oldBusinessTripList.stream().filter(ol -> ol.getStartDate().isEqual(businessTrip.getStartDate())&&ol.getEndDate().isEqual(businessTrip.getEndDate()) && ol.getOwnerId().equals(businessTrip.getOwnerId())).findFirst();
+                if(first.isPresent()){
+                    businessTrip.setId(first.get().getId());
+                }
                 businessTripList.add(businessTrip);
                 businessTripList.add(businessTrip);
             }
             }
         }
         }
-        businessTripService.saveBatch(businessTripList);
+        if(businessTripList.size()>0){
+            businessTripService.saveOrUpdateBatch(businessTripList);
+        }
     }
     }
 
 
     //每天1:00 同步昨天的微信请假信息
     //每天1:00 同步昨天的微信请假信息

+ 7 - 7
fhKeeper/formulahousekeeper/timesheet/package-lock.json

@@ -2774,11 +2774,11 @@
       }
       }
     },
     },
     "echarts": {
     "echarts": {
-      "version": "3.8.5",
-      "resolved": "https://registry.npmjs.org/echarts/-/echarts-3.8.5.tgz",
-      "integrity": "sha512-E+nnROMfCeiLeoT/fZyX8SE8mKzwkTjyemyoBF543oqjRtjTSKQAVDEihMXy4oC6pJS0tYGdMqCA2ATk8onyRg==",
+      "version": "4.9.0",
+      "resolved": "https://registry.npmjs.org/echarts/-/echarts-4.9.0.tgz",
+      "integrity": "sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==",
       "requires": {
       "requires": {
-        "zrender": "3.7.4"
+        "zrender": "4.3.2"
       }
       }
     },
     },
     "editorconfig": {
     "editorconfig": {
@@ -9393,9 +9393,9 @@
       }
       }
     },
     },
     "zrender": {
     "zrender": {
-      "version": "3.7.4",
-      "resolved": "https://registry.npmjs.org/zrender/-/zrender-3.7.4.tgz",
-      "integrity": "sha512-5Nz7+L1wIoL0+Pp/iOP56jD6eD017qC9VRSgUBheXBiAHgOBJZ4uh4/g6e83acIwa8RKSyZf/FlceKu5ntUuxQ=="
+      "version": "4.3.2",
+      "resolved": "https://registry.npmjs.org/zrender/-/zrender-4.3.2.tgz",
+      "integrity": "sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g=="
     }
     }
   }
   }
 }
 }

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/package.json

@@ -15,7 +15,7 @@
     "dayjs": "^1.10.4",
     "dayjs": "^1.10.4",
     "dhtmlx-gantt": "^7.1.6",
     "dhtmlx-gantt": "^7.1.6",
     "dingtalk-jsapi": "^2.13.42",
     "dingtalk-jsapi": "^2.13.42",
-    "echarts": "^3.8.5",
+    "echarts": "^4.9.0",
     "el-table-infinite-scroll": "^2.0.0",
     "el-table-infinite-scroll": "^2.0.0",
     "element-ui": "^2.15.3",
     "element-ui": "^2.15.3",
     "font-awesome": "^4.7.0",
     "font-awesome": "^4.7.0",

+ 64 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -11,7 +11,10 @@
             <el-col :span="4">
             <el-col :span="4">
                 <div class="tools" @click.prevent="collapse" style="position: relative;">
                 <div class="tools" @click.prevent="collapse" style="position: relative;">
                     <i class="fa fa-align-justify"></i>
                     <i class="fa fa-align-justify"></i>
-                    <span style="position: absolute;width: 350px;left: 60px;">{{user.companyName}}</span>
+                    <span style="position: absolute;width: 350px;left: 60px;">
+                        <span v-if="user.userNameNeedTranslate == '0'">{{user.companyName}}</span>
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='user.companyName'></ww-open-data></span>
+                    </span>
                 </div>
                 </div>
             </el-col>
             </el-col>
 
 
@@ -461,6 +464,60 @@
                     });
                     });
                 });
                 });
             },
             },
+
+            // 获取企业微信的参数
+            agentConfig() {
+                var curUrl = location.href.split("#")[0];
+                this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
+                    if (res.code == "ok") {
+                        wx.config({ 
+                        beta: true,
+                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                        appId: res.data.appid, // 必填,公众号的唯一标识 
+                        timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
+                        nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
+                        signature: res.data.sign, // 必填,签名,见附录1 
+                        jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
+                        });
+                        var that = this;
+                        wx.ready(function(){
+                            // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+                                that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
+                                    if (res.code == "ok") {
+                                    console.log()
+                                        wx.agentConfig({
+                                            corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
+                                            agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
+                                            timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+                                            nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+                                            signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+                                            jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
+                                            success: function (result) {
+                                                console.log(result, '请求微信成功')
+                                                console.log(window, 'window')
+                                                //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
+                                                window.WWOpenData.bind(document.querySelector('ww-open-data'))
+                                            },
+                                            fail: function (res) {
+                                                console.log('查看错误信息', res)
+                                                if (res.errMsg.indexOf('function not exist') > -1) {
+                                                    alert('版本过低请升级')
+                                                }
+                                            },
+                                        })
+                                    }
+                                }, (error) => {
+                                    console.log('查看错误信息' + res)
+                                    if (error.errMsg.indexOf('function not exist') > -1) {
+                                        alert('版本过低请升级')
+                                    }
+                                })
+                        });
+                    }
+                }, (error) => {
+                    console.log(error, '哦耶')
+                })
+            },
         },
         },
         mounted() {
         mounted() {
             // console.log(this.$router.options.routes, '看看')
             // console.log(this.$router.options.routes, '看看')
@@ -494,6 +551,12 @@
             } else {
             } else {
                 this.$router.push("/login");
                 this.$router.push("/login");
             }
             }
+
+            // console.log('啊,我被触发了呀')
+            // 获取企业微信参数
+            if(this.user.userNameNeedTranslate == '1') {
+                this.agentConfig()
+            }
         },
         },
     };
     };
 </script>
 </script>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -137,7 +137,7 @@
                         </el-popover>
                         </el-popover>
                     </div>
                     </div>
                 </el-form-item>
                 </el-form-item>
-                <el-form-item v-if="($t('other.project') || radio == $t('lable.department') || radio == $t('projectclassification')) && exportParam.type == '0'">
+                <el-form-item v-if="(radio == $t('other.project') || radio == $t('lable.department') || radio == $t('projectclassification')) && exportParam.type == '0'">
                     <el-checkbox v-model="exportParam.projectSum" >{{ $t('individualprojectdata') }}</el-checkbox>
                     <el-checkbox v-model="exportParam.projectSum" >{{ $t('individualprojectdata') }}</el-checkbox>
                 </el-form-item>
                 </el-form-item>
 
 

+ 75 - 70
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -11,7 +11,6 @@
                   </div>
                   </div>
             </div>
             </div>
             <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
             <el-divider style="margin: 0px 0px !important;height:0.5px;"></el-divider>
-            <div v-if="user.companyId == '1081'">{{tixtass}}</div>
             <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
             <div class="tree" :style="'height:'+ (tableHeight + 83) + 'px'">
                 <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
                 <!-- <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick" accordion></el-tree> -->
                 <!-- <el-tree :data="data" :props="defaultProps" node-key="id" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa"> -->
                 <!-- <el-tree :data="data" :props="defaultProps" node-key="id" :expand-on-click-node="false" accordion @node-click="handleNodeClick" :default-expanded-keys="jDarr" @node-expand="jieDian" @node-collapse="shutDown" @current-change="chufa"> -->
@@ -140,6 +139,7 @@
             </el-col>
             </el-col>
 
 
             <!--列表-->
             <!--列表-->
+            
             <el-table ref="handleSelectTable" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="handleSelectionZzjg">
             <el-table ref="handleSelectTable" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="handleSelectionZzjg">
                 <el-table-column type="selection" width="50"></el-table-column>
                 <el-table-column type="selection" width="50"></el-table-column>
                 <el-table-column type="index" width="50">
                 <el-table-column type="index" width="50">
@@ -147,8 +147,26 @@
                         {{scope.$index+1+(page-1)*size}}
                         {{scope.$index+1+(page-1)*size}}
                     </template>
                     </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column prop="name" :label="$t('lable.name')" ></el-table-column>
-                <el-table-column prop="jobNumber" :label="$t('Worknumber')" ></el-table-column>
+                <el-table-column prop="name" :label="$t('lable.name')" >
+                  <template slot-scope="scope">
+                    <div>
+                      <div v-if="user.userNameNeedTranslate == 1">
+                        <ww-open-data type='userName' :openid='scope.row.name'></ww-open-data>
+                      </div>
+                      <div v-else>{{scope.row.name}}</div>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column prop="jobNumber" :label="$t('Worknumber')" >
+                  <template slot-scope="scope">
+                    <div>
+                      <div v-if="user.userNameNeedTranslate == 1">
+                        <ww-open-data type='userName' :openid='scope.row.jobNumber'></ww-open-data>
+                      </div>
+                      <div v-else>{{scope.row.jobNumber}}</div>
+                    </div>
+                  </template>
+                </el-table-column>
                 <el-table-column prop="phone" :label="$t('shou-ji')" width="120"></el-table-column>
                 <el-table-column prop="phone" :label="$t('shou-ji')" width="120"></el-table-column>
                 <el-table-column prop="departmentName" :label="$t('lable.department')" width="220"></el-table-column>
                 <el-table-column prop="departmentName" :label="$t('lable.department')" width="220"></el-table-column>
                 <el-table-column :label="$t('jiao-se')" width="100">
                 <el-table-column :label="$t('jiao-se')" width="100">
@@ -678,7 +696,6 @@ export default {
   },
   },
   data() {
   data() {
     return {
     return {
-      tixtass: '变化',
       syncMembByCardTimeResultGialog:false,
       syncMembByCardTimeResultGialog:false,
       syncMembByCardTimeMsg:null,
       syncMembByCardTimeMsg:null,
       editSecret: false,
       editSecret: false,
@@ -2976,71 +2993,59 @@ export default {
             }
             }
           );
           );
     },
     },
-    // 获取企业微信的参数
-    agentConfig() {
-       var curUrl = location.href.split("#")[0];
-       this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
-          if (res.code == "ok") {
-            this.tixtass = "config,进入"
-            wx.config({ 
-              beta: true,
-              debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-              appId: res.data.appid, // 必填,公众号的唯一标识 
-              timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
-              nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
-              signature: res.data.sign, // 必填,签名,见附录1 
-              jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
-            });
-              var that = this;
-              wx.ready(function(){
-                  // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
-                  // if (that.user.companyId == 7) {
-                  //     that.$toast('wx init success==7 ');
-                  //     that.getLocation();
-                  // }
-                  that.getagentConfigs() 
-              });
-          }
-       }, (error) => {
-          console.log(error, '哦耶')
-       })
-    },
-    getagentConfigs() {
-          this.tixtass = "进了"
-      var curUrl = location.href.split("#")[0];
-       this.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: this.user.id}, (res) => {
-          if (res.code == "ok") {
-          this.tixtass = "处理"
-          console.log()
-            wx.agentConfig({
-                corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
-                agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
-                timestamp: res.data.timestamp, // 必填,生成签名的时间戳
-                nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
-                signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
-                jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
-                success: function (result) {
-                    console.log(result, '请求微信成功')
-                    this.tixtass = '注入'
-                    //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
-                    window.WWOpenData.bind(document.querySelector('ww-open-data'))
-                },
-                fail: function (res) {
-                    console.log('查看错误信息', res)
-                    if (res.errMsg.indexOf('function not exist') > -1) {
-                        alert('版本过低请升级')
-                    }
-                },
-            })
-          }
-       }, (error) => {
-          console.log('查看错误信息' + res)
-          this.tixtass = "失败"
-          if (error.errMsg.indexOf('function not exist') > -1) {
-              alert('版本过低请升级')
-          }
-       })
-    }
+    // // 获取企业微信的参数
+    // agentConfig() {
+    //    var curUrl = location.href.split("#")[0];
+    //    this.http.post("/wxcorp/getCorpWXConfig", {url: curUrl, token: this.user.id}, (res) => {
+    //       if (res.code == "ok") {
+    //         wx.config({ 
+    //           beta: true,
+    //           debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+    //           appId: res.data.appid, // 必填,公众号的唯一标识 
+    //           timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
+    //           nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
+    //           signature: res.data.sign, // 必填,签名,见附录1 
+    //           jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
+    //         });
+    //           var that = this;
+    //           wx.ready(function(){
+    //               // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+    //                   that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
+    //                       if (res.code == "ok") {
+    //                       console.log()
+    //                         wx.agentConfig({
+    //                             corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
+    //                             agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
+    //                             timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+    //                             nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+    //                             signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+    //                             jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
+    //                             success: function (result) {
+    //                                 console.log(result, '请求微信成功')
+    //                                 console.log(window, 'window')
+    //                                 //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
+    //                                 window.WWOpenData.bind(document.querySelector('ww-open-data'))
+    //                             },
+    //                             fail: function (res) {
+    //                                 console.log('查看错误信息', res)
+    //                                 if (res.errMsg.indexOf('function not exist') > -1) {
+    //                                     alert('版本过低请升级')
+    //                                 }
+    //                             },
+    //                         })
+    //                       }
+    //                   }, (error) => {
+    //                       console.log('查看错误信息' + res)
+    //                       if (error.errMsg.indexOf('function not exist') > -1) {
+    //                           alert('版本过低请升级')
+    //                       }
+    //                   })
+    //           });
+    //       }
+    //    }, (error) => {
+    //       console.log(error, '哦耶')
+    //    })
+    // },
   },
   },
   mounted() {
   mounted() {
     this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
     this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
@@ -3052,7 +3057,7 @@ export default {
     this.getProfessional();
     this.getProfessional();
     this.getStaffCountMax();
     this.getStaffCountMax();
     // 获取企业微信的参数
     // 获取企业微信的参数
-    if(this.user.companyId = '1081') {
+    if(this.user.companyId == '1081' || this.user.companyId == '7') {
       this.agentConfig()
       this.agentConfig()
     }
     }
   },
   },

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/count/count.vue

@@ -90,7 +90,8 @@
         <template v-else>
         <template v-else>
             <van-cell v-for="item in showList" :key="item.id" title-style="color:#666">
             <van-cell v-for="item in showList" :key="item.id" title-style="color:#666">
                 <template #title>
                 <template #title>
-                    <div style="text-align:left;margin-left:0.42667rem;">{{item.name}}</div>
+                    <div style="text-align:left;margin-left:0.42667rem;" v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.name'></ww-open-data></div>
+                    <div style="text-align:left;margin-left:0.42667rem;" v-else>{{item.name}}</div>
                 </template>
                 </template>
                 <template #default>
                 <template #default>
                     <div style="text-align:right;margin-right:0.42667rem;">{{item.department}}</div>
                     <div style="text-align:right;margin-right:0.42667rem;">{{item.department}}</div>

+ 59 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -116,11 +116,70 @@
             if (localStorage.userInfo != null) {
             if (localStorage.userInfo != null) {
                 this.getAccountInfo();
                 this.getAccountInfo();
             }
             }
+            console.log('userNameNeedTranslate',window.location.href);
+            if(this.user.userNameNeedTranslate == '1'){
+                this.agentConfig()
+            }
         },
         },
         components: {
         components: {
             Footer
             Footer
         },
         },
         methods: {
         methods: {
+            // 获取企业微信参数
+            agentConfig(){
+                let curUrl = window.location.href.split('#')[0]
+                this.$axios.post('/wxcorp/getCorpWXConfig',{
+                    url: curUrl,
+                    token: this.user.id
+                }).then(res => {
+                    wx.config({
+                        beta: true,
+                        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                        appId: res.data.appid, // 必填,公众号的唯一标识 
+                        timestamp: res.data.timestamp, // 必填,生成签名的时间戳 
+                        nonceStr: res.data.noncestr, // 必填,生成签名的随机串 
+                        signature: res.data.sign, // 必填,签名,见附录1 
+                        jsApiList: ['chooseImage','previewImage','uploadImage','downloadImage','previewFile','getLocation','agentConfig'] 
+                    })
+                    let that = this
+                    wx.ready(function(){
+                    // config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready函数中。
+                        that.http.post("/wxcorp/getCorpWXAgentConfig", {url: curUrl, token: that.user.id}, (res) => {
+                            if (res.code == "ok") {
+                            console.log()
+                                wx.agentConfig({
+                                    corpid: res.data.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
+                                    agentid: res.data.agentid, // 必填,企业微信的应用id (e.g. 1000247)
+                                    timestamp: res.data.timestamp, // 必填,生成签名的时间戳
+                                    nonceStr: res.data.nonceStr, // 必填,生成签名的随机串
+                                    signature: res.data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
+                                    jsApiList: ['selectExternalContact'], //必填,传入需要使用的接口名称
+                                    success: function (result) {
+                                        // console.log(result, '请求微信成功')
+                                        // console.log(window, 'window')
+                                        //  wx.agentConfig成功回调后,WWOpenData 才会注入到 window 对象上面
+                                        window.WWOpenData.bind(document.querySelector('ww-open-data'))
+                                    },
+                                    fail: function (res) {
+                                        // console.log('查看错误信息', res)
+                                        if (res.errMsg.indexOf('function not exist') > -1) {
+                                            alert('版本过低请升级')
+                                        }
+                                    },
+                                })
+                            }
+                        }, (error) => {
+                            console.log('查看错误信息' + res)
+                            if (error.errMsg.indexOf('function not exist') > -1) {
+                                alert('版本过低请升级')
+                            }
+                        })
+                    });
+                }).catch(err => {
+
+                })
+            },
+
             //获取账户信息
             //获取账户信息
             getAccountInfo() {
             getAccountInfo() {
                 this.$axios.get('/user/loginByUserId', {params:{userId: this.user.id}})
                 this.$axios.get('/user/loginByUserId', {params:{userId: this.user.id}})

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/my/children/center.vue

@@ -5,7 +5,8 @@
             <div class="beijin"></div>
             <div class="beijin"></div>
             <div class="flex aic users pixed" style="width:50%;">
             <div class="flex aic users pixed" style="width:50%;">
                 <img :src="require('../../../assets/img/personal/userHead.png')" class="imege" />
                 <img :src="require('../../../assets/img/personal/userHead.png')" class="imege" />
-                <span class="f16 fff ml-20">{{userInfo.name}} </span>
+                <span class="f16 fff ml-20" v-if="userInfo.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='userInfo.name'></ww-open-data></span>
+                <span class="f16 fff ml-20" v-else>{{userInfo.name}} </span>
             </div>
             </div>
         </header>
         </header>