Ver Fonte

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

# Conflicts:
#	fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
seyason há 2 anos atrás
pai
commit
906ef18c3a

+ 24 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java

@@ -47,6 +47,8 @@ public class AuthRedirectController {
     private String pcUrl;
     @Value("${privateDeployURL.mobUrl}")
     private String mobUrl;
+    @Value("${corpId}")
+    private String corpId;
 
     @Resource
     SysConfigMapper sysConfigMapper;
@@ -63,13 +65,14 @@ public class AuthRedirectController {
 
 
     @RequestMapping("/corpWXAuth")
-    public ModelAndView auth(String code, String state) {
+    public ModelAndView auth(String code, String state) throws Exception{
         Map<String,Object> reqParam = new HashMap<String,Object>(16);
         String userAgent = request.getHeader("User-Agent");
         //获取设备类型
         String deviceType = UserAgentUtils.getDeviceType(userAgent);
+        WxCorpInfo corpInfo = wxCorpInfoMapper.selectById(corpId);
         boolean isMobile = "MOBILE".equals(deviceType);
-        String url = WeiXinCorpController.GET_CORP_USERINFO_URL.replace("SUITE_ACCESS_TOKEN", getSuiteAccessToken()).replace("CODE", code);
+        String url = WeiXinCorpController.GET_CORP_INSIDE_USERINFO_URL.replace("ACCESS_TOKEN",getCorpConcactAccessToken(corpInfo)).replace("CODE", code);
         String forObject = this.restTemplate.getForObject(url, String.class);
         JSONObject obj = JSONObject.parseObject(forObject);
         String wxUserId = obj.getString("UserId");
@@ -245,4 +248,23 @@ public class AuthRedirectController {
         return WeiXinCorpController.SUITE_ACCESS_TOKEN;
     }
 
+
+    //获取企业通讯录的accessToken,在私有化部署的企业内部服务器上跑
+    private String getCorpConcactAccessToken(WxCorpInfo corpInfo) throws Exception {
+        String url = WeiXinCorpController.GET_CORP_TOKEN.replace("ID", corpInfo.getCorpid()).replace("SECRET", corpInfo.getContactSecret());
+        ResponseEntity<String> responseEntity = this.restTemplate.exchange(url,
+                HttpMethod.GET, null, String.class);
+        if (responseEntity.getStatusCode() == HttpStatus.OK) {
+            String resp = responseEntity.getBody();
+            JSONObject json = JSONObject.parseObject(resp);
+            if (json.getIntValue("errcode") == 0) {
+                String access_token = json.getString("access_token");
+                corpInfo.setAccessToken(access_token);
+            } else {
+                throw new Exception(json.toJSONString());
+            }
+        }
+        return corpInfo.getAccessToken();
+    }
+
 }

+ 2 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -80,6 +80,8 @@ public class WeiXinCorpController {
     //网页获取企业用户信息
     public static final String GET_CORP_USERINFO_URL = "https://qyapi.weixin.qq.com/cgi-bin/service/getuserinfo3rd?suite_access_token=SUITE_ACCESS_TOKEN&code=CODE";
     public static final String GET_LIST_MEMB_AUTH = "https://qyapi.weixin.qq.com/cgi-bin/user/list_member_auth?access_token=ACCESS_TOKEN";
+    //网页获取企业内部用户信息
+    public static final String GET_CORP_INSIDE_USERINFO_URL = "https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token=ACCESS_TOKEN&code=CODE";
     //获取员工打卡日报统计信息
     public static final String GET_CHECKIN_DAYDATA = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckin_daydata?access_token=ACCESS_TOKEN";
 

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

@@ -207,7 +207,7 @@ public class TimingTask {
 
 
     //每天2:11 同步钉钉用户前2天到未来30天时间段的打卡,请假,出差数据
-    @Scheduled(cron = "0 10 15 ? * *")
+    @Scheduled(cron = "0 25 15 ? * *")
     private void synFanWeiWorkData() {
         /*if (isDev) return;*/
         List<TimeType> timeTypeList = timeTypeMapper.selectList(new QueryWrapper<TimeType>().eq("sync_fanwei", 1));
@@ -278,7 +278,7 @@ public class TimingTask {
                leaveSheet.setOwnerId(user.getId());
                leaveSheet.setOwnerName(user.getName());
                leaveSheet.setStartDate(LocalDate.parse(String.valueOf(map.get("startDate")),dtf1));
-               leaveSheet.setEndDate(LocalDate.parse(String.valueOf(map.get("endDate")),dtf1));
+               leaveSheet.setEndDate(LocalDate.parse(String.valueOf(map.get("endtDate")),dtf1));
                int timeType = Integer.parseInt(String.valueOf(map.get("timeType")));
                leaveSheet.setTimeType(timeType);
                leaveSheet.setTimeDays((Float) map.get("timeDays"));

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -15,6 +15,7 @@ spring:
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://47.101.180.183:3306/man_mld?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     url: jdbc:mysql://47.101.180.183:3306/man_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&rewriteBatchedStatements=true&useSSL=false
     username: root
     password: HuoshiDB@2022
@@ -137,7 +138,7 @@ excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error,/testClient,/corpWXAuth,/w
 suitId: ww4e237fd6abb635af
 suitSecret: 1ApL6LIB4Z0v7wBrKTUNmJrerRWV3gEQWBlYOm8Kijw
 #平台作为服务商的参数
-corpId: wwf11426cf618e1703
+corpId: ww0b9aafe69e506b8b
 token: Mhi7ehNX61UN4MB7PHnC
 encodingAesKey: PHVMkME1XMrImmGJZ4OZJxSysI7hFEhtDDUQrlHAfIS
 providerSecret: wlwGIUXskWKsNtCfKUsAfJ6ueba55rZnqZvcC-rUM6nQ-LnRDyYgISQ2BO-UlL_A
@@ -147,4 +148,9 @@ configEnv:
   # 是否是私有化部署,企业内部应用
   isPrivateDeploy: false
 
+privateDeployURL:
+  pcUrl: http://dev.huoshishanxin.com/#/
+  mobUrl: http://dev.huoshishanxin.com/#/
+
+
 

Diff do ficheiro suprimidas por serem muito extensas
+ 40704 - 42375
fhKeeper/formulahousekeeper/management-platform/workTime.log


+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,10 +1,10 @@
 var path = require('path')
 
-//  var ip = '127.0.0.1'
+ var ip = '127.0.0.1'
 // var ip = '47.101.180.183'
 // var ip = '47.100.37.243'
 // var ip = '192.168.2.31'
-var ip = '192.168.2.44'
+// var ip = '192.168.2.44'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -4,9 +4,9 @@ const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 const Timestamp = new Date().getTime();
 
-var ip = '47.101.180.183'
+// var ip = '47.101.180.183'
 // var ip = '192.168.2.7'
-// var ip = '127.0.0.1'
+var ip = '127.0.0.1'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {