伊利集成,数据看板代码上传

This commit is contained in:
lihongyu 2022-12-01 14:15:38 +08:00
parent bb053c2e7c
commit 3d00447255
17 changed files with 1089 additions and 544 deletions

View File

@ -1,39 +1,14 @@
package com.awspaas.user.apps.integration.controller; package com.awspaas.user.apps.integration.controller;
import com.actionsoft.apps.coe.pal.constant.CoEConstant; import java.util.List;
import com.actionsoft.apps.coe.pal.log.CoEOpLogAPI;
import com.actionsoft.apps.coe.pal.log.CoEOpLogConst;
import com.actionsoft.apps.coe.pal.pal.output.OutputAPIManager;
import com.actionsoft.apps.coe.pal.pal.output.dao.OutputTask;
import com.actionsoft.apps.coe.pal.pal.output.model.OutputTaskModel;
import com.actionsoft.apps.coe.pal.pal.repository.cache.PALRepositoryCache;
import com.actionsoft.apps.coe.pal.pal.repository.model.PALRepositoryModel;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.constant.CoeFileConstant;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.dao.UpFileDao;
import com.actionsoft.apps.coe.pal.pal.repository.upfile.model.UpfileModel;
import com.actionsoft.apps.resource.plugin.profile.DCPluginProfile;
import com.actionsoft.bpms.commons.database.RowMap; import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.bind.annotation.Controller; import com.actionsoft.bpms.server.bind.annotation.Controller;
import com.actionsoft.bpms.server.bind.annotation.Mapping; import com.actionsoft.bpms.server.bind.annotation.Mapping;
import com.actionsoft.bpms.server.conf.server.AWSServerConf;
import com.actionsoft.bpms.server.fs.DCContext;
import com.actionsoft.bpms.server.fs.dc.DCProfileManager;
import com.actionsoft.bpms.server.fs.dc.DCUtil;
import com.actionsoft.bpms.util.DBSql; import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UUIDGener;
import com.actionsoft.bpms.util.UtilFile;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.sdk.local.SDK;
import com.alibaba.fastjson.JSONObject;
import com.awspaas.user.apps.integration.event.OutputDCFileProcessor;
import com.awspaas.user.apps.integration.web.UpfileWeb; import com.awspaas.user.apps.integration.web.UpfileWeb;
import java.io.File;
import java.util.LinkedHashMap;
import java.util.List;
/* /*
* 文件阅览界面下载时创建手册 * 文件阅览界面下载时创建手册
*/ */
@ -85,9 +60,12 @@ public class CreateFileContorller {
if (map!=null){ if (map!=null){
method = map.getString("PLMETHODID"); method = 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 ID= '"+id+"'" + String sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+id+"'" +
") and FILENAME not like '%.xml'"; ") and FILENAME not like '%.xml'";
if("control.policy".equals(method)) {
sql_upfile = "select * from APP_ACT_COE_PAL_UPFILE where palrepositoryid in (select ID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+id+"'" +
") and FILETYPE = 'f'";
}
List<RowMap> maps = DBSql.getMaps(sql_upfile); List<RowMap> maps = DBSql.getMaps(sql_upfile);
String upfile_ids = ""; String upfile_ids = "";
if (maps.size()>0){ if (maps.size()>0){
@ -96,7 +74,7 @@ public class CreateFileContorller {
upfile_ids+=rowMap.getString("ID")+","; upfile_ids+=rowMap.getString("ID")+",";
} }
} }
String zip_url = upfileWeb.readZipFileDownLoad(upfile_ids, title, taskId, method); String zip_url = upfileWeb.readZipFileDownLoad2(upfile_ids, title, taskId, method);
return zip_url; return zip_url;
} }
} }

View File

@ -18,16 +18,7 @@ import java.util.*;
public class GetmeritsController { public class GetmeritsController {
/**
* 获取页面的方法
*/
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getHtml")
public String getHtml(){
String html = "territory.html";
return HtmlPageTemplate.merge("com.awspaas.user.apps.yili.integration",html,new LinkedHashMap<>());
}
/** /**
* 这是第一个图的筛选方法 * 这是第一个图的筛选方法
@ -1523,7 +1514,7 @@ public class GetmeritsController {
jsonObject_child_content_3_last.put("content",jsonArray_child_content_3_last); jsonObject_child_content_3_last.put("content",jsonArray_child_content_3_last);
System.out.println("jsonObject_child_content_3_last>>>>>>>>>>>>>>"+jsonObject_child_content_3_last); //System.out.println("jsonObject_child_content_3_last>>>>>>>>>>>>>>"+jsonObject_child_content_3_last);
jsonArray_child_3_last.add(jsonObject_child_content_3_last); jsonArray_child_3_last.add(jsonObject_child_content_3_last);
jsonObject_child_3_last.put("child",jsonArray_child_3_last); jsonObject_child_3_last.put("child",jsonArray_child_3_last);

View File

@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.awspaas.user.apps.integration.util.UtilUrl; import com.awspaas.user.apps.integration.util.UtilUrl;
import com.awspaas.user.apps.integration.util.UtilUrls;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
import org.dom4j.Element; import org.dom4j.Element;
@ -43,15 +44,15 @@ public class CreategetFlowListALLByWfidJob implements IJob {
// HttpURLConnection 发送SOAP请求 // HttpURLConnection 发送SOAP请求
System.out.println("HttpURLConnection 发送SOAP请求"); System.out.println("HttpURLConnection 发送SOAP请求");
String postSoap = UtilUrl.doPostSoap("http://10.105.1.59:80/services/WorkflowService", xmlStr, ""); String postSoap = UtilUrls.doPostSoap("http://10.105.1.59:80/services/WorkflowService", xmlStr, "");
Document document = DocumentHelper.parseText(postSoap); Document document = DocumentHelper.parseText(postSoap);
Element rootElement = document.getRootElement(); Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement); // System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("getAllWfIdResponse").element("out"); Element result = rootElement.element("Body").element("getAllWfIdResponse").element("out");
String resultString = result.getData().toString(); String resultString = result.getData().toString();
System.out.println("resultString=>>>>>>>>>>"+resultString); //System.out.println("resultString=>>>>>>>>>>"+resultString);
JSONArray jsonArray = JSON.parseArray(resultString); JSONArray jsonArray = JSON.parseArray(resultString);
for (int i=0;i<jsonArray.size();i++ for (int i=0;i<jsonArray.size();i++

View File

@ -7,7 +7,7 @@ import com.actionsoft.sdk.local.SDK;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.awspaas.user.apps.integration.util.UtilUrl; import com.awspaas.user.apps.integration.util.UtilUrls;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
@ -52,7 +52,7 @@ public class CreategetFlowListByWfidJob implements IJob {
//jsonObject.put("createDateStart","2019-07-01 00:00:00");//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo() //jsonObject.put("createDateStart","2019-07-01 00:00:00");//SDK.getORGAPI().getDepartmentByUser(processExecutionContext.getProcessInstance().getCreateUser()).getNo()
//jsonObject.put("createDateEnd","2023-09-01 00:00:00");//processExecutionContext.getProcessInstance().getCreateUser() //jsonObject.put("createDateEnd","2023-09-01 00:00:00");//processExecutionContext.getProcessInstance().getCreateUser()
jsonObject.put("pageIndex",j); jsonObject.put("pageIndex",j);
jsonObject.put("pageSize",3000); jsonObject.put("pageSize",1000);
String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\">\n" + String xmlStr = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"webservices.services.weaver.com.cn\">\n" +
" <soapenv:Header/>" + " <soapenv:Header/>" +
" <soapenv:Body>" + " <soapenv:Body>" +
@ -71,21 +71,21 @@ public class CreategetFlowListByWfidJob implements IJob {
// HttpURLConnection 发送SOAP请求 // HttpURLConnection 发送SOAP请求
System.out.println("HttpURLConnection 发送SOAP请求"); System.out.println("HttpURLConnection 发送SOAP请求");
String postSoap = UtilUrl.doPostSoap("http://10.119.22.207:80/services/WorkflowService", xmlStr, ""); String postSoap = UtilUrls.doPostSoap("http://10.105.1.59:80/services/WorkflowService", xmlStr, "");
Document document = DocumentHelper.parseText(postSoap); Document document = DocumentHelper.parseText(postSoap);
Element rootElement = document.getRootElement(); Element rootElement = document.getRootElement();
System.out.println("rootElement>>>>>>"+rootElement); // System.out.println("rootElement>>>>>>"+rootElement);
Element result = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out"); Element result = rootElement.element("Body").element("getFlowListByWfIdResponse").element("out");
String resultString = result.getData().toString(); String resultString = result.getData().toString();
System.out.println("resultString=>>>>>>>>>>"+resultString); // System.out.println("resultString=>>>>>>>>>>"+resultString);
//if (!StringUtils.isEmpty(resultString)){ //if (!StringUtils.isEmpty(resultString)){
JSONObject jsonObject1 = JSON.parseObject(resultString); JSONObject jsonObject1 = JSON.parseObject(resultString);
String datas = jsonObject1.getString("datas"); String datas = jsonObject1.getString("datas");
System.out.println(""); System.out.println("");
JSONArray jsonArray = JSONArray.parseArray(datas); JSONArray jsonArray = JSONArray.parseArray(datas);
System.out.println("jsonArrayData》》》》》》》》》》》》"+jsonArray); // System.out.println("jsonArrayData》》》》》》》》》》》》"+jsonArray);
if (jsonArray!=null&&jsonArray.size()!=0){ if (jsonArray!=null&&jsonArray.size()!=0){
UserContext userContext = UserContext.fromUID("admin"); UserContext userContext = UserContext.fromUID("admin");
for (int i=0;i<jsonArray.size();i++){ for (int i=0;i<jsonArray.size();i++){

View File

@ -28,7 +28,7 @@ public class SendOAReadByTaskBo implements IJob {
String processinstid = rowMap.getString("ID"); String processinstid = rowMap.getString("ID");
String taskid = SDK.getProcessAPI().getInstanceById(processinstid).getStartTaskInstId(); String taskid = SDK.getProcessAPI().getInstanceById(processinstid).getStartTaskInstId();
sendReadByDataid2 sre = new sendReadByDataid2(); sendReadByDataid2 sre = new sendReadByDataid2();
sre.execute(processinstid,taskid); // sre.execute(processinstid,taskid);
} }
System.out.println("定时器执行完毕,请重新查看数据是否执行成功"); System.out.println("定时器执行完毕,请重新查看数据是否执行成功");
} }

View File

@ -250,9 +250,9 @@ public class TaskController {
map.put("sid", sid); map.put("sid", sid);
List<BO> list = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("BINDID=", processInstId).list(); List<BO> list = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("BINDID=", processInstId).orderByCreated().asc().list();
List<BO> lists = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C", true).addQuery("BINDID=", processInstId).list(); List<BO> lists = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C", true).addQuery("BINDID=", processInstId).orderByCreated().asc().list();
List<BO> list_stop = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S", true).addQuery("BINDID=", processInstId).list(); List<BO> list_stop = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S", true).addQuery("BINDID=", processInstId).orderByCreated().asc().list();
int num = 1; int num = 1;
//发布 //发布
@ -271,6 +271,70 @@ public class TaskController {
jsonObject.put("taskId", id); jsonObject.put("taskId", id);
jsonObject.put("id", bo.getString("PUBLISHFILEID")); jsonObject.put("id", bo.getString("PUBLISHFILEID"));
jsonArray.add(jsonObject); 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 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";
}
}
//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'";
List<RowMap> maps = DBSql.getMaps(conn,sql_upfile);
UserContext userContext = UserContext.fromSessionId(sid);
UpfileWeb upfileWeb = new UpfileWeb(userContext);
for (RowMap row : maps) {
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);
Map params_previews = new HashMap<String, Object>();
//文档是否允许下载,必填
params_previews.put("isDownload", true);
//显示文件名,必填
params_previews.put("fileNameOriginal", row.getString("FILENAME"));
//PDF转图片处理选项- 0代表只在需要时做转换- 1代表打开即检查是否已转换成图片如未处理强制转换默认0,非必填
params_previews.put("isPDFCovertPNG", 0);
//groupJson参数,用于表单附件OfficeOnline服务预览回传文件流,非必填
params_previews.put("extParams", "");
//文档是否允许打印,必填
params_previews.put("isPrint", true);
//是否显示顶部工具栏的返回按钮,默认显示,非必填
params_previews.put("isShowBackbtn", "");
//原文件DC,必填
params_previews.put("sourceDc", dcContexts);
//是否显示默认预览工具栏,必填
params_previews.put("isShowDefaultToolbar", true);
//文档是否允许复制true为允许复制转换结果为PDF格式文件false为不可复制转换结果为PNG格式文件注意参数值为false时转换时间稍长,必填
params_previews.put("isCopy", true);
//sessionid,必填
params_previews.put("sid", sid);
//文档是否加密,必填
params_previews.put("isEncrypt", false);
AppAPI appAPIs = SDK.getAppAPI();
//文档预览
ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(processInstId);
String sourceAppId = instanceById.getAppId();
String aslp = "aslp://com.actionsoft.apps.addons.onlinedoc/filePreview";
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, params_previews);
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("title",row.getString("FILENAME"));
String base_url = "https://bpm.yili.com:8088/portal/r";
if (row.getString("FILENAME").toString().contains(".xls")||row.getString("FILENAME").toString().contains(".xlsx")){
jsonObject1.put("link",ros.get("url").toString().substring(0));
}else {
jsonObject1.put("link",base_url+ros.get("url").toString().substring(1));
}
// jsonObject1.put("size","12k");
jsonArray.add(jsonObject1);
}
num++; num++;
} }
@ -310,6 +374,68 @@ public class TaskController {
jsonObject.put("id", bo.get("CHANGEDFILEIDNEW")); jsonObject.put("id", bo.get("CHANGEDFILEIDNEW"));
jsonObject.put("taskId", id); jsonObject.put("taskId", id);
jsonArray.add(jsonObject); 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 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";
}
}
//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'";
List<RowMap> maps = DBSql.getMaps(conn,sql_upfile);
UserContext userContext = UserContext.fromSessionId(sid);
UpfileWeb upfileWeb = new UpfileWeb(userContext);
for (RowMap row : maps) {
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);
Map params_previews = new HashMap<String, Object>();
//文档是否允许下载,必填
params_previews.put("isDownload", true);
//显示文件名,必填
params_previews.put("fileNameOriginal", row.getString("FILENAME"));
//PDF转图片处理选项- 0代表只在需要时做转换- 1代表打开即检查是否已转换成图片如未处理强制转换默认0,非必填
params_previews.put("isPDFCovertPNG", 0);
//groupJson参数,用于表单附件OfficeOnline服务预览回传文件流,非必填
params_previews.put("extParams", "");
//文档是否允许打印,必填
params_previews.put("isPrint", true);
//是否显示顶部工具栏的返回按钮,默认显示,非必填
params_previews.put("isShowBackbtn", "");
//原文件DC,必填
params_previews.put("sourceDc", dcContexts);
//是否显示默认预览工具栏,必填
params_previews.put("isShowDefaultToolbar", true);
//文档是否允许复制true为允许复制转换结果为PDF格式文件false为不可复制转换结果为PNG格式文件注意参数值为false时转换时间稍长,必填
params_previews.put("isCopy", true);
//sessionid,必填
params_previews.put("sid", sid);
//文档是否加密,必填
params_previews.put("isEncrypt", false);
AppAPI appAPIs = SDK.getAppAPI();
//文档预览
ProcessInstance instanceById = SDK.getProcessAPI().getInstanceById(processInstId);
String sourceAppId = instanceById.getAppId();
String aslp = "aslp://com.actionsoft.apps.addons.onlinedoc/filePreview";
ResponseObject ros = appAPIs.callASLP(appAPIs.getAppContext(sourceAppId), aslp, params_previews);
JSONObject jsonObject1 = new JSONObject();
jsonObject1.put("title",row.getString("FILENAME"));
String base_url = "https://bpm.yili.com:8088/portal/r";
if (row.getString("FILENAME").toString().contains(".xls")||row.getString("FILENAME").toString().contains(".xlsx")){
jsonObject1.put("link",ros.get("url").toString().substring(0));
}else {
jsonObject1.put("link",base_url+ros.get("url").toString().substring(1));
}
// jsonObject1.put("size","12k");
jsonArray.add(jsonObject1);
}
num++; num++;
} }
@ -438,9 +564,9 @@ public class TaskController {
String substring = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstId).addQuery("OPTIONTYPE IS NOT NULL",null).detail().getString("RELEASE_INSTRUCTIONS"); String substring = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstId).addQuery("OPTIONTYPE IS NOT NULL",null).detail().getString("RELEASE_INSTRUCTIONS");
BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstId).addQuery("OPTIONTYPE IS NOT NULL",null).detail(); BO bo_act_coe_publish = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH", true).addQuery("BINDID=", processInstId).addQuery("OPTIONTYPE IS NOT NULL",null).detail();
List<BO> list = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("BINDID=", processInstId).list(); List<BO> list = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_N", true).addQuery("BINDID=", processInstId).orderByCreated().asc().list();
List<BO> lists = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C", true).addQuery("BINDID=", processInstId).list(); List<BO> lists = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_C", true).addQuery("BINDID=", processInstId).orderByCreated().asc().list();
List<BO> list_stop = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S", true).addQuery("BINDID=", processInstId).list(); List<BO> list_stop = SDK.getBOAPI().query("BO_ACT_COE_PUBLISH_S", true).addQuery("BINDID=", processInstId).orderByCreated().asc().list();
int num = 1; int num = 1;
for (BO bo:list) { for (BO bo:list) {
@ -514,9 +640,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("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")+"'" + 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";
}
}
//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'";
List<RowMap> maps = DBSql.getMaps(conn,sql_upfile); List<RowMap> maps = DBSql.getMaps(conn,sql_upfile);
UserContext userContext = UserContext.fromSessionId(sid); UserContext userContext = UserContext.fromSessionId(sid);
UpfileWeb upfileWeb = new UpfileWeb(userContext); UpfileWeb upfileWeb = new UpfileWeb(userContext);
@ -647,8 +778,19 @@ 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("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")+"'" + ")";
*/
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 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";
}
}
//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")+"') AND FILETYPE = 'f'";
List<RowMap> maps = DBSql.getMaps(conn,sql_upfile); List<RowMap> maps = DBSql.getMaps(conn,sql_upfile);
UserContext userContext = UserContext.fromSessionId(sid); UserContext userContext = UserContext.fromSessionId(sid);
UpfileWeb upfileWeb = new UpfileWeb(userContext); UpfileWeb upfileWeb = new UpfileWeb(userContext);
@ -773,11 +915,15 @@ 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";
String methodId = DBSql.getString("select PLMETHODID from APP_ACT_COE_PAL_REPOSITORY where ID= '"+bo.getString("CHANGEDFILEIDNEW")+"'");
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")+"'" + 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";
}
}
List<RowMap> maps = DBSql.getMaps(conn,sql_upfile); List<RowMap> maps = DBSql.getMaps(conn,sql_upfile);
UserContext userContext = UserContext.fromSessionId(sid); UserContext userContext = UserContext.fromSessionId(sid);
UpfileWeb upfileWeb = new UpfileWeb(userContext); UpfileWeb upfileWeb = new UpfileWeb(userContext);

View File

@ -480,9 +480,197 @@ public class UpfileWeb extends ActionWeb {
return ro.toString(); return ro.toString();
} }
/**
* 压缩附件下载功能
*
* @param uuid
* @return
* @author zhaolei
*/
public String readZipFileDownLoad2(String splitId,String toolbarname,String taskId,String methodId) throws Exception {
UserContext me = super.getContext();
ResponseObject ro = ResponseObject.newOkResponse();
UpFileDao upfileDao = new UpFileDao();
try {
long times = System.currentTimeMillis();
final String zipName = "批量下载"+ toolbarname + ".zip";
String targetDir = AWSServerConf.getProperty("dc.path") + File.separator + "com.actionsoft.apps.coe.pal" + File.separator + "tmp/grouppackage/zip" + times + "/";
File targetFileDir = new File(targetDir);
if (!targetFileDir.exists()) {
targetFileDir.mkdirs();
}
// 查找对应应用下模版
if(UtilString.isNotEmpty(splitId)) {
String[] uuidSpilt=splitId.split(",");
if(uuidSpilt.length>0){
for(String oneuuid:uuidSpilt){
UpfileModel upfileModel = upfileDao.get(oneuuid);
DCContext dcContext = getDCContext(upfileModel);
String filemodelName=null;
OutputTaskModel model = new OutputTask().getTaskReportById(taskId);
UtilFile file = OutputAPIManager.getInstance().getFilePath(model.getWsId(), taskId, model.getProfileId());
if (file.exists()) {
File[] fileList = file.listFiles();
if (fileList.length > 0) {
File docFile1 = null;
for (File file2 : fileList) {
if (file2.isFile() && "doc".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) {
docFile1 = file2;
break;
}
}
if (docFile1 == null) {
return ResponseObject.newErrResponse("没有找到文件").toString();
}
filemodelName= docFile1.getName();
}
}
if(UtilString.isNotEmpty(filemodelName)){
filemodelName=filemodelName.substring(0, filemodelName.lastIndexOf("."));
//判断文件目录是否存在不存在则创建
String bdir=targetDir + File.separator+filemodelName+"_file"+File.separator;
File targetFile1 = new File(bdir);
if (!targetFile1.exists()) {
targetFile1.mkdirs();
}
File targetFile = new File(bdir + dcContext.getFileName());
if (!targetFile.exists()) {
targetFile.createNewFile();
}
OutputStream out = new FileOutputStream(targetFile);
InputStream in = DCUtil.decryptFile(dcContext);
if (in == null) {
String msg = "+ dcContext.getFileName() + ";
if (dcContext.getDCMessage() != null) {
msg = dcContext.getDCMessage().getMessage();
}
return ResponseObject.newErrResponse(msg).toString();
}
try {
IOUtils.copy(in, out);
in.close();
out.close();
} finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);
}
}else{
return ResponseObject.newErrResponse("没有找到文件").toString();
}
}
}
}
//流程手册打包
if (UtilString.isNotEmpty(taskId)) {
OutputTaskModel model = new OutputTask().getTaskReportById(taskId);
if (model != null) {
try {
UtilFile file = OutputAPIManager.getInstance().getFilePath(model.getWsId(), taskId, model.getProfileId());
if (file.exists()) {
File[] fileList = file.listFiles();
if (fileList.length > 0) {
File docFile = null;
for (File file2 : fileList) {
if (file2.isFile() && "doc".equals((file2.getName().substring(file2.getName().lastIndexOf(".") + 1)))) {
docFile = file2;
break;
}
}
if (docFile == null) {
return ResponseObject.newErrResponse("没有找到文件").toString();
}
String sourceAppId = null;
if (methodId.equals("data.form")) {
sourceAppId = "com.awspaas.user.apps.coe.pal.output.bd";
}
if (methodId.indexOf("process.") > -1) {
sourceAppId="com.actionsoft.apps.coe.pal.output.pr";
}
if (methodId.equals("control.policy")) {
sourceAppId = "com.awspaas.user.apps.coe.pal.output.zd";
}
String filename = docFile.getName();
DCContext sourceDc = new DCContext(_uc, DCProfileManager.getDCProfile(sourceAppId, "output"), sourceAppId, model.getWsId(), taskId, filename);
File targetFile = new File(targetDir + filename);
if (!targetFile.exists()) {
targetFile.createNewFile();
}
OutputStream out = new FileOutputStream(targetFile);
InputStream in = DCUtil.decryptFile(sourceDc);
if (in == null) {
String msg = "+ dcContext.getFileName() + ";
if (sourceDc.getDCMessage() != null) {
msg = sourceDc.getDCMessage().getMessage();
}
return ResponseObject.newErrResponse(msg).toString();
}
try {
IOUtils.copy(in, out);
in.close();
out.close();
} finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);
}
}
}
} catch (Exception e) {
e.printStackTrace();
return ResponseObject.newErrResponse().toString();
}
}
}
UtilFile.zipCompress(targetDir, new File(targetDir + zipName));
File[] files = targetFileDir.listFiles(new FilenameFilter()
{
@Override
public boolean accept(File dir, String name) {
if (name.equals(zipName)) {
return false;
}
return true;
}
});
for (File file : files) {
try {
file.delete();
} catch (Exception exception) {}
}
DCContext zipDcContext = new DCContext(getContext(), DCProfileManager.getDCProfile("com.actionsoft.apps.coe.pal", "tmp"), "com.actionsoft.apps.coe.pal", "grouppackage", "zip" + times, zipName);
String downUrl=SDK.getConfAPI().getPortalUrl() + "/r/" + zipDcContext.getDownloadURL().replace("./", "");
ro.put("url",downUrl);
return ro.toString();
} catch (Exception e) {
e.printStackTrace();
return ResponseObject.newErrResponse((e.getMessage() == null) ? e.getCause().getMessage() : e.getMessage()).toString();
}
}
/** /**
* 压缩附件下载功能 * 压缩附件下载功能
* *

View File

@ -1,10 +1,17 @@
package com.awspaas.user.apps.yili.reportform.controller; package com.awspaas.user.apps.yili.reportform.controller;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import com.actionsoft.bpms.commons.htmlframework.HtmlPageTemplate;
import com.actionsoft.bpms.server.RequestParams; import com.actionsoft.bpms.server.RequestParams;
import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.bind.annotation.Controller; import com.actionsoft.bpms.server.bind.annotation.Controller;
import com.actionsoft.bpms.server.bind.annotation.Mapping; import com.actionsoft.bpms.server.bind.annotation.Mapping;
import com.alibaba.fastjson.JSONObject;
import com.awspaas.user.apps.yili.reportform.service.AttrSynService; import com.awspaas.user.apps.yili.reportform.service.AttrSynService;
import com.awspaas.user.apps.yili.reportform.util.JwtUtils;
/** /**
@ -19,5 +26,39 @@ public class AttrSynController {
public String incrementSyn(UserContext uc, RequestParams params) { public String incrementSyn(UserContext uc, RequestParams params) {
return new AttrSynService().incrementSyn(uc,params); return new AttrSynService().incrementSyn(uc,params);
} }
/**
* 流程运行看板领域流程绩效看板
*/
@Mapping("com.awspaas.user.apps.integration.controller.GetmeritsController.getHtml")
public String getHtml(String sid) {
LinkedHashMap<String, String> map = new LinkedHashMap<>();
map.put("sid", sid);
String html = "territory.html";
return HtmlPageTemplate.merge("com.awspaas.user.apps.yili.integration", html, new LinkedHashMap<>());
}
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.getToken")
public JSONObject achievements(String sid) {
UserContext fromSessionId = UserContext.fromSessionId(sid);
System.err.println("=====fromSessionId======="+fromSessionId);
JSONObject result = new JSONObject();
Map<String,Object> claims = new HashMap<> ();
claims.put("userName","10036614");
//生成token
String jwt_token = JwtUtils.getAccessToken ("userId",claims);
System.out.println ("jwt_token="+jwt_token);
String username = JwtUtils.getUserName (jwt_token);
System.out.println ("userName="+username);
result.put("token", jwt_token);
result.put("uid", username);
return result;
}
} }

View File

@ -7,6 +7,7 @@ import com.actionsoft.bpms.server.bind.annotation.Mapping;
import com.actionsoft.bpms.util.DBSql; import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.sdk.local.SDK; import com.actionsoft.sdk.local.SDK;
import com.awspaas.user.apps.yili.reportform.service.DataViewService; import com.awspaas.user.apps.yili.reportform.service.DataViewService;
import com.awspaas.user.apps.yili.reportform.service.DataViewService2;
import com.awspaas.user.apps.yili.reportform.service.ToPageService; import com.awspaas.user.apps.yili.reportform.service.ToPageService;
import java.sql.Connection; import java.sql.Connection;
@ -67,10 +68,6 @@ public class DataViewController {
desc = "部门视图") desc = "部门视图")
public String deptView(UserContext uc, RequestParams params) { public String deptView(UserContext uc, RequestParams params) {
String deptViewVal = deptViewVal = new DataViewService(uc).deptView(uc, params); String deptViewVal = deptViewVal = new DataViewService(uc).deptView(uc, params);
try {
} catch (Exception e) {
SDK.getLogAPI().consoleErr("deptView异常");
}
return deptViewVal; return deptViewVal;
} }
} }

View File

@ -1,5 +1,6 @@
package com.awspaas.user.apps.yili.reportform.controller; package com.awspaas.user.apps.yili.reportform.controller;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.server.RequestParams; import com.actionsoft.bpms.server.RequestParams;
import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.server.bind.annotation.Controller; import com.actionsoft.bpms.server.bind.annotation.Controller;
@ -9,6 +10,8 @@ import com.actionsoft.sdk.local.SDK;
import com.awspaas.user.apps.yili.reportform.service.FileManagementService; import com.awspaas.user.apps.yili.reportform.service.FileManagementService;
import java.sql.Connection; import java.sql.Connection;
import java.text.ParseException;
import java.util.List;
/** /**
* @author:Lizj * @author:Lizj
@ -32,13 +35,7 @@ public class FileManagementController {
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_queryTerms5", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_queryTerms5",
desc = "制度管理看板筛选条件 文件类型、发布单位、所属领域") desc = "制度管理看板筛选条件 文件类型、发布单位、所属领域")
public String queryTerms5(UserContext uc, RequestParams params) { public String queryTerms5(UserContext uc, RequestParams params) {
String queryTerms5Val = null; return new FileManagementService(uc).queryTerms5(uc, params);
try {
queryTerms5Val = new FileManagementService(uc).queryTerms5(uc, params);
} catch (Exception e) {
SDK.getLogAPI().consoleErr("queryTerms5异常");
}
return queryTerms5Val;
} }
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_fileStatistics", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_fileStatistics",
desc = "制度管理看板") desc = "制度管理看板")
@ -48,29 +45,19 @@ public class FileManagementController {
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_deptFileCount", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_deptFileCount",
desc = "部门文件数量") desc = "部门文件数量")
public String deptFileCount(UserContext uc, RequestParams params) { public String deptFileCount(UserContext uc, RequestParams params) {
String deptFileCountVal = null; List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PUBDEPT,PLPARENTID,PLMETHODID,POLICYTYPE,FILESTATE,VIEWCOUNT FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy' OR PLMETHODID='data.form'");
try { return new FileManagementService(uc).deptFileCount(uc, params,fileRowMaps);
deptFileCountVal = new FileManagementService(uc).deptFileCount(uc, params);
} catch (Exception e) {
SDK.getLogAPI().consoleErr("deptFileCount异常"+e.toString());
}
return deptFileCountVal;
} }
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_deptFileYearRenewRate", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_deptFileYearRenewRate",
desc = "部门文件年度更新率") desc = "部门文件年度更新率")
public String deptFileYearRenewRate(UserContext uc, RequestParams params) { public String deptFileYearRenewRate(UserContext uc, RequestParams params) {
return new FileManagementService(uc).deptFileYearRenewRate(uc, params); List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PUBDEPT,PLPARENTID,PLMETHODID,POLICYTYPE,FILESTATE,VIEWCOUNT FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy' OR PLMETHODID='data.form'");
return new FileManagementService(uc).deptFileYearRenewRate(uc, params,fileRowMaps);
} }
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_deptFileYearRenewSituation", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_deptFileYearRenewSituation",
desc = "部门文件年度更新情况") desc = "部门文件年度更新情况")
public String deptFileYearRenewSituation(UserContext uc, RequestParams params) { public String deptFileYearRenewSituation(UserContext uc, RequestParams params) {
String deptFileYearRenewSituationVal = null; return new FileManagementService(uc).deptFileYearRenewSituation(uc, params);
try {
deptFileYearRenewSituationVal = new FileManagementService(uc).deptFileYearRenewSituation(uc, params);
} catch (Exception e) {
SDK.getLogAPI().consoleErr("deptFileYearRenewSituation异常"+e.toString());
}
return deptFileYearRenewSituationVal;
} }
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_queryTerms6", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_queryTerms6",
desc = "文件发布时间分布筛选条件:发布单位、所属领域") desc = "文件发布时间分布筛选条件:发布单位、所属领域")
@ -85,14 +72,8 @@ public class FileManagementController {
} }
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_filePubTimeDistribution", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_filePubTimeDistribution",
desc = "文件发布时间分布") desc = "文件发布时间分布")
public String filePubTimeDistribution(UserContext uc, RequestParams params) { public String filePubTimeDistribution(UserContext uc, RequestParams params) throws ParseException {
String filePubTimeDistributionVal = null; return new FileManagementService(uc).filePubTimeDistribution(uc, params);
try {
filePubTimeDistributionVal = new FileManagementService(uc).filePubTimeDistribution(uc, params);
} catch (Exception e) {
SDK.getLogAPI().consoleErr("filePubTimeDistribution异常");
}
return filePubTimeDistributionVal;
} }
@Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_queryTerms7", @Mapping(value = "com.awspaas.user.apps.yili.reportform.service.FileManagementService_queryTerms7",
desc = "引用情况分析筛选条件:发布单位、所属领域、文件类型") desc = "引用情况分析筛选条件:发布单位、所属领域、文件类型")

View File

@ -41,7 +41,7 @@ public class SyncData implements IJob {
@Override @Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
SDK.getLogAPI().consoleInfo("全量定时同步文件信息开始执行"); SDK.getLogAPI().consoleInfo("全量定时同步文件信息开始执行");
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
Date nowDateJ = new Date(System.currentTimeMillis()); Date nowDateJ = new Date(System.currentTimeMillis());

View File

@ -26,6 +26,7 @@ import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.RequestParams; import com.actionsoft.bpms.server.RequestParams;
import com.actionsoft.bpms.server.UserContext; import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.DBSql; import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UtilString;
import com.actionsoft.sdk.local.SDK; import com.actionsoft.sdk.local.SDK;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -140,7 +141,7 @@ public class DataViewService extends ActionWeb {
} }
} }
nodeType = "position"; nodeType = "position";
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes, null, "dept", null, nodeType); List<Map> deptTreeNodes = TreeUtil.buildTree("0",deptNodes, null, "dept", null, nodeType);
ro.put("positionTree", deptTreeNodes); ro.put("positionTree", deptTreeNodes);
return ro.toString(); return ro.toString();
} }
@ -194,8 +195,8 @@ public class DataViewService extends ActionWeb {
Integer aNum = 0; Integer aNum = 0;
Integer bNum = 0; Integer bNum = 0;
Object[] sqlParams = new Object[] {}; Object[] sqlParams = new Object[] {};
List<RowMap> fileRowMaps = DBSql.getMaps( //List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC");
"SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC"); List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PLNAME,PLMETHODID,PLLEVEL,PLORDERINDEX,RELEVANTFILE,SUPPORTFILE,PROCESSKPI FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' AND FILESTATE='1' ORDER BY PLLEVEL ASC, PLORDERINDEX ASC");
// AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) // AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX)
// ASC // ASC
if (null != positionIDs && !positionIDs.isEmpty()) { if (null != positionIDs && !positionIDs.isEmpty()) {
@ -860,15 +861,8 @@ public class DataViewService extends ActionWeb {
tempMaps.addAll(reYSMaps); tempMaps.addAll(reYSMaps);
} }
} }
//所有数据 //所有数据
UoPProcessMaps.addAll(tempMaps); UoPProcessMaps.addAll(tempMaps);
if (UoPProcessMaps.size() > 1) { if (UoPProcessMaps.size() > 1) {
for (Map uoPProcessMap : UoPProcessMaps) { for (Map uoPProcessMap : UoPProcessMaps) {
if (String.valueOf(uoPProcessMap.get("fileType")).equals("UoPProcess")) { if (String.valueOf(uoPProcessMap.get("fileType")).equals("UoPProcess")) {
@ -977,7 +971,7 @@ public class DataViewService extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes, "0", "dept", "3", null); List<Map> deptTreeNodes = TreeUtil.buildTree("0",deptNodes, "0", "dept", "3", null);
ro.put("deptTree", deptTreeNodes); ro.put("deptTree", deptTreeNodes);
// 文件类型查询 // 文件类型查询
HashMap<String, Object> fileType = new HashMap<>(); HashMap<String, Object> fileType = new HashMap<>();
@ -1024,7 +1018,7 @@ public class DataViewService extends ActionWeb {
String deptString = params.get("dept"); String deptString = params.get("dept");
String fileType = params.get("fileType"); String fileType = params.get("fileType");
ArrayList<String> deptIDList = new ArrayList<>(); ArrayList<String> deptIDList = new ArrayList<>();
String sql = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND ISUSE =1 AND ISSTOP =0 AND (PLMETHODID='process.epc' OR PLMETHODID='control.policy' OR PLMETHODID='process.flowchart')"; String sql = "SELECT ID AS FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL,PLVERSIONID,PLORDERINDEX,EXT3 as POLICYTYPE FROM APP_ACT_COE_PAL_REPOSITORY WHERE ISPUBLISH = 1 AND ISSTOP =0 AND (PLMETHODID='process.epc' OR PLMETHODID='control.policy' OR PLMETHODID='process.flowchart')";
ArrayList<RowMap> fileHandleRowMaps = new ArrayList<>(); ArrayList<RowMap> fileHandleRowMaps = new ArrayList<>();
Map<String, Object> reFileMap = new HashMap<>(); Map<String, Object> reFileMap = new HashMap<>();
RowMap reFileRowMap = new RowMap(reFileMap); RowMap reFileRowMap = new RowMap(reFileMap);
@ -1046,46 +1040,67 @@ public class DataViewService extends ActionWeb {
deptString = deptIDList.toString(); deptString = deptIDList.toString();
} }
} }
System.err.println("=====查询部门视图======"+fileListMap.size());
for (RowMap rowMap : fileListMap) { for (RowMap rowMap : fileListMap) {
String id = rowMap.getString("FILEID"); String id = rowMap.getString("FILEID");
/*
* String plVersionId = rowMap.getString("PLVERSIONID"); String sqly
* ="SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '"
* +plVersionId+"'"; List<RowMap> maps = DBSql.getMaps(sql); if(maps.size()>1) {
* String sqlu =
* "SELECT ID FROM (SELECT ID FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLVERSIONID = '"
* +plVersionId+"' AND ISPUBLISH ='1' ORDER BY PLVER DESC ) WHERE ROWNUM<2";
* String palId = DBSql.getString(sqlu); if(UtilString.isNotEmpty(palId)) {
* if(!id.equals(palId)) { continue; } } }
*/
PALRepositoryModel model = PALRepositoryCache.getCache().get(id); PALRepositoryModel model = PALRepositoryCache.getCache().get(id);
Integer PLLEVEL = model.getLevel(); if(model!=null) {
String methodId = model.getMethodId(); try {
Map<String, JSONObject> queryRepositoryAttributeById = new RepositoryAttribute() Integer PLLEVEL = model.getLevel();
.queryRepositoryAttributeById(model.getId()); String methodId = model.getMethodId();
if (null != queryRepositoryAttributeById && !queryRepositoryAttributeById.isEmpty()) {
// 发布部门 Map<String, JSONObject> queryRepositoryAttributeById = new RepositoryAttribute().queryRepositoryAttributeById(model.getId());
JSONObject Issuing_department = queryRepositoryAttributeById.get("Issuing_department"); if (null != queryRepositoryAttributeById && !queryRepositoryAttributeById.isEmpty()) {
if (null != Issuing_department && !Issuing_department.equals("")) { // 发布部门
JSONArray PUBDEPTJA = Issuing_department.getJSONArray("value"); JSONObject Issuing_department = queryRepositoryAttributeById.get("Issuing_department");
if (null != PUBDEPTJA && !PUBDEPTJA.isEmpty()) { if (null != Issuing_department && !Issuing_department.equals("")) {
for (Object PUBDEPTO : PUBDEPTJA) { JSONArray PUBDEPTJA = Issuing_department.getJSONArray("value");
JSONObject PUBDEPTJO = JSONObject.parseObject(String.valueOf(PUBDEPTO)); if (null != PUBDEPTJA && !PUBDEPTJA.isEmpty()) {
dempId = PUBDEPTJO.getString("id"); for (Object PUBDEPTO : PUBDEPTJA) {
if (deptString.contains(dempId)) { JSONObject PUBDEPTJO = JSONObject.parseObject(String.valueOf(PUBDEPTO));
// 默认添加所在部门的所有文件 dempId = PUBDEPTJO.getString("id");
fileHandleRowMaps.add(rowMap); if (deptString.contains(dempId)) {
if ("process.epc".equals(methodId) || "process.flowchart".equals(methodId)) { // 默认添加所在部门的所有文件
// 支持文件 fileHandleRowMaps.add(rowMap);
getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, if ("process.epc".equals(methodId) || "process.flowchart".equals(methodId)) {
fileHandleRowMaps); // 支持文件
// 相关文件 getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap,
getArrt("R_relevant_flies", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps);
fileHandleRowMaps); // 相关文件
} else if ("control.policy".equals(methodId)) { getArrt("R_relevant_flies", model, dempId, PLLEVEL, reFileRowMap,
// 支持文件 fileHandleRowMaps);
getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap, } else if ("control.policy".equals(methodId)) {
fileHandleRowMaps); // 支持文件
// 相关文件 getArrt("support_files", model, dempId, PLLEVEL, reFileRowMap,
getArrt("related_files", model, dempId, PLLEVEL, reFileRowMap, fileHandleRowMaps);
fileHandleRowMaps); // 相关文件
getArrt("related_files", model, dempId, PLLEVEL, reFileRowMap,
fileHandleRowMaps);
}
}
} }
} }
} }
} }
} catch (Exception e) {
System.err.println("==有问题的模型===>"+model.getName());
// TODO: handle exception
} }
} }
} }
@ -1094,9 +1109,12 @@ public class DataViewService extends ActionWeb {
// System.err.println("------测试1---------" + fileHandleRowMaps); // System.err.println("------测试1---------" + fileHandleRowMaps);
// System.err.println("------测试2---------" + fileRowMaps); // System.err.println("------测试2---------" + fileRowMaps);
// System.out.println("代码段执行时间:" + (endTime - startTime) + "ms"); // System.out.println("代码段执行时间:" + (endTime - startTime) + "ms");
//System.err.println("=========fileRowMaps1========>"+fileRowMaps);
//System.err.println("=========fileType========>"+fileType);
if (null != fileRowMaps && fileRowMaps.size() > 0) { if (null != fileRowMaps && fileRowMaps.size() > 0) {
if (null != fileType && !fileType.equals("")) { if (null != fileType && !fileType.equals("")) {
fileHandleRowMaps = new ArrayList<>(); fileHandleRowMaps = new ArrayList<>();
//System.err.println("=====fileRowMaps2========"+fileRowMaps);
if (null != fileRowMaps && !fileRowMaps.isEmpty()) { if (null != fileRowMaps && !fileRowMaps.isEmpty()) {
for (RowMap fileRowMap : fileRowMaps) { for (RowMap fileRowMap : fileRowMaps) {
if (fileType.equals("processFile")) { if (fileType.equals("processFile")) {
@ -1153,6 +1171,7 @@ public class DataViewService extends ActionWeb {
// reFileRowMap); // reFileRowMap);
} }
fileRowMaps = fileHandleRowMaps; fileRowMaps = fileHandleRowMaps;
//System.err.println("=======fileRowMaps========="+fileRowMaps);
// 遍历选择的结果 // 遍历选择的结果
List<Map> fileMaps = new ArrayList<>(); List<Map> fileMaps = new ArrayList<>();
List<RowMap> frameRowMaps = new ArrayList<>(); List<RowMap> frameRowMaps = new ArrayList<>();
@ -1191,6 +1210,7 @@ public class DataViewService extends ActionWeb {
toCollection( toCollection(
() -> new TreeSet<>(Comparator.comparing(o -> o.getString("FRAMEID")))), () -> new TreeSet<>(Comparator.comparing(o -> o.getString("FRAMEID")))),
ArrayList::new)); ArrayList::new));
for (RowMap frameRowMap : frameRowMaps) { for (RowMap frameRowMap : frameRowMaps) {
frameMap = new HashMap<String, Object>(); frameMap = new HashMap<String, Object>();
nodeType = "frame"; nodeType = "frame";
@ -1202,7 +1222,7 @@ public class DataViewService extends ActionWeb {
frameMap.put("nodeType", nodeType); frameMap.put("nodeType", nodeType);
fileMaps.add(frameMap); fileMaps.add(frameMap);
} }
/// System.err.println("=====fileRowMaps1=====>" + fileRowMaps); //System.err.println("=====fileRowMaps1=====>" + fileRowMaps);
for (RowMap fileRowMap : fileRowMaps) { for (RowMap fileRowMap : fileRowMaps) {
fileMap = new HashMap<String, Object>(); fileMap = new HashMap<String, Object>();
@ -1240,13 +1260,14 @@ public class DataViewService extends ActionWeb {
fileMap.put("PUBDATETIME", fileRowMap.getString("PUBDATETIME")); fileMap.put("PUBDATETIME", fileRowMap.getString("PUBDATETIME"));
fileMap.put("path", path); fileMap.put("path", path);
fileMap.put("ORDERINDEX", fileRowMap.getString("PLORDERINDEX")); fileMap.put("ORDERINDEX", fileRowMap.getString("PLORDERINDEX"));
fileMap.put("TLEVEL", fileRowMap.getString("PLLEVEL")); String sqlsss = "SELECT PLLEVEL FROM APP_ACT_COE_PAL_REPOSITORY_1124 WHERE ID = '"+fileRowMap.getString("FILEID")+"'";
String leve = DBSql.getString(sqlsss);
fileMap.put("TLEVEL",leve);
fileMap.put("nodeType", nodeType); fileMap.put("nodeType", nodeType);
fileMaps.add(fileMap); fileMaps.add(fileMap);
} }
// System.err.println("=====fileMaps=====>" + fileMaps); //System.err.println("=====fileMaps=====>" + fileMaps);
// System.err.println("=====返回参数4======>" + ro.toString()); List<Map> fileTreeNodes = TreeUtil.buildTree("0",fileMaps, "process", "frame", null, null);
List<Map> fileTreeNodes = TreeUtil.buildTree(fileMaps, "process", "frame", null, null);
filesCount = new LinkedHashMap<>(); filesCount = new LinkedHashMap<>();
filesCount.put("processFileNum", processFileNum); filesCount.put("processFileNum", processFileNum);
filesCount.put("policyFileNum", policyFileNum); filesCount.put("policyFileNum", policyFileNum);

View File

@ -125,7 +125,7 @@ public class DataViewService2 extends ActionWeb {
} }
} }
nodeType = "position"; nodeType = "position";
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,null,"dept",null,nodeType); List<Map> deptTreeNodes = TreeUtil.buildTree("0",deptNodes,null,"dept",null,nodeType);
ro.put("positionTree", deptTreeNodes); ro.put("positionTree", deptTreeNodes);
return ro.toString(); return ro.toString();
} }
@ -887,7 +887,7 @@ public class DataViewService2 extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,"0","dept","3",null); List<Map> deptTreeNodes = TreeUtil.buildTree("0",deptNodes,"0","dept","3",null);
ro.put("deptTree", deptTreeNodes); ro.put("deptTree", deptTreeNodes);
//文件类型查询 //文件类型查询
HashMap<String, Object> fileType = new HashMap<>(); HashMap<String, Object> fileType = new HashMap<>();
@ -936,7 +936,7 @@ public class DataViewService2 extends ActionWeb {
// AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC // AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC
List<RowMap> fileRowMaps = DBSql.getMaps("SELECT BF.FILEID,BF.PLNAME,BF.PLPARENTID,BF.PLMETHODID,BF.PUBDEPT,BF.PLLEVEL,BF.PLORDERINDEX,BF.SUPPORTFILE,BF.POLICYTYPE,BF.L1ID,PF.FRAMEID,PF.FRAMETYPE FROM BO_EU_PAL_FILE1 BF LEFT JOIN BO_EU_PAL_FRAME PF ON BF.L1ID=PF.FRAMEID" List<RowMap> fileRowMaps = DBSql.getMaps("SELECT BF.FILEID,BF.PLNAME,BF.PLPARENTID,BF.PLMETHODID,BF.PUBDEPT,BF.PLLEVEL,BF.PLORDERINDEX,BF.SUPPORTFILE,BF.POLICYTYPE,BF.L1ID,PF.FRAMEID,PF.FRAMETYPE FROM BO_EU_PAL_FILE1 BF LEFT JOIN BO_EU_PAL_FRAME PF ON BF.L1ID=PF.FRAMEID"
+ " WHERE (BF.PLMETHODID='process.epc' OR BF.PLMETHODID='process.flowchart' OR BF.PLMETHODID='control.policy') AND " + " WHERE (BF.PLMETHODID='process.epc' OR BF.PLMETHODID='process.flowchart' OR BF.PLMETHODID='control.policy') AND "
+ " BF.L1ID IS NOT NULL AND FILESTATE='1' AND PLNAME in ('关于各单位会计人员参加年度继续教育及相关费用报销事宜的通知','事业部预算追加与调整流程(集团部分)') ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC"); + " BF.L1ID IS NOT NULL AND FILESTATE='1' ORDER BY TO_NUMBER(PLLEVEL) ASC, TO_NUMBER(PLORDERINDEX) ASC");
String sql = "SELECT ID as FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL, from APP_ACT_COE_PAL_REPOSITORY where ISPUBLISH = 1 WHERE (.PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy') AND PLNAME in ('关于各单位会计人员参加年度继续教育及相关费用报销事宜的通知'"; String sql = "SELECT ID as FILEID,PLNAME,PLPARENTID,PLMETHODID,PLLEVEL, from APP_ACT_COE_PAL_REPOSITORY where ISPUBLISH = 1 WHERE (.PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy') AND PLNAME in ('关于各单位会计人员参加年度继续教育及相关费用报销事宜的通知'";
@ -1163,7 +1163,7 @@ public class DataViewService2 extends ActionWeb {
fileMap.put("nodeType", nodeType); fileMap.put("nodeType", nodeType);
fileMaps.add(fileMap); fileMaps.add(fileMap);
} }
List<Map> fileTreeNodes = TreeUtil.buildTree(fileMaps,"process","frame",null,null); List<Map> fileTreeNodes = TreeUtil.buildTree("0",fileMaps,"process","frame",null,null);
filesCount = new LinkedHashMap<>(); filesCount = new LinkedHashMap<>();
filesCount.put("processFileNum", processFileNum); filesCount.put("processFileNum", processFileNum);
filesCount.put("policyFileNum", policyFileNum); filesCount.put("policyFileNum", policyFileNum);
@ -1342,7 +1342,7 @@ public class DataViewService2 extends ActionWeb {
fileMaps.add(fileMap); fileMaps.add(fileMap);
} }
List<Map> fileTreeNodes = TreeUtil.buildTree(fileMaps,"process","frame",null,null); List<Map> fileTreeNodes = TreeUtil.buildTree("0",fileMaps,"process","frame",null,null);
filesCount = new LinkedHashMap<>(); filesCount = new LinkedHashMap<>();
filesCount.put("processFileNum", processFileNum); filesCount.put("processFileNum", processFileNum);
filesCount.put("policyFileNum", policyFileNum); filesCount.put("policyFileNum", policyFileNum);

View File

@ -1,16 +1,5 @@
package com.awspaas.user.apps.yili.reportform.service; package com.awspaas.user.apps.yili.reportform.service;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.RequestParams;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.sdk.local.SDK;
import com.awspaas.user.apps.yili.reportform.util.GetNodesUtil;
import com.awspaas.user.apps.yili.reportform.util.TreeUtil;
import java.sql.Connection;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
@ -19,7 +8,22 @@ import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.Period; import java.time.Period;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import com.actionsoft.bpms.commons.database.RowMap;
import com.actionsoft.bpms.commons.mvc.view.ActionWeb;
import com.actionsoft.bpms.commons.mvc.view.ResponseObject;
import com.actionsoft.bpms.server.RequestParams;
import com.actionsoft.bpms.server.UserContext;
import com.actionsoft.bpms.util.DBSql;
import com.actionsoft.bpms.util.UtilString;
import com.alibaba.fastjson.JSONObject;
import com.awspaas.user.apps.yili.reportform.util.GetNodesUtil;
import com.awspaas.user.apps.yili.reportform.util.TreeUtil;
/** /**
* @author:Lizj * @author:Lizj
@ -93,6 +97,11 @@ public class FileManagementService extends ActionWeb {
//文件类型 //文件类型
HashMap<String, Object> fileType = new HashMap<>(); HashMap<String, Object> fileType = new HashMap<>();
ArrayList<Map> fileTypes = new ArrayList<>(); ArrayList<Map> fileTypes = new ArrayList<>();
fileType = new HashMap<String, Object>();
fileType.put("termsKey","totalFile");
fileType.put("termsVal","全部");
fileTypes.add(fileType);
fileType = new HashMap<String, Object>();
fileType.put("termsKey","processFile"); fileType.put("termsKey","processFile");
fileType.put("termsVal","流程"); fileType.put("termsVal","流程");
fileTypes.add(fileType); fileTypes.add(fileType);
@ -111,7 +120,7 @@ public class FileManagementService extends ActionWeb {
ro.put("fileTypes",fileTypes); ro.put("fileTypes",fileTypes);
//发布单位 //发布单位
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT"
+ " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0'"); + " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND ID not in ('5bc3a2dc-3bd2-4376-bcc3-5612e28e55fe','e79281b1-2f81-4895-b30e-9f96e9ad0e2c','53d3076d-cd2d-4f5b-bacb-8e93273e9f44','9c795620-93c6-485c-b9fa-93536c988da8','12d42abb-a58f-411b-8c71-0a421a27eafc','65048aee-157f-49f2-a2dc-5903dd26f519')");
//demo3 //demo3
//3e74f14d-852f-4f6f-a809-08a56697f103 //3e74f14d-852f-4f6f-a809-08a56697f103
//本地 //本地
@ -131,7 +140,7 @@ public class FileManagementService extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,"0","dept","3",null); List<Map> deptTreeNodes = TreeUtil.buildTree("1",deptNodes,"0","dept","3",null);
//所属领域 //所属领域
ArrayList<Map> frameList = new ArrayList<>(); ArrayList<Map> frameList = new ArrayList<>();
ArrayList<Map> fieldMaps = new ArrayList<>(); ArrayList<Map> fieldMaps = new ArrayList<>();
@ -155,7 +164,7 @@ public class FileManagementService extends ActionWeb {
fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL")))); fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL"))));
fieldNodes.add(fieldNode); fieldNodes.add(fieldNode);
} }
List<Map> fieldTreeNodes = TreeUtil.buildTree(fieldNodes, "process", null, null, null); List<Map> fieldTreeNodes = TreeUtil.buildTree("1",fieldNodes, "process", null, null, null);
ro.put("deptTreeNodes",deptTreeNodes); ro.put("deptTreeNodes",deptTreeNodes);
ro.put("fieldTreeNodes",fieldTreeNodes); ro.put("fieldTreeNodes",fieldTreeNodes);
return ro.toString(); return ro.toString();
@ -176,10 +185,16 @@ public class FileManagementService extends ActionWeb {
String field = params.get("field"); String field = params.get("field");
ArrayList<String> deptIDList = new ArrayList<>(); ArrayList<String> deptIDList = new ArrayList<>();
ArrayList<Map> fieldList = new ArrayList<>(); ArrayList<Map> fieldList = new ArrayList<>();
List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PUBDEPT,PLMETHODID,POLICYTYPE,FILESTATE,VIEWCOUNT FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy' OR PLMETHODID='data.form'"); List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PUBDEPT,PLPARENTID,PLMETHODID,POLICYTYPE,FILESTATE,VIEWCOUNT FROM BO_EU_PAL_FILE1 WHERE PLMETHODID='process.epc' OR PLMETHODID='process.flowchart' OR PLMETHODID='control.policy' OR PLMETHODID='data.form'");
ArrayList<RowMap> fileHandleMaps = new ArrayList<>(); ArrayList<RowMap> fileHandleMaps = new ArrayList<>();
if (null!=fileType && !fileType.equals("")) { if (null!=fileType && !fileType.equals("")) {
fileHandleMaps = new ArrayList<>(); fileHandleMaps = new ArrayList<>();
if (fileType.equals("totalFile")||fileType.equals("all")) {
for (RowMap fileRowMap : fileRowMaps) {
fileHandleMaps.add(fileRowMap);
}
}
if (fileType.equals("processFile")) { if (fileType.equals("processFile")) {
for (RowMap fileRowMap : fileRowMaps) { for (RowMap fileRowMap : fileRowMaps) {
if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) { if (fileRowMap.getString("PLMETHODID").equals("process.epc") || fileRowMap.getString("PLMETHODID").equals("process.flowchart")) {
@ -211,30 +226,45 @@ public class FileManagementService extends ActionWeb {
fileRowMaps = fileHandleMaps; fileRowMaps = fileHandleMaps;
} }
if (null!=unit && !unit.equals("")) { if (null!=unit && !unit.equals("")) {
fileHandleMaps = new ArrayList<>(); if("all".equals(unit)) {
deptIDList = new ArrayList<String>(); for (RowMap fileRowMap : fileRowMaps) {
deptIDList = GetNodesUtil.getChildDept(unit, deptIDList); fileHandleMaps.add(fileRowMap);
for (String deptID : deptIDList) {
for (RowMap fileRowMap : fileRowMaps) {
if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
fileHandleMaps.add(fileRowMap);
}
} }
} }else {
fileHandleMaps = new ArrayList<>();
deptIDList = new ArrayList<String>();
deptIDList = GetNodesUtil.getChildDept(unit, deptIDList);
for (String deptID : deptIDList) {
for (RowMap fileRowMap : fileRowMaps) {
if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
fileHandleMaps.add(fileRowMap);
}
}
}
}
fileRowMaps = fileHandleMaps; fileRowMaps = fileHandleMaps;
} }
if (null!=field && !field.equals("")) { if (null!=field && !field.equals("")) {
fileHandleMaps = new ArrayList<>();
fieldList = new ArrayList<Map>(); if("all".equals(field)) {
fieldList = GetNodesUtil.getChildFrame(field,"", fieldList); for (RowMap fileRowMap : fileRowMaps) {
for (Map fieldMap : fieldList) { fileHandleMaps.add(fileRowMap);
String fieldID = String.valueOf(fieldMap.get("FRAMEID")); }
for (RowMap fileRowMap : fileRowMaps) { }else {
if (fileRowMap.getString("PLPARENTID").equals(fieldID)) { fileHandleMaps = new ArrayList<>();
fileHandleMaps.add(fileRowMap); fieldList = new ArrayList<Map>();
} fieldList = GetNodesUtil.getChildFrame(field,"", fieldList);
} for (Map fieldMap : fieldList) {
} String fieldID = String.valueOf(fieldMap.get("FRAMEID"));
for (RowMap fileRowMap : fileRowMaps) {
if (fileRowMap.getString("PLPARENTID").equals(fieldID)) {
fileHandleMaps.add(fileRowMap);
}
}
}
}
fileRowMaps = fileHandleMaps; fileRowMaps = fileHandleMaps;
} }
//文件状态已发布审批中已失效 查阅总数 //文件状态已发布审批中已失效 查阅总数
@ -242,6 +272,16 @@ public class FileManagementService extends ActionWeb {
Integer inApprovalCount = 0; Integer inApprovalCount = 0;
Integer expiredCount = 0; Integer expiredCount = 0;
Integer consultCount = 0; Integer consultCount = 0;
String sql = "SELECT count(*) FROM BO_EU_USER_LOGIN_LOG WHERE LOGTYPE = '3'";
String count = DBSql.getString(sql);
/*
* ExecutorService service = Executors.newFixedThreadPool(1);
* service.execute(new Runnable() {
*
* @Override public void run() { } });
*/
if (null!=fileRowMaps && fileRowMaps.isEmpty()==false) { if (null!=fileRowMaps && fileRowMaps.isEmpty()==false) {
for (RowMap fileRowMap : fileRowMaps) { for (RowMap fileRowMap : fileRowMaps) {
String fileState = fileRowMap.getString("FILESTATE"); String fileState = fileRowMap.getString("FILESTATE");
@ -260,7 +300,7 @@ public class FileManagementService extends ActionWeb {
ro.put("publishedCount",publishedCount); ro.put("publishedCount",publishedCount);
ro.put("inApprovalCount",inApprovalCount); ro.put("inApprovalCount",inApprovalCount);
ro.put("expiredCount",expiredCount); ro.put("expiredCount",expiredCount);
ro.put("consultCount",consultCount); ro.put("consultCount",count);
} else { } else {
ro.ok("暂无文件"); ro.ok("暂无文件");
publishedCount = 0; publishedCount = 0;
@ -275,178 +315,221 @@ public class FileManagementService extends ActionWeb {
return ro.toString(); return ro.toString();
} }
/**
* @methodName:
* @param: //获取属性
* @return: public String getArrtValue(String plId,String ArrtKey,String type) {
* @description:部门文件数量 String arrtValue = "";
* @auther: Lizj try {
* @date: 2022/6/28 22:43 String sql = "select PROPERTYVALUE from APP_ACT_COE_PAL_PROP where PLID = '"+plId+"' and PROPERTYID = '"+ArrtKey+"'";
*/ String relatFileJson = DBSql.getString(sql);
public String deptFileCount(UserContext uc, RequestParams params) { if(UtilString.isNotEmpty(relatFileJson)) {
/*文件数量=当日生效文档总数*/ JSONObject parseObject = JSONObject.parseObject(relatFileJson);
ResponseObject ro = ResponseObject.newOkResponse(); String fileNames = parseObject.getString("relationShapeText");
HashMap<String, Object> deptFileCountMap = new HashMap<>(); if(UtilString.isNotEmpty(fileNames)) {
ArrayList<String> deptIDList = new ArrayList<>(); arrtValue = fileNames;
ArrayList<Map> BDFileCountMaps = new ArrayList<>(); }
ArrayList<Map> FDFileCountMaps = new ArrayList<>();
Integer fileCount = 0; }
//事业部和职能部门ID名称 list } catch (Exception e) {
List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PUBDEPT FROM BO_EU_PAL_FILE1 WHERE FILEUSESTATE='1'"); // TODO: handle exception
List<RowMap> BDInfoMaps = DBSql.getMaps("SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='BD'"); }
List<RowMap> FDInfoMaps = DBSql.getMaps("SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='FD'"); return arrtValue;
if (null!=BDInfoMaps && !BDInfoMaps.isEmpty()) {
for (RowMap bdInfoMap : BDInfoMaps) { }
deptFileCountMap = new HashMap<String, Object>();
fileCount = 0; /**
String bdDeptID = bdInfoMap.getString("DEPTID"); * @methodName:
deptIDList = new ArrayList<String>(); * @param:
deptIDList = GetNodesUtil.getChildDept(bdDeptID, deptIDList); * @return:
if (null!=deptIDList && !deptIDList.isEmpty()) { * @description:部门文件数量
for (String deptID : deptIDList) { * @auther: Lizj
for (RowMap fileRowMap : fileRowMaps) { * @date: 2022/6/28 22:43
if (fileRowMap.getString("PUBDEPT").contains(deptID)) { */
fileCount += 1; public String deptFileCount(UserContext uc, RequestParams params,List<RowMap> fileRowMaps) {
} /*文件数量=当日生效文档总数*/
} ResponseObject ro = ResponseObject.newOkResponse();
} HashMap<String, Object> deptFileCountMap = new HashMap<>();
} ArrayList<String> deptIDList = new ArrayList<>();
deptFileCountMap.put("deptID",bdDeptID); ArrayList<Map> BDFileCountMaps = new ArrayList<>();
deptFileCountMap.put("deptName",bdInfoMap.getString("ABBREVIATION")); ArrayList<Map> FDFileCountMaps = new ArrayList<>();
deptFileCountMap.put("fileCount",fileCount); Integer fileCount = 0;
BDFileCountMaps.add(deptFileCountMap); //事业部和职能部门ID名称 list
} List<RowMap> BDInfoMaps = DBSql.getMaps("SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='BD'");
} List<RowMap> FDInfoMaps = DBSql.getMaps("SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='FD'");
if (null!=FDInfoMaps && !FDInfoMaps.isEmpty()) { if (null!=BDInfoMaps && !BDInfoMaps.isEmpty()) {
for (RowMap fdInfoMap : FDInfoMaps) { for (RowMap bdInfoMap : BDInfoMaps) {
deptFileCountMap = new HashMap<String, Object>(); deptFileCountMap = new HashMap<String, Object>();
fileCount = 0; fileCount = 0;
String fdDeptID = fdInfoMap.getString("DEPTID"); String bdDeptID = bdInfoMap.getString("DEPTID");
deptIDList = new ArrayList<String>(); deptIDList = new ArrayList<String>();
deptIDList = GetNodesUtil.getChildDept(fdDeptID, deptIDList); deptIDList = GetNodesUtil.getChildDept(bdDeptID, deptIDList);
if (null!=deptIDList && !deptIDList.isEmpty()) { if (null!=deptIDList && !deptIDList.isEmpty()) {
for (String deptID : deptIDList) { for (String deptID : deptIDList) {
for (RowMap fileRowMap : fileRowMaps) { for (RowMap fileRowMap : fileRowMaps) {
if (fileRowMap.getString("PUBDEPT").contains(deptID)) { if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
fileCount += 1; fileCount += 1;
} }
} }
} }
} }
deptFileCountMap.put("deptID",fdDeptID); deptFileCountMap.put("deptID",bdDeptID);
deptFileCountMap.put("deptName",fdInfoMap.getString("ABBREVIATION")); deptFileCountMap.put("deptName",bdInfoMap.getString("ABBREVIATION"));
deptFileCountMap.put("fileCount",fileCount); deptFileCountMap.put("fileCount",fileCount);
FDFileCountMaps.add(deptFileCountMap); BDFileCountMaps.add(deptFileCountMap);
} }
} }
ro.put("BDFileCount",BDFileCountMaps); if (null!=FDInfoMaps && !FDInfoMaps.isEmpty()) {
ro.put("FDFileCount",FDFileCountMaps); for (RowMap fdInfoMap : FDInfoMaps) {
return ro.toString(); deptFileCountMap = new HashMap<String, Object>();
} fileCount = 0;
/** String fdDeptID = fdInfoMap.getString("DEPTID");
* @methodName: deptIDList = new ArrayList<String>();
* @param: deptIDList = GetNodesUtil.getChildDept(fdDeptID, deptIDList);
* @return: if (null!=deptIDList && !deptIDList.isEmpty()) {
* @description:部门文件年度更新率 for (String deptID : deptIDList) {
* @auther: Lizj for (RowMap fileRowMap : fileRowMaps) {
* @date: 2022/6/28 22:49 if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
*/ fileCount += 1;
public String deptFileYearRenewRate(UserContext uc, RequestParams params) { }
/*年度更新率=(某单位年度新增文件+年度修订文件)/某单位当前文件总数*/ }
ResponseObject ro = ResponseObject.newOkResponse(); }
HashMap<String, Object> renewRateMap = new HashMap<>(); }
ArrayList<Map> BDRenewRateMaps = new ArrayList<>(); deptFileCountMap.put("deptID",fdDeptID);
ArrayList<Map> FDRenewRateMaps = new ArrayList<>(); deptFileCountMap.put("deptName",fdInfoMap.getString("ABBREVIATION"));
ArrayList<String> deptIDList = new ArrayList<>(); deptFileCountMap.put("fileCount",fileCount);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); FDFileCountMaps.add(deptFileCountMap);
Integer deptFileNum = 0; }
Integer newFileNum = 0; }
String renewRate = null; ro.put("BDFileCount",BDFileCountMaps);
//获取当前年 ro.put("FDFileCount",FDFileCountMaps);
LocalDateTime nowDate = LocalDateTime.now(); return ro.toString();
int nowYear = nowDate.getYear(); }
NumberFormat numberformat = NumberFormat.getInstance();
numberformat.setMaximumFractionDigits(2); /**
//事业部和职能部门ID名称 list * @methodName:
List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,FILEVERSION,PUBDEPT,PUBDATETIME FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); * @param:
List<RowMap> BDInfoMaps = DBSql.getMaps("SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='BD'"); * @return:
List<RowMap> FDInfoMaps = DBSql.getMaps("SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='FD'"); * @description:部门文件年度更新率
if (null!=BDInfoMaps && !BDInfoMaps.isEmpty()) { * @auther: Lizj
for (RowMap bdInfoMap : BDInfoMaps) { * @date: 2022/6/28 22:49
renewRateMap = new HashMap<String, Object>(); */
deptFileNum = 0;
newFileNum = 0; public String deptFileYearRenewRate(UserContext uc, RequestParams params,List<RowMap> fileRowMaps) {
renewRate = null; /* 年度更新率=(某单位年度新增文件+年度修订文件)/某单位当前文件总数 */
String bdDeptID = bdInfoMap.getString("DEPTID"); ResponseObject ro = ResponseObject.newOkResponse();
deptIDList = new ArrayList<String>(); HashMap<String, Object> renewRateMap = new HashMap<>();
deptIDList = GetNodesUtil.getChildDept(bdDeptID, deptIDList); ArrayList<Map> BDRenewRateMaps = new ArrayList<>();
if (null!=deptIDList && !deptIDList.isEmpty()) { ArrayList<Map> FDRenewRateMaps = new ArrayList<>();
for (String deptID : deptIDList) { ArrayList<String> deptIDList = new ArrayList<>();
for (RowMap fileRowMap : fileRowMaps) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (fileRowMap.getString("PUBDEPT").contains(deptID)) { Integer deptFileNum = 0;
deptFileNum += 1; Integer newFileNum = 0;
Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); String renewRate = null;
String FILEVERSION = fileRowMap.getString("FILEVERSION"); // 获取当前年
String pubdatetimeString= sdf.format(PUBDATETIME); LocalDateTime nowDate = LocalDateTime.now();
LocalDate pubDate = LocalDate.parse(pubdatetimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd")); int nowYear = nowDate.getYear();
if (pubDate.getYear()==nowYear) { NumberFormat numberformat = NumberFormat.getInstance();
newFileNum += 1; numberformat.setMaximumFractionDigits(2);
} // 事业部和职能部门ID名称 list
} // List<RowMap> fileRowMaps = DBSql.getMaps("SELECT
} // FILEID,FILEVERSION,PUBDEPT,PUBDATETIME FROM BO_EU_PAL_FILE1 WHERE
} // FILESTATE='1'");
} List<RowMap> BDInfoMaps = DBSql.getMaps(
if (deptFileNum!=0) { "SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='BD'");
renewRate = numberformat.format((float) newFileNum / (float) deptFileNum * 100); List<RowMap> FDInfoMaps = DBSql.getMaps(
} else { "SELECT DEPTID,DEPTNAME,ABBREVIATION,DEPTTYPE FROM BO_EU_DEPT_ABBREVIATION WHERE DEPTTYPE='FD'");
renewRate = "0"; if (null != BDInfoMaps && !BDInfoMaps.isEmpty()) {
} for (RowMap bdInfoMap : BDInfoMaps) {
renewRateMap.put("deptID",bdDeptID); renewRateMap = new HashMap<String, Object>();
renewRateMap.put("deptName",bdInfoMap.getString("ABBREVIATION")); deptFileNum = 0;
renewRateMap.put("renewRate",renewRate); newFileNum = 0;
BDRenewRateMaps.add(renewRateMap); renewRate = null;
} String bdDeptID = bdInfoMap.getString("DEPTID");
} deptIDList = new ArrayList<String>();
if (null!=FDInfoMaps && !FDInfoMaps.isEmpty()) { deptIDList = GetNodesUtil.getChildDept(bdDeptID, deptIDList);
for (RowMap fdInfoMap : FDInfoMaps) { if (null != deptIDList && !deptIDList.isEmpty()) {
renewRateMap = new HashMap<String, Object>(); for (String deptID : deptIDList) {
deptFileNum = 0; for (RowMap fileRowMap : fileRowMaps) {
newFileNum = 0; if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
renewRate = null; deptFileNum += 1;
String fdDeptID = fdInfoMap.getString("DEPTID"); String publishDate = fileRowMap.getString("PUBDATETIME");
deptIDList = new ArrayList<String>(); if (UtilString.isNotEmpty(publishDate)) {
deptIDList = GetNodesUtil.getChildDept(fdDeptID, deptIDList); if (publishDate.contains("2022")) {
if (null!=deptIDList && !deptIDList.isEmpty()) { newFileNum += 1;
for (String deptID : deptIDList) { }
for (RowMap fileRowMap : fileRowMaps) { }
if (fileRowMap.getString("PUBDEPT").contains(deptID)) { /*
deptFileNum += 1; * Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); String
Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); * FILEVERSION = fileRowMap.getString("FILEVERSION"); String pubdatetimeString=
String FILEVERSION = fileRowMap.getString("FILEVERSION"); * sdf.format(PUBDATETIME); LocalDate pubDate =
String pubdatetimeString= sdf.format(PUBDATETIME); * LocalDate.parse(pubdatetimeString,
LocalDate pubDate = LocalDate.parse(pubdatetimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd")); * DateTimeFormatter.ofPattern("yyyy-MM-dd")); if (pubDate.getYear()==nowYear) {
if (pubDate.getYear()==nowYear) { * newFileNum += 1; }
newFileNum += 1; */
} }
} }
} }
} }
} if (deptFileNum != 0) {
if (deptFileNum!=0) { renewRate = numberformat.format((float) newFileNum / (float) deptFileNum * 100);
renewRate = numberformat.format((float) newFileNum / (float) deptFileNum * 100); } else {
} else { renewRate = "0";
renewRate = "0"; }
} renewRateMap.put("deptID", bdDeptID);
renewRateMap.put("deptID",fdDeptID); renewRateMap.put("deptName", bdInfoMap.getString("ABBREVIATION"));
renewRateMap.put("deptName",fdInfoMap.getString("ABBREVIATION")); renewRateMap.put("renewRate", renewRate);
renewRateMap.put("renewRate",renewRate); BDRenewRateMaps.add(renewRateMap);
FDRenewRateMaps.add(renewRateMap); }
} }
} if (null != FDInfoMaps && !FDInfoMaps.isEmpty()) {
ro.put("BDRenewRate",BDRenewRateMaps); for (RowMap fdInfoMap : FDInfoMaps) {
ro.put("FDRenewRate",FDRenewRateMaps); renewRateMap = new HashMap<String, Object>();
return ro.toString(); deptFileNum = 0;
} newFileNum = 0;
renewRate = null;
String fdDeptID = fdInfoMap.getString("DEPTID");
deptIDList = new ArrayList<String>();
deptIDList = GetNodesUtil.getChildDept(fdDeptID, deptIDList);
if (null != deptIDList && !deptIDList.isEmpty()) {
for (String deptID : deptIDList) {
for (RowMap fileRowMap : fileRowMaps) {
if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
deptFileNum += 1;
String publishDate = fileRowMap.getString("PUBDATETIME");
if (UtilString.isNotEmpty(publishDate)) {
if (publishDate.contains("2022")) {
newFileNum += 1;
}
}
/*
* Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); String
* FILEVERSION = fileRowMap.getString("FILEVERSION"); String pubdatetimeString=
* sdf.format(PUBDATETIME); LocalDate pubDate =
* LocalDate.parse(pubdatetimeString,
* DateTimeFormatter.ofPattern("yyyy-MM-dd")); if (pubDate.getYear()==nowYear) {
* newFileNum += 1; }
*/
}
}
}
}
if (deptFileNum != 0) {
renewRate = numberformat.format((float) newFileNum / (float) deptFileNum * 100);
} else {
renewRate = "0";
}
renewRateMap.put("deptID", fdDeptID);
renewRateMap.put("deptName", fdInfoMap.getString("ABBREVIATION"));
renewRateMap.put("renewRate", renewRate);
FDRenewRateMaps.add(renewRateMap);
}
}
ro.put("BDRenewRate", BDRenewRateMaps);
ro.put("FDRenewRate", FDRenewRateMaps);
return ro.toString();
}
/** /**
* @methodName: * @methodName:
* @param: * @param:
@ -483,31 +566,48 @@ public class FileManagementService extends ActionWeb {
abolishCount = 0; abolishCount = 0;
String bdDeptID = bdInfoMap.getString("DEPTID"); String bdDeptID = bdInfoMap.getString("DEPTID");
deptIDList = new ArrayList<String>(); deptIDList = new ArrayList<String>();
deptIDList = GetNodesUtil.getChildDept(bdDeptID, deptIDList); try {
if (null!=deptIDList && !deptIDList.isEmpty()) {
for (String deptID : deptIDList) { deptIDList = GetNodesUtil.getChildDept(bdDeptID, deptIDList);
for (RowMap fileRowMap : fileRowMaps) { if (null!=deptIDList && !deptIDList.isEmpty()) {
if (fileRowMap.getString("PUBDEPT").contains(deptID)) { for (String deptID : deptIDList) {
Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); for (RowMap fileRowMap : fileRowMaps) {
String pubdatetimeString= sdf.format(PUBDATETIME); if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
LocalDate pubDate = LocalDate.parse(pubdatetimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd")); String FILESTATE = fileRowMap.getString("FILESTATE");
String FILESTATE = fileRowMap.getString("FILESTATE"); String FILEVERSION = fileRowMap.getString("FILEVERSION");
String FILEVERSION = fileRowMap.getString("FILEVERSION"); String publishDate = fileRowMap.getString("PUBDATETIME");
if (pubDate.getYear()==nowYear) { if (UtilString.isNotEmpty(publishDate)) {
if (FILESTATE.equals("1") && FILEVERSION.equals("1.0")) { if (publishDate.contains("2022")) {
createCount += 1; if (FILESTATE.equals("1") && FILEVERSION.equals("1.0")) {
} createCount += 1;
if (FILESTATE.equals("1") && !FILEVERSION.equals("1.0")) { }
updateCount += 1; if (FILESTATE.equals("1") && !FILEVERSION.equals("1.0")) {
} updateCount += 1;
if (FILESTATE.equals("3")) { }
abolishCount += 1; if (FILESTATE.equals("3")) {
} abolishCount += 1;
} }
} }
} }
}
} /*
* Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); String
* pubdatetimeString= sdf.format(PUBDATETIME); LocalDate pubDate =
* LocalDate.parse(pubdatetimeString,
* DateTimeFormatter.ofPattern("yyyy-MM-dd"));
*
* if (pubDate.getYear()==nowYear) { if (FILESTATE.equals("1") &&
* FILEVERSION.equals("1.0")) { createCount += 1; } if (FILESTATE.equals("1") &&
* !FILEVERSION.equals("1.0")) { updateCount += 1; } if (FILESTATE.equals("3"))
* { abolishCount += 1; } }
*/
}
}
}
}
} catch (Exception e) {
// TODO: handle exception
}
renewCountMap.put("deptID",bdDeptID); renewCountMap.put("deptID",bdDeptID);
renewCountMap.put("deptName",bdInfoMap.getString("ABBREVIATION")); renewCountMap.put("deptName",bdInfoMap.getString("ABBREVIATION"));
renewCountMap.put("createCount",createCount); renewCountMap.put("createCount",createCount);
@ -524,31 +624,35 @@ public class FileManagementService extends ActionWeb {
abolishCount = 0; abolishCount = 0;
String fdDeptID = fdInfoMap.getString("DEPTID"); String fdDeptID = fdInfoMap.getString("DEPTID");
deptIDList = new ArrayList<String>(); deptIDList = new ArrayList<String>();
deptIDList = GetNodesUtil.getChildDept(fdDeptID, deptIDList); try {
if (null!=deptIDList && !deptIDList.isEmpty()) { deptIDList = GetNodesUtil.getChildDept(fdDeptID, deptIDList);
for (String deptID : deptIDList) { if (null!=deptIDList && !deptIDList.isEmpty()) {
for (RowMap fileRowMap : fileRowMaps) { for (String deptID : deptIDList) {
if (fileRowMap.getString("PUBDEPT").contains(deptID)) { for (RowMap fileRowMap : fileRowMaps) {
Timestamp PUBDATETIME = fileRowMap.getTimestamp("PUBDATETIME"); if (fileRowMap.getString("PUBDEPT").contains(deptID)) {
String pubdatetimeString= sdf.format(PUBDATETIME); String FILESTATE = fileRowMap.getString("FILESTATE");
LocalDate pubDate = LocalDate.parse(pubdatetimeString, DateTimeFormatter.ofPattern("yyyy-MM-dd")); String FILEVERSION = fileRowMap.getString("FILEVERSION");
String FILESTATE = fileRowMap.getString("FILESTATE"); String publishDate = fileRowMap.getString("PUBDATETIME");
String FILEVERSION = fileRowMap.getString("FILEVERSION"); if (UtilString.isNotEmpty(publishDate)) {
if (pubDate.getYear()==nowYear) { if (publishDate.contains("2022")) {
if (FILESTATE.equals("1") && FILEVERSION.equals("1.0")) { if (FILESTATE.equals("1") && FILEVERSION.equals("1.0")) {
createCount += 1; createCount += 1;
} }
if (FILESTATE.equals("1") && !FILEVERSION.equals("1.0")) { if (FILESTATE.equals("1") && !FILEVERSION.equals("1.0")) {
updateCount += 1; updateCount += 1;
} }
if (FILESTATE.equals("3")) { if (FILESTATE.equals("3")) {
abolishCount += 1; abolishCount += 1;
} }
} }
} }
} }
} }
} }
}
} catch (Exception e) {
// TODO: handle exception
}
renewCountMap.put("deptID",fdDeptID); renewCountMap.put("deptID",fdDeptID);
renewCountMap.put("deptName",fdInfoMap.getString("ABBREVIATION")); renewCountMap.put("deptName",fdInfoMap.getString("ABBREVIATION"));
renewCountMap.put("createCount",createCount); renewCountMap.put("createCount",createCount);
@ -574,7 +678,7 @@ public class FileManagementService extends ActionWeb {
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
//发布单位 //发布单位
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT"
+ " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0'"); + " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND ID not in ('5bc3a2dc-3bd2-4376-bcc3-5612e28e55fe','e79281b1-2f81-4895-b30e-9f96e9ad0e2c','53d3076d-cd2d-4f5b-bacb-8e93273e9f44','9c795620-93c6-485c-b9fa-93536c988da8','12d42abb-a58f-411b-8c71-0a421a27eafc','65048aee-157f-49f2-a2dc-5903dd26f519')");
//demo3 //demo3
//3e74f14d-852f-4f6f-a809-08a56697f103 //3e74f14d-852f-4f6f-a809-08a56697f103
//本地 //本地
@ -594,7 +698,7 @@ public class FileManagementService extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,"0","dept","3",null); List<Map> deptTreeNodes = TreeUtil.buildTree("1",deptNodes,"0","dept","3",null);
//所属领域 //所属领域
ArrayList<Map> frameList = new ArrayList<>(); ArrayList<Map> frameList = new ArrayList<>();
ArrayList<Map> fieldMaps = new ArrayList<>(); ArrayList<Map> fieldMaps = new ArrayList<>();
@ -618,7 +722,7 @@ public class FileManagementService extends ActionWeb {
fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL")))); fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL"))));
fieldNodes.add(fieldNode); fieldNodes.add(fieldNode);
} }
List<Map> fieldTreeNodes = TreeUtil.buildTree(fieldNodes, "process", null, null, null); List<Map> fieldTreeNodes = TreeUtil.buildTree("1",fieldNodes, "process", null, null, null);
ro.put("deptTreeNodes",deptTreeNodes); ro.put("deptTreeNodes",deptTreeNodes);
ro.put("fieldTreeNodes",fieldTreeNodes); ro.put("fieldTreeNodes",fieldTreeNodes);
return ro.toString(); return ro.toString();
@ -627,11 +731,12 @@ public class FileManagementService extends ActionWeb {
* @methodName: * @methodName:
* @param: * @param:
* @return: * @return:
* @throws ParseException
* @description:文件发布时间分布 * @description:文件发布时间分布
* @auther: Lizj * @auther: Lizj
* @date: 2022/6/28 22:57 * @date: 2022/6/28 22:57
*/ */
public String filePubTimeDistribution(UserContext uc, RequestParams params) { public String filePubTimeDistribution(UserContext uc, RequestParams params) throws ParseException {
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
String unit = params.get("unit"); String unit = params.get("unit");
String field = params.get("field"); String field = params.get("field");
@ -641,33 +746,49 @@ public class FileManagementService extends ActionWeb {
ArrayList<RowMap> fileHandleMaps = new ArrayList<>(); ArrayList<RowMap> fileHandleMaps = new ArrayList<>();
if (null!=unit && !unit.equals("")) { if (null!=unit && !unit.equals("")) {
fileHandleMaps = new ArrayList<>(); if("all".equals(unit)) {
deptIDList = new ArrayList<String>(); for (RowMap fileRowMap : fileMaps) {
deptIDList = GetNodesUtil.getChildDept(unit, deptIDList); fileHandleMaps.add(fileRowMap);
for (String deptID : deptIDList) { }
for (RowMap fileMap : fileMaps) { }else {
if (fileMap.getString("PUBDEPT").contains(deptID)) { fileHandleMaps = new ArrayList<>();
fileHandleMaps.add(fileMap); deptIDList = new ArrayList<String>();
} deptIDList = GetNodesUtil.getChildDept(unit, deptIDList);
} for (String deptID : deptIDList) {
} for (RowMap fileMap : fileMaps) {
if (fileMap.getString("PUBDEPT").contains(deptID)) {
fileHandleMaps.add(fileMap);
}
}
}
}
fileMaps = fileHandleMaps; fileMaps = fileHandleMaps;
} }
if (null!=field && !field.equals("")) { if (null!=field && !field.equals("")) {
fileHandleMaps = new ArrayList<>(); if("all".equals(field)) {
fieldList = new ArrayList<Map>(); for (RowMap fileRowMap : fileMaps) {
fieldList = GetNodesUtil.getChildFrame(field,"", fieldList); fileHandleMaps.add(fileRowMap);
for (Map fieldMap : fieldList) { }
String fieldID = String.valueOf(fieldMap.get("FRAMEID")); }else {
for (RowMap fileMap : fileMaps) { fileHandleMaps = new ArrayList<>();
if (fileMap.getString("PLPARENTID").equals(fieldID)) { fieldList = new ArrayList<Map>();
fileHandleMaps.add(fileMap); fieldList = GetNodesUtil.getChildFrame(field,"", fieldList);
} for (Map fieldMap : fieldList) {
} String fieldID = String.valueOf(fieldMap.get("FRAMEID"));
} for (RowMap fileMap : fileMaps) {
if (fileMap.getString("PLPARENTID").equals(fieldID)) {
fileHandleMaps.add(fileMap);
}
}
}
}
fileMaps = fileHandleMaps; fileMaps = fileHandleMaps;
} }
LocalDate nowDate = LocalDate.now(); LocalDate nowDate = LocalDate.now();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//6个月内fileMaps //6个月内fileMaps
ArrayList<RowMap> month6InFileMaps = new ArrayList<>(); ArrayList<RowMap> month6InFileMaps = new ArrayList<>();
@ -683,23 +804,43 @@ public class FileManagementService extends ActionWeb {
ArrayList<Map> fileCountMaps = new ArrayList<>(); ArrayList<Map> fileCountMaps = new ArrayList<>();
if (null!=fileMaps && fileMaps.isEmpty()==false) { if (null!=fileMaps && fileMaps.isEmpty()==false) {
for (RowMap fileMap : fileMaps) { for (RowMap fileMap : fileMaps) {
LocalDate PUBDATETIME = LocalDate.parse(fileMap.getString("PUBDATETIME"), DateTimeFormatter.ofPattern("yyyy-MM-dd")); try {
Period betweenDate = Period.between(PUBDATETIME, nowDate); LocalDate PUBDATETIME = null;
if (betweenDate.getMonths()<6) { String publishDate = fileMap.getString("PUBDATETIME");
month6InFileMaps.add(fileMap); if(UtilString.isNotEmpty(publishDate)) {
} if(publishDate.length()>11) {
if (betweenDate.getMonths()>=6 && betweenDate.getYears()<1) { publishDate = publishDate.substring(0, 10);
year1InFileMaps.add(fileMap); }
} if(publishDate.contains("")) {
if(betweenDate.getYears()>=1 && betweenDate.getYears()<2) { //PUBDATETIME = LocalDate.parse(publishDate.substring(0,9), DateTimeFormatter.ofPattern("yyyy年MM月dd"));
year2InFileMaps.add(fileMap); }else if(publishDate.contains("-")) {
} PUBDATETIME = LocalDate.parse(publishDate);
if(betweenDate.getYears()>=2 && betweenDate.getYears()<3) { }
year3InFileMaps.add(fileMap);
} }
if(betweenDate.getYears()>=3) { if(PUBDATETIME==null) {
year3OutFileMaps.add(fileMap); continue;
} }
Period betweenDate = Period.between(PUBDATETIME, nowDate);
if (betweenDate.getMonths()<6) {
month6InFileMaps.add(fileMap);
}
if (betweenDate.getMonths()>=6 && betweenDate.getYears()<1) {
year1InFileMaps.add(fileMap);
}
if(betweenDate.getYears()>=1 && betweenDate.getYears()<2) {
year2InFileMaps.add(fileMap);
}
if(betweenDate.getYears()>=2 && betweenDate.getYears()<3) {
year3InFileMaps.add(fileMap);
}
if(betweenDate.getYears()>=3) {
year3OutFileMaps.add(fileMap);
}
} catch (Exception e) {
// TODO: handle exception
}
} }
} else { } else {
ro.ok("暂无文件"); ro.ok("暂无文件");
@ -847,7 +988,7 @@ public class FileManagementService extends ActionWeb {
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
//发布单位 //发布单位
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT"
+ " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0'"); + " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND ID not in ('5bc3a2dc-3bd2-4376-bcc3-5612e28e55fe','e79281b1-2f81-4895-b30e-9f96e9ad0e2c','53d3076d-cd2d-4f5b-bacb-8e93273e9f44','9c795620-93c6-485c-b9fa-93536c988da8','12d42abb-a58f-411b-8c71-0a421a27eafc','65048aee-157f-49f2-a2dc-5903dd26f519')");
//demo3 //demo3
//3e74f14d-852f-4f6f-a809-08a56697f103 //3e74f14d-852f-4f6f-a809-08a56697f103
//本地 //本地
@ -867,7 +1008,7 @@ public class FileManagementService extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,"0","dept","3",null); List<Map> deptTreeNodes = TreeUtil.buildTree("1",deptNodes,"0","dept","3",null);
//所属领域 //所属领域
ArrayList<Map> frameList = new ArrayList<>(); ArrayList<Map> frameList = new ArrayList<>();
ArrayList<Map> fieldMaps = new ArrayList<>(); ArrayList<Map> fieldMaps = new ArrayList<>();
@ -891,28 +1032,33 @@ public class FileManagementService extends ActionWeb {
fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL")))); fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL"))));
fieldNodes.add(fieldNode); fieldNodes.add(fieldNode);
} }
List<Map> fieldTreeNodes = TreeUtil.buildTree(fieldNodes, "process", null, null, null); List<Map> fieldTreeNodes = TreeUtil.buildTree("1",fieldNodes, "process", null, null, null);
ro.put("deptTreeNodes",deptTreeNodes); ro.put("deptTreeNodes",deptTreeNodes);
ro.put("fieldTreeNodes",fieldTreeNodes); ro.put("fieldTreeNodes",fieldTreeNodes);
//文件类型 //文件类型
HashMap<String, Object> fileType = new HashMap<>(); HashMap<String, Object> fileType = new HashMap<>();
ArrayList<Map> fileTypes = new ArrayList<>(); ArrayList<Map> fileTypes = new ArrayList<>();
fileType.put("termsKey","processFile"); fileType = new HashMap<String, Object>();
fileType.put("termsVal","流程"); fileType.put("termsKey", "totalFile");
fileTypes.add(fileType); fileType.put("termsVal", "全部");
fileType = new HashMap<String, Object>(); fileTypes.add(fileType);
fileType.put("termsKey","policyFile"); fileType = new HashMap<String, Object>();
fileType.put("termsVal","制度"); fileType.put("termsKey", "processFile");
fileTypes.add(fileType); fileType.put("termsVal", "流程");
fileType = new HashMap<String, Object>(); fileTypes.add(fileType);
fileType.put("termsKey","guideFile"); fileType = new HashMap<String, Object>();
fileType.put("termsVal","操作指导"); fileType.put("termsKey", "policyFile");
fileTypes.add(fileType); fileType.put("termsVal", "制度");
fileType = new HashMap<String, Object>(); fileTypes.add(fileType);
fileType.put("termsKey","formFile"); fileType = new HashMap<String, Object>();
fileType.put("termsVal","表单/模板"); fileType.put("termsKey", "guideFile");
fileTypes.add(fileType); fileType.put("termsVal", "操作指导");
ro.put("fileTypes",fileTypes); fileTypes.add(fileType);
fileType = new HashMap<String, Object>();
fileType.put("termsKey", "formFile");
fileType.put("termsVal", "表单/模板");
fileTypes.add(fileType);
ro.put("fileTypes", fileTypes);
return ro.toString(); return ro.toString();
} }
@ -933,11 +1079,16 @@ public class FileManagementService extends ActionWeb {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ArrayList<String> deptIDList = new ArrayList<>(); ArrayList<String> deptIDList = new ArrayList<>();
ArrayList<Map> fieldList = new ArrayList<>(); ArrayList<Map> fieldList = new ArrayList<>();
List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PLMETHODID,POLICYTYPE,PLPARENTID,PUBDEPT,MODIFYDATETIME,RELEVANTFILE,SUPPORTFILE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'"); List<RowMap> fileRowMaps = DBSql.getMaps("SELECT FILEID,PLPARENTID,PLMETHODID,POLICYTYPE,PLPARENTID,PUBDEPT,MODIFYDATETIME,RELEVANTFILE,SUPPORTFILE FROM BO_EU_PAL_FILE1 WHERE FILESTATE='1'");
List<RowMap> fileRowMaps1 = fileRowMaps; List<RowMap> fileRowMaps1 = fileRowMaps;
ArrayList<RowMap> fileHandleMaps = new ArrayList<>(); ArrayList<RowMap> fileHandleMaps = new ArrayList<>();
if (null!=fileType && !fileType.equals("")) { if (null!=fileType && !fileType.equals("")) {
fileHandleMaps = new ArrayList<>(); fileHandleMaps = new ArrayList<>();
if (fileType.equals("totalFile")||fileType.equals("all")) {
for (RowMap fileRowMap1 : fileRowMaps1) {
fileHandleMaps.add(fileRowMap1);
}
}
if (fileType.equals("processFile")) { if (fileType.equals("processFile")) {
for (RowMap fileRowMap1 : fileRowMaps1) { for (RowMap fileRowMap1 : fileRowMaps1) {
if (fileRowMap1.getString("PLMETHODID").equals("process.epc") || fileRowMap1.getString("PLMETHODID").equals("process.flowchart")) { if (fileRowMap1.getString("PLMETHODID").equals("process.epc") || fileRowMap1.getString("PLMETHODID").equals("process.flowchart")) {
@ -969,17 +1120,24 @@ public class FileManagementService extends ActionWeb {
fileRowMaps1 = fileHandleMaps; fileRowMaps1 = fileHandleMaps;
} }
if (null!=unit && !unit.equals("")) { if (null!=unit && !unit.equals("")) {
fileHandleMaps = new ArrayList<>(); if("all".equals(unit)) {
deptIDList = new ArrayList<String>(); for (RowMap fileRowMap1 : fileRowMaps1) {
deptIDList = GetNodesUtil.getChildDept(unit, deptIDList); fileHandleMaps.add(fileRowMap1);
for (String deptID : deptIDList) { }
for (RowMap fileRowMap1 : fileRowMaps1) { }else {
if (fileRowMap1.getString("PUBDEPT").contains(deptID)) { fileHandleMaps = new ArrayList<>();
fileHandleMaps.add(fileRowMap1); deptIDList = new ArrayList<String>();
} deptIDList = GetNodesUtil.getChildDept(unit, deptIDList);
} for (String deptID : deptIDList) {
} for (RowMap fileRowMap1 : fileRowMaps1) {
fileRowMaps1 = fileHandleMaps; if (fileRowMap1.getString("PUBDEPT").contains(deptID)) {
fileHandleMaps.add(fileRowMap1);
}
}
}
}
fileRowMaps1 = fileHandleMaps;
} }
if (null!=field && !field.equals("")) { if (null!=field && !field.equals("")) {
fileHandleMaps = new ArrayList<>(); fileHandleMaps = new ArrayList<>();

View File

@ -444,7 +444,8 @@ public class ProcessPubService extends ActionWeb {
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
//所属单位 //所属单位
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT"
+ " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0'"); + " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND ID not in ('5bc3a2dc-3bd2-4376-bcc3-5612e28e55fe','e79281b1-2f81-4895-b30e-9f96e9ad0e2c','53d3076d-cd2d-4f5b-bacb-8e93273e9f44','9c795620-93c6-485c-b9fa-93536c988da8','12d42abb-a58f-411b-8c71-0a421a27eafc','65048aee-157f-49f2-a2dc-5903dd26f519')");
//demo3
//demo3 //demo3
//3e74f14d-852f-4f6f-a809-08a56697f103 //3e74f14d-852f-4f6f-a809-08a56697f103
//本地 //本地
@ -464,7 +465,7 @@ public class ProcessPubService extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,"0","dept","3",null); List<Map> deptTreeNodes = TreeUtil.buildTree("1",deptNodes,"0","dept","3",null);
//所属领域 //所属领域
ArrayList<Map> frameList = new ArrayList<>(); ArrayList<Map> frameList = new ArrayList<>();
ArrayList<Map> fieldMaps = new ArrayList<>(); ArrayList<Map> fieldMaps = new ArrayList<>();
@ -488,7 +489,7 @@ public class ProcessPubService extends ActionWeb {
fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL")))); fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL"))));
fieldNodes.add(fieldNode); fieldNodes.add(fieldNode);
} }
List<Map> fieldTreeNodes = TreeUtil.buildTree(fieldNodes, "process", null, null, null); List<Map> fieldTreeNodes = TreeUtil.buildTree("1",fieldNodes, "process", null, null, null);
ro.put("deptTreeNodes", deptTreeNodes); ro.put("deptTreeNodes", deptTreeNodes);
ro.put("fieldTreeNodes", fieldTreeNodes); ro.put("fieldTreeNodes", fieldTreeNodes);
return ro.toString(); return ro.toString();
@ -1340,7 +1341,8 @@ public class ProcessPubService extends ActionWeb {
ResponseObject ro = ResponseObject.newOkResponse(); ResponseObject ro = ResponseObject.newOkResponse();
//所属单位 //所属单位
List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT" List<RowMap> deptMaps = DBSql.getMaps("SELECT ID,PARENTDEPARTMENTID,DEPARTMENTNAME,LAYER,ORDERINDEX FROM ORGDEPARTMENT"
+ " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0'"); + " WHERE COMPANYID='8911e732-b42a-4556-853f-ad32761bcbee' AND CLOSED='0' AND ID not in ('5bc3a2dc-3bd2-4376-bcc3-5612e28e55fe','e79281b1-2f81-4895-b30e-9f96e9ad0e2c','53d3076d-cd2d-4f5b-bacb-8e93273e9f44','9c795620-93c6-485c-b9fa-93536c988da8','12d42abb-a58f-411b-8c71-0a421a27eafc','65048aee-157f-49f2-a2dc-5903dd26f519')");
//demo3
//demo3 //demo3
//3e74f14d-852f-4f6f-a809-08a56697f103 //3e74f14d-852f-4f6f-a809-08a56697f103
//本地 //本地
@ -1360,7 +1362,7 @@ public class ProcessPubService extends ActionWeb {
deptNode.put("nodeType", nodeType); deptNode.put("nodeType", nodeType);
deptNodes.add(deptNode); deptNodes.add(deptNode);
} }
List<Map> deptTreeNodes = TreeUtil.buildTree(deptNodes,"0","dept","3",null); List<Map> deptTreeNodes = TreeUtil.buildTree("1",deptNodes,"0","dept","3",null);
//所属领域 //所属领域
ArrayList<Map> frameList = new ArrayList<>(); ArrayList<Map> frameList = new ArrayList<>();
ArrayList<Map> fieldMaps = new ArrayList<>(); ArrayList<Map> fieldMaps = new ArrayList<>();
@ -1384,7 +1386,7 @@ public class ProcessPubService extends ActionWeb {
fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL")))); fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL"))));
fieldNodes.add(fieldNode); fieldNodes.add(fieldNode);
} }
List<Map> fieldTreeNodes = TreeUtil.buildTree(fieldNodes, "process", null, null, null); List<Map> fieldTreeNodes = TreeUtil.buildTree("1",fieldNodes, "process", null, null, null);
ro.put("deptTreeNodes", deptTreeNodes); ro.put("deptTreeNodes", deptTreeNodes);
ro.put("fieldTreeNodes", fieldTreeNodes); ro.put("fieldTreeNodes", fieldTreeNodes);
return ro.toString(); return ro.toString();
@ -1409,32 +1411,48 @@ public class ProcessPubService extends ActionWeb {
List<RowMap> nodeRowMaps = DBSql.getMaps("SELECT BN.NODEID,BN.NODETYPE,BF.FILEID,BF.PLPARENTID,BF.PUBDEPT FROM BO_EU_PAL_FILENODE5 BN LEFT JOIN BO_EU_PAL_FILE1 BF ON BN.PLID=BF.FILEID WHERE BF.FILESTATE='1' AND BF.PLMETHODID='process.epc'"); List<RowMap> nodeRowMaps = DBSql.getMaps("SELECT BN.NODEID,BN.NODETYPE,BF.FILEID,BF.PLPARENTID,BF.PUBDEPT FROM BO_EU_PAL_FILENODE5 BN LEFT JOIN BO_EU_PAL_FILE1 BF ON BN.PLID=BF.FILEID WHERE BF.FILESTATE='1' AND BF.PLMETHODID='process.epc'");
ArrayList<RowMap> nodeHandleMaps = new ArrayList<>(); ArrayList<RowMap> nodeHandleMaps = new ArrayList<>();
if (null!=unit && !unit.equals("")) { if (null!=unit && !unit.equals("")) {
nodeHandleMaps = new ArrayList<>(); if("all".equals(unit)) {
deptIDList = new ArrayList<String>(); for (RowMap fileRowMap : nodeRowMaps) {
deptIDList = GetNodesUtil.getChildDept(unit, deptIDList); nodeHandleMaps.add(fileRowMap);
for (String deptID : deptIDList) { }
for (RowMap nodeRowMap : nodeRowMaps) { }else {
if (nodeRowMap.getString("PUBDEPT").contains(deptID)) { nodeHandleMaps = new ArrayList<>();
nodeHandleMaps.add(nodeRowMap); deptIDList = new ArrayList<String>();
} deptIDList = GetNodesUtil.getChildDept(unit, deptIDList);
} for (String deptID : deptIDList) {
} for (RowMap fileMap : nodeRowMaps) {
nodeRowMaps = nodeHandleMaps; if (fileMap.getString("PUBDEPT").contains(deptID)) {
nodeHandleMaps.add(fileMap);
}
}
}
}
nodeRowMaps = nodeHandleMaps;
} }
if (null!=field && !field.equals("")) { if (null!=field && !field.equals("")) {
nodeHandleMaps = new ArrayList<>(); if("all".equals(field)) {
fieldList = new ArrayList<Map>(); for (RowMap fileRowMap : nodeRowMaps) {
fieldList = GetNodesUtil.getChildFrame(field,"", fieldList); nodeHandleMaps.add(fileRowMap);
for (Map fieldMap : fieldList) { }
String fieldID = String.valueOf(fieldMap.get("FRAMEID")); }else {
for (RowMap nodeRowMap : nodeRowMaps) { nodeHandleMaps = new ArrayList<>();
if (nodeRowMap.getString("PLPARENTID").equals(fieldID)) { fieldList = new ArrayList<Map>();
nodeHandleMaps.add(nodeRowMap); fieldList = GetNodesUtil.getChildFrame(field,"", fieldList);
} for (Map fieldMap : fieldList) {
} String fieldID = String.valueOf(fieldMap.get("FRAMEID"));
} for (RowMap fileMap : nodeRowMaps) {
nodeRowMaps = nodeHandleMaps; if (fileMap.getString("PLPARENTID").equals(fieldID)) {
nodeHandleMaps.add(fileMap);
}
}
}
}
nodeRowMaps = nodeHandleMaps;
} }
Integer nodeTotalNum = 0; Integer nodeTotalNum = 0;
Integer approvalNodeNum = 0; Integer approvalNodeNum = 0;
Integer operationNodeNum = 0; Integer operationNodeNum = 0;
@ -1532,7 +1550,7 @@ public class ProcessPubService extends ActionWeb {
fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL")))); fieldNode.put("TLEVEL", Integer.valueOf(String.valueOf(fieldMap.get("FRAMELEVEL"))));
fieldNodes.add(fieldNode); fieldNodes.add(fieldNode);
} }
List<Map> fieldTreeNodes = TreeUtil.buildTree(fieldNodes, "process", null, null, null); List<Map> fieldTreeNodes = TreeUtil.buildTree("1",fieldNodes, "process", null, null, null);
ro.put("fieldTreeNodes", fieldTreeNodes); ro.put("fieldTreeNodes", fieldTreeNodes);
return ro.toString(); return ro.toString();
} }
@ -1572,17 +1590,24 @@ public class ProcessPubService extends ActionWeb {
String approvalOLRate = "0"; String approvalOLRate = "0";
if (null!=field && !field.equals("")) { if (null!=field && !field.equals("")) {
nodeHandleMaps = new ArrayList<>(); if("all".equals(field)) {
fieldList = new ArrayList<Map>(); for (RowMap nodeRowMap : nodeRowMaps) {
fieldList = GetNodesUtil.getChildFrame(field,"", fieldList); nodeHandleMaps.add(nodeRowMap);
for (Map fieldMap : fieldList) { }
String fieldID = String.valueOf(fieldMap.get("FRAMEID")); }else {
for (RowMap nodeRowMap : nodeRowMaps) { nodeHandleMaps = new ArrayList<>();
if (nodeRowMap.getString("PLPARENTID").equals(fieldID)) { fieldList = new ArrayList<Map>();
nodeHandleMaps.add(nodeRowMap); fieldList = GetNodesUtil.getChildFrame(field,"", fieldList);
} for (Map fieldMap : fieldList) {
} String fieldID = String.valueOf(fieldMap.get("FRAMEID"));
} for (RowMap nodeRowMap : nodeRowMaps) {
if (nodeRowMap.getString("PLPARENTID").equals(fieldID)) {
nodeHandleMaps.add(nodeRowMap);
}
}
}
}
nodeRowMaps = nodeHandleMaps; nodeRowMaps = nodeHandleMaps;
} }
@ -1731,17 +1756,24 @@ public class ProcessPubService extends ActionWeb {
String operationOLNodeRate = "0"; String operationOLNodeRate = "0";
if (null!=field && !field.equals("")) { if (null!=field && !field.equals("")) {
nodeHandleMaps = new ArrayList<>(); if("all".equals(field)) {
fieldList = new ArrayList<Map>(); for (RowMap fileRowMap : nodeRowMaps) {
fieldList = GetNodesUtil.getChildFrame(field,"", fieldList); nodeHandleMaps.add(fileRowMap);
for (Map fieldMap : fieldList) { }
String fieldID = String.valueOf(fieldMap.get("FRAMEID")); }else {
for (RowMap nodeRowMap : nodeRowMaps) { nodeHandleMaps = new ArrayList<>();
if (nodeRowMap.getString("PLPARENTID").equals(fieldID)) { fieldList = new ArrayList<Map>();
nodeHandleMaps.add(nodeRowMap); fieldList = GetNodesUtil.getChildFrame(field,"", fieldList);
} for (Map fieldMap : fieldList) {
} String fieldID = String.valueOf(fieldMap.get("FRAMEID"));
} for (RowMap nodeRowMap : nodeRowMaps) {
if (nodeRowMap.getString("PLPARENTID").equals(fieldID)) {
nodeHandleMaps.add(nodeRowMap);
}
}
}
}
nodeRowMaps = nodeHandleMaps; nodeRowMaps = nodeHandleMaps;
} }

View File

@ -265,7 +265,7 @@ public class ToPageService extends ActionWeb {
} }
fileMaps.add(fileMap); fileMaps.add(fileMap);
} }
List<Map> fileTreeNodes = TreeUtil.buildTree(fileMaps,null,"frame",null,null); List<Map> fileTreeNodes = TreeUtil.buildTree("1",fileMaps,null,"frame",null,null);
ro.put("fileMaps",fileTreeNodes); ro.put("fileMaps",fileTreeNodes);
return ro.toString(); return ro.toString();
} else { } else {

View File

@ -17,8 +17,19 @@ public class TreeUtil {
//rootSign 根节点标识 //rootSign 根节点标识
//tLevel 节点层级用于指定展示层数 //tLevel 节点层级用于指定展示层数
//nodeType 节点类型用于多数据类型合并 //nodeType 节点类型用于多数据类型合并
public static List<Map> buildTree(List<Map> nodeMaps,String rootSign,String rootNodeType,String tLevel,String nodeType){ public static List<Map> buildTree(String type,List<Map> nodeMaps,String rootSign,String rootNodeType,String tLevel,String nodeType){
List<Map> treeNodes =new ArrayList<>(); List<Map> treeNodes =new ArrayList<>();
if("1".equals(type)) {
HashMap<String, Object> deptNode = new HashMap<>();
nodeType = "dept";
deptNode.put("ID","all");
deptNode.put("PARENTID","0");
deptNode.put("name","全部");
deptNode.put("ORDERINDEX","1");
deptNode.put("TLEVEL","");
deptNode.put("nodeType", "dept");
treeNodes.add(deptNode);
}
for (Map treeNode : getRootNode(nodeMaps,rootSign,rootNodeType)) { for (Map treeNode : getRootNode(nodeMaps,rootSign,rootNodeType)) {
treeNode = buildChildTree(treeNode,nodeMaps,tLevel,nodeType); treeNode = buildChildTree(treeNode,nodeMaps,tLevel,nodeType);
treeNodes.add(treeNode); treeNodes.add(treeNode);