Browse Source

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!1848
o2null 5 years ago
parent
commit
48ef804ef2

+ 1 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Dingding.java

@@ -31,7 +31,7 @@ public class Dingding extends ConfigObject {
 	@FieldDescribe("应用的密钥")
 	private String appSecret;
 
-	@FieldDescribe("组织同步cron,默认每10分钟同步一次.")
+	@FieldDescribe("回调信号触发同步检查,默认每10分钟运行一次,如果期间内有钉钉回调信号接收到,那么触发同步任务进行人员同步.")
 	private String syncCron;
 
 	@FieldDescribe("强制拉入同步cron,默认在每天的8点和12点强制进行同步.")

File diff suppressed because it is too large
+ 2 - 4
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Qiyeweixin.java


+ 214 - 217
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WeLink.java

@@ -10,231 +10,228 @@ import java.util.Calendar;
 import java.util.Date;
 
 /**
- * Created by fancyLou on 2020-07-24.
- * Copyright © 2020 O2. All rights reserved.
+ * Created by fancyLou on 2020-07-24. Copyright © 2020 O2. All rights reserved.
  */
 public class WeLink extends ConfigObject {
 
-    @FieldDescribe("是否启用")
-    private Boolean enable;
+	@FieldDescribe("是否启用")
+	private Boolean enable;
 
-    @FieldDescribe("WeLink应用的client_id")
-    private String clientId;
+	@FieldDescribe("WeLink应用的client_id")
+	private String clientId;
 
-    @FieldDescribe("WeLink应用的client_secret")
-    private String clientSecret;
+	@FieldDescribe("WeLink应用的client_secret")
+	private String clientSecret;
 
+	@FieldDescribe("回调信号触发同步检查,默认每10分钟运行一次,如果期间内有WeLink回调信号接收到,那么触发同步任务进行人员同步.")
+	private String syncCron;
 
-    @FieldDescribe("组织同步cron,默认每10分钟同步一次.")
-    private String syncCron;
+	@FieldDescribe("强制拉入同步cron,默认在每天的8点和12点强制进行同步.")
+	private String forceSyncCron;
 
-    @FieldDescribe("强制拉入同步cron,默认在每天的8点和12点强制进行同步.")
-    private String forceSyncCron;
+	@FieldDescribe("WeLink api服务器地址")
+	private String oapiAddress;
 
-    @FieldDescribe("WeLink api服务器地址")
-    private String oapiAddress;
+	@FieldDescribe("是否启用消息推送")
+	private Boolean messageEnable;
 
-    @FieldDescribe("是否启用消息推送")
-    private Boolean messageEnable;
-
-    @FieldDescribe("WeLink消息打开工作的url地址,如:http://dev.o2oa.net/x_desktop/")
-    private String workUrl = "";
-
-    @FieldDescribe("WeLink消息处理完成后跳转到特定的门户页面的Id")
-    private String messageRedirectPortal = "";
-
-
-
-    public static WeLink defaultInstance() {
-        return new WeLink();
-    }
-
-    public static final Boolean default_enable = false;
-    public static final String default_clientId = "";
-    public static final String default_clientSecret = "";
-    public static final String default_syncCron = "10 0/10 * * * ?";
-    public static final String default_forceSyncCron = "10 45 8,12 * * ?";
-    public static final String default_oapiAddress = "https://open.welink.huaweicloud.com/api";
-    public static final Boolean default_messageEnable = false;
-    public static final String default_workUrl = "";
-    public static final String default_messageRedirectPortal = "";
-
-
-    public WeLink() {
-        this.enable = default_enable;
-        this.clientId = default_clientId;
-        this.clientSecret = default_clientSecret;
-        this.syncCron = default_syncCron;
-        this.forceSyncCron = default_forceSyncCron;
-        this.oapiAddress = default_oapiAddress;
-        this.messageEnable = default_messageEnable;
-        this.workUrl = default_workUrl;
-        this.messageRedirectPortal = default_messageRedirectPortal;
-    }
-
-    public static String WeLink_Auth_Head_Key = "x-wlk-Authorization";
-
-    private static String cachedAccessToken;
-    private static Date cachedAccessTokenDate;
-
-    public static class AccessTokenReq {
-       private String client_id;
-       private String client_secret;
-
-        public String getClient_id() {
-            return client_id;
-        }
-
-        public void setClient_id(String client_id) {
-            this.client_id = client_id;
-        }
-
-        public String getClient_secret() {
-            return client_secret;
-        }
-
-        public void setClient_secret(String client_secret) {
-            this.client_secret = client_secret;
-        }
-    }
-    public static class AccessTokenResp {
-
-        private String access_token;
-        private String code;
-        private String message;
-        private Integer expires_in;
-
-        public String getAccess_token() {
-            return access_token;
-        }
-
-        public void setAccess_token(String access_token) {
-            this.access_token = access_token;
-        }
-
-        public String getCode() {
-            return code;
-        }
-
-        public void setCode(String code) {
-            this.code = code;
-        }
-
-        public String getMessage() {
-            return message;
-        }
-
-        public void setMessage(String message) {
-            this.message = message;
-        }
-
-        public Integer getExpires_in() {
-            return expires_in;
-        }
-
-        public void setExpires_in(Integer expires_in) {
-            this.expires_in = expires_in;
-        }
-    }
-
-    /**
-     * 获取WeLink AccessToken
-     * @return
-     * @throws Exception
-     */
-    public String accessToken() throws Exception {
-        if ((StringUtils.isNotEmpty(cachedAccessToken) && (null != cachedAccessTokenDate))
-                && (cachedAccessTokenDate.after(new Date()))) {
-            return cachedAccessToken;
-        } else {
-            String address = this.getOapiAddress() + "/auth/v2/tickets";
-            AccessTokenReq req = new AccessTokenReq();
-            req.setClient_id(this.getClientId());
-            req.setClient_secret(this.getClientSecret());
-            AccessTokenResp resp = HttpConnection.postAsObject(address, null, XGsonBuilder.instance().toJson(req), AccessTokenResp.class);
-            if (!resp.getCode().equals("0")) {
-                throw new ExceptionWeLinkAccessToken(resp.getCode(), resp.getMessage());
-            }
-            cachedAccessToken = resp.getAccess_token();
-            Integer second = resp.expires_in;//过期时间 秒
-            Calendar cal = Calendar.getInstance();
-            cal.add(Calendar.SECOND, (second - 300));
-            cachedAccessTokenDate = cal.getTime();
-            return cachedAccessToken;
-        }
-    }
-
-
-
-    public Boolean getEnable() {
-        return BooleanUtils.isTrue(this.enable);
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public String getClientId() {
-        return StringUtils.isEmpty(this.clientId) ? default_clientId : this.clientId;
-    }
-
-    public void setClientId(String clientId) {
-        this.clientId = clientId;
-    }
-
-    public String getClientSecret() {
-        return StringUtils.isEmpty(this.clientSecret) ? default_clientSecret : this.clientSecret;
-    }
-
-    public void setClientSecret(String clientSecret) {
-        this.clientSecret = clientSecret;
-    }
-
-    public String getSyncCron() {
-        return StringUtils.isEmpty(this.syncCron) ? default_syncCron : this.syncCron;
-    }
-
-    public void setSyncCron(String syncCron) {
-        this.syncCron = syncCron;
-    }
-
-    public String getForceSyncCron() {
-        return StringUtils.isEmpty(this.forceSyncCron) ? default_forceSyncCron : this.forceSyncCron;
-    }
-
-    public void setForceSyncCron(String forceSyncCron) {
-        this.forceSyncCron = forceSyncCron;
-    }
-
-    public String getOapiAddress() {
-        return StringUtils.isEmpty(this.oapiAddress) ? default_oapiAddress : this.oapiAddress;
-    }
-
-    public void setOapiAddress(String oapiAddress) {
-        this.oapiAddress = oapiAddress;
-    }
-
-    public Boolean getMessageEnable() {
-        return BooleanUtils.isTrue(this.messageEnable);
-    }
-
-    public void setMessageEnable(Boolean messageEnable) {
-        this.messageEnable = messageEnable;
-    }
-
-    public String getWorkUrl() {
-        return StringUtils.isEmpty(this.workUrl) ? default_workUrl : this.workUrl;
-    }
-
-    public void setWorkUrl(String workUrl) {
-        this.workUrl = workUrl;
-    }
-
-    public String getMessageRedirectPortal() {
-        return StringUtils.isEmpty(this.messageRedirectPortal) ? default_messageRedirectPortal : this.messageRedirectPortal;
-    }
-
-    public void setMessageRedirectPortal(String messageRedirectPortal) {
-        this.messageRedirectPortal = messageRedirectPortal;
-    }
+	@FieldDescribe("WeLink消息打开工作的url地址,如:http://dev.o2oa.net/x_desktop/")
+	private String workUrl = "";
+
+	@FieldDescribe("WeLink消息处理完成后跳转到特定的门户页面的Id")
+	private String messageRedirectPortal = "";
+
+	public static WeLink defaultInstance() {
+		return new WeLink();
+	}
+
+	public static final Boolean default_enable = false;
+	public static final String default_clientId = "";
+	public static final String default_clientSecret = "";
+	public static final String default_syncCron = "10 0/10 * * * ?";
+	public static final String default_forceSyncCron = "10 45 8,12 * * ?";
+	public static final String default_oapiAddress = "https://open.welink.huaweicloud.com/api";
+	public static final Boolean default_messageEnable = false;
+	public static final String default_workUrl = "";
+	public static final String default_messageRedirectPortal = "";
+
+	public WeLink() {
+		this.enable = default_enable;
+		this.clientId = default_clientId;
+		this.clientSecret = default_clientSecret;
+		this.syncCron = default_syncCron;
+		this.forceSyncCron = default_forceSyncCron;
+		this.oapiAddress = default_oapiAddress;
+		this.messageEnable = default_messageEnable;
+		this.workUrl = default_workUrl;
+		this.messageRedirectPortal = default_messageRedirectPortal;
+	}
+
+	public static String WeLink_Auth_Head_Key = "x-wlk-Authorization";
+
+	private static String cachedAccessToken;
+	private static Date cachedAccessTokenDate;
+
+	public static class AccessTokenReq {
+		private String client_id;
+		private String client_secret;
+
+		public String getClient_id() {
+			return client_id;
+		}
+
+		public void setClient_id(String client_id) {
+			this.client_id = client_id;
+		}
+
+		public String getClient_secret() {
+			return client_secret;
+		}
+
+		public void setClient_secret(String client_secret) {
+			this.client_secret = client_secret;
+		}
+	}
+
+	public static class AccessTokenResp {
+
+		private String access_token;
+		private String code;
+		private String message;
+		private Integer expires_in;
+
+		public String getAccess_token() {
+			return access_token;
+		}
+
+		public void setAccess_token(String access_token) {
+			this.access_token = access_token;
+		}
+
+		public String getCode() {
+			return code;
+		}
+
+		public void setCode(String code) {
+			this.code = code;
+		}
+
+		public String getMessage() {
+			return message;
+		}
+
+		public void setMessage(String message) {
+			this.message = message;
+		}
+
+		public Integer getExpires_in() {
+			return expires_in;
+		}
+
+		public void setExpires_in(Integer expires_in) {
+			this.expires_in = expires_in;
+		}
+	}
+
+	/**
+	 * 获取WeLink AccessToken
+	 * 
+	 * @return
+	 * @throws Exception
+	 */
+	public String accessToken() throws Exception {
+		if ((StringUtils.isNotEmpty(cachedAccessToken) && (null != cachedAccessTokenDate))
+				&& (cachedAccessTokenDate.after(new Date()))) {
+			return cachedAccessToken;
+		} else {
+			String address = this.getOapiAddress() + "/auth/v2/tickets";
+			AccessTokenReq req = new AccessTokenReq();
+			req.setClient_id(this.getClientId());
+			req.setClient_secret(this.getClientSecret());
+			AccessTokenResp resp = HttpConnection.postAsObject(address, null, XGsonBuilder.instance().toJson(req),
+					AccessTokenResp.class);
+			if (!resp.getCode().equals("0")) {
+				throw new ExceptionWeLinkAccessToken(resp.getCode(), resp.getMessage());
+			}
+			cachedAccessToken = resp.getAccess_token();
+			Integer second = resp.expires_in;// 过期时间 秒
+			Calendar cal = Calendar.getInstance();
+			cal.add(Calendar.SECOND, (second - 300));
+			cachedAccessTokenDate = cal.getTime();
+			return cachedAccessToken;
+		}
+	}
+
+	public Boolean getEnable() {
+		return BooleanUtils.isTrue(this.enable);
+	}
+
+	public void setEnable(Boolean enable) {
+		this.enable = enable;
+	}
+
+	public String getClientId() {
+		return StringUtils.isEmpty(this.clientId) ? default_clientId : this.clientId;
+	}
+
+	public void setClientId(String clientId) {
+		this.clientId = clientId;
+	}
+
+	public String getClientSecret() {
+		return StringUtils.isEmpty(this.clientSecret) ? default_clientSecret : this.clientSecret;
+	}
+
+	public void setClientSecret(String clientSecret) {
+		this.clientSecret = clientSecret;
+	}
+
+	public String getSyncCron() {
+		return StringUtils.isEmpty(this.syncCron) ? default_syncCron : this.syncCron;
+	}
+
+	public void setSyncCron(String syncCron) {
+		this.syncCron = syncCron;
+	}
+
+	public String getForceSyncCron() {
+		return StringUtils.isEmpty(this.forceSyncCron) ? default_forceSyncCron : this.forceSyncCron;
+	}
+
+	public void setForceSyncCron(String forceSyncCron) {
+		this.forceSyncCron = forceSyncCron;
+	}
+
+	public String getOapiAddress() {
+		return StringUtils.isEmpty(this.oapiAddress) ? default_oapiAddress : this.oapiAddress;
+	}
+
+	public void setOapiAddress(String oapiAddress) {
+		this.oapiAddress = oapiAddress;
+	}
+
+	public Boolean getMessageEnable() {
+		return BooleanUtils.isTrue(this.messageEnable);
+	}
+
+	public void setMessageEnable(Boolean messageEnable) {
+		this.messageEnable = messageEnable;
+	}
+
+	public String getWorkUrl() {
+		return StringUtils.isEmpty(this.workUrl) ? default_workUrl : this.workUrl;
+	}
+
+	public void setWorkUrl(String workUrl) {
+		this.workUrl = workUrl;
+	}
+
+	public String getMessageRedirectPortal() {
+		return StringUtils.isEmpty(this.messageRedirectPortal) ? default_messageRedirectPortal
+				: this.messageRedirectPortal;
+	}
+
+	public void setMessageRedirectPortal(String messageRedirectPortal) {
+		this.messageRedirectPortal = messageRedirectPortal;
+	}
 }

+ 1 - 1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ZhengwuDingding.java

@@ -22,7 +22,7 @@ public class ZhengwuDingding extends ConfigObject {
 	private String appSecret;
 	@FieldDescribe("政务钉钉agentId")
 	private String agentId;
-	@FieldDescribe("拉入同步cron,默认每10分钟同步一次.")
+	@FieldDescribe("回调信号触发同步检查,默认每10分钟运行一次,如果期间内有政务钉钉回调信号接收到,那么触发同步任务进行人员同步.")
 	private String syncCron;
 	@FieldDescribe("强制拉入同步cron,默认在每天的8点和12点强制进行同步.")
 	private String forceSyncCron;

+ 4 - 0
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/input/ActionCover.java

@@ -59,6 +59,10 @@ class ActionCover extends BaseAction {
 			appInfo.setAppName(this.idleAppInfoName(business, appInfo.getAppName(), appInfo.getId()));
 			appInfo.setAppAlias(this.idleAppInfoAlias(business, appInfo.getAppAlias(), appInfo.getId()));
 			persistObjects.add(appInfo);
+		}else{
+			WrapCms.inCopier.copy(wi, appInfo);
+			appInfo.setAppName(this.idleAppInfoName(business, appInfo.getAppName(), appInfo.getId()));
+			appInfo.setAppAlias(this.idleAppInfoAlias(business, appInfo.getAppAlias(), appInfo.getId()));
 		}
 
 		//2020年1月16日 O2LEE 保存栏目信息对应的配置支持信息JSON ---->start

+ 9 - 0
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/oauth/ActionToken.java

@@ -52,6 +52,15 @@ class ActionToken extends StandardJaxrsAction {
 	public static class WoToken extends GsonPropertyObject {
 		private String access_token;
 		private Integer expires_in;
+		private String token_type = "bearer";
+
+		public String getToken_type() {
+			return token_type;
+		}
+
+		public void setToken_type(String token_type) {
+			this.token_type = token_type;
+		}
 
 		public String getAccess_token() {
 			return access_token;

+ 7 - 1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/input/ActionCover.java

@@ -64,7 +64,13 @@ class ActionCover extends BaseAction {
 			portal.setName(this.idlePortalName(business, portal.getName(), portal.getId()));
 			portal.setAlias(this.idlePortalAlias(business, portal.getAlias(), portal.getId()));
 			persistObjects.add(portal);
-		}else if (!business.editable(effectivePerson, portal)) {
+		}else{
+			WrapPortal.inCopier.copy(wi, portal);
+			portal.setName(this.idlePortalName(business, portal.getName(), portal.getId()));
+			portal.setAlias(this.idlePortalAlias(business, portal.getAlias(), portal.getId()));
+		}
+
+		if (!business.editable(effectivePerson, portal)) {
 			throw new ExceptionPortalAccessDenied(effectivePerson.getName(), portal.getName(), portal.getId());
 		}
 

+ 6 - 1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/input/ActionCover.java

@@ -104,7 +104,12 @@ class ActionCover extends BaseAction {
 			application.setName(this.idleApplicationName(business, application.getName(), application.getId()));
 			application.setAlias(this.idleApplicationAlias(business, application.getAlias(), application.getId()));
 			persistObjects.add(application);
-		}else if (!business.editable(effectivePerson, application)) {
+		}else{
+			WrapProcessPlatform.inCopier.copy(wi, application);
+			application.setName(this.idleApplicationName(business, application.getName(), application.getId()));
+			application.setAlias(this.idleApplicationAlias(business, application.getAlias(), application.getId()));
+		}
+		if (!business.editable(effectivePerson, application)) {
 			throw new ExceptionApplicationAccessDenied(effectivePerson.getName(), application.getName(),
 					application.getId());
 		}

+ 2 - 3
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionCreateWithWork.java

@@ -1,12 +1,12 @@
 package com.x.processplatform.assemble.surface.jaxrs.read;
 
-import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
 
 import com.google.gson.JsonElement;
 import com.x.base.core.container.EntityManagerContainer;
 import com.x.base.core.container.factory.EntityManagerContainerFactory;
+import com.x.base.core.project.Applications;
 import com.x.base.core.project.x_processplatform_service_processing;
 import com.x.base.core.project.annotation.FieldDescribe;
 import com.x.base.core.project.exception.ExceptionAccessDenied;
@@ -15,7 +15,6 @@ import com.x.base.core.project.gson.GsonPropertyObject;
 import com.x.base.core.project.http.ActionResult;
 import com.x.base.core.project.http.EffectivePerson;
 import com.x.base.core.project.jaxrs.WoId;
-import com.x.base.core.project.tools.DefaultCharset;
 import com.x.base.core.project.tools.ListTools;
 import com.x.processplatform.assemble.surface.Business;
 import com.x.processplatform.assemble.surface.ThisApplication;
@@ -49,7 +48,7 @@ class ActionCreateWithWork extends BaseAction {
 
 		List<Wo> wos = ThisApplication.context().applications()
 				.postQuery(effectivePerson.getDebugger(), x_processplatform_service_processing.class,
-						"read/work/" + URLEncoder.encode(work.getId(), DefaultCharset.name), wi, work.getJob())
+						Applications.joinQueryUri("read", "work", work.getId()), wi, work.getJob())
 				.getDataAsList(Wo.class);
 		result.setData(wos);
 		return result;

+ 6 - 2
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/input/ActionCover.java

@@ -61,10 +61,14 @@ class ActionCover extends BaseAction {
 			query.setName(this.idleQueryName(business, query.getName(), query.getId()));
 			query.setAlias(this.idleQueryAlias(business, query.getAlias(), query.getId()));
 			persistObjects.add(query);
-		}else if (!business.editable(effectivePerson, query)) {
+		}else {
+			WrapQuery.inCopier.copy(wi, query);
+			query.setName(this.idleQueryName(business, query.getName(), query.getId()));
+			query.setAlias(this.idleQueryAlias(business, query.getAlias(), query.getId()));
+		}
+		if (!business.editable(effectivePerson, query)) {
 			throw new ExceptionQueryAccessDenied(effectivePerson.getName(), query.getName(), query.getId());
 		}
-
 		for (WrapView _o : wi.getViewList()) {
 			View obj = business.entityManagerContainer().find(_o.getId(), View.class);
 			if (null != obj) {

+ 9 - 1
o2web/source/x_component_Selector/IdentityWidthDuty.js

@@ -75,6 +75,8 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
                     if (unitName)unitList.push( unitName )
                 });
 
+                debugger;
+
                 if( !this.options.expandSubEnable ){
                     this.allUnitNames = unitList;
                     loadDuty();
@@ -85,7 +87,13 @@ MWF.xApplication.Selector.IdentityWidthDuty = new Class({
                             var unitNames = [];
                             //排序
                             if( this.options.units.length === 1 ){
-                                unitNames = unitList.concat( json1.data );
+                                // unitNames = unitList.concat( json1.data );
+                                unitNames = Array.clone(unitList);
+                                for( var i=0; i<json1.data.length; i++ ){
+                                    if( !unitNames.contains(json1.data[i].distinguishedName) ){
+                                        unitNames.push( json1.data[i].distinguishedName );
+                                    }
+                                }
                             }else{
                                 unitObjectList.each( function ( u ) {
                                     unitNames.push( u.distinguishedName || u.unique || u.id || u.levelName );

Some files were not shown because too many files changed in this diff