Commit ba2dec46 by liuyang

2024-08-29 文档库变更

parent d19747a2
...@@ -11,6 +11,7 @@ public enum ChangeTypeEnum { ...@@ -11,6 +11,7 @@ public enum ChangeTypeEnum {
UPDATE("update", "修改"), UPDATE("update", "修改"),
DELETE("delete", "删除"), DELETE("delete", "删除"),
UPLOAD_ADD("uploadAdd", "附件添加"), UPLOAD_ADD("uploadAdd", "附件添加"),
UPLOAD_UPDATE("uploadUpdate", "附件变更"),
UPLOAD_DELETE("uploadDelete", "附件删除"), UPLOAD_DELETE("uploadDelete", "附件删除"),
RELEASE("release", "发布"), RELEASE("release", "发布"),
; ;
......
...@@ -41,7 +41,7 @@ public class HpDmTools { ...@@ -41,7 +41,7 @@ public class HpDmTools {
} }
} }
public static List<HGDM099> getByBizId(String bizType, String docId) { public static List<HGDM099> getByDocId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空"); AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap(); Map<String, Object> paramMap = new HashMap();
paramMap.put(HGDM099.FIELD_BIZ_TYPE, bizType); paramMap.put(HGDM099.FIELD_BIZ_TYPE, bizType);
......
...@@ -19,5 +19,21 @@ public class HgWdSqlConstant { ...@@ -19,5 +19,21 @@ public class HgWdSqlConstant {
// 搜索树节点 // 搜索树节点
public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode"; public static final String SEARCH_TREE_NODE = "HGWD001.searchTreeNode";
} }
/**
* HGCW999 SQL定义
*
* @author:songx
* @date:2024/2/22,13:57
*/
public static class HgWd099 {
// 预览自增
public static final String PREVIEW_INCR = "HGWD099.previewIncr";
// 下载自增
public static final String DOWNLOAD_INCR = "HGWD099.downloadIncr";
// 发布
public static final String RELEASE_DATE = "HGWD099.updateReleaseDate";
}
} }
...@@ -37,7 +37,9 @@ public class HGWD001A extends DaoEPBase { ...@@ -37,7 +37,9 @@ public class HGWD001A extends DaoEPBase {
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/ public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CHANGE_TYPE = "changeType"; /* 变更类型*/ public static final String FIELD_CHANGE_TYPE = "changeType"; /* 变更类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/ public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String FIELD_CHANGE_START_CODE = "changeStartCode"; /* 变更前编码*/
public static final String FIELD_CHANGE_START = "changeStart"; /* 变更前*/ public static final String FIELD_CHANGE_START = "changeStart"; /* 变更前*/
public static final String FIELD_CHANGE_END_CODE = "changeEndCode"; /* 变更后编码*/
public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/ public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/ public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
...@@ -83,7 +85,9 @@ public class HGWD001A extends DaoEPBase { ...@@ -83,7 +85,9 @@ public class HGWD001A extends DaoEPBase {
private String projName = " "; /* 项目名称*/ private String projName = " "; /* 项目名称*/
private String changeType = " "; /* 变更类型*/ private String changeType = " "; /* 变更类型*/
private String changeContent = " "; /* 变更内容*/ private String changeContent = " "; /* 变更内容*/
private String changeStartCode = " "; /* 变更前编码*/
private String changeStart = " "; /* 变更前*/ private String changeStart = " "; /* 变更前*/
private String changeEndCode = " "; /* 变更后编码*/
private String changeEnd = " "; /* 变更后*/ private String changeEnd = " "; /* 变更后*/
private Long matId = new Long(0); private Long matId = new Long(0);
...@@ -158,10 +162,18 @@ public class HGWD001A extends DaoEPBase { ...@@ -158,10 +162,18 @@ public class HGWD001A extends DaoEPBase {
eiColumn.setDescName("变更内容"); eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START_CODE);
eiColumn.setDescName("变更前编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START); eiColumn = new EiColumn(FIELD_CHANGE_START);
eiColumn.setDescName("变更前"); eiColumn.setDescName("变更前");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END_CODE);
eiColumn.setDescName("变更后编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END); eiColumn = new EiColumn(FIELD_CHANGE_END);
eiColumn.setDescName("变更后"); eiColumn.setDescName("变更后");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
...@@ -477,6 +489,22 @@ public class HGWD001A extends DaoEPBase { ...@@ -477,6 +489,22 @@ public class HGWD001A extends DaoEPBase {
this.matId = matId; this.matId = matId;
} }
public String getChangeStartCode() {
return changeStartCode;
}
public void setChangeStartCode(String changeStartCode) {
this.changeStartCode = changeStartCode;
}
public String getChangeEndCode() {
return changeEndCode;
}
public void setChangeEndCode(String changeEndCode) {
this.changeEndCode = changeEndCode;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -501,7 +529,9 @@ public class HGWD001A extends DaoEPBase { ...@@ -501,7 +529,9 @@ public class HGWD001A extends DaoEPBase {
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName)); setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setChangeType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_TYPE)), changeType)); setChangeType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_TYPE)), changeType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent)); setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setChangeStartCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START_CODE)), changeStartCode));
setChangeStart(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START)), changeStart)); setChangeStart(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START)), changeStart));
setChangeEndCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END_CODE)), changeEndCode));
setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd)); setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId)); setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
} }
...@@ -529,7 +559,9 @@ public class HGWD001A extends DaoEPBase { ...@@ -529,7 +559,9 @@ public class HGWD001A extends DaoEPBase {
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME))); map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CHANGE_TYPE, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_CHANGE_TYPE))); map.put(FIELD_CHANGE_TYPE, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_CHANGE_TYPE)));
map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT))); map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
map.put(FIELD_CHANGE_START_CODE, StringUtils.toString(changeStartCode, eiMetadata.getMeta(FIELD_CHANGE_START_CODE)));
map.put(FIELD_CHANGE_START, StringUtils.toString(changeStart, eiMetadata.getMeta(FIELD_CHANGE_START))); map.put(FIELD_CHANGE_START, StringUtils.toString(changeStart, eiMetadata.getMeta(FIELD_CHANGE_START)));
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_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_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
......
...@@ -90,7 +90,7 @@ public class ServiceHGWD001B extends ServiceBase { ...@@ -90,7 +90,7 @@ public class ServiceHGWD001B extends ServiceBase {
List<HGWD001B> fWd001bs = MapUtils.toDaoEPBases(inInfo, HGWD001B.class); List<HGWD001B> fWd001bs = MapUtils.toDaoEPBases(inInfo, HGWD001B.class);
for (HGWD001B fWd001b : fWd001bs) { for (HGWD001B fWd001b : fWd001bs) {
// 预览记录+1 // 预览记录+1
HGCWTools.HgCw999.previewIncr(fWd001b.getDocId()); HGWDTools.HgWd099.previewIncr(fWd001b.getDocId());
// 新增 // 新增
DaoUtils.insert(HGWD001B.INSERT, fWd001b); DaoUtils.insert(HGWD001B.INSERT, fWd001b);
} }
......
...@@ -90,7 +90,7 @@ public class ServiceHGWD001C extends ServiceBase { ...@@ -90,7 +90,7 @@ public class ServiceHGWD001C extends ServiceBase {
List<HGWD001C> fWd001cs = MapUtils.toDaoEPBases(inInfo, HGWD001C.class); List<HGWD001C> fWd001cs = MapUtils.toDaoEPBases(inInfo, HGWD001C.class);
for (HGWD001C fWd001c : fWd001cs) { for (HGWD001C fWd001c : fWd001cs) {
// 下载记录+1 // 下载记录+1
HGCWTools.HgCw999.downloadIncr(fWd001c.getDocId()); HGWDTools.HgWd099.downloadIncr(fWd001c.getDocId());
// 新增 // 新增
DaoUtils.insert(HGWD001C.INSERT, fWd001c); DaoUtils.insert(HGWD001C.INSERT, fWd001c);
} }
......
...@@ -37,7 +37,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -37,7 +37,7 @@ public class ServiceHGWD001D extends TreeService {
String accountCode = UserSessionUtils.getAccountCode(); String accountCode = UserSessionUtils.getAccountCode();
if (StringUtils.isEmpty(accountCode) || CommonConstant.Field.ADMIN.equals(accountCode)) { if (StringUtils.isEmpty(accountCode) || CommonConstant.Field.ADMIN.equals(accountCode)) {
map.put("label", "root"); map.put("label", "root");
map.put("text", "组织机构"); map.put("text", "文档库");
list.add(map); list.add(map);
} else { } else {
//Org org = HGXSTools.XsOrg.get(accountCode); //Org org = HGXSTools.XsOrg.get(accountCode);
...@@ -50,6 +50,7 @@ public class ServiceHGWD001D extends TreeService { ...@@ -50,6 +50,7 @@ public class ServiceHGWD001D extends TreeService {
hashMap.put("text", hgsc001.getProjName()); hashMap.put("text", hgsc001.getProjName());
hashMap.put("projCode", hgsc001.getProjCode()); hashMap.put("projCode", hgsc001.getProjCode());
hashMap.put("projName", hgsc001.getProjName()); hashMap.put("projName", hgsc001.getProjName());
hashMap.put("ename", hgsc001.getProjCode());
hashMap.put("type", "1"); hashMap.put("type", "1");
hashMap.put("leaf", "0"); hashMap.put("leaf", "0");
hashMap.put("leafLevel", "0"); hashMap.put("leafLevel", "0");
...@@ -71,8 +72,6 @@ public class ServiceHGWD001D extends TreeService { ...@@ -71,8 +72,6 @@ public class ServiceHGWD001D extends TreeService {
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16 // 非管理员仅查询所属企业用户 added by songx at 2024-01-16
queryMap.put("accountCode", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName()) queryMap.put("accountCode", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getAccountCode()); ? null : UserSessionUtils.getAccountCode());
queryMap.put("userId", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getUserId());
List<Map> ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999); List<Map> ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999);
Map parentOrgMap = new HashMap(); Map parentOrgMap = new HashMap();
......
...@@ -104,7 +104,7 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -104,7 +104,7 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称"); hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
} }
/** /**
...@@ -123,14 +123,14 @@ public class ServiceHGWD001E extends ServiceEPBase { ...@@ -123,14 +123,14 @@ public class ServiceHGWD001E extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称"); hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName()); hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){ }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(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList()); List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型"); hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString()); hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString()); hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
} }
DaoUtils.update(HGWD001.UPDATE, hgwd001); DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
...@@ -98,7 +98,7 @@ public class ServiceHGWD001F extends ServiceEPBase { ...@@ -98,7 +98,7 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称"); hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
} }
/** /**
...@@ -117,14 +117,14 @@ public class ServiceHGWD001F extends ServiceEPBase { ...@@ -117,14 +117,14 @@ public class ServiceHGWD001F extends ServiceEPBase {
hgwd001a.setChangeContent("文件名称"); hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName()); hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){ }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(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList()); List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型"); hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString()); hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString()); hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
} }
DaoUtils.update(HGWD001.UPDATE, hgwd001); DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
...@@ -97,7 +97,7 @@ public class ServiceHGWD001G extends ServiceEPBase { ...@@ -97,7 +97,7 @@ public class ServiceHGWD001G extends ServiceEPBase {
hgwd001a.setChangeContent("项目名称"); hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
} }
/** /**
...@@ -116,14 +116,14 @@ public class ServiceHGWD001G extends ServiceEPBase { ...@@ -116,14 +116,14 @@ public class ServiceHGWD001G extends ServiceEPBase {
hgwd001a.setChangeContent("项目名称"); hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeStart(wd001.getFileName()); hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName()); hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}else if (wd001 != null && !wd001.getFileType().equals(hgwd001.getFileType())){ }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(wd001.getFileType())).collect(Collectors.toList());
List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList()); List<Map> fileType2 = edcm01List.stream().filter(map -> map.get("itemCode").equals(hgwd001.getFileType())).collect(Collectors.toList());
hgwd001a.setChangeContent("文件类型"); hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString()); hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString()); hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
} }
DaoUtils.update(HGWD001.UPDATE, hgwd001); DaoUtils.update(HGWD001.UPDATE, hgwd001);
......
...@@ -3,24 +3,21 @@ package com.baosight.hggp.hg.wd.service; ...@@ -3,24 +3,21 @@ package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation; import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum; import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant; import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999; import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.vo.UserVO;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.ds.domain.HGDS002;
import com.baosight.hggp.hg.wd.constant.HgWdConstant; import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.tools.HGWDTools; 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.*;
import com.baosight.iplat4j.core.ProjectInfo; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase; import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -44,7 +41,7 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -44,7 +41,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override @Override
public EiInfo initLoad(EiInfo inInfo) { public EiInfo initLoad(EiInfo inInfo) {
try { try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD099().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
...@@ -62,8 +59,9 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -62,8 +59,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo); Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if(StringUtils.isNotEmpty(queryRow.get(HGDM099.FIELD_BIZ_ID).toString())){ if (StringUtils.isNotEmpty(queryRow.get(HGWD001.FIELD_FILE_ID).toString())){
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099()); inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, User.FIELD_USER_ID, UserSessionUtils.getUserId());
inInfo = super.query(inInfo, HGWD099.QUERY, new HGWD099());
} }
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -83,10 +81,10 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -83,10 +81,10 @@ public class ServiceHGWD099 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099(); HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow); hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0); hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, hgdm099); DaoUtils.insert(HGWD099.INSERT, hgdm099);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId()); HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) { if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A(); HGWD001A hgwd001a = new HGWD001A();
...@@ -95,11 +93,12 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -95,11 +93,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjCode(hgwd001.getProjCode()); hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName()); hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode()); hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件"); hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName()); hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId()); hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001); HGWDTools.HgWd001.updateStatus(hgwd001);
} }
...@@ -124,9 +123,9 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -124,9 +123,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
try { try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099(); HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow); hgdm099.fromMap(resultRow);
DaoUtils.update(HGDM099.DELETE, hgdm099); DaoUtils.update(HGWD099.DELETE, hgdm099);
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId()); HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) { if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A(); HGWD001A hgwd001a = new HGWD001A();
...@@ -135,11 +134,12 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -135,11 +134,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjCode(hgwd001.getProjCode()); hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName()); hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode()); hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件"); hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setChangeEnd(hgdm099.getDocName()); hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId()); hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.addHGWD001A(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001); HGWDTools.HgWd001.updateStatus(hgwd001);
} }
...@@ -151,45 +151,4 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -151,45 +151,4 @@ public class ServiceHGWD099 extends ServiceEPBase {
} }
return inInfo; return inInfo;
} }
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGCW999.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
} }
...@@ -272,37 +272,32 @@ ...@@ -272,37 +272,32 @@
<!-- 文档库子节点树查询 --> <!-- 文档库子节点树查询 -->
<select id="queryOrganiation" resultClass="java.util.HashMap"> <select id="queryOrganiation" resultClass="java.util.HashMap">
SELECT SELECT
A.COMPANY_CODE as "companyCode", <!-- 公司编码 --> COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 --> PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 --> FILE_ID as "label",
A.PROJ_NAME as "projName", <!-- 项目名称 --> FILE_ID as "ename",
A.FILE_ID as "label", FILE_NAME as "text",
A.FILE_ID as "ename", FILE_TYPE as "leaf",
A.FILE_NAME as "text", FILE_TYPE as "type",
A.FILE_TYPE as "leaf", PARENT_ID as "parentId",
A.FILE_TYPE as "type", DELETE_FLAG as "isDeleted",
A.PARENT_ID as "parentId", LEAF_LEVEL as "leafLevel"
A.DELETE_FLAG as "isDeleted", FROM ${hggpSchema}.HGWD001
A.LEAF_LEVEL as "leafLevel"
FROM ${hggpSchema}.HGWD001 A INNER JOIN ${hggpSchema}.HGWD003 B ON A.FILE_ID = B.FILE_ID
WHERE 1=1 WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery"> <isEmpty prepend=" AND " property="deletedQuery">
A.DELETE_FLAG = '0' DELETE_FLAG = '0'
</isEmpty> </isEmpty>
<isNotEmpty prepend=" AND " property="node"> <isNotEmpty prepend=" AND " property="node">
A.PARENT_ID = #node# PARENT_ID = #node#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
A.COMPANY_CODE = #companyCode# COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode# ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
</isNotEmpty> </isNotEmpty>
group by A.COMPANY_CODE,A.PROJ_CODE,A.FILE_ID,A.FILE_NAME,A.FILE_TYPE,A.PARENT_ID,A.DELETE_FLAG <!--group by COMPANY_CODE, PROJ_CODE, FILE_ID, FILE_NAME, FILE_TYPE, PARENT_ID, DELETE_FLAG-->
order by A.CREATED_TIME asc order by CREATED_TIME asc
</select> </select>
<!--档库所有子节点树查询--> <!--档库所有子节点树查询-->
......
...@@ -74,9 +74,15 @@ ...@@ -74,9 +74,15 @@
<isNotEmpty prepend=" AND " property="changeContent"> <isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent# CHANGE_CONTENT = #changeContent#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStartCode">
CHANGE_START_CODE = #changeStartCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStart"> <isNotEmpty prepend=" AND " property="changeStart">
CHANGE_START = #changeStart# CHANGE_START = #changeStart#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEndCode">
CHANGE_END_CODE = #changeEndCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEnd"> <isNotEmpty prepend=" AND " property="changeEnd">
CHANGE_END = #changeEnd# CHANGE_END = #changeEnd#
</isNotEmpty> </isNotEmpty>
...@@ -104,7 +110,9 @@ ...@@ -104,7 +110,9 @@
PROJ_NAME as "projName", <!-- 项目名称 --> PROJ_NAME as "projName", <!-- 项目名称 -->
CHANGE_TYPE as "changeType", <!-- 变更类型 --> CHANGE_TYPE as "changeType", <!-- 变更类型 -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 --> CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
CHANGE_START_CODE as "changeStartCode",
CHANGE_START as "changeStart", <!-- 变更前 --> CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END_CODE as "changeEndCode",
CHANGE_END as "changeEnd", <!-- 变更后 --> CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId" MAT_ID as "matId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1 FROM ${hggpSchema}.HGWD001A WHERE 1=1
...@@ -184,26 +192,30 @@ ...@@ -184,26 +192,30 @@
<insert id="insert"> <insert id="insert">
INSERT INTO ${hggpSchema}.HGWD001A (ID, INSERT INTO ${hggpSchema}.HGWD001A (ID,
ACCOUNT_CODE, <!-- 企业编码 --> ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 --> DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 --> CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 --> CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 --> CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 --> UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 --> UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 --> UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 --> DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 --> COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 --> COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 --> PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 --> PROJ_NAME, <!-- 项目名称 -->
CHANGE_TYPE, <!-- 变更类型 --> CHANGE_TYPE, <!-- 变更类型 -->
CHANGE_CONTENT, <!-- 变更内容 --> CHANGE_CONTENT, <!-- 变更内容 -->
CHANGE_START, <!-- 变更前 --> CHANGE_START_CODE,
CHANGE_END, <!-- 变更后 --> CHANGE_START, <!-- 变更前 -->
MAT_ID CHANGE_END_CODE,
) CHANGE_END, <!-- 变更后 -->
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#, #changeContent#, #changeStart#, #changeEnd#,#matId#) MAT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#,
#updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#,
#changeContent#, #changeStartCode#, #changeStart#, #changeEndCode#, #changeEnd#,#matId#)
</insert> </insert>
<delete id="delete"> <delete id="delete">
...@@ -234,7 +246,9 @@ ...@@ -234,7 +246,9 @@
PROJ_NAME = #projName#, <!-- 项目名称 --> PROJ_NAME = #projName#, <!-- 项目名称 -->
CHANGE_TYPE = #changeType#, <!-- 变更类型 --> CHANGE_TYPE = #changeType#, <!-- 变更类型 -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 --> CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
CHANGE_START_CODE = #changeStartCode#,
CHANGE_START = #changeStart#, <!-- 变更前 --> CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END_CODE as #changeEndCode#,
CHANGE_END = #changeEnd#, <!-- 变更后 --> CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId# MAT_ID = #matId#
WHERE WHERE
......
package com.baosight.hggp.hg.wd.tools; package com.baosight.hggp.hg.wd.tools;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.dao.DaoBase; import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils; import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.constant.HgCwSqlConstant;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant; import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001; import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A; import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002; import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.util.AssertUtils; import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.MapUtils; import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ProjectInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -84,7 +92,7 @@ public class HGWDTools { ...@@ -84,7 +92,7 @@ public class HGWDTools {
return DaoBase.getInstance().query(HgWdSqlConstant.HgWd001.SEARCH_TREE_NODE, queryMap); return DaoBase.getInstance().query(HgWdSqlConstant.HgWd001.SEARCH_TREE_NODE, queryMap);
} }
public static void add(HGWD001A hgwd001a) { public static void addHGWD001A(HGWD001A hgwd001a) {
AssertUtils.isNull(hgwd001a, "文档对象不能为空"); AssertUtils.isNull(hgwd001a, "文档对象不能为空");
DaoUtils.insert(HGWD001A.INSERT, hgwd001a); DaoUtils.insert(HGWD001A.INSERT, hgwd001a);
} }
...@@ -127,4 +135,50 @@ public class HGWDTools { ...@@ -127,4 +135,50 @@ public class HGWDTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0); return CollectionUtils.isEmpty(results) ? null : results.get(0);
} }
} }
public static class HgWd099 {
public static List<HGWD099> getByDocId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGWD099.FIELD_BIZ_TYPE, bizType);
paramMap.put(HGWD099.FIELD_DOC_ID, docId);
return DaoBase.getInstance().query(HGWD099.QUERY, paramMap);
}
/**
* 预览记录自增
*
* @param docId
*/
public static void previewIncr(String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCW999.FIELD_DOC_ID, docId);
DaoUtils.update(HgWdSqlConstant.HgWd099.PREVIEW_INCR, queryMap);
}
/**
* 下载记录自增
*
* @param docId
*/
public static void downloadIncr(String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGCW999.FIELD_DOC_ID, docId);
DaoUtils.update(HgWdSqlConstant.HgWd099.DOWNLOAD_INCR, queryMap);
}
public static List<HGWD099> queryByBiz(String bizType) {
AssertUtils.isNull(bizType, "业务类型不能为空!");
List<HGWD099> results = DaoBase.getInstance().query(HGWD099.QUERY,
new HashMap<String,Object>(){{put("bizType",bizType);}}
);
return results;
}
}
} }
...@@ -98,5 +98,6 @@ ...@@ -98,5 +98,6 @@
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD001.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD002.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD002.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD003.xml"/> <sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD003.xml"/>
<sqlMap resource="com/baosight/hggp/hg/wd/sql/HGWD099.xml"/>
</sqlMapConfig> </sqlMapConfig>
...@@ -6,15 +6,15 @@ $(function () { ...@@ -6,15 +6,15 @@ $(function () {
const init = () => { const init = () => {
$("#HGWD001").css("padding-bottom", "8px") $("#HGWD001").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__") sessionStorage.removeItem("__user_id__")
setTimeout(() => { setTimeout(() => {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
}, 1000); }, 1000);
// 查询 // 查询
$("#QUERY").on("click", function (e) { $("#QUERY").on("click", function (e) {
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
}); });
// 分割线组件 // 分割线组件
(function () { (function () {
splitter = $("#splitter").kendoSplitter({ splitter = $("#splitter").kendoSplitter({
...@@ -94,21 +94,22 @@ $(function () { ...@@ -94,21 +94,22 @@ $(function () {
"categoryTree": { "categoryTree": {
select: function (e) { select: function (e) {
var _data = this.dataItem(e.node); var _data = this.dataItem(e.node);
var nodeData = IPLATUI.EFTree.categoryTree.selectTreeNode;
var labelValue = _data.label; var labelValue = _data.label;
var typeValue = _data.type; var typeValue = _data.type;
const eNameValue = _data.ename; const eNameValue = _data.ename;
setTreeNodeValue(_data);
$("[name = 'inqu_status-0-parentId']").val(labelValue); $("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-bizId']").val(labelValue);
$("[name = 'inqu_status-0-fileId']").val(eNameValue); $("[name = 'inqu_status-0-fileId']").val(eNameValue);
$("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel==null?0:_data.leafLevel); $("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel==null?0:_data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode); $("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(_data.companyCode); $("[name = 'inqu_status-0-companyCode']").val(_data.companyCode);
$("[name = 'inqu_status-0-type']").val(_data.type); $("[name = 'inqu_status-0-type']").val(typeValue);
$("[name = 'inqu_status-0-fileName']").val(_data.text); $("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 编辑、删除树节点时,需要刷新的树节点 // 编辑、删除树节点时,需要刷新的树节点
$("[name = 'inqu_status-0-orgParentId']").val(_data.parentId); $("[name = 'inqu_status-0-orgParentId']").val(_data.parentId);
// 显示授权按钮
showAuthButton();
}, },
/*ROOT:{label: 'root',text: '组织机构'},*/ /*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) { template: function (node) {
...@@ -351,7 +352,6 @@ $(function () { ...@@ -351,7 +352,6 @@ $(function () {
selectTreeNode(tree, orgId); selectTreeNode(tree, orgId);
// 设置当前选中的节点信息 // 设置当前选中的节点信息
$("[name = 'inqu_status-0-parentId']").val(orgId); $("[name = 'inqu_status-0-parentId']").val(orgId);
$("[name = 'inqu_status-0-bizId']").val(orgId);
$("[name = 'inqu_status-0-projCode']").val(data.projCode); $("[name = 'inqu_status-0-projCode']").val(data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(data.companyCode); $("[name = 'inqu_status-0-companyCode']").val(data.companyCode);
$("[name = 'inqu_status-0-type']").val(data.type); $("[name = 'inqu_status-0-type']").val(data.type);
...@@ -378,7 +378,14 @@ $(function () { ...@@ -378,7 +378,14 @@ $(function () {
this.expandPath(['root']); this.expandPath(['root']);
}, 1000); }, 1000);
}, },
selectTreeNode: {}, selectTreeNode: {
fileId: '',
parentId: '',
projCode: '',
companyCode: '',
leafLevel: '',
type: '',
},
// expandLevel:1, // expandLevel:1,
/** /**
* 开启结点拖拽功能,默认dragAndDrop = false不开启, * 开启结点拖拽功能,默认dragAndDrop = false不开启,
...@@ -465,6 +472,8 @@ $(function () { ...@@ -465,6 +472,8 @@ $(function () {
// 附件上传 // 附件上传
$("#UPLOAD_FILE").on("click", uploadFile); $("#UPLOAD_FILE").on("click", uploadFile);
$("#RELEASE").click("click",updateRelease)
}, },
onDelete: function (e) { onDelete: function (e) {
// 阻止默认请求,使用自定义删除 // 阻止默认请求,使用自定义删除
...@@ -816,7 +825,7 @@ function uploadFile() { ...@@ -816,7 +825,7 @@ function uploadFile() {
} }
JSColorbox.open({ JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" + href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
"&inqu_status-0-bizId="+$("#inqu_status-0-bizId").val()+"" + "&inqu_status-0-bizId="+$("#inqu_status-0-parentId").val()+"" +
"&inqu_status-0-operType=add" + "&inqu_status-0-operType=add" +
"&efParentFormEname=HGWD001", "&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>附件上传</div>", title: "<div style='text-align: center;'>附件上传</div>",
...@@ -888,3 +897,48 @@ function deleteFunc() { ...@@ -888,3 +897,48 @@ function deleteFunc() {
} }
}) })
} }
/**
* 发布
*/
function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/**
* 显示授权按钮
*/
let showAuthButton = function () {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel;
// C:目录
if (leafType && leafType >0) {
$("#RELEASE").attr("disabled", false);
$("#UPLOAD_FILE").attr("disabled", false);
} else {
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
}
}
\ No newline at end of file
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
<EF:EFInput cname="公司代码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="公司代码" ename="companyCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="bizId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
...@@ -69,6 +68,9 @@ ...@@ -69,6 +68,9 @@
<EF:EFColumn ename="id" cname="ID" hidden="true"/> <EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/> <EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/> <EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="120" align="center" defaultValue="0" hidden="false">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center" <EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/> parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/> <EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
......
...@@ -78,7 +78,6 @@ $(function () { ...@@ -78,7 +78,6 @@ $(function () {
//console.log(dayjs,"dayjs") //console.log(dayjs,"dayjs")
// 此 grid 对象 // 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化 // 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) { grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化 // 判断父级节点是否发生变化
if (e.field === "projCode") { if (e.field === "projCode") {
...@@ -185,34 +184,6 @@ let save = function (btnNode) { ...@@ -185,34 +184,6 @@ let save = function (btnNode) {
} }
} }
/**
* 发布
*/
function updateRelease() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result"))
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, {
onSuccess(response) {
if (response.status != -1) {
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
}
);
}
/** /**
* 显示详情 * 显示详情
......
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