diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index 107dc1f7..9c4dec17 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java index b0db2f45..41ac7152 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishWeb.java @@ -2559,7 +2559,7 @@ public class ProcessPublishWeb extends ActionWeb { String name = parseObject.getString("name"); if (!"流程制度".equals(name)) { String versionId = parseObject.getString("versionId"); - String sql = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '" + versionId + "' and ISPUBLISH = '0' and ISSTOP = '0' "; + String sql = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '" + versionId + "' and ISPUBLISH = '0' and ISSTOP = '0' order by plver "; String newName = DBSql.getString(sql); parseObject.replace("name", newName); parseObject.replace("isParent", "false"); diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java index ad5c3023..c2009fb1 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/pubEvent/ProcessEndAfterEvent_new.java @@ -114,6 +114,18 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute e.printStackTrace(); } + + //发送消息通知 + List readCountBO=SDK.getBOAPI().query("BO_EU_READ_COUNT").addQuery("PROCESSID=",ext.getProcessInstance().getId()).addQuery("RESULT=","待处理").list(); + if(readCountBO.size()>0){ + SDK.getNotificationAPI().sendMessage("admin", "admin", "文件名称:"+ext.getProcessInstance().getTitle()+"文件有失败记录,请及时处理!!!"); + } + + + //更新任务状态 + int r1 = DBSql.update("UPDATE BO_ACT_EXECUTIVE_TASK SET ISTASKEND='2' WHERE TASKID ='" + ext.getProcessInstance().getId() + "'"); + + } public void ProcessData(ProcessExecutionContext processExecutionContext,Connection open) throws Exception { @@ -551,30 +563,29 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute /** * 创建索引 * @param processExecutionContext 流程实例 - * @param index 索引名称 (随便填写,aslp那边已经有固定的) - * @param type 类型(随便填写,aslp中也是有固定的) - * @param documentPath dc全路径 - * @param fileNames 文件名称 + * @param contents 索引内容 + * @return */ - public void createIndexByFile(ProcessExecutionContext processExecutionContext,String index,String type,String documentPath,JSONObject fileNames) { + + public boolean createIndexesByContent(ProcessExecutionContext processExecutionContext,JSONArray contents) { // 调用App - String sourceAppId = processExecutionContext.getProcessInstance().getAppId(); + String sourceAppId =processExecutionContext.getProcessInstance().getAppId() ; // aslp服务地址 - String aslp = "aslp://com.actionsoft.apps.addons.es/createIndexByFile"; + String aslp = "aslp://com.actionsoft.apps.addons.es/createIndexesByContent"; // 参数定义列表 Map params = new HashMap(); +//索引内容(JSONArray格式, JSONArray中包含JSONObject, JSONObject的内容同创建单个索引),必填 + params.put("contents", contents); //索引名称(文档在哪存放),必填 - params.put("index", index); + params.put("index", "com.actionsoft.apps.kms_kmsdoc_card"); //类型(索引中对数据进行逻辑分区。不同 type的文档可能有不同的字段,但最好能够非常相似,比如:存储所有产品到索引products中,但是你有许多不同的产品类别,这些产品共享一种相同的(或非常相似)的模式:他们有一个标题、描述、产品代码和价格。他们只是正好属于“产品”下的一些子类。用type表示不同的类别),必填 - params.put("type", type); -//要入库的文件全路径,必填 - params.put("documentPath", documentPath); -//文件实际名称, jsonObject,非必填 - params.put("fileNames", fileNames); + params.put("type", "kmsdoc_card"); AppAPI appAPI = SDK.getAppAPI(); -//入库操作,从文件创建内容索引 +//入库操作,创建内容索引(多个) ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); - System.out.println("ro===================="+ro); + + System.out.println("ro==================="+ro); + return ro.isOk(); } /** @@ -659,15 +670,6 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute - //发送消息通知 - List readCountBO=SDK.getBOAPI().query("BO_EU_READ_COUNT").addQuery("PROCESSID=",processExecutionContext.getProcessInstance().getId()).addQuery("RESULT=","待处理").list(); - if(readCountBO.size()>0){ - SDK.getNotificationAPI().sendMessage("admin", "admin", "文件名称:"+processExecutionContext.getProcessInstance().getTitle()+"文件有失败记录,请及时处理!!!"); - } - - //更新任务状态 - int r1 = DBSql.update("UPDATE BO_ACT_EXECUTIVE_TASK SET ISTASKEND='2' WHERE TASKID ='" + processExecutionContext.getProcessInstance().getId() + "'"); - } catch (Exception e) { System.out.println("等待中断异常"); @@ -760,7 +762,16 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute //创建文件 ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); System.out.println("流程手册的存入=================" + ro); - createIndexByFile(processExecutionContext, dcContext.getFileName(),"process",dcContext.getFilePath(),new JSONObject()); + + JSONArray coontest = new JSONArray(new LinkedList<>()); + JSONObject jsonObject = new JSONObject(new LinkedHashMap<>()); + jsonObject.put("documentId", cardId); + jsonObject.put("content", "");//信息附件 + jsonObject.put("abstract", dcContext);//信息摘要 + jsonObject.put("title", dcContext.getFileName().substring(0,dcContext.getFileName().indexOf(".")));//信息标题 + coontest.add(jsonObject); + //createIndexesByContent(processExecutionContext,coontest); + } } @@ -799,7 +810,16 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute paramss.put("dc", dcContexts); AppAPI appAPIs = SDK.getAppAPI(); ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, paramss); - //createIndexByFile(processExecutionContext, dcContexts.getFileName(),"process",dcContexts.getFilePath(),new JSONObject()); + + JSONArray coontest = new JSONArray(new LinkedList<>()); + JSONObject jsonObject = new JSONObject(new LinkedHashMap<>()); + jsonObject.put("documentId", cardId); + jsonObject.put("content", "");//信息附件 + jsonObject.put("abstract", dcContexts);//信息摘要 + jsonObject.put("title", dcContexts.getFileName().substring(0,dcContexts.getFileName().indexOf(".")));//信息标题 + coontest.add(jsonObject); + //createIndexesByContent(processExecutionContext,coontest); + } } } @@ -2097,7 +2117,7 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute jsonObject_ehsq.put("releasescope", "内蒙古伊利实业集团股份有限公司"); } else { - String departname = ""; + /*String departname = ""; String orgperm = bo1.getString("ORGPERM"); String dleass = ""; String[] deptSplit = orgperm.split(","); @@ -2114,9 +2134,10 @@ public class ProcessEndAfterEvent_new extends ExecuteListener implements Execute if(UtilString.isNotEmpty(departname)&&departname.length()>500) { String substring = departname.substring(0, 500); departname = substring.substring(0,substring.lastIndexOf(";")); - } - jsonObject_ehsq.put("releasescope", departname); + }*/ + //jsonObject_ehsq.put("releasescope", departname); + jsonObject_ehsq.put("releasescope", byProcess.getString("IS_THE_UNIT")); } } diff --git a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar index f1ea735a..732d0fdb 100644 Binary files a/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar and b/com.actionsoft.apps.coe.pal/lib/com.actionsoft.apps.coe.pal.jar differ diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java index 9bb60d77..f577c265 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/output/util/OutputWordUtil.java @@ -1150,7 +1150,6 @@ public class OutputWordUtil { } try { - System.out.println("生成附件路径是=================="+outFile.getPath()); doc.saveToFile(outFile.getPath(), FileFormat.Docx_2013); } catch (Exception e) { e.printStackTrace(); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java index ca180d5f..7c0096c8 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/dao/PALRepositoryRemoveInfo.java @@ -221,7 +221,6 @@ public class PALRepositoryRemoveInfo extends DaoObject 0 ) { boolean containsJSONObject = true; for(int i=0;i>>>>" + anInt); //只有一条记录的时候判断是否第一次创建对应模型 if (type.equals("0")) { if (anInt == 1) { @@ -4237,7 +4240,6 @@ public class DesignerRelationShapeWeb extends ActionWeb { String getID = DBSql.getString(getCreateDateSql); String isfirstSql = "SELECT ISFIRSTCREATE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + getID + "'"; String isfirst = DBSql.getString(isfirstSql); - System.out.println("isfirst>>>>>>>>" + isfirst); if (isfirst == null || isfirst == "") { DBSql.update("UPDATE APP_ACT_COE_PAL_REPOSITORY SET ISFIRSTCREATE = 1 WHERE ID = '" + getID + "'"); ro.put("isFirst", true); diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java index cfc46417..36996811 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/designer/web/CoeDesignerWeb.java @@ -4215,8 +4215,15 @@ public class CoeDesignerWeb extends ActionWeb { //1.创建角色模型 DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); List oldModelList = dao.getModelListByFileId(oldUUID); - if (oldModelList.size() > 0 && oldModelList.get(0).getAttrId().equals("role")) { - CreateRelevanceRoleModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer, teamId); + + + if (oldModelList.size() > 0) { + for (DesignerShapeRelationModel oldModel : oldModelList) { + if (oldModel.getAttrId().equals("role")) { + CreateRelevanceRoleModel(isLargeIteration, oldUUID, PALRepositoryCache.getCache().get(newUUID), mapNewUUID, tempVer, teamId,oldModel.getRelationFileId()); + break; + } + } } //创建绩效关联关系 @@ -4246,13 +4253,14 @@ public class CoeDesignerWeb extends ActionWeb { * @param isLargeIteration * @param olduuid */ - public String CreateRelevanceRoleModel(boolean isLargeIteration, String olduuid, PALRepositoryModel newModel, Map mapNewUUID, Double tempVer, String teamId) { + public String CreateRelevanceRoleModel(boolean isLargeIteration, String olduuid, PALRepositoryModel newModel, Map mapNewUUID, Double tempVer, String teamId,String relationFileId) { ResponseObject ro = null; DesignerShapeRelationDao dao = new DesignerShapeRelationDao(); List oldModelList = dao.getModelListByFileId(olduuid); + //1.创建角色模型 - String relationFileId = oldModelList.get(0).getRelationFileId(); + //String relationFileId = oldModelList.get(0).getRelationFileId(); String srcPath = "";// 源文件路径 String targetPath = "";// 目标文件路径 PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); @@ -4335,98 +4343,6 @@ public class CoeDesignerWeb extends ActionWeb { ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage()); } - - /*if(oldModelList.size()>0){ - for (DesignerShapeRelationModel oldModel : oldModelList) { - - PALRepositoryModel model = PALRepositoryCache.getCache().get(newModel.getId()); - //如果关联角色图,则同步复制角色图关联关系 - if(oldModel.getAttrId().equals("role")){ - String methodIds="org.role"; - if (mapNewUUID.containsKey(oldModel.getShapeId())) { - - String srcPath = "";// 源文件路径 - String targetPath = "";// 目标文件路径 - PALRepository coeProcessLevel = CoeProcessLevelDaoFacotory.createCoeProcessLevel(); - PALRepositoryModelImpl lastplModel = (PALRepositoryModelImpl) coeProcessLevel.getInstance(oldModel.getRelationFileId()); - final String oldUUID = lastplModel.getId(); - lastplModel.setId(UUIDGener.getUUID()); - final String newUUID = lastplModel.getId(); - //大小版本号处理 - tempVer = isLargeIteration ? coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId()) : coeProcessLevel.getMaxVersionNum(lastplModel.getVersionId(),lastplModel.getVersion()); - lastplModel.setHistoryMaxVersion("0"); - lastplModel.setVersion(VersionUtil.increaseVersionNo(tempVer,isLargeIteration)); - lastplModel.setUse(false); - srcPath = lastplModel.getFilePath(); - if (!"".equals(srcPath) && srcPath != null) { - targetPath = srcPath.replace(oldModel.getRelationFileId(), lastplModel.getId()); - } - lastplModel.setFilePath(targetPath); - lastplModel.setPublish(false); - lastplModel.setStop(false); - lastplModel.setApproval(false); - Timestamp nowTime = new Timestamp(System.currentTimeMillis()); - String uid = super.getContext().getUID(); - lastplModel.setCreateUser(uid); - lastplModel.setCreateDate(nowTime); - lastplModel.setModifyUser(uid); - lastplModel.setModifyDate(nowTime); - List data=new ArrayList<>(); - data.add(0,"org.role"); - data.add(1,newModel.getId()); - lastplModel.setExt2(data.toString()); - //密级 - lastplModel.setSecurityLevel(-1); - int store = 0; - try { - store = CoeProcessLevelDaoFacotory.createCoeProcessLevel().insert(lastplModel); - if (store == 1) { - // 修改设计器文件 - CoeFile fileUtil = new CoeFile(); - fileUtil.copyDefaultVersion(srcPath, oldModel.getRelationFileId(), targetPath, lastplModel.getId()); - - // 获取新旧节点关联关系 - final Map mapNewUUID1 = createShapeIdRelation(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), true); - // 处理流程属性 - String property = CoePropertyUtil.getPropertyValue(oldModel.getRelationFileId() + "_attr"); - if (!UtilString.isEmpty(property)) { - CoePropertyUtil.createProperty(newUUID + "_attr", property); - } - - //重新设置修订关联关系 - DesignerShapeRelationModel newModel1 = new DesignerShapeRelationModel(); - newModel1.setId(UUIDGener.getUUID()); - newModel1.setFileId(newModel.getId()); - newModel1.setShapeId(mapNewUUID.get(oldModel.getShapeId())); - newModel1.setShapeText(oldModel.getShapeText()); - newModel1.setAttrId(oldModel.getAttrId()); - newModel1.setRelationFileId(newUUID); - newModel1.setRelationShapeId(oldModel.getRelationShapeId()); - newModel1.setRelationShapeText(oldModel.getRelationShapeText()); - dao.insert(newModel1); - - - CoeProcessLevelUtil.copyRepositoryProperty(PALRepositoryCache.getCache().get(oldModel.getRelationFileId()), PALRepositoryCache.getCache().get(newUUID), mapNewUUID1, _uc); - ro = ResponseObject.newOkResponse("创建成功"); - ro.put("uuid", lastplModel.getId()); - }else{ - ro = ResponseObject.newWarnResponse("创建失败"); - } - } catch (Exception e) { - ro = ResponseObject.newWarnResponse("创建失败," + e.getMessage()); - } - - - } - ro = ResponseObject.newWarnResponse("创建失败"); - }else{ - ro = ResponseObject.newWarnResponse("创建失败"); - } - break; - } - }else{ - ro = ResponseObject.newWarnResponse("创建失败"); - }*/ return ro.toString(); } diff --git a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/RepositoryTreeUtil.java b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/RepositoryTreeUtil.java index c186bdec..3a50d05e 100755 --- a/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/RepositoryTreeUtil.java +++ b/com.actionsoft.apps.coe.pal/src/com/actionsoft/apps/coe/pal/pal/repository/util/RepositoryTreeUtil.java @@ -114,8 +114,8 @@ public class RepositoryTreeUtil { if (model != null) palObject.put("dutyUserName", model.getUserName()); } - String sqls = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYNAME='文件编码' and PLID = '"+palModel.getId()+"'"; - palObject.put("stopNumber", DBSql.getString(sqls)); + //String sqls = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PROPERTYNAME='文件编码' and PLID = '"+palModel.getId()+"'"; + //palObject.put("stopNumber", DBSql.getString(sqls)); // if (professionalIcon) { if (false) { palObject.put("icon", "../apps/" + CoEConstant.APP_ID + "/img/method/" + palModel.getMethodId() + "/16.png"); diff --git a/com.awspaas.user.apps.yili.integration/lib/com.awspaas.user.apps.yili.integration.jar b/com.awspaas.user.apps.yili.integration/lib/com.awspaas.user.apps.yili.integration.jar index a9154260..52fae2f5 100644 Binary files a/com.awspaas.user.apps.yili.integration/lib/com.awspaas.user.apps.yili.integration.jar and b/com.awspaas.user.apps.yili.integration/lib/com.awspaas.user.apps.yili.integration.jar differ diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/CreateWorkflowServiceJob.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/CreateWorkflowServiceJob.java index e7fb93d6..c6fa5df0 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/CreateWorkflowServiceJob.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/CreateWorkflowServiceJob.java @@ -90,7 +90,8 @@ public class CreateWorkflowServiceJob implements IJob { // HttpURLConnection 发送SOAP请求 System.out.println("HttpURLConnection 发送SOAP请求"); - String postSoap = UtilUrl.doPostSoap("http://10.105.1.59:80/services/WorkflowService", xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap("http://10.105.1.59:80/services/WorkflowService", xmlStr, ""); /*// HttpClient发送SOAP请求 System.out.println("HttpClient 发送SOAP请求"); diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/SendReadBycontract.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/SendReadBycontract.java index 7eeb7b63..23b39288 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/SendReadBycontract.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/SendReadBycontract.java @@ -889,8 +889,8 @@ public class SendReadBycontract implements IJob { ""; System.out.println("xmlStr>>>>>>>>"+xmlStr); String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - - String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(readurl, xmlStr, ""); Document document = DocumentHelper.parseText(postSoap); Element rootElement = document.getRootElement(); System.out.println("rootElement>>>>>>"+rootElement); diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/TestSendOARead.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/TestSendOARead.java index d73ee769..5c2e2a6b 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/TestSendOARead.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/TestSendOARead.java @@ -608,7 +608,8 @@ public class TestSendOARead implements IJob { System.out.println("xmlStr>>>>>>>>"+xmlStr); String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(readurl, xmlStr, ""); Document document = DocumentHelper.parseText(postSoap); Element rootElement = document.getRootElement(); System.out.println("rootElement>>>>>>"+rootElement); diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid.java index 6582e7b3..ce72e06c 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid.java @@ -901,7 +901,8 @@ public class sendReadByDataid { //System.out.println("xmlStr>>>>>>>>" + xmlStr); String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(readurl, xmlStr, ""); Document document = DocumentHelper.parseText(postSoap); Element rootElement = document.getRootElement(); //System.out.println("rootElement>>>>>>" + rootElement); diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid2.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid2.java index 37913d8b..53f97578 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid2.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid2.java @@ -897,7 +897,8 @@ public class sendReadByDataid2 { System.out.println("xmlStr>>>>>>>>" + xmlStr); String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(readurl, xmlStr, ""); Document document = DocumentHelper.parseText(postSoap); Element rootElement = document.getRootElement(); System.out.println("rootElement>>>>>>" + rootElement); diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid3.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid3.java index 61efdf07..ce4b7201 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid3.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/job/sendReadByDataid3.java @@ -699,7 +699,8 @@ public class sendReadByDataid3 { System.out.println("xmlStr>>>>>>>>" + xmlStr); String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(readurl, xmlStr, ""); Document document = DocumentHelper.parseText(postSoap); Element rootElement = document.getRootElement(); System.out.println("rootElement>>>>>>" + rootElement); diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/oauth/TaskController.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/oauth/TaskController.java index 084cfd29..d2e0bf5e 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/oauth/TaskController.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/oauth/TaskController.java @@ -26,6 +26,7 @@ import com.actionsoft.bpms.server.fs.DCContext; 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; import com.actionsoft.exception.AWSQuotaException; import com.actionsoft.sdk.local.SDK; @@ -111,58 +112,83 @@ public class TaskController { * @param logType */ public void setUserLog(String processInstId, String userid, String logType) { + Connection open = DBSql.open(); System.err.println("用户登录记录存入日志========>" + userid + "_类型:" + logType); if (UtilString.isNotEmpty(userid)) { - //待阅更新已读记录 - if ("3".equals(logType)) { - String dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); - /* - * RowMap map = DBSql.getMap("SELECT * FROM BO_ACT_DATAID WHERE PROCESSID = '" - * +processInstId+"' AND USER_ID = '"+userid+"' AND READSTATE = '已读'"); - * if(null!=map) { int readCount = map.getInt("READCOUNT")+1; - * DBSql.update("UPDATE BO_ACT_DATAID SET READSTATE = '已读',READTIMES = '" - * +dateTime+"',READCOUNT = "+readCount+" WHERE PROCESSID = '" - * +processInstId+"' AND USER_ID = '"+userid+"'"); }else { } - */ - DBSql.update("UPDATE BO_ACT_DATAID SET READSTATE = '已读',READTIMES = '" + dateTime + "',READCOUNT = 1 WHERE PROCESSID = '" + processInstId + "' AND USER_ID = '" + userid + "'"); + try { + //待阅更新已读记录 + if ("3".equals(logType)) { + String dateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + /* + * RowMap map = DBSql.getMap("SELECT * FROM BO_ACT_DATAID WHERE PROCESSID = '" + * +processInstId+"' AND USER_ID = '"+userid+"' AND READSTATE = '已读'"); + * if(null!=map) { int readCount = map.getInt("READCOUNT")+1; + * DBSql.update("UPDATE BO_ACT_DATAID SET READSTATE = '已读',READTIMES = '" + * +dateTime+"',READCOUNT = "+readCount+" WHERE PROCESSID = '" + * +processInstId+"' AND USER_ID = '"+userid+"'"); }else { } + */ + //DBSql.update(open,"UPDATE BO_ACT_DATAID SET READSTATE = '已读',READTIMES = '" + dateTime + "',READCOUNT = 1 WHERE PROCESSID = '" + processInstId + "' AND USER_ID = '" + userid + "'"); - //将已读数据插入至BO_ACT_ALREADY_DATAID ,并把BO_ACT_DATAID中此条已读数据删除 + //将已读数据插入至BO_ACT_ALREADY_DATAID ,并把BO_ACT_DATAID中此条已读数据删除 /*String sql = "INSERT INTO BO_ACT_ALREADY_DATAID (\"ID\",ORGID,BINDID,CREATEDATE,CREATEUSER,UPDATEDATE,UPDATEUSER,PROCESSDEFID,ISEND,PROCESSID,USER_ID,USERDEP,READTIMES,DATAID,\"RESULT\",TITLE,SENDTYPE,READSTATE,READCOUNT,\"TYPE\")\n" + "\t\t\t\tSELECT \"ID\",ORGID,BINDID,CREATEDATE,CREATEUSER,UPDATEDATE,UPDATEUSER,PROCESSDEFID,ISEND,PROCESSID,USER_ID,USERDEP,READTIMES,DATAID,\"RESULT\",TITLE,SENDTYPE,READSTATE,READCOUNT,\"TYPE\"\n" + "\t\t\t\tFROM BO_ACT_DATAID WHERE READSTATE='已读' AND PROCESSID = '" + processInstId + "' AND USER_ID = '" + userid + "'"; DBSql.update(sql);*/ - String sqly = "SELECT PROCESSID,USER_ID,USERDEP,READTIMES,DATAID,TITLE,SENDTYPE,READSTATE,READCOUNT FROM BO_ACT_DATAID WHERE PROCESSID='" + processInstId + "' AND USER_ID='"+userid+"' "; - RowMap mapsy = DBSql.getMap(sqly); - if (null != mapsy && !mapsy.isEmpty()) { - String alsqly = "SELECT USER_ID FROM BO_ACT_ALREADY_DATAID WHERE PROCESSID='" + processInstId + "' AND USER_ID='"+userid+"' "; - if(alsqly==null){ - String sql = "insert into BO_ACT_ALREADY_DATAID (ID,PROCESSID,USER_ID,READTIMES,DATAID,TITLE,READSTATE) values ('%s', '%s', '%s', '%s', '%s', '%s','%s')"; - String id = UUIDGener.getUUID(); - int update = DBSql.update(String.format(sql, id, mapsy.getString("PROCESSID"), mapsy.getString("USER_ID"), mapsy.get("READTIMES"), mapsy.getString("DATAID"),mapsy.getString("TITLE"),mapsy.getString("READSTATE"))); - if(update!=0){ - String sql1 = "DELETE FROM BO_ACT_DATAID WHERE READSTATE='已读' AND PROCESSID='"+processInstId+"'AND USER_ID='"+userid+"'"; - DBSql.update(sql1); + String sqly = "SELECT PROCESSID,USER_ID,USERDEP,READTIMES,DATAID,TITLE,SENDTYPE,READSTATE,READCOUNT,ID FROM BO_ACT_DATAID WHERE PROCESSID='" + processInstId + "' AND USER_ID='"+userid+"' "; + RowMap mapsy = DBSql.getMap(open,sqly); + if (null != mapsy && !mapsy.isEmpty()) { + String alsqly = "SELECT USER_ID FROM BO_ACT_ALREADY_DATAID WHERE PROCESSID='" + processInstId + "' AND USER_ID='"+userid+"' "; + RowMap alsqlyMap = DBSql.getMap(open,alsqly); + if(alsqlyMap==null){ + String sql = "insert into BO_ACT_ALREADY_DATAID (ID,PROCESSID,USER_ID,READTIMES,DATAID,TITLE,READSTATE) values ('%s', '%s', '%s', '%s', '%s', '%s','%s')"; + String id = UUIDGener.getUUID(); + int update = DBSql.update(open,String.format(sql, id, mapsy.getString("PROCESSID"), mapsy.getString("USER_ID"), dateTime, mapsy.getString("DATAID"),mapsy.getString("TITLE"),mapsy.getString("READSTATE"))); + + /* ProcessInstance boProcessInstance = SDK.getProcessAPI() + .createBOProcessInstance("obj_1a2207bf57eb4ed982ed24b9ed80e260", "admin", "OA已阅日志"); + + BO bo=new BO(); + bo.set("PROCESSID",mapsy.getString("PROCESSID")); + bo.set("USER_ID",mapsy.getString("USER_ID")); + bo.set("READTIMES",mapsy.getString("READTIMES")); + bo.set("DATAID",mapsy.getString("DATAID")); + bo.set("TITLE",mapsy.getString("TITLE")); + bo.set("READSTATE",mapsy.getString("READSTATE")); + int count=SDK.getBOAPI().create("BO_ACT_ALREADY_DATAID", bo, boProcessInstance.getId(), boProcessInstance.getCreateUser());*/ + + if(update!=0){ + System.out.println("count==========="+update); + String sql1 = "DELETE FROM BO_ACT_DATAID WHERE PROCESSID='"+processInstId+"'AND USER_ID='"+userid+"'"; + DBSql.update(open,sql1); + + //SDK.getBOAPI().remove("BO_ACT_DATAID",mapsy.getString("ID")); + } } } - } + } + String logTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); + BO bo = new BO(); + ORGAPI orgapi = SDK.getORGAPI(); + UserModel user = orgapi.getUser(userid); + DepartmentModel departmentByUser = orgapi.getDepartmentByUser(userid); + bo.set("LOGINUSERNAME", userid); + bo.set("USERBUNAME", user.getExt4()); + bo.set("USERPOST", user.getPositionName()); + bo.set("USERDEPTNAME", departmentByUser.getPathNameOfCache()); + bo.set("LOGINTIME", logTime); + bo.set("LOGINCOUNTS", 1); + bo.set("LOGTYPE", Integer.valueOf(logType)); + SDK.getBOAPI().createDataBO("BO_EU_USER_LOGIN_LOG", bo, UserContext.fromUID("admin")); + + DBSql.close(open); + } catch (Exception e) { + DBSql.close(open); + e.printStackTrace(); } - String logTime = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); - BO bo = new BO(); - ORGAPI orgapi = SDK.getORGAPI(); - UserModel user = orgapi.getUser(userid); - DepartmentModel departmentByUser = orgapi.getDepartmentByUser(userid); - bo.set("LOGINUSERNAME", userid); - bo.set("USERBUNAME", user.getExt4()); - bo.set("USERPOST", user.getPositionName()); - bo.set("USERDEPTNAME", departmentByUser.getPathNameOfCache()); - bo.set("LOGINTIME", logTime); - bo.set("LOGINCOUNTS", 1); - bo.set("LOGTYPE", Integer.valueOf(logType)); - SDK.getBOAPI().createDataBO("BO_EU_USER_LOGIN_LOG", bo, UserContext.fromUID("admin")); } } @@ -242,6 +268,10 @@ public class TaskController { //pc端待阅 @Mapping("com.yili_process_page") public String processTest(UserContext me, RequestParams params) throws IOException, SQLException { + + long start_time = System.currentTimeMillis(); + System.out.println("com.yili_process_page开始时间>>>>>>>>>>>>"+start_time); + // System.out.println("params>>>>>>>>>>>>"+params.toString()); // System.out.println("UserContext>>>>>>>>>>>>"+me.getUID()); String userMobile = me.getDeviceType(); @@ -257,7 +287,7 @@ public class TaskController { ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(processInstId); try { // 记录门户待阅 - setRecord(me.getUID(), processInstId, instanceById.getTitle()); + setRecord(me.getUID(), processInstId, instanceById.getTitle(),conn); } catch (Exception e) { @@ -676,7 +706,8 @@ public class TaskController { HttpClient client = new HttpClient(); int timeout = 10000; String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String s = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String s = uc.doPostSoap(readurl, xmlStr, ""); System.err.println(instanceById.getTitle() + "OA待阅PC端阅读返回=======>" + s); String nums = DBSql.getString( "select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'"); @@ -705,7 +736,8 @@ public class TaskController { HttpClient client = new HttpClient(); int timeout = 10000; String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String s = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String s = uc.doPostSoap(readurl, xmlStr, ""); System.err.println(instanceById.getTitle() + "OA待阅PC端阅读返回=======>" + s); String nums = DBSql.getString( "select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'"); @@ -723,25 +755,29 @@ public class TaskController { // 用户打开阅览界面日志 setUserLog(processInstId, me.getUID(), "3"); + long have_time = System.currentTimeMillis(); + + System.out.println("com.yili_process_page耗时时间>>>>>>>>>>>>"+(have_time-start_time)/ 1000 + "秒"); + DBSql.close(conn); // } } catch (Exception e) { e.printStackTrace(); } finally { - conn.close(); + DBSql.close(conn); } return HtmlPageTemplate.merge("com.awspaas.user.apps.yili.integration", html, map); } //门户待阅同步更新 - public String setRecord(String uid, String id, String fileName) { + public String setRecord(String uid, String id, String fileName,Connection conn) { String sql = "SELECT READFILECOUNT FROM BO_EU_PAL_RECORD WHERE FILEID = ? AND READFILENAME = ?"; - RowMap map= DBSql.getMap(sql, new Object[]{id, uid}); + RowMap map= DBSql.getMap(conn,sql, new Object[]{id, uid}); int num = 0; if (null != map) { String readCount = map.getString("READFILECOUNT"); int count = Integer.parseInt(readCount) + 1; String s = "UPDATE BO_EU_PAL_RECORD SET READFILECOUNT = ? WHERE FILEID = ? AND READFILENAME = ?"; - num = DBSql.update(s, new Object[]{count, id, uid}); + num = DBSql.update(conn,s, new Object[]{count, id, uid}); } else { BO bo = new BO(); bo.set("FILEID", id); @@ -758,6 +794,8 @@ public class TaskController { @Mapping("com.yili_process_page_phone") public String processPhone(UserContext me, RequestParams params) throws SQLException { + long start_time = System.currentTimeMillis(); + System.out.println("com.yili_process_page_phone开始时间>>>>>>>>>>>>"+start_time); ArrayList isNumberAscArray = new ArrayList(); String userMobile = me.getDeviceType(); Connection conn = DBSql.open(); @@ -773,7 +811,7 @@ public class TaskController { ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(processInstId); try { //记录门户待阅 - setRecord(me.getUID(), processInstId, instanceById.getTitle()); + setRecord(me.getUID(), processInstId, instanceById.getTitle(),conn); } catch (Exception e) { @@ -1375,7 +1413,8 @@ public class TaskController { + " " + " " + ""; int timeout = 10000; String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String s = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String s = uc.doPostSoap(readurl, xmlStr, ""); //System.err.println(instanceById.getTitle()+"_OA待阅移动端阅读返回=======>"+s); String nums = DBSql.getString( "select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'"); @@ -1402,7 +1441,8 @@ public class TaskController { + " " + " " + ""; int timeout = 10000; String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl"); - String s = UtilUrl.doPostSoap(readurl, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String s = uc.doPostSoap(readurl, xmlStr, ""); System.err.println(instanceById.getTitle() + "_OA待阅移动端阅读返回=======>" + s); String nums = DBSql.getString( "select READNUM from BO_EU_PAL_READ_LOG where PROCESSID = '" + processInstId + "'"); @@ -1463,11 +1503,18 @@ public class TaskController { * DBSql.update("update BO_EU_PAL_READ_LOG set READNUM = '" + read_num + * "' where PROCESSID = '" + processInstId + "'"); } */ + DBSql.close(conn); } catch (Exception e) { e.printStackTrace(); } finally { - conn.close(); + DBSql.close(conn); } + + long have_time = System.currentTimeMillis(); + + System.out.println("com.yili_process_page_phone耗时时间>>>>>>>>>>>>"+(have_time-start_time)/ 1000 + "秒"); + + return HtmlPageTemplate.merge("com.awspaas.user.apps.yili.integration", html, map); } diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/HttpClientUtils.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/HttpClientUtils.java index eb12023e..6a90031a 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/HttpClientUtils.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/HttpClientUtils.java @@ -57,7 +57,8 @@ public class HttpClientUtils { ""; System.out.println("xmlstr================"+xmlStr); - String postSoap = UtilUrl.doPostSoap(url, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(url, xmlStr, ""); return postSoap; } @@ -77,7 +78,8 @@ public class HttpClientUtils { ""; System.out.println("xmlstr================"+xmlStr); - String postSoap = UtilUrl.doPostSoap(url, xmlStr, ""); + UtilUrl uc=new UtilUrl(); + String postSoap = uc.doPostSoap(url, xmlStr, ""); return postSoap; } diff --git a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/UtilUrl.java b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/UtilUrl.java index 6929aa81..af47b06e 100644 --- a/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/UtilUrl.java +++ b/com.awspaas.user.apps.yili.integration/src/com/awspaas/user/apps/integration/util/UtilUrl.java @@ -19,7 +19,7 @@ import java.nio.charset.Charset; public class UtilUrl { //使用SOAP1.1发送消息 - public static String doPostSoap(String postUrl, String soapXml, String soapAction) { + public String doPostSoap(String postUrl, String soapXml, String soapAction) { String retStr = ""; // 创建HttpClientBuilder HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();