提交人:(方世筱)邹江涛

时间:2025-11-26 18:16
提交内容:待办增加移动端链接推送(移动端待办使用外网,PC端待办使用内网)
This commit is contained in:
Tao 2025-11-26 18:16:38 +08:00
parent c1769c0c68
commit 5b6e16d38a
3 changed files with 84 additions and 15 deletions

View File

@ -205,6 +205,14 @@ public class ToDoResendTack extends AbstractTask {
next.getString("factivityId"),
next.getString("fbusinesskey"),
next.getString("fid"));
//app地址
String app_Url = GetUrlUtils.getInstance().getAppUrl(next.getString("fprocessingpage"),
next.getString("fprocessingmobilepage"),
next.getString("fsource"),
accountId,
next.getString("factivityId"),
next.getString("fbusinesskey"),
next.getString("fid"));
StringBuilder form = new StringBuilder();
form.append("{");
form.append("\"title\":");
@ -226,10 +234,10 @@ public class ToDoResendTack extends AbstractTask {
form.append("\"handleUrl\":");
form.append("\"").append(pcUrl).append("&userName=").append(userName).append("\",");
form.append("\"appHandleUrl\":");
form.append("\"").append(pcUrl).append("&userName=").append(userName).append("\",");
form.append("\"").append(app_Url).append("&userName=").append(userName).append("\",");
// appUrl移动端查看模式
form.append("\"appViewUrl\":");
form.append("\"").append(pcUrl).append("&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"").append(app_Url).append("&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"appName\":");
form.append("\"").append(next.getString("fentityname")).append("\",");
//pc端查看模式

View File

@ -199,6 +199,13 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
next.getString("factivityId"),
next.getString("fbusinesskey"),
next.getString("fid"));
String app_Url = GetUrlUtils.getInstance().getAppUrl(next.getString("fprocessingpage"),
next.getString("fprocessingmobilepage"),
next.getString("fsource"),
accountId,
next.getString("factivityId"),
next.getString("fbusinesskey"),
next.getString("fid"));
StringBuilder form = new StringBuilder();
form.append("{");
form.append("\"title\":");
@ -220,10 +227,10 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
form.append("\"handleUrl\":");
form.append("\"").append(pcUrl).append("&userName=").append(userName).append("\",");
form.append("\"appHandleUrl\":");
form.append("\"").append(pcUrl).append("&userName=").append(userName).append("\",");
form.append("\"").append(app_Url).append("&userName=").append(userName).append("\",");
// appUrl移动端查看模式
form.append("\"appViewUrl\":");
form.append("\"").append(pcUrl).append("&ado=view&userName=").append(userName).append("\",");
form.append("\"").append(app_Url).append("&ado=view&userName=").append(userName).append("\",");
form.append("\"appName\":");
form.append("\"").append(next.getString("fentityname")).append("\",");
//pc端查看模式
@ -373,18 +380,19 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
form.append("\"").append(query_one.getString("username")).append("\",");
form.append("\"handleUrl\":");
Map<String, Object> taskInfo = GetUrlUtils.getTaskInfo(todoInfo.getTaskId());
String url = GetUrlUtils.buildTaskUrl(taskInfo);
form.append("\"").append(url).append("&userName=").append(userName).append("\",");
String pc_url = GetUrlUtils.buildTaskUrl(taskInfo);
String app_url = GetUrlUtils.buildAppTaskUrl(taskInfo);
form.append("\"").append(pc_url).append("&userName=").append(userName).append("\",");
form.append("\"appHandleUrl\":");
form.append("\"").append(url).append("&userName=").append(userName).append("\",");
form.append("\"").append(app_url).append("&userName=").append(userName).append("\",");
// appUrl移动端查看模式
form.append("\"appViewUrl\":");
form.append("\"").append(url).append("&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"").append(app_url).append("&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"appName\":");
form.append("\"").append(ctx.getEntityName()).append("\",");
//pc端查看模式
form.append("\"viewUrl\":");
form.append("\"").append(url).append("&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"").append(pc_url).append("&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"pendingId\":");
form.append("\"").append(todoInfo.getTaskId()).append("\",");
form.append("\"pendingAttr\":");
@ -437,18 +445,19 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
form.append("\"").append(query_one.getString("username")).append("\",");
form.append("\"handleUrl\":");
Map<String, Object> taskInfo = GetUrlUtils.getTaskInfo(todoInfo.getTaskId());
String url = GetUrlUtils.buildTaskUrl(taskInfo);
form.append("\"").append(url).append("&isNew=true&userName=").append(userName).append("\",");
String pc_url = GetUrlUtils.buildTaskUrl(taskInfo);
String app_url = GetUrlUtils.buildAppTaskUrl(taskInfo);
form.append("\"").append(pc_url).append("&isNew=true&userName=").append(userName).append("\",");
form.append("\"appHandleUrl\":");
form.append("\"").append(url).append("&isNew=true&userName=").append(userName).append("\",");
form.append("\"").append(app_url).append("&isNew=true&userName=").append(userName).append("\",");
// appUrl移动端查看模式
form.append("\"appViewUrl\":");
form.append("\"").append(url).append("&isNew=true&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"").append(app_url).append("&isNew=true&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"appName\":");
form.append("\"").append(ctx.getEntityName()).append("\",");
//pc端查看模式
form.append("\"viewUrl\":");
form.append("\"").append(url).append("&isNew=true&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"").append(pc_url).append("&isNew=true&userName=").append(userName).append("&ado=view").append("\",");
form.append("\"pendingId\":");
form.append("\"").append(todoInfo.getTaskId()).append("\",");
form.append("\"pendingAttr\":");
@ -457,6 +466,7 @@ public class BacklogServiceHandle extends AbstractServiceHandler {
logger.info("###推送新EOSS待办拼接请求体" + form);
CreateToDoHandler.get_CreateToDoHandler().sendCreateToDoNew(form.toString(), todoInfo.getTitle(),
todoInfo.getTaskId().toString(), query_one.getString("username"), dynamicObject.getString("billno"));
}
}

View File

@ -41,7 +41,7 @@ public class GetUrlUtils {
* @return
*/
public String getPcUrl(String formId, String mobFormId, String source, String accountId,
Object activityId, Object pkId, Object taskId) {
Object activityId, Object pkId, Object taskId) {
StringBuffer urlBuffer = new StringBuffer();
urlBuffer.append(System.getProperty("backlog-url"));
// urlBuffer.append("http:10.17.85:8022/ierp");
@ -56,6 +56,38 @@ public class GetUrlUtils {
urlBuffer.append("&apptype=todo");
return urlBuffer.toString();
}
/**
* 构建待办链接
* @param formId PC表单id
* @param mobFormId 移动表单id
* @param source 来源应用编码
* @param accountId 数据中心
* @param activityId 活动id
* @param pkId 单据id
* @param taskId 任务id
* @return
*/
public String getAppUrl(String formId, String mobFormId, String source, String accountId,
Object activityId, Object pkId, Object taskId) {
StringBuffer urlBuffer = new StringBuffer();
urlBuffer.append(System.getProperty("backlog-app-url"));
// urlBuffer.append("http:10.17.85:8022/ierp");
urlBuffer.append("/integration/yzjShareOpen.do");
urlBuffer.append("?formId=").append(formId);
urlBuffer.append("&mb_formId=").append(mobFormId);
urlBuffer.append("&pkId=").append(pkId);
urlBuffer.append("&src=").append(source.toLowerCase());
urlBuffer.append("&accountId=").append(accountId);
urlBuffer.append("&activityId=").append(activityId);
urlBuffer.append("&tId=").append(taskId);
urlBuffer.append("&apptype=todo");
return urlBuffer.toString();
}
public static Map<String,Object> getTaskInfo(Object taskId){
Map<String,Object> taskMap = new HashMap();
StringBuffer sqlCmd = new StringBuffer();
@ -101,5 +133,24 @@ public class GetUrlUtils {
}
return null;
}
/**
* 构建移动端待办链接
* @param taskMap 任务信息
* @return
*/
public static String buildAppTaskUrl(Map<String,Object> taskMap){
if(taskMap != null && taskMap.size() >= 6){
String accountId = System.getProperty("backlog-accountid");
getInstance();
return _instance.getAppUrl((String)taskMap.get("formId"),
(String)taskMap.get("mobFormId"),
(String)taskMap.get("source"),
accountId,
taskMap.get("activityId"),
taskMap.get("pkId"),
taskMap.get("taskId"));
}
return null;
}
}