Переглянути джерело

企业微信的任务消息点击直接跳转到待办任务,待审核消息也进入项目报告审核

seyason 2 роки тому
батько
коміт
c8740d1be0

+ 5 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/AuthRedirectController.java

@@ -12,6 +12,7 @@ import com.management.platform.service.UserService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
 import com.management.platform.util.UserAgentUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -103,8 +104,10 @@ public class AuthRedirectController {
             }
         }
         reqParam.put("hasTriedAutoLogin", 1);
-        System.out.println("state========"+state);
-        reqParam.put("state", state);
+        if (!StringUtils.isEmpty(state) && state.length() > 1) {
+            reqParam.put("path", state);
+        }
+
         String redirecUrl = null;
         String router = "index";
         if (companyId > 0) {
@@ -121,7 +124,6 @@ public class AuthRedirectController {
         } else {
             redirecUrl = "https://worktime.ttkuaiban.com/#/" + router;
         }
-        System.out.println("redirecUrl="+redirecUrl);
         ModelAndView modelAndView = new ModelAndView(
                 new RedirectView(redirecUrl), reqParam);
 

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/TaskController.java

@@ -277,7 +277,7 @@ public class TaskController {
                         jsonObj.put("value",task.getName());
                         dataJson.add(jsonObj);
                         json.put("template_id","tty9TkCAAAovv416zsWtn0e06CJ635HA");
-                        json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                        json.put("url", "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=task#wechat_redirect");
                         json.put("content_item",dataJson);
                         wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpUid, json);
                     });

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

@@ -1395,11 +1395,9 @@ public class WeiXinCorpController {
                         project.setCreateDate(LocalDate.now());
                         project.setProjectCode("example");
                         project.setProjectName("示例项目");
+                        //设置为公共项目,这样测试的用户都能填报
+                        project.setIsPublic(1);
                         projectMapper.insert(project);
-                        //todo:  设置初始项目参与人
-                        Participation participation=new Participation();
-                        participation.setProjectId(project.getId()).setUserId(user.getId());
-                        participationMapper.insert(participation);
                         //todo: 生成初始项目相关日报审核人
                         ProjectAuditor projectAuditor=new ProjectAuditor();
                         projectAuditor.setAuditorId(user.getId());

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskProgressServiceImpl.java

@@ -136,7 +136,7 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
                     dataJson.add(jsonObj2);
                     dataJson.add(jsonObj3);
                     json.put("template_id","tty9TkCAAASja8aiHGlheqEHQ7OIpRyg");
-                    json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                    json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=task#wechat_redirect");
                     json.put("content_item",dataJson);
                     wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
                 }

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

@@ -383,7 +383,7 @@ public class TimingTask {
                     jsonObj.put("value",StringUtils.isEmpty(map.get("num"))?"":map.get("num"));
                     dataJson.add(jsonObj);
                     json.put("template_id","tty9TkCAAAuPvPjabDdQXGocnG0K24EQ");
-                    json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=0#wechat_redirect");
+                    json.put("url","https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww4e237fd6abb635af&redirect_uri=http://worktime.ttkuaiban.com/api/corpWXAuth&response_type=code&scope=snsapi_base&state=review#wechat_redirect");
                     json.put("content_item",dataJson);
                     wxCorpInfoService.sendWXCorpTemplateMsg(wxCorpInfo, corpwxUserid, json);
                     }

+ 1 - 0
fhKeeper/formulahousekeeper/show.sh

@@ -0,0 +1 @@
+ps -ef|grep timesheet-3.4.0.jar

+ 1 - 0
fhKeeper/formulahousekeeper/startWorkTime.sh

@@ -0,0 +1 @@
+nohup java -jar -Djava.library.path=/usr/local/share/java/opencv4/ timesheet-3.4.0.jar --spring.profiles.active=prod > wt_print.log 2>&1&

+ 11 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -110,7 +110,11 @@
                         if (loginUserId.includes('#/')) {
                             loginUserId = loginUserId.substring(0, loginUserId.indexOf('#/'));
                         }
-                        this.loginByUserId(loginUserId);
+                        var path = null;
+                        if (href.indexOf('path') > 0) {
+                            path = href.split('path=')[1].split('&')[0];
+                        }
+                        this.loginByUserId(loginUserId, path);
                     }
                 } else {
                     //检查环境,如果是钉钉有$CORPID$
@@ -232,7 +236,7 @@
                 var weixinUrl="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appId+"&redirect_uri="+encodeURI(url)+"&response_type=code&scope=snsapi_base&state=1#wechat_redirect";
                 window.location.href = weixinUrl;
             },
-            loginByUserId(userId) {
+            loginByUserId(userId, path) {
                 this.http.post("/user/loginByUserId", {userId:userId} , res => {
                             if (res.code == "ok") {
                                 var user = res.data;
@@ -240,7 +244,11 @@
                                 sessionStorage.setItem('user', JSON.stringify(res.data));
                                 this.permissionsList(res.data)
                                 if(user.moduleList.length > 0) {
-                                    this.$router.push({ path: user.moduleList[0].path })
+                                    if (path) {
+                                        this.$router.push({ path: path })
+                                    } else {
+                                        this.$router.push({ path: user.moduleList[0].path })
+                                    }
                                 }
                             } else {
                                 this.$message({

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -240,6 +240,7 @@
                         this.key++
                         this.getModule()
                         this.getMessage();
+                        this.redirectIfNess();
                         this.$forceUpdate()
                         // this.bindIfNessary();
                     } 
@@ -247,7 +248,13 @@
                     alert('err=' + err);
                 });
             },
-
+            redirectIfNess() {
+                var href = window.location.href;
+                if (href.indexOf('path') > 0) {
+                    var path = href.split('path=')[1].split('&')[0];
+                    this.$router.push(path);
+                }
+            },
             bindIfNessary() {
                 let href = window.location.href;
                 var requestUrl = "";