Commit 952a9ee3 by 宋祥

Merge branch 'dev' of http://129.211.46.84:8800/platform/hg-smart into dev-sx

parents c82209a3 f7fe07cf
......@@ -229,9 +229,9 @@ public class ServiceHGCW010 extends ServiceBase {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
HGCW010 hgcw010 = new HGCW010();
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgcw010.setCompanyCode(userVO.getUsercode());
hgcw010.setCompanyName(userVO.getUsername());
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgcw010.setCompanyCode(hgcw011List.get(0).getCompanyCode());
hgcw010.setCompanyName(hgcw011List.get(0).getCompanyName());
hgcw010.setBillTybe(1);
hgcw010.setReviewStatus(0);
hgcw010.setBillState(1);
......
......@@ -90,9 +90,9 @@ public class ServiceHGCW014 extends ServiceBase {
for (int i = 0; i < resultRows.size(); i++) {
HGCW014 HGCW014 = new HGCW014();
HGCW014.fromMap(resultRows.get(i));
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
/*UserVO userVO = HGCWTools.HgCw002.getUserCompany();
HGCW014.setCompanyCode(userVO.getUsercode());
HGCW014.setCompanyName(userVO.getUsername());
HGCW014.setCompanyName(userVO.getUsername());*/
HGCW014.setCancelStatus(1);
HGCW014.setReviewStatus(0);
HGCW014.setIncomeNumber(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_COLLECTION_NO));
......@@ -183,9 +183,9 @@ public class ServiceHGCW014 extends ServiceBase {
if (StringUtils.isEmpty(mainId)) {
//先生成主表
HGCW014 hgcw014 = new HGCW014();
UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgcw014.setCompanyCode(userVO.getUsercode());
hgcw014.setCompanyName(userVO.getUsername());
//UserVO userVO = HGCWTools.HgCw002.getUserCompany();
hgcw014.setCompanyCode(hgcw015List.get(0).getCompanyCode());
hgcw014.setCompanyName(hgcw015List.get(0).getCompanyName());
hgcw014.setCancelStatus(1);
hgcw014.setReviewStatus(ReviewStatusEnum.UNREVIEWED.getCode());
hgcw014.setIncomeNumber(SequenceGenerator.getNextSequence(HGConstant.SequenceId.CW_COLLECTION_NO));
......
......@@ -20,6 +20,8 @@ public class HgScSqlConstant {
public static final String UPDATE_FOR_DC = "HGSC001.updateForDc";
// 修改项目名称
public static final String UPDATE_PROJ_NAME = "HGSC001.updateProjName";
// 修改审批状态
public static final String UPDATE_APPROVAL_STATUS = "HGSC001.updateApprovalStatus";
// 批量删除
public static final String BATCH_DELETE = "HGSC001.batch_delete";
// 批量完成
......
......@@ -51,7 +51,21 @@ public enum ProjectSourceEnum {
}
return null;
}
/**
* 根据编码查询
* @param code
* @return
*/
public static ProjectSourceEnum getByCode(String code) {
for (ProjectSourceEnum value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
ProjectSourceEnum(String code, String name) {
this.code = code;
this.name = name;
......
......@@ -8,6 +8,7 @@ import com.baosight.hggp.core.extapp.decheng.model.DcContractList;
import com.baosight.hggp.core.model.Pager;
import com.baosight.hggp.core.tools.CodeValueTools;
import com.baosight.hggp.core.utils.ThreadUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
......@@ -170,7 +171,7 @@ public class ServiceHGSC101 extends ServiceEPBase {
private void syncDcContractSingle(HGPZ009 dbPz009, DcContractList dcContractList) throws IOException {
// 获取合同详情
DcContract dcContract = DcOpenApi.contractDetail(dcContractList.getOrd());
if (dcContract == null || !"审批通过".equals(dcContract.getSpStatus())) {
if (dcContract == null) {
return;
}
dcContract.setOrd(dcContractList.getOrd());
......@@ -178,9 +179,17 @@ public class ServiceHGSC101 extends ServiceEPBase {
String projCode = dbPz009.getLoginPrefix() + dcContractList.getOrd();
HGSC001 dbSc001 = HGSCTools.Hgsc001.getByCode(projCode);
if (dbSc001 == null) {
this.syncDcSingleContractAdd(projCode, dcContract, dbPz009);
// 不存在,并且是"审批通过"就新增;否则不做任何操作
if ("审批通过".equals(dcContract.getSpStatus())) {
this.syncDcSingleContractAdd(projCode, dcContract, dbPz009);
}
} else {
this.syncDcSingleContractModify(projCode, dcContract);
// 存在,并且是"审批通过"就修改,否则状态修改为删除
if ("审批通过".equals(dcContract.getSpStatus())) {
this.syncDcSingleContractModify(projCode, dcContract);
} else {
this.syncDcSingleContractRemove(projCode);
}
}
}
......@@ -198,6 +207,7 @@ public class ServiceHGSC101 extends ServiceEPBase {
dbSc001.setDepName(dbPz009.getAccountName());
dbSc001.setProjCode(projCode);
dbSc001.setProjName(dcContract.getTitle());
dbSc001.setApprovalStatus(HGConstant.ApprovalStatus.YS);
// 设计来源
dbSc001.setProjectSource(getProjectSource(dcContract.getDesignSource()));
dbSc001.setContractNo(dcContract.getHtid());
......@@ -222,12 +232,25 @@ public class ServiceHGSC101 extends ServiceEPBase {
updateMap.put(HGSC001.FIELD_contract_no, dcContract.getHtid());
updateMap.put(HGSC001.FIELD_proj_name, dcContract.getTitle());
updateMap.put(HGSC001.FIELD_project_source, getProjectSource(dcContract.getDesignSource()));
updateMap.put(HGSC001.FIELD_approval_status, HGConstant.ApprovalStatus.YS);
DaoUtils.update(HgScSqlConstant.HgSc001.UPDATE_PROJ_NAME, updateMap);
// 同步更新文档库
DaoUtils.update(HgWdSqlConstant.HgWd001.UPDATE_PROJECT, updateMap);
}
/**
* 删除
*
* @param projCode
*/
private void syncDcSingleContractRemove(String projCode) {
Map updateMap = new HashMap();
updateMap.put(HGSC001.FIELD_proj_code, projCode);
updateMap.put(HGSC001.FIELD_approval_status, HGConstant.ApprovalStatus.DS);
DaoUtils.update(HgScSqlConstant.HgSc001.UPDATE_APPROVAL_STATUS, updateMap);
}
/**
* 设计来源
*
* @return
......
......@@ -7,7 +7,6 @@ import com.baosight.hggp.hg.sc.constant.HgScSqlConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.EiInfoUtils;
......@@ -91,6 +90,7 @@ public class ServiceHGSC101A extends ServiceEPBase {
private void addData(HGSC001 fSc001) {
// 校验编号是否存在
fSc001.setProjCode(SequenceGenerator.getNextSequence(HGConstant.SequenceId.PROJ_NUMBER));
fSc001.setApprovalStatus(HGConstant.ApprovalStatus.YS);
DaoUtils.insert(HGSC001.INSERT, fSc001);
}
......
......@@ -432,6 +432,16 @@
CONTRACT_NO = #contractNo#,
PROJ_NAME = #projName#,
PROJECT_SOURCE = #projectSource#,
APPROVAL_STATUS = #approvalStatus#,
<include refid="SqlBase.updateRevise"/>
WHERE PROJ_CODE = #projCode#
</update>
<!-- 修改审批状态 -->
<update id="updateApprovalStatus">
UPDATE ${hggpSchema}.HGSC001
SET
APPROVAL_STATUS = #approvalStatus#,
<include refid="SqlBase.updateRevise"/>
WHERE PROJ_CODE = #projCode#
</update>
......
......@@ -70,6 +70,9 @@
<isNotEmpty prepend=" AND " property="projectSource">
project_source = #projectSource#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="approvalStatus">
APPROVAL_STATUS = #approvalStatus#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ename">
proj_name like concat('%', #ename#, '%') or proj_code like concat('%', #ename#, '%')
</isNotEmpty>
......
......@@ -24,6 +24,10 @@ public class HgWdSqlConstant {
public static final String UPDATE_PROJECT = "HGWD001.updateProject";
// 查询所以
public static final String QUERY_ALL = "HGWD001.queryAll";
// 查询子节点
public static final String QUERY_FILE_CHILD = "HGWD001.queryFileChild";
public static final String UPDATE_FILE_PATH = "HGWD001.updateFilePath";
}
/**
......
......@@ -45,6 +45,7 @@ public class HGWD001 extends DaoEPBase {
public static final String FIELD_STATUS = "status"; /* 状态*/
public static final String FIELD_REMARK = "remark"; /* 备注*/
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
public static final String FIELD_FILE_PATH = "filePath"; /* 文件路径*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -102,6 +103,7 @@ public class HGWD001 extends DaoEPBase {
private Integer status = 0; /* 状态*/
private String remark = " "; /* 备注*/
private String releaseDate = " "; /* 发布时间*/
private String filePath = " ";
/**
* initialize the metadata.
......@@ -206,7 +208,9 @@ public class HGWD001 extends DaoEPBase {
eiColumn.setDescName("发布时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH);
eiColumn.setDescName("文件路径");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -591,6 +595,14 @@ public class HGWD001 extends DaoEPBase {
public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/**
* get the value from Map.
*
......@@ -623,6 +635,7 @@ public class HGWD001 extends DaoEPBase {
setStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_STATUS)), status));
setRemark(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REMARK)), remark));
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setFilePath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH)), filePath));
}
/**
......@@ -656,6 +669,7 @@ public class HGWD001 extends DaoEPBase {
map.put(FIELD_STATUS, StringUtils.toString(status, eiMetadata.getMeta(FIELD_STATUS)));
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_FILE_PATH, StringUtils.toString(filePath, eiMetadata.getMeta(FIELD_FILE_PATH)));
return map;
}
......
......@@ -48,6 +48,7 @@ public class HGWD002 extends DaoEPBase {
public static final String FIELD_PREVIEW_NUM = "previewNum"; /* 预览次数*/
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -107,6 +108,7 @@ public class HGWD002 extends DaoEPBase {
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
private String docType = " "; /* 文件类型*/
private String changeContent = " "; /* 变更内容*/
/**
* initialize the metadata.
......@@ -218,6 +220,10 @@ public class HGWD002 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_CONTENT);
eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -635,6 +641,23 @@ public class HGWD002 extends DaoEPBase {
public void setDocType(String docType) {
this.docType = docType;
}
/**
* get the changeContent - 变更内容.
* @return the changeContent
*/
public String getChangeContent() {
return this.changeContent;
}
/**
* set the changeContent - 变更内容.
*
* @param changeContent - 变更内容
*/
public void setChangeContent(String changeContent) {
this.changeContent = changeContent;
}
/**
* get the value from Map.
*
......@@ -669,6 +692,7 @@ public class HGWD002 extends DaoEPBase {
setPreviewNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PREVIEW_NUM)), previewNum));
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
}
/**
......@@ -704,6 +728,7 @@ public class HGWD002 extends DaoEPBase {
map.put(FIELD_PREVIEW_NUM, StringUtils.toString(previewNum, eiMetadata.getMeta(FIELD_PREVIEW_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_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
return map;
}
......
......@@ -38,6 +38,8 @@ public class HGWD099 extends DaoEPBase {
public static final String FIELD_DOC_VERSION = "docVersion"; /* 文件版本号*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String FIELD_OPER_STATUS = "operStatus"; /* 是否变更 0-否 1-是*/
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_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -87,6 +89,8 @@ public class HGWD099 extends DaoEPBase {
private Integer docVersion = new Integer(0); /* 文件版本号*/
private String docType = " "; /* 文件类型*/
private Integer operStatus = new Integer(0);
private String changeContent = " "; /* 变更内容*/
private String filePath = " ";
/**
* initialize the metadata.
......@@ -178,6 +182,14 @@ public class HGWD099 extends DaoEPBase {
eiColumn = new EiColumn(FIELD_OPER_STATUS);
eiColumn.setDescName("操作状态");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_CONTENT);
eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_PATH);
eiColumn.setDescName("文件路径");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -486,6 +498,31 @@ public class HGWD099 extends DaoEPBase {
}
/**
* get the changeContent - 变更内容.
* @return the changeContent
*/
public String getChangeContent() {
return this.changeContent;
}
/**
* set the changeContent - 变更内容.
*
* @param changeContent - 变更内容
*/
public void setChangeContent(String changeContent) {
this.changeContent = changeContent;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/**
* get the value from Map.
*
* @param map - source data map
......@@ -514,6 +551,8 @@ public class HGWD099 extends DaoEPBase {
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
setOperStatus(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_OPER_STATUS)), operStatus));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setFilePath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_PATH)), filePath));
}
/**
......@@ -544,6 +583,8 @@ public class HGWD099 extends DaoEPBase {
map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
map.put(FIELD_OPER_STATUS, StringUtils.toString(operStatus, eiMetadata.getMeta(FIELD_OPER_STATUS)));
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;
}
......
......@@ -5,26 +5,29 @@ import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.DeleteFlagEnum;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.FileTools;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD001C;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -34,7 +37,11 @@ import com.baosight.iplat4j.core.resource.I18nMessages;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
......@@ -219,9 +226,6 @@ public class ServiceHGWD001 extends ServiceEPBase {
Map<?, ?> map = eiBlock.getRow(i);
HGWD099 hgwd099 = new HGWD099();
hgwd099.fromMap(map);
if (hgwd099.getOperStatus() == 0){
hgwd099.setDocVersion(hgwd099.getDocVersion() + 1);
}
hgwd099.setStatus(HgWdConstant.FileStatus.S_1);
hgwd099.setReleaseDate(DateUtils.shortDateTime());
hgwd099.setOperStatus(HgWdConstant.OperStatus.S_0);
......@@ -308,13 +312,13 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd099.setDocId(resultRow.get(HGWD099.FIELD_DOC_ID).toString());
hgwd099.setDocName(resultRow.get(HGWD099.FIELD_DOC_NAME).toString());
hgwd099.setDocType(resultRow.get(HGWD099.FIELD_DOC_TYPE).toString());
hgwd099.setChangeContent(resultRow.get(HGWD099.FIELD_CHANGE_CONTENT).toString());
hgwd099.setStatus(HgWdConstant.FileStatus.S_0);
hgwd099.setOperStatus(HgWdConstant.OperStatus.S_1);
DaoUtils.insert(HGWD099.UPDATE, hgwd099);
if (Objects.nonNull(resultRow.get("changeContent")) || resultRow.get("changeContent").toString().trim().length()>0){
HGWDTools.HgWd006.add(hgwd099, hgwd001, resultRow.get("changeContent").toString());
}
}
//获取文件下的权限人员
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId());
......@@ -434,6 +438,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
cleanBaseInfo(hgdm099);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgdm099.setBizId(hgwd001.getFileId());
hgdm099.setFilePath(hgwd001.getFilePath());
hgdm099.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
strFileName.append(hgdm099.getDocName()).append(",");
......@@ -516,6 +521,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
if (!StringUtils.isNull(result2Rows)) {
result2Rows.forEach(hgwd001 -> {
hgwd001.setParentId(parentId);
hgwd001.setFilePath(detail2Rows.get(0).getFilePath()+"/"+hgwd001.getFileName());
});
// 查询添加子节点
addNode(result2Rows);
......@@ -540,6 +546,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001s.forEach(o -> {
if (o.getParentId().equals(hgwd001.getFileId())) {
o.setParentId(fileId);
o.setFilePath(hgwd001.getFilePath()+"/"+o.getFileName());
}
});
}
......@@ -563,6 +570,7 @@ public class ServiceHGWD001 extends ServiceEPBase {
cleanBaseInfo(hgwd099);
hgwd099.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgwd099.setBizId(fileId);
hgwd099.setFilePath(hgwd001.getFilePath());
hgwd099.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.insert(HGWD099.INSERT, hgwd099);
strFileName.append(hgwd099.getDocName()).append(",");
......@@ -581,11 +589,25 @@ public class ServiceHGWD001 extends ServiceEPBase {
HGWDTools.interaction(hgwd001, strFileName.substring(0, strFileName.length() - 1));
}
/**
* 查询管理员信息
*
* @param inInfo
* @return
*/
public EiInfo queryProjectManager(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Integer isManager = HGWDTools.HgWd003.isProjectManager(queryRow.get(HGWD001.FIELD_FILE_ID).toString());
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID);
Integer isManager = HGWDTools.HgWd003.isProjectManager(fileId);
inInfo.set("isManager", isManager);
// 是否可以下载
if (StringUtils.isNotNull(fileId)) {
HGWD003 dbWd003 = HGWDTools.HgWd003.getByUser(fileId);
inInfo.set("downloadFlag", dbWd003 == null ? CommonConstant.YesNo.NO_0 : dbWd003.getDownloadFlag());
} else {
inInfo.set("downloadFlag", CommonConstant.YesNo.NO_0);
}
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
......
......@@ -4,12 +4,14 @@ import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.CodeValueTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.enums.ProjectSourceEnum;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.util.EiInfoUtils;
......@@ -249,6 +251,7 @@ public class ServiceHGWD001D extends TreeService {
Map leafMap = buildLeaf(parentId, label, text, HgWdConstant.LeafType.P);
leafMap.put("type", "-1");
leafMap.put("leafLevel", "-1");
leafMap.put("filePath", text);
results.add(leafMap);
}
// 设置叶子节点
......@@ -268,7 +271,8 @@ public class ServiceHGWD001D extends TreeService {
List<Map> results = new ArrayList();
Map queryMap = new HashMap<>();
queryMap.put("ename", ename);
queryMap.put("projectSource", parentId);
queryMap.put(HGSC001.FIELD_project_source, parentId);
queryMap.put(HGSC001.FIELD_approval_status, HGConstant.ApprovalStatus.YS);
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (isAuth && !HgWdUtils.HgWd009.isManager(userId)) {
......@@ -292,6 +296,7 @@ public class ServiceHGWD001D extends TreeService {
leafMap.put("leafLevel", "0");
leafMap.put("count", count);
leafMap.put("isAuth", isAuth ? "1" : "0");
leafMap.put("filePath", ProjectSourceEnum.getByCode(parentId).getName()+"/"+text);
results.add(leafMap);
}
// 设置叶子节点
......@@ -326,16 +331,27 @@ public class ServiceHGWD001D extends TreeService {
List<String> fileIds = dbWd001s.stream().map(HGWD001::getFileId).distinct().collect(Collectors.toList());
// 查询目录授权人数
Map<String, List<HGWD003>> dbWd003Map = HGWDTools.HgWd003.map(fileIds);
Map<String, List<HGWD099>> fWd099s = HGWDTools.HgWd099.map(fileIds);
for (HGWD001 dbWd001 : dbWd001s) {
Map leafMap = buildLeaf(parentId, dbWd001.getFileId(), dbWd001.getFileName(), HgWdConstant.LeafType.C);
// 已授权人员信息
List<HGWD003> dbWd003s = dbWd003Map == null ? null : dbWd003Map.get(dbWd001.getFileId());
int dbWd099s = fWd099s.get(dbWd001.getFileId()) == null ? 0 : fWd099s.get(dbWd001.getFileId()).size();
int count = 0;
if (dbWd003s!=null && dbWd003s.size() > 0 && dbWd099s > 0){
count = 3;
}else if (dbWd003s!=null && dbWd003s.size() > 0){
count = 2;
}else if (dbWd099s > 0){
count = 1;
}
leafMap.put("projCode", dbWd001.getProjCode());
leafMap.put("projName", dbWd001.getProjName());
leafMap.put("ename", dbWd001.getProjCode());
leafMap.put("type", dbWd001.getFileType());
leafMap.put("leafLevel", dbWd001.getLeafLevel());
leafMap.put("count", dbWd003s == null ? 0 : dbWd003s.size());
leafMap.put("count", count);
leafMap.put("filePath",dbWd001.getFilePath());
if (!isManager && isSourceAuth) {
leafMap.put("isAuth", "1");
// 从已授权的信息中查找出自己
......
......@@ -16,9 +16,7 @@ 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.xs.domain.Org;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
......@@ -69,8 +67,15 @@ public class ServiceHGWD001E extends ServiceEPBase {
@OperationLogAnnotation(operModul = "文档库",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
Map<String,String> queryMap = EiInfoUtils.getFirstRow(inInfo);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.getByCodesetMap("CODESET_CODE IN ('hggp.hgwd.fileType','app.sc.projectSource')");
HGWD001 wd001 = (HGWD001) this.dao.get(HGWD001.QUERY, HGWD001.FIELD_FILE_ID, queryMap.get(HGWD001.FIELD_PARENT_ID));
HGSC001 hgsc001 = new HGSC001();
if (wd001 == null){
hgsc001 = HGSCTools.Hgsc001.queryByCode(queryMap.get(HGWD001.FIELD_PARENT_ID));
}
Map<String, List<Map<String, Object>>> edcm01Map = edcm01List.stream().collect(Collectors.groupingBy(map -> map.get("codesetCode").toString(), Collectors.toList()));
List<HGWD001> hgwd001s = new ArrayList<>();
// 写入数据
for (Map resultRow : resultRows) {
......@@ -79,10 +84,17 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
// 设置项目信息
this.setProjectInfo(hgwd001);
if (wd001 == null){
String filePath = setFilePath(hgsc001,edcm01Map.get("app.sc.projectSource"));
hgwd001.setFilePath(filePath+"/"+hgwd001.getFileName());
}else {
hgwd001.setFilePath(wd001.getFilePath()+"/"+hgwd001.getFileName());
}
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
} else {
this.modify(hgwd001,edcm01List);
List<Map<String, Object>> mapList = edcm01Map.get("hggp.hgwd.fileType");
this.modify(hgwd001,mapList);
}
hgwd001s.add(hgwd001);
}
......@@ -132,7 +144,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
......@@ -165,5 +177,9 @@ public class ServiceHGWD001E extends ServiceEPBase {
fWd001.setProjName(dbSc001.getProjName());
fWd001.setProjectSource(dbSc001.getProjectSource());
}
private String setFilePath(HGSC001 hgsc001,List<Map<String, Object>> edcm01List) {
String filePath = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgsc001.getProjectSource())).findAny().get().get("itemCname").toString();
return filePath+"/"+hgsc001.getProjName();
}
}
......@@ -8,12 +8,17 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.sc.domain.HGSC001;
import com.baosight.hggp.hg.sc.tools.HGSCTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.Org;
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.iplat4j.core.ei.EiConstant;
......@@ -21,10 +26,7 @@ import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -61,17 +63,32 @@ public class ServiceHGWD001F extends ServiceEPBase {
@OperationLogAnnotation(operModul = "文档库",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
Map<String,String> queryMap = EiInfoUtils.getFirstRow(inInfo);
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.getByCodesetMap("CODESET_CODE IN ('hggp.hgwd.fileType','app.sc.projectSource')");
HGWD001 wd001 = (HGWD001) this.dao.get(HGWD001.QUERY, HGWD001.FIELD_FILE_ID, inInfo.getString(HGWD001.FIELD_PARENT_ID));
HGSC001 hgsc001 = new HGSC001();
if (wd001 == null){
hgsc001 = HGSCTools.Hgsc001.queryByCode(queryMap.get(HGWD001.FIELD_PROJ_CODE));
}
Map<String, List<Map<String, Object>>> edcm01Map = edcm01List.stream().collect(Collectors.groupingBy(map -> map.get("codesetCode").toString(), Collectors.toList()));
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(resultRow);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
if (wd001 == null){
String filePath = setFilePath(hgsc001,edcm01Map.get("app.sc.projectSource"));
hgwd001.setFilePath(filePath+"/"+hgwd001.getFileName());
}else {
hgwd001.setFilePath(wd001.getFilePath()+"/"+hgwd001.getFileName());
}
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
} else {
this.modify(hgwd001,edcm01List);
String wd001FilePath = wd001 == null? setFilePath(hgsc001,edcm01Map.get("app.sc.projectSource")):wd001.getFilePath();
this.modify(hgwd001,wd001FilePath,edcm01Map);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
......@@ -103,9 +120,12 @@ public class ServiceHGWD001F extends ServiceEPBase {
/**
* 修改操作
* @param hgwd001 文件信息
* @param wd001FilePath 文件路径
* @param edcm01Map 小代碼
*/
public void modify(HGWD001 hgwd001,List<Map<String, Object>> edcm01List) {
HGWD001 wd001 =HGWDTools.HgWd001.get(hgwd001.getId());
public void modify(HGWD001 hgwd001,String wd001FilePath,Map<String, List<Map<String, Object>>> edcm01Map) {
HGWD001 wd001out =HGWDTools.HgWd001.get(hgwd001.getId());
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
......@@ -113,14 +133,14 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPDATE.getCode());
hgwd001a.setMatId(hgwd001.getId());
if (wd001 != null && !wd001.getFileName().equals(hgwd001.getFileName())){
if (wd001out != null && !wd001out.getFileName().equals(hgwd001.getFileName())){
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeStart(wd001out.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01List.stream().filter(map -> map.get("itemCode").equals(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
}else if (wd001out != null && !wd001out.getFileType().equals(hgwd001.getFileType())){
List<Map> fileType1 = edcm01Map.get("hggp.hgwd.fileType").stream().filter(map -> map.get("itemCode").equals(wd001out.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01Map.get("hggp.hgwd.fileType").stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
......@@ -128,5 +148,40 @@ public class ServiceHGWD001F extends ServiceEPBase {
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
updateFilePath(hgwd001,wd001out,wd001FilePath);
}
public void updateFilePath(HGWD001 hgwd001,HGWD001 wd001out,String wd001FilePath) {
List<Map> childList = HGWDTools.HgWd001.queryFileChild(hgwd001.getFileId());
List<String> childFileIdList = Optional.ofNullable(childList).orElse(new ArrayList<>()).stream()
.filter(map -> !hgwd001.getFileId().equals(map.get(HGWD001.FIELD_FILE_ID)))
.map(map -> map.get(HGWD001.FIELD_FILE_ID).toString()).collect(Collectors.toList());
List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD",childFileIdList);
Map<String, List<HGWD099>> listMap = hgwd099List.stream().collect(Collectors.groupingBy(HGWD099::getBizId,Collectors.toList()));
int end = wd001out.getFilePath().length()+1;
if (childList != null && childList.size() > 0) {
for (Map child : childList) {
HGWD001 childOut = new HGWD001();
childOut.fromMap(child);
if (!hgwd001.getFileId().equals(childOut.getFileId())){
String filePathEnd = child.get(HGWD001.FIELD_FILE_PATH).toString().substring(end);
StringBuffer filePath = new StringBuffer();
filePath.append(wd001FilePath).append("/").append(hgwd001.getFileName()).append("/").append(filePathEnd);
childOut.setFilePath(filePath.toString());
DaoUtils.update(HgWdSqlConstant.HgWd001.UPDATE_FILE_PATH, childOut);
if (listMap.containsKey(childOut.getFileId())){
for (HGWD099 hgwd099: listMap.get(childOut.getFileId())) {
hgwd099.setFilePath(filePath.toString());
DaoUtils.update(HGWD099.UPDATE, hgwd099);
}
}
}
}
}
}
private String setFilePath(HGSC001 hgsc001,List<Map<String, Object>> edcm01List) {
String filePath = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgsc001.getProjectSource())).findAny().get().get("itemCname").toString();
return filePath+"/"+hgsc001.getProjName();
}
}
......@@ -135,6 +135,12 @@ public class ServiceHGWD002 extends ServiceBase {
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]);
......
......@@ -3,21 +3,18 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.ObjectUtils;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -25,8 +22,10 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.io.IOException;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
/**
......@@ -64,8 +63,13 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_PARENT_ID).toString())){
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
if (ObjectUtils.isNotBlank(queryRow.get(HGWD001.FIELD_PARENT_ID))){
List<Map> childList = HGWDTools.HgWd001.queryFileChild(queryRow.get(HGWD001.FIELD_PARENT_ID).toString());
List<String> childFileIdList = Optional.ofNullable(childList).orElse(new ArrayList<>()).stream().map(map -> map.get(HGWD001.FIELD_FILE_ID).toString()).collect(Collectors.toList());
queryRow.put("bizIds",childFileIdList);
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());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......
......@@ -26,7 +26,8 @@
DOC_VERSION as "docVersion", <!-- 文件版本号 -->
STATUS as "status", <!-- 状态 -->
REMARK as "remark", <!-- 备注 -->
RELEASE_DATE as "releaseDate" <!-- 发布时间 -->
RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
FILE_PATH as "filePath" <!-- 文件路径 -->
</sql>
<sql id="condition">
......@@ -93,6 +94,9 @@
<isNotEmpty prepend=" AND " property="releaseDate">
RELEASE_DATE = #releaseDate#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath">
FILE_PATH = #filePath#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ename">
PROJ_NAME like concat('%', #ename#, '%') or PROJ_CODE like concat('%', #ename#, '%')
</isNotEmpty>
......@@ -209,12 +213,13 @@
DOC_VERSION, <!-- 文件版本号 -->
STATUS, <!-- 状态 -->
REMARK, <!-- 备注 -->
RELEASE_DATE
RELEASE_DATE,
FILE_PATH
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #projectSource#,
#leafLevel#, #parentId#, #fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate#
#docVersion#, #status#, #remark#, #releaseDate#, #filePath#
)
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001
......@@ -236,6 +241,7 @@
STATUS = #status#, <!-- 状态 -->
REMARK = #remark#, <!-- 备注 -->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
FILE_PATH = #filePath#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
......@@ -259,6 +265,14 @@
WHERE ID = #id#
</update>
<update id="updateFilePath">
UPDATE ${hggpSchema}.HGWD001
SET
FILE_PATH = #filePath#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
<select id="queryTree" resultClass="java.util.HashMap">
SELECT
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
......@@ -270,7 +284,8 @@
PARENT_ID as "pId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName" <!-- 文件名称 -->
FILE_NAME as "fileName", <!-- 文件名称 -->
FILE_PATH as "filePath"
FROM ${hggpSchema}.HGWD001
WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
......@@ -309,7 +324,8 @@
FILE_TYPE as "type",
PARENT_ID as "parentId",
DELETE_FLAG as "isDeleted",
LEAF_LEVEL as "leafLevel"
LEAF_LEVEL as "leafLevel",
FILE_PATH as "filePath"
FROM ${hggpSchema}.HGWD001
WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery">
......@@ -331,7 +347,11 @@
<!--档库所有子节点树查询-->
<select id="queryFileChild" resultClass="java.util.HashMap">
SELECT
T3.ID as "id", T3.FILE_ID AS "fileId",T3.FILE_TYPE AS "fileType", T3.PARENT_ID as "parentId"
T3.ID as "id",
T3.FILE_ID AS "fileId",
T3.FILE_TYPE AS "fileType",
T3.PARENT_ID as "parentId",
T3.FILE_PATH as "filePath"
FROM (
SELECT
@CODES AS CODES,
......@@ -354,7 +374,7 @@
${hggpSchema}.HGWD001 T3
WHERE T3.DELETE_FLAG = 0
AND FIND_IN_SET(T3.FILE_ID, T2.CODES)
ORDER BY T3.FILE_ID ASC
ORDER BY T3.ID ASC
</select>
<!-- 修改项目信息 -->
......@@ -375,7 +395,8 @@
PARENT_ID as "parentId", <!--父级ID-->
FILE_ID as "fileId", <!-- 文件ID -->
FILE_TYPE as "fileType", <!-- 文件类型 -->
FILE_NAME as "fileName" <!-- 文件名称 -->
FILE_NAME as "fileName", <!-- 文件名称 -->
FILE_PATH as "filePath"
from (
SELECT
PROJ_CODE, <!-- 项目编码 -->
......@@ -384,7 +405,8 @@
PROJ_CODE as "PARENT_ID", <!--父级ID-->
'' as "FILE_ID", <!-- 文件ID -->
'' as "FILE_TYPE", <!-- 文件类型 -->
'' as "FILE_NAME" <!-- 文件名称 -->
'' as "FILE_NAME", <!-- 文件名称 -->
project_source as "FILE_PATH"
FROM ${hggpSchema}.HGSC001 T WHERE 1=1
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
......@@ -411,7 +433,8 @@
PARENT_ID, <!--父级ID-->
FILE_ID, <!-- 文件ID -->
FILE_TYPE, <!-- 文件类型 -->
FILE_NAME <!-- 文件名称 -->
FILE_NAME, <!-- 文件名称 -->
FILE_PATH
FROM ${hggpSchema}.HGWD001 T WHERE 1=1
<include refid="condition"/>
) a
......
......@@ -20,6 +20,7 @@
B.DOC_TYPE as "docType", <!-- 文件类型 -->
B.PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
B.DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
B.CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
B.CREATED_BY as "createdBy", <!-- 创建人 -->
B.CREATED_NAME as "createdName", <!-- 创建人名称 -->
B.CREATED_TIME as "createdTime", <!-- 创建时间 -->
......
......@@ -22,7 +22,9 @@
DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
DOC_VERSION as "docVersion", <!-- 文件版本号 -->
RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
OPER_STATUS as "operStatus"
OPER_STATUS as "operStatus",
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
FILE_PATH as "filePath"
</sql>
<sql id="condition">
......@@ -36,9 +38,9 @@
<isNotEmpty prepend=" AND " property="bizId">
BIZ_ID = #bizId#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="fileId">
BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #fileId# )
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="bizIds">
BIZ_ID IN <iterate close=")" open="(" conjunction="," property="bizIds">#bizIds[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
......@@ -69,6 +71,9 @@
<isNotEmpty prepend=" AND " property="updatedTime">
LEFT(UPDATED_TIME,8) = replace(#updatedTime#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="filePath">
FILE_PATH like concat('%',#filePath#,'%')
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -139,11 +144,14 @@
STATUS,
DOC_VERSION,
RELEASE_DATE,
OPER_STATUS
OPER_STATUS,
CHANGE_CONTENT,
FILE_PATH
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#, #operStatus#
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#,
#docVersion#, #releaseDate#, #operStatus#, #changeContent#, #filePath#
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD099
</selectKey>
......@@ -177,9 +185,10 @@
DOC_NAME = #docName#, <!-- 文件名称 -->
DOC_TYPE = #docType#, <!-- 文件类型 -->
STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
OPER_STATUS = #operStatus#,
CHANGE_CONTENT = #changeContent#,
FILE_PATH = #filePath#,
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
......@@ -200,7 +209,7 @@
UPDATE ${hggpSchema}.HGWD099
SET
RELEASE_DATE = #releaseDate#, <!--发布时间-->
DOC_VERSION = #docVersion#, <!--版本号-->
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
STATUS = #status#, <!-- 状态 -->
OPER_STATUS = #operStatus#,
<include refid="SqlBase.updateRevise"/>
......
......@@ -215,6 +215,20 @@ public class HGWDTools {
}
return results;
}
/**
* 查询文件子节点
*
* @param parentId
* @return
*/
public static List<Map> queryFileChild(String parentId) {
AssertUtils.isEmpty(parentId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put("parentId", parentId);
List<Map> results = DaoBase.getInstance().query(HgWdSqlConstant.HgWd001.QUERY_FILE_CHILD, queryMap);
return CollectionUtils.isEmpty(results) ? null : results;
}
}
......@@ -444,6 +458,18 @@ public class HGWDTools {
);
return results;
}
/**
* @param fileIds
* @return
*/
public static Map<String, List<HGWD099>> map(List<String> fileIds) {
List<HGWD099> hgwd099List = queryByBiz("WD",fileIds);
if (CollectionUtils.isEmpty(hgwd099List)) {
return null;
}
return hgwd099List.stream().collect(Collectors.groupingBy(HGWD099::getBizId));
}
}
/**
......
......@@ -77,20 +77,21 @@
t1.pwd_revise_date as "pwdReviseDate",
t1.pwd_revisor as "pwdRevisor",
t1.archive_flag as "archiveFlag",
t1.USER_GROUP_ENAME as "userGroupEname"
t1.USER_GROUP_ENAME as "userGroupEname",
C.ORG_CNAME as "deptName"
FROM ${platSchema}.XS_USER t1
where t1.USER_ID not in
(
SELECT
MEMBER_ID
FROM ${platSchema}.XS_USER_GROUP_MEMBER t2
where 1 = 1
<isNotEmpty prepend=" AND " property="memberType">
t2.MEMBER_TYPE = #memberType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
t2.PARENT_ID = #parentId#
</isNotEmpty>
LEFT JOIN iplat_hggp.TXSOG02 B ON t1.USER_ID = B.USER_ID
LEFT JOIN iplat_hggp.TXSOG01 C ON B.ORG_ID = C.ORG_ID
WHERE t1.USER_ID NOT IN (
SELECT MEMBER_ID
FROM ${platSchema}.XS_USER_GROUP_MEMBER t2
WHERE 1 = 1
<isNotEmpty prepend=" AND " property="memberType">
t2.MEMBER_TYPE = #memberType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
t2.PARENT_ID = #parentId#
</isNotEmpty>
)
<isNotEmpty prepend=" AND " property="loginName">
t1.login_name like ('%$loginName$%')
......@@ -101,6 +102,9 @@
<isNotEmpty prepend=" AND " property="accountCode">
t1.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deptName">
C.ORG_CNAME LIKE CONCAT('%', #deptName#, '%')
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -109,7 +113,6 @@
<isNotEmpty prepend="AND" property="sql">
$sql$
</isNotEmpty>
</select>
</sqlMap>
......@@ -116,15 +116,15 @@ function btnSaveFunc(btnNode, gridNode) {
}
let thisSettlementAmount = item['thisSettlementAmount'];
let amount = item['amount'];
let taxIncludeAmount = item['taxIncludeAmount'];
let invoiceRemainingAmount = item['invoiceRemainingAmount'];
if (!isNumber(thisSettlementAmount) && !isPositiveNumber(thisSettlementAmount)) {
message("勾选的第" + (index + 1) + "行发票总额必须是大于0的数字");
flag = false;
return false;
}
if (parseFloat(thisSettlementAmount) > parseFloat(amount)) {
message("第" + (index + 1) + "行发票总额不能大于收货金额");
if (parseFloat(thisSettlementAmount) > parseFloat(taxIncludeAmount)) {
message("第" + (index + 1) + "行发票总额不能大于含税金额");
flag = false;
return false;
}
......
......@@ -5,8 +5,7 @@ $(function () {
columns: [{
field: "operator",
template: function (model) {
let param = "'" + model.fileId + "', '" + model.docId + "', '" + model.docType + "', '"
+ model.docName + "'";
let param = "'" + model.fileId + "', '" + model.docId + "'";
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showPreview(' + param + ')" >预览</a>';
......@@ -49,11 +48,9 @@ let query = function () {
*
* @param fileId
* @param docId
* @param docType
* @param docName
*/
let showPreview = function (fileId, docId, docType, docName) {
addRecordWindow(fileId, docId, docType, docName);
let showPreview = function (fileId, docId) {
addRecordWindow(fileId, docId);
}
/**
......
......@@ -26,6 +26,10 @@
<EF:EFComboColumn ename="projectSource" cname="项目来源" enable="false" width="100" align="center">
<EF:EFCodeOption codeName="app.sc.projectSource"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="approvalStatus" cname="状态" enable="false" width="100" align="center">
<EF:EFOption label="已删除" value="0"/>
<EF:EFOption label="正常" value="2"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdBy" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
......
......@@ -122,14 +122,22 @@ $(function () {
switch (item.leafType) {
case 'P':
icon = 'fa fa-clipboard'
if (count>0){
if (count == 2){
icon = 'fa fa-clipboard text-success'
}else if (count == 3){
icon = 'fa fa-clipboard text-primary'
}else if (count == 1){
icon = 'fa fa-clipboard text-danger'
}
break;
case 'C':
icon = 'fa fa-folder'
if (count>0){
if (count == 2){
icon = 'fa fa-folder text-success'
}else if (count == 3){
icon = 'fa fa-folder text-primary'
}else if (count == 1){
icon = 'fa fa-folder text-danger'
}
break;
}
......@@ -274,6 +282,7 @@ $(function () {
$("#edit").on("click", () => {
const orgId = $("#inqu_status-0-parentId").val();
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.parentId;
let projCode = $("#inqu_status-0-projCode").val();
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
......@@ -285,7 +294,7 @@ $(function () {
message2("提示", "项目无法编辑!");
return
}
let params = "&inqu_status-0-fileId=" + orgId +"&inqu_status-0-projCode="+projCode;
let params = "&inqu_status-0-fileId=" + orgId +"&inqu_status-0-projCode="+projCode+"&parentId="+parentId;
JSColorbox.open({
href: "HGWD001F?methodName=initLoad" + params,
title: "<div style='text-align: center;'>编辑文件</div>",
......@@ -381,6 +390,7 @@ $(function () {
leafLevel: '',
leafType: '',
isAuth: '1',
filePath: '',
},
// expandLevel:1,
/**
......@@ -482,10 +492,9 @@ $(function () {
field: "operator",
readonly: true,
template: function (model) {
let param = "'" + model.docId + "', '" + model.docType + "', '" + model.docName + "'";
let template = "";
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showPreview(' + param + ')" >预览</a>';
+ 'onclick="showPreview(\'' + model.docId + '\')" >预览</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="changeFile(\'' + model.docId + '\',\'' + model.bizId
+ '\')" target="_blank">变更</a>';
......@@ -522,7 +531,7 @@ $(function () {
query: function (e) {
let inEiInfo = new EiInfo();
let fileId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
inEiInfo.set("inqu_status2-0-parentId", fileId);
inEiInfo.set("inqu_status2-0-fileId", fileId);
return inEiInfo;
}
},
......@@ -699,6 +708,7 @@ let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel = leafLevel;
IPLATUI.EFTree.categoryTree.selectTreeNode.leafType = nodeData.leafType;
IPLATUI.EFTree.categoryTree.selectTreeNode.isAuth = nodeData.isAuth;
IPLATUI.EFTree.categoryTree.selectTreeNode.filePath = nodeData.filePath;
$("[name = 'inqu_status-0-parentId']").val(nodeData.label);
$("[name = 'inqu_status-0-fileId']").val(nodeData.label);
$("[name = 'inqu_status-0-leafLevel']").val(leafLevel);
......@@ -786,6 +796,7 @@ function uploadFileCallback(data) {
inEiInfo.set("result-0-ndocId", data.ndocId);
inEiInfo.set("inqu_status-0-fileId", data.bizId);
inEiInfo.set("result-0-changeContent", data.changeContent);
inEiInfo.set("result-0-filePath", IPLATUI.EFTree.categoryTree.selectTreeNode.filePath);
let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001";
let methodName = data.operType == "add" ? "insert" : "updateFile";
......@@ -1054,12 +1065,10 @@ let preview = function () {
* 预览
*
* @param docId
* @param docType
* @param docName
*/
let showPreview = function (docId, docType, docName) {
let showPreview = function (docId) {
let fileId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
addRecordWindow(fileId, docId, docType, docName);
addRecordWindow(fileId, docId);
}
/**
......@@ -1068,6 +1077,12 @@ let showPreview = function (docId, docType, docName) {
* @param parentId
*/
let isProjectManager = function (parentId) {
CommonUtils.hideButton("RELEASE");
CommonUtils.hideButton("COPY_PROT_FILE");
CommonUtils.hideButton("COPY_FILE");
CommonUtils.hideButton("UPLOAD_FILE");
CommonUtils.hideButton("PREVIEW");
CommonUtils.hideButton("BATCH_DOWNLOAD");
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
EiCommunicator.send("HGWD001", "queryProjectManager", inEiInfo, {
......@@ -1076,23 +1091,20 @@ let isProjectManager = function (parentId) {
return;
}
let isManager = ei.extAttr.isManager;
let downloadFlag = ei.extAttr.downloadFlag;
// 1-管理员,2-项目经理,3-设计人
if (isManager === 1 || isManager === 2 || isManager === 3) {
if (isManager !== 1 && downloadFlag !== 1) {
$("#BATCH_DOWNLOAD").attr("disabled", true);
}
if (isManager === 1 || isManager === 2) {
CommonUtils.showButton("RELEASE");
} else {
CommonUtils.hideButton("RELEASE");
}
CommonUtils.showButton("COPY_PROT_FILE");
CommonUtils.showButton("BATCH_DOWNLOAD");
CommonUtils.showButton("UPLOAD_FILE");
CommonUtils.showButton("COPY_FILE");
CommonUtils.showButton("PREVIEW");
} else {
CommonUtils.showButton("RELEASE");
CommonUtils.showButton("UPLOAD_FILE");
CommonUtils.showButton("COPY_FILE");
CommonUtils.showButton("PREVIEW");
CommonUtils.showButton("COPY_PROT_FILE");
CommonUtils.showButton("BATCH_DOWNLOAD");
}
}
}, {async: false})
......
......@@ -74,6 +74,7 @@
startName="updateDateFrom" endName="updateDateTo" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan>
<EF:EFInput cname="文件路径" ename="filePath" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
......@@ -84,6 +85,8 @@
<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="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:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"
defaultValue="0" hidden="false">
......@@ -130,6 +133,7 @@
queryMethod="query1">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="filePath" cname="文件路径" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......@@ -162,6 +166,7 @@
<EF:EFGrid blockId="detail2" autoDraw="override" autoBind="false" isFloat="true" checkMode="single" queryMethod="queryDetail2">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="filePath" cname="文件路径" hidden="true"/>
<%--<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......@@ -182,6 +187,7 @@
<EF:EFGrid blockId="result2" autoDraw="override" autoBind="false" isFloat="true" checkMode="row " queryMethod="query2">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFColumn ename="filePath" cname="文件路径" hidden="true"/>
<%--<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
......
......@@ -4,25 +4,27 @@ $(function () {
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 500,
pageSizes: [20, 50, 100, 250, 500],
},
columns: [{
field: "projCode",
title: "所属项目",
template: function (dataItem) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['textField'];
}
}
return dataItem["projCode"];
}
}, {
columns: [
{
field: "projCode",
title: "所属项目",
template: function (dataItem) {
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]['valueField'] === dataItem['projCode']) {
dataItem['projName'] = projCodeBox[i]['textField']
return projCodeBox[i]['textField'];
}
}
return dataItem["projCode"];
}
},
{
field:"fileName",
editor: function (container, options) {
var grid = container.closest(".k-grid").data("kendoGrid");
......
......@@ -136,7 +136,7 @@ let save = function (btnNode) {
var status = e.status;
if (status !== -1) {
let fileId = $("#inqu_status-0-fileId").val();
parent.JSColorbox.setValueCallback(fileId);
parent.JSColorbox.setValueCallback();
}
}
);
......
......@@ -20,7 +20,7 @@
<EF:EFPage title="文档库">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="上级组织编码" blockId="inqu_status" ename="parentId" row="0" type="hidden"/>
<EF:EFInput cname="上级组织编码" ename="parentId" type="hidden"/>
<EF:EFInput cname="组织编码" blockId="inqu_status" ename="fileId" row="0" type="hidden"/>
<EF:EFInput cname="项目代码" blockId="inqu_status" ename="projCode" row="0" type="hidden"/>
<EF:EFInput cname="层级" blockId="inqu_status" ename="leafLevel" row="0" type="hidden"/>
......@@ -34,6 +34,7 @@
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row" showCount="true" height="73vh">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="filePath" cname="文件路径" hidden="true"/>
<%--<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
......
......@@ -58,17 +58,14 @@ let save = function () {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
});
}
});
JSUtils.submitGridsData("result", "HGWD003", "save", true,
function (e) {
var status = e.status;
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
/**
......@@ -115,18 +112,14 @@ let removeUser = function () {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"取消授权用户\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "removeUser",
true,function (e) {
var status = e.status;
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
});
JSUtils.submitGridsData("result", "HGWD003", "removeUser",
true, function (e) {
var status = e.status;
if (status !== -1) {
parent.JSColorbox.setValueCallback();
}
}
);
}
/**
......
......@@ -154,10 +154,9 @@ $(function () {
field: "operator",
title: "操作",
template: function (model) {
let param = "'" + model.docId + "', '" + model.docType + "', '" + model.docName + "'";
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showPreview(' + param + ')" >预览</a>';
+ 'onclick="showPreview(\'' + model.docId + '\')" >预览</a>';
return template;
}
}, {
......@@ -320,16 +319,16 @@ let showAuthButton = function () {
// C:目录
let leafType = IPLATUI.EFTree.docTree.selectTreeNode.leafLevel;
if (leafType && leafType > 0) {
$("#PREVIEW").show();
CommonUtils.showButton("PREVIEW");
} else {
$("#PREVIEW").hide();
CommonUtils.hideButton("PREVIEW");
}
// 是否可以下载
let downloadFlag = IPLATUI.EFTree.docTree.selectTreeNode.downloadFlag;
if (downloadFlag === "1") {
$("#DOWNLOAD").show();
$("#DOWNLOAD").attr("disabled", false);
} else {
$("#DOWNLOAD").hide();
$("#DOWNLOAD").attr("disabled", true);
}
}
......@@ -345,10 +344,8 @@ let preview = function () {
* 预览
*
* @param docId
* @param docType
* @param docName
*/
let showPreview = function (docId, docType, docName) {
let showPreview = function (docId) {
let fileId = IPLATUI.EFTree.docTree.selectTreeNode.fileId;
addRecordWindow(fileId, docId, docType, docName);
addRecordWindow(fileId, docId);
}
......@@ -54,6 +54,7 @@
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" sort="true"/>
<EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center" sort="true"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
<EF:EFColumn ename="changeContent" cname="变更内容" enable="false" width="200" align="center" sort="true"/>
<EF:EFColumn ename="updatedTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true"
required="false" enable="false" sort="true"/>
......
......@@ -15,7 +15,7 @@ $(function () {
IPLATUI.EFTree.docTree.selectNode.leaf = nodeData.leaf;
IPLATUI.EFTree.docTree.selectNode.leafType = leafType;
// 添加预览记录
add(label, leafType, nodeData.docType, nodeData.text);
add(label, leafType);
},
template: function (node) {
var item = node.item;
......@@ -93,12 +93,10 @@ function expandTreeNode(tree, node) {
/**
* 预览
*
* @param label docId
* @param docId docId
* @param leafType 节点类型:C=目录,F=文件
* @param docType
* @param docName
*/
function add(docId, leafType, docType, docName) {
function add(docId, leafType) {
if (isBlank(leafType) || isBlank(docId)) {
message("文件类型或ID不能为空");
return;
......@@ -109,7 +107,7 @@ function add(docId, leafType, docType, docName) {
return;
}
let fileId = $("#inqu_status-0-fileId").val()
addRecord(fileId, docId, docType, docName);
addRecord(fileId, docId);
}
......@@ -3,13 +3,11 @@
*
* @param fileId
* @param docId
* @param docType
* @param docName
*/
function addRecordWindow(fileId, docId, docType, docName) {
function addRecordWindow(fileId, docId) {
$("#previewFile").data("kendoWindow").center();
$("#previewFile").data("kendoWindow").open();
addRecord(fileId, docId, docType, docName);
addRecord(fileId, docId);
}
/**
......@@ -17,9 +15,8 @@ function addRecordWindow(fileId, docId, docType, docName) {
*
* @param fileId
* @param docId
* @param docType
*/
function addRecord(fileId, docId, docType, docName) {
function addRecord(fileId, docId) {
if (isBlank(docId)) {
message("附件类型或ID不能为空");
return;
......@@ -34,9 +31,7 @@ function addRecord(fileId, docId, docType, docName) {
onSuccess: function (res) {
if (res.getStatus() >= 0) {
try {
let url = res.extAttr.url;
let docType = res.extAttr.docType;
previewFile(url, docType);
previewFile(res.extAttr.url, res.extAttr.docType);
} catch (e) {
}
} else {
......@@ -64,6 +59,8 @@ function previewFile(url, docType) {
previewXml(url);
} else if (isWord(docType)) {
previewDocx(url);
} else if (isPdf(docType)) {
previewFrame(url);
} else {
previewOnline(url);
}
......
......@@ -38,6 +38,9 @@
<EF:EFColumn ename="docId" cname="附件ID" width="160" enable="true" readonly="false" hidden="true" align="center" required="false"/>
<EF:EFColumn ename="docName" cname="附件名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="changeContent" cname="变更内容" width="200" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn cname="变更人" ename="createdName" enable="false" align="center"/>
<EF:EFColumn cname="变更时间" ename="createdTime" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
......
......@@ -305,33 +305,31 @@
</EF:EFTab>
</EF:EFWindow>
<EF:EFWindow id="userWindow" width="58%" height="75%" top="100px" left="280px">
<EF:EFWindow id="userWindow" width="78%" height="75%" top="100px" left="180px">
<EF:EFRegion id="inqu6" title="查询条件" type="query" efRegionShowClear="true" efRegionSave="true">
<div class="row">
<EF:EFInput type="hidden" cname="父节点ID" ename="parentId" row="0" blockId="inqu_status"
name="inqu_status-0-parentId" value=""/>
<EF:EFInput ename="inqu_status-0-loginName" cname="登录账号" placeholder="请输入登录账号"/>
<EF:EFInput ename="inqu_status-0-userName" cname="用户姓名" placeholder="请输入用户姓名"/>
<EF:EFInput ename="inqu_status-0-deptName" cname="部门名称" placeholder="请输入部门名称"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result6Region" title="资源组信息">
<EF:EFGrid blockId="result6" autoDraw="no" autoBind="false"
queryMethod="queryUserOutOfUserGroup"
>
<EF:EFColumn ename="loginName" cname="登录账号" readonly="true" style="text-align:left;"/>
<EF:EFColumn ename="userName" cname="用户姓名" style="text-align:left;" readonly="true"/>
<EF:EFComboColumn ename="gender" cname="性别" valueField="valueField" textField="textField"
columnTemplate="#=textField#" align="center" readonly="true">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" style="text-align:right;" cname="手机" data-rules="mobile_phone"
readonly="true"/>
<EF:EFColumn ename="email" cname="邮箱" data-rules="email" style="text-align:left;" readonly="true"/>
<EF:EFColumn ename="userId" cname="用户ID" readonly="false" primaryKey="true" hidden="true"/>
<EF:EFColumn ename="password" cname="用户密码" hidden="true" readonly="true"/>
</EF:EFGrid>
<EF:EFGrid blockId="result6" autoDraw="no" autoBind="false" showCount="true"
queryMethod="queryUserOutOfUserGroup">
<EF:EFColumn ename="deptName" cname="部门名称" enable="false" align="left"/>
<EF:EFColumn ename="loginName" cname="登录账号" enable="false" align="left"/>
<EF:EFColumn ename="userName" cname="用户姓名" enable="false" align="left"/>
<EF:EFComboColumn ename="gender" cname="性别" valueField="valueField" textField="textField"
columnTemplate="#=textField#" align="center" readonly="true">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" style="text-align:right;" cname="手机" data-rules="mobile_phone"
readonly="true"/>
<EF:EFColumn ename="email" cname="邮箱" data-rules="email" style="text-align:left;" readonly="true"/>
<EF:EFColumn ename="userId" cname="用户ID" readonly="false" primaryKey="true" hidden="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
......
......@@ -759,8 +759,7 @@ function loadChange(grid,e,field) {
let button = $("#" + name);
button.hide();
// 隐藏父级标签,防止按钮重叠
let parent = button.parent();
parent.css("display", "none");
button.parent().css("display", "none");
}
/**
......
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