流程发布,待阅界面附件按名称排序
This commit is contained in:
parent
fe0e3ba494
commit
38a3dac969
@ -1739,7 +1739,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
JSONArray js = new JSONArray();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'").append(" ORDER BY CREATETIME ASC");
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'").append(" ORDER BY FILENAME ASC");
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
if (fileList != null && fileList.size() > 0)
|
||||
for (UpfileModel upfileModel : fileList)
|
||||
@ -1816,7 +1816,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
JSONArray js = new JSONArray();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'").append(" ORDER BY CREATETIME ASC");;
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'").append(" ORDER BY FILENAME ASC");;
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
if (fileList != null && fileList.size() > 0)
|
||||
for (UpfileModel upfileModel : fileList)
|
||||
@ -1931,7 +1931,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
JSONArray js = new JSONArray();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'").append(" ORDER BY CREATETIME ASC");;
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'").append(" ORDER BY FILENAME ASC");;
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
if (fileList != null && fileList.size() > 0)
|
||||
for (UpfileModel upfileModel : fileList)
|
||||
@ -2009,7 +2009,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
JSONArray js = new JSONArray();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'").append(" ORDER BY CREATETIME ASC");;
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'").append(" ORDER BY FILENAME ASC");;
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
if (fileList != null && fileList.size() > 0)
|
||||
for (UpfileModel upfileModel : fileList)
|
||||
@ -2962,7 +2962,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
JSONArray js = new JSONArray();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'").append(" ORDER BY CREATETIME ASC");
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(publishId).append("'").append(" ORDER BY FILENAME ASC");
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
if (fileList != null && fileList.size() > 0)
|
||||
for (UpfileModel upfileModel : fileList)
|
||||
@ -3067,7 +3067,7 @@ public class ProcessPublishWeb extends ActionWeb {
|
||||
JSONArray js = new JSONArray();
|
||||
UpFileDao upFileDao = new UpFileDao();
|
||||
StringBuilder sqlWhere = new StringBuilder();
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'").append(" ORDER BY CREATETIME ASC");
|
||||
sqlWhere.append(" and PALREPOSITORYID ='").append(changeId).append("'").append(" ORDER BY FILENAME ASC");
|
||||
List<UpfileModel> fileList = upFileDao.search(sqlWhere.toString());
|
||||
if (fileList != null && fileList.size() > 0)
|
||||
for (UpfileModel upfileModel : fileList)
|
||||
|
||||
@ -83,6 +83,15 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
}
|
||||
BO bo = SDK.getBOAPI().query(PublisherConstant.BOTABLENAME).detailByBindId(processInstId);
|
||||
Timestamp nowTime = new Timestamp(System.currentTimeMillis());
|
||||
String publishDateType = bo.getString("CHOICEEFFECTIVEDATE");
|
||||
String publishDate = bo.getString("EFFECTIVEDATE");
|
||||
if("1".equals(publishDateType)) {
|
||||
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(publishDate);
|
||||
Timestamp stamp = new Timestamp(date.getTime());
|
||||
model.setPublishDate(stamp);
|
||||
}else {
|
||||
model.setPublishDate(nowTime);
|
||||
}
|
||||
model.setId(UUIDGener.getUUID());
|
||||
model.setProcessInstId(processInstId);
|
||||
model.setWsId(bo.get("WSID").toString());
|
||||
@ -96,7 +105,6 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
auditorId = bo.get("AUDITOR1").toString();
|
||||
}
|
||||
model.setAuditorId(auditorId);
|
||||
model.setPublishDate(nowTime);
|
||||
model.setPublishDesc(bo.get("PUBLISHDESC") == null ? "" : bo.get("PUBLISHDESC").toString());
|
||||
model.setTeamId(bo.get("TEAMID").toString());
|
||||
|
||||
@ -373,6 +381,8 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
// 制度:control.policy effective_date
|
||||
String applyUser = bo.getString("APPLYUSERID");// 以申请人身份创建流程手册
|
||||
String date = UtilDate.datetimeFormat(publishDate);
|
||||
String publishDateType = bo.getString("CHOICEEFFECTIVEDATE");
|
||||
String publishDatet = bo.getString("EFFECTIVEDATE");
|
||||
PALRepositoryPropertyDao propertyDao = new PALRepositoryPropertyDao();
|
||||
// 创建线程池进行流程手册的处理
|
||||
ExecutorService service = Executors.newFixedThreadPool(4);
|
||||
@ -386,7 +396,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
continue;
|
||||
}
|
||||
// 新增模型时间
|
||||
if (updatePropertyEffectiveDate(model, date, propertyDao)) {
|
||||
if (updatePropertyEffectiveDate(model, date, propertyDao,publishDateType,publishDatet)) {
|
||||
// 重新创建手册
|
||||
service.execute(new Runnable() {
|
||||
@Override
|
||||
@ -406,7 +416,7 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
continue;
|
||||
}
|
||||
// 新增模型时间
|
||||
if (updatePropertyEffectiveDate(model, date, propertyDao)) {
|
||||
if (updatePropertyEffectiveDate(model, date, propertyDao,publishDateType,publishDatet)) {
|
||||
// 重新创建手册
|
||||
service.execute(new Runnable() {
|
||||
@Override
|
||||
@ -550,13 +560,15 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
* @param date
|
||||
* @param propertyDao
|
||||
*/
|
||||
private boolean updatePropertyEffectiveDate(PALRepositoryModel model, String date, PALRepositoryPropertyDao propertyDao) {
|
||||
private boolean updatePropertyEffectiveDate(PALRepositoryModel model, String date, PALRepositoryPropertyDao propertyDao,String publishDateType,String publishDate) {
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String time= df.format(new Date());
|
||||
// epc:process.epc effective_date
|
||||
// 表单:data.form form_effective_date
|
||||
// 制度:control.policy effective_date
|
||||
String method = model.getMethodId();
|
||||
//
|
||||
|
||||
String attrId = "";
|
||||
if ("process.epc".equals(method)) {
|
||||
attrId = "effective_date";
|
||||
@ -574,7 +586,12 @@ public class PublishExecuteListenerInterfaceImpl extends ExecuteListener impleme
|
||||
List<PALRepositoryPropertyModel> list = propertyDao.getPropertysByPlid(model.getId(), attrId);
|
||||
for (PALRepositoryPropertyModel propertyModel : list) {
|
||||
if (attrId.equals(propertyModel.getPropertyId())) {
|
||||
propertyDao.updatePropertyByPropertyId(model.getId(), attrId, time);
|
||||
if("1".equals(publishDateType)) {
|
||||
propertyDao.updatePropertyByPropertyId(model.getId(), attrId, publishDate);
|
||||
}else {
|
||||
propertyDao.updatePropertyByPropertyId(model.getId(), attrId, time);
|
||||
|
||||
}
|
||||
SDK.getLogAPI().consoleInfo("[更新模型生效时间]成功,模型[" + model.getName() + "][" + model.getId() + "],生效时间[" + time + "]");
|
||||
existProp = true;
|
||||
}
|
||||
|
||||
@ -106,9 +106,13 @@ public class PublishFormBeforeSaveEvent extends InterruptListener implements Int
|
||||
//获取关联模型id
|
||||
String relationFileId= null;
|
||||
try {
|
||||
relationFileId = JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
|
||||
String propertyValue = propertyModel.getPropertyValue();
|
||||
System.err.println("propertyValue========>"+propertyValue);
|
||||
if(UtilString.isNotEmpty(propertyValue)&&propertyValue.contains("{")) {
|
||||
relationFileId = JSONObject.parseObject(propertyModel.getPropertyValue()).getString("relationFileId");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// e.printStackTrace();
|
||||
throw new BPMNError("0313", sb.append("模型名称:").append(model.getName()).append("关联支持文件异常,请联系管理员!!!").append("</br>").toString());
|
||||
}
|
||||
|
||||
|
||||
@ -311,9 +311,7 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 二次推送
|
||||
|
||||
List<RowMap> List = DBSql.getMaps("SELECT NAME FROM BO_EU_READ_COUNT WHERE PROCESSID = '"
|
||||
+ instanceById.getId() + "' AND RESULT = '待处理'");
|
||||
if (List.size() != 0) {
|
||||
@ -322,7 +320,7 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
try {
|
||||
ArrayList<String> userList3 = new ArrayList<String>();
|
||||
String userIds = rowMap.getString("NAME");
|
||||
System.err.println(instanceById.getTitle() + "二次推送账号=======>" + userList3);
|
||||
System.err.println(instanceById.getTitle() + "二次推送账号=======>" + userIds);
|
||||
SendOARead(jsonObject, instanceById, userIds, "单个账号推送");
|
||||
} catch (Exception e) { // TODO: handle exception
|
||||
}
|
||||
@ -479,10 +477,9 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
UpfileWeb upfileWeb = new UpfileWeb(userContext);
|
||||
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where PLMETHODID != 'process.framework' AND ID= '"
|
||||
+ map.getString("ID") + "'" + ")";
|
||||
+ map.getString("ID") + "'" + ") ORDER BY FILENAME ASC";
|
||||
List<RowMap> maps = DBSql.getMaps(sql_upfile);
|
||||
for (RowMap row : maps) {
|
||||
System.out.println("附件名称>>>>>>" + row.getString("FILENAME"));
|
||||
if (!row.getString("FILENAME").contains(".xml")) {
|
||||
UpfileModel upfileModel = new UpfileModel();
|
||||
upfileModel.setType(row.getString("FILETYPE"));
|
||||
@ -493,7 +490,6 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
paramss.put("dc", dcContexts);
|
||||
AppAPI appAPIs = SDK.getAppAPI();
|
||||
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, paramss);
|
||||
System.out.println("流程模型附件的生成=============" + ros);
|
||||
}
|
||||
}
|
||||
|
||||
@ -726,17 +722,40 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
+ " </soapenv:Body>" + "</soapenv:Envelope>";
|
||||
// System.out.println("xmlStr>>>>>>>>" + xmlStr);
|
||||
String readurl = SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "readurl");
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
// System.out.println("rootElement>>>>>>" + rootElement);
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("data");
|
||||
String status = jsonObject1.getString("status");
|
||||
// System.out.println("推送》》》》》》》》》》》" + status);
|
||||
if ("false".equals(status)) {
|
||||
try {
|
||||
String postSoap = UtilUrl.doPostSoap(readurl, xmlStr, "");
|
||||
Document document = DocumentHelper.parseText(postSoap);
|
||||
Element rootElement = document.getRootElement();
|
||||
// System.out.println("rootElement>>>>>>" + rootElement);
|
||||
Element result = rootElement.element("Body").element("serviceResponse").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("data");
|
||||
String status = jsonObject1.getString("status");
|
||||
// System.out.println("推送》》》》》》》》》》》" + status);
|
||||
if ("true".equals(status)) {
|
||||
JSONArray resultArray = JSONObject.parseArray(datas);
|
||||
//System.out.println(processInstance.getTitle() + "待阅推送成功:" + idList.size()+"人");
|
||||
for (int j = 0; j < resultArray.size(); j++) {
|
||||
JSONObject jsonObject2 = resultArray.getJSONObject(j);
|
||||
String user = jsonObject2.get("user").toString();
|
||||
String dataid = jsonObject2.get("dataid").toString();
|
||||
BO bo = new BO();
|
||||
bo.set("TITLE", processInstance.getTitle());
|
||||
bo.set("PROCESSID", processInstance.getId());
|
||||
bo.set("USER_ID", user);
|
||||
bo.set("USERDEP", SDK.getORGAPI().getUser(user).getDepartmentId());
|
||||
bo.set("DATAID", dataid);
|
||||
bo.set("RESULT", status);
|
||||
bo.set("SENDTYPE", "1");
|
||||
bo.set("READSTATE", "未读");
|
||||
bo.set("TYPE", type);
|
||||
SDK.getBOAPI().create("BO_ACT_DATAID", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
}
|
||||
if("单个账号推送".equals(type)) {
|
||||
DBSql.update("UPDATE BO_EU_READ_COUNT SET RESULT = '已重新推送' WHERE PROCESSID = '"+processInstId+"' AND NAME = '"+userIds+"'");
|
||||
}
|
||||
} else {
|
||||
System.out.println(processInstance.getTitle() + "待阅推送失败:" + userIds);
|
||||
try {
|
||||
BO bo = new BO();
|
||||
@ -750,30 +769,20 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
JSONArray resultArray = JSONObject.parseArray(datas);
|
||||
//System.out.println(processInstance.getTitle() + "待阅推送成功:" + idList.size()+"人");
|
||||
for (int j = 0; j < resultArray.size(); j++) {
|
||||
JSONObject jsonObject2 = resultArray.getJSONObject(j);
|
||||
String user = jsonObject2.get("user").toString();
|
||||
String dataid = jsonObject2.get("dataid").toString();
|
||||
} catch (Exception e) {
|
||||
System.out.println(processInstance.getTitle() + "待阅推送失败:" + userIds);
|
||||
BO bo = new BO();
|
||||
bo.set("TITLE", processInstance.getTitle());
|
||||
bo.set("PROCESSID", processInstance.getId());
|
||||
bo.set("USER_ID", user);
|
||||
bo.set("USERDEP", SDK.getORGAPI().getUser(user).getDepartmentId());
|
||||
bo.set("DATAID", dataid);
|
||||
bo.set("RESULT", status);
|
||||
bo.set("SENDTYPE", "1");
|
||||
bo.set("READSTATE", "未读");
|
||||
bo.set("NAME", userIds);
|
||||
bo.set("TYPE", type);
|
||||
SDK.getBOAPI().create("BO_ACT_DATAID", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
}
|
||||
if("单个账号推送".equals(type)) {
|
||||
DBSql.update("UPDATE BO_EU_READ_COUNT SET RESULT = '已重新推送' WHERE PROCESSID = '"+processInstId+"' AND NAME = '"+userIds+"'");
|
||||
}
|
||||
bo.set("RESULT", "待处理");
|
||||
bo.set("PROCESSID", processInstId);
|
||||
bo.set("DEPNAME", SDK.getORGAPI().getUser(userIds).getDepartmentId());
|
||||
SDK.getBOAPI().create("BO_EU_READ_COUNT", bo, processInstance.getId(), processInstance.getCreateUser());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1173,15 +1182,19 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
//知识名称,必填
|
||||
|
||||
String level = "";
|
||||
|
||||
if (map.getString("PLVER").contains(".00")) {
|
||||
String[] plvers = map.getString("PLVER").split("\\.");
|
||||
plvers[1] = plvers[1].replaceAll("0", "");
|
||||
level = plvers[0] + "." + plvers[1];
|
||||
} else {
|
||||
level = map.getString("PLVER");
|
||||
if (map != null) {
|
||||
String pver = map.getString("PLVER");
|
||||
if (UtilString.isNotEmpty(pver)) {
|
||||
if (pver.contains(".00")) {
|
||||
String levels = pver;
|
||||
String[] plvers = levels.split("\\.");
|
||||
plvers[1] = plvers[1].replaceAll("0", "");
|
||||
level = plvers[0] + "." + plvers[1];
|
||||
} else {
|
||||
level = pver + ".0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
params_create.put("knwlName", map.getString("PLNAME") + "V" + level);
|
||||
//是否可以评论,必填
|
||||
params_create.put("isComment", true);
|
||||
@ -1202,7 +1215,6 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
ResponseObject ro_create = appAPI_create.callASLP(
|
||||
appAPI_create.getAppContext(processExecutionContext.getProcessInstance().getAppId()),
|
||||
aslps_create, params_create);
|
||||
System.out.println("ro_create================" + ro_create);
|
||||
String cardId = ((LinkedHashMap) ro_create.getData()).get("cardId").toString();
|
||||
JSONArray jsonArray1 = new JSONArray();
|
||||
if (bo_act_coe_publish.getString("SEND_SCOP").equals("0")) {
|
||||
@ -1235,14 +1247,18 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<RowMap> select_id_from_orgdepartment = DBSql.getMaps("select ID from ORGDEPARTMENT");
|
||||
for (RowMap depaid : select_id_from_orgdepartment) {
|
||||
String id = depaid.getString("ID");
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType", "department");
|
||||
jsonObjecta.put("assignmentId", id);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
List<DepartmentModel> departmentsByCompanyId = SDK.getORGAPI().getDepartmentsByCompanyId(1,
|
||||
"8911e732-b42a-4556-853f-ad32761bcbee");
|
||||
for (DepartmentModel departmentModel : departmentsByCompanyId) {
|
||||
String depId = departmentModel.getId();
|
||||
// 查询未注销的部门并且去掉系统部门
|
||||
if (!departmentModel.isClosed()&& !"e79281b1-2f81-4895-b30e-9f96e9ad0e2c".equals(depId)&& !"65048aee-157f-49f2-a2dc-5903dd26f519".equals(depId)) {
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType","department");
|
||||
jsonObjecta.put("assignmentId",depId);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AddKnwlAC(processExecutionContext, jsonArray1, processExecutionContext.getUserContext().getSessionId(),
|
||||
@ -1296,12 +1312,17 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
//知识名称,必填
|
||||
String level = "";
|
||||
if (map != null) {
|
||||
if (map.getString("PLVER").contains(".00")) {
|
||||
String[] plvers = map.getString("PLVER").split("\\.");
|
||||
plvers[1] = plvers[1].replaceAll("0", "");
|
||||
level = plvers[0] + "." + plvers[1];
|
||||
} else {
|
||||
level = map.getString("PLVER");
|
||||
String pver = map.getString("PLVER");
|
||||
if(UtilString.isNotEmpty(pver)) {
|
||||
if (pver.contains(".00")) {
|
||||
System.out.println("PLver>>>>>>>>>>" + pver);
|
||||
String levels = pver;
|
||||
String[] plvers = levels.split("\\.");
|
||||
plvers[1] = plvers[1].replaceAll("0", "");
|
||||
level = plvers[0] + "." + plvers[1];
|
||||
} else {
|
||||
level = pver + ".0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1358,14 +1379,18 @@ public class ProcessEndAfterEvent extends ExecuteListener implements ExecuteList
|
||||
}
|
||||
|
||||
} else {
|
||||
List<RowMap> select_id_from_orgdepartment = DBSql.getMaps("select ID from ORGDEPARTMENT");
|
||||
for (RowMap depaid : select_id_from_orgdepartment) {
|
||||
String id = depaid.getString("ID");
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType", "department");
|
||||
jsonObjecta.put("assignmentId", id);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
List<DepartmentModel> departmentsByCompanyId = SDK.getORGAPI().getDepartmentsByCompanyId(1,
|
||||
"8911e732-b42a-4556-853f-ad32761bcbee");
|
||||
for (DepartmentModel departmentModel : departmentsByCompanyId) {
|
||||
String depId = departmentModel.getId();
|
||||
// 查询未注销的部门并且去掉系统部门
|
||||
if (!departmentModel.isClosed()&& !"e79281b1-2f81-4895-b30e-9f96e9ad0e2c".equals(depId)&& !"65048aee-157f-49f2-a2dc-5903dd26f519".equals(depId)) {
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType","department");
|
||||
jsonObjecta.put("assignmentId",depId);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
}
|
||||
}
|
||||
AddKnwlAC(processExecutionContext, jsonArray1, processExecutionContext.getUserContext().getSessionId(),
|
||||
cardId);
|
||||
|
||||
@ -12,11 +12,13 @@ import com.actionsoft.bpms.bo.engine.BO;
|
||||
import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
|
||||
import com.actionsoft.bpms.commons.database.RowMap;
|
||||
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
|
||||
import com.actionsoft.bpms.org.model.DepartmentModel;
|
||||
import com.actionsoft.bpms.schedule.IJob;
|
||||
import com.actionsoft.bpms.server.SSOUtil;
|
||||
import com.actionsoft.bpms.server.UserContext;
|
||||
import com.actionsoft.bpms.server.fs.DCContext;
|
||||
import com.actionsoft.bpms.util.DBSql;
|
||||
import com.actionsoft.bpms.util.UtilString;
|
||||
import com.actionsoft.exception.AWSException;
|
||||
import com.actionsoft.sdk.local.SDK;
|
||||
import com.actionsoft.sdk.local.api.AppAPI;
|
||||
@ -43,143 +45,82 @@ public class CreateDataKnow implements IJob {
|
||||
|
||||
private static String USERID = "admin";
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
SSOUtil ssoUtil = new SSOUtil();
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
String sid = ssoUtil.registerClientSessionNoPassword(USERID, "cn", portalUrl, "pc");
|
||||
UserContext userContext = UserContext.fromSessionId(sid);
|
||||
System.out.println("创建知识准备开始===============");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
System.out.println("开始时间是>>>>>>>>>>"+sdf.format(new Date()));
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY " +
|
||||
"where PLCATEGORY = 'process'and PLMETHODID !='process.framework' " +
|
||||
"and ISPUBLISH = '1' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试'" +
|
||||
",'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试')" +
|
||||
" and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e'," +
|
||||
"'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09'," +
|
||||
"'36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5'," +
|
||||
"'98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093'," +
|
||||
"'79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c'," +
|
||||
"'42c09260-c1d3-44b7-ac3d-f8280e04c294')";
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
SSOUtil ssoUtil = new SSOUtil();
|
||||
String portalUrl = SDK.getPortalAPI().getPortalUrl();
|
||||
String sid = ssoUtil.registerClientSessionNoPassword(USERID, "cn", portalUrl, "pc");
|
||||
UserContext userContext = UserContext.fromSessionId(sid);
|
||||
System.out.println("创建知识准备开始===============");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
System.out.println("开始时间是>>>>>>>>>>" + sdf.format(new Date()));
|
||||
String sql = "select * from APP_ACT_COE_PAL_REPOSITORY "
|
||||
+ "where PLCATEGORY = 'process'and PLMETHODID !='process.framework' "
|
||||
+ "and ISPUBLISH = '1' and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试'"
|
||||
+ ",'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试')"
|
||||
+ " and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e',"
|
||||
+ "'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09',"
|
||||
+ "'36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5',"
|
||||
+ "'98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093',"
|
||||
+ "'79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c',"
|
||||
+ "'42c09260-c1d3-44b7-ac3d-f8280e04c294')";
|
||||
List<RowMap> rowMapList = DBSql.getMaps(sql);
|
||||
for (RowMap rowmap : rowMapList) {
|
||||
String card_sql = "SELECT * FROM APP_ACT_KMS_CARD WHERE CARDNAME like '" + rowmap.getString("PLNAME")
|
||||
+ "%'";
|
||||
RowMap map = DBSql.getMap(card_sql);
|
||||
if (map != null) {
|
||||
String sql_pal = "SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT4 = '" + map.getString("ID") + "'";
|
||||
RowMap rowMap = DBSql.getMap(sql_pal);
|
||||
if (rowMap != null) {
|
||||
System.out.println("该知识已经存在于PAL资产库中的EXT4中,并且已经在知识中");
|
||||
} else {
|
||||
String level = "";
|
||||
if (rowmap != null) {
|
||||
if (rowmap.getString("PLVER").contains(".00")) {
|
||||
String[] plvers = rowmap.getString("PLVER").split("\\.");
|
||||
plvers[1] = plvers[1].replaceAll("0", "");
|
||||
level = plvers[0] + "." + plvers[1];
|
||||
} else {
|
||||
level = rowmap.getString("PLVER") + ".0";
|
||||
}
|
||||
}
|
||||
try {
|
||||
CreateKnow(rowmap.getString("PLMETHODID"), rowmap.getString("PLNAME") + "V" + level,
|
||||
rowmap.getString("PLNAME"), rowmap.getString("PLVER"), true, true, "2099-12-31", "1",
|
||||
USERID, "", sid);
|
||||
|
||||
List<RowMap> rowMapList = DBSql.getMaps(sql);
|
||||
for (RowMap rowmap:rowMapList
|
||||
) {
|
||||
String card_sql = "SELECT * FROM APP_ACT_KMS_CARD WHERE CARDNAME like '"+rowmap.getString("PLNAME")+"%'";
|
||||
RowMap map = DBSql.getMap(card_sql);
|
||||
if (map!=null){
|
||||
String sql_pal = "SELECT * FROM APP_ACT_COE_PAL_REPOSITORY WHERE EXT4 = '"+map.getString("ID")+"'";
|
||||
RowMap rowMap = DBSql.getMap(sql_pal);
|
||||
if (rowMap!=null){
|
||||
System.out.println("该知识已经存在于PAL资产库中的EXT4中,并且已经在知识中");
|
||||
}else{
|
||||
String level = "";
|
||||
if (rowMap!=null){
|
||||
} catch (Exception e) {
|
||||
System.err.println("=====创建知识异常=====>" + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
if (rowmap.getString("PLVER").contains(".00")){
|
||||
String[] plvers = rowmap.getString("PLVER").split("\\.");
|
||||
plvers[1] = plvers[1].replaceAll("0","");
|
||||
level = plvers[0]+"."+plvers[1];
|
||||
}else {
|
||||
level = rowmap.getString("PLVER")+".0";
|
||||
}
|
||||
}
|
||||
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+"V"+level,rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
|
||||
/*Map names = new LinkedHashMap<>();
|
||||
|
||||
String plname = rowmap.getString("PLNAME");
|
||||
for (int i=0;i<4;i++) {
|
||||
String sql_de = sql+" and PLNAME = '"+plname+"'";
|
||||
RowMap map1 = DBSql.getMap(sql_de);
|
||||
if (map1!=null){
|
||||
names.put(i,map1.getString("PLNAME"));
|
||||
plname = map1.getString("PLNAME");
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i=names.size() - 1; i >= 0; i--) {
|
||||
String sql_de = sql+" and PLNAME = '"+names.get(i)+"'";
|
||||
RowMap map1 = DBSql.getMap(sql_de);
|
||||
String sql_decre = "select * from APP_ACT_KMS_DIMENSION where DIMENSIONNAME = '"+names.get(i)+"'";
|
||||
RowMap map2 = DBSql.getMap(sql_decre);
|
||||
if (map2==null){
|
||||
|
||||
createDimension(map1.getString("ID"),false,true,"1","","",names.get(i).toString(),sid);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}else {
|
||||
String level = "";
|
||||
if (rowmap!=null){
|
||||
if (rowmap.getString("PLVER").contains(".00")){
|
||||
System.out.println("PLver>>>>>>>>>>"+rowmap.getString("PLVER"));
|
||||
String levels = rowmap.getString("PLVER");
|
||||
String[] plvers = levels.split("\\.");
|
||||
System.out.println("pleces>>>>>>>>>>>>>>>>>"+plvers[0]);
|
||||
plvers[1] = plvers[1].replaceAll("0","");
|
||||
level = plvers[0]+"."+plvers[1];
|
||||
}else {
|
||||
level = rowmap.getString("PLVER")+".0";
|
||||
}
|
||||
}
|
||||
CreateKnow(rowmap.getString("PLMETHODID"),rowmap.getString("PLNAME")+"V"+level,rowmap.getString("PLNAME"),rowmap.getString("PLVER"),true,true,"2099-12-31","1",USERID,"",sid);
|
||||
/*Map names = new LinkedHashMap<>();
|
||||
|
||||
|
||||
String plname = rowmap.getString("PLNAME");
|
||||
String plparentid = rowmap.getString("PLPARENTID");
|
||||
for (int i=0;i<4;i++) {
|
||||
String slq = "select * from APP_ACT_COE_PAL_REPOSITORY where id = '"+plparentid+"'";
|
||||
RowMap map3 = DBSql.getMap(slq);
|
||||
if (map3!=null){
|
||||
names.put(i,map3.getString("PLNAME"));
|
||||
plname = map3.getString("PLNAME");
|
||||
plparentid = map3.getString("PLPARENTID");
|
||||
}else if (plparentid.equals("process")){
|
||||
names.put(i,"流程制度");
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i=names.size() - 1; i >= 0; i--) {
|
||||
if (names.get(i).equals("流程制度")){
|
||||
String sql_decre = "select * from APP_ACT_KMS_DIMENSION where DIMENSIONNAME = '"+names.get(i)+"'";
|
||||
RowMap map2 = DBSql.getMap(sql_decre);
|
||||
if (map2==null){
|
||||
|
||||
createDimension("",false,true,"1","","",names.get(i).toString(),sid);
|
||||
}
|
||||
}else {
|
||||
String sql_de = "select * from APP_ACT_COE_PAL_REPOSITORY " +
|
||||
"where PLCATEGORY = 'process'and PLMETHODID ='process.framework' " +
|
||||
"and PLNAME not in ('流程架构图','测试用','GMY-截图用','sx批量测试'" +
|
||||
",'8.2培训使用','用户练习使用','YX测试分部','yx测试人员','yx测试部','流程架构测试')" +
|
||||
" and PLPARENTID not in ('63ff93c6-2f27-4851-a396-6830c428db2e'," +
|
||||
"'c84f497a-4de3-4404-86e8-cd5af71c3b47','94dabf55-b032-4316-a4c3-00b83763da09'," +
|
||||
"'36ac7cdd-a361-4bd3-9511-c03c1b3627a4','84e534b4-e51a-4874-9ff1-8a0206d9e0c5'," +
|
||||
"'98bd5917-7563-4b29-b775-815e91d9864c','f07da63c-3423-4c1e-ae75-b323c6a69093'," +
|
||||
"'79cb4c35-d2f7-4c43-a7db-44038b557eac','7ad79a73-a497-417a-a5ec-d4c9fd45061c'," +
|
||||
"'42c09260-c1d3-44b7-ac3d-f8280e04c294')"+" and PLNAME = '"+names.get(i)+"'";
|
||||
RowMap map1 = DBSql.getMap(sql_de);
|
||||
String sql_decre = "select * from APP_ACT_KMS_DIMENSION where DIMENSIONNAME = '"+names.get(i)+"'";
|
||||
RowMap map2 = DBSql.getMap(sql_decre);
|
||||
if (map2==null){
|
||||
|
||||
createDimension(map1.getString("ID"),false,true,"1","","",names.get(i).toString(),sid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
System.out.println("知识库同步完成");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String level = "";
|
||||
if (rowmap != null) {
|
||||
if (rowmap.getString("PLVER").contains(".00")) {
|
||||
System.out.println("PLver>>>>>>>>>>" + rowmap.getString("PLVER"));
|
||||
String levels = rowmap.getString("PLVER");
|
||||
String[] plvers = levels.split("\\.");
|
||||
System.out.println("pleces>>>>>>>>>>>>>>>>>" + plvers[0]);
|
||||
plvers[1] = plvers[1].replaceAll("0", "");
|
||||
level = plvers[0] + "." + plvers[1];
|
||||
} else {
|
||||
level = rowmap.getString("PLVER") + ".0";
|
||||
}
|
||||
}
|
||||
try {
|
||||
CreateKnow(rowmap.getString("PLMETHODID"), rowmap.getString("PLNAME") + "V" + level,
|
||||
rowmap.getString("PLNAME"), rowmap.getString("PLVER"), true, true, "2099-12-31", "1",
|
||||
USERID, "", sid);
|
||||
} catch (Exception e) {
|
||||
System.err.println("=====创建知识异常=====>" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
System.out.println("知识库同步完成");
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建知识
|
||||
@ -202,7 +143,7 @@ public class CreateDataKnow implements IJob {
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.actionsoft.apps.kms/CreateKnwl";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
//保密级别, 0: 普通 1:秘密 2:机密,必填
|
||||
params.put("securityLevel", 0);
|
||||
//知识名称,必填
|
||||
@ -226,7 +167,7 @@ public class CreateDataKnow implements IJob {
|
||||
//创建知识
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
if (ro.isOk()){
|
||||
String cardId = ((LinkedHashMap) ro.getData()).get("cardId").toString();
|
||||
String cardId = ((LinkedHashMap<?, ?>) ro.getData()).get("cardId").toString();
|
||||
|
||||
String update_sql = "UPDATE APP_ACT_COE_PAL_REPOSITORY SET EXT4 = '"+cardId+"' WHERE " +
|
||||
" PLCATEGORY = 'process'and PLMETHODID !='process.framework' " +
|
||||
@ -240,7 +181,11 @@ public class CreateDataKnow implements IJob {
|
||||
" '42c09260-c1d3-44b7-ac3d-f8280e04c294') and PLMETHODID = '"+securityLevel+"' and PLNAME = '"+plname+"' AND PLVER = '"+PLVER+"'";
|
||||
int update = DBSql.update(update_sql);
|
||||
System.out.println("更新名称为:"+plname+"版本为:"+PLVER +"的知识对应的资产库的EXT4的影响行数为"+update);
|
||||
creadteFile(userContext,cardId);
|
||||
try {
|
||||
creadteFile(userContext,cardId);
|
||||
} catch (Exception e) {
|
||||
System.err.println("===获取手册和附件异常====>"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -262,105 +207,114 @@ public class CreateDataKnow implements IJob {
|
||||
if (StringUtils.isNotEmpty(cardId)){
|
||||
String sql_ext4 = "select * from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+cardId+"'";
|
||||
RowMap map = DBSql.getMap(sql_ext4);
|
||||
RowMap rowMap = DBSql.getMap("select * from (select * from BO_ACT_COE_PUBLISH_N where PUBLISHFILEID = '"+map.getString("ID")+"' order by CREATEDATE desc) where rownum = 1");
|
||||
if (rowMap!=null){
|
||||
|
||||
if (StringUtils.isNotEmpty(rowMap.getString("TASKID"))) {
|
||||
|
||||
OutputTaskModel model = new OutputTask().getTaskReportById(rowMap.getString("TASKID"));
|
||||
if (model != null) {
|
||||
System.out.println(",pdel============" + model);
|
||||
System.out.println("123313123123123==========" + model.getProfileId());
|
||||
OutputAppProfile appProfile = OutputAppManager.getProfile(model.getProfileId());
|
||||
System.out.println("dajadfas======" + appProfile);
|
||||
if (appProfile == null) {
|
||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + model.getProfileId());
|
||||
}
|
||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||
if (dcProfile == null)
|
||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||
String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + rowMap.getString("PUBLISHFILEID") + "'";
|
||||
System.out.println("手册的版本号>>>>>>>>>>>>"+sql_lever);
|
||||
String lever = DBSql.getString( sql_lever);
|
||||
//lever = lever.substring(0,3);
|
||||
if(lever.length()==5&&lever.substring(4).equals("0")){
|
||||
lever.substring(0,3);
|
||||
}else if (lever.length()==1){
|
||||
lever=lever+".0";
|
||||
}
|
||||
System.out.println("手册截取之后的版本号>>>>>>>>>>"+lever);
|
||||
DCContext dcContext = new DCContext(userContext, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), rowMap.getString("TASKID"), rowMap.getString("PUBLISHFILENAME") + "_" + lever + ".doc");
|
||||
//UtilFile file = new UtilFile(dcContext.getPath());
|
||||
|
||||
|
||||
Map params = new HashMap<String, Object>();
|
||||
if(map!=null) {
|
||||
RowMap rowMap = DBSql.getMap("select * from (select * from BO_ACT_COE_PUBLISH_N where PUBLISHFILEID = '"+map.getString("ID")+"' order by CREATEDATE desc) where rownum = 1");
|
||||
if (rowMap!=null){
|
||||
|
||||
if (StringUtils.isNotEmpty(rowMap.getString("TASKID"))) {
|
||||
|
||||
OutputTaskModel model = new OutputTask().getTaskReportById(rowMap.getString("TASKID"));
|
||||
if (model != null) {
|
||||
// System.out.println(",pdel============" + model);
|
||||
//System.out.println("123313123123123==========" + model.getProfileId());
|
||||
OutputAppProfile appProfile = OutputAppManager.getProfile(model.getProfileId());
|
||||
//System.out.println("dajadfas======" + appProfile);
|
||||
if (appProfile == null) {
|
||||
throw new AWSException("Not Find OutputAppProfile! profileId=" + model.getProfileId());
|
||||
}
|
||||
DCPluginProfile dcProfile = SDK.getDCAPI().getDCProfile(appProfile.getAppContext().getId(), OutputConst.EXT_APP_DC_OUTPUT);
|
||||
if (dcProfile == null)
|
||||
throw new AWSException("Not Find DCProfile! repositoryName=" + OutputConst.EXT_APP_DC_OUTPUT);
|
||||
String sql_lever = "SELECT PLVER FROM APP_ACT_COE_PAL_REPOSITORY WHERE ID = '" + rowMap.getString("PUBLISHFILEID") + "'";
|
||||
//System.out.println("手册的版本号>>>>>>>>>>>>"+sql_lever);
|
||||
String lever = DBSql.getString( sql_lever);
|
||||
//lever = lever.substring(0,3);
|
||||
if(lever.length()==5&&lever.substring(4).equals("0")){
|
||||
lever.substring(0,3);
|
||||
}else if (lever.length()==1){
|
||||
lever=lever+".0";
|
||||
}
|
||||
// System.out.println("手册截取之后的版本号>>>>>>>>>>"+lever);
|
||||
DCContext dcContext = new DCContext(userContext, dcProfile, appProfile.getAppContext().getId(), model.getWsId(), rowMap.getString("TASKID"), rowMap.getString("PUBLISHFILENAME") + "_" + lever + ".doc");
|
||||
//UtilFile file = new UtilFile(dcContext.getPath());
|
||||
|
||||
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
//知识ID,必填
|
||||
params.put("cardId", cardId);
|
||||
params.put("cardId", cardId);
|
||||
//sid,必填
|
||||
params.put("sid", userContext.getSessionId());
|
||||
|
||||
params.put("dc", dcContext);
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
params.put("sid", userContext.getSessionId());
|
||||
|
||||
params.put("dc", dcContext);
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//创建文件
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
System.out.println("流程手册的存入=================" + ro);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
String sql_A = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY where ID = '"+map.getString("ID")+"' AND PLMETHODID != 'process.framework' AND PLMETHODID IN (select distinct PLMETHODID from APP_ACT_COE_PAL_REPOSITORY)";
|
||||
List<RowMap> rows = DBSql.getMaps(sql_A);
|
||||
|
||||
for (RowMap bo:rows
|
||||
) {
|
||||
|
||||
/**
|
||||
* 这个是模型中的附件获取的并插入的数据信息,需要做修改
|
||||
*/
|
||||
// 调用App
|
||||
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
System.out.println("流程手册的存入=================" + ro);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
String sql_A = "SELECT PLNAME FROM APP_ACT_COE_PAL_REPOSITORY where ID = '"+map.getString("ID")+"' AND PLMETHODID != 'process.framework' AND PLMETHODID IN (select distinct PLMETHODID from APP_ACT_COE_PAL_REPOSITORY)";
|
||||
List<RowMap> rows = DBSql.getMaps(sql_A);
|
||||
|
||||
for (RowMap bo:rows
|
||||
) {
|
||||
|
||||
/**
|
||||
* 这个是模型中的附件获取的并插入的数据信息,需要做修改
|
||||
*/
|
||||
// 调用App
|
||||
|
||||
// 参数定义列表
|
||||
Map paramss = new HashMap<String, Object>();
|
||||
Map<String, Object> paramss = new HashMap<String, Object>();
|
||||
//知识ID,必填
|
||||
paramss.put("cardId", cardId);
|
||||
paramss.put("cardId", cardId);
|
||||
//sid,必填
|
||||
paramss.put("sid", userContext.getSessionId());
|
||||
|
||||
UpfileWeb upfileWeb = new UpfileWeb(userContext);
|
||||
|
||||
|
||||
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where PLMETHODID != 'process.framework' AND ID= '"+map.getString("ID")+"'" +
|
||||
")";
|
||||
List<RowMap> maps = DBSql.getMaps(sql_upfile);
|
||||
for (RowMap row : maps) {
|
||||
System.out.println("附件的名称>>>>>>>>>>"+row.getString("FILENAME"));
|
||||
if (!row.getString("FILENAME").contains(".xml")){
|
||||
try {
|
||||
|
||||
|
||||
UpfileModel upfileModel = new UpfileModel();
|
||||
upfileModel.setType(row.getString("FILETYPE"));
|
||||
upfileModel.setFileName(row.getString("FILENAME"));
|
||||
upfileModel.setPl_uuid(row.getString("PALREPOSITORYID"));
|
||||
upfileModel.setShape_uuid(row.getString("SHAPEID"));
|
||||
DCContext dcContexts = upfileWeb.getDCContext(upfileModel);
|
||||
paramss.put("dc", dcContexts);
|
||||
AppAPI appAPIs = SDK.getAppAPI();
|
||||
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, paramss);
|
||||
System.out.println("流程模型附件的生成============="+ros);
|
||||
}catch (Exception e){
|
||||
System.out.println("附件无法上传>>>>>>>>"+row.getString("FILENAME"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
paramss.put("sid", userContext.getSessionId());
|
||||
|
||||
UpfileWeb upfileWeb = new UpfileWeb(userContext);
|
||||
String plId = map.getString("ID");
|
||||
String methodId = map.getString("PLMETHODID");
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where PLMETHODID != 'process.framework' AND ID= '"+plId+"') ORDER BY CREATETIME ASC";
|
||||
if(UtilString.isNotEmpty(methodId)) {
|
||||
if(methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+plId+"') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
}
|
||||
}
|
||||
List<RowMap> maps = DBSql.getMaps(sql_upfile);
|
||||
for (RowMap row : maps) {
|
||||
String fileName = row.getString("FILENAME");
|
||||
//System.out.println("附件的名称>>>>>>>>>>"+fileName);
|
||||
if (!fileName.contains(".xml")){
|
||||
try {
|
||||
UpfileModel upfileModel = new UpfileModel();
|
||||
upfileModel.setType(row.getString("FILETYPE"));
|
||||
upfileModel.setFileName(row.getString("FILENAME"));
|
||||
upfileModel.setPl_uuid(row.getString("PALREPOSITORYID"));
|
||||
upfileModel.setShape_uuid(row.getString("SHAPEID"));
|
||||
DCContext dcContexts = upfileWeb.getDCContext(upfileModel);
|
||||
paramss.put("dc", dcContexts);
|
||||
AppAPI appAPIs = SDK.getAppAPI();
|
||||
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, paramss);
|
||||
//System.out.println("流程模型附件的生成============="+ros);
|
||||
}catch (Exception e){
|
||||
System.out.println("附件无法上传>>>>>>>>"+row.getString("FILENAME"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//DCContext对象,必填
|
||||
|
||||
|
||||
//创建文件
|
||||
}
|
||||
PublishKnow(userContext,cardId);
|
||||
}
|
||||
|
||||
}
|
||||
try {
|
||||
PublishKnow(userContext,cardId);
|
||||
} catch (Exception e) {
|
||||
System.err.println("发布知识异常======="+e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,9 +329,11 @@ public class CreateDataKnow implements IJob {
|
||||
String sql = "select EXT4 from APP_ACT_COE_PAL_REPOSITORY where id in (select PLPARENTID from APP_ACT_COE_PAL_REPOSITORY where EXT4 = '"+id +"')";
|
||||
List<RowMap> maps = DBSql.getMaps(sql);
|
||||
String ids = "";
|
||||
String plname = "";
|
||||
for (RowMap rowmap:maps
|
||||
) {
|
||||
ids+=rowmap.getString("EXT4")+",";
|
||||
plname =rowmap.getString("PLNAME");
|
||||
}
|
||||
String[] deptSplit_id = ids.split(",");
|
||||
|
||||
@ -395,14 +351,12 @@ public class CreateDataKnow implements IJob {
|
||||
jsonArray_das.add(das);
|
||||
}
|
||||
//jsonObject.put(deptSplit_id);
|
||||
|
||||
|
||||
// 调用App
|
||||
String sourceAppId = APPID;
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.actionsoft.apps.kms/PublishKnwl";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
//要发布到的维度ID的JSON数组字符串,必填
|
||||
params.put("dimensionIDArray", jsonArray.toString());
|
||||
//要发布的知识ID的JSON数组字符串,必填
|
||||
@ -413,41 +367,35 @@ public class CreateDataKnow implements IJob {
|
||||
params.put("sid", userContext.getSessionId());
|
||||
AppAPI appAPI = SDK.getAppAPI();
|
||||
//发布知识
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
|
||||
System.out.println("知识发布============"+ro);
|
||||
|
||||
String sql_ext4 = "select PERMTYPE,ORGPERM from BO_ACT_PUBLISH_PERM_SCOPE where PALVERSIONID = (select PLVERSIONID from ( select PLVERSIONID from APP_ACT_COE_PAL_REPOSITORY a where ISPUBLISH = '1' AND EXT4 = '"+id.substring(0,id.length()-1)+"' order by a.createdate desc ) where rownum=1)";//id.substring(0,id.length()-1)
|
||||
try {
|
||||
ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params);
|
||||
System.out.println("知识发布============"+ro);
|
||||
} catch (Exception e) {
|
||||
System.out.println("知识发布失败============"+e.getMessage());
|
||||
}
|
||||
String sql_ext4 = "select PERMTYPE,ORGPERM,POSTPERM,LEVELPERM from BO_ACT_PUBLISH_PERM_SCOPE where PALVERSIONID = (select PLVERSIONID from ( select PLVERSIONID from APP_ACT_COE_PAL_REPOSITORY a where ISPUBLISH = '1' AND EXT4 = '"+id.substring(0,id.length()-1)+"' order by a.createdate desc ) where rownum=1)";//id.substring(0,id.length()-1)
|
||||
RowMap rowMap = DBSql.getMap(sql_ext4);
|
||||
System.out.println("rowMap>>>>>>>>"+rowMap);
|
||||
System.out.println("sqls>>>>>>>>"+sql_ext4);
|
||||
JSONArray jsonArray1 = new JSONArray(new LinkedList<>());
|
||||
if (rowMap==null){
|
||||
List<RowMap> select_id_from_orgdepartment = DBSql.getMaps("select ID from ORGDEPARTMENT");
|
||||
for (RowMap depaid:
|
||||
select_id_from_orgdepartment) {
|
||||
String id_depart = depaid.getString("ID");
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType","department");
|
||||
jsonObjecta.put("assignmentId",id_depart);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType","company");
|
||||
jsonObjecta.put("assignmentId","8911e732-b42a-4556-853f-ad32761bcbee");
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}else {
|
||||
String permtype = rowMap.getString("PERMTYPE");
|
||||
if (permtype.equals("1")) {
|
||||
List<RowMap> select_id_from_orgdepartment = DBSql.getMaps("select ID from ORGDEPARTMENT");
|
||||
for (RowMap depaid :
|
||||
select_id_from_orgdepartment) {
|
||||
String depaid_id = depaid.getString("ID");
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType", "department");
|
||||
jsonObjecta.put("assignmentId", depaid_id);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType","company");
|
||||
jsonObjecta.put("assignmentId","8911e732-b42a-4556-853f-ad32761bcbee");
|
||||
jsonArray1.add(jsonObjecta);
|
||||
} else {
|
||||
String org_depart = rowMap.getString("ORGPERM");
|
||||
String post = rowMap.getString("POSTPERM");
|
||||
String levelperm = rowMap.getString("LEVELPERM");
|
||||
String deoa = "";
|
||||
if (org_depart.contains(",")) {
|
||||
if (UtilString.isNotEmpty(org_depart)) {
|
||||
String[] ds = org_depart.split(",");
|
||||
for (String depaid :
|
||||
ds) {
|
||||
@ -456,7 +404,7 @@ public class CreateDataKnow implements IJob {
|
||||
jsonObjecta.put("assignmentId", depaid);
|
||||
jsonArray1.add(jsonObjecta);
|
||||
}
|
||||
} else {
|
||||
} else{
|
||||
deoa = org_depart;
|
||||
JSONObject jsonObjecta = new JSONObject();
|
||||
jsonObjecta.put("assignmentType", "department");
|
||||
@ -465,7 +413,11 @@ public class CreateDataKnow implements IJob {
|
||||
}
|
||||
}
|
||||
}
|
||||
AddKnwlAC(jsonArray1,userContext.getSessionId(),id.substring(0,id.length()-1));
|
||||
try {
|
||||
AddKnwlAC(jsonArray1,userContext.getSessionId(),id.substring(0,id.length()-1));
|
||||
} catch (Exception e) {
|
||||
System.err.println("===知识授权异常====="+e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -483,7 +435,7 @@ public class CreateDataKnow implements IJob {
|
||||
// aslp服务地址
|
||||
String aslp = "aslp://com.actionsoft.apps.kms/AddKnwlAC";
|
||||
// 参数定义列表
|
||||
Map params = new HashMap<String, Object>();
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
//[{"assignmentType":"department","assignmentId":"62196ff9-a26d-4be5-9480-3ef680886f63"},{"assignmentType":"user","assignmentId":"user1"}],必填
|
||||
params.put("acList", jsonArray);
|
||||
//sid,如果为空,则需要传createUser参数,非必填
|
||||
|
||||
@ -95,7 +95,12 @@ public class ProcessAfterData extends ExecuteListener implements ExecuteListener
|
||||
xmlDatasUtil.setOther_system_to_do_ID(taskInstance.getId());
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstance.getId()).detail();
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
String title = bo_act_coe_publish.getString("PROCESS_TITLE");
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title.replace("&", "-")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
BO bo_eu_1664184390101 = SDK.getBOAPI().query("BO_EU_1664184390101", true).addQuery("BINDID=", processInstance.getId()).detail();
|
||||
if (bo_eu_1664184390101!=null){
|
||||
@ -113,7 +118,7 @@ public class ProcessAfterData extends ExecuteListener implements ExecuteListener
|
||||
xmlDatasUtil.setPcurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&oauthName=oauthLogin&processInstId="+processInstance.getId()+"&taskInstId="+taskInstance.getId()+"&openState="+taskInstance.getState());
|
||||
xmlDatasUtil.setMobileurl(portalUrl+"/r/or?cmd=com.yili_form_page_open&corpid=wwb0ae23173b140618&appAgentId=1000014&oauthName=wechat&casaccount="+taskInstance.getTarget()+"&processInstId="+processInstance.getId()+"&taskInstId="+taskInstance.getId()+"&openState="+taskInstance.getState());
|
||||
String target = taskInstance.getTarget();
|
||||
System.out.println("当前账户======》》》》"+target);
|
||||
//System.out.println("当前账户======》》》》"+target);
|
||||
BO bo_eu_oa_reson = SDK.getBOAPI().query("BO_EU_OA_RESON", true).addQuery("WORKCODE=" , target).detail();
|
||||
System.out.println("bo>>>>>>>>>>"+bo_eu_oa_reson);
|
||||
if (bo_eu_oa_reson!=null){
|
||||
@ -188,8 +193,12 @@ public class ProcessAfterData extends ExecuteListener implements ExecuteListener
|
||||
}
|
||||
|
||||
xmlDatasUtil.setWorkcode("");
|
||||
xmlDatasUtil.setWorkflowname(processInstance.getTitle());
|
||||
|
||||
String title = processInstance.getTitle();
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setWorkflowname(title.replaceAll("&", "-"));
|
||||
}else {
|
||||
xmlDatasUtil.setWorkflowname(processInstance.getTitle());
|
||||
}
|
||||
if (bo_eu_oa_reson!=null){
|
||||
xmlDatasUtil.setCreaterhrcode(bo_eu_oa_reson.getString("LOGINID"));
|
||||
}
|
||||
@ -201,8 +210,7 @@ public class ProcessAfterData extends ExecuteListener implements ExecuteListener
|
||||
String taskurl= SDK.getAppAPI().getProperty("com.awspaas.user.apps.yili.integration", "taskurl");
|
||||
|
||||
String s = httpClientUtil.SendPend(taskurl, xmlDatasUtil);
|
||||
System.out.println("状态码============》》》》》》》》》》》"+s);
|
||||
|
||||
System.out.println("发送待办===>"+processInstance.getTitle()+"===>"+"状态码============》》》》》》》》》》》"+s);
|
||||
Document document = null;
|
||||
try {
|
||||
document = DocumentHelper.parseText(s);
|
||||
@ -210,21 +218,22 @@ public class ProcessAfterData extends ExecuteListener implements ExecuteListener
|
||||
e.printStackTrace();
|
||||
}
|
||||
Element rootElement = document.getRootElement();
|
||||
System.out.println("rootElement>>>>>>"+rootElement);
|
||||
/*Element result = rootElement.element("Body").element("InsertTodoCominfoResponse ").element("out");
|
||||
String resultString = result.getData().toString();
|
||||
JSONObject jsonObject1 = JSON.parseObject(resultString);
|
||||
String datas = jsonObject1.getString("result");
|
||||
String status = jsonObject1.getString("message");
|
||||
|
||||
if (datas.equals("success")){
|
||||
System.out.println("发送待办任务完成,请去OA系统上查看是否传输完成");
|
||||
//System.out.println("rootElement>>>>>>"+rootElement);
|
||||
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse").element("out");
|
||||
String text = result.getText();
|
||||
document = DocumentHelper.parseText(text);
|
||||
Element rootElement2 = document.getRootElement();
|
||||
Element statusElement = rootElement2.element("result");
|
||||
Element messageElement = rootElement2.element("message");
|
||||
String status = statusElement.getData().toString();
|
||||
String message = messageElement.getData().toString();
|
||||
if (status.equals("success")){
|
||||
System.out.println("手动发送待办成功===>"+processInstance.getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
flag = true;
|
||||
}else {
|
||||
System.out.println("发送待办任务失败,请联系管理员查看是否出现错误");
|
||||
System.out.println("错误提示>>>>>>>>>>>>"+status);
|
||||
System.out.println("手动发送待办失败===>"+processInstance.getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
flag = false;
|
||||
}*/
|
||||
}
|
||||
bo.set("OA_RESULT",rootElement);
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
bo.set("OA_DATE",simpleDateFormat.format(new Date()));
|
||||
|
||||
@ -139,11 +139,11 @@ public class createDimensionJob implements IJob {
|
||||
if (id.equals("process")){
|
||||
|
||||
if (SDK.getPortalAPI().getPortalUrl().equals("https://bpm.yili.com:8088/portal")){
|
||||
string = "obj_b0121317eb9b414586885bcc8527ab8f";
|
||||
string = "obj_6adcee05d6f740868b2ef901dbeb85ee";
|
||||
}else if (SDK.getPortalAPI().getPortalUrl().equals("http://10.60.143.183:8088/portal")){
|
||||
string = "obj_e055a421f23547579a75130d27ab3b34";
|
||||
}else{
|
||||
string = "obj_6dcfbc5d374645d5b97c8ec51ea3a234";
|
||||
string = "obj_6adcee05d6f740868b2ef901dbeb85ee";
|
||||
}
|
||||
}
|
||||
params.put("parentId", string);
|
||||
|
||||
@ -116,7 +116,7 @@ public class UpdateKnowJob implements Job {
|
||||
break;
|
||||
}
|
||||
if (fisrt_name.equals("process")) {
|
||||
names.put(i, "obj_5020f54928c842b58107c3354e450070");
|
||||
names.put(i, "obj_6adcee05d6f740868b2ef901dbeb85ee");
|
||||
}
|
||||
if (StringUtils.isEmpty(parent_name)) {
|
||||
break;
|
||||
|
||||
@ -142,8 +142,9 @@ public class OaPendComponent {
|
||||
* 发送待办
|
||||
*
|
||||
* @param taskInstance DD
|
||||
* @throws DocumentException
|
||||
*/
|
||||
public void sendOaPending(TaskInstance taskInstance, ProcessExecutionContext pec) throws IOException {
|
||||
public void sendOaPending(TaskInstance taskInstance, ProcessExecutionContext pec) throws IOException, DocumentException {
|
||||
if("admin".equals(taskInstance.getTarget())) {
|
||||
return;
|
||||
}
|
||||
@ -153,7 +154,12 @@ public class OaPendComponent {
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", pec.getProcessInstance().getId()).detail();
|
||||
if (!pec.getProcessInstance().getParentTaskInstId().equals("00000000-0000-0000-0000-000000000000")){
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
String title = bo_act_coe_publish.getString("PROCESS_TITLE");
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title.replace("&", "-")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+pec.getProcessInstance().getTitle()+"】,点击进行处理");
|
||||
}
|
||||
@ -245,7 +251,13 @@ public class OaPendComponent {
|
||||
}
|
||||
|
||||
xmlDatasUtil.setWorkcode("");
|
||||
xmlDatasUtil.setWorkflowname(pec.getProcessInstance().getTitle());
|
||||
String title = pec.getProcessInstance().getTitle();
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setWorkflowname(title.replaceAll("&", "-"));
|
||||
}else {
|
||||
xmlDatasUtil.setWorkflowname(title);
|
||||
}
|
||||
//xmlDatasUtil.setWorkflowname(pec.getProcessInstance().getTitle());
|
||||
|
||||
if (bo_eu_oa_reson!=null){
|
||||
xmlDatasUtil.setCreaterhrcode(bo_eu_oa_reson.getString("LOGINID"));
|
||||
@ -286,6 +298,28 @@ public class OaPendComponent {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
bo.set("OA_DATE",sdf.format(new Date()));
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_MOBILEURL",bo,UserContext.fromUID(taskInstance.getTarget()));
|
||||
System.out.println("发送待办===>"+pec.getProcessInstance().getTitle()+"===>"+"状态码============》》》》》》》》》》》"+s);
|
||||
Document document = null;
|
||||
try {
|
||||
document = DocumentHelper.parseText(s);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Element rootElement = document.getRootElement();
|
||||
//System.out.println("rootElement>>>>>>"+rootElement);
|
||||
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse").element("out");
|
||||
String text = result.getText();
|
||||
document = DocumentHelper.parseText(text);
|
||||
Element rootElement2 = document.getRootElement();
|
||||
Element statusElement = rootElement2.element("result");
|
||||
Element messageElement = rootElement2.element("message");
|
||||
String status = statusElement.getData().toString();
|
||||
String message = messageElement.getData().toString();
|
||||
if ("success".equals(status)){
|
||||
System.out.println("发送待办成功===>"+pec.getProcessInstance().getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
}else {
|
||||
System.out.println("发送待办失败===>"+pec.getProcessInstance().getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
}
|
||||
if (s.contains("success")){
|
||||
//System.out.println("发送待办任务完成,请去OA系统上查看是否传输完成");
|
||||
}else {
|
||||
@ -353,14 +387,26 @@ public class OaPendComponent {
|
||||
if (actionName.equals("传阅")){
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", pec.getProcessInstance().getId()).detail();
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
String title = bo_act_coe_publish.getString("PROCESS_TITLE");
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+title.replace("&", "-")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+title+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+pec.getProcessInstance().getTitle()+"】,点击进行处理");
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", pec.getProcessInstance().getId()).detail();
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
String title = bo_act_coe_publish.getString("PROCESS_TITLE");
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title.replace("&", "-")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+pec.getProcessInstance().getTitle()+"】,点击进行处理");
|
||||
}
|
||||
@ -548,6 +594,29 @@ public class OaPendComponent {
|
||||
}else {
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_MOBILEURL",bo,UserContext.fromUID("admin"));
|
||||
}
|
||||
|
||||
System.out.println("更新待办===>"+pec.getProcessInstance().getTitle()+"===>"+"状态码============》》》》》》》》》》》"+s);
|
||||
Document document = null;
|
||||
try {
|
||||
document = DocumentHelper.parseText(s);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Element rootElement = document.getRootElement();
|
||||
//System.out.println("rootElement>>>>>>"+rootElement);
|
||||
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse").element("out");
|
||||
String text = result.getText();
|
||||
document = DocumentHelper.parseText(text);
|
||||
Element rootElement2 = document.getRootElement();
|
||||
Element statusElement = rootElement2.element("result");
|
||||
Element messageElement = rootElement2.element("message");
|
||||
String status = statusElement.getData().toString();
|
||||
String message = messageElement.getData().toString();
|
||||
if (status.equals("success")){
|
||||
System.out.println("更新待办成功===>"+pec.getProcessInstance().getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
}else {
|
||||
System.out.println("更新待办失败===>"+pec.getProcessInstance().getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
}
|
||||
|
||||
if (s.contains("success")){
|
||||
//System.out.println("发送待办任务完成,请去OA系统上查看是否传输完成");
|
||||
@ -586,14 +655,24 @@ public class OaPendComponent {
|
||||
if (actionName.equals("传阅")){
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", pec.getProcessInstance().getId()).detail();
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
String title = bo_act_coe_publish.getString("PROCESS_TITLE");
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+title.replace("&", "-")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+title+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条传阅流程【"+pec.getProcessInstance().getTitle()+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", pec.getProcessInstance().getId()).detail();
|
||||
if (bo_act_coe_publish!=null){
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+bo_act_coe_publish.getString("PROCESS_TITLE")+"】,点击进行处理");
|
||||
String title = bo_act_coe_publish.getString("PROCESS_TITLE");
|
||||
if(title.contains("&")) {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title.replace("&", "-")+"】,点击进行处理");
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+title+"】,点击进行处理");
|
||||
}
|
||||
}else {
|
||||
xmlDatasUtil.setProcess_title(" 您有一条待办流程【"+pec.getProcessInstance().getTitle()+"】,点击进行处理");
|
||||
}
|
||||
@ -757,6 +836,28 @@ public class OaPendComponent {
|
||||
}else {
|
||||
SDK.getBOAPI().createDataBO("BO_EU_OA_MOBILEURL",bo,UserContext.fromUID("admin"));
|
||||
}
|
||||
System.out.println("更新待办===>"+pec.getProcessInstance().getTitle()+"===>"+"状态码============》》》》》》》》》》》"+s);
|
||||
Document document = null;
|
||||
try {
|
||||
document = DocumentHelper.parseText(s);
|
||||
} catch (DocumentException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Element rootElement = document.getRootElement();
|
||||
//System.out.println("rootElement>>>>>>"+rootElement);
|
||||
Element result = rootElement.element("Body").element("InsertTodoCominfoResponse").element("out");
|
||||
String text = result.getText();
|
||||
document = DocumentHelper.parseText(text);
|
||||
Element rootElement2 = document.getRootElement();
|
||||
Element statusElement = rootElement2.element("result");
|
||||
Element messageElement = rootElement2.element("message");
|
||||
String status = statusElement.getData().toString();
|
||||
String message = messageElement.getData().toString();
|
||||
if (status.equals("success")){
|
||||
System.out.println("更新待办成功===>"+pec.getProcessInstance().getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
}else {
|
||||
System.out.println("更新待办失败===>"+pec.getProcessInstance().getTitle()+"===>"+taskInstance.getTarget()+"====>"+status+"===>"+message);
|
||||
}
|
||||
|
||||
if (s.contains("success")){
|
||||
//System.out.println("发送待办任务完成,请去OA系统上查看是否传输完成");
|
||||
|
||||
@ -273,11 +273,11 @@ public class TaskController {
|
||||
jsonArray.add(jsonObject);
|
||||
|
||||
|
||||
String sql_upfile ="select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"'" + ") ORDER BY CREATETIME ASC";
|
||||
String sql_upfile ="select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"'" + ") ORDER BY FILENAME ASC";
|
||||
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"'");
|
||||
if(UtilString.isNotEmpty(methodId)) {
|
||||
if(methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"') AND FILETYPE = 'f' ORDER BY FILENAME ASC";
|
||||
}
|
||||
}
|
||||
//String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"') AND FILETYPE = 'f'";
|
||||
@ -356,11 +356,11 @@ public class TaskController {
|
||||
jsonObject.put("taskId", id);
|
||||
jsonArray.add(jsonObject);
|
||||
|
||||
String sql_upfile ="select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("STOPFILEID")+"'" + ") ORDER BY CREATETIME ASC";
|
||||
String sql_upfile ="select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("STOPFILEID")+"'" + ") ORDER BY FILENAME ASC";
|
||||
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("STOPFILEID")+"'");
|
||||
if(UtilString.isNotEmpty(methodId)) {
|
||||
if(methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("STOPFILEID")+"') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("STOPFILEID")+"') AND FILETYPE = 'f' ORDER BY FILENAME ASC";
|
||||
}
|
||||
}
|
||||
//String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"') AND FILETYPE = 'f'";
|
||||
@ -437,11 +437,11 @@ public class TaskController {
|
||||
jsonObject.put("taskId", id);
|
||||
jsonArray.add(jsonObject);
|
||||
|
||||
String sql_upfile ="select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.get("CHANGEDFILEIDNEW")+"'" + ") ORDER BY CREATETIME ASC";
|
||||
String sql_upfile ="select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.get("CHANGEDFILEIDNEW")+"'" + ") ORDER BY FILENAME ASC";
|
||||
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("CHANGEDFILEIDNEW")+"'");
|
||||
if(UtilString.isNotEmpty(methodId)) {
|
||||
if(methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.get("CHANGEDFILEIDNEW")+"') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.get("CHANGEDFILEIDNEW")+"') AND FILETYPE = 'f' ORDER BY FILENAME ASC";
|
||||
}
|
||||
}
|
||||
//String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("PUBLISHFILEID")+"') AND FILETYPE = 'f'";
|
||||
@ -682,13 +682,13 @@ public class TaskController {
|
||||
}
|
||||
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("PUBLISHFILEID") + "'" + ") ORDER BY CREATETIME ASC";
|
||||
+ bo.getString("PUBLISHFILEID") + "'" + ") ORDER BY FILENAME ASC";
|
||||
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("PUBLISHFILEID") + "'");
|
||||
if (UtilString.isNotEmpty(methodId)) {
|
||||
if (methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("PUBLISHFILEID") + "') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
+ bo.getString("PUBLISHFILEID") + "') AND FILETYPE = 'f' ORDER BY FILENAME ASC";
|
||||
}
|
||||
}
|
||||
// String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where
|
||||
@ -841,14 +841,14 @@ public class TaskController {
|
||||
* +bo.getString("STOPFILEID")+"'" + ")";
|
||||
*/
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("STOPFILEID") + "'" + ") ORDER BY CREATETIME ASC";
|
||||
+ bo.getString("STOPFILEID") + "'" + ") ORDER BY FILENAME ASC";
|
||||
String methodId = DBSql
|
||||
.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("STOPFILEID") + "'");
|
||||
if (UtilString.isNotEmpty(methodId)) {
|
||||
if (methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("STOPFILEID") + "') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
+ bo.getString("STOPFILEID") + "') AND FILETYPE = 'f' ORDER BY FILENAME ASC";
|
||||
}
|
||||
}
|
||||
// String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where
|
||||
@ -992,14 +992,14 @@ public class TaskController {
|
||||
}
|
||||
|
||||
String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("CHANGEDFILEIDNEW") + "'" + ") ORDER BY CREATETIME ASC";
|
||||
+ bo.getString("CHANGEDFILEIDNEW") + "'" + ") ORDER BY FILENAME ASC";
|
||||
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("CHANGEDFILEIDNEW") + "'");
|
||||
if (UtilString.isNotEmpty(methodId)) {
|
||||
if (methodId.equals("control.policy")) {
|
||||
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"
|
||||
+ bo.getString("CHANGEDFILEIDNEW")
|
||||
+ "') AND FILETYPE = 'f' ORDER BY CREATETIME ASC";
|
||||
+ "') AND FILETYPE = 'f' ORDER BY FILENAME ASC";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user