Commit 4c4b4713 by liuyang

Merge branch 'dev' of http://git.pseer.com:8800/platform/hg-smart into dev-ly

parents 2990d0ac 12ac6646
package com.baosight.hggp.hg.wd.domain; package com.baosight.hggp.hg.wd.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase; import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/** /**
* Project: <br> * Project: <br>
...@@ -46,6 +47,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -46,6 +47,7 @@ public class HGWD001 extends DaoEPBase {
public static final String FIELD_REMARK = "remark"; /* 备注*/ public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/ public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
public static final String FIELD_FILE_PATH = "filePath"; /* 文件路径*/ public static final String FIELD_FILE_PATH = "filePath"; /* 文件路径*/
public static final String FIELD_FILE_ID_PATH = "filePath"; /* 文件ID路径*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
...@@ -104,6 +106,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -104,6 +106,7 @@ public class HGWD001 extends DaoEPBase {
private String remark = " "; /* 备注*/ private String remark = " "; /* 备注*/
private String releaseDate = " "; /* 发布时间*/ private String releaseDate = " "; /* 发布时间*/
private String filePath = " "; private String filePath = " ";
private String fileIdPath = " ";
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -211,6 +214,10 @@ public class HGWD001 extends DaoEPBase { ...@@ -211,6 +214,10 @@ public class HGWD001 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_FILE_PATH); eiColumn = new EiColumn(FIELD_FILE_PATH);
eiColumn.setDescName("文件路径"); eiColumn.setDescName("文件路径");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_ID_PATH);
eiColumn.setDescName("文件ID路径");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -603,6 +610,15 @@ public class HGWD001 extends DaoEPBase { ...@@ -603,6 +610,15 @@ public class HGWD001 extends DaoEPBase {
public void setFilePath(String filePath) { public void setFilePath(String filePath) {
this.filePath = filePath; this.filePath = filePath;
} }
public String getFileIdPath() {
return fileIdPath;
}
public void setFileIdPath(String fileIdPath) {
this.fileIdPath = fileIdPath;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -636,6 +652,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -636,6 +652,7 @@ public class HGWD001 extends DaoEPBase {
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark)); setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate)); setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setFilePath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH)), filePath)); setFilePath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH)), filePath));
setFileIdPath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_ID_PATH)), fileIdPath));
} }
/** /**
...@@ -670,6 +687,7 @@ public class HGWD001 extends DaoEPBase { ...@@ -670,6 +687,7 @@ public class HGWD001 extends DaoEPBase {
map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK))); map.put(FIELD_REMARK, StringUtils.toString(remark, eiMetadata.getMeta(FIELD_REMARK)));
map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE))); map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE)));
map.put(FIELD_FILE_PATH, StringUtils.toString(filePath, eiMetadata.getMeta(FIELD_FILE_PATH))); map.put(FIELD_FILE_PATH, StringUtils.toString(filePath, eiMetadata.getMeta(FIELD_FILE_PATH)));
map.put(FIELD_FILE_ID_PATH, StringUtils.toString(fileIdPath, eiMetadata.getMeta(FIELD_FILE_ID_PATH)));
return map; return map;
} }
......
...@@ -19,9 +19,9 @@ import java.util.Map; ...@@ -19,9 +19,9 @@ import java.util.Map;
* @history 2024-08-19 14:34:38 create * @history 2024-08-19 14:34:38 create
*/ */
public class HGWD002 extends DaoEPBase { public class HGWD002 extends DaoEPBase {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/ public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/ public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
...@@ -49,7 +49,8 @@ public class HGWD002 extends DaoEPBase { ...@@ -49,7 +49,8 @@ public class HGWD002 extends DaoEPBase {
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/ public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/ public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/ public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String FIELD_FILE_PATH = "filePath"; /* 文件路径*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/ public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/ public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
...@@ -75,13 +76,14 @@ public class HGWD002 extends DaoEPBase { ...@@ -75,13 +76,14 @@ public class HGWD002 extends DaoEPBase {
public static final String COL_RELEASE_DATE = "RELEASE_DATE"; /* 发布时间*/ public static final String COL_RELEASE_DATE = "RELEASE_DATE"; /* 发布时间*/
public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/ public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/
public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/ public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/
public static final String COL_FILE_PATH = "FILE_PATH"; /* 文件路径*/
public static final String QUERY = "HGWD002.query"; public static final String QUERY = "HGWD002.query";
public static final String COUNT = "HGWD002.count"; public static final String COUNT = "HGWD002.count";
public static final String INSERT = "HGWD002.insert"; public static final String INSERT = "HGWD002.insert";
public static final String UPDATE = "HGWD002.update"; public static final String UPDATE = "HGWD002.update";
public static final String DELETE = "HGWD002.delete"; public static final String DELETE = "HGWD002.delete";
private Long id = new Long(0); private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/ private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/ private String depCode = " "; /* 部门编码*/
...@@ -109,130 +111,135 @@ public class HGWD002 extends DaoEPBase { ...@@ -109,130 +111,135 @@ public class HGWD002 extends DaoEPBase {
private Integer downloadNum = new Integer(0); /* 下载次数*/ private Integer downloadNum = new Integer(0); /* 下载次数*/
private String docType = " "; /* 文件类型*/ private String docType = " "; /* 文件类型*/
private String changeContent = " "; /* 变更内容*/ private String changeContent = " "; /* 变更内容*/
private String filePath = " "; /* 文件路径*/
/** /**
* initialize the metadata. * initialize the metadata.
*/ */
public void initMetaData() { public void initMetaData() {
EiColumn eiColumn; EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID); eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true); eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" "); eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE); eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码"); eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE); eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码"); eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY); eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者"); eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME); eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称"); eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME); eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间"); eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY); eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者"); eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME); eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称"); eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME); eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间"); eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG); eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除"); eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE); eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码"); eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME); eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称"); eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE); eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码"); eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME); eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称"); eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_ID); eiColumn = new EiColumn(FIELD_FILE_ID);
eiColumn.setDescName("文件ID"); eiColumn.setDescName("文件ID");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_TYPE); eiColumn = new EiColumn(FIELD_FILE_TYPE);
eiColumn.setDescName("文件类型"); eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_NAME); eiColumn = new EiColumn(FIELD_FILE_NAME);
eiColumn.setDescName("文件名称"); eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID); eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件号"); eiColumn.setDescName("文件号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME); eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件附件名称"); eiColumn.setDescName("文件附件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_VERSION); eiColumn = new EiColumn(FIELD_DOC_VERSION);
eiColumn.setDescName("文件版本号"); eiColumn.setDescName("文件版本号");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_STATUS); eiColumn = new EiColumn(FIELD_STATUS);
eiColumn.setDescName("状态"); eiColumn.setDescName("状态");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REMARK); eiColumn = new EiColumn(FIELD_REMARK);
eiColumn.setDescName("备注"); eiColumn.setDescName("备注");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_RELEASE_DATE); eiColumn = new EiColumn(FIELD_RELEASE_DATE);
eiColumn.setDescName("发布时间"); eiColumn.setDescName("发布时间");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PREVIEW_NUM); eiColumn = new EiColumn(FIELD_PREVIEW_NUM);
eiColumn.setDescName("预览次数"); eiColumn.setDescName("预览次数");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOWNLOAD_NUM); eiColumn = new EiColumn(FIELD_DOWNLOAD_NUM);
eiColumn.setDescName("下载次数"); eiColumn.setDescName("下载次数");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE); eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型"); eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_CONTENT); eiColumn = new EiColumn(FIELD_CHANGE_CONTENT);
eiColumn.setDescName("变更内容"); eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH);
eiColumn.setDescName("文件路径");
eiMetadata.addMeta(eiColumn);
} }
/** /**
* the constructor. * the constructor.
*/ */
public HGWD002() { public HGWD002() {
initMetaData(); initMetaData();
} }
/** /**
* get the id . * get the id .
* @return the id * @return the id
...@@ -240,7 +247,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -240,7 +247,7 @@ public class HGWD002 extends DaoEPBase {
public Long getId() { public Long getId() {
return this.id; return this.id;
} }
/** /**
* set the id . * set the id .
* *
...@@ -256,7 +263,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -256,7 +263,7 @@ public class HGWD002 extends DaoEPBase {
public String getAccountCode() { public String getAccountCode() {
return this.accountCode; return this.accountCode;
} }
/** /**
* set the accountCode - 企业编码. * set the accountCode - 企业编码.
* *
...@@ -272,7 +279,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -272,7 +279,7 @@ public class HGWD002 extends DaoEPBase {
public String getDepCode() { public String getDepCode() {
return this.depCode; return this.depCode;
} }
/** /**
* set the depCode - 部门编码. * set the depCode - 部门编码.
* *
...@@ -288,7 +295,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -288,7 +295,7 @@ public class HGWD002 extends DaoEPBase {
public String getCreatedBy() { public String getCreatedBy() {
return this.createdBy; return this.createdBy;
} }
/** /**
* set the createdBy - 记录创建者. * set the createdBy - 记录创建者.
* *
...@@ -304,7 +311,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -304,7 +311,7 @@ public class HGWD002 extends DaoEPBase {
public String getCreatedName() { public String getCreatedName() {
return this.createdName; return this.createdName;
} }
/** /**
* set the createdName - 记录创建名称. * set the createdName - 记录创建名称.
* *
...@@ -320,7 +327,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -320,7 +327,7 @@ public class HGWD002 extends DaoEPBase {
public String getCreatedTime() { public String getCreatedTime() {
return this.createdTime; return this.createdTime;
} }
/** /**
* set the createdTime - 记录创建时间. * set the createdTime - 记录创建时间.
* *
...@@ -336,7 +343,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -336,7 +343,7 @@ public class HGWD002 extends DaoEPBase {
public String getUpdatedBy() { public String getUpdatedBy() {
return this.updatedBy; return this.updatedBy;
} }
/** /**
* set the updatedBy - 记录修改者. * set the updatedBy - 记录修改者.
* *
...@@ -352,7 +359,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -352,7 +359,7 @@ public class HGWD002 extends DaoEPBase {
public String getUpdatedName() { public String getUpdatedName() {
return this.updatedName; return this.updatedName;
} }
/** /**
* set the updatedName - 记录修改名称. * set the updatedName - 记录修改名称.
* *
...@@ -368,7 +375,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -368,7 +375,7 @@ public class HGWD002 extends DaoEPBase {
public String getUpdatedTime() { public String getUpdatedTime() {
return this.updatedTime; return this.updatedTime;
} }
/** /**
* set the updatedTime - 记录修改时间. * set the updatedTime - 记录修改时间.
* *
...@@ -384,7 +391,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -384,7 +391,7 @@ public class HGWD002 extends DaoEPBase {
public Integer getDeleteFlag() { public Integer getDeleteFlag() {
return this.deleteFlag; return this.deleteFlag;
} }
/** /**
* set the deleteFlag - 0-未删除,1-已删除. * set the deleteFlag - 0-未删除,1-已删除.
* *
...@@ -400,7 +407,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -400,7 +407,7 @@ public class HGWD002 extends DaoEPBase {
public String getCompanyCode() { public String getCompanyCode() {
return this.companyCode; return this.companyCode;
} }
/** /**
* set the companyCode - 公司编码. * set the companyCode - 公司编码.
* *
...@@ -416,7 +423,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -416,7 +423,7 @@ public class HGWD002 extends DaoEPBase {
public String getCompanyName() { public String getCompanyName() {
return this.companyName; return this.companyName;
} }
/** /**
* set the companyName - 公司名称. * set the companyName - 公司名称.
* *
...@@ -432,7 +439,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -432,7 +439,7 @@ public class HGWD002 extends DaoEPBase {
public String getProjCode() { public String getProjCode() {
return this.projCode; return this.projCode;
} }
/** /**
* set the projCode - 项目编码. * set the projCode - 项目编码.
* *
...@@ -448,7 +455,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -448,7 +455,7 @@ public class HGWD002 extends DaoEPBase {
public String getProjName() { public String getProjName() {
return this.projName; return this.projName;
} }
/** /**
* set the projName - 项目名称. * set the projName - 项目名称.
* *
...@@ -464,7 +471,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -464,7 +471,7 @@ public class HGWD002 extends DaoEPBase {
public String getFileId() { public String getFileId() {
return this.fileId; return this.fileId;
} }
/** /**
* set the fileId - 文件ID. * set the fileId - 文件ID.
* *
...@@ -480,7 +487,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -480,7 +487,7 @@ public class HGWD002 extends DaoEPBase {
public String getFileType() { public String getFileType() {
return this.fileType; return this.fileType;
} }
/** /**
* set the fileType - 文件类型. * set the fileType - 文件类型.
* *
...@@ -496,7 +503,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -496,7 +503,7 @@ public class HGWD002 extends DaoEPBase {
public String getFileName() { public String getFileName() {
return this.fileName; return this.fileName;
} }
/** /**
* set the fileName - 文件名称. * set the fileName - 文件名称.
* *
...@@ -512,7 +519,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -512,7 +519,7 @@ public class HGWD002 extends DaoEPBase {
public String getDocId() { public String getDocId() {
return this.docId; return this.docId;
} }
/** /**
* set the docId - 文件号. * set the docId - 文件号.
* *
...@@ -528,7 +535,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -528,7 +535,7 @@ public class HGWD002 extends DaoEPBase {
public String getDocName() { public String getDocName() {
return this.docName; return this.docName;
} }
/** /**
* set the docName - 文件附件名称. * set the docName - 文件附件名称.
* *
...@@ -544,7 +551,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -544,7 +551,7 @@ public class HGWD002 extends DaoEPBase {
public Integer getDocVersion() { public Integer getDocVersion() {
return this.docVersion; return this.docVersion;
} }
/** /**
* set the docVersion - 文件版本号. * set the docVersion - 文件版本号.
* *
...@@ -560,7 +567,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -560,7 +567,7 @@ public class HGWD002 extends DaoEPBase {
public Integer getStatus() { public Integer getStatus() {
return this.status; return this.status;
} }
/** /**
* set the status - 状态. * set the status - 状态.
* *
...@@ -576,7 +583,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -576,7 +583,7 @@ public class HGWD002 extends DaoEPBase {
public String getRemark() { public String getRemark() {
return this.remark; return this.remark;
} }
/** /**
* set the remark - 备注. * set the remark - 备注.
* *
...@@ -592,7 +599,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -592,7 +599,7 @@ public class HGWD002 extends DaoEPBase {
public String getReleaseDate() { public String getReleaseDate() {
return this.releaseDate; return this.releaseDate;
} }
/** /**
* set the releaseDate - 发布时间. * set the releaseDate - 发布时间.
* *
...@@ -608,7 +615,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -608,7 +615,7 @@ public class HGWD002 extends DaoEPBase {
public Integer getPreviewNum() { public Integer getPreviewNum() {
return this.previewNum; return this.previewNum;
} }
/** /**
* set the previewNum - 预览次数. * set the previewNum - 预览次数.
* *
...@@ -624,7 +631,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -624,7 +631,7 @@ public class HGWD002 extends DaoEPBase {
public Integer getDownloadNum() { public Integer getDownloadNum() {
return this.downloadNum; return this.downloadNum;
} }
/** /**
* set the downloadNum - 下载次数. * set the downloadNum - 下载次数.
* *
...@@ -633,15 +640,15 @@ public class HGWD002 extends DaoEPBase { ...@@ -633,15 +640,15 @@ public class HGWD002 extends DaoEPBase {
public void setDownloadNum(Integer downloadNum) { public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum; this.downloadNum = downloadNum;
} }
public String getDocType() { public String getDocType() {
return docType; return docType;
} }
public void setDocType(String docType) { public void setDocType(String docType) {
this.docType = docType; this.docType = docType;
} }
/** /**
* get the changeContent - 变更内容. * get the changeContent - 变更内容.
* @return the changeContent * @return the changeContent
...@@ -649,7 +656,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -649,7 +656,7 @@ public class HGWD002 extends DaoEPBase {
public String getChangeContent() { public String getChangeContent() {
return this.changeContent; return this.changeContent;
} }
/** /**
* set the changeContent - 变更内容. * set the changeContent - 变更内容.
* *
...@@ -658,6 +665,15 @@ public class HGWD002 extends DaoEPBase { ...@@ -658,6 +665,15 @@ public class HGWD002 extends DaoEPBase {
public void setChangeContent(String changeContent) { public void setChangeContent(String changeContent) {
this.changeContent = changeContent; this.changeContent = changeContent;
} }
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -665,7 +681,7 @@ public class HGWD002 extends DaoEPBase { ...@@ -665,7 +681,7 @@ public class HGWD002 extends DaoEPBase {
*/ */
@Override @Override
public void fromMap(Map map) { public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id)); setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode)); setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode)); setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
...@@ -693,14 +709,15 @@ public class HGWD002 extends DaoEPBase { ...@@ -693,14 +709,15 @@ public class HGWD002 extends DaoEPBase {
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum)); setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType)); setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent)); setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setFilePath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH)), filePath));
} }
/** /**
* set the value to Map. * set the value to Map.
*/ */
@Override @Override
public Map toMap() { public Map toMap() {
Map map = new HashMap(); Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID))); map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE))); map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
...@@ -729,7 +746,8 @@ public class HGWD002 extends DaoEPBase { ...@@ -729,7 +746,8 @@ public class HGWD002 extends DaoEPBase {
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM))); map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE))); map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT))); map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
map.put(FIELD_FILE_PATH, StringUtils.toString(filePath, eiMetadata.getMeta(FIELD_FILE_PATH)));
return map; return map;
} }
} }
...@@ -516,18 +516,19 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -516,18 +516,19 @@ public class ServiceHGWD001 extends ServiceEPBase {
queryMap.get(HGWD001.FIELD_PARENT_ID)); queryMap.get(HGWD001.FIELD_PARENT_ID));
}*/ }*/
// 要复制目录集合 // 要复制目录集合
if (Objects.nonNull(detail2Rows)){ if (Objects.nonNull(detail2Rows)) {
String parentId = detail2Rows.get(0).getFileId().length()>0?detail2Rows.get(0).getFileId():detail2Rows.get(0).getProjCode(); String parentId = detail2Rows.get(0).getFileId().length() > 0 ? detail2Rows.get(0).getFileId()
: detail2Rows.get(0).getProjCode();
if (!StringUtils.isNull(result2Rows)) { if (!StringUtils.isNull(result2Rows)) {
result2Rows.forEach(hgwd001 -> { result2Rows.forEach(hgwd001 -> {
hgwd001.setParentId(parentId); hgwd001.setParentId(parentId);
hgwd001.setFilePath(detail2Rows.get(0).getFilePath()+"/"+hgwd001.getFileName()); hgwd001.setFilePath(detail2Rows.get(0).getFilePath() + "/" + hgwd001.getFileName());
hgwd001.setFileIdPath(detail2Rows.get(0).getFileIdPath() + "/" + hgwd001.getFileId());
}); });
// 查询添加子节点 // 查询添加子节点
addNode(result2Rows); addNode(result2Rows);
} }
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作复制文件成功!"); inInfo.setMsg("操作复制文件成功!");
} catch (Exception e) { } catch (Exception e) {
...@@ -546,7 +547,8 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -546,7 +547,8 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001s.forEach(o -> { hgwd001s.forEach(o -> {
if (o.getParentId().equals(hgwd001.getFileId())) { if (o.getParentId().equals(hgwd001.getFileId())) {
o.setParentId(fileId); o.setParentId(fileId);
o.setFilePath(hgwd001.getFilePath()+"/"+o.getFileName()); o.setFilePath(hgwd001.getFilePath() + "/" + o.getFileName());
o.setFileIdPath(hgwd001.getFileIdPath() + "/" + o.getFileId());
} }
}); });
} }
......
...@@ -35,7 +35,6 @@ import java.util.HashMap; ...@@ -35,7 +35,6 @@ import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -226,7 +225,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -226,7 +225,7 @@ public class ServiceHGWD001D extends TreeService {
if (CommonConstant.Field.ROOT.equals(node) || CommonConstant.Field.ROOT2.equals(node)) { if (CommonConstant.Field.ROOT.equals(node) || CommonConstant.Field.ROOT2.equals(node)) {
inInfo.addBlock(node).setRows(queryTopNode(node)); inInfo.addBlock(node).setRows(queryTopNode(node));
} else if (ProjectSourceEnum.contains(node)) { } else if (ProjectSourceEnum.contains(node)) {
inInfo.addBlock(node).setRows(queryFirstNode(node, ename)); inInfo.addBlock(node).setRows(queryFirstNode(node, ename, pageCode));
} else { } else {
inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename, pageCode)); inInfo.addBlock(node).setRows(queryChildNode(projCode, node, ename, pageCode));
} }
...@@ -287,9 +286,10 @@ public class ServiceHGWD001D extends TreeService { ...@@ -287,9 +286,10 @@ public class ServiceHGWD001D extends TreeService {
* *
* @param parentId * @param parentId
* @param ename * @param ename
* @param pageCode 页码
* @return * @return
*/ */
public List queryFirstNode(String parentId, String ename) { public List queryFirstNode(String parentId, String ename, String pageCode) {
// SPARE:备件制造图不限制;非管理员仅查询自己有权限的项目 // SPARE:备件制造图不限制;非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName(); String userId = UserSessionUtils.getLoginName();
boolean isManager = HgWdUtils.HgWd009.isManager(userId); boolean isManager = HgWdUtils.HgWd009.isManager(userId);
...@@ -307,9 +307,12 @@ public class ServiceHGWD001D extends TreeService { ...@@ -307,9 +307,12 @@ public class ServiceHGWD001D extends TreeService {
return results; return results;
} }
for (HGSC001 dbSc001 : dbSc001s) { for (HGSC001 dbSc001 : dbSc001s) {
int count = getChildCount(dbSc001.getProjCode(), isManager, isSpare, pageCode);
if ("HGWD002".equals(pageCode) && count == 0) {
continue;
}
String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")"; String text = dbSc001.getProjName() + "(" + dbSc001.getProjCode() + ")";
Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P); Map leafMap = buildLeaf(parentId, dbSc001.getProjCode(), text, HgWdConstant.LeafType.P);
int count = getChildCount(dbSc001.getProjCode(), isManager, isSpare, null);
leafMap.put("projCode", dbSc001.getProjCode()); leafMap.put("projCode", dbSc001.getProjCode());
leafMap.put("projName", dbSc001.getProjName()); leafMap.put("projName", dbSc001.getProjName());
leafMap.put("ename", dbSc001.getProjCode()); leafMap.put("ename", dbSc001.getProjCode());
...@@ -355,8 +358,11 @@ public class ServiceHGWD001D extends TreeService { ...@@ -355,8 +358,11 @@ public class ServiceHGWD001D extends TreeService {
// 查询目录授权人数 // 查询目录授权人数
List<HGWD003> dbWd003s = HGWDTools.HgWd003.list(fileIds); List<HGWD003> dbWd003s = HGWDTools.HgWd003.list(fileIds);
for (HGWD001 dbWd001 : dbWd001s) { for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
int count = getChildCount(dbWd001.getFileId(), isManager, isSpare, pageCode); int count = getChildCount(dbWd001.getFileId(), isManager, isSpare, pageCode);
if ("HGWD002".equals(pageCode) && count == 0) {
continue;
}
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
leafMap.put("projCode", dbWd001.getProjCode()); leafMap.put("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName()); leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode()); leafMap.put("ename", dbWd001.getProjCode());
...@@ -364,9 +370,6 @@ public class ServiceHGWD001D extends TreeService { ...@@ -364,9 +370,6 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("leafLevel", dbWd001.getLeafLevel()); leafMap.put("leafLevel", dbWd001.getLeafLevel());
leafMap.put("count", count); leafMap.put("count", count);
leafMap.put("filePath", dbWd001.getFilePath()); leafMap.put("filePath", dbWd001.getFilePath());
if ("HGWD002".equals(pageCode) && count == 0) {
continue;
}
if (!isManager && !isSpare) { if (!isManager && !isSpare) {
leafMap.put("isAuth", "1"); leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己 // 从已授权的信息中查找出自己
...@@ -385,6 +388,27 @@ public class ServiceHGWD001D extends TreeService { ...@@ -385,6 +388,27 @@ public class ServiceHGWD001D extends TreeService {
} }
/** /**
* 搜索树
*
* @param inInfo
* @return
*/
public EiInfo searchTree(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
// 查询有权限的目录和备件目录,管理员不做限制
if (!HgWdUtils.HgWd009.isManager()) {
queryMap.put("userId", UserSessionUtils.getLoginName());
}
List<HGWD001> nodeWds = dao.query(HGWD001.QUERY, queryMap);
// 查询父级结构
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "搜索节点失败");
}
return inInfo;
}
/**
* 设置叶子节点是否可以展开 * 设置叶子节点是否可以展开
* *
* @param nodes * @param nodes
...@@ -430,9 +454,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -430,9 +454,7 @@ public class ServiceHGWD001D extends TreeService {
* @return 节点数量 * @return 节点数量
*/ */
public int getChildCount(String fileId, boolean isManager, boolean isSpare, String pageCode) { public int getChildCount(String fileId, boolean isManager, boolean isSpare, String pageCode) {
List<HGWD001> hgwd001List = HgWdUtils.HgWd001.queryChildren(fileId, isManager, isSpare); //查询子级目录 List<String> childIds = HgWdUtils.HgWd001.queryChildrenId(fileId, isManager, isSpare); //查询子级目录
List<String> childIds = Optional.ofNullable(hgwd001List).orElse(new ArrayList<>()).stream()
.map(HGWD001::getFileId).collect(Collectors.toList());
// 已授权人员信息 // 已授权人员信息
List<HGWD003> dbWd003List = HGWDTools.HgWd003.list(childIds); List<HGWD003> dbWd003List = HGWDTools.HgWd003.list(childIds);
List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD", childIds, pageCode); List<HGWD099> fWd099s = HGWDTools.HgWd099.queryByBiz("WD", childIds, pageCode);
......
...@@ -13,10 +13,12 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools; ...@@ -13,10 +13,12 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD005;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.Org; import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.*; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
...@@ -24,7 +26,11 @@ import com.baosight.iplat4j.core.ei.EiInfo; ...@@ -24,7 +26,11 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator; import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -84,12 +90,14 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -84,12 +90,14 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
// 设置项目信息 // 设置项目信息
this.setProjectInfo(hgwd001); this.setProjectInfo(hgwd001);
if (wd001 == null){ if (wd001 == null) {
String filePath = setFilePath(hgsc001,edcm01Map.get("app.sc.projectSource")); String filePath = setFilePath(hgsc001, edcm01Map.get("app.sc.projectSource"));
hgwd001.setFilePath(filePath+"/"+hgwd001.getFileName()); hgwd001.setFilePath(filePath + "/" + hgwd001.getFileName());
}else { hgwd001.setFileIdPath(setFileIdPath(hgsc001));
hgwd001.setFilePath(wd001.getFilePath()+"/"+hgwd001.getFileName()); } else {
} hgwd001.setFilePath(wd001.getFilePath() + "/" + hgwd001.getFileName());
hgwd001.setFileIdPath(wd001.getFilePath() + "/" + hgwd001.getFileId());
}
if (hgwd001.getId() == null || hgwd001.getId() == 0) { if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001); this.add(hgwd001);
} else { } else {
...@@ -182,4 +190,8 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -182,4 +190,8 @@ public class ServiceHGWD001E extends ServiceEPBase {
String filePath = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgsc001.getProjectSource())).findAny().get().get("itemCname").toString(); String filePath = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgsc001.getProjectSource())).findAny().get().get("itemCname").toString();
return filePath+"/"+hgsc001.getProjName(); return filePath+"/"+hgsc001.getProjName();
} }
private String setFileIdPath(HGSC001 hgsc001) {
return hgsc001.getProjectSource() + "/" + hgsc001.getProjCode();
}
} }
...@@ -76,22 +76,25 @@ public class ServiceHGWD001F extends ServiceEPBase { ...@@ -76,22 +76,25 @@ public class ServiceHGWD001F extends ServiceEPBase {
// 写入数据 // 写入数据
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001(); HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(resultRow); hgwd001.fromMap(resultRow);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
if (wd001 == null){ if (wd001 == null) {
AssertUtils.isEmpty(Collections.singleton(hgwd001), "项目编号不能为空"); AssertUtils.isEmpty(Collections.singleton(hgwd001), "项目编号不能为空");
String filePath = setFilePath(hgsc001,edcm01Map.get("app.sc.projectSource")); String filePath = setFilePath(hgsc001, edcm01Map.get("app.sc.projectSource"));
hgwd001.setFilePath(filePath+"/"+hgwd001.getFileName()); hgwd001.setFilePath(filePath + "/" + hgwd001.getFileName());
}else { hgwd001.setFileIdPath(setFileIdPath(hgsc001));
hgwd001.setFilePath(wd001.getFilePath()+"/"+hgwd001.getFileName()); } else {
} hgwd001.setFilePath(wd001.getFilePath() + "/" + hgwd001.getFileName());
if (hgwd001.getId() == null || hgwd001.getId() == 0) { hgwd001.setFileIdPath(wd001.getFilePath() + "/" + hgwd001.getFileId());
this.add(hgwd001); }
} else { if (hgwd001.getId() == null || hgwd001.getId() == 0) {
String wd001FilePath = wd001 == null? setFilePath(hgsc001,edcm01Map.get("app.sc.projectSource")):wd001.getFilePath(); this.add(hgwd001);
this.modify(hgwd001,wd001FilePath,edcm01Map); } else {
String wd001FilePath = wd001 == null ? setFilePath(hgsc001, edcm01Map.get("app.sc.projectSource"))
} : wd001.getFilePath();
String wd001FileIdPath = wd001 == null ? setFileIdPath(hgsc001) : wd001.getFileIdPath();
this.modify(hgwd001, wd001FilePath, wd001FileIdPath, edcm01Map);
}
} }
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
...@@ -124,9 +127,10 @@ public class ServiceHGWD001F extends ServiceEPBase { ...@@ -124,9 +127,10 @@ public class ServiceHGWD001F extends ServiceEPBase {
* 修改操作 * 修改操作
* @param hgwd001 文件信息 * @param hgwd001 文件信息
* @param wd001FilePath 文件路径 * @param wd001FilePath 文件路径
* @param wd001FileIdPath 文件ID路径
* @param edcm01Map 小代碼 * @param edcm01Map 小代碼
*/ */
public void modify(HGWD001 hgwd001,String wd001FilePath,Map<String, List<Map<String, Object>>> edcm01Map) { public void modify(HGWD001 hgwd001,String wd001FilePath, String wd001FileIdPath, Map<String, List<Map<String, Object>>> edcm01Map) {
HGWD001 wd001out =HGWDTools.HgWd001.get(hgwd001.getId()); HGWD001 wd001out =HGWDTools.HgWd001.get(hgwd001.getId());
HGWD001A hgwd001a = new HGWD001A(); HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode()); hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
...@@ -150,27 +154,36 @@ public class ServiceHGWD001F extends ServiceEPBase { ...@@ -150,27 +154,36 @@ public class ServiceHGWD001F extends ServiceEPBase {
} }
DaoUtils.update(HGWD001.UPDATE, hgwd001); DaoUtils.update(HGWD001.UPDATE, hgwd001);
updateFilePath(hgwd001,wd001out,wd001FilePath); updateFilePath(hgwd001,wd001out,wd001FilePath, wd001FileIdPath);
} }
public void updateFilePath(HGWD001 hgwd001,HGWD001 wd001out,String wd001FilePath) { public void updateFilePath(HGWD001 hgwd001,HGWD001 wd001out,String wd001FilePath, String wd001FileIdPath) {
List<Map> childList = HGWDTools.HgWd001.queryFileChild(hgwd001.getFileId()); List<Map> childList = HGWDTools.HgWd001.queryFileChild(hgwd001.getFileId());
List<String> childFileIdList = Optional.ofNullable(childList).orElse(new ArrayList<>()).stream() List<String> childFileIdList = Optional.ofNullable(childList).orElse(new ArrayList<>()).stream()
.filter(map -> !hgwd001.getFileId().equals(map.get(HGWD001.FIELD_FILE_ID))) .filter(map -> !hgwd001.getFileId().equals(map.get(HGWD001.FIELD_FILE_ID)))
.map(map -> map.get(HGWD001.FIELD_FILE_ID).toString()).collect(Collectors.toList()); .map(map -> map.get(HGWD001.FIELD_FILE_ID).toString()).collect(Collectors.toList());
List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD",childFileIdList); List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD", childFileIdList);
Map<String, List<HGWD099>> listMap = Optional.ofNullable(hgwd099List).orElse(new ArrayList<>()).stream().collect(Collectors.groupingBy(HGWD099::getBizId,Collectors.toList())); Map<String, List<HGWD099>> listMap = Optional.ofNullable(hgwd099List).orElse(new ArrayList<>()).stream()
int end =wd001out ==null ? 0: wd001out.getFilePath().length()+1; .collect(Collectors.groupingBy(HGWD099::getBizId, Collectors.toList()));
if (childList != null && childList.size() > 0) { int end = wd001out == null ? 0 : wd001out.getFilePath().length() + 1;
for (Map child : childList) { int endFileIdPathIndex = wd001out == null ? 0 : wd001out.getFileIdPath().length() + 1;
if (childList != null && childList.size() > 0) {
for (Map child : childList) {
HGWD001 childOut = new HGWD001(); HGWD001 childOut = new HGWD001();
childOut.fromMap(child); childOut.fromMap(child);
if (!hgwd001.getFileId().equals(childOut.getFileId())){ if (!hgwd001.getFileId().equals(childOut.getFileId())) {
String filePathEnd = child.get(HGWD001.FIELD_FILE_PATH).toString().substring(end); String filePathEnd = child.get(HGWD001.FIELD_FILE_PATH).toString().substring(end);
StringBuffer filePath = new StringBuffer(); String fileIdPathEnd = child.get(HGWD001.FIELD_FILE_ID_PATH).toString()
filePath.append(wd001FilePath).append("/").append(hgwd001.getFileName()).append("/").append(filePathEnd); .substring(endFileIdPathIndex);
childOut.setFilePath(filePath.toString()); StringBuffer filePath = new StringBuffer();
DaoUtils.update(HgWdSqlConstant.HgWd001.UPDATE_FILE_PATH, childOut); filePath.append(wd001FilePath).append("/").append(hgwd001.getFileName()).append("/")
.append(filePathEnd);
childOut.setFilePath(filePath.toString());
StringBuffer fileIdPath = new StringBuffer();
fileIdPath.append(wd001FileIdPath).append("/").append(hgwd001.getFileId()).append("/")
.append(fileIdPathEnd);
childOut.setFileIdPath(fileIdPath.toString());
DaoUtils.update(HgWdSqlConstant.HgWd001.UPDATE_FILE_PATH, childOut);
if (listMap.containsKey(childOut.getFileId())){ if (listMap.containsKey(childOut.getFileId())){
for (HGWD099 hgwd099: listMap.get(childOut.getFileId())) { for (HGWD099 hgwd099: listMap.get(childOut.getFileId())) {
hgwd099.setFilePath(filePath.toString()); hgwd099.setFilePath(filePath.toString());
...@@ -186,4 +199,8 @@ public class ServiceHGWD001F extends ServiceEPBase { ...@@ -186,4 +199,8 @@ public class ServiceHGWD001F extends ServiceEPBase {
String filePath = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgsc001.getProjectSource())).findAny().get().get("itemCname").toString(); String filePath = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgsc001.getProjectSource())).findAny().get().get("itemCname").toString();
return filePath+"/"+hgsc001.getProjName(); return filePath+"/"+hgsc001.getProjName();
} }
private String setFileIdPath(HGSC001 hgsc001) {
return hgsc001.getProjectSource() + "/" + hgsc001.getProjCode();
}
} }
...@@ -3,11 +3,11 @@ package com.baosight.hggp.hg.wd.service; ...@@ -3,11 +3,11 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002; import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.utils.HgWdUtils; import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.CommonMethod; import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils; import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils; import com.baosight.hggp.util.LogUtils;
...@@ -56,21 +56,23 @@ public class ServiceHGWD002 extends ServiceBase { ...@@ -56,21 +56,23 @@ public class ServiceHGWD002 extends ServiceBase {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 未选择文件目录时,返回空 // 未选择文件目录时,返回空
String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE);
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID); String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) { if (StringUtils.isBlank(fileId)) {
return inInfo; return inInfo;
} }
String parentId = MapUtils.getString(queryRow, HGWD001.FIELD_PARENT_ID);
String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE);
// 判断是否备件制造图
boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId, projCode);
// 仅查询已发布的文件 // 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1); queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
// 管理员、无权限的目录不做权限验证 // 顶级分类目录
if (!(isSpare || HgWdUtils.HgWd009.isManager())) { if (ProjectSourceEnum.getByCode(fileId) != null) {
queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId()); queryRow.put("projectSource", fileId);
} else {
queryRow.put("parentId", fileId);
}
// 管理员或者备件制造图
if (HgWdUtils.HgWd001.isAuth(fileId, projCode)) {
queryRow.put("userId", UserSessionUtils.getLoginName());
} }
builder(inInfo);
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002()); inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) { } catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -78,79 +80,4 @@ public class ServiceHGWD002 extends ServiceBase { ...@@ -78,79 +80,4 @@ public class ServiceHGWD002 extends ServiceBase {
return inInfo; return inInfo;
} }
public void builder(EiInfo eiInfo) {
String[] orderBy = eiInfo.getBlock(EiConstant.resultBlock).getString("orderBy").split(",");
if (orderBy.length > 0) {
StringBuilder orderByStr = new StringBuilder();
for (int i = 0; i < orderBy.length; i++) {
if (i != 0 && i != orderByStr.length() - 1) {
orderByStr.append(",");
}
switch (orderBy[i]) {
case "fileType asc":
orderByStr.append(orderBy[i].replace("fileType asc", "a.fileType asc"));
break;
case "docId asc":
orderByStr.append(orderBy[i].replace("docId asc", "b.docId asc"));
break;
case "docName asc":
orderByStr.append(orderBy[i].replace("docName asc", "b.docName asc"));
break;
case "docVersion asc":
orderByStr.append(orderBy[i].replace("docVersion asc", "b.docVersion asc"));
break;
case "createdTime asc":
orderByStr.append(orderBy[i].replace("createdTime asc", "b.createdTime asc"));
break;
case "updatedTime asc":
orderByStr.append(orderBy[i].replace("updatedTime asc", "b.updatedTime asc"));
break;
case "previewNum asc":
orderByStr.append(orderBy[i].replace("previewNum asc", "b.previewNum asc"));
break;
case "downloadNum asc":
orderByStr.append(orderBy[i].replace("downloadNum asc", "b.downloadNum asc"));
break;
case "fileType desc":
orderByStr.append(orderBy[i].replace("fileType desc", "a.fileType desc"));
break;
case "docId desc":
orderByStr.append(orderBy[i].replace("docId desc", "b.docId desc"));
break;
case "docName desc":
orderByStr.append(orderBy[i].replace("docName desc", "b.docName desc"));
break;
case "docVersion desc":
orderByStr.append(orderBy[i].replace("docVersion desc", "b.docVersion desc"));
break;
case "createdTime desc":
orderByStr.append(orderBy[i].replace("createdTime desc", "b.createdTime desc"));
break;
case "previewNum desc":
orderByStr.append(orderBy[i].replace("previewNum desc", "b.previewNum desc"));
break;
case "downloadNum desc":
orderByStr.append(orderBy[i].replace("downloadNum desc", "b.downloadNum desc"));
break;
case "updatedTime desc":
orderByStr.append(orderBy[i].replace("updatedTime desc", "b.updatedTime desc"));
break;
case "changeContent asc":
orderByStr.append(orderBy[i].replace("downloadNum desc", "b.changeContent asc"));
break;
case "changeContent desc":
orderByStr.append(orderBy[i].replace("updatedTime desc", "b.changeContent desc"));
break;
default:
if (!orderBy[i].isEmpty()) {
orderByStr.append(orderBy[i]);
} else {
orderByStr.append(orderBy[i]);
}
break;
}
}
eiInfo.getBlock(EiConstant.resultBlock).set("orderBy", orderByStr);
}
}
} }
...@@ -5,6 +5,7 @@ import com.baosight.hggp.common.ChangeTypeEnum; ...@@ -5,6 +5,7 @@ import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
...@@ -58,8 +59,8 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -58,8 +59,8 @@ public class ServiceHGWD099 extends ServiceEPBase {
* @param inInfo * @param inInfo
* @return * @return
*/ */
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "文档库-附件清单A-查询")
@Override @Override
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "文档库-附件清单A-查询")
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); Map queryRow = EiInfoUtils.getFirstRow(inInfo);
...@@ -68,15 +69,15 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -68,15 +69,15 @@ public class ServiceHGWD099 extends ServiceEPBase {
if (StringUtils.isBlank(parentId)) { if (StringUtils.isBlank(parentId)) {
return inInfo; return inInfo;
} }
// 查询子节点 // 顶级分类目录
List<HGWD001> children = HgWdUtils.HgWd001.queryChildren(parentId, projCode); ProjectSourceEnum projectSourceEnum = ProjectSourceEnum.getByCode(parentId);
if (CollectionUtils.isEmpty(children)) { if (projectSourceEnum != null) {
return inInfo; queryRow.put("projectSource", parentId);
}
// 管理员或者备件制造图
if (HgWdUtils.HgWd001.isAuth(parentId, projCode)) {
queryRow.put("userId", UserSessionUtils.getLoginName());
} }
// 需要包含自身
queryRow.put("bizIds", children.stream().map(HGWD001::getFileId).collect(Collectors.toList()));
queryRow.remove(HGWD099.FIELD_BIZ_ID);
inInfo.getBlock(EiConstant.queryBlock).getRow(ACConstants.ROW_CODE_0).remove(HGWD001.FIELD_PARENT_ID);
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099()); inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
STATUS as "status", <!-- 状态 --> STATUS as "status", <!-- 状态 -->
REMARK as "remark", <!-- 备注 --> REMARK as "remark", <!-- 备注 -->
RELEASE_DATE as "releaseDate", <!-- 发布时间 --> RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
FILE_PATH as "filePath" <!-- 文件路径 --> FILE_PATH as "filePath", <!-- 文件路径 -->
FILE_ID_PATH as "fileIdPath" <!-- 文件路径 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -206,12 +207,13 @@ ...@@ -206,12 +207,13 @@
STATUS, <!-- 状态 --> STATUS, <!-- 状态 -->
REMARK, <!-- 备注 --> REMARK, <!-- 备注 -->
RELEASE_DATE, RELEASE_DATE,
FILE_PATH FILE_PATH,
FILE_ID_PATH
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #projectSource#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #projectSource#,
#leafLevel#, #parentId#, #fileId#, #fileType#, #fileName#, #leafLevel#, #parentId#, #fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate#, #filePath# #docVersion#, #status#, #remark#, #releaseDate#, #filePath#, #fileIdPath#
) )
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001 SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001
...@@ -234,6 +236,7 @@ ...@@ -234,6 +236,7 @@
REMARK = #remark#, <!-- 备注 --> REMARK = #remark#, <!-- 备注 -->
RELEASE_DATE = #releaseDate#, <!--发布时间--> RELEASE_DATE = #releaseDate#, <!--发布时间-->
FILE_PATH = #filePath#, FILE_PATH = #filePath#,
FILE_ID_PATH = #fileIdPath#,
<include refid="SqlBase.updateRevise"/> <include refid="SqlBase.updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</update> </update>
...@@ -261,6 +264,7 @@ ...@@ -261,6 +264,7 @@
UPDATE ${hggpSchema}.HGWD001 UPDATE ${hggpSchema}.HGWD001
SET SET
FILE_PATH = #filePath#, FILE_PATH = #filePath#,
FILE_ID_PATH = #fileIdPath#,
<include refid="SqlBase.updateRevise"/> <include refid="SqlBase.updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</update> </update>
...@@ -277,7 +281,8 @@ ...@@ -277,7 +281,8 @@
FILE_ID as "fileId", <!-- 文件ID --> FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 --> FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName", <!-- 文件名称 --> FILE_NAME as "fileName", <!-- 文件名称 -->
FILE_PATH as "filePath" FILE_PATH as "filePath",
FILE_ID_PATH as "fileIdPath"
FROM ${hggpSchema}.HGWD001 FROM ${hggpSchema}.HGWD001
WHERE 1=1 WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
...@@ -317,7 +322,8 @@ ...@@ -317,7 +322,8 @@
PARENT_ID as "parentId", PARENT_ID as "parentId",
DELETE_FLAG as "isDeleted", DELETE_FLAG as "isDeleted",
LEAF_LEVEL as "leafLevel", LEAF_LEVEL as "leafLevel",
FILE_PATH as "filePath" FILE_PATH as "filePath",
FILE_ID_PATH as "fileIdPath"
FROM ${hggpSchema}.HGWD001 FROM ${hggpSchema}.HGWD001
WHERE 1=1 WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery"> <isEmpty prepend=" AND " property="deletedQuery">
...@@ -336,7 +342,7 @@ ...@@ -336,7 +342,7 @@
order by CREATED_TIME asc order by CREATED_TIME asc
</select> </select>
<!-- 查询节点,包含自身 --> <!-- 查询节点,包含自身 -->
<select id="queryChildren" resultClass="com.baosight.hggp.hg.wd.domain.HGWD001"> <select id="queryChildren" resultClass="com.baosight.hggp.hg.wd.domain.HGWD001">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
...@@ -348,6 +354,7 @@ ...@@ -348,6 +354,7 @@
) )
</isNotEmpty> </isNotEmpty>
</select> </select>
<!--档库所有子节点树查询--> <!--档库所有子节点树查询-->
<select id="queryFileChild" resultClass="java.util.HashMap"> <select id="queryFileChild" resultClass="java.util.HashMap">
SELECT SELECT
...@@ -355,7 +362,8 @@ ...@@ -355,7 +362,8 @@
T3.FILE_ID AS "fileId", T3.FILE_ID AS "fileId",
T3.FILE_TYPE AS "fileType", T3.FILE_TYPE AS "fileType",
T3.PARENT_ID as "parentId", T3.PARENT_ID as "parentId",
T3.FILE_PATH as "filePath" T3.FILE_PATH as "filePath",
T3.FILE_ID_PATH as "fileIdPath"
FROM ( FROM (
SELECT SELECT
@CODES AS CODES, @CODES AS CODES,
...@@ -400,7 +408,8 @@ ...@@ -400,7 +408,8 @@
FILE_ID as "fileId", <!-- 文件ID --> FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 --> FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName", <!-- 文件名称 --> FILE_NAME as "fileName", <!-- 文件名称 -->
FILE_PATH as "filePath" FILE_PATH as "filePath",
FILE_ID_PATH as "fileIdPath"
from ( from (
SELECT SELECT
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
...@@ -410,7 +419,8 @@ ...@@ -410,7 +419,8 @@
'' as "FILE_ID", <!-- 文件ID --> '' as "FILE_ID", <!-- 文件ID -->
'' as "FILE_TYPE", <!-- 文件类型 --> '' as "FILE_TYPE", <!-- 文件类型 -->
'' as "FILE_NAME", <!-- 文件名称 --> '' as "FILE_NAME", <!-- 文件名称 -->
project_source as "FILE_PATH" PROJECT_SOURCE as "FILE_PATH",
PROJ_CODE as "fileIdPath"
FROM ${hggpSchema}.HGSC001 T WHERE 1=1 FROM ${hggpSchema}.HGSC001 T WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
...@@ -438,7 +448,8 @@ ...@@ -438,7 +448,8 @@
FILE_ID, <!-- 文件ID --> FILE_ID, <!-- 文件ID -->
FILE_TYPE, <!-- 文件类型 --> FILE_TYPE, <!-- 文件类型 -->
FILE_NAME, <!-- 文件名称 --> FILE_NAME, <!-- 文件名称 -->
FILE_PATH FILE_PATH,
FILE_ID_PATH
FROM ${hggpSchema}.HGWD001 T WHERE 1=1 FROM ${hggpSchema}.HGWD001 T WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
) a ) a
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
B.CREATED_TIME as "createdTime", <!-- 创建时间 --> B.CREATED_TIME as "createdTime", <!-- 创建时间 -->
B.UPDATED_BY as "updatedBy", <!-- 记录修改者 --> B.UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
B.UPDATED_NAME as "updatedName", <!-- 记录修改名称 --> B.UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
B.UPDATED_TIME as "updatedTime" <!-- 记录修改时间 --> B.UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
B.FILE_PATH as "filePath" <!-- 文件路径 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -37,21 +38,12 @@ ...@@ -37,21 +38,12 @@
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
A.ID = #id# A.ID = #id#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
A.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName"> <isNotEmpty prepend=" AND " property="projName">
A.PROJ_NAME LIKE CONCAT('%', #projName#, '%') A.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
A.FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileType"> <isNotEmpty prepend=" AND " property="fileType">
A.FILE_TYPE = #fileType# A.FILE_TYPE = #fileType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="fileName">
A.FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
B.STATUS = #status# B.STATUS = #status#
</isNotEmpty> </isNotEmpty>
...@@ -61,9 +53,6 @@ ...@@ -61,9 +53,6 @@
<isNotEmpty prepend=" AND " property="docName"> <isNotEmpty prepend=" AND " property="docName">
B.DOC_NAME LIKE CONCAT('%', #docName#, '%') B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.BIZ_ID IN (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 WHERE USER_ID = #userId#)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdDateFrom"> <isNotEmpty prepend=" AND " property="createdDateFrom">
B.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000') B.CREATED_TIME &gt;= CONCAT(REPLACE(#createdDateFrom#, '-', ''), '000000')
</isNotEmpty> </isNotEmpty>
...@@ -73,8 +62,29 @@ ...@@ -73,8 +62,29 @@
<isNotEmpty prepend=" AND " property="docType"> <isNotEmpty prepend=" AND " property="docType">
B.DOC_TYPE = #docType# B.DOC_TYPE = #docType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath">
B.FILE_PATH LIKE CONCAT('%', #filePath#, '%')
</isNotEmpty>
</sql> </sql>
<sql id="customCondition">
<include refid="condition"/>
<!-- projectSource和parentId只能同时存在一个, APPROVAL_STATUS=2:已审核 -->
<isNotEmpty prepend=" AND " property="projectSource">
EXISTS (SELECT PROJ_CODE FROM ${hggpSchema}.HGSC001 M WHERE M.PROJ_CODE = A.PROJ_CODE
AND APPROVAL_STATUS = 2 AND A.PROJECT_SOURCE = #projectSource#
)
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
FIND_IN_SET(A.FILE_ID, (SELECT ${hggpSchema}.queryWdTreeInfo(#parentId#)))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE M.FILE_ID = A.FILE_ID
AND M.DELETE_FLAG = 0 AND M.USER_ID = #userId#
)
</isNotEmpty>
</sql>
<sql id="orderBy"> <sql id="orderBy">
<dynamic prepend="ORDER BY"> <dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy"> <isNotEmpty property="orderBy">
...@@ -92,7 +102,7 @@ ...@@ -92,7 +102,7 @@
FROM ${hggpSchema}.HGWD001 A FROM ${hggpSchema}.HGWD001 A
INNER JOIN ${hggpSchema}.HGWD099 B ON A.FILE_ID = B.BIZ_ID INNER JOIN ${hggpSchema}.HGWD099 B ON A.FILE_ID = B.BIZ_ID
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="customCondition"/>
<include refid="orderBy"/> <include refid="orderBy"/>
</select> </select>
...@@ -101,7 +111,7 @@ ...@@ -101,7 +111,7 @@
FROM ${hggpSchema}.HGWD001 A FROM ${hggpSchema}.HGWD001 A
INNER JOIN ${hggpSchema}.HGWD099 B ON A.FILE_ID = B.BIZ_ID INNER JOIN ${hggpSchema}.HGWD099 B ON A.FILE_ID = B.BIZ_ID
WHERE 1=1 WHERE 1=1
<include refid="condition"/> <include refid="customCondition"/>
</select> </select>
</sqlMap> </sqlMap>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGWD099"> <sqlMap namespace="HGWD099">
<sql id="column"> <sql id="column">
...@@ -38,9 +38,6 @@ ...@@ -38,9 +38,6 @@
<isNotEmpty prepend=" AND " property="bizId"> <isNotEmpty prepend=" AND " property="bizId">
BIZ_ID = #bizId# BIZ_ID = #bizId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="bizIds">
BIZ_ID IN <iterate close=")" open="(" conjunction="," property="bizIds">#bizIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId"> <isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId# DOC_ID = #docId#
</isNotEmpty> </isNotEmpty>
...@@ -50,15 +47,9 @@ ...@@ -50,15 +47,9 @@
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="docVersion">
DOC_VERSION = #docVersion#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="releaseDate"> <isNotEmpty prepend=" AND " property="releaseDate">
RELEASE_DATE = #releaseDate# RELEASE_DATE = #releaseDate#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
BIZ_ID = #parentId#
</isNotEmpty>
<isEmpty prepend=" AND " property="deleteFlag"> <isEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = 0 DELETE_FLAG = 0
</isEmpty> </isEmpty>
...@@ -96,6 +87,24 @@ ...@@ -96,6 +87,24 @@
<isNotEmpty prepend=" AND " property="bizIds"> <isNotEmpty prepend=" AND " property="bizIds">
BIZ_ID in <iterate close=")" open="(" conjunction="," property="bizIds">#bizIds[]#</iterate> BIZ_ID in <iterate close=")" open="(" conjunction="," property="bizIds">#bizIds[]#</iterate>
</isNotEmpty> </isNotEmpty>
<!-- projectSource和parentId只能同时存在一个, APPROVAL_STATUS=2:已审核 -->
<isNotEmpty prepend=" AND " property="projectSource">
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD001 M, ${hggpSchema}.HGSC001 N
WHERE M.FILE_ID = T.BIZ_ID AND M.PROJ_CODE = N.PROJ_CODE
AND M.DELETE_FLAG = 0 AND N.APPROVAL_STATUS = 2
AND N.PROJECT_SOURCE = #projectSource#
)
</isNotEmpty>
<isEmpty property="projectSource">
<isNotEmpty prepend=" AND " property="parentId">
FIND_IN_SET(BIZ_ID, (SELECT ${hggpSchema}.queryWdTreeInfo(#parentId#)))
</isNotEmpty>
</isEmpty>
<isNotEmpty prepend=" AND " property="userId">
EXISTS (SELECT FILE_ID FROM ${hggpSchema}.HGWD003 M WHERE M.FILE_ID = T.BIZ_ID
AND M.DELETE_FLAG = 0 AND M.USER_ID = #userId#
)
</isNotEmpty>
</sql> </sql>
<sql id="orderBy"> <sql id="orderBy">
...@@ -112,7 +121,7 @@ ...@@ -112,7 +121,7 @@
<select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD099"> <select id="query" resultClass="com.baosight.hggp.hg.wd.domain.HGWD099">
SELECT SELECT
<include refid="column"/> <include refid="column"/>
FROM ${hggpSchema}.HGWD099 FROM ${hggpSchema}.HGWD099 T
WHERE 1=1 WHERE 1=1
<include refid="customCondition"/> <include refid="customCondition"/>
<include refid="orderBy"/> <include refid="orderBy"/>
...@@ -120,7 +129,7 @@ ...@@ -120,7 +129,7 @@
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) SELECT COUNT(*)
FROM ${hggpSchema}.HGWD099 FROM ${hggpSchema}.HGWD099 T
WHERE 1=1 WHERE 1=1
<include refid="customCondition"/> <include refid="customCondition"/>
</select> </select>
......
...@@ -8,8 +8,10 @@ import com.baosight.hggp.hg.wd.domain.HGWD001; ...@@ -8,8 +8,10 @@ import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003; import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.util.StringUtils; import com.baosight.hggp.util.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author:songx * @author:songx
...@@ -27,6 +29,21 @@ public class HgWdUtils { ...@@ -27,6 +29,21 @@ public class HgWdUtils {
public static class HgWd001 { public static class HgWd001 {
/** /**
* 管理员和备件制造图不需要权限控制
*
* @param treeId 树节点ID
* @param projCode 项目编码
* @return true:需要权限
*/
public static boolean isAuth(String treeId, String projCode) {
boolean isManager = HgWdUtils.HgWd009.isManager();
if (isManager) {
return false;
}
return !HgWdUtils.HgWd001.isSpare(treeId, projCode);
}
/**
* 是否备件制造图 * 是否备件制造图
* *
* @param treeId * @param treeId
...@@ -92,6 +109,23 @@ public class HgWdUtils { ...@@ -92,6 +109,23 @@ public class HgWdUtils {
/** /**
* 查询子节点 * 查询子节点
* *
* @param parentId 父级节点
* @param isManager true:管理员
* @param isSpare true:备件制造图
* @return
*/
public static List<String> queryChildrenId(String parentId, boolean isManager, boolean isSpare) {
// 管理员或者备件制造图查询所有子节点;其余查询当前节点有权限的子节点
List<HGWD001> dbWd001s = queryChildren(parentId, isManager, isSpare);
if (CollectionUtils.isEmpty(dbWd001s)) {
return null;
}
return dbWd001s.stream().map(HGWD001::getFileId).collect(Collectors.toList());
}
/**
* 查询子节点
*
* @param parentId * @param parentId
* @param isManager true:管理员 * @param isManager true:管理员
* @param isSpare true:备件制造图 * @param isSpare true:备件制造图
......
...@@ -63,17 +63,17 @@ ...@@ -63,17 +63,17 @@
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0"> <EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgcg.contractStatus" condition="ITEM_CODE IN ('0','2','4','5')"/> <EF:EFCodeOption codeName="hggp.hgcg.contractStatus" condition="ITEM_CODE IN ('0','2','4','5')"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFComboColumn ename="supCode" cname="供应商名称" width="120" align="left" defaultValue="" <EF:EFComboColumn ename="supCode" cname="供应商名称" readonly="true" width="120" align="left"
filter="contains" required="true"> defaultValue="" filter="contains" required="true">
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFComboColumn ename="purUserId" cname="采购员" width="120" align="left" defaultValue="" <%-- <EF:EFComboColumn ename="purUserId" cname="采购员" readonly="true" width="120" align="left" defaultValue=""--%>
filter="contains" required="true" columnTemplate="#=valueField# - #=textField#" <%-- filter="contains" required="true" columnTemplate="#=valueField# - #=textField#"--%>
itemTemplate="#=valueField# - #=textField#"> <%-- itemTemplate="#=valueField# - #=textField#">--%>
<EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/> <%-- <EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/>--%>
</EF:EFComboColumn> <%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="purUserName" cname="采购员姓名" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="purUserName" cname="采购员姓名" readonly="true" width="120" align="center"/>
<EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false" <EF:EFColumn ename="purQty" cname="采购数量" width="120" align="right" format="{0:N3}" enable="false"
defaultValue="0" sumType="page"/> defaultValue="0" sumType="page"/>
<EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false" <EF:EFColumn ename="purWeight" cname="采购重量" width="120" align="right" format="{0:N3}" enable="false"
......
...@@ -92,13 +92,11 @@ let checkParam = function () { ...@@ -92,13 +92,11 @@ let checkParam = function () {
} }
let supCode = $("#inqu_status-0-supCode").val(); let supCode = $("#inqu_status-0-supCode").val();
if (isBlank(supCode)) { if (isBlank(supCode)) {
message("供应商不能为空"); return "供应商不能为空";
return;
} }
let purUserId = $("#inqu_status-0-purUserId").val(); let purUserId = $("#inqu_status-0-purUserId").val();
if (isBlank(purUserId)) { if (isBlank(purUserId)) {
message("采购员不能为空"); return "采购员不能为空";
return;
} }
return ""; return "";
} }
\ No newline at end of file
...@@ -48,25 +48,25 @@ $(function () { ...@@ -48,25 +48,25 @@ $(function () {
} }
} }
} }
return dataItem["purUserName"]; return dataItem["purUserName"];
}, },
editor: function (container, options) { editor: function (container, options) {
var input = $('<input />'); var input = $('<input />');
input.attr("name", options.field); input.attr("name", options.field);
input.attr("id", options.field); input.attr("id", options.field);
input.appendTo(container); input.appendTo(container);
input.kendoDropDownList({ input.kendoDropDownList({
dataSource: userByCompany, dataSource: userByCompany,
minLength: 0, minLength: 0,
dataTextField: "userName", dataTextField: "userName",
dataValueField: "userName", dataValueField: "userName",
optionLabelTemplate: "[#:loginName#]#:userName#-#:depName#", optionLabelTemplate: "[#:loginName#]#:userName#-#:depName#",
valueTemplate: "[#:loginName#]#:userName#-#:depName#", valueTemplate: "[#:loginName#]#:userName#-#:depName#",
template: "[#:loginName#]#:userName#-#:depName#", template: "[#:loginName#]#:userName#-#:depName#",
filter: "contains" filter: "contains"
}); });
} }
}, { }, {
field: "projCode", field: "projCode",
title: "项目编码", title: "项目编码",
template: function (dataItem) { template: function (dataItem) {
......
...@@ -65,12 +65,12 @@ ...@@ -65,12 +65,12 @@
<EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/> <EF:EFOptions blockId="sup_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="supName" cname="供应商名称" enable="false" width="120" align="center" hidden="true"/>
<EF:EFComboColumn ename="purUserId" cname="采购员" width="120" align="left" defaultValue="" <%-- <EF:EFComboColumn ename="purUserId" cname="采购员" width="120" align="left" defaultValue=""--%>
filter="contains" required="true" columnTemplate="#=valueField# - #=textField#" <%-- filter="contains" required="true" columnTemplate="#=valueField# - #=textField#"--%>
itemTemplate="#=valueField# - #=textField#"> <%-- itemTemplate="#=valueField# - #=textField#">--%>
<EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/> <%-- <EF:EFOptions blockId="user_block_id" valueField="valueField" textField="textField"/>--%>
</EF:EFComboColumn> <%-- </EF:EFComboColumn>--%>
<EF:EFColumn ename="purUserName" cname="采购员姓名" enable="false" width="120" align="center" hidden="true"/> <EF:EFColumn ename="purUserName" cname="采购员姓名" width="120" align="center"/>
<EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="receiveQty" cname="收货数量" enable="false" width="120" align="right" format="{0:N3}"
sumType="page"/> sumType="page"/>
<EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}" <EF:EFColumn ename="deliverQty" cname="退货数量" enable="false" width="120" align="right" format="{0:N3}"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="180" align="left"/> <EF:EFColumn ename="fieldCode" cname="字段英文名" enable="false" width="180" align="left"/>
<EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left" sort="false"/> <EF:EFColumn ename="fieldName" cname="字段中文名" enable="false" width="180" align="left" sort="false"/>
<EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left" sort="false"/> <EF:EFColumn ename="aliasName" cname="字段别名" enable="false" width="160" align="left" sort="false"/>
<EF:EFColumn ename="sortNum" cname="排序" width="80" align="center" required="true"/> <EF:EFColumn ename="sortNum" cname="排序" width="100" align="center" required="true"/>
<EF:EFComboColumn ename="isDefault" cname="是否默认" width="100" align="center" copy="true" required="true" <EF:EFComboColumn ename="isDefault" cname="是否默认" width="100" align="center" copy="true" required="true"
sort="false"> sort="false">
<EF:EFCodeOption codeName="hggp.common.yesNo"/> <EF:EFCodeOption codeName="hggp.common.yesNo"/>
......
...@@ -54,27 +54,29 @@ ...@@ -54,27 +54,29 @@
</div> </div>
<div id="right-pane" class="i-fit-height"> <div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="是否是文件" ename="leafType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="父级Id" ename="orgParentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<div class="row"> <div class="row">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput ename="fileName" cname="目录名称" blockId="inqu_status" row="0" colWidth="3"
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/> readonly="true"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput ename="docName" cname="附件名称" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput ename="filePath" cname="文件路径" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/> <EF:EFSelect ename="status" cname="状态" blockId="inqu_status" row="0" colWidth="3">
<EF:EFInput cname="是否是文件" ename="leafType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="父级Id" ename="orgParentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="登录用户" ename="userId" blockId="inqu_status" row="0" colWidth="3" value="${loginName}" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFInput cname="附件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFSelect blockId="inqu_status" row="0" ename="status" cname="状态" colWidth="3">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.status"/> <EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFSelect> </EF:EFSelect>
</div>
<div class="row">
<EF:EFDateSpan startCname="修改时间" endCname="至" blockId="inqu_status" row="0" <EF:EFDateSpan startCname="修改时间" endCname="至" blockId="inqu_status" row="0"
startName="updateDateFrom" endName="updateDateTo" role="date" startName="updateDateFrom" endName="updateDateTo" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false"> format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan> </EF:EFDateSpan>
<EF:EFInput cname="文件路径" ename="filePath" blockId="inqu_status" row="0" colWidth="3" />
</div> </div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true"> <EF:EFRegion id="result" title="明细信息" fitHeight="true">
...@@ -84,9 +86,9 @@ ...@@ -84,9 +86,9 @@
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="150" align="center" sort="false"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="150" align="center" sort="false"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="200"/> <EF:EFColumn ename="docName" cname="附件名称" enable="false" width="200"/>
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" sort="false"/>
<EF:EFColumn ename="filePath" cname="文件路径" enable="false" width="200"/>
<EF:EFColumn ename="docType" cname="附件类型" enable="false" width="110" align="center"/> <EF:EFColumn ename="docType" cname="附件类型" enable="false" width="110" align="center"/>
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" align="center"/>
<EF:EFColumn ename="filePath" cname="文件路径" enable="false" width="200" align="center"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/> <EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center" <EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"
defaultValue="0" hidden="false"> defaultValue="0" hidden="false">
......
...@@ -98,7 +98,7 @@ $(function () { ...@@ -98,7 +98,7 @@ $(function () {
// 设置选中节点 // 设置选中节点
treeSelectClick(model); treeSelectClick(model);
inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val()); inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val());
inInfo.set("inqu_status-0-pageCode","HGWD002"); inInfo.set("inqu_status-0-pageCode", "HGWD002");
return inInfo; return inInfo;
}, },
select: function (e) { select: function (e) {
...@@ -124,15 +124,13 @@ $(function () { ...@@ -124,15 +124,13 @@ $(function () {
return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>' return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>'
}, },
loadComplete: function (options) { loadComplete: function (options) {
// 树节点查询
$("#search").on("click", treeSearch);
}, },
selectTreeNode: { selectTreeNode: {
fileId: '', fileId: '',
parentId: '',
projCode: '', projCode: '',
companyCode: '', leafType: '',
leafLevel: '',
type: '',
downloadFlag: '0' downloadFlag: '0'
}, },
// expandLevel:1, // expandLevel:1,
...@@ -296,21 +294,14 @@ let treeSelectClick = function (nodeData) { ...@@ -296,21 +294,14 @@ let treeSelectClick = function (nodeData) {
* @param nodeData * @param nodeData
*/ */
let setTreeNodeValue = function (nodeData) { let setTreeNodeValue = function (nodeData) {
let leafLevel = nodeData.leafLevel == null ? 0 : nodeData.leafLevel; IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.id;
IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.docTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.docTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.docTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode; IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.docTree.selectTreeNode.leafLevel = leafLevel; IPLATUI.EFTree.docTree.selectTreeNode.leafType = nodeData.leafType;
IPLATUI.EFTree.docTree.selectTreeNode.downloadFlag = nodeData.downloadFlag == null ? 0 IPLATUI.EFTree.docTree.selectTreeNode.downloadFlag = nodeData.downloadFlag == null ? 0
: nodeData.downloadFlag; : nodeData.downloadFlag;
$("[name = 'inqu_status-0-parentId']").val(nodeData.label); $("[name = 'inqu_status-0-parentId']").val(nodeData.id);
$("[name = 'inqu_status-0-fileId']").val(nodeData.id); $("[name = 'inqu_status-0-fileId']").val(nodeData.id);
$("[name = 'inqu_status-0-projCode']").val(nodeData.projCode); $("[name = 'inqu_status-0-projCode']").val(nodeData.projCode);
$("[name = 'inqu_status-0-leafLevel']").val(leafLevel);
$("[name = 'inqu_status-0-type']").val(nodeData.type);
$("[name = 'inqu_status-0-fileName']").val(nodeData.text);
} }
/** /**
...@@ -318,8 +309,8 @@ let setTreeNodeValue = function (nodeData) { ...@@ -318,8 +309,8 @@ let setTreeNodeValue = function (nodeData) {
*/ */
let showAuthButton = function () { let showAuthButton = function () {
// C:目录 // C:目录
let leafType = IPLATUI.EFTree.docTree.selectTreeNode.leafLevel; let leafType = IPLATUI.EFTree.docTree.selectTreeNode.leafType;
if (leafType && leafType > 0) { if (leafType === 'C') {
CommonUtils.showButton("PREVIEW"); CommonUtils.showButton("PREVIEW");
} else { } else {
CommonUtils.hideButton("PREVIEW"); CommonUtils.hideButton("PREVIEW");
...@@ -350,3 +341,65 @@ let showPreview = function (docId) { ...@@ -350,3 +341,65 @@ let showPreview = function (docId) {
let fileId = IPLATUI.EFTree.docTree.selectTreeNode.fileId; let fileId = IPLATUI.EFTree.docTree.selectTreeNode.fileId;
addRecordWindow(fileId, docId); addRecordWindow(fileId, docId);
} }
/**
* 树节点查询
*/
let treeSearch = function (){
let tree = $("#docTree").data("kendoTreeView");
let leafName = $("#searchText").val();
if (leafName == null || leafName.trim() === '') {
tree.reload("root");
return
}
let inInfo = new EiInfo();
inInfo.set("inqu_status-0-fileName", leafName);
EiCommunicator.send("HGWD001D", "searchTree", inInfo, {
onSuccess: function (res) {
if (res.status === -1) {
message(res.msg);
return;
}
// 获取所有满足条件的子节点路径
const allPath = res.get("allPath")
if (allPath.length <= 0) {
return;
}
tree.reload("root");
// 根据路径一层层展开树节点,先剔除重复的节点
let expandNodes = []
for (let path of allPath) {
for (let index = 0; index < path.length - 1; index++) {
if (-1 === expandNodes.indexOf(path[index])) {
expandNodes.push(path[index]);
}
}
}
expandTreeNodeList(tree, expandNodes);
}, onFail: function (res) {
IPLAT.alert(res.msg);
}
});
}
/**
* 批量展开树节点
*
* @param tree
* @param nodeIds
*/
function expandTreeNodeList(tree, nodeIds) {
if (nodeIds.length === 0 || tree == null) {
// 所有节点都已展开完毕,结束递归
return;
}
const orgId = nodeIds[0];
let barDataItem = tree.dataSource.get(orgId);
if (barDataItem) {
tree.expandPath(nodeIds)
} else {
setTimeout(() => {
expandTreeNodeList(tree, nodeIds)
}, 100)
}
}
\ No newline at end of file
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
<div id="splitter" class="i-fit-height"> <div id="splitter" class="i-fit-height">
<div id="left-pane" class="i-fit-height"> <div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true"> <EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<%-- <div class="row" style="display: block">--%>
<%-- <div class="col-md-8" style="display:flex;align-items: center">--%>
<%-- <EF:EFInput ename="searchText" colWidth="8" inline="true"/>--%>
<%-- <EF:EFButton ename="search" class="fa fa-search" layout="2"/>--%>
<%-- </div>--%>
<%-- </div>--%>
<div id="menu" style="margin-top: 12px; margin-bottom: 8px"> <div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label" <EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="queryTree" hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="queryTree"
...@@ -19,14 +25,9 @@ ...@@ -19,14 +25,9 @@
</div> </div>
<div id="right-pane" class="i-fit-height"> <div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<div class="row"> <div class="row">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="附件分类" colWidth="3" <EF:EFSelect blockId="inqu_status" row="0" ename="fileType" cname="附件分类" colWidth="3"
filter="contains"> filter="contains">
<EF:EFOption label="全部" value=""/> <EF:EFOption label="全部" value=""/>
...@@ -38,28 +39,32 @@ ...@@ -38,28 +39,32 @@
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false"> format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan> </EF:EFDateSpan>
</div> </div>
<div class="row">
<EF:EFInput cname="文件路径" ename="filePath" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true"> <EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" sort="setted" <EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" sort="single"
checkMode="row"> checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/> <EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" sort="false" <EF:EFColumn ename="docId" cname="附件ID" hidden="true"/>
hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="80" align="center" sort="false"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="80" align="center" sort="false"/>
<EF:EFComboColumn ename="fileType" cname="附件分类" enable="false" width="90" align="center"> <EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" alias="b.docName"/>
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" sort="false"/>
<EF:EFColumn ename="filePath" cname="文件路径" enable="false" width="200" alias="b.filePath"/>
<EF:EFComboColumn ename="fileType" cname="附件分类" enable="false" width="100" align="center"
alias="a.fileType">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/> <EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" sort="true"/> <EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center"
<EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center" sort="true"/> alias="b.docType"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/> <EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" align="center" sort="true"/> alias="b.docVersion"/>
<EF:EFColumn ename="updatedTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime" <EF:EFColumn ename="updatedTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140"
required="false" enable="false" sort="true"/> enable="false" alias="b.updatedTime"/>
<%-- <EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right" sort="true"/>--%>
<%-- <EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right" sort="true"/>--%>
</EF:EFGrid> </EF:EFGrid>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment