知识库代码提交
This commit is contained in:
		
							parent
							
								
									e4bf4617f3
								
							
						
					
					
						commit
						9722a1b6d0
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| Before Width: | Height: | Size: 1.2 MiB | 
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| Before Width: | Height: | Size: 1.2 MiB | 
| @ -0,0 +1,47 @@ | ||||
| package com.actionsoft.apps.kms; | ||||
| 
 | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.model.VersionModel; | ||||
| import com.actionsoft.apps.listener.AppListener; | ||||
| import com.actionsoft.apps.resource.AppContext; | ||||
| import com.actionsoft.bpms.commons.database.BatchPreparedStatementSetter; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| 
 | ||||
| public class AfterInstallationEvent implements AppListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void after(AppContext appContext) { | ||||
| 		// 如果版本号表(APP_ACT_KMS_VERSION)为空,则从1.0到10.0初始化10条版本号 | ||||
| 		long count = DBSql.getLong("SELECT COUNT(*) AS C FROM " + KMSConstant.ENTITY_NAME_VERSION, "C"); | ||||
| 		if (count == 0L) { | ||||
| 			final String[] versionNOArr = new String[] { "1.0", "2.0", "3.0", "4.0", "5.0", "6.0", "7.0", "8.0", "9.0", "10.0" }; | ||||
| 			String sql = "INSERT INTO " + KMSConstant.ENTITY_NAME_VERSION + " (" + VersionModel.ID + "," + VersionModel.VERSIONNO + "," + VersionModel.CREATETIME + "," + VersionModel.CREATEUSER + "," + VersionModel.MEMO + ") VALUES (?,?,?,?,?)"; | ||||
| 			DBSql.batch(sql, new BatchPreparedStatementSetter() { | ||||
| 				@Override | ||||
| 				public void setValues(PreparedStatement pstmt, int index) throws SQLException { | ||||
| 					String versionNO = versionNOArr[index]; | ||||
| 					pstmt.setString(1, UUIDGener.getObjectId()); | ||||
| 					pstmt.setString(2, versionNO); | ||||
| 					pstmt.setTimestamp(3, new Timestamp(System.currentTimeMillis())); | ||||
| 					pstmt.setString(4, "admin"); | ||||
| 					pstmt.setString(5, "系统初始化"); | ||||
| 				} | ||||
| 
 | ||||
| 				@Override | ||||
| 				public int getBatchSize() { | ||||
| 					return versionNOArr.length; | ||||
| 				} | ||||
| 			}); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean before(AppContext appContext) { | ||||
| 		return true; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,134 @@ | ||||
| package com.actionsoft.apps.kms; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class KMSConstant { | ||||
| 	/** 导航菜单ID */ | ||||
| 	public static final String NAV_ID_KNWL_CENTER = "obj_21d0b756a48946ccb5d38668f32943b2"; | ||||
| 	public static final String NAV_ID_KNWL_SEARCH = "obj_9db6edd0ccf5433f82fe0af6fd67b7cc"; | ||||
| 	public static final String NAV_ID_DIMENSION_MGR = "obj_4f48f895966349beb2bd3e01bda46b69"; | ||||
| 	public static final String NAV_ID_META_MGR = "obj_9acae9a8b50142daac7d98efda6d13d6"; | ||||
| 	public static final String NAV_ID_VALIDDATE_MGR = "obj_28b304cc5bad4636adfa780f45317033"; | ||||
| 	public static final String NAV_ID_SYSTEM_MGR = "obj_50e47d2f2cac4738b4b819bf68dc1f81"; | ||||
| 
 | ||||
| 	/** 应用ID */ | ||||
| 	public static final String APP_ID = "com.actionsoft.apps.kms"; | ||||
| 	/** doccenter目录 */ | ||||
| 	public static final String DOC_REPOSITORY_NAME = "-doc-"; | ||||
| 	//	public static final String ONLINEDOC_REPOSITORY_NAME = "onlinedoc"; //替换为onlinedoc之后无需再解密 | ||||
| 	public static final String DOC_REPOSITORY_HOTSPOT = "hotspot"; | ||||
| 	/** 全文检索目录 */ | ||||
| 	public static final String FULLSEARCH_REPOSITORY_NAME = "kmsDoc"; | ||||
| 	public static final String APP_KMS_FULLSEARCH_INDEX="com.actionsoft.apps.kms_kmsdoc"; | ||||
| 	public static final String APP_KMS_FULLSEARCH_TYPE="kmsdoc"; | ||||
| 	public static final String APP_KMS_FULLSEARCH_INDEX_CARD = "com.actionsoft.apps.kms_kmsdoc_card"; | ||||
| 	public static final String APP_KMS_FULLSEARCH_TYPE_CARD = "kmsdoc_card"; | ||||
| 	public static final String APP_FULLSEARCH = "com.actionsoft.apps.addons.es";// 全文检索 | ||||
| 	/** 知识参数-manifest文件使用 */ | ||||
| 	public static final String SYSTEM_PARAM_KEY = "systemParam"; | ||||
| 	/** 表名 */ | ||||
| 	public static final String ENTITY_NAME_DIMENSION = "APP_ACT_KMS_DIMENSION"; | ||||
| 	public static final String ENTITY_NAME_CARD = "APP_ACT_KMS_CARD"; | ||||
| 	public static final String ENTITY_NAME_OPT = "APP_ACT_KMS_OPT"; | ||||
| 	public static final String ENTITY_NAME_FILE = "APP_ACT_KMS_FILE"; | ||||
| 	public static final String ENTITY_NAME_HOTSPOT_DEF = "APP_ACT_KMS_HOTSPOT_DEF"; | ||||
| 	public static final String ENTITY_NAME_HOTSPOT = "APP_ACT_KMS_HOTSPOT"; | ||||
| 	public static final String ENTITY_NAME_LOG = "APP_ACT_KMS_LOG"; | ||||
| 	public static final String ENTITY_NAME_PUBLISH = "APP_ACT_KMS_PUBLISH"; | ||||
| 	public static final String ENTITY_NAME_VERSION = "APP_ACT_KMS_VERSION"; | ||||
| 	public static final String ENTITY_NAME_META_SCHEMA = "APP_ACT_KMS_META_SCHEMA"; | ||||
| 	public static final String ENTITY_NAME_META_ATTR = "APP_ACT_KMS_META_ATTR"; | ||||
| 	public static final String ENTITY_NAME_META_DATA = "APP_ACT_KMS_META_DATA"; | ||||
| 	public static final String ENTITY_NAME_COLLECTION = "APP_ACT_KMS_COLLECTION"; | ||||
| 
 | ||||
| 	/** BO表名 */ | ||||
| 	public static final String BO_ENTITY_NAME_BORROW = "BO_ACT_KMS_BORROW"; | ||||
| 	public static final String BO_ENTITY_NAME_PUBLISH = "BO_ACT_KMS_PUBLISH"; | ||||
| 	public static final String BO_ENTITY_NAME_CANCEL_PUBLISH = "BO_ACT_KMS_CANCEL_PUBLISH"; | ||||
| 
 | ||||
| 	/** 维度类型 */ | ||||
| 	public static final int SHOWTYPE_CATEGORY = 2;// 仅做分类(不允许发布知识) | ||||
| 	public static final int SHOWTYPE_DIMENSION = 1;// 普通维度(知识列表) | ||||
| 	public static final int SHOWTYPE_HOTSPOT = 0;// 知识地图 | ||||
| 
 | ||||
| 	/** 启用 不启用 */ | ||||
| 	public static final int ENABLED = 1; | ||||
| 	public static final int UNABLED = 0; | ||||
| 
 | ||||
| 	/** 发布 未发布 */ | ||||
| 	public static final int PUBLISHED = 1; | ||||
| 	public static final int UNPUBLISHED = 0; | ||||
| 
 | ||||
| 	/** 审批 不审批 */ | ||||
| 	public static final int EXAMINE = 1; | ||||
| 	public static final int UNEXAMINE = 0; | ||||
| 
 | ||||
| 	/** 标签分隔符(数据库中varchar类型) */ | ||||
| 	public static final String TAG_SEPRATOR = "@`@"; | ||||
| 
 | ||||
| 	/** 知识管理员AC类型 */ | ||||
| 	public static final String AC_RESOURCE_TYPE_KNWL_MGR = "kms.knwlmgr"; | ||||
| 	public static final String AC_RESOURCE_TYPE_XPAGE_MGR = "kms.xpagemgr"; | ||||
| 	/** 知识管理员资源ID */ | ||||
| 	public static final String AC_RESOURCE_ID_KNWL_MGR = "kms.knwlmgr.id"; | ||||
| 
 | ||||
| 	/** 二级知识管理员AC类型 */ | ||||
| 	public static final String AC_RESOURCE_TYPE_DIMENSION_MGR = "kms.dimensionmgr"; | ||||
| 
 | ||||
| 	/** 知识访问AC类型 */ | ||||
| 	public static final String AC_RESOURCE_TYPE_CARD = "kms.card"; | ||||
| 
 | ||||
| 	/** 元数据发布访问AC类型 */ | ||||
| 	public static final String AC_RESOURCE_TYPE_META_SCHEMA = "kms.metaSchema"; | ||||
| 
 | ||||
| 	/** 借阅流程的定义ID */ | ||||
| 	public static final String BORROW_PROCESS_DEF_ID = "obj_bcf0034b766f4a3d9cda8e0288e1c8c6"; | ||||
| 	/** 借阅流程开始事件的ID */ | ||||
| 	public static final String BORROW_START_EVENT_ID = "obj_c71e56d36b2000011759a1271e0057e0"; | ||||
| 
 | ||||
| 	/** 发布流程的定义ID */ | ||||
| 	public static final String PUBLISH_PROCESS_DEF_ID = "obj_073f4f28416946e39db3d9f3fb981021"; | ||||
| 	/** 发布流程开始事件的ID */ | ||||
| 	public static final String PUBLISH_START_EVENT_ID = "obj_c71fa098cae00001d2e9a78ff250c020"; | ||||
| 
 | ||||
| 	/** 取消发布流程的定义ID */ | ||||
| 	public static final String CANCEL_PUBLISH_PROCESS_DEF_ID = "obj_65be24aea7284f07a693e37c8c8deef3"; | ||||
| 	/** 取消发布流程开始事件的ID */ | ||||
| 	public static final String CANCEL_PUBLISH_START_EVENT_ID = "obj_c7329417b7600001be6d139b2db09490"; | ||||
| 
 | ||||
| 	/** KMS OPT 类型 1、评论 2、评分 3、反馈 */ | ||||
| 	public static final int OPT_TYPE_COMMENT = 1; | ||||
| 	/** KMS OPT 类型 1、评论 2、评分 3、反馈 */ | ||||
| 	public static final int OPT_TYPE_RATE = 2; | ||||
| 	/** KMS OPT 类型 1、评论 2、评分 3、反馈 */ | ||||
| 	public static final int OPT_TYPE_REPORT = 3; | ||||
| 
 | ||||
| 	/** 我的收藏-KMS的分类名称 */ | ||||
| 	public static final String FAVORITE_CATEGORY_KMS = "KMS"; | ||||
| 
 | ||||
| 	public static final String FILE_SUFFIX_DOC = "doc"; | ||||
| 	public static final String FILE_SUFFIX_PICTURE = "picture"; | ||||
| 	public static final String FILE_SUFFIX_AUDIO = "audio"; | ||||
| 	public static final String FILE_SUFFIX_VIDEO = "video"; | ||||
| 
 | ||||
| 	public static final int LOG_ACCESS_CARD = 0;// 访问知识卡片 | ||||
| 	public static final int LOG_DOWNLOAD_FILE = 1;// 下载文件 | ||||
| 	public static final int LOG_ACCESS_FILE = 2;// 在线浏览文件 | ||||
| 	public static final int LOG_ACCESS_OTHER = 3;// 在线浏览文件 | ||||
| 	public static final String NOTIFICATION_SYSTEM_NAME = "知识阅读邀请"; | ||||
| 	public static final String REPORT_SYSTEM_NAME = "知识反馈"; | ||||
| 
 | ||||
| 	public static final String DOC_GROUP_HOTSPOT = "grouphotspot"; | ||||
| 	public static final String DOC_FILE_HOTSPOT = "filehotspot"; | ||||
| 	 | ||||
| //	调用积分接口参数 | ||||
| 	public final static String POINT_DOWN_LOAD = "KMS下载文件"; | ||||
| 	public final static String POINT_LOOK_ATCART = "KMS阅读知识卡片"; | ||||
| 	public final static String POINT_LOOK_ATFILE= "KMS预览文件"; | ||||
| 	public final static String POINT_PUBLSH = "KMS发布知识"; | ||||
| 	public final static int POINT_COUNT = 1;//0为加积分,1为扣积分 | ||||
| 	public final static String POINT_ISADD_POINT = "1";//参数控制为1即调用aslp,0不调用 | ||||
| 	public final static String POINTS_APPID = "com.actionsoft.apps.points"; | ||||
| 	public static final String DOC_CARDCONTENT_REPOSITORY_NAME = "-doccardcontent-"; | ||||
| } | ||||
| @ -0,0 +1,84 @@ | ||||
| package com.actionsoft.apps.kms; | ||||
| 
 | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.concurrent.ExecutorService; | ||||
| import java.util.concurrent.Executors; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.model.LogModel; | ||||
| import com.actionsoft.apps.lifecycle.log.AppsLogger; | ||||
| import com.actionsoft.bpms.commons.database.BatchPreparedStatementSetter; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 记录KMS日志(采用线程池,提高性能) | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class KMSLogUtil { | ||||
| 
 | ||||
| 	private static ExecutorService logExecutorService = Executors.newCachedThreadPool(); | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 记录日志入口方法 | ||||
| 	 *  | ||||
| 	 * @param logModels | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	public static void log(final LogModel... logModels) { | ||||
| 		logExecutorService.execute(new Runnable() { | ||||
| 			@Override | ||||
| 			public void run() { | ||||
| 				insertLogs(logModels); | ||||
| 			} | ||||
| 		}); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 插入数据库 | ||||
| 	 *  | ||||
| 	 * @param logModels | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	private static void insertLogs(final LogModel... logModels) { | ||||
| 		try { | ||||
| 			if (logModels == null || logModels.length == 0) { | ||||
| 				return; | ||||
| 			} | ||||
| 			String sql = "INSERT INTO " + KMSConstant.ENTITY_NAME_LOG + " (" + LogModel.ID + "," + LogModel.CARDID + "," + LogModel.FILEID + "," + LogModel.ACCESSUSER + "," + LogModel.ACCESSTIME + "," + LogModel.IPADDRESS + "," + LogModel.LOGTYPE + "," + LogModel.LOGINFO + ") VALUES (?,?,?,?,?,?,?,?)"; | ||||
| 			DBSql.batch(sql, new BatchPreparedStatementSetter() { | ||||
| 
 | ||||
| 				@Override | ||||
| 				public void setValues(PreparedStatement pstmt, int index) throws SQLException { | ||||
| 					LogModel logModel = logModels[index]; | ||||
| 					pstmt.setString(1, UUIDGener.getObjectId()); | ||||
| 					pstmt.setString(2, logModel.getCardId()); | ||||
| 
 | ||||
| 					if (logModel.getFileId() == null) { | ||||
| 						pstmt.setNull(3, Types.VARCHAR); | ||||
| 					} else { | ||||
| 						pstmt.setString(3, logModel.getFileId()); | ||||
| 					} | ||||
| 
 | ||||
| 					pstmt.setString(4, logModel.getAccessUser()); | ||||
| 					pstmt.setTimestamp(5, logModel.getAccessTime()); | ||||
| 					pstmt.setString(6, logModel.getIpAddress()); | ||||
| 					pstmt.setInt(7, logModel.getLogType()); | ||||
| 					pstmt.setString(8, logModel.getLogInfo()); | ||||
| 				} | ||||
| 
 | ||||
| 				@Override | ||||
| 				public int getBatchSize() { | ||||
| 					return logModels.length; | ||||
| 				} | ||||
| 			}); | ||||
| 		} catch (Exception e) { | ||||
| 			AppsLogger.err(SDK.getAppAPI().getAppContext(KMSConstant.APP_ID), "记录KMS日志出错:" + e.getMessage()); | ||||
| 			e.printStackTrace(); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										1378
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/KMSUtil.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1378
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/KMSUtil.java
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										198
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/Plugins.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/Plugins.java
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,198 @@ | ||||
| package com.actionsoft.apps.kms; | ||||
| 
 | ||||
| import java.lang.reflect.Method; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.ac.CardACCM; | ||||
| import com.actionsoft.apps.kms.ac.DimensionMgrACCM; | ||||
| import com.actionsoft.apps.kms.ac.KnwlMgrACCM; | ||||
| import com.actionsoft.apps.kms.ac.MetaSchemaACCM; | ||||
| import com.actionsoft.apps.kms.ac.XpageMgrACCM; | ||||
| import com.actionsoft.apps.kms.aslp.CreateDimension; | ||||
| import com.actionsoft.apps.kms.aslp.CreateFile; | ||||
| import com.actionsoft.apps.kms.aslp.CreateFileByInputStream; | ||||
| import com.actionsoft.apps.kms.aslp.CreateFormLink; | ||||
| import com.actionsoft.apps.kms.aslp.CreateKnwl; | ||||
| import com.actionsoft.apps.kms.aslp.FullSearch; | ||||
| import com.actionsoft.apps.kms.aslp.GetDimension; | ||||
| import com.actionsoft.apps.kms.aslp.GetFile; | ||||
| import com.actionsoft.apps.kms.aslp.GetKnwl; | ||||
| import com.actionsoft.apps.kms.aslp.PublishKnwl; | ||||
| import com.actionsoft.apps.kms.aslp.SearchDimensionList; | ||||
| import com.actionsoft.apps.kms.aslp.SearchFileList; | ||||
| import com.actionsoft.apps.kms.aslp.SearchKnwlList; | ||||
| import com.actionsoft.apps.kms.aslp.UpdateDimension; | ||||
| import com.actionsoft.apps.kms.aslp.UpdateKnwl; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.CardPermCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionPermCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionTreeCache; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.cache.HotspotCache; | ||||
| import com.actionsoft.apps.kms.cache.MetaAttrCache; | ||||
| import com.actionsoft.apps.kms.cache.MetaDataCache; | ||||
| import com.actionsoft.apps.kms.cache.MetaSchemaCache; | ||||
| import com.actionsoft.apps.kms.cache.OptCache; | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.cache.VersionCache; | ||||
| import com.actionsoft.apps.kms.dc.DocCardContentProcessor; | ||||
| import com.actionsoft.apps.kms.dc.DocFileProcessor; | ||||
| import com.actionsoft.apps.kms.dc.HotspotFileProcessor; | ||||
| import com.actionsoft.apps.kms.dc.TmpFileProcessor; | ||||
| import com.actionsoft.apps.kms.formatter.KMSNotificationFormatter; | ||||
| import com.actionsoft.apps.kms.formatter.KMSReportFormatter; | ||||
| import com.actionsoft.apps.kms.service.PermChangeByOrgSync; | ||||
| import com.actionsoft.apps.kms.ui.FormUIComponentKnwlImpl; | ||||
| import com.actionsoft.apps.kms.web.FavoriteWeb; | ||||
| import com.actionsoft.apps.listener.PluginListener; | ||||
| import com.actionsoft.apps.resource.AppContext; | ||||
| import com.actionsoft.apps.resource.plugin.profile.ACPluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.ASLPPluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.AWSPluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.AppExtensionProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.FormUIPluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.FullSearchPluginProfile; | ||||
| import com.actionsoft.apps.resource.plugin.profile.HttpASLP; | ||||
| import com.actionsoft.apps.resource.plugin.profile.OrgSyncPluginProfile; | ||||
| import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class Plugins implements PluginListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public List<AWSPluginProfile> register(AppContext appContext) { | ||||
| 		List<AWSPluginProfile> awsPluginProfiles = new ArrayList<AWSPluginProfile>(); | ||||
| 		// 缓存 | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(DimensionCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(CardCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(PublishCache.class));// publish是card和dimension的中间表,应在两者之后加载cache | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(FileCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(OptCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(VersionCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(HotspotCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(MetaSchemaCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(MetaAttrCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(MetaDataCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(CardPermCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(DimensionPermCache.class)); | ||||
| 		awsPluginProfiles.add(new CachePluginProfile(DimensionTreeCache.class)); | ||||
| 		// aslp | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("createDimension", CreateDimension.class.getName(), "创建维度", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("updateDimension", UpdateDimension.class.getName(), "修改维度", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("searchDimensionList", SearchDimensionList.class.getName(), "查询维度列表", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("GetDimension", GetDimension.class.getName(), "查询单个维度", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("CreateKnwl", CreateKnwl.class.getName(), "创建知识", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("UpdateKnwl", UpdateKnwl.class.getName(), "修改知识", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("SearchKnwlList", SearchKnwlList.class.getName(), "查询知识(多个参数之间是AND关系,单个参数内部是OR关系)", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("GetKnwl", GetKnwl.class.getName(), "查询单个知识", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("GetFile", GetFile.class.getName(), "查询单个文件", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("CreateFile", CreateFile.class.getName(), "创建文件", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("CreateFileByInputStream", CreateFileByInputStream.class.getName(), "通过流创建文件", null)); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("CreateFormLink", CreateFormLink.class.getName(), "创建表单链接类文件", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("SearchFileList", SearchFileList.class.getName(), "查询文件", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("FullSearch", FullSearch.class.getName(), "全文检索(由于KMS的权限限制,返回结果可能大于rowsPerPage条)", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 		awsPluginProfiles.add(new ASLPPluginProfile("PublishKnwl", PublishKnwl.class.getName(), "发布知识", new HttpASLP(HttpASLP.AUTH_RSA, null))); | ||||
| 
 | ||||
| 		// ac | ||||
| 		KnwlMgrACCM knwlMgrACCM = new KnwlMgrACCM(); | ||||
| 		//awsPluginProfiles.add(new ACPluginProfile(KnwlMgrACCM.resourceType, knwlMgrACCM.getResourceName(), null, knwlMgrACCM.getAccessModes(), false, true));// 知识管理员 | ||||
| 		awsPluginProfiles.add(new ACPluginProfile(knwlMgrACCM));// 知识管理员 | ||||
| 		XpageMgrACCM xpageMgrACCM = new XpageMgrACCM(); | ||||
| 		//awsPluginProfiles.add(new ACPluginProfile(KnwlMgrACCM.resourceType, knwlMgrACCM.getResourceName(), null, knwlMgrACCM.getAccessModes(), false, true));// 知识管理员 | ||||
| 		awsPluginProfiles.add(new ACPluginProfile(xpageMgrACCM));// XPAGE内容管理员 | ||||
| 
 | ||||
| 		DimensionMgrACCM dimensionMgrACCM = new DimensionMgrACCM(); | ||||
| 		//awsPluginProfiles.add(new ACPluginProfile(DimensionMgrACCM.resourceType, dimensionMgrACCM.getResourceName(), null, dimensionMgrACCM.getAccessModes(), false, true));// 维度管理员 | ||||
| 		awsPluginProfiles.add(new ACPluginProfile(dimensionMgrACCM));// 维度管理员 | ||||
| 
 | ||||
| 		MetaSchemaACCM metaSchemaACCM = new MetaSchemaACCM(); | ||||
| 		awsPluginProfiles.add(new ACPluginProfile(MetaSchemaACCM.resourceType, metaSchemaACCM.getResourceName(), null, metaSchemaACCM.getAccessModes(), false, true)); | ||||
| 
 | ||||
| 		CardACCM cardACCM = new CardACCM(); | ||||
| 		//awsPluginProfiles.add(new ACPluginProfile(CardACCM.resourceType, cardACCM.getResourceName(), null, cardACCM.getAccessModes(), false, true)); | ||||
| 		awsPluginProfiles.add(new ACPluginProfile(cardACCM)); | ||||
| 		// dc | ||||
| 		awsPluginProfiles.add(new DCPluginProfile(KMSConstant.DOC_REPOSITORY_NAME, DocFileProcessor.class.getName(), "普通文档,文档存放到该应用的doc目录下", false, true)); | ||||
| 		awsPluginProfiles.add(new DCPluginProfile(KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME, DocCardContentProcessor.class.getName(), "卡片正文", false)); | ||||
| 		awsPluginProfiles.add(new DCPluginProfile("tmp", TmpFileProcessor.class.getName(), "知识地图临时图片", false, false)); | ||||
| 		//		awsPluginProfiles.add(new DCPluginProfile(KMSConstant.ONLINEDOC_REPOSITORY_NAME, OnlinedocFileProcessor.class.getName(), "onlinedoc生成图片和pdf到该目录下", false)); | ||||
| 		awsPluginProfiles.add(new DCPluginProfile(KMSConstant.DOC_REPOSITORY_HOTSPOT, HotspotFileProcessor.class.getName(), "用户上传的知识地图目录", false, false)); | ||||
| 		// 全文检索 | ||||
| 		awsPluginProfiles.add(new FullSearchPluginProfile(KMSConstant.FULLSEARCH_REPOSITORY_NAME, false, "KMS全文检索")); | ||||
| 		// 注册应用扩展点-收藏 | ||||
| 		Map<String, Object> params1 = new HashMap<String, Object>(); | ||||
| 		params1.put("categoryName", KMSConstant.FAVORITE_CATEGORY_KMS); | ||||
| 		params1.put("mainClass", FavoriteWeb.class.getName()); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("我的收藏->KMS", "aslp://com.actionsoft.apps.favorite/registerApp", params1)); | ||||
| 		// 注册应用扩展点-通知-阅读邀请 | ||||
| 		Map<String, Object> params2 = new HashMap<String, Object>(); | ||||
| 		params2.put("systemName", KMSConstant.NOTIFICATION_SYSTEM_NAME); | ||||
| 		params2.put("icon", ""); | ||||
| 		params2.put("formatter", KMSNotificationFormatter.class.getName()); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("通知中心->浏览知识", "aslp://com.actionsoft.apps.notification/registerApp", params2)); | ||||
| 		// 注册应用扩展点-通知-知识反馈 | ||||
| 		Map<String, Object> params3 = new HashMap<String, Object>(); | ||||
| 		params3.put("systemName", KMSConstant.REPORT_SYSTEM_NAME); | ||||
| 		params3.put("icon", ""); | ||||
| 		params3.put("formatter", KMSReportFormatter.class.getName()); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("通知中心->知识反馈", "aslp://com.actionsoft.apps.notification/registerApp", params3)); | ||||
| 		//表单UI组件 | ||||
| 		FormUIPluginProfile formUIPluginProfile = new FormUIPluginProfile("高级组件", "AWSUI.KnwlPortal", FormUIComponentKnwlImpl.class.getName(), "知识门户", "有访问权限的知识列表", false, true, false, false, false, true, true, false, false); | ||||
| 		Class clazz = formUIPluginProfile.getClass(); | ||||
| 		try { | ||||
| 			Method setIconFont = clazz.getDeclaredMethod("setIconFont", String.class, String.class, String.class); | ||||
| 			setIconFont.invoke(formUIPluginProfile, "awsui-iconfont", "", "#0c6e9f"); | ||||
| 		} catch (Exception e) { | ||||
| 		} | ||||
| 
 | ||||
| 		awsPluginProfiles.add(formUIPluginProfile); | ||||
| 
 | ||||
| 		// addons页面 | ||||
| 
 | ||||
| 		//		awsPluginProfiles.add(new AddOnsPluginProfile(AddonsWeb.class.getName())); | ||||
| 		//注册全文检索 | ||||
| 		Map<String, Object> params4 = new HashMap<String, Object>(); | ||||
| 		params4.put("name", "知识"); | ||||
| 		params4.put("url", "./w?cmd=com.actionsoft.apps.kms_es_search&sid=$sid&q=$q"); | ||||
| 		params4.put("placeholder", "请输入要查询的内容..."); | ||||
| 		params4.put("orderIndex", 45); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("知识", "aslp://com.actionsoft.apps.addons.es/registerApp", params4)); | ||||
| 
 | ||||
| 		//注册xpages | ||||
| 		String contextAll5 = HtmlPageTemplate.merge(KMSConstant.APP_ID, "kms.latest.xPageRegister.htm", null); | ||||
| 		Map<String, Object> params5 = new HashMap<String, Object>(); | ||||
| 		params5.put("systemName", "最新KMS知识"); | ||||
| 		params5.put("type", "3"); | ||||
| 		params5.put("functionPre", "kmslatest"); | ||||
| 		params5.put("urlIdentifier", "com.actionsoft.apps.kms_xpages"); | ||||
| 		params5.put("xpagesContent", contextAll5); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("最新KMS知识", "aslp://com.actionsoft.apps.addons.xpages/registerApp", params5)); | ||||
| 		String contextAll = HtmlPageTemplate.merge(KMSConstant.APP_ID, "kms.directory.xPageRegister.htm", null); | ||||
| 		Map<String, Object> params6 = new HashMap<String, Object>(); | ||||
| 		params6.put("systemName", "KMS目录"); | ||||
| 		params6.put("type", "3"); | ||||
| 		params6.put("functionPre", "kmsdirectory"); | ||||
| 		params6.put("urlIdentifier", "com.actionsoft.apps.kms_xpage_opencardbydirctory"); | ||||
| 		params6.put("xpagesContent", contextAll); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("KMS目录", "aslp://com.actionsoft.apps.addons.xpages/registerApp", params6)); | ||||
| 		String contextAll7 = HtmlPageTemplate.merge(KMSConstant.APP_ID, "kms.card.xPageRegister.htm", null); | ||||
| 		Map<String, Object> params7 = new HashMap<String, Object>(); | ||||
| 		params7.put("systemName", "KMS知识"); | ||||
| 		params7.put("type", "3"); | ||||
| 		params7.put("xpagesContent", contextAll7); | ||||
| 		params7.put("urlIdentifier", "com.actionsoft.apps.kms_xpage_openfastcard"); | ||||
| 		params7.put("functionPre", "kmscard"); | ||||
| 		awsPluginProfiles.add(new AppExtensionProfile("KMS知识", "aslp://com.actionsoft.apps.addons.xpages/registerApp", params7)); | ||||
| 		awsPluginProfiles.add(new OrgSyncPluginProfile(PermChangeByOrgSync.class.getName(), "组织结构变化同步维度知识权限")); | ||||
| 		return awsPluginProfiles; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,63 @@ | ||||
| package com.actionsoft.apps.kms.ac; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.CardPermCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionTreeCache; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACAccessMode; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACCM; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.AccessControlModel; | ||||
| 
 | ||||
| /** | ||||
|  * 知识访问ac | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CardACCM extends ACCM { | ||||
| 	public static ACAccessMode CARD = new ACAccessMode("知识访问", 0); | ||||
| 	public static String resourceType = KMSConstant.AC_RESOURCE_TYPE_CARD; | ||||
| 	public String resourceName = "知识访问"; | ||||
| 	private String[] assignmentTypes; | ||||
| 	private static ACAccessMode[] accessModes = new ACAccessMode[] { CARD }; | ||||
| 	private boolean isolationCompany; | ||||
| 	private boolean orgAdminSecurity = true; | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceType() { | ||||
| 		return resourceType; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceName() { | ||||
| 		return resourceName; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String[] getAssignmentTypes() { | ||||
| 		return assignmentTypes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public ACAccessMode[] getAccessModes() { | ||||
| 		return accessModes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isIsolationCompany() { | ||||
| 		return isolationCompany; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isOrgAdminSecurity() { | ||||
| 		return orgAdminSecurity; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void callBack(List<AccessControlModel> acModelList) { | ||||
| 		DimensionTreeCache.getCache().destroy(true); | ||||
| 		for (AccessControlModel accessControlModel : acModelList) { | ||||
| 			CardPermCache.getCache().remove(accessControlModel._resourceId); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,67 @@ | ||||
| package com.actionsoft.apps.kms.ac; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.DimensionPermCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionTreeCache; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACAccessMode; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACCM; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.AccessControlModel; | ||||
| 
 | ||||
| /** | ||||
|  * 二级知识管理员ac(或者叫维度管理员ac,区别于知识管理员) | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DimensionMgrACCM extends ACCM { | ||||
| 	public static ACAccessMode PUBLISH = new ACAccessMode("发布", 3); | ||||
| 	public static ACAccessMode ACCESS = new ACAccessMode("访问", 0); | ||||
| 	public static ACAccessMode BORROW = new ACAccessMode("借阅", 1); | ||||
| 	public static ACAccessMode DIMENSION_MGR = new ACAccessMode("维度管理员", 2); | ||||
| 	public static String resourceType = KMSConstant.AC_RESOURCE_TYPE_DIMENSION_MGR; | ||||
| 	public String resourceName = "维度管理员"; | ||||
| 	private String[] assignmentTypes; | ||||
| 	private static ACAccessMode[] accessModes = new ACAccessMode[] { PUBLISH, ACCESS, BORROW, DIMENSION_MGR }; | ||||
| 	private boolean isolationCompany; | ||||
| 	private boolean orgAdminSecurity = true; | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceType() { | ||||
| 		return resourceType; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceName() { | ||||
| 		return resourceName; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String[] getAssignmentTypes() { | ||||
| 		return assignmentTypes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public ACAccessMode[] getAccessModes() { | ||||
| 		return accessModes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isIsolationCompany() { | ||||
| 		return isolationCompany; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isOrgAdminSecurity() { | ||||
| 		return orgAdminSecurity; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void callBack(List<AccessControlModel> acModelList) { | ||||
| 		DimensionTreeCache.getCache().destroy(true); | ||||
| 		for (AccessControlModel accessControlModel : acModelList) { | ||||
| 			DimensionPermCache.getCache().remove(accessControlModel._resourceId); | ||||
| 			DimensionTreeCache.getCache().destroy(true); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,63 @@ | ||||
| package com.actionsoft.apps.kms.ac; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.CardPermCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionPermCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionTreeCache; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACAccessMode; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACCM; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.AccessControlModel; | ||||
| 
 | ||||
| /** | ||||
|  * 知识管理员ac | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class KnwlMgrACCM extends ACCM { | ||||
| 	public static ACAccessMode KNWLMGR = new ACAccessMode("知识管理员", 0); | ||||
| 	public static String resourceType = KMSConstant.AC_RESOURCE_TYPE_KNWL_MGR; | ||||
| 	public String resourceName = "知识管理员"; | ||||
| 	private String[] assignmentTypes; | ||||
| 	private static ACAccessMode[] accessModes = new ACAccessMode[] { KNWLMGR }; | ||||
| 	private boolean isolationCompany; | ||||
| 	private boolean orgAdminSecurity = true; | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceType() { | ||||
| 		return resourceType; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceName() { | ||||
| 		return resourceName; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String[] getAssignmentTypes() { | ||||
| 		return assignmentTypes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public ACAccessMode[] getAccessModes() { | ||||
| 		return accessModes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isIsolationCompany() { | ||||
| 		return isolationCompany; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isOrgAdminSecurity() { | ||||
| 		return orgAdminSecurity; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void callBack(List<AccessControlModel> acModelList) { | ||||
| 		DimensionTreeCache.getCache().destroy(true); | ||||
| 		DimensionPermCache.getCache().destroy(true); | ||||
| 		CardPermCache.getCache().destroy(true); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,52 @@ | ||||
| package com.actionsoft.apps.kms.ac; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACAccessMode; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACCM; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据ac(发布和访问) | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaSchemaACCM extends ACCM { | ||||
| 	public static ACAccessMode PUBLISH = new ACAccessMode("发布", 0); | ||||
| 	public static ACAccessMode READ = new ACAccessMode("访问", 1); | ||||
| 	public static String resourceType = KMSConstant.AC_RESOURCE_TYPE_META_SCHEMA; | ||||
| 	public String resourceName = "元数据发布访问权限"; | ||||
| 	private String[] assignmentTypes; | ||||
| 	private static ACAccessMode[] accessModes = new ACAccessMode[] { PUBLISH, READ }; | ||||
| 	private boolean isolationCompany; | ||||
| 	private boolean orgAdminSecurity = true; | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceType() { | ||||
| 		return resourceType; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceName() { | ||||
| 		return resourceName; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String[] getAssignmentTypes() { | ||||
| 		return assignmentTypes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public ACAccessMode[] getAccessModes() { | ||||
| 		return accessModes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isIsolationCompany() { | ||||
| 		return isolationCompany; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isOrgAdminSecurity() { | ||||
| 		return orgAdminSecurity; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,51 @@ | ||||
| package com.actionsoft.apps.kms.ac; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACAccessMode; | ||||
| import com.actionsoft.bpms.commons.security.ac.model.ACCM; | ||||
| 
 | ||||
| /** | ||||
|  * xpage内容管理员ac | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class XpageMgrACCM extends ACCM { | ||||
| 	public static ACAccessMode XPAGEMGR = new ACAccessMode("xpage内容管理员", 0); | ||||
| 	public static String resourceType = KMSConstant.AC_RESOURCE_TYPE_XPAGE_MGR; | ||||
| 	public String resourceName = "xpage内容管理员"; | ||||
| 	private String[] assignmentTypes; | ||||
| 	private static ACAccessMode[] accessModes = new ACAccessMode[] { XPAGEMGR }; | ||||
| 	private boolean isolationCompany; | ||||
| 	private boolean orgAdminSecurity = true; | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceType() { | ||||
| 		return resourceType; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getResourceName() { | ||||
| 		return resourceName; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String[] getAssignmentTypes() { | ||||
| 		return assignmentTypes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public ACAccessMode[] getAccessModes() { | ||||
| 		return accessModes; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isIsolationCompany() { | ||||
| 		return isolationCompany; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean isOrgAdminSecurity() { | ||||
| 		return orgAdminSecurity; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,83 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.model.DimensionModel; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CreateDimension implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'dimensionName', required: true, desc: '维度名称'", "name: 'parentId', required: true, desc: '父维度Id:\"\"表示根维度'", "name: 'showType', required: true, desc: '维度类型,1:允许发布知识 2:不允许发布知识'", "name: 'isExamine', required: true, desc: '发布是否需要审批,默认false'", "name: 'memo', required: false, desc: '维度描述'", "name: 'isEnabled', required: true, desc: '是否启用,默认启用'", "name: 'createUser', required: false, desc: '创建人'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String dimensionName = (String) params.get("dimensionName"); | ||||
| 			if (UtilString.isEmpty(dimensionName) || UtilString.isEmpty(dimensionName.trim())) { | ||||
| 				ro = ResponseObject.newErrResponse("维度名称不允许为空"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String parentId = (String) params.get("parentId"); | ||||
| 			if (!parentId.equals("")) { | ||||
| 				DimensionModel dimensionModel = DimensionCache.getCache().get(parentId); | ||||
| 				if (dimensionModel == null) { | ||||
| 					ro = ResponseObject.newErrResponse("父维度Id不存在"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			Integer showTypeI = Integer.valueOf(params.get("showType").toString()); | ||||
| 			if (showTypeI != null) { | ||||
| 				int showType = showTypeI.intValue(); | ||||
| 				if (showType != KMSConstant.SHOWTYPE_CATEGORY && showType != KMSConstant.SHOWTYPE_DIMENSION) { | ||||
| 					ro = ResponseObject.newErrResponse("维度类型不正确"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			String createUser = UserContext.fromSessionId(sid).getUID(); | ||||
| 			if (params.containsKey("createUser")) { | ||||
| 				createUser = (String) params.get("createUser"); | ||||
| 			} | ||||
| 			UserModel createUserModel = SDK.getORGAPI().getUser(createUser); | ||||
| 			if (createUserModel == null || createUserModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("创建人UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 			boolean isExamine = Boolean.valueOf(params.get("isExamine").toString()); | ||||
| 			String memo = (String) params.get("memo"); | ||||
| 			boolean isEnabled = Boolean.valueOf(params.get("isEnabled").toString()); | ||||
| 
 | ||||
| 			DimensionService dimensionService = new DimensionService(); | ||||
| 			String dimensionId = dimensionService.createDimension(dimensionName, parentId, showTypeI.intValue(), isExamine, memo, createUser, "", isEnabled); | ||||
| 
 | ||||
| 			ro = ResponseObject.newOkResponse("创建成功").put("dimensionId", dimensionId); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,60 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCProfileManager; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCUtil; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CreateFile implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'cardId', required: true, desc: '知识ID'", "name: 'dc', required: true, desc: 'DCContext对象'", "name: 'extParams',required:false,desc:'扩展信息,JSON字符串'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String cardId = (String) params.get("cardId"); | ||||
| 			CardModel cardModel = CardCache.getCache().get(cardId); | ||||
| 			if (cardModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("知识不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			DCContext dcContext = (DCContext) params.get("dc"); | ||||
| 
 | ||||
| 			String fileVersion = KMSUtil.getNextFileVersion(cardId, dcContext.getFileName()); | ||||
| 			DCContext newDCContext = new DCContext(UserContext.fromSessionId(sid), DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardId, dcContext.getFileName()); | ||||
| 			boolean result = DCUtil.copyDCFile(dcContext, newDCContext); | ||||
| 			if (result) { | ||||
| 				ro = ResponseObject.newOkResponse("创建成功").put("fileId", (String) newDCContext.getDCMessage().getAttrs().get("fileId")); | ||||
| 			} else { | ||||
| 				ro = ResponseObject.newErrResponse("创建失败,复制DC失败"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,72 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.io.InputStream; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCProfileManager; | ||||
| import com.actionsoft.bpms.server.fs.file.WriteDCFile; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CreateFileByInputStream implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'cardId', required: true, desc: '知识ID'", "name: 'in', required: true, desc: 'inputstream对象'", "name: 'fileName', required: true, desc: '文件名称'", "name: 'extParams',required:false,desc:'扩展信息,JSON字符串'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String cardId = (String) params.get("cardId"); | ||||
| 			CardModel cardModel = CardCache.getCache().get(cardId); | ||||
| 			if (cardModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("知识不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			InputStream inputStream = (InputStream) params.get("in"); | ||||
| 			String fileName = (String) params.get("fileName"); | ||||
| 			String fileVersion = KMSUtil.getNextFileVersion(cardId, fileName); | ||||
| 			DCContext newDCContext = new DCContext(UserContext.fromSessionId(sid), DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardId, fileName); | ||||
| 			boolean result = copyDCFile(inputStream, newDCContext); | ||||
| 			if (result) { | ||||
| 				ro = ResponseObject.newOkResponse("创建成功").put("fileId", (String) newDCContext.getDCMessage().getAttrs().get("fileId")); | ||||
| 			} else { | ||||
| 				ro = ResponseObject.newErrResponse("创建失败,复制DC失败"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	public boolean copyDCFile(InputStream sourceFileByte, DCContext targetContext) { | ||||
| 		try { | ||||
| 			return WriteDCFile.getInstance().write(sourceFileByte, targetContext); | ||||
| 		} finally { | ||||
| 			try { | ||||
| 				sourceFileByte.close(); | ||||
| 			} catch (Exception e) { | ||||
| 				e.printStackTrace(); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,89 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.dao.FileDao; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CreateFormLink implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'cardId', required: true, desc: '知识ID'", "name: 'formJSON', required: true, desc: '表单链接所需的JSON信息,格式:{"processInstId":"xxx","taskInstId":"xxx","formName":"xxx"}'", "name: 'createUser', required: false, desc: '表单链接创建人,某些特殊场景下,sid和createUser代表的用户并不一样,如果此参数为null,则使用sid代表的用户'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String cardId = (String) params.get("cardId"); | ||||
| 			CardModel cardModel = CardCache.getCache().get(cardId); | ||||
| 			if (cardModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("知识不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String createUser; | ||||
| 			String createUserParam = (String) params.get("createUser"); | ||||
| 			if (createUserParam == null) { | ||||
| 				createUser = UserContext.fromSessionId(sid).getUID(); | ||||
| 			} else { | ||||
| 				createUser = createUserParam; | ||||
| 			} | ||||
| 			UserModel createUserModel = SDK.getORGAPI().getUser(createUser); | ||||
| 			if (createUserModel == null || createUserModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("创建人UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String formJSON = (String) params.get("formJSON"); | ||||
| 			JSONObject formJO = JSONObject.parseObject(formJSON); | ||||
| 			if (!formJO.containsKey("processInstId") || !formJO.containsKey("taskInstId") || !formJO.containsKey("formName")) { | ||||
| 				ro = ResponseObject.newErrResponse("[表单链接所需的JSON信息]格式错误"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			FileModel fileModel = new FileModel(); | ||||
| 			fileModel.setCardId(cardId); | ||||
| 			fileModel.setCreateTime(new Timestamp(System.currentTimeMillis())); | ||||
| 			fileModel.setCreateUser(createUser); | ||||
| 			fileModel.setFileName(formJSON); | ||||
| 			fileModel.setFileSize(-1); | ||||
| 			fileModel.setFileVer("-1"); | ||||
| 			String fileId = UUIDGener.getObjectId(); | ||||
| 			fileModel.setId(fileId); | ||||
| 			fileModel.setFileState(2);//2代表表单链接 | ||||
| 			fileModel.setIsFullsearch(2);//2代表无需全文检索 | ||||
| 
 | ||||
| 			FileDao fileDao = new FileDao(); | ||||
| 			int result = fileDao.insert(fileModel); | ||||
| 			if (result == 1) { | ||||
| 				ro = ResponseObject.newOkResponse("创建成功").put("fileId", fileId); | ||||
| 			} else { | ||||
| 				ro = ResponseObject.newErrResponse("创建失败"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,99 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CreateKnwl implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: false, desc: 'sid,如果为空,则需要传createUser参数'", "name: 'knwlName', required: true, desc: '知识名称'", "name: 'createUser', required: false, desc: '知识创建人,某些特殊场景下,sid和createUser代表的用户并不一样,如果此参数为null,则使用sid代表的用户'", "name: 'validDate', required: false, desc: '有效期:yyyy-MM-dd'", "name: 'onlineLevel', required: true, desc: '只读控制,1:在线阅读和下载 0:在线阅读'", "name: 'securityLevel', required: true, desc: '保密级别, 0: 普通 1:秘密 2:机密'", "name: 'isComment', required: true, desc: '是否可以评论'", "name: 'isRate', required: true, desc: '是否可以评分'", | ||||
| 			"name:'cardContext',required:false,desc:'知识内容'", "name: 'externalUrl',required:false,desc:'外部知识链接,可以展示外部知识的链接'", "name: 'extParams',required:false,desc:'扩展信息,JSON字符串'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (UtilString.isNotEmpty(sid) && !SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String knwlName = (String) params.get("knwlName"); | ||||
| 			if (UtilString.isEmpty(knwlName) || UtilString.isEmpty(knwlName.trim())) { | ||||
| 				ro = ResponseObject.newErrResponse("知识名称不允许为空"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			Date validDate = params.get("validDate") == null ? null : UtilDate.parse(params.get("validDate").toString()); | ||||
| 
 | ||||
| 			Integer onlineLevel = (Integer) params.get("onlineLevel"); | ||||
| 			if (onlineLevel.intValue() != 1 && onlineLevel.intValue() != 0) { | ||||
| 				ro = ResponseObject.newErrResponse("只读控制值不正确"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			Integer securityLevel = (Integer) params.get("securityLevel"); | ||||
| 			if (securityLevel.intValue() != 0 && securityLevel.intValue() != 1 && securityLevel.intValue() != 2) { | ||||
| 				ro = ResponseObject.newErrResponse("保密级别值不正确"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			Boolean isComment = (Boolean) params.get("isComment"); | ||||
| 
 | ||||
| 			Boolean isRate = (Boolean) params.get("isRate"); | ||||
| 
 | ||||
| 			String url = (String) params.get("externalUrl"); | ||||
| 
 | ||||
| 			String extParams = (String) params.get("extParams"); | ||||
| 
 | ||||
| 			String createUser; | ||||
| 			String createUserParam = (String) params.get("createUser"); | ||||
| 			if (createUserParam == null) { | ||||
| 				if (UtilString.isEmpty(sid)) { | ||||
| 					ro = ResponseObject.newErrResponse("sid和createUser不能都为空值"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 				createUser = UserContext.fromSessionId(sid).getUID(); | ||||
| 			} else { | ||||
| 				createUser = createUserParam; | ||||
| 			} | ||||
| 			UserModel createUserModel = SDK.getORGAPI().getUser(createUser); | ||||
| 			if (createUserModel == null || createUserModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("创建人UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			CardService cardService = new CardService(); | ||||
| 			String cardId = UUIDGener.getObjectId(); | ||||
| 			String cardContext = ""; | ||||
| 			if (params.containsKey("cardContext")) { | ||||
| 				cardContext = (String) params.get("cardContext"); | ||||
| 			} | ||||
| 			boolean result = cardService.insertCard(createUser, cardId, knwlName, validDate == null ? null : new java.sql.Date(validDate.getTime()), onlineLevel, securityLevel, 0, isComment == true ? 1 : 0, isRate == true ? 1 : 0, cardContext, url, extParams); | ||||
| 
 | ||||
| 			if (result) { | ||||
| 				ro = ResponseObject.newOkResponse("创建成功").put("cardId", cardId); | ||||
| 			} else { | ||||
| 				ro = ResponseObject.newOkResponse("创建失败"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,62 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.service.SearchService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class FullSearch implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'curPage', required: true, desc: '当前页码,从0开始'", "name: 'rowsPerPage', required: true, desc: '每页的条数'", "name: 'searchText', required: true, desc: '查询的关键词'", "name: 'docTypes', required: false, desc: '文档类型,JSON数组,格式:["pdf","doc","ppt","xls","txt"]'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String uid = UserContext.fromSessionId(sid).getUID(); | ||||
| 			UserModel userModel = SDK.getORGAPI().getUser(uid); | ||||
| 			if (userModel == null || userModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("查询者UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			Integer curPage = Integer.valueOf(params.get("curPage").toString()); | ||||
| 
 | ||||
| 			Integer rowsPerPage = Integer.valueOf(params.get("rowsPerPage").toString()); | ||||
| 
 | ||||
| 			String searchText = (String) params.get("searchText"); | ||||
| 
 | ||||
| 			String docTypes = (String) params.get("docTypes"); | ||||
| 			List<String> docTypeList = new ArrayList<>(); | ||||
| 			if (docTypes != null) { | ||||
| 				docTypeList = JSONArray.parseArray(docTypes, String.class); | ||||
| 			} | ||||
| 			String result = new SearchService().fullSearchWrap(UserContext.fromSessionId(sid), curPage, rowsPerPage, searchText, docTypeList, "1"); | ||||
| 			ResponseObject resultRO = ResponseObject.parse(result); | ||||
| 			if (resultRO.isOk()) { | ||||
| 				ro = resultRO.msg("查询成功"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,61 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.model.DimensionModel; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.cache.UserCache; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class GetDimension implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'dimensionId', required: true, desc: '维度ID'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String dimensionId = (String) params.get("dimensionId"); | ||||
| 
 | ||||
| 			DimensionModel dimensionModel = DimensionCache.getCache().get(dimensionId); | ||||
| 			if (dimensionModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("维度不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			JSONObject dimensionJO = new JSONObject(); | ||||
| 			dimensionJO.put("id", dimensionModel.getId()); | ||||
| 			dimensionJO.put("dimensionName", dimensionModel.getDimensionName()); | ||||
| 			dimensionJO.put("showType", dimensionModel.getShowType()); | ||||
| 			dimensionJO.put("isExamine", dimensionModel.getIsExamine() == 1 ? true : false); | ||||
| 			dimensionJO.put("memo", dimensionModel.getMemo()); | ||||
| 			dimensionJO.put("createUsername", UserCache.getModel(dimensionModel.getCreateUser()) == null ? dimensionModel.getCreateUser() : UserCache.getModel(dimensionModel.getCreateUser()).getUserName()); | ||||
| 			dimensionJO.put("createTime", UtilDate.datetimeFormat(dimensionModel.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); | ||||
| 			dimensionJO.put("isEnabled", dimensionModel.getIsEnabled() == 1 ? true : false); | ||||
| 			dimensionJO.put("hotspotDefId", dimensionModel.getHotspotDefId()); | ||||
| 			dimensionJO.put("orderIndex", dimensionModel.getOrderIndex()); | ||||
| 
 | ||||
| 			ro = ResponseObject.newOkResponse("查询成功").put("dimension", dimensionJO); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,77 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCProfileManager; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class GetFile implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'fileId', required: true, desc: '文件ID'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String fileId = (String) params.get("fileId"); | ||||
| 
 | ||||
| 			FileModel fileModel = FileCache.getCache().get(fileId); | ||||
| 			if (fileModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("文件不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			JSONObject fileJO = new JSONObject(); | ||||
| 			fileJO.put("fileId", fileModel.getId()); | ||||
| 			fileJO.put("cardId", fileModel.getCardId()); | ||||
| 			fileJO.put("fileName", fileModel.getFileName()); | ||||
| 			fileJO.put("fileVer", fileModel.getFileVer()); | ||||
| 			fileJO.put("fileSize", fileModel.getFileSize()); | ||||
| 			fileJO.put("fileState", fileModel.getFileState()); | ||||
| 			fileJO.put("createTime", UtilDate.datetimeFormat24(fileModel.getCreateTime())); | ||||
| 			fileJO.put("createUser", fileModel.getCreateUser()); | ||||
| 			String knwlId=fileModel.getCardId(); | ||||
| 			fileJO.put("isFullsearch", fileModel.getIsFullsearch()); | ||||
| 			String fileName = fileModel.getFileName(); | ||||
| 			CardCache cardCache = CardCache.getCache(); | ||||
| 			CardModel cardModel = cardCache.get(fileModel.getCardId()); | ||||
| 			DCContext dcContext = new DCContext(UserContext.fromSessionId(sid), DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), knwlId, KMSUtil.getFileNameOfVersion(fileName, fileModel.getFileVer())); | ||||
| 			dcContext.setFileNameShow(fileName); | ||||
| 			fileJO.put("fileDownloadURL", dcContext.getDownloadURL()); | ||||
| 			fileJO.put("repositoryName", KMSConstant.DOC_REPOSITORY_NAME); | ||||
| 			fileJO.put("groupValue", cardModel.getCreateUser()); | ||||
| 			fileJO.put("fileValue", knwlId); | ||||
| 			fileJO.put("fileName", KMSUtil.getFileNameOfVersion(fileName, fileModel.getFileVer())); | ||||
| 			fileJO.put("extParams", "{}"); | ||||
| 			ro = ResponseObject.newOkResponse("查询成功").put("file", fileJO); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,68 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class GetKnwl implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'knwlId', required: true, desc: '知识ID'", "name: 'isPage', required: false, desc: '是否是独立页面(非侧边栏打开)'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String knwlId = (String) params.get("knwlId"); | ||||
| 
 | ||||
| 			CardModel cardModel = CardCache.getCache().get(knwlId); | ||||
| 			if (cardModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("知识不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 			boolean isPage = false; | ||||
| 			if (params.containsKey("isPage")) { | ||||
| 				isPage = Boolean.valueOf(params.get("isPage").toString()); | ||||
| 			} | ||||
| 
 | ||||
| 			JSONObject cardJO = new JSONObject(); | ||||
| 			cardJO.put("knwlId", cardModel.getId()); | ||||
| 			cardJO.put("knwlName", cardModel.getCardName()); | ||||
| 			cardJO.put("createUser", cardModel.getCreateUser()); | ||||
| 			cardJO.put("createTime", UtilDate.datetimeFormat24(cardModel.getCreateTime())); | ||||
| 			cardJO.put("lastUpdate", UtilDate.datetimeFormat24(cardModel.getLastUpdate())); | ||||
| 			cardJO.put("onlineLevel", cardModel.getOnlineLevel()); | ||||
| 			cardJO.put("securityLevel", cardModel.getSecurityLevel()); | ||||
| 			cardJO.put("readCount", cardModel.getReadCount()); | ||||
| 			cardJO.put("isPublished", cardModel.getIsPublished() == 1 ? true : false); | ||||
| 			cardJO.put("validDate", UtilDate.dateFormat(cardModel.getValidDate())); | ||||
| 			cardJO.put("isComment", cardModel.getIsComment() == 1 ? true : false); | ||||
| 			cardJO.put("isRate", cardModel.getIsRate() == 1 ? true : false); | ||||
| 			cardJO.put("accessURL", "./w?sid=" + sid + "&cmd=com.actionsoft.apps.kms_knwl_center_browse_card_page&cardId=" + knwlId + "&isPage=" + isPage); | ||||
| 			cardJO.put("externalUrl", cardModel.getExternalUrl()); | ||||
| 			cardJO.put("extParams", cardModel.getExtParams()); | ||||
| 			ro = ResponseObject.newOkResponse("查询成功").put("knwl", cardJO); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,90 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import org.apache.commons.lang.StringUtils; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class PublishKnwl implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'knwlIDArray', required: true, desc: '要发布的知识ID的JSON数组字符串'", "name: 'dimensionIDArray', required: true, desc: '要发布到的维度ID的JSON数组字符串'", | ||||
| 			"name: 'schemaMetaDataObject', required: false, desc: '元数据,格式:{"2":[{"metaValue":"类型为文本框的值","schemaId":"元数据ID"}],"01":[{"attrId":"属性ID","schemaId":"元数据ID"}]}'", "name: 'tagArray', required: false, desc: '标签的JSON数组字符串'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 			String uid = UserContext.fromSessionId(sid).getUID(); | ||||
| 			UserModel userModel = SDK.getORGAPI().getUser(uid); | ||||
| 			if (userModel == null || userModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("查询者UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			JSONArray publishKnwlIDArray = JSONArray.parseArray(params.get("knwlIDArray").toString()); | ||||
| 			for (int i = 0; i < publishKnwlIDArray.size(); i++) { | ||||
| 				String knwlId = publishKnwlIDArray.getString(i); | ||||
| 				if (CardCache.getCache().get(knwlId) == null) { | ||||
| 					ro = ResponseObject.newErrResponse("知识不存在:" + knwlId); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			JSONArray publishDimensionIDArray = JSONArray.parseArray(params.get("dimensionIDArray").toString()); | ||||
| 			for (int i = 0; i < publishDimensionIDArray.size(); i++) { | ||||
| 				String dimensionId = publishDimensionIDArray.getString(i); | ||||
| 				if (DimensionCache.getCache().get(dimensionId) == null) { | ||||
| 					ro = ResponseObject.newErrResponse("维度不存在:" + dimensionId); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			JSONObject schemaMetaDataJO = null; | ||||
| 			if (params.get("schemaMetaDataObject") == null) { | ||||
| 				schemaMetaDataJO = new JSONObject(); | ||||
| 				schemaMetaDataJO.put("01", new JSONArray()); | ||||
| 				schemaMetaDataJO.put("2", new JSONArray()); | ||||
| 			} else { | ||||
| 				schemaMetaDataJO = JSONObject.parseObject(params.get("schemaMetaDataObject").toString()); | ||||
| 			} | ||||
| 
 | ||||
| 			JSONArray tagArray = new JSONArray(); | ||||
| 			if (params.get("tagArray") != null) { | ||||
| 				tagArray = JSONArray.parseArray(params.get("tagArray").toString()); | ||||
| 			} | ||||
| 			String join = ""; | ||||
| 			if (tagArray != null) { | ||||
| 				join = StringUtils.join(tagArray.toArray(new String[0]), KMSConstant.TAG_SEPRATOR); | ||||
| 			} | ||||
| 			CardService cardService = new CardService(); | ||||
| 			cardService.publishCard(UserContext.fromSessionId(sid), publishKnwlIDArray, publishDimensionIDArray, schemaMetaDataJO, join, null); | ||||
| 			ro = ResponseObject.newOkResponse("发布成功"); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,107 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.model.DimensionModel; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.cache.UserCache; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class SearchDimensionList implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'parentId', required: true, desc: '父维度ID'", "name: 'permType', required: false, desc: '维度的权限类型,值:manage、access,分别代表管理权限、访问权限,默认是管理权限'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String parentId = (String) params.get("parentId"); | ||||
| 			if (!UtilString.isEmpty(parentId)) { | ||||
| 				DimensionModel dimensionModel = DimensionCache.getCache().get(parentId); | ||||
| 				if (dimensionModel == null) { | ||||
| 					ro = ResponseObject.newErrResponse("父维度Id不存在"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 			String permType = "manage"; | ||||
| 			if (params.containsKey("permType")) { | ||||
| 				permType = (String) params.get("permType"); | ||||
| 			} | ||||
| 			if (!permType.equals("manage") && !permType.equals("access") && !permType.equals("all") && !permType.equals("allenable")) { | ||||
| 				ro = ResponseObject.newErrResponse("权限类型错误"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 			if ("root".equals(parentId)) { | ||||
| 				parentId = ""; | ||||
| 			} | ||||
| 			JSONArray dimensionJA = new JSONArray(); | ||||
| 			DimensionService dimensionService = new DimensionService(); | ||||
| 			List<DimensionModel> dimensionModels = new ArrayList<>(); | ||||
| 			if (permType.equals("manage")) { | ||||
| 				dimensionModels = dimensionService.queryListMgrDimensionsByParentId(parentId, UserContext.fromSessionId(sid).getUID()); | ||||
| 			} else if (permType.equals("access")) { | ||||
| 				String uid = UserContext.fromSessionId(sid).getUID(); | ||||
| 				dimensionModels = dimensionService.queryTreeAccessDimensionsByParentId(parentId, uid, KMSUtil.isKnwlManager(uid)); | ||||
| 			} else if (permType.equals("all")) { | ||||
| 				dimensionModels = dimensionService.queryListMgrDimensionsByParentId(parentId); | ||||
| 			} else if (permType.equals("allenable")) { | ||||
| 				dimensionModels = dimensionService.queryTreeEnabledDimensionsByParentId(parentId); | ||||
| 			} | ||||
| 			for (DimensionModel dimensionModel : dimensionModels) { | ||||
| 				if (!hasRepeatDimension(dimensionJA, dimensionModel)) { | ||||
| 					JSONObject dimensionJO = new JSONObject(); | ||||
| 					dimensionJO.put("id", dimensionModel.getId()); | ||||
| 					dimensionJO.put("dimensionName", dimensionModel.getDimensionName()); | ||||
| 					dimensionJO.put("showType", dimensionModel.getShowType()); | ||||
| 					dimensionJO.put("isExamine", dimensionModel.getIsExamine() == 1 ? true : false); | ||||
| 					dimensionJO.put("memo", dimensionModel.getMemo()); | ||||
| 					dimensionJO.put("createUsername", UserCache.getModel(dimensionModel.getCreateUser()) == null ? dimensionModel.getCreateUser() : UserCache.getModel(dimensionModel.getCreateUser()).getUserName()); | ||||
| 					dimensionJO.put("createTime", UtilDate.datetimeFormat(dimensionModel.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); | ||||
| 					dimensionJO.put("isEnabled", dimensionModel.getIsEnabled() == 1 ? true : false); | ||||
| 					dimensionJO.put("hotspotDefId", dimensionModel.getHotspotDefId()); | ||||
| 					dimensionJO.put("orderIndex", dimensionModel.getOrderIndex()); | ||||
| 					dimensionJO.put("hasPerm", dimensionModel.isHasPerm()); | ||||
| 
 | ||||
| 					dimensionJA.add(dimensionJO); | ||||
| 				} | ||||
| 			} | ||||
| 			ro = ResponseObject.newOkResponse("查询成功").put("list", dimensionJA); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	public boolean hasRepeatDimension(JSONArray dimensions, DimensionModel dimensionModel) { | ||||
| 		for (int i = 0; i < dimensions.size(); i++) { | ||||
| 			JSONObject dimensionJO = dimensions.getJSONObject(i); | ||||
| 			if (dimensionModel.getId().equals(dimensionJO.getString("id"))) { | ||||
| 				return true; | ||||
| 			} | ||||
| 		} | ||||
| 		return false; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,92 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.kms.service.FileService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCProfileManager; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class SearchFileList implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'knwlId', required: true, desc: '知识ID'", "name: 'isLatestVersion', required: false, desc: '是否只返回最新版的文件,默认false'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String uid = UserContext.fromSessionId(sid).getUID(); | ||||
| 			UserModel userModel = SDK.getORGAPI().getUser(uid); | ||||
| 			if (userModel == null || userModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("查询者UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String knwlId = (String) params.get("knwlId"); | ||||
| 			if (CardCache.getCache().get(knwlId) == null) { | ||||
| 				ro = ResponseObject.newErrResponse("知识不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			Boolean isLatestVersion = (Boolean) params.get("isLatestVersion"); | ||||
| 			List<FileModel> fileModels = new ArrayList<>(); | ||||
| 			if (isLatestVersion != null && isLatestVersion == true) { | ||||
| 				fileModels = new FileService().queryLatestFiles(knwlId); | ||||
| 			} else { | ||||
| 				fileModels = new FileService().queryFiles(knwlId); | ||||
| 			} | ||||
| 			JSONArray dataJson = new JSONArray(); | ||||
| 			CardCache cardCache = CardCache.getCache(); | ||||
| 			for (FileModel fileModel : fileModels) { | ||||
| 				JSONObject fileJO = new JSONObject(); | ||||
| 
 | ||||
| 				String fileName = fileModel.getFileName(); | ||||
| 				CardModel cardModel = cardCache.get(fileModel.getCardId()); | ||||
| 				DCContext dcContext = new DCContext(UserContext.fromSessionId(sid), DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), knwlId, KMSUtil.getFileNameOfVersion(fileName, fileModel.getFileVer())); | ||||
| 				dcContext.setFileNameShow(fileName); | ||||
| 
 | ||||
| 				fileJO.put("fileDownloadURL", dcContext.getDownloadURL()); | ||||
| 				fileJO.put("id", fileModel.getId()); | ||||
| 				fileJO.put("fileName", fileName); | ||||
| 				fileJO.put("versionFileName", KMSUtil.getFileNameOfVersion(fileName, fileModel.getFileVer())); | ||||
| 				fileJO.put("fileVer", fileModel.getFileVer()); | ||||
| 				fileJO.put("fileSize", fileModel.getFileSize()); | ||||
| 				fileJO.put("createTime", UtilDate.datetimeFormat(fileModel.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); | ||||
| 				fileJO.put("createUser", fileModel.getCreateUser()); | ||||
| 				fileJO.put("fileState", fileModel.getFileState()); | ||||
| 				fileJO.put("extParams", "{}"); | ||||
| 				dataJson.add(fileJO); | ||||
| 			} | ||||
| 			ro = ResponseObject.newOkResponse("查询成功").put("searchResult", dataJson); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,135 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.model.PublishModel; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.apps.kms.service.SearchService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.cache.UserCache; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class SearchKnwlList implements ASLP { | ||||
| 
 | ||||
| 	// 元数据,格式:Html.encodeForHTML("{\"2\":[{\"metaValue\":\"类型为文本框的值\",\"schemaId\":\"元数据ID\"}],\"01\":[{\"attrId\":\"属性ID\",\"schemaId\":\"元数据ID\"}]}"); | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'curPage', required: true, desc: '当前页码'", "name: 'rowsPerPage', required: true, desc: '每页的条数'", "name: 'sortIndx', required: true, desc: '排序字段,READCOUNT : 阅读次数、CARDNAME : 知识名称、PUBLISHTIME : 发布时间、COMMENTCOUNT : 评论次数'", "name: 'sortDir', required: true, desc: '顺序,up : 升序,down : 降序'", "name: 'dimensionIdArray', required: false, desc: '维度ID的JSON数组字符串'", | ||||
| 			"name: 'schemaMetaDataObject', required: false, desc: '元数据,格式:{"2":[{"metaValue":"类型为文本框的值","schemaId":"元数据ID"}],"01":[{"attrId":"属性ID","schemaId":"元数据ID"}]}'", "name: 'knwlName', required: false, desc: '知识名称'", | ||||
| 			"name: 'publishStartDate', required: false, desc: '发布开始时间 : yyyy-MM-dd'", "name: 'publishEndDate', required: false, desc: '发布结束时间 : yyyy-MM-dd'", "name: 'publishUsers', required: false, desc: '发布人UID的JSON数组字符串'", "name: 'tag', required: false, desc: '标签'", "name: 'lastPublishId', required: false, desc: '上一页最后一个publishId,用于增强查询性能'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String uid = UserContext.fromSessionId(sid).getUID(); | ||||
| 			UserModel userModel = SDK.getORGAPI().getUser(uid); | ||||
| 			if (userModel == null || userModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("查询者UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			Integer curPage = Integer.valueOf(params.get("curPage").toString()); | ||||
| 
 | ||||
| 			Integer rowsPerPage = Integer.valueOf(params.get("rowsPerPage").toString()); | ||||
| 
 | ||||
| 			String sortIndx = (String) params.get("sortIndx"); | ||||
| 			if (!sortIndx.equals("READCOUNT") && !sortIndx.equals("CARDNAME") && !sortIndx.equals("PUBLISHTIME") && !sortIndx.equals("COMMENTCOUNT")) { | ||||
| 				ro = ResponseObject.newErrResponse("排序字段值不正确"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String sortDir = (String) params.get("sortDir"); | ||||
| 			if (!sortDir.equals("up") && !sortDir.equals("down")) { | ||||
| 				ro = ResponseObject.newErrResponse("顺序值不正确"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			List<String> dimensionIdList = params.get("dimensionIdArray") == null ? new ArrayList<String>() : JSONArray.parseArray(params.get("dimensionIdArray").toString(), String.class); | ||||
| 
 | ||||
| 			JSONObject schemaMetaDataJO = null; | ||||
| 			if (params.get("schemaMetaDataObject") == null) { | ||||
| 				schemaMetaDataJO = new JSONObject(); | ||||
| 				schemaMetaDataJO.put("01", new JSONArray()); | ||||
| 				schemaMetaDataJO.put("2", new JSONArray()); | ||||
| 			} else { | ||||
| 				schemaMetaDataJO = JSONObject.parseObject(params.get("schemaMetaDataObject").toString()); | ||||
| 			} | ||||
| 
 | ||||
| 			String cardName = (String) params.get("knwlName"); | ||||
| 
 | ||||
| 			Timestamp publishStartDate = params.get("publishStartDate") == null ? null : UtilDate.parseTsFromDate(params.get("publishStartDate").toString()); | ||||
| 
 | ||||
| 			Timestamp publishEndDate = params.get("publishEndDate") == null ? null : UtilDate.parseTsFromDate(params.get("publishEndDate").toString()); | ||||
| 
 | ||||
| 			List<String> publishUsers = params.get("publishUsers") == null ? new ArrayList<String>() : JSONArray.parseArray(params.get("publishUsers").toString(), String.class); | ||||
| 
 | ||||
| 			List<String> tagList = new ArrayList<>(); | ||||
| 			if (params.get("tag") != null) { | ||||
| 				tagList.add(params.get("tag").toString()); | ||||
| 			} | ||||
| 			String lastPublishId = params.get("lastPublishId") == null ? "" : params.get("lastPublishId").toString(); | ||||
| 			DimensionService dimensionService = new DimensionService(); | ||||
| 			SearchService searchService = new SearchService(); | ||||
| 			List<PublishModel> publishModels = searchService.attrSearchCard(curPage, rowsPerPage, sortIndx, sortDir, uid, dimensionIdList, schemaMetaDataJO, cardName, publishStartDate, publishEndDate, publishUsers, tagList, lastPublishId, "",""); | ||||
| 			JSONObject dataJson = new JSONObject(); | ||||
| 			if (publishModels.size() < rowsPerPage + 1L) { | ||||
| 				dataJson.put("totalRecords", (curPage - 1) * rowsPerPage + publishModels.size()); | ||||
| 			} else { | ||||
| 				dataJson.put("totalRecords", searchService.totalRecords); | ||||
| 				if (publishModels.size() > 0) { | ||||
| 					publishModels.remove(publishModels.size() - 1);//移除最后一条 | ||||
| 				} | ||||
| 			} | ||||
| 			JSONArray cardJA = new JSONArray(); | ||||
| 			for (PublishModel publishModel : publishModels) { | ||||
| 				JSONObject cardJO = new JSONObject(); | ||||
| 				cardJO.put("cardId", publishModel.getCardModel().getId()); | ||||
| 				cardJO.put("cardName", publishModel.getCardModel().getCardName()); | ||||
| 				cardJO.put("cardType", publishModel.getCardModel().getCardType()); | ||||
| 				cardJO.put("onlineLevel", publishModel.getCardModel().getOnlineLevel()); | ||||
| 				cardJO.put("securityLevel", publishModel.getCardModel().getSecurityLevel()); | ||||
| 				// cardJO.put("lastUpdate", publishModel.getCardModel().getLastUpdate()); | ||||
| 				cardJO.put("readCount", publishModel.getCardModel().getReadCount()); | ||||
| 				cardJO.put("commentCount", publishModel.getCardModel().getCommentCount()); | ||||
| 				cardJO.put("isPublished", publishModel.getCardModel().getIsPublished()); | ||||
| 				cardJO.put("validDate", UtilDate.dateFormat(publishModel.getCardModel().getValidDate())); | ||||
| 				UserModel publishUserModel = UserCache.getModel(publishModel.getPublishUser()); | ||||
| 				cardJO.put("publishUsername", publishUserModel == null ? publishModel.getPublishUser() : publishUserModel.getUserName()); | ||||
| 				cardJO.put("publishTime", UtilDate.datetimeFormat(publishModel.getPublishTime(), "yyyy-MM-dd HH:mm:ss")); | ||||
| 				cardJO.put("dimensionId", publishModel.getDimensionId()); | ||||
| 				cardJO.put("dimensionPath", dimensionService.getDimensionPath(publishModel.getDimensionId(), " > ")); | ||||
| 				cardJO.put("externalUrl", "https://www.awspaas.com"); | ||||
| 				cardJO.put("extParams", "{}"); | ||||
| 				cardJA.add(cardJO); | ||||
| 			} | ||||
| 
 | ||||
| 			dataJson.put("data", cardJA); | ||||
| 			dataJson.put("curPage", curPage); | ||||
| 
 | ||||
| 			ro = ResponseObject.newOkResponse("查询成功").put("searchResult", dataJson); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,101 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.model.DimensionModel; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class UpdateDimension implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'dimensionId', required: true, desc: '维度ID'", "name: 'dimensionName', required: false, desc: '维度名称'", "name: 'parentId', required: false, desc: '父维度Id:\"\"表示根维度'", "name: 'showType', required: false, desc: '维度类型,1:允许发布知识 2:不允许发布知识'", "name: 'isExamine', required: false, desc: '发布是否需要审批,默认false'", "name: 'memo', required: false, desc: '维度描述'", "name: 'isEnabled', required: false, desc: '是否启用,默认启用'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String dimensionId = (String) params.get("dimensionId"); | ||||
| 			DimensionModel dimensionModel = DimensionCache.getCache().get(dimensionId); | ||||
| 			if (dimensionId == null || dimensionModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("维度不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String dimensionName = (String) params.get("dimensionName"); | ||||
| 			if (dimensionName == null) { | ||||
| 				dimensionName = dimensionModel.getDimensionName(); | ||||
| 			} else if (dimensionName.trim().equals("")) { | ||||
| 				ro = ResponseObject.newErrResponse("维度名称不允许为空"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String parentId = (String) params.get("parentId"); | ||||
| 			if (parentId == null) { | ||||
| 				parentId = dimensionModel.getParentId(); | ||||
| 			} else if (parentId.equals("")) { | ||||
| 
 | ||||
| 			} else { | ||||
| 				DimensionModel parentDimensionModel = DimensionCache.getCache().get(parentId); | ||||
| 				if (parentDimensionModel == null) { | ||||
| 					ro = ResponseObject.newErrResponse("父维度不存在"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			Integer showTypeI = params.get("showType") == null ? null : Integer.valueOf(params.get("showType").toString()); | ||||
| 			if (showTypeI == null) { | ||||
| 				showTypeI = dimensionModel.getShowType(); | ||||
| 			} else { | ||||
| 				int showType = showTypeI.intValue(); | ||||
| 				if (showType != KMSConstant.SHOWTYPE_CATEGORY && showType != KMSConstant.SHOWTYPE_DIMENSION) { | ||||
| 					ro = ResponseObject.newErrResponse("维度类型不正确"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			Boolean isExamine = params.get("isExamine") == null ? null : Boolean.valueOf(params.get("isExamine").toString()); | ||||
| 			if (isExamine == null) { | ||||
| 				isExamine = dimensionModel.getIsExamine() == KMSConstant.EXAMINE; | ||||
| 			} | ||||
| 
 | ||||
| 			String memo = (String) params.get("memo"); | ||||
| 			if (memo == null) { | ||||
| 				memo = dimensionModel.getMemo(); | ||||
| 			} | ||||
| 
 | ||||
| 			Boolean isEnabled = params.get("isEnabled") == null ? null : Boolean.valueOf(params.get("isEnabled").toString()); | ||||
| 			if (isEnabled == null) { | ||||
| 				isEnabled = dimensionModel.getIsEnabled() == KMSConstant.ENABLED; | ||||
| 			} | ||||
| 
 | ||||
| 			DimensionService dimensionService = new DimensionService(); | ||||
| 			int result = dimensionService.updateDimension(dimensionId, dimensionName, showTypeI, isExamine, memo, "", isEnabled); | ||||
| 
 | ||||
| 			if (result == 1) { | ||||
| 				ro = ResponseObject.newOkResponse("修改成功"); | ||||
| 			} else { | ||||
| 				ro = ResponseObject.newErrResponse("修改失败"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,95 @@ | ||||
| package com.actionsoft.apps.kms.aslp; | ||||
| 
 | ||||
| import java.util.Date; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.apps.resource.interop.aslp.ASLP; | ||||
| import com.actionsoft.apps.resource.interop.aslp.Meta; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.model.UserModel; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class UpdateKnwl implements ASLP { | ||||
| 
 | ||||
| 	@Override | ||||
| 	@Meta(parameter = { "name: 'sid', required: true, desc: 'sid'", "name: 'knwlId', required: true, desc: '知识ID'", "name: 'knwlName', required: false, desc: '知识名称'", "name: 'validDate', required: false, desc: '有效期:yyyy-MM-dd,如果为null则表示长期有效'", "name: 'onlineLevel', required: false, desc: '只读控制,1:在线阅读和下载 0:在线阅读'", "name: 'securityLevel', required: false, desc: '保密级别, 0: 普通 1:秘密 2:机密'", "name: 'isComment', required: false, desc: '是否可以评论'", "name: 'isRate', required: false, desc: '是否可以评分'", "name:'cardContext',required:false,desc:'知识内容'", | ||||
| 			"name: 'externalUrl',required:false,desc:'外部知识链接,可以展示外部知识的链接'", "name: 'extParams',required:false,desc:'扩展信息,JSON字符串'" }) | ||||
| 	public ResponseObject call(Map<String, Object> params) { | ||||
| 		ResponseObject ro = ResponseObject.newWarnResponse("结果未知"); | ||||
| 		try { | ||||
| 			// 校验参数 | ||||
| 			String sid = (String) params.get("sid"); | ||||
| 			if (!SDK.getPortalAPI().checkSession(sid)) { | ||||
| 				ro = ResponseObject.newErrResponse("sid无效"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String knwlId = (String) params.get("knwlId"); | ||||
| 			CardModel cardModel = CardCache.getCache().get(knwlId); | ||||
| 			if (cardModel == null) { | ||||
| 				ro = ResponseObject.newErrResponse("知识不存在"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 
 | ||||
| 			String knwlName = (String) params.get("knwlName"); | ||||
| 			if (knwlName == null) { | ||||
| 				knwlName = cardModel.getCardName(); | ||||
| 			} | ||||
| 
 | ||||
| 			Date validDate = params.get("validDate") == null ? null : UtilDate.parse(params.get("validDate").toString()); | ||||
| 
 | ||||
| 			Integer onlineLevel = params.get("onlineLevel") == null ? cardModel.getOnlineLevel() : Integer.parseInt(params.get("onlineLevel").toString()); | ||||
| 			if (params.get("onlineLevel") != null) { | ||||
| 				if (onlineLevel.intValue() != 1 && onlineLevel.intValue() != 0) { | ||||
| 					ro = ResponseObject.newErrResponse("只读控制值不正确"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			Integer securityLevel = params.get("securityLevel") == null ? cardModel.getSecurityLevel() : Integer.parseInt(params.get("securityLevel").toString()); | ||||
| 			if (params.get("securityLevel") != null) { | ||||
| 				if (securityLevel.intValue() != 0 && securityLevel.intValue() != 1 && securityLevel.intValue() != 2) { | ||||
| 					ro = ResponseObject.newErrResponse("保密级别值不正确"); | ||||
| 					return ro; | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			Boolean isComment = params.get("isComment") == null ? (cardModel.getIsComment() == 1 ? true : false) : Boolean.parseBoolean(params.get("isComment").toString()); | ||||
| 
 | ||||
| 			Boolean isRate = params.get("isRate") == null ? (cardModel.getIsRate() == 1 ? true : false) : Boolean.parseBoolean(params.get("isRate").toString()); | ||||
| 
 | ||||
| 			String createUser = UserContext.fromSessionId(sid).getUID(); | ||||
| 			UserModel createUserModel = SDK.getORGAPI().getUser(createUser); | ||||
| 			if (createUserModel == null || createUserModel.isClosed()) { | ||||
| 				ro = ResponseObject.newErrResponse("创建人UID不存在或已注销"); | ||||
| 				return ro; | ||||
| 			} | ||||
| 			String cardContext = (String) params.get("cardContext"); | ||||
| 			if (cardContext == null) { | ||||
| 				cardContext = ""; | ||||
| 			} | ||||
| 			CardService cardService = new CardService(); | ||||
| 			boolean result = cardService.updateCard(createUser, knwlId, knwlName, validDate == null ? null : new java.sql.Date(validDate.getTime()), onlineLevel, securityLevel, 0, isComment == true ? 1 : 0, isRate == true ? 1 : 0, cardContext); | ||||
| 
 | ||||
| 			if (result) { | ||||
| 				ro = ResponseObject.newOkResponse("修改成功"); | ||||
| 			} else { | ||||
| 				ro = ResponseObject.newOkResponse("创建失败"); | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			ro = ResponseObject.newErrResponse(e.getMessage()); | ||||
| 		} | ||||
| 		return ro; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										37
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/CardCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/CardCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.CardDao; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| /** | ||||
|  * 知识缓存 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CardCache extends Cache<String, CardModel> { | ||||
| 
 | ||||
| 	public CardCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		CardDao cardDao = new CardDao(); | ||||
| 		IDaoQuery<CardModel> iDaoQuery = cardDao.query(); | ||||
| 		List<CardModel> cardModels = iDaoQuery.list(); | ||||
| 		for (CardModel cardModel : cardModels) { | ||||
| 			put(cardModel.getId(), cardModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static CardCache getCache() { | ||||
| 		return CacheManager.getCache(CardCache.class); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										58
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/CardPermCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/CardPermCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,58 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.HashMap; | ||||
| 
 | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| 
 | ||||
| /** | ||||
|  * 知识缓存 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CardPermCache extends Cache<String, HashMap<String, Boolean>> { | ||||
| 
 | ||||
| 	public CardPermCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	public static CardPermCache getCache() { | ||||
| 		return CacheManager.getCache(CardPermCache.class); | ||||
| 	} | ||||
| 
 | ||||
| 	public static void put(String cardId, String uid, boolean isPerm) { | ||||
| 		HashMap<String, Boolean> uidMap = getCache().get(cardId); | ||||
| 		if (uidMap != null) { | ||||
| 			if (!uidMap.containsKey(uid)) { | ||||
| 				uidMap.put(uid, isPerm); | ||||
| 				getCache().put(cardId, uidMap); | ||||
| 			} | ||||
| 		} else { | ||||
| 			uidMap = new HashMap<String, Boolean>(); | ||||
| 			uidMap.put(uid, isPerm); | ||||
| 			getCache().put(cardId, uidMap); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static boolean getPermByUID(String cardId, String uid) { | ||||
| 		HashMap<String, Boolean> uidMap = getCache().get(cardId); | ||||
| 		if (uidMap == null) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		return uidMap.get(uid); | ||||
| 	} | ||||
| 
 | ||||
| 	public static boolean hasCacheByUID(String cardId, String uid) { | ||||
| 		HashMap<String, Boolean> uidMap = getCache().get(cardId); | ||||
| 		if (uidMap == null) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		return uidMap.containsKey(uid); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										51
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/DimensionCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/DimensionCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,51 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.DimensionDao; | ||||
| import com.actionsoft.apps.kms.model.DimensionModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.cache.ListValueIndex; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| /** | ||||
|  * 维度缓存 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DimensionCache extends Cache<String, DimensionModel> { | ||||
| 
 | ||||
| 	public DimensionCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 		registeIndex(DimensionParentIndex.class, new DimensionParentIndex()); | ||||
| 	} | ||||
| 
 | ||||
| 	public List<DimensionModel> getDimensionListOfParent(String parentDimensionId) { | ||||
| 		List<DimensionModel> list = iteratorToList(getCache().getByIndex(DimensionParentIndex.class, parentDimensionId)); | ||||
| 		return list; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		DimensionDao dimensionDao = new DimensionDao(); | ||||
| 		IDaoQuery<DimensionModel> iDaoQuery = dimensionDao.query(); | ||||
| 		List<DimensionModel> dimensionModels = iDaoQuery.list(); | ||||
| 		for (DimensionModel dimensionModel : dimensionModels) { | ||||
| 			put(dimensionModel.getId(), dimensionModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static DimensionCache getCache() { | ||||
| 		return CacheManager.getCache(DimensionCache.class); | ||||
| 	} | ||||
| 
 | ||||
| 	class DimensionParentIndex extends ListValueIndex<String, DimensionModel> { | ||||
| 
 | ||||
| 		@Override | ||||
| 		public String key(DimensionModel t) { | ||||
| 			return t.getParentId(); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										58
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/DimensionPermCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/DimensionPermCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,58 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.HashMap; | ||||
| 
 | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| 
 | ||||
| /** | ||||
|  * 维度缓存 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DimensionPermCache extends Cache<String, HashMap<String, Boolean>> { | ||||
| 
 | ||||
| 	public DimensionPermCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	public static DimensionPermCache getCache() { | ||||
| 		return CacheManager.getCache(DimensionPermCache.class); | ||||
| 	} | ||||
| 
 | ||||
| 	public static void put(String dimensionId, String uid, boolean isPerm) { | ||||
| 		HashMap<String, Boolean> uidMap = getCache().get(dimensionId); | ||||
| 		if (uidMap != null) { | ||||
| 			if (!uidMap.containsKey(uid)) { | ||||
| 				uidMap.put(uid, isPerm); | ||||
| 				getCache().put(dimensionId, uidMap); | ||||
| 			} | ||||
| 		} else { | ||||
| 			uidMap = new HashMap<String, Boolean>(); | ||||
| 			uidMap.put(uid, isPerm); | ||||
| 			getCache().put(dimensionId, uidMap); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static boolean getPermByUID(String dimensionId, String uid) { | ||||
| 		HashMap<String, Boolean> uidMap = getCache().get(dimensionId); | ||||
| 		if (uidMap == null) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		return uidMap.get(uid); | ||||
| 	} | ||||
| 
 | ||||
| 	public static boolean hasCacheByUID(String dimensionId, String uid) { | ||||
| 		HashMap<String, Boolean> uidMap = getCache().get(dimensionId); | ||||
| 		if (uidMap == null) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		return uidMap.containsKey(uid); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										27
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/DimensionTreeCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/DimensionTreeCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| 
 | ||||
| /** | ||||
|  * 知识缓存 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DimensionTreeCache extends Cache<String, JSONArray> { | ||||
| 
 | ||||
| 	public DimensionTreeCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	public static DimensionTreeCache getCache() { | ||||
| 		return CacheManager.getCache(DimensionTreeCache.class); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										36
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/FileCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/FileCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,36 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.FileDao; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| /** | ||||
|  * 文件缓存 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class FileCache extends Cache<String, FileModel> { | ||||
| 	public FileCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		FileDao fileDao = new FileDao(); | ||||
| 		IDaoQuery<FileModel> iDaoQuery = fileDao.query(); | ||||
| 		List<FileModel> fileModels = iDaoQuery.list(); | ||||
| 		for (FileModel fileModel : fileModels) { | ||||
| 			put(fileModel.getId(), fileModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static FileCache getCache() { | ||||
| 		return CacheManager.getCache(FileCache.class); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										37
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/HotspotCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/HotspotCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.HotspotDao; | ||||
| import com.actionsoft.apps.kms.model.HotspotModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| /** | ||||
|  * 知识地图缓存(图形和维度的绑定缓存) | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class HotspotCache extends Cache<String, HotspotModel> { | ||||
| 	public HotspotCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		HotspotDao hotspotDao = new HotspotDao(); | ||||
| 		IDaoQuery<HotspotModel> iDaoQuery = hotspotDao.query(); | ||||
| 		List<HotspotModel> hotspotModels = iDaoQuery.list(); | ||||
| 		for (HotspotModel hotspotModel : hotspotModels) { | ||||
| 			put(hotspotModel.getId(), hotspotModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static HotspotCache getCache() { | ||||
| 		return CacheManager.getCache(HotspotCache.class); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										30
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/MetaAttrCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/MetaAttrCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,30 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.MetaAttrDao; | ||||
| import com.actionsoft.apps.kms.model.MetaAttrModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| public class MetaAttrCache extends Cache<String, MetaAttrModel> { | ||||
| 	public MetaAttrCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		MetaAttrDao metaAttrDao = new MetaAttrDao(); | ||||
| 		IDaoQuery<MetaAttrModel> iDaoQuery = metaAttrDao.query(); | ||||
| 		List<MetaAttrModel> metaAttrModels = iDaoQuery.list(); | ||||
| 		for (MetaAttrModel metaAttrModel : metaAttrModels) { | ||||
| 			put(metaAttrModel.getId(), metaAttrModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static MetaAttrCache getCache() { | ||||
| 		return CacheManager.getCache(MetaAttrCache.class); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										45
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/MetaDataCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/MetaDataCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,45 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.MetaDataDao; | ||||
| import com.actionsoft.apps.kms.model.MetaDataModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.cache.ListValueIndex; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| public class MetaDataCache extends Cache<String, MetaDataModel> { | ||||
| 	public MetaDataCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 		registeIndex(metaDataCardIndex.class, new metaDataCardIndex()); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		MetaDataDao metaDataDao = new MetaDataDao(); | ||||
| 		IDaoQuery<MetaDataModel> iDaoQuery = metaDataDao.query(); | ||||
| 		List<MetaDataModel> metaDataModels = iDaoQuery.list(); | ||||
| 		for (MetaDataModel metaDataModel : metaDataModels) { | ||||
| 			put(metaDataModel.getId(), metaDataModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static MetaDataCache getCache() { | ||||
| 		return CacheManager.getCache(MetaDataCache.class); | ||||
| 	} | ||||
| 
 | ||||
| 	public List<MetaDataModel> getMetaDataListOfCardId(String cardId) { | ||||
| 		List<MetaDataModel> list = iteratorToList(getCache().getByIndex(metaDataCardIndex.class, cardId)); | ||||
| 		return list; | ||||
| 	} | ||||
| 
 | ||||
| 	class metaDataCardIndex extends ListValueIndex<String, MetaDataModel> { | ||||
| 
 | ||||
| 		@Override | ||||
| 		public String key(MetaDataModel t) { | ||||
| 			return t.getCardId(); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										36
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/MetaSchemaCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/MetaSchemaCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,36 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.MetaSchemaDao; | ||||
| import com.actionsoft.apps.kms.model.MetaSchemaModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据缓存 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class MetaSchemaCache extends Cache<String, MetaSchemaModel> { | ||||
| 	public MetaSchemaCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		MetaSchemaDao metaSchemaDao = new MetaSchemaDao(); | ||||
| 		IDaoQuery<MetaSchemaModel> iDaoQuery = metaSchemaDao.query(); | ||||
| 		List<MetaSchemaModel> metaschemaModels = iDaoQuery.list(); | ||||
| 		for (MetaSchemaModel metaSchemaModel : metaschemaModels) { | ||||
| 			put(metaSchemaModel.getId(), metaSchemaModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static MetaSchemaCache getCache() { | ||||
| 		return CacheManager.getCache(MetaSchemaCache.class); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										37
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/OptCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/OptCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.OptDao; | ||||
| import com.actionsoft.apps.kms.model.OptModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| /** | ||||
|  * 操作缓存(评论、评分、反馈) | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class OptCache extends Cache<String, OptModel> { | ||||
| 
 | ||||
| 	public OptCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		OptDao optDao = new OptDao(); | ||||
| 		IDaoQuery<OptModel> iDaoQuery = optDao.query(); | ||||
| 		List<OptModel> optModels = iDaoQuery.list(); | ||||
| 		for (OptModel optModel : optModels) { | ||||
| 			put(optModel.getId(), optModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static OptCache getCache() { | ||||
| 		return CacheManager.getCache(OptCache.class); | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										32
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/PublishCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/PublishCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.PublishDao; | ||||
| import com.actionsoft.apps.kms.model.PublishModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| public class PublishCache extends Cache<String, PublishModel> { | ||||
| 
 | ||||
| 	public PublishCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		PublishDao publishDao = new PublishDao(); | ||||
| 		IDaoQuery<PublishModel> iDaoQuery = publishDao.query(); | ||||
| 		List<PublishModel> publishModels = iDaoQuery.list(); | ||||
| 		for (PublishModel publishModel : publishModels) { | ||||
| 			put(publishModel.getId(), publishModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static PublishCache getCache() { | ||||
| 		return CacheManager.getCache(PublishCache.class); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										30
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/VersionCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								com.actionsoft.apps.kms/src/com/actionsoft/apps/kms/cache/VersionCache.java
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,30 @@ | ||||
| package com.actionsoft.apps.kms.cache; | ||||
| 
 | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.VersionDao; | ||||
| import com.actionsoft.apps.kms.model.VersionModel; | ||||
| import com.actionsoft.apps.resource.plugin.profile.CachePluginProfile; | ||||
| import com.actionsoft.bpms.commons.cache.Cache; | ||||
| import com.actionsoft.bpms.commons.cache.CacheManager; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.IDaoQuery; | ||||
| 
 | ||||
| public class VersionCache extends Cache<String, VersionModel> { | ||||
| 	public VersionCache(CachePluginProfile configuration) { | ||||
| 		super(configuration); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	protected void load() { | ||||
| 		VersionDao versionDao = new VersionDao(); | ||||
| 		IDaoQuery<VersionModel> iDaoQuery = versionDao.query(); | ||||
| 		List<VersionModel> versionModels = iDaoQuery.list(); | ||||
| 		for (VersionModel versionModel : versionModels) { | ||||
| 			put(versionModel.getId(), versionModel, false); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static VersionCache getCache() { | ||||
| 		return CacheManager.getCache(VersionCache.class); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,388 @@ | ||||
| package com.actionsoft.apps.kms.controller; | ||||
| 
 | ||||
| import java.sql.Date; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.web.KnwlCenterWeb; | ||||
| import com.actionsoft.apps.processon.HotspotWeb; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Controller; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Mapping; | ||||
| 
 | ||||
| /** | ||||
|  * 知识中心(KMS前台)控制器类 | ||||
|  * | ||||
|  * @author wangshibao 知识中心 | ||||
|  */ | ||||
| @Controller public class KnwlCenterController { | ||||
| 	/* 知识中心iframe框架 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl") | ||||
| 	public String getKnwlHome(UserContext uc, String page) { | ||||
| 		PublishCache.getCache().reload(); | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getKnwlHome(page); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心主页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center") | ||||
| 	public String getKnwlCenterHome(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getKnwlCenterHome(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心主页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mobile_center_knowladge_count") | ||||
| 	public String getMobileKnwlCenterCount(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getKnowladgeCount(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-我的知识-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_me_card_list_json") | ||||
| 	public String getMeCardListJson(UserContext uc, int curPage, int rowsPerPage, String sortIndx, String sortDir, String filter) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getMeCardListJson(curPage, rowsPerPage, sortIndx, sortDir, filter); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-我发布的-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_publish_card_list_json") | ||||
| 	public String getPublishCardListJson(UserContext uc, int curPage, int rowsPerPage, String sortIndx, String sortDir, String filter) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getPublishListJson(curPage, rowsPerPage, sortIndx, sortDir, filter); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-我借阅的-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_borrow_card_list_json") | ||||
| 	public String getBorrowCardListJson(UserContext uc, int curPage, int rowsPerPage, String sortIndx, String sortDir, String filter) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getBorrowListJson(curPage, rowsPerPage, sortIndx, sortDir, filter); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-发布待审-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_publish_examine_card_list_json") | ||||
| 	public String getPublishExamineCardListJson(UserContext uc, int curPage, int rowsPerPage) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getPublishExamineListJson(curPage, rowsPerPage); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-获取维度树json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_dimension_tree_json") | ||||
| 	public String getDimensionTreeJson(UserContext uc, String parentId, boolean isDimensionKnwlPage) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getDimensionTreeJson(parentId, isDimensionKnwlPage); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-发布知识-获取元数据以及属性json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_schema_attr_list_json") | ||||
| 	public String getSchemaAttrJson(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getSchemaAttr(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-发布知识-获取维度树json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_me_publish_dimension_tree_json") | ||||
| 	public String getMeDimensionTreeJson(UserContext uc, String parentId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getMeDimensionTreeJson(parentId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_dimension_card_list_json") | ||||
| 	public String getDimensionCardListJson(UserContext uc, String dimensionId, int curPage, int rowsPerPage, String sortIndx, String sortDir, String filter) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getDimensionCardListJson(dimensionId, curPage, rowsPerPage, sortIndx, sortDir, filter); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-知识列表json(不分页) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_dimension_card_list_all_json") | ||||
| 	public String getDimensionCardListAllJson(UserContext uc, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getDimensionCardListAllJson(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-删除文件 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_delete_file") | ||||
| 	public String deleteFile(UserContext uc, String cardId, String fileId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.deleteFile(cardId, fileId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-新建知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_insert_card") | ||||
| 	public String insertCard(UserContext uc, String cardId, String cardName, Date validDate, int onlineLevel, int securityLevel, int cardType, boolean isComment, boolean isRate, String cardContext) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.insertCard(cardId, cardName, validDate, onlineLevel, securityLevel, cardType, isComment, isRate, cardContext); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-编辑知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_update_card") | ||||
| 	public String updateCard(UserContext uc, String cardId, String cardName, Date validDate, int onlineLevel, int securityLevel, int cardType, boolean isComment, boolean isRate, String cardContext) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.updateCard(cardId, cardName, validDate, onlineLevel, securityLevel, cardType, isComment, isRate, cardContext); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-删除知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_delete_card") | ||||
| 	public String deleteFile(UserContext uc, String cardIds) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.deleteCards(cardIds); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-文件列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_file_list_json") | ||||
| 	public String getFileListJson(UserContext uc, String cardId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getFileListJson(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-发布知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_publish_card") | ||||
| 	public String publishCard(UserContext uc, String publishCardIds, String publishDimensionIds, String schemaMetaData, String tags, String publishMemo) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.publishCard(uc,publishCardIds, publishDimensionIds, schemaMetaData, tags, publishMemo); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-给知识评分 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_rate_card") | ||||
| 	public String rateCard(UserContext uc, String rateId, String cardId, Integer rateLevel) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.rateCard(rateId, cardId, rateLevel); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-查询浏览信息 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_browse_card_info_json") | ||||
| 	public String getBrowseCardInfo(UserContext uc, String cardId, boolean isBorrow, String boId, boolean isEdit, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getBrowseCardInfo(uc,cardId, isBorrow, boId, isEdit, dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-发送邀请 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_send_browse_invitation") | ||||
| 	public String sendBrowseInvitation(UserContext uc,String dimensionId, String cardId, String targetUsers) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.sendBrowseInvitation(dimensionId,cardId, targetUsers); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-打开浏览页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_browse_card_page") | ||||
| 	public String openBrowseCardPage(UserContext uc,String dimensionId, String cardId, boolean isPage) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.openBrowseCardPage(dimensionId,cardId, isPage); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-新增评论 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_comment_insert") | ||||
| 	public String insertComment(UserContext uc, String cardId, String commentContent) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.insertComment(cardId, commentContent); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-统计数据 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_stat_json") | ||||
| 	public String statCardFile(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.statCardFile(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 启动借阅流程 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_borrow_card_process_start") | ||||
| 	public String startBorrowProcwss(UserContext uc, String cardId, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.startBorrowProcessType(cardId, dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 启动发布流程 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_publish_card_process_start") | ||||
| 	public String startPublishProcess(UserContext uc, String cardIds, String dimensionId, String schemaMetaData, String tags, String publishMemo) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.startPublishProcessType(cardIds, dimensionId, schemaMetaData, tags, publishMemo); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 取消发布知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_cancel_publish_card") | ||||
| 	public String cancelPublishCard(UserContext uc, String publishId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.cancelPublishCard(publishId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 打开知识地图home页 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_home") | ||||
| 	public String getHotspotHome(UserContext uc, String dimensionId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc); | ||||
| 		return hotspotWeb.getHotspot(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 查询维度的tree路径 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_get_dimension_path_from_root") | ||||
| 	public String getDimensionPath(UserContext uc, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getDimensionPath(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 打包下载 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_package_files") | ||||
| 	public String packageFiels(UserContext uc, String cardId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.packageFiels(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 收藏知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_collect_card") | ||||
| 	public String collectCard(UserContext uc, String cardId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.collectCard(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除未保存的知识卡片上传的文件 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_delete_unsaved_files") | ||||
| 	public String deleteUnsavedFiles(UserContext uc, String cardId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.deleteUnsavedFiles(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 反馈 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_report_card") | ||||
| 	public String reportCard(UserContext uc, String cardId, String dimensionId, String reportContent) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.reportCard(cardId, dimensionId, reportContent); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 预览 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_preview_file") | ||||
| 	public String previewFile(UserContext uc, String fileId, boolean isDownload, boolean isCopy) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.previewFile(uc, fileId, isDownload, isCopy); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 下载文件 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_download_file") | ||||
| 	public String downloadFile(UserContext uc, String fileId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.downloadFile(uc,fileId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-我的知识-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_log_list") | ||||
| 	public String getLogListJson(UserContext uc, int curPage, int rowsPerPage, String cardId, String sortIndx, String sortDir) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getLogListJson(curPage, rowsPerPage, cardId, sortIndx, sortDir); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-个人-我的知识-知识列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_latest_comment") | ||||
| 	public String getLatestComment(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getLatestComment(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 加载工作网络树页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_get_network_page") | ||||
| 	public String getNetworkPage(UserContext uc, String cardId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getNetWorkPage(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 加载工作网络树 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_get_network_tree") | ||||
| 	public String getNetworkTree(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getNetworkTree(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 分享到工作网络 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_shareto_network") | ||||
| 	public String shareToNetwork(UserContext uc, String cardId, String teamId, String networkId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.shareToNetwork(cardId, teamId, networkId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-移动复制知识-获取维度树json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_all_move_dimension_tree_json") | ||||
| 	public String getMoveKnwlDimensionTreeJson(UserContext uc, String parentId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.getMoveKnwlDimensionTreeJson(parentId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-移动知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_move_card") | ||||
| 	public String moveCard(UserContext uc, String cardIds, String dimensionIds, String currDimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.moveCard(cardIds, dimensionIds, currDimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-复制知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_copy_card") | ||||
| 	public String copyCard(UserContext uc, String cardIds, String dimensionIds, String currDimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.copyCard(cardIds, dimensionIds, currDimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-全部-移交知识 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_change_carduser") | ||||
| 	public String changeCardUser(UserContext uc, String cardIds, String handoverCardUser) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.changeCardUser(cardIds, handoverCardUser); | ||||
| 	} | ||||
| 	/* 知识中心-发布-检查知识下是否存在文件 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_check_card_has_file") | ||||
| 	public String checkCardHasFile(UserContext uc, String cardIds) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.checkCardHasFile(cardIds); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识中心-发布-检查知识下是否存在文件 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_cancel_publish_card_process_start") | ||||
| 	public String startCancelPublishProcess(UserContext uc, String publishId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.startCancelPublishProcess(publishId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 浏览器预览文件(区别于onlinedoc) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_browser_preview") | ||||
| 	public String browserPreview(UserContext uc, String fileId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.browserPreview(fileId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 浏览器预览图片 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_browser_preview_image") | ||||
| 	public String browserPreviewImg(UserContext uc, String fileId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.browserPreviewImg(fileId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 浏览器预览表单 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_browser_preview_form") | ||||
| 	public String browserPreviewForm(UserContext uc, String fileId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.browserPreviewForm(fileId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 加载公共维度知识列表html */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_grid_html") | ||||
| 	public String dimensionGridHtml(UserContext uc) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.dimensionGridHtml(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 独立知识展示页面 iframe(为了和知识中心的架构保持一致) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_grid_page_iframe") | ||||
| 	public String dimensionGridPageIframe(UserContext uc, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.dimensionGridPageIframe(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 独立知识展示页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_grid_page") | ||||
| 	public String dimensionGridPage(UserContext uc, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.dimensionGridPage(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 独立知识展示页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_write_log") | ||||
| 	public String dimensionGridWriteLog(UserContext uc, String fileId, String cardId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.dimensionWriteLog(fileId, cardId); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,246 @@ | ||||
| package com.actionsoft.apps.kms.controller; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.web.KnwlMgrWeb; | ||||
| import com.actionsoft.apps.processon.HotspotWeb; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Controller; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Mapping; | ||||
| 
 | ||||
| /** | ||||
|  * 知识维护(KMS后台)控制器类 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| @Controller | ||||
| public class KnwlMgrController { | ||||
| 	/* 知识维护主页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_mgr") | ||||
| 	public String getMgrHome(UserContext uc, String page, String tab) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getMgrHome(page, tab); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护主页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr") | ||||
| 	public String getKnwlMgrHome(UserContext uc) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getKnwlMgrHome(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 获取维度树json-维度维护 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_tree_json") | ||||
| 	public String getDimensionTreeJson(UserContext uc, String parentId) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getDimensionTreeJson(parentId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 获取维度树json-设置知识地图 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_tree_bindhotspot_json") | ||||
| 	public String getDimensionBindHotspotTreeJson(UserContext uc, String parentId) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getDimensionBindHotspotTreeJson(parentId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 获取维度树json-有效期维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_validdate_tree_json") | ||||
| 	public String getDimensionValiddateTreeJson(UserContext uc, String parentId) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getDimensionValiddateTreeJson(parentId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 获取维度树json-有效期维度-全部加载 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_validdate_tree_all_json") | ||||
| 	public String getDimensionValiddateTreeAllJson(UserContext uc) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getDimensionValiddateTreeAllJson(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 获取维度树json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_dimension_list_json") | ||||
| 	public String getDimensionJson(UserContext uc, String parentId) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.getDimensionListJson(parentId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 新建维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_add_dimension") | ||||
| 	public String addDimension(UserContext uc, String parentId, String dimensionNames, boolean showtype, boolean isPublishKnwl, boolean isExamine, String memo, String hotspotName, boolean isEnabled) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.createDimension(dimensionNames, parentId, showtype, isPublishKnwl, isExamine, memo, hotspotName, isEnabled); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 修改维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_update_dimension") | ||||
| 	public String updateDimension(UserContext uc, String id, String dimensionName, boolean showtype, boolean isPublishKnwl, boolean isExamine, String memo, String hotspotName, boolean isEnabled) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.updateDimension(id, dimensionName, showtype, isPublishKnwl, isExamine, memo, hotspotName, isEnabled); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_delete_dimension") | ||||
| 	public String deleteDimension(UserContext uc, String ids) { | ||||
| 		KnwlMgrWeb mgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return mgrWeb.deleteDimension(ids); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护-元数据-列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_schema_list_json") | ||||
| 	public String getSchemaListJson(UserContext uc, int curPage, int rowsPerPage, String sortIndx, String sortDir) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.getSchemaListJson(curPage, rowsPerPage, sortIndx, sortDir); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护-有效期-列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_valid_date_card_list_json") | ||||
| 	public String getValidDateCardListJson(UserContext uc, int curPage, int rowsPerPage, String dimensionIdArr, String validDate, String sortIndx, String sortDir) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.getValidDateCardListJson(curPage, rowsPerPage, dimensionIdArr, validDate, sortIndx, sortDir); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护-元数据-属性列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_meta_attr_list_json") | ||||
| 	public String getMetaAttrListJson(UserContext uc, String schemaId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.getMetaAttrListJson(schemaId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护-元数据-新建元数据 (包括属性) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_add_meta_schema") | ||||
| 	public String addMetaSchema(UserContext uc, String schemaTitle, int schemaShowtype, boolean isNullable, boolean isSearch, String schemaDesc, String metaAttr) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.addMetaSchema(schemaTitle, schemaShowtype, isNullable, isSearch, schemaDesc, metaAttr); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护-元数据-修改元数据 (包括属性) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_update_meta_schema") | ||||
| 	public String updateMetaSchema(UserContext uc, String schemaId, String schemaTitle, int schemaShowtype, boolean isNullable, boolean isSearch, String schemaDesc, String metaAttr) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.updateMetaSchema(schemaId, schemaTitle, schemaShowtype, isNullable, isSearch, schemaDesc, metaAttr); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识维护-元数据-删除元数据 (包括属性) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_delete_meta_schema") | ||||
| 	public String deleteMetaSchema(UserContext uc, String schemaIds) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.deleteSchema(schemaIds); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 打开绑定维度到知识地图页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_binding") | ||||
| 	public String getBindingHotspotHome(UserContext uc, String dimensionId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc, dimensionId); | ||||
| 		return hotspotWeb.getBindHotspot(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 绑定维度到知识地图 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_bind") | ||||
| 	public String bindHotspot(UserContext uc, String dimensionId, String shapeId, String hotspotDefId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc); | ||||
| 		return hotspotWeb.bindHotspot(dimensionId, shapeId, hotspotDefId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 绑定知识到知识地图 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_bind_card") | ||||
| 	public String bindHotspotCard(UserContext uc, String cardId, String shapeId, String hotspotDefId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc); | ||||
| 		return hotspotWeb.bindHotspotCard(cardId, shapeId, hotspotDefId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 绑定维度到知识地图 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_bind_linkurl") | ||||
| 	public String bindHotspotLinkURL(UserContext uc, String linkurl, String target, String shapeId, String hotspotDefId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc); | ||||
| 		return hotspotWeb.bindHotspotLinkURL(linkurl, target, shapeId, hotspotDefId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除绑定知识地图 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_delete_bind") | ||||
| 	public String deleteHotspot(UserContext uc, String hotspotId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc); | ||||
| 		return hotspotWeb.deleteHotspot(hotspotId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除绑定知识地图 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_render_hotspot_div") | ||||
| 	public String getAsyncBindingShapeHotspot(UserContext uc, String dimensionId, String shapeId) { | ||||
| 		HotspotWeb hotspotWeb = new HotspotWeb(uc); | ||||
| 		return hotspotWeb.getAsyncBindingShapeHotspot(dimensionId, shapeId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 移动维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_move_dimension") | ||||
| 	public String moveDimension(UserContext uc, String sourceDimensionId, String targetDimensionId, String sort) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.moveDimension(sourceDimensionId, targetDimensionId, sort); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 延期维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_delay_validdate") | ||||
| 	public String delayValiddate(UserContext uc, String cardIdArr, String validDate, String sort) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.delayValiddate(cardIdArr, validDate); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 元数据排序 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_meta_schema_order_index_save") | ||||
| 	public String saveMetaSchemaOrderIndex(UserContext uc, String sourceId, String targetId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.saveMetaSchemaOrderIndex(sourceId, targetId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 有效期-取消发布知识(全部维度)前的检查 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_cancel_publishes_card_check") | ||||
| 	public String cancelPublishesCardCheck(UserContext uc, String cardId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.cancelPublishesCardCheck(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 有效期-取消发布知识(全部维度) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_cancel_publishes_card") | ||||
| 	public String cancelPublishesCard(UserContext uc, String cardId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.cancelPublishesCard(cardId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 有效期-取消发布知识(全部维度) */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_get_examine_user") | ||||
| 	public String getExamineUser(UserContext uc, String dimensionId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.getExamineUser(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* usertask-维度树页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_usertask_html") | ||||
| 	public String getKMSUsertaskHTML(UserContext uc, String formToKMSOptionDimensionIdJA) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.getKMSUsertaskHTML(formToKMSOptionDimensionIdJA); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 维度策略报告 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_report") | ||||
| 	public String getDimensionReport(UserContext uc, String dimensionId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.getDimensionReport(dimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 应用当前维度的ac权限到后代 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_dimension_ac_to_des") | ||||
| 	public String dimensionACToDes(UserContext uc, String dimensionId, String style) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.dimensionACToDes(dimensionId, style); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 复制维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_mgr_dimension_copy") | ||||
| 	public String copyDimension(UserContext uc, String newDimensionName, String currDimensionId) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.copyDimension(uc, newDimensionName, currDimensionId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 移交维度 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_change_dimensionuser") | ||||
| 	public String changeCardUser(UserContext uc, String dimensionIds, String handoverCardUser) { | ||||
| 		KnwlMgrWeb knwlMgrWeb = new KnwlMgrWeb(uc); | ||||
| 		return knwlMgrWeb.changeDimensionUser(dimensionIds, handoverCardUser); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,60 @@ | ||||
| package com.actionsoft.apps.kms.controller; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.web.KnwlCenterWeb; | ||||
| import com.actionsoft.apps.kms.web.KnwlMobileWeb; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Controller; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Mapping; | ||||
| 
 | ||||
| @Controller | ||||
| public class KnwlMobileController { | ||||
| 	/* 主页面 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_mobile_home") | ||||
| 	public String getMobileHome(UserContext uc) { | ||||
| 		KnwlMobileWeb web = new KnwlMobileWeb(uc); | ||||
| 		return web.getMobileHome(); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_mobile_lists") | ||||
| 	public String getLists(UserContext uc, String sortIndx, String sortDir, String searchDimensionIds, String schemaMetaData, String cardName, String publishTime, String publishUser, String tags, String lastPublishId, String searchType,String departId) { | ||||
| 		KnwlMobileWeb web = new KnwlMobileWeb(uc); | ||||
| 		return web.mobileListsData(uc, sortIndx, sortDir, searchDimensionIds, schemaMetaData, cardName, publishTime, publishUser, tags, lastPublishId, searchType,departId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 启动发布流程 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_publish_card_process_start_mobile") | ||||
| 	public String startPublishProcess(UserContext uc, String cardIds, String dimensionId, String schemaMetaData, String tags, String publishMemo) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.startPublishProcess(cardIds, dimensionId, schemaMetaData, tags, publishMemo, "mobile"); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 启动借阅流程 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_borrow_card_process_start_mobile") | ||||
| 	public String startBorrowProcwss(UserContext uc, String cardId, String dimensionId) { | ||||
| 		KnwlCenterWeb knwlCenterWeb = new KnwlCenterWeb(uc); | ||||
| 		return knwlCenterWeb.startBorrowProcess(cardId, dimensionId, "mobile"); | ||||
| 	} | ||||
| 	@Mapping("com.actionsoft.apps.kms_mobile_center_dimension_tree_json") | ||||
| 	public String getDimensionTreeJson(UserContext uc, String parentId, boolean isDimensionKnwlPage) { | ||||
| 		KnwlMobileWeb web = new KnwlMobileWeb(uc); | ||||
| 		return web.getDimensionTreeJson(uc, parentId, isDimensionKnwlPage); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_mobile_center_dimension_search") | ||||
| 	public String getDimensionSearchByName(UserContext uc, String key) { | ||||
| 		KnwlMobileWeb web = new KnwlMobileWeb(uc); | ||||
| 		return web.getDimensionSearchByName(uc, key); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_mobile_schema_attr_list_json") | ||||
| 	public String getSchemaMobile(UserContext uc) { | ||||
| 		KnwlMobileWeb web = new KnwlMobileWeb(uc); | ||||
| 		return web.getSchemaMobile(); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_mobile_check_fullsearch") | ||||
| 	public String checkFullsearchAppActive(UserContext uc) { | ||||
| 		KnwlMobileWeb web = new KnwlMobileWeb(uc); | ||||
| 		return web.checkFullsearchAppActive(uc); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,167 @@ | ||||
| package com.actionsoft.apps.kms.controller; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.web.KnwlSearchWeb; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Controller; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Mapping; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| @Controller | ||||
| public class KnwlSearchController { | ||||
| 	/* 知识检索home页 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_search") | ||||
| 	public String getKnwlMgrHome(UserContext uc, String searchType, String sortIndx) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		return knwlSearchWeb.getKnwlSearchHome(searchType, sortIndx); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识检索-属性-维度树json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_search_attr_dimension_tree_json") | ||||
| 	public String getAttrSearchDimensionTreeJson(UserContext uc, String parentId) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		return knwlSearchWeb.getAttrSearchDimensionTreeJson(parentId, KMSUtil.isKnwlManager(uc.getUID())); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识检索-属性-维度树json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_search_attr_dimension_tree_all_json") | ||||
| 	public String getAttrSearchDimensionTreeAllJson(UserContext uc) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		return knwlSearchWeb.getAttrSearchDimensionTreeAllJson(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识检索-属性-元数据列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_search_schema_attr_list_json") | ||||
| 	public String getSchemaAttrListJson(UserContext uc) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		return knwlSearchWeb.getSchemaAttr(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 知识检索-属性-检索数据库 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_attr_search_dosearch") | ||||
| 	public String attrSearchCard(UserContext uc, int curPage, int rowsPerPage, String sortIndx, String sortDir, String searchDimensionIds, String schemaMetaData, String cardName, String publishUser, String publishTime, String tags, String lastPublishId, String searchType,String departId) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		System.out.println("departId>>>>>>>>>>>"+departId); | ||||
| 		return knwlSearchWeb.attrSearchCard(curPage, rowsPerPage, sortIndx, sortDir, searchDimensionIds, schemaMetaData, cardName, publishTime, publishUser, tags, lastPublishId, searchType,departId); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 全文检索 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_fullsearch_list_json") | ||||
| 	public String fullSearch(UserContext uc, int curPage, int rowsPerPage, String searchText, String docTypes, String searchType) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		return knwlSearchWeb.fullSearch(curPage, rowsPerPage, searchText, docTypes, searchType); | ||||
| 	} | ||||
| 
 | ||||
| 	// 键盘地址本查询团队成员模糊匹配 | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_memberlist") | ||||
| 	public String getApplicationManagementDeploy(UserContext uc, String term) { | ||||
| 		KnwlSearchWeb knwlSearchWeb = new KnwlSearchWeb(uc); | ||||
| 		// term为组件默认参数 | ||||
| 		return knwlSearchWeb.getUserList(term); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 全文检索查询 | ||||
| 	 * | ||||
| 	 * @param me | ||||
| 	 * @param q 关键词 | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_es_search") | ||||
| 	public String openEsSearchPage(UserContext me, String q) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.openEsSearchPage(q); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * kms注册的xpages页面 | ||||
| 	 * | ||||
| 	 * @param me | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpages") | ||||
| 	public String kmsXPages(UserContext me, String showIndex, String showStyle) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.kmsXPages(showIndex, showStyle); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_querycardtoplist") | ||||
| 	public String queryCardTopList(UserContext me, String sortIndx) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.queryCardTopList(sortIndx); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_querycardtoplistpage") | ||||
| 	public String queryCardTopPage(UserContext me, String sortIndx) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.queryCardTopPage(sortIndx); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_opencardbydirctory") | ||||
| 	public String openCardbyDirctory(UserContext me, String rootDirectoryId, String showType, String showIndex, String ifShowDirectory, String sortIndx, String showStyle, String publishTimeFormat) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.openCardByDirctory(rootDirectoryId, showType, showIndex, ifShowDirectory, sortIndx, showStyle, publishTimeFormat); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_getcardbydirctory") | ||||
| 	public String getCardByDirctory(UserContext me, String directoryId, String sortIndx, String hasPerm, String publishTimeFormat) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.getCardByDirctory(directoryId, sortIndx, hasPerm, publishTimeFormat); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_getxpagecategory") | ||||
| 	public String getXpageCategory(UserContext me) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.getXpageCategory(); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_savexpagecategory") | ||||
| 	public String saveXpageCategory(UserContext me, String categoryName) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.saveXpageCategory(categoryName); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_openfastcard") | ||||
| 	public String openFastCard(UserContext me, String category, String showType, String showIndex, String showStyle, String publishTimeFormat) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.openFastCard(category, showType, showIndex, showStyle, publishTimeFormat); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_savexpagefastcard") | ||||
| 	public String saveXpageFastCard(UserContext me, String categoryName, String cardIds) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.saveXpageFastCard(categoryName, cardIds); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_deletexpagefastcard") | ||||
| 	public String deleteXpageFastCard(UserContext me, String id) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.deleteXpageFastCard(id); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_loadfastcard") | ||||
| 	public String loadFastCard(UserContext me, String categoryName, String publishTimeFormat) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.loadFastCard(categoryName, publishTimeFormat); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_savefastcardorder") | ||||
| 	public String saveFastCardOrder(UserContext me, String data) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.saveFastCardOrder(data); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_getcardtree") | ||||
| 	public String getCardTree(UserContext me) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.getCardTree(); | ||||
| 	} | ||||
| 
 | ||||
| 	@Mapping("com.actionsoft.apps.kms_xpage_getcardtreedata") | ||||
| 	public String getCardTreeData(UserContext me, String type, String pid, String hasPerm) { | ||||
| 		KnwlSearchWeb web = new KnwlSearchWeb(me); | ||||
| 		return web.getCardTreeData(type, pid, hasPerm); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,83 @@ | ||||
| package com.actionsoft.apps.kms.controller; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.web.SystemMgrWeb; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Controller; | ||||
| import com.actionsoft.bpms.server.bind.annotation.Mapping; | ||||
| 
 | ||||
| /** | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| @Controller | ||||
| public class SystemMgrController { | ||||
| 	/* 系统维护home页 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_system_mgr") | ||||
| 	public String getKnwlMgrHome(UserContext uc) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.getSystemMgrHome(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 系统维护版本号列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_version_list_json") | ||||
| 	public String getVersionListJson(UserContext uc) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.getVersionListJson(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 系统维护知识地图定义列表json */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_hotspot_def_list_json") | ||||
| 	public String getHotspotDefListJson(UserContext uc) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.getHotspotDefListJson(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 保存知识参数 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_system_mgr_save_param") | ||||
| 	public String saveSystemParam(UserContext uc, String maxFileSize, String blackFileList, String gridRowPP, String browserPreview) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.saveSystemParam(maxFileSize, blackFileList, gridRowPP, browserPreview); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 获取知识参数 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_system_mgr_get_param_json") | ||||
| 	public String getSystemParam(UserContext uc) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.getSystemParam(); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 新建版本号 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_system_mgr_add_version") | ||||
| 	public String addVersion(UserContext uc, String versionNo, String memo) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.addVersion(versionNo, memo); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 新建知识地图定义 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_system_mgr_add_hotspot_def") | ||||
| 	public String addHotspotDef(UserContext uc, String hotspotName, String hotspotMetaId, String memo) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.addHotspotDef(hotspotName, hotspotMetaId, memo); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除版本号 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_delete_version") | ||||
| 	public String deleteVersions(UserContext uc, String versionNos) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.deleteVersions(versionNos); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除知识地图定义 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_delete_hotspot_def") | ||||
| 	public String deleteHotspotDefs(UserContext uc, String hotspotDefIds) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.deleteHotspotDefs(hotspotDefIds); | ||||
| 	} | ||||
| 
 | ||||
| 	/* 删除知识地图定义 */ | ||||
| 	@Mapping("com.actionsoft.apps.kms_knwl_center_delete_hotspot_check") | ||||
| 	public String deleteHotspotDefsCheck(UserContext uc, String hotspotDefIds) { | ||||
| 		SystemMgrWeb systemMgrWeb = new SystemMgrWeb(uc); | ||||
| 		return systemMgrWeb.deleteHotspotDefsCheck(hotspotDefIds); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,170 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 知识 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CardDao extends DaoObject<CardModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(CardModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(CardModel.ID, model.getId()); | ||||
| 		paraMap.put(CardModel.CARDNAME, model.getCardName()); | ||||
| 		paraMap.put(CardModel.CARDTYPE, model.getCardType()); | ||||
| 		paraMap.put(CardModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(CardModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(CardModel.ONLINELEVEL, model.getOnlineLevel()); | ||||
| 		paraMap.put(CardModel.ISPUBLISHED, model.getIsPublished()); | ||||
| 		paraMap.put(CardModel.ISFULLSEARCH, model.getIsFullSearch()); | ||||
| 		paraMap.put(CardModel.READCOUNT, model.getReadCount()); | ||||
| 		paraMap.put(CardModel.SECURITYLEVEL, model.getSecurityLevel()); | ||||
| 
 | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			SQLNullValue lastUpdateNull = SQLNullValue.newInstance(Types.DATE); | ||||
| 			paraMap.put(CardModel.LASTUPDATE, lastUpdateNull); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 		if (model.getValidDate() == null) { | ||||
| 			SQLNullValue validDateNull = SQLNullValue.newInstance(Types.DATE); | ||||
| 			paraMap.put(CardModel.VALIDDATE, validDateNull); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.VALIDDATE, model.getValidDate()); | ||||
| 		} | ||||
| 
 | ||||
| 		paraMap.put(CardModel.ISCOMMENT, model.getIsComment()); | ||||
| 		paraMap.put(CardModel.ISRATE, model.getIsRate()); | ||||
| 		paraMap.put(CardModel.CARDCONTEXT, ""); | ||||
| 		if (model.getExternalUrl() == null) { | ||||
| 			paraMap.put(CardModel.EXTERNALURL, ""); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.EXTERNALURL, model.getExternalUrl()); | ||||
| 		} | ||||
| 		if (model.getExtParams() == null) { | ||||
| 			paraMap.put(CardModel.EXTPARAMS, ""); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.EXTPARAMS, model.getExtParams()); | ||||
| 		} | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			CardCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(CardModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(CardModel.CARDNAME, model.getCardName()); | ||||
| 		paraMap.put(CardModel.CARDTYPE, model.getCardType()); | ||||
| 		paraMap.put(CardModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(CardModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(CardModel.ONLINELEVEL, model.getOnlineLevel()); | ||||
| 		paraMap.put(CardModel.ISPUBLISHED, model.getIsPublished()); | ||||
| 		paraMap.put(CardModel.ISFULLSEARCH, model.getIsFullSearch()); | ||||
| 		paraMap.put(CardModel.READCOUNT, model.getReadCount()); | ||||
| 		paraMap.put(CardModel.SECURITYLEVEL, model.getSecurityLevel()); | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			SQLNullValue lastUpdateNull = SQLNullValue.newInstance(Types.DATE); | ||||
| 			paraMap.put(CardModel.LASTUPDATE, lastUpdateNull); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 		if (model.getValidDate() == null) { | ||||
| 			SQLNullValue validDateNull = SQLNullValue.newInstance(Types.DATE); | ||||
| 			paraMap.put(CardModel.VALIDDATE, validDateNull); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.VALIDDATE, model.getValidDate()); | ||||
| 		} | ||||
| 		paraMap.put(CardModel.ISCOMMENT, model.getIsComment()); | ||||
| 		paraMap.put(CardModel.ISRATE, model.getIsRate()); | ||||
| 		paraMap.put(CardModel.CARDCONTEXT, ""); | ||||
| 		if (model.getExternalUrl() == null) { | ||||
| 			paraMap.put(CardModel.EXTERNALURL, ""); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.EXTERNALURL, model.getExternalUrl()); | ||||
| 		} | ||||
| 		if (model.getExtParams() == null) { | ||||
| 			paraMap.put(CardModel.EXTPARAMS, ""); | ||||
| 		} else { | ||||
| 			paraMap.put(CardModel.EXTPARAMS, model.getExtParams()); | ||||
| 		} | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			CardCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_CARD; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<CardModel> rowMapper() { | ||||
| 		return new RowMapper<CardModel>() { | ||||
| 			@Override | ||||
| 			public CardModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public CardModel record2Model(ResultSet rs) { | ||||
| 		CardModel cardModel = null; | ||||
| 		try { | ||||
| 			if (rs.getString(CardModel.CARDTYPE) == null) { | ||||
| 				return cardModel; | ||||
| 			} | ||||
| 			cardModel = new CardModel(); | ||||
| 			cardModel.setId(rs.getString(CardModel.ID)); | ||||
| 			cardModel.setCardName(rs.getString(CardModel.CARDNAME)); | ||||
| 			cardModel.setCardType(rs.getInt(CardModel.CARDTYPE)); | ||||
| 			cardModel.setCreateTime(rs.getTimestamp(CardModel.CREATETIME)); | ||||
| 			cardModel.setCreateUser(rs.getString(CardModel.CREATEUSER)); | ||||
| 			cardModel.setIsPublished(rs.getInt(CardModel.ISPUBLISHED)); | ||||
| 			cardModel.setLastUpdate(rs.getTimestamp(CardModel.LASTUPDATE)); | ||||
| 			cardModel.setOnlineLevel(rs.getInt(CardModel.ONLINELEVEL)); | ||||
| 			cardModel.setReadCount(rs.getLong(CardModel.READCOUNT)); | ||||
| 			cardModel.setSecurityLevel(rs.getInt(CardModel.SECURITYLEVEL)); | ||||
| 			cardModel.setValidDate(rs.getDate(CardModel.VALIDDATE)); | ||||
| 			cardModel.setIsComment(rs.getInt(CardModel.ISCOMMENT)); | ||||
| 			cardModel.setIsRate(rs.getInt(CardModel.ISRATE)); | ||||
| 			cardModel.setCardContext(rs.getString(CardModel.CARDCONTEXT)); | ||||
| 			cardModel.setIsFullSearch(rs.getInt(CardModel.ISFULLSEARCH)); | ||||
| 			cardModel.setExternalUrl(rs.getString(cardModel.EXTERNALURL)); | ||||
| 			cardModel.setExtParams(rs.getString(cardModel.EXTPARAMS)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return cardModel; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,217 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Iterator; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.model.DimensionModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 维度 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DimensionDao extends DaoObject<DimensionModel> { | ||||
| 	/** | ||||
| 	 * 重载方法,传入Connection提高效率 | ||||
| 	 * | ||||
| 	 * @param conn | ||||
| 	 * @param model | ||||
| 	 * @return | ||||
| 	 * @throws AWSDataAccessException | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	public int insert(Connection conn, DimensionModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(DimensionModel.ID, model.getId()); | ||||
| 		paraMap.put(DimensionModel.DIMENSIONNAME, model.getDimensionName()); | ||||
| 		paraMap.put(DimensionModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(DimensionModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(DimensionModel.HOTSPOTDEFID, model.getHotspotDefId()); | ||||
| 		paraMap.put(DimensionModel.ISENABLED, model.getIsEnabled()); | ||||
| 		paraMap.put(DimensionModel.ISEXAMINE, model.getIsExamine()); | ||||
| 
 | ||||
| 		if (model.getMemo() == null) { | ||||
| 			paraMap.put(DimensionModel.MEMO, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(DimensionModel.MEMO, model.getMemo()); | ||||
| 		} | ||||
| 
 | ||||
| 		paraMap.put(DimensionModel.PARENTID, model.getParentId()); | ||||
| 		paraMap.put(DimensionModel.SHOWTYPE, model.getShowType()); | ||||
| 
 | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			paraMap.put(DimensionModel.LASTUPDATE, SQLNullValue.newInstance(Types.DATE)); | ||||
| 		} else { | ||||
| 			paraMap.put(DimensionModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 
 | ||||
| 		paraMap.put(DimensionModel.ORDERINDEX, model.getOrderIndex()); | ||||
| 
 | ||||
| 		int result = 0; | ||||
| 		if (conn == null) { | ||||
| 			result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		} else { | ||||
| 			result = DBSql.update(conn, DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		} | ||||
| 		if (result == 1) {// 更新cache | ||||
| 			DimensionCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(DimensionModel model) throws AWSDataAccessException { | ||||
| 		return insert(null, model); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 重载方法,传入Connection提高效率 | ||||
| 	 * | ||||
| 	 * @param conn | ||||
| 	 * @param model | ||||
| 	 * @return | ||||
| 	 * @throws AWSDataAccessException | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	public int update(Connection conn, DimensionModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(DimensionModel.DIMENSIONNAME, model.getDimensionName()); | ||||
| 		paraMap.put(DimensionModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(DimensionModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(DimensionModel.HOTSPOTDEFID, model.getHotspotDefId()); | ||||
| 		paraMap.put(DimensionModel.ISENABLED, model.getIsEnabled()); | ||||
| 		paraMap.put(DimensionModel.ISEXAMINE, model.getIsExamine()); | ||||
| 		paraMap.put(DimensionModel.MEMO, model.getMemo()); | ||||
| 		paraMap.put(DimensionModel.PARENTID, model.getParentId()); | ||||
| 		paraMap.put(DimensionModel.SHOWTYPE, model.getShowType()); | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			paraMap.put(DimensionModel.LASTUPDATE, SQLNullValue.newInstance(Types.DATE)); | ||||
| 		} else { | ||||
| 			paraMap.put(DimensionModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 
 | ||||
| 		paraMap.put(DimensionModel.ORDERINDEX, model.getOrderIndex()); | ||||
| 
 | ||||
| 		int result = 0; | ||||
| 		if (conn == null) { | ||||
| 			result = update(model.getId(), paraMap); | ||||
| 		} else { | ||||
| 			result = update(conn, model.getId(), paraMap); | ||||
| 		} | ||||
| 		if (result == 1) {// 更新cache | ||||
| 			DimensionCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(DimensionModel model) throws AWSDataAccessException { | ||||
| 		return update(null, model); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_DIMENSION; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<DimensionModel> rowMapper() { | ||||
| 		return new RowMapper<DimensionModel>() { | ||||
| 			@Override | ||||
| 			public DimensionModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public DimensionModel record2Model(ResultSet rs) { | ||||
| 		DimensionModel dimensionModel = new DimensionModel(); | ||||
| 		try { | ||||
| 			dimensionModel.setId(rs.getString(DimensionModel.ID)); | ||||
| 			dimensionModel.setCreateTime(rs.getTimestamp(DimensionModel.CREATETIME)); | ||||
| 			dimensionModel.setCreateUser(rs.getString(DimensionModel.CREATEUSER)); | ||||
| 			dimensionModel.setDimensionName(rs.getString(DimensionModel.DIMENSIONNAME)); | ||||
| 			dimensionModel.setHotspotDefId(rs.getString(DimensionModel.HOTSPOTDEFID)); | ||||
| 			dimensionModel.setIsEnabled(rs.getInt(DimensionModel.ISENABLED)); | ||||
| 			dimensionModel.setIsExamine(rs.getInt(DimensionModel.ISEXAMINE)); | ||||
| 			dimensionModel.setLastUpdate(rs.getTimestamp(DimensionModel.LASTUPDATE)); | ||||
| 			dimensionModel.setMemo(rs.getString(DimensionModel.MEMO)); | ||||
| 			String parentId = rs.getString(DimensionModel.PARENTID); | ||||
| 			dimensionModel.setParentId(parentId == null ? "" : parentId.trim());// sqlserver和db2把char(36)类型的空字符串默认处理为36位空格 oracle把char(36)类型的空字符串处理为NULL | ||||
| 			dimensionModel.setShowType(rs.getInt(DimensionModel.SHOWTYPE)); | ||||
| 			dimensionModel.setOrderIndex(rs.getInt(DimensionModel.ORDERINDEX)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return dimensionModel; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 删除维度(一并删除子维度) | ||||
| 	 * | ||||
| 	 * @param dimensionIdList 维度集合 | ||||
| 	 * @return | ||||
| 	 * @throws AWSDataAccessException | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	public int delete(List<String> dimensionIdList) throws AWSDataAccessException { | ||||
| 
 | ||||
| 		StringBuilder sqlWhere = new StringBuilder("("); | ||||
| 		for (int i = 0; i < dimensionIdList.size(); i++) { | ||||
| 			sqlWhere.append("'" + dimensionIdList.get(i) + "',"); | ||||
| 		} | ||||
| 		String sqlWhere1 = sqlWhere.substring(0, sqlWhere.lastIndexOf(",")); | ||||
| 		sqlWhere1 += ")"; | ||||
| 		String sql = "DELETE FROM " + entityName() + " WHERE " + pkFieldName() + " IN " + sqlWhere1; | ||||
| 
 | ||||
| 		int result = DBSql.update(sql); | ||||
| 		// 更新cache | ||||
| 		DimensionCache dimensionCache = DimensionCache.getCache(); | ||||
| 		for (String id : dimensionIdList) { | ||||
| 			dimensionCache.remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 填充后代维度id | ||||
| 	 * | ||||
| 	 * @param id | ||||
| 	 * @param dimensionIds | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	public void fillDescendantDimensions(String id, List<String> dimensionIds) { | ||||
| 		Iterator<DimensionModel> iterator = DimensionCache.getCache().iterator(); | ||||
| 		while (iterator.hasNext()) { | ||||
| 			DimensionModel dimensionModel = iterator.next(); | ||||
| 			if (id.equals(dimensionModel.getParentId())) { | ||||
| 				dimensionIds.add(dimensionModel.getId()); | ||||
| 				String id1 = dimensionModel.getId(); | ||||
| 				fillDescendantDimensions(id1, dimensionIds); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,117 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 知识-文件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class FileDao extends DaoObject<FileModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(FileModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(FileModel.ID, model.getId()); | ||||
| 		paraMap.put(FileModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(FileModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(FileModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(FileModel.FILENAME, model.getFileName()); | ||||
| 		paraMap.put(FileModel.FILESIZE, model.getFileSize()); | ||||
| 		paraMap.put(FileModel.FILESTATE, model.getFileState()); | ||||
| 		paraMap.put(FileModel.FILEVER, model.getFileVer()); | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			FileCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(FileModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(FileModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(FileModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(FileModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(FileModel.FILENAME, model.getFileName()); | ||||
| 		paraMap.put(FileModel.FILESIZE, model.getFileSize()); | ||||
| 		paraMap.put(FileModel.FILESTATE, model.getFileState()); | ||||
| 		paraMap.put(FileModel.FILEVER, model.getFileVer()); | ||||
| 		paraMap.put(FileModel.ISFULLSEARCH, model.getIsFullsearch()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			FileCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 删除文件(但不删除缓存,在调用方删除缓存) | ||||
| 	 *  | ||||
| 	 * @param id | ||||
| 	 * @return | ||||
| 	 * @throws AWSDataAccessException | ||||
| 	 * @author wangshibao | ||||
| 	 */ | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_FILE; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<FileModel> rowMapper() { | ||||
| 		return new RowMapper<FileModel>() { | ||||
| 			@Override | ||||
| 			public FileModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public FileModel record2Model(ResultSet rs) { | ||||
| 		FileModel fileModel = new FileModel(); | ||||
| 		try { | ||||
| 			fileModel.setCardId(rs.getString(FileModel.CARDID)); | ||||
| 			fileModel.setCreateTime(rs.getTimestamp(FileModel.CREATETIME)); | ||||
| 			fileModel.setCreateUser(rs.getString(FileModel.CREATEUSER)); | ||||
| 			fileModel.setFileName(rs.getString(FileModel.FILENAME)); | ||||
| 			fileModel.setFileSize(rs.getLong(FileModel.FILESIZE)); | ||||
| 			fileModel.setFileState(rs.getInt(FileModel.FILESTATE)); | ||||
| 			fileModel.setFileVer(rs.getString(FileModel.FILEVER)); | ||||
| 			fileModel.setId(rs.getString(FileModel.ID)); | ||||
| 			fileModel.setIsFullsearch(rs.getInt(FileModel.ISFULLSEARCH)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return fileModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,144 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.HotspotCache; | ||||
| import com.actionsoft.apps.kms.model.HotspotModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 知识地图 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class HotspotDao extends DaoObject<HotspotModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(HotspotModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getObjectId()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(HotspotModel.ID, model.getId()); | ||||
| 		paraMap.put(HotspotModel.HOTSPOTDEFID, model.getHotspotDefId()); | ||||
| 		if (model.getDimensionId() == null) { | ||||
| 			paraMap.put(HotspotModel.DIMENSIONID, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(HotspotModel.DIMENSIONID, model.getDimensionId()); | ||||
| 		} | ||||
| 
 | ||||
| 		paraMap.put(HotspotModel.SHAPEID, model.getShapeId()); | ||||
| 		paraMap.put(HotspotModel.BINDTYPE, model.getBindType()); | ||||
| 		if (model.getLinkURL() == null) { | ||||
| 			paraMap.put(HotspotModel.LINKURL, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(HotspotModel.LINKURL, model.getLinkURL()); | ||||
| 		} | ||||
| 		if (model.getTarget() == null) { | ||||
| 			paraMap.put(HotspotModel.TARGET, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(HotspotModel.TARGET, model.getTarget()); | ||||
| 		} | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			HotspotCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(HotspotModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(HotspotModel.HOTSPOTDEFID, model.getHotspotDefId()); | ||||
| 		if (model.getDimensionId() == null) { | ||||
| 			paraMap.put(HotspotModel.DIMENSIONID, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(HotspotModel.DIMENSIONID, model.getDimensionId()); | ||||
| 		} | ||||
| 		paraMap.put(HotspotModel.SHAPEID, model.getShapeId()); | ||||
| 		paraMap.put(HotspotModel.BINDTYPE, model.getBindType()); | ||||
| 		if (model.getLinkURL() == null) { | ||||
| 			paraMap.put(HotspotModel.LINKURL, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(HotspotModel.LINKURL, model.getLinkURL()); | ||||
| 		} | ||||
| 		if (model.getTarget() == null) { | ||||
| 			paraMap.put(HotspotModel.TARGET, SQLNullValue.newInstance(Types.VARCHAR)); | ||||
| 		} else { | ||||
| 			paraMap.put(HotspotModel.TARGET, model.getTarget()); | ||||
| 		} | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			HotspotCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			HotspotCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 
 | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			HotspotCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_HOTSPOT; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<HotspotModel> rowMapper() { | ||||
| 		return new RowMapper<HotspotModel>() { | ||||
| 			@Override | ||||
| 			public HotspotModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public HotspotModel record2Model(ResultSet rs) { | ||||
| 		HotspotModel hotspotModel = new HotspotModel(); | ||||
| 		try { | ||||
| 			hotspotModel.setDimensionId(rs.getString(HotspotModel.DIMENSIONID)); | ||||
| 			hotspotModel.setShapeId(rs.getString(HotspotModel.SHAPEID)); | ||||
| 			hotspotModel.setHotspotDefId(rs.getString(HotspotModel.HOTSPOTDEFID)); | ||||
| 			hotspotModel.setId(rs.getString(HotspotModel.ID)); | ||||
| 			hotspotModel.setBindType(rs.getInt(HotspotModel.BINDTYPE)); | ||||
| 			hotspotModel.setLinkURL(rs.getString(HotspotModel.LINKURL)); | ||||
| 			hotspotModel.setTarget(rs.getString(hotspotModel.TARGET)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return hotspotModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,99 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.model.HotspotDefModel; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 知识地图定义 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class HotspotDefDao extends DaoObject<HotspotDefModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(HotspotDefModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(HotspotDefModel.ID, model.getId()); | ||||
| 		paraMap.put(HotspotDefModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(HotspotDefModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(HotspotDefModel.HOTSPOTNAME, model.getHotspotName()); | ||||
| 		paraMap.put(HotspotDefModel.HOTSPOTMETAID, model.getHotspotMetaId()); | ||||
| 		paraMap.put(HotspotDefModel.MEMO, model.getMemo()); | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(HotspotDefModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(HotspotDefModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(HotspotDefModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(HotspotDefModel.HOTSPOTNAME, model.getHotspotName()); | ||||
| 		paraMap.put(HotspotDefModel.HOTSPOTMETAID, model.getHotspotMetaId()); | ||||
| 		paraMap.put(HotspotDefModel.MEMO, model.getMemo()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_HOTSPOT_DEF; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<HotspotDefModel> rowMapper() { | ||||
| 		return new RowMapper<HotspotDefModel>() { | ||||
| 			@Override | ||||
| 			public HotspotDefModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public HotspotDefModel record2Model(ResultSet rs) { | ||||
| 		HotspotDefModel hotspotDefModel = new HotspotDefModel(); | ||||
| 		try { | ||||
| 			hotspotDefModel.setCreateTime(rs.getTimestamp(HotspotDefModel.CREATETIME)); | ||||
| 			hotspotDefModel.setId(rs.getString(HotspotDefModel.ID)); | ||||
| 			hotspotDefModel.setCreateUser(rs.getString(HotspotDefModel.CREATEUSER)); | ||||
| 			hotspotDefModel.setHotspotName(rs.getString(HotspotDefModel.HOTSPOTNAME)); | ||||
| 			hotspotDefModel.setHotspotMetaId(rs.getString(HotspotDefModel.HOTSPOTMETAID)); | ||||
| 			hotspotDefModel.setMemo(rs.getString(HotspotDefModel.MEMO)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return hotspotDefModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,107 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.model.LogModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 日志 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class LogDao extends DaoObject<LogModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(LogModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(LogModel.ID, model.getId()); | ||||
| 		paraMap.put(LogModel.ACCESSTIME, model.getAccessTime()); | ||||
| 		paraMap.put(LogModel.ACCESSUSER, model.getAccessUser()); | ||||
| 		paraMap.put(LogModel.CARDID, model.getCardId()); | ||||
| 
 | ||||
| 		if (model.getFileId() == null) { | ||||
| 			SQLNullValue fileIdNull = SQLNullValue.newInstance(Types.VARCHAR); | ||||
| 			paraMap.put(LogModel.FILEID, fileIdNull); | ||||
| 		} else { | ||||
| 			paraMap.put(LogModel.FILEID, model.getFileId()); | ||||
| 		} | ||||
| 		paraMap.put(LogModel.IPADDRESS, model.getIpAddress()); | ||||
| 		paraMap.put(LogModel.LOGTYPE, model.getLogType()); | ||||
| 		paraMap.put(LogModel.LOGINFO, model.getLogInfo()); | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(LogModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(LogModel.ACCESSTIME, model.getAccessTime()); | ||||
| 		paraMap.put(LogModel.ACCESSUSER, model.getAccessUser()); | ||||
| 		paraMap.put(LogModel.CARDID, model.getCardId()); | ||||
| 		if (model.getFileId() == null) { | ||||
| 			SQLNullValue fileIdNull = SQLNullValue.newInstance(Types.VARCHAR); | ||||
| 			paraMap.put(LogModel.FILEID, fileIdNull); | ||||
| 		} else { | ||||
| 			paraMap.put(LogModel.FILEID, model.getFileId()); | ||||
| 		} | ||||
| 		paraMap.put(LogModel.IPADDRESS, model.getIpAddress()); | ||||
| 		paraMap.put(LogModel.LOGTYPE, model.getLogType()); | ||||
| 		paraMap.put(LogModel.LOGINFO, model.getLogInfo()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_LOG; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<LogModel> rowMapper() { | ||||
| 		return new RowMapper<LogModel>() { | ||||
| 			@Override | ||||
| 			public LogModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public LogModel record2Model(ResultSet rs) { | ||||
| 		LogModel logModel = new LogModel(); | ||||
| 		try { | ||||
| 			logModel.setAccessTime(rs.getTimestamp(LogModel.ACCESSTIME)); | ||||
| 			logModel.setAccessUser(rs.getString(LogModel.ACCESSUSER)); | ||||
| 			logModel.setCardId(rs.getString(LogModel.CARDID)); | ||||
| 			logModel.setFileId(rs.getString(LogModel.FILEID)); | ||||
| 			logModel.setId(rs.getString(LogModel.ID)); | ||||
| 			logModel.setIpAddress(rs.getString(LogModel.IPADDRESS)); | ||||
| 			logModel.setLogType(rs.getInt(LogModel.LOGTYPE)); | ||||
| 			logModel.setLogInfo(rs.getString(LogModel.LOGINFO)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return logModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,107 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.MetaAttrCache; | ||||
| import com.actionsoft.apps.kms.model.MetaAttrModel; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据-属性 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaAttrDao extends DaoObject<MetaAttrModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(MetaAttrModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(MetaAttrModel.ID, model.getId()); | ||||
| 		paraMap.put(MetaAttrModel.ATTRTITLE, model.getAttrTitle()); | ||||
| 		paraMap.put(MetaAttrModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(MetaAttrModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(MetaAttrModel.SCHEMAID, model.getSchemaId()); | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			MetaAttrCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(MetaAttrModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(MetaAttrModel.ATTRTITLE, model.getAttrTitle()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			MetaAttrModel metaAttrModel = MetaAttrCache.getCache().get(model.getId()); | ||||
| 			metaAttrModel.setAttrTitle(model.getAttrTitle()); | ||||
| 			MetaAttrCache.getCache().put(model.getId(), metaAttrModel); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			MetaAttrCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			MetaAttrCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_META_ATTR; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<MetaAttrModel> rowMapper() { | ||||
| 		return new RowMapper<MetaAttrModel>() { | ||||
| 			@Override | ||||
| 			public MetaAttrModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public MetaAttrModel record2Model(ResultSet rs) { | ||||
| 		MetaAttrModel metaAttrModel = new MetaAttrModel(); | ||||
| 		try { | ||||
| 			metaAttrModel.setAttrTitle(rs.getString(MetaAttrModel.ATTRTITLE)); | ||||
| 			metaAttrModel.setCreateTime(rs.getTimestamp(MetaAttrModel.CREATETIME)); | ||||
| 			metaAttrModel.setCreateUser(rs.getString(MetaAttrModel.CREATEUSER)); | ||||
| 			metaAttrModel.setId(rs.getString(MetaAttrModel.ID)); | ||||
| 			metaAttrModel.setSchemaId(rs.getString(MetaAttrModel.SCHEMAID)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return metaAttrModel; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,116 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.MetaDataCache; | ||||
| import com.actionsoft.apps.kms.model.MetaDataModel; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据-数据 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaDataDao extends DaoObject<MetaDataModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(MetaDataModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(MetaDataModel.ID, model.getId()); | ||||
| 		paraMap.put(MetaDataModel.ATTRID, model.getAttrId()); | ||||
| 		paraMap.put(MetaDataModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(MetaDataModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(MetaDataModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(MetaDataModel.METATEXT, model.getMetaText()); | ||||
| 		paraMap.put(MetaDataModel.SCHEMAID, model.getSchemaId()); | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			MetaDataCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(MetaDataModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(MetaDataModel.ATTRID, model.getAttrId()); | ||||
| 		paraMap.put(MetaDataModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(MetaDataModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(MetaDataModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(MetaDataModel.METATEXT, model.getMetaText()); | ||||
| 		paraMap.put(MetaDataModel.SCHEMAID, model.getSchemaId()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			MetaDataCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 
 | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			MetaDataCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			MetaDataCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_META_DATA; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<MetaDataModel> rowMapper() { | ||||
| 		return new RowMapper<MetaDataModel>() { | ||||
| 			@Override | ||||
| 			public MetaDataModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public MetaDataModel record2Model(ResultSet rs) { | ||||
| 		MetaDataModel metaDataModel = new MetaDataModel(); | ||||
| 		try { | ||||
| 			metaDataModel.setAttrId(rs.getString(MetaDataModel.ATTRID)); | ||||
| 			metaDataModel.setCardId(rs.getString(MetaDataModel.CARDID)); | ||||
| 			metaDataModel.setCreateTime(rs.getTimestamp(MetaDataModel.CREATETIME)); | ||||
| 			metaDataModel.setCreateUser(rs.getString(MetaDataModel.CREATEUSER)); | ||||
| 			metaDataModel.setId(rs.getString(MetaDataModel.ID)); | ||||
| 			metaDataModel.setMetaText(rs.getString(MetaDataModel.METATEXT)); | ||||
| 			metaDataModel.setSchemaId(rs.getString(MetaDataModel.SCHEMAID)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return metaDataModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,134 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.MetaSchemaCache; | ||||
| import com.actionsoft.apps.kms.model.MetaSchemaModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaSchemaDao extends DaoObject<MetaSchemaModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(MetaSchemaModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(MetaSchemaModel.ID, model.getId()); | ||||
| 		paraMap.put(MetaSchemaModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(MetaSchemaModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(MetaSchemaModel.ISNULLABLE, model.getIsNullable()); | ||||
| 		paraMap.put(MetaSchemaModel.ISSEARCH, model.getIsSearch()); | ||||
| 		paraMap.put(MetaSchemaModel.SCHEMADESC, model.getSchemaDesc()); | ||||
| 		paraMap.put(MetaSchemaModel.SCHEMASHOWTYPE, model.getSchemaShowtype()); | ||||
| 		paraMap.put(MetaSchemaModel.SCHEMATITLE, model.getSchemaTitle()); | ||||
| 
 | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			paraMap.put(MetaSchemaModel.LASTUPDATE, SQLNullValue.newInstance(Types.DATE)); | ||||
| 		} else { | ||||
| 			paraMap.put(MetaSchemaModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 		paraMap.put(MetaSchemaModel.ORDERINDEX, model.getOrderIndex()); | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			MetaSchemaCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(MetaSchemaModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(MetaSchemaModel.ISNULLABLE, model.getIsNullable()); | ||||
| 		paraMap.put(MetaSchemaModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(MetaSchemaModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(MetaSchemaModel.ISSEARCH, model.getIsSearch()); | ||||
| 		paraMap.put(MetaSchemaModel.SCHEMADESC, model.getSchemaDesc()); | ||||
| 		paraMap.put(MetaSchemaModel.SCHEMASHOWTYPE, model.getSchemaShowtype()); | ||||
| 		paraMap.put(MetaSchemaModel.SCHEMATITLE, model.getSchemaTitle()); | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			paraMap.put(MetaSchemaModel.LASTUPDATE, SQLNullValue.newInstance(Types.DATE)); | ||||
| 		} else { | ||||
| 			paraMap.put(MetaSchemaModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 		paraMap.put(MetaSchemaModel.ORDERINDEX, model.getOrderIndex()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			MetaSchemaCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			MetaSchemaCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			MetaSchemaCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_META_SCHEMA; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<MetaSchemaModel> rowMapper() { | ||||
| 		return new RowMapper<MetaSchemaModel>() { | ||||
| 			@Override | ||||
| 			public MetaSchemaModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public MetaSchemaModel record2Model(ResultSet rs) { | ||||
| 		MetaSchemaModel schemaModel = new MetaSchemaModel(); | ||||
| 		try { | ||||
| 			schemaModel.setCreateTime(rs.getTimestamp(MetaSchemaModel.CREATETIME)); | ||||
| 			schemaModel.setCreateUser(rs.getString(MetaSchemaModel.CREATEUSER)); | ||||
| 			schemaModel.setId(rs.getString(MetaSchemaModel.ID)); | ||||
| 			schemaModel.setIsNullable(rs.getInt(MetaSchemaModel.ISNULLABLE)); | ||||
| 			schemaModel.setIsSearch(rs.getInt(MetaSchemaModel.ISSEARCH)); | ||||
| 			schemaModel.setLastUpdate(rs.getTimestamp(MetaSchemaModel.LASTUPDATE)); | ||||
| 			schemaModel.setSchemaDesc(rs.getString(MetaSchemaModel.SCHEMADESC)); | ||||
| 			schemaModel.setSchemaShowtype(rs.getInt(MetaSchemaModel.SCHEMASHOWTYPE)); | ||||
| 			schemaModel.setSchemaTitle(rs.getString(MetaSchemaModel.SCHEMATITLE)); | ||||
| 			schemaModel.setOrderIndex(rs.getInt(MetaSchemaModel.ORDERINDEX)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return schemaModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,107 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.OptCache; | ||||
| import com.actionsoft.apps.kms.model.OptModel; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| public class OptDao extends DaoObject<OptModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(OptModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(OptModel.ID, model.getId()); | ||||
| 		paraMap.put(OptModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(OptModel.OPTCONTENT, model.getOptContent()); | ||||
| 		paraMap.put(OptModel.OPTTIME, model.getOptTime()); | ||||
| 		paraMap.put(OptModel.OPTUSER, model.getOptUser()); | ||||
| 		paraMap.put(OptModel.OPTTYPE, model.getOptType()); | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) {// 更新cache | ||||
| 			OptCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(OptModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 
 | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(OptModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(OptModel.OPTCONTENT, model.getOptContent()); | ||||
| 		paraMap.put(OptModel.OPTTIME, model.getOptTime()); | ||||
| 		paraMap.put(OptModel.OPTUSER, model.getOptUser()); | ||||
| 		paraMap.put(OptModel.OPTTYPE, model.getOptType()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) {// 更新cache | ||||
| 			OptCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			OptCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			OptCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_OPT; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<OptModel> rowMapper() { | ||||
| 		return new RowMapper<OptModel>() { | ||||
| 			@Override | ||||
| 			public OptModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public OptModel record2Model(ResultSet rs) { | ||||
| 		try { | ||||
| 			OptModel optModel = new OptModel(); | ||||
| 			optModel.setCardId(rs.getString(OptModel.CARDID)); | ||||
| 			optModel.setId(rs.getString(OptModel.ID)); | ||||
| 			optModel.setOptContent(rs.getString(OptModel.OPTCONTENT)); | ||||
| 			optModel.setOptTime(rs.getTimestamp(OptModel.OPTTIME)); | ||||
| 			optModel.setOptUser(rs.getString(OptModel.OPTUSER)); | ||||
| 			optModel.setOptType(rs.getInt(OptModel.OPTTYPE)); | ||||
| 			return optModel; | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,144 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.model.PublishModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 发布 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class PublishDao extends DaoObject<PublishModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(PublishModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(PublishModel.ID, model.getId()); | ||||
| 		paraMap.put(PublishModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(PublishModel.DIMENSIONID, model.getDimensionId()); | ||||
| 		paraMap.put(PublishModel.MEMO, model.getMemo()); | ||||
| 
 | ||||
| 		paraMap.put(PublishModel.PUBLISHTIME, model.getPublishTime()); | ||||
| 		paraMap.put(PublishModel.PUBLISHUSER, model.getPublishUser()); | ||||
| 		paraMap.put(PublishModel.TAG, model.getTag()); | ||||
| 
 | ||||
| 		if (model.getExamineInfo() == null) { | ||||
| 			SQLNullValue examineNull = SQLNullValue.newInstance(Types.VARCHAR); | ||||
| 			paraMap.put(PublishModel.EXAMINEINFO, examineNull); | ||||
| 		} else { | ||||
| 			paraMap.put(PublishModel.EXAMINEINFO, model.getExamineInfo()); | ||||
| 		} | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			PublishCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(PublishModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(PublishModel.CARDID, model.getCardId()); | ||||
| 		paraMap.put(PublishModel.DIMENSIONID, model.getDimensionId()); | ||||
| 		paraMap.put(PublishModel.MEMO, model.getMemo()); | ||||
| 
 | ||||
| 		paraMap.put(PublishModel.PUBLISHTIME, model.getPublishTime()); | ||||
| 		paraMap.put(PublishModel.PUBLISHUSER, model.getPublishUser()); | ||||
| 		paraMap.put(PublishModel.TAG, model.getTag()); | ||||
| 		if (model.getExamineInfo() == null) { | ||||
| 			SQLNullValue examineNull = SQLNullValue.newInstance(Types.VARCHAR); | ||||
| 			paraMap.put(PublishModel.EXAMINEINFO, examineNull); | ||||
| 		} else { | ||||
| 			paraMap.put(PublishModel.EXAMINEINFO, model.getExamineInfo()); | ||||
| 		} | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			PublishCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			PublishCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			// 更新缓存 | ||||
| 			PublishCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_PUBLISH; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<PublishModel> rowMapper() { | ||||
| 		return new RowMapper<PublishModel>() { | ||||
| 			@Override | ||||
| 			public PublishModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public PublishModel record2Model(ResultSet rs) { | ||||
| 		PublishModel publishModel = new PublishModel(); | ||||
| 		try { | ||||
| 			publishModel.setCardId(rs.getString(PublishModel.CARDID)); | ||||
| 			// 处理CardModel | ||||
| 			publishModel.setCardModel(CardCache.getCache().get(publishModel.getCardId())); | ||||
| 
 | ||||
| 			publishModel.setDimensionId(rs.getString(PublishModel.DIMENSIONID)); | ||||
| 			// 处理DimensionModel | ||||
| 			publishModel.setDimensionModel(DimensionCache.getCache().get(publishModel.getDimensionId())); | ||||
| 
 | ||||
| 			publishModel.setId(rs.getString(PublishModel.ID)); | ||||
| 			publishModel.setMemo(rs.getString(PublishModel.MEMO)); | ||||
| 			publishModel.setPublishTime(rs.getTimestamp(PublishModel.PUBLISHTIME)); | ||||
| 			publishModel.setPublishUser(rs.getString(PublishModel.PUBLISHUSER)); | ||||
| 			publishModel.setTag(rs.getString(PublishModel.TAG)); | ||||
| 			publishModel.setExamineInfo(rs.getString(PublishModel.EXAMINEINFO)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return publishModel; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,106 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.sql.Types; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.model.SchemaModel; | ||||
| import com.actionsoft.bpms.bo.engine.SQLNullValue; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class SchemaDao extends DaoObject<SchemaModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(SchemaModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(SchemaModel.ID, model.getId()); | ||||
| 		paraMap.put(SchemaModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(SchemaModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(SchemaModel.ISNULLABLE, model.getIsNullable()); | ||||
| 		paraMap.put(SchemaModel.ISSEARCH, model.getIsSearch()); | ||||
| 		paraMap.put(SchemaModel.SCHEMADESC, model.getSchemaDesc()); | ||||
| 		paraMap.put(SchemaModel.SCHEMASHOWTYPE, model.getSchemaShowtype()); | ||||
| 		paraMap.put(SchemaModel.SCHEMATITLE, model.getSchemaTitle()); | ||||
| 
 | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			paraMap.put(SchemaModel.LASTUPDATE, SQLNullValue.newInstance(Types.DATE)); | ||||
| 		} else { | ||||
| 			paraMap.put(SchemaModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(SchemaModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(SchemaModel.ISNULLABLE, model.getIsNullable()); | ||||
| 		paraMap.put(SchemaModel.ISSEARCH, model.getIsSearch()); | ||||
| 		paraMap.put(SchemaModel.SCHEMADESC, model.getSchemaDesc()); | ||||
| 		paraMap.put(SchemaModel.SCHEMASHOWTYPE, model.getSchemaShowtype()); | ||||
| 		paraMap.put(SchemaModel.SCHEMATITLE, model.getSchemaTitle()); | ||||
| 		if (model.getLastUpdate() == null) { | ||||
| 			paraMap.put(SchemaModel.LASTUPDATE, SQLNullValue.newInstance(Types.DATE)); | ||||
| 		} else { | ||||
| 			paraMap.put(SchemaModel.LASTUPDATE, model.getLastUpdate()); | ||||
| 		} | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_META_SCHEMA; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<SchemaModel> rowMapper() { | ||||
| 		return new RowMapper<SchemaModel>() { | ||||
| 			@Override | ||||
| 			public SchemaModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public SchemaModel record2Model(ResultSet rs) { | ||||
| 		SchemaModel schemaModel = new SchemaModel(); | ||||
| 		try { | ||||
| 			schemaModel.setCreateTime(rs.getTimestamp(SchemaModel.CREATETIME)); | ||||
| 			schemaModel.setCreateUser(rs.getString(SchemaModel.CREATEUSER)); | ||||
| 			schemaModel.setId(rs.getString(SchemaModel.ID)); | ||||
| 			schemaModel.setIsNullable(rs.getInt(SchemaModel.ISNULLABLE)); | ||||
| 			schemaModel.setIsSearch(rs.getInt(SchemaModel.ISSEARCH)); | ||||
| 			schemaModel.setLastUpdate(rs.getTimestamp(SchemaModel.LASTUPDATE)); | ||||
| 			schemaModel.setSchemaDesc(rs.getString(SchemaModel.SCHEMADESC)); | ||||
| 			schemaModel.setSchemaShowtype(rs.getInt(SchemaModel.SCHEMASHOWTYPE)); | ||||
| 			schemaModel.setSchemaTitle(rs.getString(SchemaModel.SCHEMATITLE)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return schemaModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,109 @@ | ||||
| package com.actionsoft.apps.kms.dao; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| import java.sql.ResultSet; | ||||
| import java.sql.SQLException; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.VersionCache; | ||||
| import com.actionsoft.apps.kms.model.VersionModel; | ||||
| import com.actionsoft.bpms.commons.database.RowMapper; | ||||
| import com.actionsoft.bpms.commons.mvc.dao.DaoObject; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.exception.AWSDataAccessException; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| /** | ||||
|  * 版本号 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class VersionDao extends DaoObject<VersionModel> { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int insert(VersionModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			model.setId(UUIDGener.getUUID()); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(VersionModel.ID, model.getId()); | ||||
| 		paraMap.put(VersionModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(VersionModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(VersionModel.VERSIONNO, model.getVersionNo()); | ||||
| 		paraMap.put(VersionModel.MEMO, model.getMemo()); | ||||
| 
 | ||||
| 		int result = DBSql.update(DBSql.getInsertStatement(entityName(), paraMap), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			VersionCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public int update(VersionModel model) throws AWSDataAccessException { | ||||
| 		if (UtilString.isEmpty(model.getId())) { | ||||
| 			throw new AWSDataAccessException("Method getId() Does Not Allow Empty"); | ||||
| 		} | ||||
| 		Map<String, Object> paraMap = new HashMap<>(); | ||||
| 		paraMap.put(VersionModel.CREATETIME, model.getCreateTime()); | ||||
| 		paraMap.put(VersionModel.CREATEUSER, model.getCreateUser()); | ||||
| 		paraMap.put(VersionModel.VERSIONNO, model.getVersionNo()); | ||||
| 		paraMap.put(VersionModel.MEMO, model.getMemo()); | ||||
| 		int result = update(model.getId(), paraMap); | ||||
| 		if (result == 1) { | ||||
| 			VersionCache.getCache().put(model.getId(), model); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(id); | ||||
| 		if (result == 1) { | ||||
| 			VersionCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	public int delete(Connection conn, String id) throws AWSDataAccessException { | ||||
| 		int result = super.delete(conn, id); | ||||
| 		if (result == 1) { | ||||
| 			VersionCache.getCache().remove(id); | ||||
| 		} | ||||
| 		return result; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String entityName() { | ||||
| 		return KMSConstant.ENTITY_NAME_VERSION; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public RowMapper<VersionModel> rowMapper() { | ||||
| 		return new RowMapper<VersionModel>() { | ||||
| 			@Override | ||||
| 			public VersionModel mapRow(ResultSet rs, int rowNum) throws SQLException { | ||||
| 				return record2Model(rs); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
| 
 | ||||
| 	public VersionModel record2Model(ResultSet rs) { | ||||
| 		VersionModel versionModel = new VersionModel(); | ||||
| 		try { | ||||
| 			versionModel.setCreateTime(rs.getTimestamp(VersionModel.CREATETIME)); | ||||
| 			versionModel.setId(rs.getString(VersionModel.ID)); | ||||
| 			versionModel.setCreateUser(rs.getString(VersionModel.CREATEUSER)); | ||||
| 			versionModel.setVersionNo(rs.getString(VersionModel.VERSIONNO)); | ||||
| 			versionModel.setMemo(rs.getString(VersionModel.MEMO)); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 			throw new AWSException(e); | ||||
| 		} | ||||
| 		return versionModel; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,8 @@ | ||||
| package com.actionsoft.apps.kms.dc; | ||||
| 
 | ||||
| import com.actionsoft.bpms.server.fs.AbstFileProcessor; | ||||
| import com.actionsoft.bpms.server.fs.FileProcessorListener; | ||||
| 
 | ||||
| public class DocCardContentProcessor extends AbstFileProcessor implements FileProcessorListener { | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,152 @@ | ||||
| package com.actionsoft.apps.kms.dc; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.dao.FileDao; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.resource.AppContext; | ||||
| import com.actionsoft.bpms.commons.database.LocalTxManager; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.org.cache.UserCache; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.fs.AbstFileProcessor; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.FileProcessorListener; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCMessage; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UUIDGener; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.actionsoft.sdk.local.api.AppAPI; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| import java.util.HashMap; | ||||
| import java.util.Iterator; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| /** | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DocFileProcessor extends AbstFileProcessor implements FileProcessorListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean uploadReady(Map<String, Object> param) throws Exception { | ||||
| 		DCContext dcContext = ((DCContext) param.get("DCContext")); | ||||
| 		// 根据版本重命名(加上版本号信息,防止文件名冲突) | ||||
| 		String cardId = dcContext.getFileValue(); | ||||
| 		String fileName = dcContext.getFileName(); | ||||
| 		param.put("originalFileName", fileName); | ||||
| 		//判断是否有文件版本,存在则使用原版本(文件移交操作) | ||||
| 		Map<String, Object> extParams = dcContext.getExtParams(); | ||||
| 		String fileVersion = ""; | ||||
| 		if (extParams.containsKey("transferFileVersion")) { | ||||
| 			fileVersion = extParams.get("transferFileVersion").toString(); | ||||
| 		} else { | ||||
| 			fileVersion = KMSUtil.getNextFileVersion(cardId, fileName); | ||||
| 		} | ||||
| 		param.put("fileVersion", fileVersion); | ||||
| 		dcContext.setFileName(KMSUtil.getFileNameOfVersion(fileName, fileVersion)); | ||||
| 
 | ||||
| 		return super.uploadReady(param); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * 将文件信息插入数据库 | ||||
| 	 */ | ||||
| 	@Override | ||||
| 	public void uploadSuccess(Map<String, Object> param) { | ||||
| 		try { | ||||
| 			DCContext dcContext = (DCContext) param.get("DCContext"); | ||||
| 
 | ||||
| 			LocalTxManager.getInstance().begin(); | ||||
| 
 | ||||
| 			FileModel fileModel = new FileModel(); | ||||
| 			fileModel.setCardId(dcContext.getFileValue()); | ||||
| 			fileModel.setCreateTime(new Timestamp(System.currentTimeMillis())); | ||||
| 			fileModel.setCreateUser(dcContext.getSession().getUID()); | ||||
| 			fileModel.setFileName((String) param.get("originalFileName")); | ||||
| 			fileModel.setFileSize(Long.parseLong(dcContext.getFileLength())); | ||||
| 			String fileId = UUIDGener.getObjectId(); | ||||
| 			fileModel.setId(fileId); | ||||
| 
 | ||||
| 			fileModel.setFileVer((String) param.get("fileVersion")); | ||||
| 			fileModel.setFileState(1); | ||||
| 
 | ||||
| 			// 更新其他版本为老版本 | ||||
| 			int result = DBSql.update("UPDATE " + KMSConstant.ENTITY_NAME_FILE + " SET " + FileModel.FILESTATE + " = 0 WHERE " + FileModel.CARDID + " = ? AND " + FileModel.FILENAME + " = ? AND " + FileModel.FILESTATE + " = 1 AND " + FileModel.ID + "<> ?", new Object[] { dcContext.getFileValue(), (String) param.get("originalFileName"), fileId }); | ||||
| 			// 新建file模型 | ||||
| 			FileDao fileDao = new FileDao(); | ||||
| 			fileDao.insert(fileModel); | ||||
| 
 | ||||
| 			LocalTxManager.getInstance().commit(); | ||||
| 
 | ||||
| 			if (result != 0) { | ||||
| 				// 更新缓存 | ||||
| 				FileCache fileCache = FileCache.getCache(); | ||||
| 				Iterator<FileModel> fileIterator = fileCache.iterator(); | ||||
| 				while (fileIterator.hasNext()) { | ||||
| 					FileModel fileModel2 = fileIterator.next(); | ||||
| 					if (dcContext.getFileValue().equals(fileModel2.getCardId()) && fileModel2.getFileName().equals(param.get("originalFileName")) && fileModel2.getFileState() == 1 && !fileModel2.getId().equals(fileId)) { | ||||
| 						fileModel2.setFileState(0); | ||||
| 						fileCache.put(fileModel2.getId(), fileModel2); | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			dcContext.setDCMessage(DCMessage.OK, ""); | ||||
| 			dcContext.setFileNameShow((String) param.get("originalFileName")); | ||||
| 			dcContext.getDCMessage().addAttr("fileDownloadURL", dcContext.getDownloadURL()); | ||||
| 			dcContext.getDCMessage().addAttr("fileId", fileModel.getId()); | ||||
| 			dcContext.getDCMessage().addAttr("fileVer", fileModel.getFileVer()); | ||||
| 			dcContext.getDCMessage().addAttr("createUsername", UserCache.getCache().get(dcContext.getSession().getUID()).getUserName()); | ||||
| 			dcContext.getDCMessage().addAttr("createTime", UtilDate.datetimeFormat(fileModel.getCreateTime(), "yyyy-MM-dd HH:mm")); | ||||
| 			dcContext.getDCMessage().addAttr("fileSuffixIcon", KMSUtil.getFileIconName((String) param.get("originalFileName"))); | ||||
| 			dcContext.getDCMessage().addAttr("fileCreateUserPhoto", SDK.getPortalAPI().getUserPhoto(dcContext.getSession(), fileModel.getCreateUser())); | ||||
| 			dcContext.getDCMessage().addAttr("fileCreateUser", fileModel.getCreateUser()); | ||||
| 			//调用转换服务.在预览之前提前进行转换 | ||||
| 			new Thread(new Runnable() { | ||||
| 				@Override | ||||
| 				public void run() { | ||||
| 					fileCovert(dcContext.getSession(), dcContext, "true"); | ||||
| 					fileCovert(dcContext.getSession(), dcContext, "false"); | ||||
| 				} | ||||
| 			}).start(); | ||||
| 		} catch (Exception e) { | ||||
| 			LocalTxManager.getInstance().rollback(); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public static ResponseObject fileCovert(UserContext me, DCContext sourceDc, String isCopy) { | ||||
| 		ResponseObject ro = ResponseObject.newOkResponse(); | ||||
| 		AppAPI appAPI = SDK.getAppAPI(); | ||||
| 		AppContext onlinedocApp = SDK.getAppAPI().getAppContext("com.actionsoft.apps.addons.wpsonline"); | ||||
| 		if (onlinedocApp != null && SDK.getAppAPI().isActive(onlinedocApp.getId())) { | ||||
| 			String sourceAppId = KMSConstant.APP_ID; | ||||
| 			// 服务地址 | ||||
| 			String aslp = "aslp://com.actionsoft.apps.addons.wpsonline/filePreviewUrl"; | ||||
| 			Map<String, Object> params = new HashMap<String, Object>(); | ||||
| 			try { | ||||
| 				params.put("sid", me.getSessionId()); | ||||
| 				//文件DC | ||||
| 				params.put("sourceDc", sourceDc); | ||||
| 				//文件是否允许复制 | ||||
| 				params.put("isCopy", isCopy); | ||||
| 				params.put("isPDFCovertPNG", "0"); | ||||
| 				ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); | ||||
| 			} catch (Exception e) { | ||||
| 				e.printStackTrace(); | ||||
| 				ro.err(e.getMessage()); | ||||
| 			} | ||||
| 		} | ||||
| 		return ro; | ||||
| 	} | ||||
| 
 | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean downloadValidate(Map<String, Object> param) { | ||||
| 		DCContext context = (DCContext) param.get("DCContext"); | ||||
| 		System.out.println("下载校验--" + context.getPath() + context.getFileName()); | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,72 @@ | ||||
| package com.actionsoft.apps.kms.dc; | ||||
| 
 | ||||
| import java.nio.charset.StandardCharsets; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.dao.HotspotDefDao; | ||||
| import com.actionsoft.apps.kms.model.HotspotDefModel; | ||||
| import com.actionsoft.apps.processon.posreader.PosReader; | ||||
| import com.actionsoft.apps.processon.posreader.model.Document; | ||||
| import com.actionsoft.bpms.server.fs.AbstFileProcessor; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.FileProcessorListener; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCMessage; | ||||
| import com.actionsoft.bpms.util.UtilFile; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| 
 | ||||
| public class HotspotFileProcessor extends AbstFileProcessor implements FileProcessorListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean uploadReady(Map<String, Object> param) { | ||||
| 		DCContext dcContext = (DCContext) param.get("DCContext"); | ||||
| 		String fileName = dcContext.getFileName(); | ||||
| 		HotspotDefDao hotspotDefDao = new HotspotDefDao(); | ||||
| 		List<HotspotDefModel> hotspotDefModels = hotspotDefDao.query(HotspotDefModel.HOTSPOTNAME + " = ?", new Object[] { fileName }).list(); | ||||
| 		if (hotspotDefModels != null && hotspotDefModels.size() > 0) { | ||||
| 			// 返回状态 | ||||
| 			dcContext.getDCMessage(); | ||||
| 			dcContext.setDCMessage(DCMessage.ERROR, "不能上传重名文件"); | ||||
| 			return false; | ||||
| 		} | ||||
| 		return true; | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void uploadSuccess(Map<String, Object> param) { | ||||
| 		super.uploadSuccess(param); | ||||
| 
 | ||||
| 		// 判断是否已经上传过该文件(根据文件内容的meta的id判断) | ||||
| 		DCContext dcContext = (DCContext) param.get("DCContext"); | ||||
| 		UtilFile posFile = new UtilFile(dcContext.getFilePath()); | ||||
| 
 | ||||
| 		PosReader reader = new PosReader(); | ||||
| 		Document document = null; | ||||
| 		try { | ||||
| 			document = reader.read(posFile.readStr(StandardCharsets.UTF_8.name())); | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} | ||||
| 		if (document == null) { | ||||
| 			// 先删除文件再返回异常 | ||||
| 			dcContext.delete(); | ||||
| 			// 返回状态 | ||||
| 			dcContext.getDCMessage().addAttr("hotspotResult", "文件解析错误,请检查知识地图版本是否正确"); | ||||
| 			throw new AWSException("文件解析错误,请检查知识地图版本是否正确"); | ||||
| 		} | ||||
| 
 | ||||
| 		HotspotDefDao hotspotDefDao = new HotspotDefDao(); | ||||
| 		List<HotspotDefModel> hotspotDefModels = hotspotDefDao.query(HotspotDefModel.HOTSPOTMETAID + " = ?", new Object[] { document.getMeta().getId() }).list(); | ||||
| 		if (hotspotDefModels != null && hotspotDefModels.size() > 0) { | ||||
| 			// 先删除文件再返回异常 | ||||
| 			dcContext.delete(); | ||||
| 			// 返回状态 | ||||
| 			dcContext.getDCMessage().addAttr("hotspotResult", "不能上传重复文件(重命名文件视为一个文件)"); | ||||
| 			throw new AWSException("不能上传重复文件(重命名文件视为一个文件)"); | ||||
| 		} | ||||
| 		// 返回hotspotMetaId | ||||
| 		dcContext.getDCMessage().addAttr("hotspotMetaId", document.getMeta().getId()); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,8 @@ | ||||
| package com.actionsoft.apps.kms.dc; | ||||
| 
 | ||||
| import com.actionsoft.bpms.server.fs.AbstFileProcessor; | ||||
| import com.actionsoft.bpms.server.fs.FileProcessorListener; | ||||
| 
 | ||||
| public class OnlinedocFileProcessor extends AbstFileProcessor implements FileProcessorListener { | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,18 @@ | ||||
| package com.actionsoft.apps.kms.dc; | ||||
| 
 | ||||
| import com.actionsoft.bpms.server.fs.AbstFileProcessor; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.FileProcessorListener; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public class TmpFileProcessor extends AbstFileProcessor implements FileProcessorListener { | ||||
|     @Override | ||||
|     public boolean downloadValidate(Map<String, Object> param) { | ||||
|         DCContext context = (DCContext) param.get("DCContext"); | ||||
|         System.out.println("下载校验--" + context.getPath() + context.getFileName()); | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,29 @@ | ||||
| package com.actionsoft.apps.kms.event.borrow; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 借阅申请任务完成前事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ApplyBeforeComplete extends InterruptListener implements InterruptListenerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "作废")) { | ||||
| 			String processInstId = pec.getProcessInstance().getId(); | ||||
| 			// 更新bo状态为作废 | ||||
| 			String sqlBO = "UPDATE " + KMSConstant.BO_ENTITY_NAME_BORROW + " SET STATUS = '作废' WHERE BINDID = ?"; | ||||
| 			DBSql.update(sqlBO, new Object[] { processInstId }); | ||||
| 		} | ||||
| 
 | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,19 @@ | ||||
| package com.actionsoft.apps.kms.event.borrow; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| 
 | ||||
| /** | ||||
|  * 借阅申请表单加载后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ApplyFormAfterLoad extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		KMSUtil.commonFormAfterLoad(pec); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,23 @@ | ||||
| package com.actionsoft.apps.kms.event.borrow; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| 
 | ||||
| /*** | ||||
|  * 借阅审批任务创建后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingAfterCreate extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		// 修改状态为"审批中" | ||||
| 		String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_BORROW + " SET STATUS = '审批中' WHERE BINDID = ?"; | ||||
| 		DBSql.update(sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,30 @@ | ||||
| package com.actionsoft.apps.kms.event.borrow; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 借阅审批任务完成前事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingBeforeComplete extends InterruptListener implements InterruptListenerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		// 修改状态 | ||||
| 		if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "不同意")) { | ||||
| 			String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_BORROW + " SET STATUS = '不同意', READTIMES = 0 WHERE BINDID = ?"; | ||||
| 			DBSql.update(sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 		} else if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "同意")) { | ||||
| 			String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_BORROW + " SET STATUS = '同意', READTIMES = 0 WHERE BINDID = ?"; | ||||
| 			DBSql.update(sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 		} | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,32 @@ | ||||
| package com.actionsoft.apps.kms.event.borrow; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst; | ||||
| 
 | ||||
| /** | ||||
|  * 借阅审批表单加载后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingFormAfterLoad extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		// 查询文件列表 | ||||
| 		BO bo = (BO) pec.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); | ||||
| 		String cardId = bo.getString("CARDID"); | ||||
| 
 | ||||
| 		Map<String, Object> macroLibraries = pec.getParameterOfMap(ListenerConst.FORM_EVENT_PARAM_TAGS); | ||||
| 
 | ||||
| 		KMSUtil.commonFormAfterLoad(pec); | ||||
| 		KMSUtil.browseFormAfterLoad(pec); | ||||
| 		macroLibraries.put("CARDID", cardId); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,29 @@ | ||||
| package com.actionsoft.apps.kms.event.cancelpublish; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 取消发布申请任务完成前事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ApplyBeforeComplete extends InterruptListener implements InterruptListenerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "作废")) { | ||||
| 			String processInstId = pec.getProcessInstance().getId(); | ||||
| 			// 更新bo状态为作废 | ||||
| 			String sqlBO = "UPDATE " + KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH + " SET STATUS = '作废' WHERE BINDID = ?"; | ||||
| 			DBSql.update(sqlBO, new Object[] { processInstId }); | ||||
| 		} | ||||
| 
 | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,28 @@ | ||||
| package com.actionsoft.apps.kms.event.cancelpublish; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst; | ||||
| 
 | ||||
| /** | ||||
|  * 取消发布申请表单加载后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ApplyFormAfterLoad extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		KMSUtil.commonFormAfterLoad(pec); | ||||
| 		KMSUtil.browseFormAfterLoad(pec); | ||||
| 		Map<String, Object> macroLibraries = pec.getParameterOfMap(ListenerConst.FORM_EVENT_PARAM_TAGS); | ||||
| 		BO bo = (BO) pec.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); | ||||
| 		String cardId = bo.getString("CARDID"); | ||||
| 		macroLibraries.put("CARDID", cardId); | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,23 @@ | ||||
| package com.actionsoft.apps.kms.event.cancelpublish; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| 
 | ||||
| /** | ||||
|  * 取消发布流程任务创建后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingAfterCreate extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		// 修改状态为"审批中" | ||||
| 		String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH + " SET STATUS = '审批中' WHERE BINDID = ?"; | ||||
| 		DBSql.update(sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,71 @@ | ||||
| package com.actionsoft.apps.kms.event.cancelpublish; | ||||
| 
 | ||||
| import java.sql.Connection; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.apps.kms.service.PublishService; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface; | ||||
| import com.actionsoft.bpms.commons.database.LocalTxManager; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.exception.AWSException; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 取消发布审批任务完成前事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingBeforeComplete extends InterruptListener implements InterruptListenerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		// 修改状态 | ||||
| 		if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "同意")) { | ||||
| 			boolean isInTx = false;// 标识是否当前方法打开的事务 | ||||
| 			Connection conn = null; | ||||
| 			try { | ||||
| 				if (!LocalTxManager.getInstance().inTransaction()) { | ||||
| 					LocalTxManager.getInstance().begin(); | ||||
| 					isInTx = true; | ||||
| 				} | ||||
| 				conn = DBSql.open(); | ||||
| 				String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH + " SET STATUS = '同意' WHERE BINDID = ?"; | ||||
| 				DBSql.update(conn, sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 
 | ||||
| 				// 删除发布信息 | ||||
| 				String publishId = (String) SDK.getBOAPI().query(KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH).detailByBindId(pec.getProcessInstance().getId(), "PUBLISHID"); | ||||
| 				PublishService publishService = new PublishService(); | ||||
| 				boolean result = publishService.delete(conn, publishId); | ||||
| 				if (!result) { | ||||
| 					throw new AWSException("删除知识发布信息失败"); | ||||
| 				} else { | ||||
| 					// 判断并修改知识的发布状态 | ||||
| 					CardService cardService = new CardService(); | ||||
| 					String cardId = (String) SDK.getBOAPI().getByProcess(KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH, pec.getProcessInstance().getId(), "CARDID"); | ||||
| 					cardService.updateCardIsPublishedStatus(conn, cardId); | ||||
| 					// 判断并删除全文检索 | ||||
| 					publishService.deleteFullSearch(cardId); | ||||
| 				} | ||||
| 				if (isInTx) { | ||||
| 					LocalTxManager.getInstance().commit(); | ||||
| 				} | ||||
| 			} catch (Exception e) { | ||||
| 				if (isInTx) { | ||||
| 					LocalTxManager.getInstance().rollback(); | ||||
| 				} | ||||
| 				e.printStackTrace(); | ||||
| 				throw e; | ||||
| 			} finally { | ||||
| 				DBSql.close(conn); | ||||
| 			} | ||||
| 		} else if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "不同意")) { | ||||
| 			String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH + " SET STATUS = '不同意'  WHERE BINDID = ?"; | ||||
| 			DBSql.update(sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 		} | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,32 @@ | ||||
| package com.actionsoft.apps.kms.event.cancelpublish; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst; | ||||
| 
 | ||||
| /** | ||||
|  * 取消发布审批表单加载后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingFormAfterLoad extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		// 查询文件列表 | ||||
| 		BO bo = (BO) pec.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); | ||||
| 		String cardId = bo.getString("CARDID"); | ||||
| 
 | ||||
| 		Map<String, Object> macroLibraries = pec.getParameterOfMap(ListenerConst.FORM_EVENT_PARAM_TAGS); | ||||
| 
 | ||||
| 		KMSUtil.commonFormAfterLoad(pec); | ||||
| 		KMSUtil.browseFormAfterLoad(pec); | ||||
| 		macroLibraries.put("CARDID", cardId); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,55 @@ | ||||
| package com.actionsoft.apps.kms.event.publish; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.model.PublishModel; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| 
 | ||||
| /** | ||||
|  * 发布申请任务完成前事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ApplyBeforeComplete extends InterruptListener implements InterruptListenerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "作废")) { | ||||
| 			String processInstId = pec.getProcessInstance().getId(); | ||||
| 			// 更新bo状态为作废 | ||||
| 			String sqlBO = "UPDATE " + KMSConstant.BO_ENTITY_NAME_PUBLISH + " SET STATUS = '作废' WHERE BINDID = ?"; | ||||
| 			DBSql.update(sqlBO, new Object[] { processInstId }); | ||||
| 			// 删除临时publish信息 | ||||
| 			BO bo = SDK.getBOAPI().query(KMSConstant.BO_ENTITY_NAME_PUBLISH).detailByBindId(processInstId); | ||||
| 			String publishIds = bo.getString("PUBLISHIDS"); | ||||
| 			List<String> publishIdList = JSONArray.parseArray(publishIds, String.class); | ||||
| 
 | ||||
| 			String sql = "DELETE FROM " + KMSConstant.ENTITY_NAME_PUBLISH + " WHERE " + PublishModel.ID + " IN ("; | ||||
| 			List<String> params = new ArrayList<>(); | ||||
| 			for (String publishId : publishIdList) { | ||||
| 				sql += "?,"; | ||||
| 				params.add(publishId); | ||||
| 			} | ||||
| 			sql = sql.substring(0, sql.length() - 1); | ||||
| 			sql += ")"; | ||||
| 			DBSql.update(sql, params.toArray()); | ||||
| 
 | ||||
| 			// 更新缓存 | ||||
| 			for (String publishId : publishIdList) { | ||||
| 				PublishCache.getCache().remove(publishId); | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,50 @@ | ||||
| package com.actionsoft.apps.kms.event.publish; | ||||
| 
 | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * 发布申请表单加载后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ApplyFormAfterLoad extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		KMSUtil.commonFormAfterLoad(pec); | ||||
| 		KMSUtil.browseFormAfterLoad(pec); | ||||
| 		Map<String, Object> macroLibraries = pec.getParameterOfMap(ListenerConst.FORM_EVENT_PARAM_TAGS); | ||||
| 		BO bo = (BO) pec.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); | ||||
| 		if (bo != null) { | ||||
| 			String cardIds = bo.getString("CARDIDS"); | ||||
| 			if (UtilString.isNotEmpty(cardIds)) { | ||||
| 				List<String> cardIdList = JSONArray.parseArray(cardIds, String.class); | ||||
| 				JSONArray cardInfoJA = new JSONArray(); | ||||
| 				for (String cardId : cardIdList) { | ||||
| 					JSONObject cardInfoJO = new JSONObject(); | ||||
| 					cardInfoJO.put("cardId", cardId); | ||||
| 					CardModel cardModel = CardCache.getCache().get(cardId); | ||||
| 					cardInfoJO.put("cardName", cardModel == null ? "知识不存在" : cardModel.getCardName()); | ||||
| 
 | ||||
| 					cardInfoJA.add(cardInfoJO); | ||||
| 				} | ||||
| 				macroLibraries.put("cardInfoJA", cardInfoJA.toString()); | ||||
| 			} else { | ||||
| 				macroLibraries.put("cardInfoJA", ""); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,48 @@ | ||||
| package com.actionsoft.apps.kms.event.publish; | ||||
| 
 | ||||
| import java.util.Iterator; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.model.PublishModel; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * 发布审批任务创建后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingAfterCreate extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		String processInstId = pec.getProcessInstance().getId(); | ||||
| 		// 修改BO状态为"审批中" | ||||
| 		String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_PUBLISH + " SET STATUS = '审批中' WHERE BINDID = ?"; | ||||
| 		DBSql.update(sql, new Object[] { processInstId }); | ||||
| 		// 修改publish状态为审批中 | ||||
| 		JSONObject examineInfoJO1 = new JSONObject(); | ||||
| 		examineInfoJO1.put("processInstId", processInstId); | ||||
| 		examineInfoJO1.put("status", "申请中"); | ||||
| 		JSONObject examineInfoJO2 = new JSONObject(); | ||||
| 		examineInfoJO2.put("processInstId", processInstId); | ||||
| 		examineInfoJO2.put("status", "审批中"); | ||||
| 
 | ||||
| 		String tempPublishSql = "UPDATE " + KMSConstant.ENTITY_NAME_PUBLISH + " SET " + PublishModel.EXAMINEINFO + " =? WHERE " + PublishModel.EXAMINEINFO + " LIKE ?"; | ||||
| 		DBSql.update(tempPublishSql, new Object[] { examineInfoJO2.toString(), "%" + processInstId + "%" }); | ||||
| 		// 更新publish缓存 | ||||
| 		Iterator<PublishModel> publishIterator = PublishCache.getCache().iterator(); | ||||
| 		while (publishIterator.hasNext()) { | ||||
| 			PublishModel publishModel = publishIterator.next(); | ||||
| 			if (publishModel.getExamineInfo() != null && publishModel.getExamineInfo().contains(processInstId)) { | ||||
| 				publishModel.setExamineInfo(examineInfoJO2.toString()); | ||||
| 				PublishCache.getCache().put(publishModel.getId(), publishModel); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,81 @@ | ||||
| package com.actionsoft.apps.kms.event.publish; | ||||
| 
 | ||||
| import java.util.Iterator; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.model.PublishModel; | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.InterruptListenerInterface; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * 发布审批任务完成前事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingBeforeComplete extends InterruptListener implements InterruptListenerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public boolean execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		String processInstId = pec.getProcessInstance().getId(); | ||||
| 		if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "同意")) { | ||||
| 			// 修改BO状态 | ||||
| 			String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_PUBLISH + " SET STATUS = '同意' WHERE BINDID = ?"; | ||||
| 			DBSql.update(sql, new Object[] { processInstId }); | ||||
| 			// 删除临时发布的publish数据 | ||||
| 			BO bo = SDK.getBOAPI().query(KMSConstant.BO_ENTITY_NAME_PUBLISH).detailByBindId(processInstId); | ||||
| 			String tempPublishSql = "DELETE FROM " + KMSConstant.ENTITY_NAME_PUBLISH + " WHERE " + PublishModel.EXAMINEINFO + " LIKE ?"; | ||||
| 			DBSql.update(tempPublishSql, new Object[] { "%" + processInstId + "%" }); | ||||
| 			// 更新publish缓存 | ||||
| 			Iterator<PublishModel> publishIterator = PublishCache.getCache().iterator(); | ||||
| 			while (publishIterator.hasNext()) { | ||||
| 				PublishModel publishModel = publishIterator.next(); | ||||
| 				if (publishModel.getExamineInfo() != null && publishModel.getExamineInfo().contains(processInstId)) { | ||||
| 					PublishCache.getCache().remove(publishModel.getId()); | ||||
| 				} | ||||
| 			} | ||||
| 			// 发布 | ||||
| 			JSONArray publishCardJA = JSONArray.parseArray(bo.getString("CARDIDS")); | ||||
| 			JSONArray publishDimensionJA = new JSONArray(); | ||||
| 			publishDimensionJA.add(bo.getString("DIMENSIONID")); | ||||
| 			JSONObject schemaMetaDataJO = JSONObject.parseObject(bo.getString("SCHEMAMETADATA")); | ||||
| 			String tags = bo.getString("TAGS"); | ||||
| 			String publishMemo = bo.getString("PUBLISHMEMO"); | ||||
| 			CardService cardService = new CardService(); | ||||
| 
 | ||||
| 			JSONObject examineInfoJO3 = new JSONObject(); | ||||
| 			examineInfoJO3.put("processInstId", processInstId); | ||||
| 			examineInfoJO3.put("status", "同意"); | ||||
| 			cardService.publishCard(UserContext.fromUID(bo.getString("APPLYUSER")), publishCardJA, publishDimensionJA, schemaMetaDataJO, tags, publishMemo, examineInfoJO3.toString()); | ||||
| 
 | ||||
| 		} else if (SDK.getTaskAPI().isChoiceActionMenu(pec.getTaskInstance(), "不同意")) { | ||||
| 			String sql = "UPDATE " + KMSConstant.BO_ENTITY_NAME_PUBLISH + " SET STATUS = '不同意' WHERE BINDID = ?"; | ||||
| 			DBSql.update(sql, new Object[] { pec.getProcessInstance().getId() }); | ||||
| 			// 修改publish表的发布信息 | ||||
| 			JSONObject examineInfoJO3 = new JSONObject(); | ||||
| 			examineInfoJO3.put("processInstId", processInstId); | ||||
| 			examineInfoJO3.put("status", "不同意"); | ||||
| 			String tempPublishSql = "UPDATE " + KMSConstant.ENTITY_NAME_PUBLISH + " SET " + PublishModel.EXAMINEINFO + " =? WHERE " + PublishModel.EXAMINEINFO + " LIKE ?"; | ||||
| 			DBSql.update(tempPublishSql, new Object[] { examineInfoJO3.toString(), "%" + processInstId + "%" }); | ||||
| 			// 更新publish缓存 | ||||
| 			Iterator<PublishModel> publishIterator = PublishCache.getCache().iterator(); | ||||
| 			while (publishIterator.hasNext()) { | ||||
| 				PublishModel publishModel = publishIterator.next(); | ||||
| 				if (publishModel.getExamineInfo() != null && publishModel.getExamineInfo().contains(processInstId)) { | ||||
| 					publishModel.setExamineInfo(examineInfoJO3.toString()); | ||||
| 					PublishCache.getCache().put(publishModel.getId(), publishModel); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,44 @@ | ||||
| package com.actionsoft.apps.kms.event.publish; | ||||
| 
 | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ExecuteListener; | ||||
| import com.actionsoft.bpms.bpmn.engine.listener.ListenerConst; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * 发布审批表单加载后事件 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ExaminingFormAfterLoad extends ExecuteListener { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(ProcessExecutionContext pec) throws Exception { | ||||
| 		KMSUtil.commonFormAfterLoad(pec); | ||||
| 		KMSUtil.browseFormAfterLoad(pec); | ||||
| 		Map<String, Object> macroLibraries = pec.getParameterOfMap(ListenerConst.FORM_EVENT_PARAM_TAGS); | ||||
| 		BO bo = (BO) pec.getParameter(ListenerConst.FORM_EVENT_PARAM_BODATA); | ||||
| 		String cardIds = bo.getString("CARDIDS"); | ||||
| 		List<String> cardIdList = JSONArray.parseArray(cardIds, String.class); | ||||
| 		JSONArray cardInfoJA = new JSONArray(); | ||||
| 		for (String cardId : cardIdList) { | ||||
| 			JSONObject cardInfoJO = new JSONObject(); | ||||
| 			cardInfoJO.put("cardId", cardId); | ||||
| 			CardModel cardModel = CardCache.getCache().get(cardId); | ||||
| 			cardInfoJO.put("cardName", cardModel == null ? "知识不存在" : cardModel.getCardName()); | ||||
| 
 | ||||
| 			cardInfoJA.add(cardInfoJO); | ||||
| 		} | ||||
| 		macroLibraries.put("cardInfoJA", cardInfoJA.toString()); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,48 @@ | ||||
| package com.actionsoft.apps.kms.formatter; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.client.notification.NotificationMessageFormatter; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| public class KMSNotificationFormatter implements NotificationMessageFormatter { | ||||
| 	/** | ||||
| 	 * KMS阅读邀请:当用户接收到提醒窗口或在通知中心点击通知条目时被触发,格式化通知的内容 | ||||
| 	 * | ||||
| 	 * @param userContext 通知查看人 | ||||
| 	 * @param content 发送的原始内容 | ||||
| 	 * @return ResponseObject,包含content和buttons两个变量 | ||||
| 	 */ | ||||
| 	@Override public ResponseObject parser(UserContext userContext, String content) { | ||||
| 		ResponseObject ro = ResponseObject.newOkResponse(); | ||||
| 		JSONObject contentJO = JSONObject.parseObject(content); | ||||
| 		String cardId = contentJO.getString("cardId"); | ||||
| 		String dimensionId = contentJO.getString("dimensionId"); | ||||
| 		String inviteUser = contentJO.getString("inviteUser"); | ||||
| 		String cardName = contentJO.getString("cardName"); | ||||
| 		ro.put("content", inviteUser + "邀请您阅读知识:" + cardName); | ||||
| 		List<Map<String, String>> buttons = new ArrayList<>(); | ||||
| 		if (!userContext.isMobileClient()){ | ||||
| 			Map<String, String> button = new HashMap<>(); | ||||
| 			button.put("name", "阅读知识"); | ||||
| 			button.put("target", "side");// 新窗口,不常用。只允许四个常量:_blank/mainFrame/ajax/app | ||||
| 			button.put("action", "./w?sid=" + userContext.getSessionId() + "&cmd=com.actionsoft.apps.kms_knwl_center_browse_card_page&dimensionId="+dimensionId+"&cardId=" + cardId + "&isPage=true"); | ||||
| 
 | ||||
| 			button.put("color", "blue");// 只允许三个常量:blue/white/red | ||||
| 			button.put("functionId", SDK.getAppAPI().getAppContext(KMSConstant.APP_ID).getId()); | ||||
| 			button.put("functionName", "浏览知识"); | ||||
| 			buttons.add(button); | ||||
| 		} | ||||
| 		 | ||||
| 		ro.put("buttons", buttons); | ||||
| 		return ro; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,48 @@ | ||||
| package com.actionsoft.apps.kms.formatter; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.bpms.client.notification.NotificationMessageFormatter; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| public class KMSReportFormatter implements NotificationMessageFormatter { | ||||
| 	/** | ||||
| 	 * KMS阅读邀请:当用户接收到提醒窗口或在通知中心点击通知条目时被触发,格式化通知的内容 | ||||
| 	 * | ||||
| 	 * @param userContext 通知查看人 | ||||
| 	 * @param content 发送的原始内容 | ||||
| 	 * @return ResponseObject,包含content和buttons两个变量 | ||||
| 	 */ | ||||
| 	@Override public ResponseObject parser(UserContext userContext, String content) { | ||||
| 		ResponseObject ro = ResponseObject.newOkResponse(); | ||||
| 		JSONObject contentJO = JSONObject.parseObject(content); | ||||
| 		String cardId = contentJO.getString("cardId"); | ||||
| 		String reportUser = contentJO.getString("reportUser"); | ||||
| 		String cardName = contentJO.getString("cardName"); | ||||
| 		String reportContent = contentJO.getString("reportContent"); | ||||
| 		ro.put("content", "来自" + reportUser + "的关于知识[" + cardName + "]的反馈:" + reportContent); | ||||
| 		List<Map<String, String>> buttons = new ArrayList<>(); | ||||
| 		if (!userContext.isMobileClient()){ | ||||
| 			Map<String, String> button = new HashMap<>(); | ||||
| 			button.put("name", "查看知识"); | ||||
| 			button.put("target", "mainFrame");// 新窗口,不常用。只允许四个常量:_blank/mainFrame/ajax/app | ||||
| 			button.put("action", "./w?sid=" + userContext.getSessionId() + "&cmd=com.actionsoft.apps.kms_knwl_center_browse_card_page&cardId=" + cardId); | ||||
| 
 | ||||
| 			button.put("color", "blue");// 只允许三个常量:blue/white/red | ||||
| 			button.put("functionId", SDK.getAppAPI().getAppContext(KMSConstant.APP_ID).getId()); | ||||
| 			button.put("functionName", "浏览知识"); | ||||
| 			buttons.add(button); | ||||
| 		} | ||||
| 		 | ||||
| 		ro.put("buttons", buttons); | ||||
| 		return ro; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,33 @@ | ||||
| package com.actionsoft.apps.kms.humanperformer; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.def.UserTaskModel; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance; | ||||
| import com.actionsoft.bpms.bpmn.engine.performer.HumanPerformerAbst; | ||||
| import com.actionsoft.bpms.bpmn.engine.performer.HumanPerformerInterface; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 借阅流程-审批的参与者实现 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class BorrowerExamineHP extends HumanPerformerAbst implements HumanPerformerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getHumanPerformer(UserContext me, ProcessInstance processInstance, TaskInstance taskInstance, UserTaskModel userTaskModel, Map<String, Object> params) { | ||||
| 		BO bo = SDK.getBOAPI().query(KMSConstant.BO_ENTITY_NAME_BORROW).detailByBindId(processInstance.getId()); | ||||
| 		return new DimensionService().getDimensionAdmin(bo.getString("DIMENSIONID")); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getSetting(UserContext arg0, Map<String, Object> arg1) { | ||||
| 		return null; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,33 @@ | ||||
| package com.actionsoft.apps.kms.humanperformer; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.def.UserTaskModel; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance; | ||||
| import com.actionsoft.bpms.bpmn.engine.performer.HumanPerformerAbst; | ||||
| import com.actionsoft.bpms.bpmn.engine.performer.HumanPerformerInterface; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 发布流程-审批的参与者实现 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CancelPublishExamineHP extends HumanPerformerAbst implements HumanPerformerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getHumanPerformer(UserContext me, ProcessInstance processInstance, TaskInstance taskInstance, UserTaskModel userTaskModel, Map<String, Object> params) { | ||||
| 		BO bo = SDK.getBOAPI().query(KMSConstant.BO_ENTITY_NAME_CANCEL_PUBLISH).detailByBindId(processInstance.getId()); | ||||
| 		return new DimensionService().getDimensionAdmin(bo.getString("DIMENSIONID")); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getSetting(UserContext arg0, Map<String, Object> arg1) { | ||||
| 		return null; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,33 @@ | ||||
| package com.actionsoft.apps.kms.humanperformer; | ||||
| 
 | ||||
| import java.util.Map; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.service.DimensionService; | ||||
| import com.actionsoft.bpms.bo.engine.BO; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.def.UserTaskModel; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.run.delegate.ProcessInstance; | ||||
| import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance; | ||||
| import com.actionsoft.bpms.bpmn.engine.performer.HumanPerformerAbst; | ||||
| import com.actionsoft.bpms.bpmn.engine.performer.HumanPerformerInterface; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| 
 | ||||
| /** | ||||
|  * 发布流程-审批的参与者实现 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class PublishExamineHP extends HumanPerformerAbst implements HumanPerformerInterface { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getHumanPerformer(UserContext me, ProcessInstance processInstance, TaskInstance taskInstance, UserTaskModel userTaskModel, Map<String, Object> params) { | ||||
| 		BO bo = SDK.getBOAPI().query(KMSConstant.BO_ENTITY_NAME_PUBLISH).detailByBindId(processInstance.getId()); | ||||
| 		return new DimensionService().getDimensionAdmin(bo.getString("DIMENSIONID")); | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public String getSetting(UserContext arg0, Map<String, Object> arg1) { | ||||
| 		return null; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,316 @@ | ||||
| package com.actionsoft.apps.kms.job; | ||||
| 
 | ||||
| import java.io.File; | ||||
| import java.io.FileNotFoundException; | ||||
| import java.io.FileOutputStream; | ||||
| import java.io.IOException; | ||||
| import java.io.OutputStream; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.Iterator; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| import org.quartz.JobExecutionContext; | ||||
| import org.quartz.JobExecutionException; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.dao.CardDao; | ||||
| import com.actionsoft.apps.kms.dao.FileDao; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.apps.resource.AppContext; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.schedule.IJob; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.conf.server.AWSServerConf; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCProfileManager; | ||||
| import com.actionsoft.bpms.server.fs.file.ReadDCFile; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.bpms.util.UtilFile; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.actionsoft.sdk.local.api.AppAPI; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * 全文检索入库 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class FullsearchCreatedByFile implements IJob { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { | ||||
| 		AppContext kmsApp = SDK.getAppAPI().getAppContext(KMSConstant.APP_ID); | ||||
| 		FileCache fileCache = FileCache.getCache(); | ||||
| 		CardCache cardCache = CardCache.getCache(); | ||||
| 		CardService cardService = new CardService(); | ||||
| 		//知识卡片入库 | ||||
| 		Iterator<CardModel> cardIterator = cardCache.iterator(); | ||||
| 		CardDao cardDao = new CardDao(); | ||||
| 		JSONArray contents = new JSONArray(); | ||||
| 		List<CardModel> cardModelList = new ArrayList<CardModel>(); | ||||
| 		while (cardIterator.hasNext()) { | ||||
| 			CardModel cardModel = cardIterator.next(); | ||||
| 			if (cardModel.getIsPublished() == 1 && cardModel.getIsFullSearch() == 0) { | ||||
| 				cardModelList.add(cardModel); | ||||
| 				JSONObject json = new JSONObject(); | ||||
| 				String cardContext = cardModel.getCardContext(); | ||||
| 				if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 					//查询正文 | ||||
| 					DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 					cardContext = cardService.getCardContent(dc); | ||||
| 					cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 					cardContext = KMSUtil.replaceText(cardContext); | ||||
| 				} | ||||
| 				json.put("documentId", cardModel.getId()); | ||||
| 				json.put("content", "");//信息附件 | ||||
| 				json.put("abstract", cardContext);//信息摘要 | ||||
| 				json.put("title", cardModel.getCardName());//信息标题 | ||||
| 				json.put("createTime", UtilDate.datetimeFormat(cardModel.getCreateTime())); | ||||
| 				contents.add(json); | ||||
| 			} | ||||
| 		} | ||||
| 		String aslp = "aslp://" + KMSConstant.APP_FULLSEARCH + "/createIndexesByContent"; | ||||
| 		Map<String, Object> params = new HashMap<String, Object>(); | ||||
| 		params.put("index", KMSConstant.APP_KMS_FULLSEARCH_INDEX_CARD); | ||||
| 		params.put("type", KMSConstant.APP_KMS_FULLSEARCH_TYPE_CARD); | ||||
| 		params.put("contents", contents); | ||||
| 		AppAPI appAPI = SDK.getAppAPI(); | ||||
| 		ResponseObject resultRO = appAPI.callASLP(appAPI.getAppContext(KMSConstant.APP_ID), aslp, params); | ||||
| 		if (!resultRO.isOk()) { | ||||
| 			System.err.println("入库知识卡片时发生错误:" + resultRO.getMsg()); | ||||
| 			SDK.getAppAPI().info(kmsApp, "---------入库全文检索时发生错误:" + resultRO.getMsg() + "---------"); | ||||
| 		} else { | ||||
| 			for (CardModel cardModel : cardModelList) { | ||||
| 				cardModel.setIsFullSearch(1); | ||||
| 				cardDao.update(cardModel); | ||||
| 			} | ||||
| 		} | ||||
| 		Iterator<FileModel> fileIterator = fileCache.iterator(); | ||||
| 
 | ||||
| 		// key:fileId File:解密后的文件 | ||||
| 		Map<String, File> targetFileMap = new HashMap<>(); | ||||
| 		JSONObject fileNames = new JSONObject(); | ||||
| 		while (fileIterator.hasNext()) { | ||||
| 			FileModel fileModel = fileIterator.next(); | ||||
| 			if (fileModel != null) { | ||||
| 				if (fileModel.getIsFullsearch() == 0 && !fileModel.getFileName().contains("processInstId")) {// 未入库的文件//流程链接不入库 | ||||
| 					CardModel cardModel = cardCache.get(fileModel.getCardId()); | ||||
| 					if (cardModel != null && cardModel.getIsPublished() == 1) {// 已发布的知识 | ||||
| 						File targetFile = null; | ||||
| 						try { | ||||
| 							/* 开始入库操作 */ | ||||
| 							// 1、构建文件DC | ||||
| 							DCContext dcContext = new DCContext(UserContext.fromUID("admin"), DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), KMSUtil.getFileNameOfVersion(fileModel.getFileName(), fileModel.getFileVer())); | ||||
| 
 | ||||
| 							// 2、解密到tmp目录 | ||||
| 							String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + KMSConstant.APP_ID + File.separator + "tmp" + File.separator + cardModel.getId() + File.separator + fileModel.getId() + File.separator;// groupValue为cardId fileValue为fileId(在搜索全文检索时使用) | ||||
| 							File targetFileDir = new File(targetDir); | ||||
| 							if (!targetFileDir.exists()) { | ||||
| 								targetFileDir.mkdirs(); | ||||
| 							} | ||||
| 							String newFileName = KMSUtil.toDigestUTF8(fileModel.getFileName()) + "." + fileModel.getFileName().substring(fileModel.getFileName().lastIndexOf(".") + 1); | ||||
| 							targetFile = new File(targetDir + newFileName);// 名字不带版本号 | ||||
| 							if (!targetFile.exists()) { | ||||
| 								targetFile.createNewFile(); | ||||
| 							} | ||||
| 							OutputStream out = new FileOutputStream(targetFile); | ||||
| 							try { | ||||
| 								ReadDCFile.getInstance().read(out, dcContext); | ||||
| 								targetFileMap.put(fileModel.getId(), targetFile); | ||||
| 								fileNames.put(newFileName, fileModel.getFileName()); | ||||
| 							} catch (Exception e) { | ||||
| 								if ((e instanceof FileNotFoundException) || (e.getMessage() != null && e.getMessage().contains("key does not exist"))) { | ||||
| 									System.err.println("[" + fileModel.getCreateUser() + "]的文件[" + fileModel.getCardId() + "][" + fileModel.getFileName() + "]文件不存在"); | ||||
| 								} else { | ||||
| 									throw e; | ||||
| 								} | ||||
| 							} finally { | ||||
| 								out.close(); | ||||
| 							} | ||||
| 						} catch (Exception e) { | ||||
| 							System.err.println("[" + fileModel.getCreateUser() + "]的文件[" + fileModel.getFileName() + "]入库全文检索时发生错误"); | ||||
| 							e.printStackTrace(); | ||||
| 						} catch (Error e) { | ||||
| 							System.err.println("[" + fileModel.getCreateUser() + "]的文件[" + fileModel.getFileName() + "]入库全文检索时发生错误"); | ||||
| 							e.printStackTrace(); | ||||
| 						} | ||||
| 
 | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		creatCardModelContentFile(cardCache, fileCache, targetFileMap, fileNames, cardService); | ||||
| 		try { | ||||
| 			Set<String> fileIdSet = targetFileMap.keySet(); | ||||
| 			if (fileIdSet.size() > 0) { | ||||
| 				FileDao fileDao = new FileDao(); | ||||
| 				JSONArray docPathJA = new JSONArray(); | ||||
| 				for (String fileId : fileIdSet) { | ||||
| 					FileModel fileModel = fileCache.get(fileId); | ||||
| 					CardModel cardModel = null; | ||||
| 					if (fileModel != null) { | ||||
| 						cardModel = cardCache.get(fileModel.getCardId()); | ||||
| 					} else { | ||||
| 						cardModel = cardCache.get(fileId); | ||||
| 					} | ||||
| 					getCardData(cardService, targetFileMap, docPathJA, fileId, cardModel); | ||||
| 				} | ||||
| 				// 3、入库全文检索 | ||||
| 				aslp = "aslp://" + KMSConstant.APP_FULLSEARCH + "/createIndexesByFile"; | ||||
| 				Map<String, Object> params1 = new HashMap<String, Object>(); | ||||
| 				params1.put("index", KMSConstant.APP_KMS_FULLSEARCH_INDEX); | ||||
| 				params1.put("type", KMSConstant.APP_KMS_FULLSEARCH_TYPE); | ||||
| 				params1.put("documentsPath", docPathJA.toString()); | ||||
| 				params1.put("fileNames", fileNames.toString()); | ||||
| 				resultRO = appAPI.callASLP(appAPI.getAppContext(KMSConstant.APP_ID), aslp, params1); | ||||
| 				if (!resultRO.isOk()) { | ||||
| 					System.err.println("入库全文检索时发生错误:" + resultRO.getMsg()); | ||||
| 				} else { | ||||
| 					// 4、标记FileModel为已入库 | ||||
| 					for (String fileId : fileIdSet) { | ||||
| 						try { | ||||
| 							FileModel fileModel = FileCache.getCache().get(fileId); | ||||
| 							if (fileModel != null) { | ||||
| 								fileModel.setIsFullsearch(1); | ||||
| 								fileDao.update(fileModel); | ||||
| 							} | ||||
| 						} catch (Exception e) { | ||||
| 							e.printStackTrace(); | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 				for (String fileId : fileIdSet) { | ||||
| 					try { | ||||
| 						File targetFile = targetFileMap.get(fileId); | ||||
| 						// 5、删除tmp文件 | ||||
| 						if (targetFile != null && targetFile.exists()) { | ||||
| 							targetFile.delete(); | ||||
| 							File parentFileValueDir = targetFile.getParentFile();// 四级存储,获取名称为后三位的父文件夹 | ||||
| 							if (parentFileValueDir.list().length == 0) { | ||||
| 								UtilFile.removeFile(parentFileValueDir); | ||||
| 							} | ||||
| 						} | ||||
| 					} catch (Exception e) { | ||||
| 						e.printStackTrace(); | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} | ||||
| 
 | ||||
| 	} | ||||
| 
 | ||||
| 	public void getCardData(CardService cardService, Map<String, File> targetFileMap, JSONArray docPathJA, String fileId, CardModel cardModel) { | ||||
| 		JSONObject docInfo = new JSONObject(); | ||||
| 		if (cardModel != null) { | ||||
| 			String cardName = cardModel.getCardName(); | ||||
| 			docInfo.put("cardName", cardName); | ||||
| 			String cardContext = cardModel.getCardContext(); | ||||
| 			if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 				//查询正文 | ||||
| 				DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 				cardContext = cardService.getCardContent(dc); | ||||
| 				cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 				cardContext = KMSUtil.replaceText(cardContext); | ||||
| 			} | ||||
| 			docInfo.put("cardContent", cardContext); | ||||
| 		} else { | ||||
| 			docInfo.put("cardName", ""); | ||||
| 			docInfo.put("cardContent", ""); | ||||
| 		} | ||||
| 		docInfo.put("documentPath", targetFileMap.get(fileId).getPath()); | ||||
| 		docPathJA.add(docInfo); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @Author hunter | ||||
| 	 * @Datetime 2020/11/11 18:47 | ||||
| 	 * @Param | ||||
| 	 * @Return void | ||||
| 	 * @Description Todo-hul 创建知识简介的临时文件 | ||||
| 	 **/ | ||||
| 	public void creatCardModelContentFile(CardCache cardCache, FileCache fileCache, Map<String, File> targetFileMap, JSONObject fileNames, CardService cardService) { | ||||
| 		Iterator<CardModel> cardIterator = cardCache.iterator(); | ||||
| 		Iterator<FileModel> fileModelIterator = fileCache.iterator(); | ||||
| 		Map<String, CardModel> map = new HashMap<String, CardModel>(); | ||||
| 		while (cardIterator.hasNext()) { | ||||
| 			CardModel cardModel = cardIterator.next(); | ||||
| 			List<Object> arrayList = new ArrayList<>(); | ||||
| 			if (fileModelIterator.hasNext()) { | ||||
| 				while (fileModelIterator.hasNext()) { | ||||
| 					FileModel fileModel = fileModelIterator.next(); | ||||
| 					String cardId = fileModel.getCardId(); | ||||
| 					arrayList.add(cardId); | ||||
| 				} | ||||
| 			} | ||||
| 			if (arrayList.size() > 0) { | ||||
| 				if (!arrayList.contains(cardModel.getId())) { | ||||
| 					map.put(cardModel.getId(), cardModel); | ||||
| 				} | ||||
| 			} else { | ||||
| 				map.put(cardModel.getId(), cardModel); | ||||
| 			} | ||||
| 		} | ||||
| 		if (map.size() > 0) { | ||||
| 			for (CardModel cardModel : map.values()) { | ||||
| 				File targetFile = null; | ||||
| 				String cardContext = cardModel.getCardContext(); | ||||
| 				OutputStream out = null; | ||||
| 				if (cardModel.getIsPublished() == 1) { | ||||
| 					if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 						//查询正文 | ||||
| 						DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 						cardContext = cardService.getCardContent(dc); | ||||
| 						cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 						cardContext = KMSUtil.replaceText(cardContext); | ||||
| 					} | ||||
| 					if (UtilString.isEmpty(cardContext)) { | ||||
| 						return; | ||||
| 					} | ||||
| 					try { | ||||
| 						String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + KMSConstant.APP_ID + File.separator + "tmp" + File.separator + cardModel.getId() + File.separator + cardModel.getId() + File.separator;// groupValue为cardId fileValue为fileId(在搜索全文检索时使用) | ||||
| 						File targetFileDir = new File(targetDir); | ||||
| 						if (!targetFileDir.exists()) { | ||||
| 							boolean mkdirs = targetFileDir.mkdirs(); | ||||
| 						} | ||||
| 						String newFileName = KMSUtil.toDigestUTF8(cardModel.getCardName()) + ".doc"; | ||||
| 						targetFile = new File(targetDir + newFileName);// 名字不带版本号 | ||||
| 						if (!targetFile.exists()) { | ||||
| 							targetFile.createNewFile(); | ||||
| 						} | ||||
| 
 | ||||
| 						byte bytes[] = new byte[512]; | ||||
| 						bytes = cardContext.getBytes(); | ||||
| 						out = new FileOutputStream(targetFile); | ||||
| 						out.write(bytes); | ||||
| 						targetFileMap.put(cardModel.getId(), targetFile); | ||||
| 						fileNames.put(newFileName, newFileName); | ||||
| 					} catch (IOException e) { | ||||
| 						System.err.println("[" + cardModel.getCreateUser() + "]创建的知识[" + cardModel.getCardName() + "],知识简介部分入库全文检索时发生错误"); | ||||
| 						e.printStackTrace(); | ||||
| 					} finally { | ||||
| 						if (out != null) { | ||||
| 							try { | ||||
| 								out.close(); | ||||
| 							} catch (IOException e) { | ||||
| 								e.printStackTrace(); | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,378 @@ | ||||
| package com.actionsoft.apps.kms.job; | ||||
| 
 | ||||
| import java.io.File; | ||||
| import java.io.FileOutputStream; | ||||
| import java.io.IOException; | ||||
| import java.io.InputStream; | ||||
| import java.io.OutputStream; | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.Iterator; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.Set; | ||||
| 
 | ||||
| import org.apache.commons.io.IOUtils; | ||||
| import org.quartz.JobExecutionContext; | ||||
| import org.quartz.JobExecutionException; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.KMSConstant; | ||||
| import com.actionsoft.apps.kms.KMSUtil; | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.dao.CardDao; | ||||
| import com.actionsoft.apps.kms.dao.FileDao; | ||||
| import com.actionsoft.apps.kms.model.CardModel; | ||||
| import com.actionsoft.apps.kms.model.FileModel; | ||||
| import com.actionsoft.apps.kms.service.CardService; | ||||
| import com.actionsoft.apps.kms.service.SearchService; | ||||
| import com.actionsoft.apps.resource.AppContext; | ||||
| import com.actionsoft.bpms.commons.mvc.view.ResponseObject; | ||||
| import com.actionsoft.bpms.schedule.IJob; | ||||
| import com.actionsoft.bpms.server.UserContext; | ||||
| import com.actionsoft.bpms.server.conf.server.AWSServerConf; | ||||
| import com.actionsoft.bpms.server.fs.DCContext; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCProfileManager; | ||||
| import com.actionsoft.bpms.server.fs.dc.DCUtil; | ||||
| import com.actionsoft.bpms.util.DBSql; | ||||
| import com.actionsoft.bpms.util.UtilDate; | ||||
| import com.actionsoft.bpms.util.UtilFile; | ||||
| import com.actionsoft.bpms.util.UtilString; | ||||
| import com.actionsoft.sdk.local.SDK; | ||||
| import com.actionsoft.sdk.local.api.AppAPI; | ||||
| import com.alibaba.fastjson.JSONArray; | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| 
 | ||||
| /** | ||||
|  * 重新初始索引 | ||||
|  * | ||||
|  * @author lishan | ||||
|  */ | ||||
| public class ReIndexFullsearch implements IJob { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { | ||||
| 		//将app_act_kms_file是否索引字段改成否 | ||||
| 		AppContext kmsApp = SDK.getAppAPI().getAppContext(KMSConstant.APP_ID); | ||||
| 		String sql = "UPDATE APP_ACT_KMS_FILE SET ISFULLSEARCH = 0 "; | ||||
| 		DBSql.update(sql); | ||||
| 		sql = "UPDATE APP_ACT_KMS_CARD SET ISFULLSEARCH = 0 "; | ||||
| 		DBSql.update(sql); | ||||
| 		//重新加载缓存 | ||||
| 		FileCache.getCache().reload(); | ||||
| 		CardCache.getCache().reload(); | ||||
| 		//删除索引 | ||||
| 		SearchService searchService = new SearchService(); | ||||
| 		System.err.println("删除KMS全部索引"); | ||||
| 		searchService.deleteAllIndex(); | ||||
| 		//重新建立索引 | ||||
| 		FileCache fileCache = FileCache.getCache(); | ||||
| 		CardCache cardCache = CardCache.getCache(); | ||||
| 		CardService cardService = new CardService(); | ||||
| 		//知识卡片入库 | ||||
| 		Iterator<CardModel> cardIterator = cardCache.iterator(); | ||||
| 		CardDao cardDao = new CardDao(); | ||||
| 		JSONArray contents = new JSONArray(); | ||||
| 		List<CardModel> cardModelList = new ArrayList<CardModel>(); | ||||
| 		while (cardIterator.hasNext()) { | ||||
| 			CardModel cardModel = cardIterator.next(); | ||||
| 			if (cardModel.getIsPublished() == 1 && cardModel.getIsFullSearch() == 0) { | ||||
| 				cardModelList.add(cardModel); | ||||
| 				JSONObject json = new JSONObject(); | ||||
| 				String cardContext = cardModel.getCardContext(); | ||||
| 				if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 					//查询正文 | ||||
| 					DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 					cardContext = cardService.getCardContent(dc); | ||||
| 					cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 					cardContext = KMSUtil.replaceText(cardContext); | ||||
| 				} | ||||
| 				json.put("documentId", cardModel.getId()); | ||||
| 				json.put("content", "");//信息附件 | ||||
| 				json.put("abstract", cardContext);//信息摘要 | ||||
| 				json.put("title", cardModel.getCardName());//信息标题 | ||||
| 				json.put("createTime", UtilDate.datetimeFormat(cardModel.getCreateTime())); | ||||
| 				contents.add(json); | ||||
| 			} | ||||
| 		} | ||||
| 		String aslp = "aslp://" + KMSConstant.APP_FULLSEARCH + "/createIndexesByContent"; | ||||
| 		Map<String, Object> params = new HashMap<String, Object>(); | ||||
| 		params.put("index", KMSConstant.APP_KMS_FULLSEARCH_INDEX_CARD); | ||||
| 		params.put("type", KMSConstant.APP_KMS_FULLSEARCH_TYPE_CARD); | ||||
| 		params.put("contents", contents); | ||||
| 		AppAPI appAPI = SDK.getAppAPI(); | ||||
| 		ResponseObject resultRO = appAPI.callASLP(appAPI.getAppContext(KMSConstant.APP_ID), aslp, params); | ||||
| 		if (!resultRO.isOk()) { | ||||
| 			System.err.println("入库知识卡片时发生错误:" + resultRO.getMsg()); | ||||
| 			SDK.getAppAPI().info(kmsApp, "---------入库全文检索时发生错误:" + resultRO.getMsg() + "---------"); | ||||
| 		} else { | ||||
| 			for (CardModel cardModel : cardModelList) { | ||||
| 				cardModel.setIsFullSearch(1); | ||||
| 				cardDao.update(cardModel); | ||||
| 			} | ||||
| 		} | ||||
| 		Iterator<FileModel> fileIterator = fileCache.iterator(); | ||||
| 		// key:fileId File:解密后的文件 | ||||
| 		Map<String, File> targetFileMap = new HashMap<>(); | ||||
| 		JSONObject fileNames = new JSONObject(); | ||||
| 		while (fileIterator.hasNext()) { | ||||
| 			FileModel fileModel = fileIterator.next(); | ||||
| 			if (fileModel.getIsFullsearch() == 0 && fileModel.getFileState() == 1) {// 未入库的文件 | ||||
| 				CardModel cardModel = cardCache.get(fileModel.getCardId()); | ||||
| 				if (cardModel != null && cardModel.getIsPublished() == 1) {// 已发布的知识 | ||||
| 					File targetFile = null; | ||||
| 					try { | ||||
| 						/* 开始入库操作 */ | ||||
| 						// 1、构建文件DC | ||||
| 						DCContext dcContext = new DCContext(UserContext.fromUID("admin"), DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), KMSUtil.getFileNameOfVersion(fileModel.getFileName(), fileModel.getFileVer())); | ||||
| 
 | ||||
| 						// 2、解密到tmp目录 | ||||
| 						String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + KMSConstant.APP_ID + File.separator + "tmp" + File.separator + cardModel.getId() + File.separator + fileModel.getId() + File.separator;// groupValue为cardId fileValue为fileId(在搜索全文检索时使用) | ||||
| 						File targetFileDir = new File(targetDir); | ||||
| 						if (!targetFileDir.exists()) { | ||||
| 							targetFileDir.mkdirs(); | ||||
| 						} | ||||
| 						String newFileName = KMSUtil.toDigestUTF8(fileModel.getFileName()) + "." + fileModel.getFileName().substring(fileModel.getFileName().lastIndexOf(".") + 1); | ||||
| 						targetFile = new File(targetDir + newFileName);// 名字不带版本号 | ||||
| 						if (!targetFile.exists()) { | ||||
| 							targetFile.createNewFile(); | ||||
| 						} | ||||
| 						OutputStream out = new FileOutputStream(targetFile); | ||||
| 						InputStream in = DCUtil.decryptFile(dcContext); | ||||
| 						try { | ||||
| 							IOUtils.copy(in, out); | ||||
| 							in.close(); | ||||
| 							out.close(); | ||||
| 						} finally { | ||||
| 							IOUtils.closeQuietly(in); | ||||
| 							IOUtils.closeQuietly(out); | ||||
| 						} | ||||
| 						targetFileMap.put(fileModel.getId(), targetFile); | ||||
| 						fileNames.put(newFileName, fileModel.getFileName()); | ||||
| 					} catch (Exception e) { | ||||
| 						System.err.println("[" + fileModel.getCreateUser() + "]的文件[" + fileModel.getFileName() + "]入库全文检索时发生错误"); | ||||
| 						System.err.println("[知识ID:" + cardModel.getId() + "] [文件版本:" + fileModel.getFileVer() + "]"); | ||||
| 						e.printStackTrace(); | ||||
| 					} catch (Error e) { | ||||
| 						System.err.println("[" + fileModel.getCreateUser() + "]的文件[" + fileModel.getFileName() + "]入库全文检索时发生错误"); | ||||
| 						System.err.println("[知识ID:" + cardModel.getId() + "] [文件版本:" + fileModel.getFileVer() + "]"); | ||||
| 						e.printStackTrace(); | ||||
| 					} | ||||
| 
 | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		creatCardModelContentFile(cardCache, fileCache, targetFileMap, fileNames, cardService); | ||||
| 		try { | ||||
| 			Set<String> fileIdSet = targetFileMap.keySet(); | ||||
| 			if (fileIdSet.size() > 0) { | ||||
| 				FileDao fileDao = new FileDao(); | ||||
| 				JSONArray docPathJA = new JSONArray(); | ||||
| 				for (String fileId : fileIdSet) { | ||||
| 					FileModel fileModel = fileCache.get(fileId); | ||||
| 					CardModel cardModel = null; | ||||
| 					if (fileModel != null) { | ||||
| 						cardModel = cardCache.get(fileModel.getCardId()); | ||||
| 					} else { | ||||
| 						cardModel = cardCache.get(fileId); | ||||
| 					} | ||||
| 					getCardData(cardService, targetFileMap, docPathJA, fileId, cardModel); | ||||
| 				} | ||||
| 				// 3、入库全文检索 | ||||
| 				System.err.println("KMS全库初始化开始..."); | ||||
| 				SDK.getAppAPI().info(kmsApp, "---------KMS全库初始化开始---------"); | ||||
| 				aslp = "aslp://" + KMSConstant.APP_FULLSEARCH + "/createIndexesByFile"; | ||||
| 				Map<String, Object> params1 = new HashMap<String, Object>(); | ||||
| 				params1.put("index", KMSConstant.APP_KMS_FULLSEARCH_INDEX); | ||||
| 				params1.put("type", KMSConstant.APP_KMS_FULLSEARCH_TYPE); | ||||
| 				params1.put("documentsPath", docPathJA.toString()); | ||||
| 				params1.put("fileNames", fileNames.toString()); | ||||
| 				resultRO = appAPI.callASLP(appAPI.getAppContext(KMSConstant.APP_ID), aslp, params1); | ||||
| 				if (!resultRO.isOk()) { | ||||
| 					System.err.println("入库全文检索时发生错误:" + resultRO.getMsg()); | ||||
| 					SDK.getAppAPI().info(kmsApp, "---------入库全文检索时发生错误:" + resultRO.getMsg() + "---------"); | ||||
| 				} else { | ||||
| 					System.err.println("KMS全库初始化完成..."); | ||||
| 					SDK.getAppAPI().info(kmsApp, "---------KMS全库初始化完成---------"); | ||||
| 					// 4、标记FileModel为已入库 | ||||
| 					for (String fileId : fileIdSet) { | ||||
| 						try { | ||||
| 							FileModel fileModel = FileCache.getCache().get(fileId); | ||||
| 							if (fileModel != null) { | ||||
| 								fileModel.setIsFullsearch(1); | ||||
| 								fileDao.update(fileModel); | ||||
| 							} | ||||
| 						} catch (Exception e) { | ||||
| 							e.printStackTrace(); | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 				for (String fileId : fileIdSet) { | ||||
| 					try { | ||||
| 						File targetFile = targetFileMap.get(fileId); | ||||
| 						// 5、删除tmp文件 | ||||
| 						if (targetFile != null && targetFile.exists()) { | ||||
| 							targetFile.delete(); | ||||
| 							File parentFileValueDir = targetFile.getParentFile();// 四级存储,获取名称为后三位的父文件夹 | ||||
| 							if (parentFileValueDir.list().length == 0) { | ||||
| 								UtilFile.removeFile(parentFileValueDir); | ||||
| 							} | ||||
| 						} | ||||
| 					} catch (Exception e) { | ||||
| 						e.printStackTrace(); | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} catch (Exception e) { | ||||
| 			e.printStackTrace(); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public void getCardData(CardService cardService, Map<String, File> targetFileMap, JSONArray docPathJA, String fileId, CardModel cardModel) { | ||||
| 		JSONObject docInfo = new JSONObject(); | ||||
| 		if (cardModel != null) { | ||||
| 			String cardName = cardModel.getCardName(); | ||||
| 			docInfo.put("cardName", cardName); | ||||
| 			String cardContext = cardModel.getCardContext(); | ||||
| 			if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 				//查询正文 | ||||
| 				DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 				cardContext = cardService.getCardContent(dc); | ||||
| 				cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 				cardContext = KMSUtil.replaceText(cardContext); | ||||
| 			} | ||||
| 			docInfo.put("cardContent", cardContext); | ||||
| 		} else { | ||||
| 			docInfo.put("cardName", ""); | ||||
| 			docInfo.put("cardContent", ""); | ||||
| 		} | ||||
| 		docInfo.put("documentPath", targetFileMap.get(fileId).getPath()); | ||||
| 		docPathJA.add(docInfo); | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
| 	 * @Author hunter | ||||
| 	 * @Datetime 2020/11/11 18:47 | ||||
| 	 * @Param | ||||
| 	 * @Return void | ||||
| 	 * @Description Todo-hul 创建知识简介的临时文件 | ||||
| 	 **/ | ||||
| 	public void creatCardModelContentFile(CardCache cardCache, FileCache fileCache, Map<String, File> targetFileMap, JSONObject fileNames, CardService cardService) { | ||||
| 		Iterator<CardModel> cardIterator = cardCache.iterator(); | ||||
| 		Iterator<FileModel> fileModelIterator = fileCache.iterator(); | ||||
| 		Map<String, CardModel> map = new HashMap<String, CardModel>(); | ||||
| 		while (cardIterator.hasNext()) { | ||||
| 			CardModel cardModel = cardIterator.next(); | ||||
| 			List<Object> arrayList = new ArrayList<>(); | ||||
| 			if (fileModelIterator.hasNext()) { | ||||
| 				while (fileModelIterator.hasNext()) { | ||||
| 					FileModel fileModel = fileModelIterator.next(); | ||||
| 					String cardId = fileModel.getCardId(); | ||||
| 					arrayList.add(cardId); | ||||
| 				} | ||||
| 			} | ||||
| 			if (arrayList.size() > 0) { | ||||
| 				if (!arrayList.contains(cardModel.getId())) { | ||||
| 					map.put(cardModel.getId(), cardModel); | ||||
| 				} | ||||
| 			} else { | ||||
| 				map.put(cardModel.getId(), cardModel); | ||||
| 			} | ||||
| 		} | ||||
| 		if (map.size() > 0) { | ||||
| 			for (CardModel cardModel : map.values()) { | ||||
| 				File targetFile = null; | ||||
| 				String cardContext = cardModel.getCardContext(); | ||||
| 				OutputStream out = null; | ||||
| 				if (cardModel.getIsPublished() == 1) { | ||||
| 					if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 						//查询正文 | ||||
| 						DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 						cardContext = cardService.getCardContent(dc); | ||||
| 						cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 						cardContext = KMSUtil.replaceText(cardContext); | ||||
| 					} | ||||
| 					if (UtilString.isEmpty(cardContext)) { | ||||
| 						return; | ||||
| 					} | ||||
| 					try { | ||||
| 						String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + KMSConstant.APP_ID + File.separator + "tmp" + File.separator + cardModel.getId() + File.separator + cardModel.getId() + File.separator;// groupValue为cardId fileValue为fileId(在搜索全文检索时使用) | ||||
| 						File targetFileDir = new File(targetDir); | ||||
| 						if (!targetFileDir.exists()) { | ||||
| 							boolean mkdirs = targetFileDir.mkdirs(); | ||||
| 						} | ||||
| 						String newFileName = KMSUtil.toDigestUTF8(cardModel.getCardName()) + ".doc"; | ||||
| 						targetFile = new File(targetDir + newFileName);// 名字不带版本号 | ||||
| 						if (!targetFile.exists()) { | ||||
| 							targetFile.createNewFile(); | ||||
| 						} | ||||
| 
 | ||||
| 						byte bytes[] = new byte[512]; | ||||
| 						bytes = cardContext.getBytes(); | ||||
| 						out = new FileOutputStream(targetFile); | ||||
| 						out.write(bytes); | ||||
| 						targetFileMap.put(cardModel.getId(), targetFile); | ||||
| 						fileNames.put(newFileName, newFileName); | ||||
| 					} catch (IOException e) { | ||||
| 						System.err.println("[" + cardModel.getCreateUser() + "]创建的知识[" + cardModel.getCardName() + "],知识简介部分入库全文检索时发生错误"); | ||||
| 						e.printStackTrace(); | ||||
| 					} finally { | ||||
| 						if (out != null) { | ||||
| 							try { | ||||
| 								out.close(); | ||||
| 							} catch (IOException e) { | ||||
| 								e.printStackTrace(); | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	public void notFileFullsearch(AppContext kmsApp) { | ||||
| 		CardCache cardCache = CardCache.getCache(); | ||||
| 		CardService cardService = new CardService(); | ||||
| 		Iterator<CardModel> iterator = cardCache.iterator(); | ||||
| 		JSONArray docPathJA = new JSONArray(); | ||||
| 		AppAPI appAPI = SDK.getAppAPI(); | ||||
| 		while (iterator.hasNext()) { | ||||
| 			CardModel cardModel = iterator.next(); | ||||
| 			JSONObject docInfo = new JSONObject(); | ||||
| 			if (cardModel != null && cardModel.getIsPublished() == 1) { | ||||
| 				String cardName = cardModel.getCardName(); | ||||
| 				docInfo.put("cardName", cardName); | ||||
| 				String cardContext = cardModel.getCardContext(); | ||||
| 				if (UtilString.isEmpty(cardContext) || cardModel.getId().equals(cardContext)) { | ||||
| 					//查询正文 | ||||
| 					DCContext dc = new DCContext(null, DCProfileManager.getDCProfile(KMSConstant.APP_ID, KMSConstant.DOC_CARDCONTENT_REPOSITORY_NAME), KMSConstant.APP_ID, cardModel.getCreateUser(), cardModel.getId(), cardModel.getId()); | ||||
| 					cardContext = cardService.getCardContent(dc); | ||||
| 					cardContext = KMSUtil.getPlainText(cardContext); | ||||
| 					cardContext = KMSUtil.replaceText(cardContext); | ||||
| 				} | ||||
| 				docInfo.put("cardContent", cardContext); | ||||
| 			} else { | ||||
| 				docInfo.put("cardName", ""); | ||||
| 				docInfo.put("cardContent", ""); | ||||
| 			} | ||||
| 			docInfo.put("documentPath", ""); | ||||
| 			docPathJA.add(docInfo); | ||||
| 			System.err.println("KMS全库初正文始化开始..."); | ||||
| 			SDK.getAppAPI().info(kmsApp, "---------KMS全库正文初始化开始---------"); | ||||
| 			String aslp = "aslp://" + KMSConstant.APP_FULLSEARCH + "/createIndexesByFile"; | ||||
| 			Map<String, Object> params1 = new HashMap<String, Object>(); | ||||
| 			params1.put("index", KMSConstant.APP_KMS_FULLSEARCH_INDEX); | ||||
| 			params1.put("type", KMSConstant.APP_KMS_FULLSEARCH_TYPE); | ||||
| 			params1.put("documentsPath", docPathJA.toString()); | ||||
| 			params1.put("fileNames", ""); | ||||
| 			ResponseObject resultRO = appAPI.callASLP(appAPI.getAppContext(KMSConstant.APP_ID), aslp, params1); | ||||
| 			if (!resultRO.isOk()) { | ||||
| 				System.err.println("正文入库全文检索时发生错误:" + resultRO.getMsg()); | ||||
| 				SDK.getAppAPI().info(kmsApp, "---------正文入库全文检索时发生错误:" + resultRO.getMsg() + "---------"); | ||||
| 			} else { | ||||
| 				System.err.println("KMS全库正文初始化完成..."); | ||||
| 				SDK.getAppAPI().info(kmsApp, "---------KMS全库正文初始化完成---------"); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,40 @@ | ||||
| package com.actionsoft.apps.kms.job; | ||||
| 
 | ||||
| import org.quartz.JobExecutionContext; | ||||
| import org.quartz.JobExecutionException; | ||||
| 
 | ||||
| import com.actionsoft.apps.kms.cache.CardCache; | ||||
| import com.actionsoft.apps.kms.cache.DimensionCache; | ||||
| import com.actionsoft.apps.kms.cache.FileCache; | ||||
| import com.actionsoft.apps.kms.cache.HotspotCache; | ||||
| import com.actionsoft.apps.kms.cache.MetaAttrCache; | ||||
| import com.actionsoft.apps.kms.cache.MetaDataCache; | ||||
| import com.actionsoft.apps.kms.cache.MetaSchemaCache; | ||||
| import com.actionsoft.apps.kms.cache.OptCache; | ||||
| import com.actionsoft.apps.kms.cache.PublishCache; | ||||
| import com.actionsoft.apps.kms.cache.VersionCache; | ||||
| import com.actionsoft.bpms.schedule.IJob; | ||||
| 
 | ||||
| /** | ||||
|  * 同步将数据库和缓存(数据库操作使用了事务,预防某些异常导致的数据库和缓存不同步) | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  * | ||||
|  */ | ||||
| public class ReloadCache implements IJob { | ||||
| 
 | ||||
| 	@Override | ||||
| 	public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { | ||||
| 		CardCache.getCache().reload(); | ||||
| 		DimensionCache.getCache().reload(); | ||||
| 		PublishCache.getCache().reload(); | ||||
| 		FileCache.getCache().reload(); | ||||
| 		HotspotCache.getCache().reload(); | ||||
| 		MetaSchemaCache.getCache().reload(); | ||||
| 		MetaAttrCache.getCache().reload(); | ||||
| 		MetaDataCache.getCache().reload(); | ||||
| 		OptCache.getCache().reload(); | ||||
| 		VersionCache.getCache().reload(); | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,209 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Date; | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 知识 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class CardModel extends ModelBean implements IModelBean { | ||||
| 
 | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String CARDNAME = "CARDNAME"; | ||||
| 	public static final String CARDTYPE = "CARDTYPE"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String LASTUPDATE = "LASTUPDATE"; | ||||
| 	public static final String READCOUNT = "READCOUNT"; | ||||
| 	public static final String ONLINELEVEL = "ONLINELEVEL"; | ||||
| 	public static final String SECURITYLEVEL = "SECURITYLEVEL"; | ||||
| 	public static final String ISPUBLISHED = "ISPUBLISHED"; | ||||
| 	public static final String VALIDDATE = "VALIDDATE"; | ||||
| 	public static final String ISCOMMENT = "ISCOMMENT"; | ||||
| 	public static final String ISRATE = "ISRATE"; | ||||
| 	public static final String CARDCONTEXT = "CARDCONTEXT"; | ||||
| 	public static final String ISFULLSEARCH = "ISFULLSEARCH"; | ||||
| 	public static final String EXTERNALURL = "EXTERNALURL"; | ||||
| 	public static final String EXTPARAMS = "EXTPARAMS"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String cardName; | ||||
| 	private int cardType; | ||||
| 	private String createUser; | ||||
| 	private Timestamp createTime; | ||||
| 	private Timestamp lastUpdate; | ||||
| 	private long readCount; | ||||
| 	private int onlineLevel; | ||||
| 	private int securityLevel; | ||||
| 	private int isPublished; | ||||
| 	private int isFullSearch; | ||||
| 	private Date validDate; | ||||
| 	private int isComment; | ||||
| 	private int isRate; | ||||
| 	private String externalUrl; | ||||
| 	private String extParams; | ||||
| 	private int commentCount;// 内存使用,不存入数据库 | ||||
| 
 | ||||
| 	public double getRateScore() { | ||||
| 		return rateScore; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setRateScore(double rateScore) { | ||||
| 		this.rateScore = rateScore; | ||||
| 	} | ||||
| 
 | ||||
| 	private double rateScore;// 内存使用,不存入数据库 | ||||
| 
 | ||||
| 	public String getCardContext() { | ||||
| 		return cardContext; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardContext(String cardContext) { | ||||
| 		this.cardContext = cardContext; | ||||
| 	} | ||||
| 
 | ||||
| 	private String cardContext; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCardName() { | ||||
| 		return cardName; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardName(String cardName) { | ||||
| 		this.cardName = cardName; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getCardType() { | ||||
| 		return cardType; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardType(int cardType) { | ||||
| 		this.cardType = cardType; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getLastUpdate() { | ||||
| 		return lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLastUpdate(Timestamp lastUpdate) { | ||||
| 		this.lastUpdate = lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public long getReadCount() { | ||||
| 		return readCount; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setReadCount(long readCount) { | ||||
| 		this.readCount = readCount; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getOnlineLevel() { | ||||
| 		return onlineLevel; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOnlineLevel(int onlineLevel) { | ||||
| 		this.onlineLevel = onlineLevel; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getSecurityLevel() { | ||||
| 		return securityLevel; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSecurityLevel(int securityLevel) { | ||||
| 		this.securityLevel = securityLevel; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsPublished() { | ||||
| 		return isPublished; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsPublished(int isPublished) { | ||||
| 		this.isPublished = isPublished; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsFullSearch() { | ||||
| 		return isFullSearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsFullSearch(int isFullSearch) { | ||||
| 		this.isFullSearch = isFullSearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public Date getValidDate() { | ||||
| 		return validDate; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setValidDate(Date validDate) { | ||||
| 		this.validDate = validDate; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsComment() { | ||||
| 		return isComment; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsComment(int isComment) { | ||||
| 		this.isComment = isComment; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getCommentCount() { | ||||
| 		return commentCount; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCommentCount(int commentCount) { | ||||
| 		this.commentCount = commentCount; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsRate() { | ||||
| 		return isRate; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsRate(int isRate) { | ||||
| 		this.isRate = isRate; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getExternalUrl() { | ||||
| 		return externalUrl; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setExternalUrl(String externalUrl) { | ||||
| 		this.externalUrl = externalUrl; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getExtParams() { | ||||
| 		return extParams; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setExtParams(String extParams) { | ||||
| 		this.extParams = extParams; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,173 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 维度 | ||||
|  *  | ||||
|  * 将String类的null值处理为"" | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class DimensionModel extends ModelBean implements IModelBean, Cloneable { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String DIMENSIONNAME = "DIMENSIONNAME"; | ||||
| 	public static final String PARENTID = "PARENTID"; | ||||
| 	public static final String SHOWTYPE = "SHOWTYPE"; | ||||
| 	public static final String ISEXAMINE = "ISEXAMINE"; | ||||
| 	public static final String MEMO = "MEMO"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String LASTUPDATE = "LASTUPDATE"; | ||||
| 	public static final String HOTSPOTDEFID = "HOTSPOTDEFID"; | ||||
| 	public static final String ISENABLED = "ISENABLED"; | ||||
| 	public static final String ORDERINDEX = "ORDERINDEX"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String dimensionName; | ||||
| 	private String parentId; | ||||
| 	private int showType; | ||||
| 	private int isExamine; | ||||
| 	private String memo; | ||||
| 	private String createUser; | ||||
| 	private Timestamp createTime; | ||||
| 	private Timestamp lastUpdate; | ||||
| 	private String hotspotDefId; | ||||
| 	private int isEnabled; | ||||
| 	private int orderIndex; | ||||
| 	private boolean hasPerm = true;// 是否有权限,仅逻辑上使用,不存入数据库(默认有权限) | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getDimensionName() { | ||||
| 		if (dimensionName == null) { | ||||
| 			dimensionName = ""; | ||||
| 		} | ||||
| 		return dimensionName; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setDimensionName(String dimensionName) { | ||||
| 		this.dimensionName = dimensionName; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getParentId() { | ||||
| 		if (parentId == null) { | ||||
| 			parentId = ""; | ||||
| 		} | ||||
| 		return parentId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setParentId(String parentId) { | ||||
| 		this.parentId = parentId; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getShowType() { | ||||
| 		return showType; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setShowType(int showType) { | ||||
| 		this.showType = showType; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsExamine() { | ||||
| 		return isExamine; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsExamine(int isExamine) { | ||||
| 		this.isExamine = isExamine; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getMemo() { | ||||
| 		if (memo == null) { | ||||
| 			memo = ""; | ||||
| 		} | ||||
| 		return memo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setMemo(String memo) { | ||||
| 		this.memo = memo; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		if (createUser == null) { | ||||
| 			createUser = ""; | ||||
| 		} | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getLastUpdate() { | ||||
| 		return lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLastUpdate(Timestamp lastUpdate) { | ||||
| 		this.lastUpdate = lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getHotspotDefId() { | ||||
| 		if (hotspotDefId == null) { | ||||
| 			hotspotDefId = ""; | ||||
| 		} | ||||
| 		return hotspotDefId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setHotspotDefId(String hotspotDefId) { | ||||
| 		this.hotspotDefId = hotspotDefId; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsEnabled() { | ||||
| 		return isEnabled; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsEnabled(int isEnabled) { | ||||
| 		this.isEnabled = isEnabled; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getOrderIndex() { | ||||
| 		return orderIndex; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOrderIndex(int orderIndex) { | ||||
| 		this.orderIndex = orderIndex; | ||||
| 	} | ||||
| 
 | ||||
| 	public boolean isHasPerm() { | ||||
| 		return hasPerm; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setHasPerm(boolean hasPerm) { | ||||
| 		this.hasPerm = hasPerm; | ||||
| 	} | ||||
| 
 | ||||
| 	@Override | ||||
| 	public DimensionModel clone() { | ||||
| 		try { | ||||
| 			return (DimensionModel) super.clone(); | ||||
| 		} catch (CloneNotSupportedException e) { | ||||
| 			e.printStackTrace(); | ||||
| 			return null; | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,119 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 知识-文件 | ||||
|  * | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class FileModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String CARDID = "CARDID"; | ||||
| 	public static final String FILENAME = "FILENAME"; | ||||
| 	public static final String FILEVER = "FILEVER"; | ||||
| 	public static final String FILESIZE = "FILESIZE"; | ||||
| 	public static final String FILESTATE = "FILESTATE"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String ISFULLSEARCH = "ISFULLSEARCH";//0:未入库 1:已入库 2:无需入库(比如表单类虚拟文件) | ||||
| 	public static final String SECURITYLEVEL = "SECURITYLEVEL";//0:未入库 1:已入库 2:无需入库(比如表单类虚拟文件) | ||||
| 
 | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String cardId; | ||||
| 	private String fileName; | ||||
| 	private String fileVer; | ||||
| 	private long fileSize; | ||||
| 	private int fileState; | ||||
| 	private Timestamp createTime; | ||||
| 	private String createUser; | ||||
| 	private int isFullsearch; | ||||
| 	private int securityLevel; | ||||
| 
 | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCardId() { | ||||
| 		return cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardId(String cardId) { | ||||
| 		this.cardId = cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getFileName() { | ||||
| 		return fileName; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setFileName(String fileName) { | ||||
| 		this.fileName = fileName; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getFileVer() { | ||||
| 		return fileVer; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setFileVer(String fileVer) { | ||||
| 		this.fileVer = fileVer; | ||||
| 	} | ||||
| 
 | ||||
| 	public long getFileSize() { | ||||
| 		return fileSize; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setFileSize(long fileSize) { | ||||
| 		this.fileSize = fileSize; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getFileState() { | ||||
| 		return fileState; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setFileState(int fileState) { | ||||
| 		this.fileState = fileState; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsFullsearch() { | ||||
| 		return isFullsearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsFullsearch(int isFullsearch) { | ||||
| 		this.isFullsearch = isFullsearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getSecurityLevel() { | ||||
| 		return securityLevel; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSecurityLevel(int securityLevel) { | ||||
| 		this.securityLevel = securityLevel; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,78 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 知识地图-定义 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class HotspotDefModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String HOTSPOTNAME = "HOTSPOTNAME"; | ||||
| 	public static final String HOTSPOTMETAID = "HOTSPOTMETAID"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String MEMO = "MEMO"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String hotspotName; | ||||
| 	private String hotspotMetaId; | ||||
| 	private Timestamp createTime; | ||||
| 	private String createUser; | ||||
| 	private String memo; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getHotspotName() { | ||||
| 		return hotspotName; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setHotspotName(String hotspotName) { | ||||
| 		this.hotspotName = hotspotName; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getHotspotMetaId() { | ||||
| 		return hotspotMetaId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setHotspotMetaId(String hotspotMetaId) { | ||||
| 		this.hotspotMetaId = hotspotMetaId; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getMemo() { | ||||
| 		return memo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setMemo(String memo) { | ||||
| 		this.memo = memo; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,86 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 流程 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class HotspotModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String HOTSPOTDEFID = "HOTSPOTDEFID"; | ||||
| 	public static final String SHAPEID = "SHAPEID"; | ||||
| 	public static final String DIMENSIONID = "DIMENSIONID"; | ||||
| 	public static final String BINDTYPE = "BINDTYPE"; | ||||
| 	public static final String LINKURL = "LINKURL"; | ||||
| 	public static final String TARGET = "TARGET"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String hotspotDefId; | ||||
| 	private String shapeId; | ||||
| 	private String dimensionId;// todo 重构成sourceId,因为此id在bindType为1的时候代表维度id,bindType为2的时候代表知识id | ||||
| 	private int bindType; | ||||
| 	private String linkURL; | ||||
| 	private String target; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getHotspotDefId() { | ||||
| 		return hotspotDefId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setHotspotDefId(String hotspotDefId) { | ||||
| 		this.hotspotDefId = hotspotDefId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getShapeId() { | ||||
| 		return shapeId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setShapeId(String shapeId) { | ||||
| 		this.shapeId = shapeId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getDimensionId() { | ||||
| 		return dimensionId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setDimensionId(String dimensionId) { | ||||
| 		this.dimensionId = dimensionId; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getBindType() { | ||||
| 		return bindType; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setBindType(int bindType) { | ||||
| 		this.bindType = bindType; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getLinkURL() { | ||||
| 		return linkURL; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLinkURL(String linkURL) { | ||||
| 		this.linkURL = linkURL; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getTarget() { | ||||
| 		return target; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setTarget(String target) { | ||||
| 		this.target = target; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,100 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 日志 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class LogModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String CARDID = "CARDID"; | ||||
| 	public static final String FILEID = "FILEID"; | ||||
| 	public static final String ACCESSUSER = "ACCESSUSER"; | ||||
| 	public static final String ACCESSTIME = "ACCESSTIME"; | ||||
| 	public static final String IPADDRESS = "IPADDRESS"; | ||||
| 	public static final String LOGTYPE = "LOGTYPE"; | ||||
| 	public static final String LOGINFO = "LOGINFO"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String cardId; | ||||
| 	private String fileId; | ||||
| 	private String accessUser; | ||||
| 	private Timestamp accessTime; | ||||
| 	private String ipAddress; | ||||
| 	private int logType; | ||||
| 	private String logInfo; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCardId() { | ||||
| 		return cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardId(String cardId) { | ||||
| 		this.cardId = cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getFileId() { | ||||
| 		return fileId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setFileId(String fileId) { | ||||
| 		this.fileId = fileId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getAccessUser() { | ||||
| 		return accessUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setAccessUser(String accessUser) { | ||||
| 		this.accessUser = accessUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getAccessTime() { | ||||
| 		return accessTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setAccessTime(Timestamp accessTime) { | ||||
| 		this.accessTime = accessTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getIpAddress() { | ||||
| 		return ipAddress; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIpAddress(String ipAddress) { | ||||
| 		this.ipAddress = ipAddress; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getLogType() { | ||||
| 		return logType; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLogType(int logType) { | ||||
| 		this.logType = logType; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getLogInfo() { | ||||
| 		if (logInfo == null) { | ||||
| 			return ""; | ||||
| 		} | ||||
| 		return logInfo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLogInfo(String logInfo) { | ||||
| 		this.logInfo = logInfo; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,67 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据-属性 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaAttrModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String SCHEMAID = "SCHEMAID"; | ||||
| 	public static final String ATTRTITLE = "ATTRTITLE"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String schemaId; | ||||
| 	private String attrTitle; | ||||
| 	private Timestamp createTime; | ||||
| 	private String createUser; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getSchemaId() { | ||||
| 		return schemaId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaId(String schemaId) { | ||||
| 		this.schemaId = schemaId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getAttrTitle() { | ||||
| 		return attrTitle; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setAttrTitle(String attrTitle) { | ||||
| 		this.attrTitle = attrTitle; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| } | ||||
| @ -0,0 +1,87 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据-数据 | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaDataModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String CARDID = "CARDID"; | ||||
| 	public static final String SCHEMAID = "SCHEMAID"; | ||||
| 	public static final String ATTRID = "ATTRID"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String METATEXT = "METATEXT"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String cardId; | ||||
| 	private String schemaId; | ||||
| 	private String attrId; | ||||
| 	private Timestamp createTime; | ||||
| 	private String createUser; | ||||
| 	private String metaText; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCardId() { | ||||
| 		return cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardId(String cardId) { | ||||
| 		this.cardId = cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getSchemaId() { | ||||
| 		return schemaId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaId(String schemaId) { | ||||
| 		this.schemaId = schemaId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getAttrId() { | ||||
| 		return attrId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setAttrId(String attrId) { | ||||
| 		this.attrId = attrId; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getMetaText() { | ||||
| 		return metaText; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setMetaText(String metaText) { | ||||
| 		this.metaText = metaText; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,118 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class MetaSchemaModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String SCHEMATITLE = "SCHEMATITLE"; | ||||
| 	public static final String SCHEMASHOWTYPE = "SCHEMASHOWTYPE"; | ||||
| 	public static final String SCHEMADESC = "SCHEMADESC"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String LASTUPDATE = "LASTUPDATE"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String ISNULLABLE = "ISNULLABLE"; | ||||
| 	public static final String ISSEARCH = "ISSEARCH"; | ||||
| 	public static final String ORDERINDEX = "ORDERINDEX"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String schemaTitle; | ||||
| 	private int schemaShowtype; | ||||
| 	private String schemaDesc; | ||||
| 	private Timestamp createTime; | ||||
| 	private Timestamp lastUpdate; | ||||
| 	private String createUser; | ||||
| 	private int isNullable; | ||||
| 	private int isSearch; | ||||
| 	private int orderIndex; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getSchemaTitle() { | ||||
| 		return schemaTitle; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaTitle(String schemaTitle) { | ||||
| 		this.schemaTitle = schemaTitle; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getSchemaShowtype() { | ||||
| 		return schemaShowtype; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaShowtype(int schemaShowtype) { | ||||
| 		this.schemaShowtype = schemaShowtype; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getSchemaDesc() { | ||||
| 		return schemaDesc; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaDesc(String schemaDesc) { | ||||
| 		this.schemaDesc = schemaDesc; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getLastUpdate() { | ||||
| 		return lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLastUpdate(Timestamp lastUpdate) { | ||||
| 		this.lastUpdate = lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsNullable() { | ||||
| 		return isNullable; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsNullable(int isNullable) { | ||||
| 		this.isNullable = isNullable; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsSearch() { | ||||
| 		return isSearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsSearch(int isSearch) { | ||||
| 		this.isSearch = isSearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getOrderIndex() { | ||||
| 		return orderIndex; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOrderIndex(int orderIndex) { | ||||
| 		this.orderIndex = orderIndex; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,73 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| public class OptModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String CARDID = "CARDID"; | ||||
| 	public static final String OPTUSER = "OPTUSER"; | ||||
| 	public static final String OPTTYPE = "OPTTYPE"; | ||||
| 	public static final String OPTTIME = "OPTTIME"; | ||||
| 	public static final String OPTCONTENT = "OPTCONTENT"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String cardId; | ||||
| 	private String optUser; | ||||
| 	private int optType; | ||||
| 	private Timestamp optTime; | ||||
| 	private String optContent; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCardId() { | ||||
| 		return cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardId(String cardId) { | ||||
| 		this.cardId = cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getOptUser() { | ||||
| 		return optUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOptUser(String optUser) { | ||||
| 		this.optUser = optUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getOptType() { | ||||
| 		return optType; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOptType(int optType) { | ||||
| 		this.optType = optType; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getOptTime() { | ||||
| 		return optTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOptTime(Timestamp optTime) { | ||||
| 		this.optTime = optTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getOptContent() { | ||||
| 		return optContent; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setOptContent(String optContent) { | ||||
| 		this.optContent = optContent; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,118 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 发布 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class PublishModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String CARDID = "CARDID"; | ||||
| 	public static final String DIMENSIONID = "DIMENSIONID"; | ||||
| 	public static final String PUBLISHUSER = "PUBLISHUSER"; | ||||
| 	public static final String PUBLISHTIME = "PUBLISHTIME"; | ||||
| 	public static final String TAG = "TAG"; | ||||
| 	public static final String MEMO = "MEMO"; | ||||
| 	public static final String EXAMINEINFO = "EXAMINEINFO"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String cardId; | ||||
| 	private String dimensionId; | ||||
| 	private String publishUser; | ||||
| 	private Timestamp publishTime; | ||||
| 	private String tag; | ||||
| 	private String memo; | ||||
| 	private String examineInfo; | ||||
| 
 | ||||
| 	// model | ||||
| 	private CardModel cardModel; | ||||
| 	private DimensionModel dimensionModel; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCardId() { | ||||
| 		return cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardId(String cardId) { | ||||
| 		this.cardId = cardId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getDimensionId() { | ||||
| 		return dimensionId; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setDimensionId(String dimensionId) { | ||||
| 		this.dimensionId = dimensionId; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getPublishUser() { | ||||
| 		return publishUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setPublishUser(String publishUser) { | ||||
| 		this.publishUser = publishUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getPublishTime() { | ||||
| 		return publishTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setPublishTime(Timestamp publishTime) { | ||||
| 		this.publishTime = publishTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getTag() { | ||||
| 		return tag; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setTag(String tag) { | ||||
| 		this.tag = tag; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getMemo() { | ||||
| 		return memo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setMemo(String memo) { | ||||
| 		this.memo = memo; | ||||
| 	} | ||||
| 
 | ||||
| 	public CardModel getCardModel() { | ||||
| 		return cardModel; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCardModel(CardModel cardModel) { | ||||
| 		this.cardModel = cardModel; | ||||
| 	} | ||||
| 
 | ||||
| 	public DimensionModel getDimensionModel() { | ||||
| 		return dimensionModel; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setDimensionModel(DimensionModel dimensionModel) { | ||||
| 		this.dimensionModel = dimensionModel; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getExamineInfo() { | ||||
| 		return examineInfo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setExamineInfo(String examineInfo) { | ||||
| 		this.examineInfo = examineInfo; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,108 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 元数据 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class SchemaModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String SCHEMATITLE = "SCHEMATITLE"; | ||||
| 	public static final String SCHEMASHOWTYPE = "SCHEMASHOWTYPE"; | ||||
| 	public static final String SCHEMADESC = "SCHEMADESC"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String LASTUPDATE = "LASTUPDATE"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String ISNULLABLE = "ISNULLABLE"; | ||||
| 	public static final String ISSEARCH = "ISSEARCH"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String schemaTitle; | ||||
| 	private int schemaShowtype; | ||||
| 	private String schemaDesc; | ||||
| 	private Timestamp createTime; | ||||
| 	private Timestamp lastUpdate; | ||||
| 	private String createUser; | ||||
| 	private int isNullable; | ||||
| 	private int isSearch; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getSchemaTitle() { | ||||
| 		return schemaTitle; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaTitle(String schemaTitle) { | ||||
| 		this.schemaTitle = schemaTitle; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getSchemaShowtype() { | ||||
| 		return schemaShowtype; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaShowtype(int schemaShowtype) { | ||||
| 		this.schemaShowtype = schemaShowtype; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getSchemaDesc() { | ||||
| 		return schemaDesc; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setSchemaDesc(String schemaDesc) { | ||||
| 		this.schemaDesc = schemaDesc; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getLastUpdate() { | ||||
| 		return lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setLastUpdate(Timestamp lastUpdate) { | ||||
| 		this.lastUpdate = lastUpdate; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsNullable() { | ||||
| 		return isNullable; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsNullable(int isNullable) { | ||||
| 		this.isNullable = isNullable; | ||||
| 	} | ||||
| 
 | ||||
| 	public int getIsSearch() { | ||||
| 		return isSearch; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setIsSearch(int isSearch) { | ||||
| 		this.isSearch = isSearch; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,68 @@ | ||||
| package com.actionsoft.apps.kms.model; | ||||
| 
 | ||||
| import java.sql.Timestamp; | ||||
| 
 | ||||
| import com.actionsoft.bpms.commons.mvc.model.IModelBean; | ||||
| import com.actionsoft.bpms.commons.mvc.model.ModelBean; | ||||
| 
 | ||||
| /** | ||||
|  * 版本号 | ||||
|  *  | ||||
|  * @author wangshibao | ||||
|  */ | ||||
| public class VersionModel extends ModelBean implements IModelBean { | ||||
| 	private static final long serialVersionUID = 1L; | ||||
| 
 | ||||
| 	public static final String ID = "ID"; | ||||
| 	public static final String VERSIONNO = "VERSIONNO"; | ||||
| 	public static final String CREATETIME = "CREATETIME"; | ||||
| 	public static final String CREATEUSER = "CREATEUSER"; | ||||
| 	public static final String MEMO = "MEMO"; | ||||
| 
 | ||||
| 	private String id; | ||||
| 	private String versionNo; | ||||
| 	private Timestamp createTime; | ||||
| 	private String createUser; | ||||
| 	private String memo; | ||||
| 
 | ||||
| 	public String getId() { | ||||
| 		return id; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setId(String id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getVersionNo() { | ||||
| 		return versionNo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setVersionNo(String versionNo) { | ||||
| 		this.versionNo = versionNo; | ||||
| 	} | ||||
| 
 | ||||
| 	public Timestamp getCreateTime() { | ||||
| 		return createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateTime(Timestamp createTime) { | ||||
| 		this.createTime = createTime; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getCreateUser() { | ||||
| 		return createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setCreateUser(String createUser) { | ||||
| 		this.createUser = createUser; | ||||
| 	} | ||||
| 
 | ||||
| 	public String getMemo() { | ||||
| 		return memo; | ||||
| 	} | ||||
| 
 | ||||
| 	public void setMemo(String memo) { | ||||
| 		this.memo = memo; | ||||
| 	} | ||||
| 
 | ||||
| } | ||||
| @ -0,0 +1,38 @@ | ||||
| package com.actionsoft.apps.kms.pal; | ||||
| 
 | ||||
| import java.util.Timer; | ||||
| 
 | ||||
| public class CoEConstant { | ||||
| 	 | ||||
| 	public static final String APP_ID = "com.actionsoft.apps.coe.pal";	//App name | ||||
| 
 | ||||
| 	/** | ||||
| 	 * DC下资产库文件根目录 | ||||
| 	 */ | ||||
| 	public static final String REPOSITORY_ROOT_DIR = "workspace"; | ||||
| 
 | ||||
| 	public static final String PROPERTY_CUSTOM_DEFINE_SCHEMA = "CUSTOM_DEFINE_SCHEMA";	//属性-是否允许用户自定义,0:不允许;1:允许 | ||||
| 	public static final String PROPERTY_DEFAULT_WSID = "DEFAULT_WSID";	//属性-默认的流程资产库Id | ||||
| 	public static final String PROPERTY_PLDEPT_LAYER = "PLDEPT_LAYER";	//属性-流程责任部门组织级别 | ||||
| 	public static final String PROPERTY_RELATION_TYPE = "RELATION_TYPE";	//属性-责任人和责任部门关联方式 | ||||
| 	public static final String PROPERTY_SYS_AUTOSAVE = "SYS_AUTOSAVE";	//属性-流程自动保存 | ||||
| 	 | ||||
| 	public static Timer timer1 = new Timer();	//用于清理设计器协作的同步消息 | ||||
| 	public static final Timer timer2 = new Timer();	//用于清理设计器出现复制的同步消息 | ||||
| 
 | ||||
| 	// 收藏模型文件标识 | ||||
| 	public static final String COMMON_REPOSITORY_VERSIONID = "commonRepositoryVersionId"; | ||||
| 
 | ||||
| 	public static final String APP_PROCESSLINK_ID = "com.actionsoft.apps.coe.pal.processlink";// 串联分析应用id | ||||
| 
 | ||||
| 	public static final String APP_OUTPUT_ID = "com.actionsoft.apps.coe.pal.output";// 报告生成器应用id | ||||
| 
 | ||||
| 	public static final String APP_OUTPUT_PR_ID = "com.actionsoft.apps.coe.pal.output.pr";// 流程手册应用id | ||||
| 
 | ||||
| 	public static final String APP_ONLINE_DOC_ID = "com.actionsoft.apps.addons.onlinedoc";// 预览应用id | ||||
| 
 | ||||
| 	public static final String APP_BATCH_ID = "com.actionsoft.apps.coe.pal.batch";// 流程批处理id | ||||
| 
 | ||||
| 	public static final String APP_SUB_PROCESS_ID = "com.actionsoft.apps.coe.method.process.subprocess"; // 端到端应用ID | ||||
| 
 | ||||
| } | ||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
		Reference in New Issue
	
	Block a user