Commit 069a1be1 by 宋祥

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

parents 0ddb76ea 30f89125
......@@ -96,7 +96,7 @@
proj_code = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
proj_name = #projName#
proj_name LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="taskCode">
task_code = #taskCode#
......
......@@ -42,6 +42,7 @@ public class HGWD001A extends DaoEPBase {
public static final String FIELD_CHANGE_END_CODE = "changeEndCode"; /* 变更后编码*/
public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
public static final String FIELD_ACCE_ID = "acceId"; /* 上级ID*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -92,6 +93,7 @@ public class HGWD001A extends DaoEPBase {
private String changeEndCode = " "; /* 变更后编码*/
private String changeEnd = " "; /* 变更后*/
private Long matId = new Long(0);
private String acceId = " ";
/**
* initialize the metadata.
......@@ -184,6 +186,10 @@ public class HGWD001A extends DaoEPBase {
eiColumn.setDescName("上级ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCE_ID);
eiColumn.setDescName("附件ID");
eiMetadata.addMeta(eiColumn);
}
......@@ -507,6 +513,14 @@ public class HGWD001A extends DaoEPBase {
this.changeEndCode = changeEndCode;
}
public String getAcceId() {
return acceId;
}
public void setAcceId(String acceId) {
this.acceId = acceId;
}
/**
* get the value from Map.
*
......@@ -536,6 +550,7 @@ public class HGWD001A extends DaoEPBase {
setChangeEndCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END_CODE)), changeEndCode));
setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
setAcceId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCE_ID)), acceId));
}
/**
......@@ -566,6 +581,7 @@ public class HGWD001A extends DaoEPBase {
map.put(FIELD_CHANGE_END_CODE, StringUtils.toString(changeEndCode, eiMetadata.getMeta(FIELD_CHANGE_END_CODE)));
map.put(FIELD_CHANGE_END, StringUtils.toString(changeEnd, eiMetadata.getMeta(FIELD_CHANGE_END)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
map.put(FIELD_ACCE_ID, StringUtils.toString(acceId, eiMetadata.getMeta(FIELD_ACCE_ID)));
return map;
}
......
......@@ -47,6 +47,7 @@ public class HGWD002 extends DaoEPBase {
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
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 COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
......@@ -105,6 +106,7 @@ public class HGWD002 extends DaoEPBase {
private String releaseDate = " "; /* 发布时间*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
private String docType = " "; /* 文件类型*/
/**
* initialize the metadata.
......@@ -213,7 +215,9 @@ public class HGWD002 extends DaoEPBase {
eiColumn.setDescName("下载次数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -623,6 +627,14 @@ public class HGWD002 extends DaoEPBase {
public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
/**
* get the value from Map.
*
......@@ -656,6 +668,7 @@ public class HGWD002 extends DaoEPBase {
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
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));
}
/**
......@@ -690,6 +703,7 @@ public class HGWD002 extends DaoEPBase {
map.put(FIELD_RELEASE_DATE, StringUtils.toString(releaseDate, eiMetadata.getMeta(FIELD_RELEASE_DATE)));
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)));
return map;
}
......
......@@ -36,6 +36,7 @@ public class HGWD099 extends DaoEPBase {
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String FIELD_RELEASE_DATE = "releaseDate"; /* 发布时间*/
public static final String FIELD_DOC_VERSION = "docVersion"; /* 文件版本号*/
public static final String FIELD_DOC_TYPE = "docType"; /* 文件类型*/
public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -61,6 +62,7 @@ public class HGWD099 extends DaoEPBase {
public static final String UPDATE = "HGWD099.update";
public static final String DELETE = "HGWD099.delete";
public static final String DELETE_DOC_ID = "HGWD099.deleteDocId";
public static final String DELETE_ID = "HGWD099.deleteId";
private Long id = new Long(0);
......@@ -82,6 +84,7 @@ public class HGWD099 extends DaoEPBase {
private Integer downloadNum = new Integer(0); /* 下载次数*/
private String releaseDate = " "; /* 发布时间*/
private Integer docVersion = new Integer(0); /* 文件版本号*/
private String docType = " "; /* 文件类型*/
/**
* initialize the metadata.
......@@ -166,6 +169,9 @@ public class HGWD099 extends DaoEPBase {
eiColumn.setDescName("发布时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("文件类型");
eiMetadata.addMeta(eiColumn);
}
/**
......@@ -457,6 +463,14 @@ public class HGWD099 extends DaoEPBase {
this.docVersion = docVersion;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
/**
* get the value from Map.
*
......@@ -484,6 +498,7 @@ public class HGWD099 extends DaoEPBase {
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
setDocVersion(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOC_VERSION)), docVersion));
setReleaseDate(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_RELEASE_DATE)), releaseDate));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
}
/**
......@@ -512,6 +527,7 @@ public class HGWD099 extends DaoEPBase {
map.put(FIELD_DOWNLOAD_NUM, StringUtils.toString(downloadNum, eiMetadata.getMeta(FIELD_DOWNLOAD_NUM)));
map.put(FIELD_DOC_VERSION, StringUtils.toString(docVersion, eiMetadata.getMeta(FIELD_DOC_VERSION)));
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)));
return map;
}
......
......@@ -56,11 +56,76 @@ public class ServiceHGWD002 extends ServiceBase {
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
builder(inInfo);
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
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 "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;
default:
if (!orderBy[i].isEmpty()){
orderByStr.append(orderBy[i]);
}else {
orderByStr.append(orderBy[i]);
}
break;
}
}
eiInfo.getBlock(EiConstant.resultBlock).set("orderBy",orderByStr);
}
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
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.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
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.HGWD099;
......@@ -16,7 +15,6 @@ import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.CommonMethod;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.StringUtil;
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;
......@@ -29,6 +27,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author LiuYang
......@@ -73,19 +72,29 @@ public class ServiceHGWD004 extends ServiceEPBase {
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
List<HGWD099> hgwd099s =DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{
put(HGWD099.FIELD_DELETE_FLAG, Arrays.asList(CommonConstant.YesNo.NO_0,CommonConstant.YesNo.YES_1));
}}
);
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.fromMap(map);
Iplat4jUtils.deleteFileByDocId(hgwd001a.getChangeStartCode()); //删除物理附件
String docId = hgwd001a.getChangeType().equals(ChangeTypeEnum.UPLOAD_UPDATE.getCode()) ? hgwd001a.getChangeStartCode() : hgwd001a.getChangeEndCode();
List<HGWD099> cw099List = hgwd099s.stream().filter(hgwd099 -> hgwd099.getDocId().equals(docId)).collect(Collectors.toList());
if (cw099List.size() <= 1){
//删除物理附件
Iplat4jUtils.deleteFileByDocId(docId);
}
//删除附件详情
DaoUtils.update(HGWD099.DELETE_DOC_ID,
new HashMap<String,String>(){{
put(HGWD099.FIELD_DOC_ID, hgwd001a.getChangeStartCode());
}}
);
DaoUtils.update(HGWD001A.DELETE, hgwd001a); //删除变更记录
if (hgwd001a.getChangeType().equals(ChangeTypeEnum.UPLOAD_DELETE.getCode())) {
DaoUtils.update(HGWD099.DELETE_ID, new HashMap<String,String>(){{put(HGWD099.FIELD_ID, hgwd001a.getAcceId());}});
}
//删除变更记录
DaoUtils.update(HGWD001A.DELETE, hgwd001a);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
......
......@@ -3,12 +3,17 @@ 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;
......@@ -18,11 +23,11 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
......@@ -84,6 +89,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
//项目文件
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
......@@ -101,6 +107,8 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
interaction(hgwd001,hgdm099.getDocName());
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
......@@ -137,6 +145,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
hgwd001a.setAcceId(hgdm099.getId().toString());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
......@@ -150,4 +159,31 @@ public class ServiceHGWD099 extends ServiceEPBase {
}
return inInfo;
}
/**
* 附件上传通知
* @param hgwd001 待变更的项目名称
* @param newName 变更后附件名称
*/
public void interaction(HGWD001 hgwd001,String newName){
try {
if (Objects.nonNull(hgwd001)){
List<HGWD003> listByFile = HGWDTools.HgWd003.listByFile(hgwd001.getFileId()); //获取文件下的权限人员
//当前登录用户是否是设计人员,是设计人员则通知项目经理
List<HGWD003> hgwd003s = listByFile.stream().filter(hgwd003 -> hgwd003.getUserId().equals(UserSessionUtils.getUserId()) && hgwd003.getIsProjectManager() == 0).collect(Collectors.toList());
if (hgwd003s.size()>0){
HGPZ009 hgpz009 = HGPZTools.HgPz009.getByCode(hgwd001.getAccountCode());
List<String> userIds = listByFile.stream().filter(hgwd003 -> hgwd003.getIsProjectManager() == 1).map(hgwd003 -> hgwd003.getUserId().replace(hgpz009.getLoginPrefix(),"")).distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(userIds)){
DcOpenApi.interactionAdd(
String.format("[%s]项目上传附件请审核发布", hgwd001.getProjName()),
String.format("上传附件名称[%s]",newName),String.join(",",userIds));
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
......@@ -232,6 +232,7 @@
RELEASE_DATE = #releaseDate#, <!--发布时间-->
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
STATUS = #status#, <!-- 状态 -->
REMARK = #remark#, <!-- 备注 -->
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
......
......@@ -89,6 +89,9 @@
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="acceId">
ACCE_ID = #acceId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
......@@ -110,11 +113,12 @@
PROJ_NAME as "projName", <!-- 项目名称 -->
CHANGE_TYPE as "changeType", <!-- 变更类型 -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
CHANGE_START_CODE as "changeStartCode",
CHANGE_START_CODE as "changeStartCode",
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
MAT_ID as "matId",
ACCE_ID as "acceId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
......@@ -211,47 +215,47 @@
CHANGE_START, <!-- 变更前 -->
CHANGE_END_CODE,
CHANGE_END, <!-- 变更后 -->
MAT_ID
MAT_ID,
ACCE_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#,
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#,#matId#)
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#, #matId#, #acceId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGWD001A WHERE
ID = #id#
DELETE FROM ${hggpSchema}.HGWD001A WHERE ID = #id#
</delete>
<delete id="deleteMatId">
DELETE FROM ${hggpSchema}.HGWD001A WHERE
MAT_ID = #matId#
DELETE FROM ${hggpSchema}.HGWD001A WHERE MAT_ID = #matId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD001A
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CHANGE_TYPE = #changeType#, <!-- 变更类型 -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
CHANGE_START_CODE = #changeStartCode#,
CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END_CODE as #changeEndCode#,
CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId#
WHERE
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CHANGE_TYPE = #changeType#, <!-- 变更类型 -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
CHANGE_START_CODE = #changeStartCode#,
CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END_CODE as #changeEndCode#,
CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId#,
ACCE_ID = #acceId#
WHERE
ID = #id#
</update>
......@@ -278,7 +282,8 @@
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
MAT_ID as "matId",
ACCE_ID as "acceId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1 and CHANGE_TYPE IN ('uploadUpdate','uploadDelete')
<include refid="BaseCondition.createdTimeCondition"/>
<include refid="condition" />
......
......@@ -17,8 +17,12 @@
B.RELEASE_DATE as "releaseDate", <!-- 发布时间 -->
B.DOC_ID as "docId", <!-- 文件号 -->
B.DOC_NAME as "docName", <!-- 文件附件名称 -->
B.DOC_TYPE as "docType", <!-- 文件类型 -->
B.PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
B.DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
B.DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
B.CREATED_BY as "createdBy", <!-- 创建人 -->
B.CREATED_NAME as "createdName", <!-- 创建人名称 -->
B.CREATED_TIME as "createdTime" <!-- 创建时间 -->
</sql>
<sql id="condition">
......@@ -56,6 +60,12 @@
<isNotEmpty prepend=" AND " property="parentId">
B.BIZ_ID IN (select FILE_ID from ${hggpSchema}.hgwd003 where USER_ID = #userId# and FILE_ID = #parentId# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
LEFT(B.CREATED_TIME,8) = replace(#createdTime#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
B.DOC_TYPE = #docType#
</isNotEmpty>
</sql>
<sql id="orderBy">
......
......@@ -16,6 +16,7 @@
BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName", <!-- 文件名称 -->
DOC_TYPE as "docType", <!-- 文件类型 -->
STATUS as "status",
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum", <!-- 下载次数 -->
......@@ -24,7 +25,6 @@
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="id">
ID = #id#
......@@ -41,6 +41,9 @@
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docType">
DOC_TYPE = #docType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="status">
STATUS = #status#
</isNotEmpty>
......@@ -53,6 +56,12 @@
<isNotEmpty prepend=" AND " property="parentId">
BIZ_ID = #parentId#
</isNotEmpty>
<isEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = 0
</isEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG in <iterate close=")" open="(" conjunction="," property="deleteFlag">#deleteFlag[]#</iterate>
</isNotEmpty>
</sql>
<sql id="customCondition">
......@@ -107,12 +116,13 @@
BIZ_ID, <!-- 业务ID -->
DOC_ID, <!-- 文件ID -->
DOC_NAME, <!-- 文件名称 -->
DOC_TYPE, <!-- 文件名称 -->
STATUS,
DOC_VERSION,
RELEASE_DATE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #status#, #docVersion#, #releaseDate#
#deleteFlag#, #bizType#, #bizId#, #docId#, #docName#, #docType#, #status#, #docVersion#, #releaseDate#
)
</insert>
......@@ -132,11 +142,16 @@
DELETE FROM ${hggpSchema}.HGWD099 WHERE DOC_ID = #docId#
</delete>
<delete id="deleteId">
DELETE FROM ${hggpSchema}.HGWD099 WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD099
SET
DOC_ID = #docId#, <!-- 文件ID -->
DOC_NAME = #docName#, <!-- 文件名称 -->
DOC_TYPE = #docType#, <!-- 文件类型 -->
STATUS = #status#,
DOC_VERSION = DOC_VERSION + 1, <!--版本号-->
RELEASE_DATE = #releaseDate#, <!--发布时间-->
......
......@@ -6,7 +6,7 @@ $(function () {
const init = () => {
$("#HGWD001").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__")
setTimeout(() => {
setTimeout(() => {
resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
......@@ -15,6 +15,9 @@ $(function () {
$("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1);
});
$("#QUERY1").on("click", function (e) {
result1Grid.dataSource.page(1);
});
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
......@@ -89,7 +92,6 @@ $(function () {
}
init();
$("#QUERY").on("click", query);
IPLATUI.EFTree = {
"categoryTree": {
select: function (e) {
......@@ -471,9 +473,53 @@ $(function () {
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
//发布
$("#RELEASE").click("click",updateRelease);
$("#RELEASE").click("click",function () {
var rows = resultGrid.getCheckedRows();
let flat = 1;
if (rows.length == 0) {
message("请先勾选要发布的数据!");
return;
}
$.each(rows, function (i, row){
if (row.status == 1){
message("选中的第"+(i+1)+"行\"已发布\",不能重复发布!");
flat = 0;
return;
}
})
if (flat){
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
//inEiInfo.set("inqu_status-0-isProjectManager", "1");
//inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator.send("HGWD003", "query", inEiInfo, {
onSuccess(ei) {
if (!isBlank(ei.getBlock("result"))){
let rows = ei.getBlock("result").getMappedRows();
if (rows.length <= 1){
message("文件未分配人员,请先分配人员!");
return;
}else {
$("#releaseWindow").data("kendoWindow").center()
$("#releaseWindow").data("kendoWindow").open();
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
});
//变更记录
$("#CHANGE_RECORD").on("click", changeResord);
// 复制附件
$("#COPY_FILE").on("click", copyFile);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
......@@ -494,6 +540,13 @@ $(function () {
}
}
],
},
result1:{
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
}
}
};
......@@ -501,6 +554,9 @@ $(function () {
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
$("#SAVE1").on("click", saveFunc);
//确认发布
$("#confirmRelease").on("click", updateRelease);
});
let query = function () {
......@@ -862,6 +918,7 @@ function uploadFileCallback(data) {
inEiInfo.set("result-0-bizId", data.bizId);
inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-docName", data.docName);
inEiInfo.set("result-0-docType", data.docType);
inEiInfo.set("result-0-bizType", data.bizType);
inEiInfo.set("result-0-ndocId", data.ndocId);
let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001";
......@@ -910,11 +967,18 @@ function updateRelease() {
message("请选择数据");
return;
}
let changeContent = $("#inqu_status-0-changeContent").val();
if (isBlank(changeContent)){
message("请输入变更内容");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"));
inEiInfo.set("inqu_status-0-changeContent", changeContent);
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
$("#releaseWindow").data("kendoWindow").close()
NotificationUtil(response.msg);
query();
} else {
......@@ -935,16 +999,41 @@ function updateRelease() {
*/
let showAuthButton = function () {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
// C:目录
if (leafType && leafType >0) {
$("#RELEASE").attr("disabled", false);
$("#UPLOAD_FILE").attr("disabled", false);
$("#CHANGE_RECORD").attr("disabled", true);
$("#COPY_FILE").attr("disabled", false);
} else {
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
$("#CHANGE_RECORD").attr("disabled", false);
$("#COPY_FILE").attr("disabled", true);
}
let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
inEiInfo.set("inqu_status-0-isProjectManager", "1");
inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator.send("HGWD003", "query", inEiInfo, {
onSuccess(ei) {
if (!isBlank(ei.getBlock("result"))){
let rows = ei.getBlock("result").getMappedRows();
if (rows.length > 0 && rows[0].isProjectManager == "1"){
$("#RELEASE").attr("disabled", false);
}else {
$("#RELEASE").attr("disabled", true);
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
......@@ -966,4 +1055,56 @@ function changeResord() {
height: "80%",
callbackName: uploadFileCallback
});
}
/**
* 复制文件
*/
let copyFile = function () {
let rowsDate = resultGrid.getCheckedRows();
if (rowsDate.length < 1){
message("请选择数据");
return;
}
let selectOrgWindow = $("#selectOrgWindow");
selectOrgWindow.data("kendoWindow").center();
selectOrgWindow.data("kendoWindow").open();
result1Grid.dataSource.page(1);
}
/**
* 复制附件
*/
function saveFunc() {
var rows = result1Grid.getCheckedRows();
if (rows.length == 0) {
message("请勾选数据文件!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据\"确认\"操作?", {
ok: function () {
JSUtils.submitGridsData("result,result1", "HGWD001", "save1", true,
function (ei) {
if (ei.getStatus() >= 0) {
try {
$("#selectOrgWindow").data("kendoWindow").close()
$("#inqu_status1-0-companyCode").val('');
$("#inqu_status1-0-projName").val('');
$("#inqu_status1-0-fileType").val('');
$("#inqu_status1-0-fileName").val('');
query();
} catch (e) {
// TODO: handle exception
}
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
});
}
})
}
\ No newline at end of file
......@@ -4,10 +4,10 @@
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
String userId = UserSession.getUserId();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<c:set var="loginName" value="<%=userId%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="文档库">
......@@ -59,6 +59,7 @@
<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="父级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" />
</div>
......@@ -81,7 +82,7 @@
</EF:EFPage>
<EF:EFWindow id="deleteOrgWindow" width="350px" height="200px">
<EF:EFWindow id="deleteOrgWindow" width="350px" height="165px">
<div class="kendo-del-message">
<span>确认删除?</span>
</div>
......@@ -92,3 +93,59 @@
</div>
</EF:EFWindow>
<EF:EFWindow id="selectOrgWindow" width="70%" height="70%" title="选择文档">
<EF:EFRegion id="inqu1" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status1" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status1" row="0" ename="projName" cname="项目名称" colWidth="3" placeholder="模糊查询项目名称"/>
<EF:EFSelect blockId="inqu_status1" row="0" ename="fileType" cname="文件类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status1" row="0" ename="fileName" cname="文件名称" colWidth="3" placeholder="模糊查询文件名称"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result1" title="明细信息" >
<EF:EFGrid blockId="result1" autoDraw="override" isFloat="true" checkMode="row" queryMethod="query1">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="160" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="companyName" cname="项目名称" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/>
<EF:EFComboColumn ename="projCode" cname="项目名称" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="200" required="true"
align="center" filter="contains" sort="true"/>
<EF:EFColumn ename="projName" cname="项目名称" width="160" enable="true" readonly="true" align="center"
required="true" hidden="true"/>
<EF:EFComboColumn ename="fileType" cname="文件类型" width="100" align="center" readonly="false" required="true"
defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="fileName" cname="文件名称" width="160" enable="true" readonly="false" align="center"
required="true"/>
<EF:EFColumn ename="fileId" cname="文件号" width="100" enable="false" readonly="true" align="center"
required="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="releaseWindow" title="发布变更" width="50%" height="30%">
<EF:EFRegion id="inqu2" title="">
<EF:EFInput blockId="inqu_status" row="0" ename="changeContent" cname="变更内容" type="textarea" colWidth="12" ratio="2:10" required="true"/>
</EF:EFRegion>
<div style="display: flex;justify-content: flex-end;">
<EF:EFButton ename="confirmRelease" cname="确认发布"/>
</div>
</EF:EFWindow>
......@@ -182,6 +182,15 @@ $(function () {
template: function (model) {
return "V" + model.docVersion;
}
}, {
field: "docType",
title: "文件类型",
template: function (row) {
if (!isBlank(row.docType)){
return row.docType.substring(1).toUpperCase();
}
return row.docType == null ? "" : row.docType;
}
}],
loadComplete: function (grid) {
}
......
......@@ -28,20 +28,30 @@
<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" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFSelect>
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
<EF:EFDatePicker blockId="inqu_status" row="0" ename="createdTime" cname="上传时间" role="date"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" queryMethod="query">
<EF:EFGrid blockId="result" autoDraw="override" queryMethod="query" sort="single">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="previewNum" cname="预览次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="downloadNum" cname="下载次数" enable="false" width="100" align="right"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" sort="false"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150" sort="false"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="150" align="center" sort="false"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="100" align="center" sort="true"/>
<EF:EFColumn ename="createdTime" cname="上传时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="140" readonly="true" required="false"
enable="false" sort="true"/>
<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:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center" sort="false"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
......
......@@ -14,10 +14,19 @@ $(function () {
field: "changeStartCode",
template: function (item) {
let template = item["changeStartCode"]
/*if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete" || item.changeType == "uploadUpdate") {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.changeStartCode) + '" target="_blank">'+item.changeStart+'</a>';
}*/
if (item['changeType'] === "uploadAdd" || item['changeType'] === "uploadDelete") {
template = item['changeEndCode'];
}
return template;
}
},
{
field: "changeStart",
template: function (item) {
let template = item["changeStart"]
if (item['changeType'] === "uploadAdd" || item['changeType'] === "uploadDelete") {
template = item['changeEnd'];
}
return template;
}
}
......
......@@ -17,6 +17,7 @@ $(function () {
var data = {
docId: docId,
docName: e.response.docName,
docType: e.response.docType,
bizId: matId,
bizType: bizType,
operType: operType,
......
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