Commit 71c014dc by liuyang

2024-08-29 文档库变更

parent fc93070f
...@@ -36,6 +36,8 @@ public class HGDM099 extends DaoEPBase { ...@@ -36,6 +36,8 @@ public class HGDM099 extends DaoEPBase {
public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/ public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/ public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/ public static final String FIELD_DOC_NAME = "docName"; /* 文件名称*/
public static final String FIELD_PREVIEW_NUM = "previewNum"; /* 预览次数*/
public static final String FIELD_DOWNLOAD_NUM = "downloadNum"; /* 下载次数*/
public static final String COL_ID = "ID"; public static final String COL_ID = "ID";
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/ public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
...@@ -51,6 +53,8 @@ public class HGDM099 extends DaoEPBase { ...@@ -51,6 +53,8 @@ public class HGDM099 extends DaoEPBase {
public static final String COL_BIZ_ID = "BIZ_ID"; /* 业务ID*/ public static final String COL_BIZ_ID = "BIZ_ID"; /* 业务ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/ public static final String COL_DOC_ID = "DOC_ID"; /* 文件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名称*/ public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名称*/
public static final String COL_PREVIEW_NUM = "PREVIEW_NUM"; /* 预览次数*/
public static final String COL_DOWNLOAD_NUM = "DOWNLOAD_NUM"; /* 下载次数*/
public static final String QUERY = "HGDM099.query"; public static final String QUERY = "HGDM099.query";
public static final String COUNT = "HGDM099.count"; public static final String COUNT = "HGDM099.count";
...@@ -72,6 +76,8 @@ public class HGDM099 extends DaoEPBase { ...@@ -72,6 +76,8 @@ public class HGDM099 extends DaoEPBase {
private String bizId = " "; /* 业务ID*/ private String bizId = " "; /* 业务ID*/
private String docId = " "; /* 文件ID*/ private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/ private String docName = " "; /* 文件名称*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
/** /**
* initialize the metadata. * initialize the metadata.
...@@ -136,6 +142,14 @@ public class HGDM099 extends DaoEPBase { ...@@ -136,6 +142,14 @@ public class HGDM099 extends DaoEPBase {
eiColumn.setDescName("文件名称"); eiColumn.setDescName("文件名称");
eiMetadata.addMeta(eiColumn); eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PREVIEW_NUM);
eiColumn.setDescName("预览次数");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOWNLOAD_NUM);
eiColumn.setDescName("下载次数");
eiMetadata.addMeta(eiColumn);
} }
/** /**
...@@ -369,6 +383,39 @@ public class HGDM099 extends DaoEPBase { ...@@ -369,6 +383,39 @@ public class HGDM099 extends DaoEPBase {
public void setDocName(String docName) { public void setDocName(String docName) {
this.docName = docName; this.docName = docName;
} }
/**
* get the previewNum - 预览次数.
* @return the previewNum
*/
public Integer getPreviewNum() {
return this.previewNum;
}
/**
* set the previewNum - 预览次数.
*
* @param previewNum - 预览次数
*/
public void setPreviewNum(Integer previewNum) {
this.previewNum = previewNum;
}
/**
* get the downloadNum - 下载次数.
* @return the downloadNum
*/
public Integer getDownloadNum() {
return this.downloadNum;
}
/**
* set the downloadNum - 下载次数.
*
* @param downloadNum - 下载次数
*/
public void setDownloadNum(Integer downloadNum) {
this.downloadNum = downloadNum;
}
/** /**
* get the value from Map. * get the value from Map.
* *
...@@ -391,6 +438,8 @@ public class HGDM099 extends DaoEPBase { ...@@ -391,6 +438,8 @@ public class HGDM099 extends DaoEPBase {
setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId)); setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId)); setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName)); setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setPreviewNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_PREVIEW_NUM)), previewNum));
setDownloadNum(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DOWNLOAD_NUM)), downloadNum));
} }
/** /**
...@@ -414,6 +463,8 @@ public class HGDM099 extends DaoEPBase { ...@@ -414,6 +463,8 @@ public class HGDM099 extends DaoEPBase {
map.put(FIELD_BIZ_ID, StringUtils.toString(bizId, eiMetadata.getMeta(FIELD_BIZ_ID))); map.put(FIELD_BIZ_ID, StringUtils.toString(bizId, eiMetadata.getMeta(FIELD_BIZ_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID))); map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME))); map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
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)));
return map; return map;
} }
......
...@@ -15,7 +15,9 @@ ...@@ -15,7 +15,9 @@
BIZ_TYPE as "bizType", <!-- 业务类型 --> BIZ_TYPE as "bizType", <!-- 业务类型 -->
BIZ_ID as "bizId", <!-- 业务ID --> BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID --> DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName" <!-- 文件名称 --> DOC_NAME as "docName", <!-- 文件名称 -->
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
</sql> </sql>
<sql id="condition"> <sql id="condition">
...@@ -93,10 +95,55 @@ ...@@ -93,10 +95,55 @@
) )
</insert> </insert>
<delete id="deleteBizId">
UPDATE ${hggpSchema}.HGDM099
SET DELETE_FLAG = 1
WHERE BIZ_ID = #bizId#
</delete>
<delete id="delete"> <delete id="delete">
UPDATE ${hggpSchema}.HGDM099 UPDATE ${hggpSchema}.HGDM099
SET DELETE_FLAG = 1 SET DELETE_FLAG = 1
WHERE ID = #id# WHERE ID = #id#
</delete> </delete>
<update id="update">
UPDATE ${hggpSchema}.HGDM099
SET
DOC_ID = #docId#, <!-- 文件ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE ID = #id#
</update>
<update id="batchUpdate">
UPDATE ${hggpSchema}.HGDM099
SET
BIZ_ID = #bizId#, <!-- 物料ID -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_NAME = #updatedName#, <!-- 修改人名称 -->
UPDATED_TIME = #updatedTime# <!-- 修改时间 -->
WHERE DOC_ID IN <iterate close=")" open="(" conjunction="," property="docIds">#docIds[]#</iterate>
</update>
<!-- 预览自增 -->
<update id="previewIncr">
UPDATE ${hggpSchema}.HGDM099
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
<!-- 下载自增 -->
<update id="downloadIncr">
UPDATE ${hggpSchema}.HGDM099
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include refid="SqlBase.updateRevise"/>
WHERE DOC_ID = #docId#
</update>
</sqlMap> </sqlMap>
...@@ -41,5 +41,13 @@ public class HpDmTools { ...@@ -41,5 +41,13 @@ public class HpDmTools {
} }
} }
public static List<HGDM099> getByBizId(String bizType, String docId) {
AssertUtils.isEmpty(docId, "文件ID不能为空");
Map<String, Object> paramMap = new HashMap();
paramMap.put(HGDM099.FIELD_BIZ_TYPE, bizType);
paramMap.put(HGDM099.FIELD_DOC_ID, docId);
return DaoBase.getInstance().query("HGDM099.query", paramMap);
}
} }
} }
...@@ -2,28 +2,21 @@ package com.baosight.hggp.hg.wd.service; ...@@ -2,28 +2,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.common.CompanyTypeEnum;
import com.baosight.hggp.common.DdynamicEnum; import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant; 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.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum; import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.Iplat4jTools; 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.constant.HGConstant;
import com.baosight.hggp.hg.cw.domain.HGCW999; import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.sb.domain.HGSB001; import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.sb.domain.HGSB003; import com.baosight.hggp.hg.dm.tools.HpDmTools;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
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.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org; 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.*;
import com.baosight.hggp.util.contants.ACConstants; import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock; import com.baosight.iplat4j.core.ei.EiBlock;
...@@ -81,15 +74,16 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -81,15 +74,16 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001.setDeleteFlag(CommonConstant.YesNo.YES_1); hgwd001.setDeleteFlag(CommonConstant.YesNo.YES_1);
Map map1 = new HashMap(); Map map1 = new HashMap();
map1.put(HGWD001A.FIELD_MAT_ID, hgwd001.getId()); map1.put(HGWD001A.FIELD_MAT_ID, hgwd001.getId());
List<HGWD001A> hgwd001AList = DaoBase.getInstance().query(HGWD001A.QUERY, map1); /*List<HGWD001A> hgwd001AList = DaoBase.getInstance().query(HGWD001A.QUERY, map1);
for (HGWD001A hgwd001A:hgwd001AList) { for (HGWD001A hgwd001A:hgwd001AList) {
if (hgwd001A.getChangeType().equals(ChangeTypeEnum.UPLOAD_ADD.getCode()) if (hgwd001A.getChangeType().equals(ChangeTypeEnum.UPLOAD_ADD.getCode())
|| hgwd001A.getChangeType().equals(ChangeTypeEnum.UPLOAD_DELETE.getCode())) { || hgwd001A.getChangeType().equals(ChangeTypeEnum.UPLOAD_DELETE.getCode())) {
Iplat4jUtils.deleteFileByDocId(hgwd001A.getChangeStart()); Iplat4jUtils.deleteFileByDocId(hgwd001A.getChangeStart());
} }
} }*/
DaoUtils.update("HGCW999.deleteMatId", map1); //删除附件记录 DaoUtils.update("HGDM099.deleteBizId",
DaoUtils.update(HGWD001A.DELETE_MAT_ID, map1); //删除变更记录 new HashMap<String,String>(){{put(HGDM099.FIELD_BIZ_ID, hgwd001.getId().toString());}}); //删除附件记录
//DaoUtils.update(HGWD001A.DELETE_MAT_ID, map1); //删除变更记录
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.update(HGWD001.DELETE, hgwd001); DaoUtils.update(HGWD001.DELETE, hgwd001);
} }
...@@ -212,26 +206,94 @@ public class ServiceHGWD001 extends ServiceEPBase { ...@@ -212,26 +206,94 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo; return inInfo;
} }
//树查询服务 @OperationLogAnnotation(operModul = "文档库",operType = "修改",operDesc = "文档库-附件清单A-修改附件操作")
public EiInfo queryTreeNode(EiInfo inInfo) { public EiInfo updateFile(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo); try {
String node = MapUtils.getString(queryRow, "fileId"); String ndocId = inInfo.getCellStr(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "ndocId");
//获取物料详情数据 List<HGDM099> hgdm099s = HpDmTools.HpDm099.getByBizId("WD",ndocId);
String projCode = inInfo.getString("projCode"); for (HGDM099 hgdm099:hgdm099s) {
String companyCode = inInfo.getString("companyCode"); DaoUtils.update(HGDM099.DELETE, hgdm099);
String parentId = inInfo.getString("parentId"); HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
Map queryMap = new HashMap(); if (hgwd001 != null) {
queryMap.put("companyCode", StringUtils.isNotBlank(companyCode) ? companyCode : "null"); HGWD001A hgwd001a =initHgwd001a(hgwd001, hgdm099,ChangeTypeEnum.DELETE.getCode());
queryMap.put("projCode", StringUtils.isNotBlank(projCode) ? projCode : "null"); HGWDTools.HgWd001.add(hgwd001a);
queryMap.put("parentId", StringUtils.isNotBlank(parentId) ? parentId : "null"); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
queryMap.put("pEname", "$".equals(node) ? "root" : node); }
//2 查询节点 }
List rows = dao.query("HGWD001.queryTree", queryMap); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
//3 增加节点block块 for (Map resultRow : resultRows) {
EiInfo outInfo = new EiInfo(); HGDM099 hgdm099 = new HGDM099();
EiBlock outBlock = outInfo.addBlock(node); hgdm099.fromMap(resultRow);
outBlock.addRows(rows); hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
return outInfo; DaoUtils.insert(HGDM099.INSERT, hgdm099);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a =initHgwd001a(hgwd001, hgdm099,ChangeTypeEnum.ADD.getCode());
HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
public HGWD001A initHgwd001a(HGWD001 hgwd001,HGDM099 hgdm099,String type){
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
if (ChangeTypeEnum.ADD.getCode().equals(type)){
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件");
}else if (ChangeTypeEnum.DELETE.getCode().equals(type)){
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件");
}
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
return hgwd001a;
}
/**
* 删除组织及子节点
*
* @param inInfo
* @return
*/
public EiInfo deleteOrgAndChildrenById(EiInfo inInfo) {
try {
List<Map> rows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map idMap = new HashMap();
int sum = 0;
for (int i = 0; i < rows.size(); ++i) {
String orgId = rows.get(i).get("fileId").toString();
Map orgIdMap = new HashMap();
orgIdMap.put("parentId", orgId);
List orgIdChildList = this.dao.query("HGWD001.queryFileChild", orgIdMap);
for (int j = 0; j < orgIdChildList.size(); ++j) {
Map childMap = ((Map) orgIdChildList.get(j));
String childOrgId = childMap.get("id").toString();
idMap.put("id", childOrgId);
this.dao.update("HGWD001.delete", idMap);
Map memberMap = new HashMap();
memberMap.put(HGDM099.FIELD_BIZ_ID, ((Map) orgIdChildList.get(j)).get("fileId"));
DaoUtils.update("HGDM099.deleteBizId",memberMap); //删除附件记录
++sum;
}
}
inInfo.setMsg("删除[" + sum + "]条记录成功");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
} }
} }
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.hg.xs.tools.HGXSTools;
import com.baosight.iplat4j.core.ei.*;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.ef.ui.tree.TreeService;
import com.baosight.xservices.xs.service.ServiceXSTreeNode;
import com.baosight.xservices.xs.util.LoginUserDetails;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/29
* @description 文件库树
*/
public class ServiceHGWD001D extends TreeService {
private EiBlockMeta eiMetadata = null;
public ServiceHGWD001D() {
}
@Override
public List getTopNodes() {
HashMap<String, String> map = new HashMap();
List<HashMap> list = new ArrayList();
String accountCode = UserSessionUtils.getAccountCode();
if (StringUtils.isEmpty(accountCode) || CommonConstant.Field.ADMIN.equals(accountCode)) {
map.put("label", "root");
map.put("text", "组织机构");
} else {
Org org = HGXSTools.XsOrg.get(accountCode);
map.put("label", org == null ? "root" : org.getOrgId());
map.put("text", org == null ? "文档库" : org.getOrgCname());
}
map.put("leaf", "0");
map.put("parent", "0");
list.add(map);
return list;
}
@Override
public List getChildNodes(String parentLabel) {
if (StringUtils.isEmpty(parentLabel) || "$".equals(parentLabel)) {
parentLabel = "root";
}
Map queryMap = new HashMap();
queryMap.put("node", parentLabel);
// 非管理员仅查询所属企业用户 added by songx at 2024-01-16
queryMap.put("accountCode", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getAccountCode());
List<Map> ret = new ArrayList<>();
if (parentLabel.indexOf("Q")==0){
queryMap.put("node", parentLabel);
ret = this.dao.query("XSOG01.queryOrganiation", queryMap, 0, -999999);
ret = ret.stream().filter(map -> map.get("type").equals(OrgTypeEnum.COMPANY.getCode())).collect(Collectors.toList());
}else {
queryMap.put("userId", LoginUserDetails.isUserAdmin(UserSessionUtils.getLoginName())
? null : UserSessionUtils.getUserId());
ret = this.dao.query("HGWD001.queryOrganiation", queryMap, 0, -999999);
}
Map parentOrgMap = new HashMap();
String orgId;
for(int i = 0; i < ret.size(); ++i) {
Map org = (Map)ret.get(i);
if (parentLabel.indexOf("Q")==0){
orgId = (String)org.get("parentOrgId");
}else {
orgId = (String)org.get("parentId");
}
if (parentOrgMap.get(orgId) == null) {
parentOrgMap.put(orgId, new ArrayList());
}
((List)parentOrgMap.get(orgId)).add(org);
}
List result = (List)parentOrgMap.get(parentLabel);
if(CollectionUtils.isEmpty(result)){
return result;
}
for(int i = 0; i < result.size(); ++i) {
orgId = (String)((Map)result.get(i)).get("label");
String hasChild = parentOrgMap.get(orgId) != null ? "2" : "1";
// ((Map)result.get(i)).put("leaf", hasChild);
((Map)result.get(i)).put("leaf", "0");
}
return result;
}
public EiInfo search(EiInfo inInfo) {
EiInfo outInfo = new EiInfo();
try {
outInfo = super.query(inInfo, "XSOG0100.search");
} catch (PlatException var5) {
var5.printStackTrace();
EiBlock block = new EiBlock(EiConstant.resultBlock);
outInfo.setBlock(block);
}
return outInfo;
}
public EiInfo expandPath(EiInfo inInfo) {
EiInfo outInfo = super.query(inInfo, "XSOG0100.expandPath");
return outInfo;
}
@Override
public EiBlockMeta initMetaData() {
if (this.eiMetadata == null) {
this.eiMetadata = new EiBlockMeta();
EiColumn eiColumn = new EiColumn("label");
eiColumn.setDescName("label");
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("parent");
eiColumn.setDescName("parent");
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("text");
eiColumn.setDescName("text");
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("leaf");
eiColumn.setDescName("leaf");
eiColumn.setType(EiConstant.COLUMN_TYPE_NUMBER);
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("companyCode");
eiColumn.setDescName("companyCode");
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("projCode");
eiColumn.setDescName("projCode");
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn("leafLevel");
eiColumn.setDescName("leafLevel");
eiColumn.setNullable(false);
eiColumn.setPrimaryKey(false);
this.eiMetadata.addMeta(eiColumn);
}
return this.eiMetadata;
}
public EiInfo searchNodePath(EiInfo inInfo) {
String leafName = (String)inInfo.get("leafName");
Map map = new HashMap();
List queryNodeList = this.dao.query("XSOG01.queryOrganiation", map);
List nodeList = new ArrayList();
Iterator var6 = queryNodeList.iterator();
while(var6.hasNext()) {
Object node = var6.next();
String parentId = (String)((HashMap)node).get("parentOrgId");
if (!"".equals(parentId.trim())) {
((HashMap)node).put("parentId", parentId);
nodeList.add(node);
}
}
ServiceXSTreeNode root = ServiceXSTreeNode.buildTree(nodeList);
List allPath = ServiceXSTreeNode.findAllPath(root, nodeList, leafName);
inInfo.set("allPath", allPath);
return inInfo;
}
}
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.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.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.tools.HGWDTools;
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.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
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.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/29
* @description 新增文档库
*/
public class ServiceHGWD001E extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),new HashMap<String,Object>(){{
put(Org.FIELD_ORG_TYPE, OrgTypeEnum.COMPANY.getCode());
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD001().eiMetadata);
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
/*String parentId = inInfo.getCellStr(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_PARENT_ID);
if (parentId.indexOf("Q")==0){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_ACCOUNT_CODE, parentId);
}else if (parentId.indexOf("R")==0){
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_COMPANY_CODE, parentId);
}*/
return super.query(inInfo, HGWD001.QUERY,new HGWD001());
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "文档库",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(resultRow);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
} else {
this.modify(hgwd001,edcm01List);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGWD001 hgwd001) {
hgwd001.setFileId(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID));
hgwd001.setDocVersion(hgwd001.getDocVersion() + 1);
DaoUtils.insert(HGWD001.INSERT, hgwd001);
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.ADD.getCode());
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
}
/**
* 修改操作
*/
public void modify(HGWD001 hgwd001,List<Map<String, Object>> edcm01List) {
HGWD001 wd001 =HGWDTools.HgWd001.get(hgwd001.getId());
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPDATE.getCode());
hgwd001a.setMatId(hgwd001.getId());
if (wd001 != null && !wd001.getFileName().equals(hgwd001.getFileName())){
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(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());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
}
}
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.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.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.tools.HGWDTools;
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.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
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.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/29
* @description 修改文档库
*/
public class ServiceHGWD001F extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),new HashMap<String,Object>(){{
put(Org.FIELD_ORG_TYPE, OrgTypeEnum.COMPANY.getCode());
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD001().eiMetadata);
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGWD001.QUERY,new HGWD001());
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "文档库",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(resultRow);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
} else {
this.modify(hgwd001,edcm01List);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGWD001 hgwd001) {
hgwd001.setFileId(SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID));
hgwd001.setDocVersion(hgwd001.getDocVersion() + 1);
DaoUtils.insert(HGWD001.INSERT, hgwd001);
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.ADD.getCode());
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
}
/**
* 修改操作
*/
public void modify(HGWD001 hgwd001,List<Map<String, Object>> edcm01List) {
HGWD001 wd001 =HGWDTools.HgWd001.get(hgwd001.getId());
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPDATE.getCode());
hgwd001a.setMatId(hgwd001.getId());
if (wd001 != null && !wd001.getFileName().equals(hgwd001.getFileName())){
hgwd001a.setChangeContent("文件名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(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());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
}
}
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.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.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.tools.HGWDTools;
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.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiConstant;
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.stream.Collectors;
/**
* @author LiuYang
* @version 1.0 2024/8/29
* @description 文档添加项目
*/
public class ServiceHGWD001G extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.PROJ_RECORD_BLOCK_ID));
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.COMPANY_BOX_BLOCK_ID),new HashMap<String,Object>(){{
put(Org.FIELD_ORG_TYPE, OrgTypeEnum.COMPANY.getCode());
}});
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD001().eiMetadata);
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
return super.query(inInfo, HGWD001.QUERY,new HGWD001());
}
@OperationLogAnnotation(operModul = "文档库",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(resultRow);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.checkProjCode(hgwd001.getProjCode());
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
} else {
this.modify(hgwd001,edcm01List);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增操作
*/
public void add(HGWD001 hgwd001) {
hgwd001.setFileId(hgwd001.getProjCode());
hgwd001.setFileName(hgwd001.getProjName());
hgwd001.setDocVersion(hgwd001.getDocVersion() + 1);
DaoUtils.insert(HGWD001.INSERT, hgwd001);
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.ADD.getCode());
hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeEnd(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
}
/**
* 修改操作
*/
public void modify(HGWD001 hgwd001,List<Map<String, Object>> edcm01List) {
HGWD001 wd001 =HGWDTools.HgWd001.get(hgwd001.getId());
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPDATE.getCode());
hgwd001a.setMatId(hgwd001.getId());
if (wd001 != null && !wd001.getFileName().equals(hgwd001.getFileName())){
hgwd001a.setChangeContent("项目名称");
hgwd001a.setChangeStart(wd001.getFileName());
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(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());
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(fileType1.get(0).get("itemCname").toString());
hgwd001a.setChangeEnd(fileType2.get(0).get("itemCname").toString());
HGWDTools.HgWd001.add(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
}
}
...@@ -7,13 +7,13 @@ import com.baosight.hggp.core.constant.S3Constant; ...@@ -7,13 +7,13 @@ 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.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools; import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.ds.domain.HGDS002; 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.tools.HGWDTools; import com.baosight.hggp.hg.wd.tools.HGWDTools;
import com.baosight.hggp.util.FileUtils; import com.baosight.hggp.util.*;
import com.baosight.hggp.util.LogUtils;
import com.baosight.iplat4j.core.ProjectInfo; import com.baosight.iplat4j.core.ProjectInfo;
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;
...@@ -44,7 +44,7 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -44,7 +44,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 HGCW999().eiMetadata); inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (PlatException e) { } catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败"); LogUtils.setDetailMsg(inInfo, e, "初始化失败");
} }
...@@ -61,11 +61,9 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -61,11 +61,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override @Override
public EiInfo query(EiInfo inInfo) { public EiInfo query(EiInfo inInfo) {
try { try {
// 项目环境 Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) { if(StringUtils.isNotEmpty(queryRow.get(HGDM099.FIELD_BIZ_ID).toString())){
inInfo = super.query(inInfo, "HGCW999.queryRun", new HGCW999()); inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
} else {
inInfo = super.query(inInfo, "HGCW999.queryDev", new HGCW999());
} }
} catch (Throwable e) { } catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败"); LogUtils.setDetailMsg(inInfo, e, "查询失败");
...@@ -73,39 +71,6 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -73,39 +71,6 @@ public class ServiceHGWD099 extends ServiceEPBase {
return inInfo; return inInfo;
} }
public EiInfo queryDoc(EiInfo inInfo) {
try {
String docId = inInfo.getString("docId");
HGCW999 HGCW999 = new HGCW999();
List<HGCW999> list = new ArrayList<>();
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
// 项目环境
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
list = this.dao.query("HGCW999.queryRun",map);
} else {
list = this.dao.query("HGCW999.queryDev",map);
}
if (CollectionUtils.isNotEmpty(list)) {
HGCW999 = list.get(0);
inInfo.set("data",HGCW999);
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
public void add(HGCW999 HGCW999) {
DaoUtils.insert("HGCW999.insert", HGCW999);
}
public void deleteEntity(HGCW999 HGCW999) {
DaoUtils.update("HGCW999.delete", HGCW999);
}
/** /**
* 新增操作 * 新增操作
* *
...@@ -118,10 +83,11 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -118,10 +83,11 @@ 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) {
HGCW999 fSc002A = new HGCW999(); HGDM099 hgdm099 = new HGDM099();
fSc002A.fromMap(resultRow); hgdm099.fromMap(resultRow);
this.add(fSc002A); hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(fSc002A.getMatId()); DaoUtils.insert(HGDM099.INSERT, hgdm099);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) { if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A(); HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode()); hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
...@@ -130,8 +96,8 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -130,8 +96,8 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjName(hgwd001.getProjName()); hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode()); hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件"); hgwd001a.setChangeContent("上传附件");
hgwd001a.setChangeEnd(fSc002A.getDocName()); hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(fSc002A.getDocId()); hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
...@@ -156,14 +122,12 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -156,14 +122,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override @Override
public EiInfo delete(EiInfo inInfo) { public EiInfo delete(EiInfo inInfo) {
try { try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows(); List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HGCW999 fSc002A = new HGCW999(); HGDM099 hgdm099 = new HGDM099();
fSc002A.fromMap(resultRow); hgdm099.fromMap(resultRow);
matId = fSc002A.getMatId(); DaoUtils.update(HGDM099.DELETE, hgdm099);
this.deleteEntity(fSc002A); HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
HGWD001 hgwd001 = HGWDTools.HgWd001.get(matId);
if (hgwd001 != null) { if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A(); HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode()); hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
...@@ -172,16 +136,14 @@ public class ServiceHGWD099 extends ServiceEPBase { ...@@ -172,16 +136,14 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjName(hgwd001.getProjName()); hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode()); hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件"); hgwd001a.setChangeContent("删除附件");
hgwd001a.setChangeEnd(fSc002A.getDocName()); hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(fSc002A.getDocId()); hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId()); hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a); HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0); hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001); HGWDTools.HgWd001.updateStatus(hgwd001);
} }
} }
//List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
//inInfo.addBlock(EiConstant.resultBlock).addRows(hgcw999List);
inInfo.setStatus(EiConstant.STATUS_DEFAULT); inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!"); inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
RELEASE_DATE RELEASE_DATE
) VALUES ( ) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,#leafLevel#,#parentId# #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,#leafLevel#,#parentId#,
#fileId#, #fileType#, #fileName#, #fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate# #docVersion#, #status#, #remark#, #releaseDate#
<selectKey resultClass="long" keyProperty="id"> <selectKey resultClass="long" keyProperty="id">
...@@ -229,16 +229,21 @@ ...@@ -229,16 +229,21 @@
ORDER BY CREATED_TIME DESC ORDER BY CREATED_TIME DESC
</select> </select>
<!-- 组织机构子节点树查询 --> <!-- 文档库子节点树查询 -->
<select id="queryOrganiation" resultClass="java.util.HashMap"> <select id="queryOrganiation" resultClass="java.util.HashMap">
SELECT SELECT
A.COMPANY_CODE as "companyCode", <!-- 公司编码 -->
A.COMPANY_NAME as "companyName", <!-- 公司名称 -->
A.PROJ_CODE as "projCode", <!-- 项目编码 -->
A.PROJ_NAME as "projName", <!-- 项目名称 -->
A.FILE_ID as "label", A.FILE_ID as "label",
A.FILE_ID as "ename", A.FILE_ID as "ename",
A.FILE_NAME as "text", A.FILE_NAME as "text",
A.FILE_TYPE as "leaf", A.FILE_TYPE as "leaf",
A.FILE_TYPE as "type", A.FILE_TYPE as "type",
A.PARENT_ID as "parentId", A.PARENT_ID as "parentId",
A.DELETE_FLAG as "isDeleted" A.DELETE_FLAG as "isDeleted",
A.LEAF_LEVEL as "leafLevel"
FROM ${hggpSchema}.HGWD001 A INNER JOIN ${hggpSchema}.HGWD003 B ON A.FILE_ID = B.FILE_ID 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">
...@@ -248,7 +253,7 @@ ...@@ -248,7 +253,7 @@
A.PARENT_ID = #node# A.PARENT_ID = #node#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode"> <isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode# A.COMPANY_CODE = #companyCode#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode"> <isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode# A.ACCOUNT_CODE = #accountCode#
...@@ -256,7 +261,37 @@ ...@@ -256,7 +261,37 @@
<isNotEmpty prepend=" AND " property="userId"> <isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #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
order by A.CREATED_TIME asc order by A.CREATED_TIME asc
</select> </select>
<!--档库所有子节点树查询-->
<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"
FROM (
SELECT
@CODES AS CODES,
(
SELECT @CODES:=GROUP_CONCAT(FILE_ID)
FROM ${hggpSchema}.HGWD001
WHERE FIND_IN_SET(PARENT_ID, @CODES)
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
AND DELETE_FLAG = 0
) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL
FROM ${hggpSchema}.HGWD001,
<isNotEmpty property="parentId">
(SELECT @CODES:=#parentId#, @LEVEL:= 0) T4
</isNotEmpty>
WHERE @CODES IS NOT NULL
) T2,
${hggpSchema}.HGWD001 T3
WHERE T3.DELETE_FLAG = 0
AND FIND_IN_SET(T3.FILE_ID, T2.CODES)
ORDER BY T3.FILE_ID ASC
</select>
</sqlMap> </sqlMap>
...@@ -61,6 +61,14 @@ public class HGWDTools { ...@@ -61,6 +61,14 @@ public class HGWDTools {
AssertUtils.isNull(hgwd001, "文档对象不能为空"); AssertUtils.isNull(hgwd001, "文档对象不能为空");
DaoUtils.update("HGWD001.updateStatus", hgwd001); DaoUtils.update("HGWD001.updateStatus", hgwd001);
} }
public static void checkProjCode(String projCode) {
AssertUtils.isNull(projCode, "项目不能为空!");
Map queryMap = new HashMap<>();
queryMap.put(HGWD001.FIELD_FILE_ID, projCode);
List results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
AssertUtils.isTrue(!CollectionUtils.isEmpty(results), "项目已存在,不能重复添加!");
}
} }
......
...@@ -271,7 +271,9 @@ ...@@ -271,7 +271,9 @@
ORG_NODE_TYPE as "leaf", ORG_NODE_TYPE as "leaf",
ORG_TYPE as "type", ORG_TYPE as "type",
PARENT_ORG_ID as "parentOrgId", PARENT_ORG_ID as "parentOrgId",
IS_DELETED as "isDeleted" IS_DELETED as "isDeleted",
COMPANY_CODE as "companyCode",
COMPANY_NAME as "companyName"
FROM ${platSchema}.TXSOG01 WHERE 1=1 FROM ${platSchema}.TXSOG01 WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery"> <isEmpty prepend=" AND " property="deletedQuery">
IS_DELETED = '0' IS_DELETED = '0'
......
...@@ -20,8 +20,7 @@ $(function () { ...@@ -20,8 +20,7 @@ $(function () {
let template = ''; let template = '';
if (item.companyCode && item.projCode) { if (item.companyCode && item.projCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.projCode + '\',\'' + item.projName + '\'' + + 'onclick="showUploadFile(\'' + item.companyCode + '\',\'' + item.projCode + '\',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\')" >计划详情</a>';
',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\',\'' + item.status + '\')" >计划详情</a>';
if (auditStatus == 0) { if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' + template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >提交</a>'; 'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
...@@ -245,16 +244,13 @@ let query = function () { ...@@ -245,16 +244,13 @@ let query = function () {
* *
* @param id * @param id
*/ */
function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCode,planMaterialName,status) { function showUploadFile(companyCode,projCode,planMaterialCode,planMaterialName) {
JSColorbox.open({ JSColorbox.open({
href: "HGSC009A?methodName=initLoad&" + href: "HGSC009A?methodName=initLoad&" +
"inqu_status-0-companyCode=" + companyCode + "inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-status=" + status+
"&inqu_status-0-planMaterialCode=" + planMaterialCode + "&inqu_status-0-planMaterialCode=" + planMaterialCode +
"&inqu_status-0-projCode=" + projCode + "&inqu_status-0-projCode=" + projCode +
"&inqu_status-0-companyName=" + companyName + "&inqu_status-0-planMaterialName="+ planMaterialName,
"&inqu_status-0-planMaterialName="+ planMaterialName +
"&inqu_status-0-projName=" + projName ,
title: "<div style='text-align: center;'>材料计划清单</div>", title: "<div style='text-align: center;'>材料计划清单</div>",
width: "80%", width: "80%",
height: "80%", height: "80%",
......
let projCode = '';
var companyCode='';
$(function () { $(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows(); var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
...@@ -25,131 +23,6 @@ $(function () { ...@@ -25,131 +23,6 @@ $(function () {
$("#QUERY_2").on("click", function (e) { $("#QUERY_2").on("click", function (e) {
result2Grid.dataSource.page(1); result2Grid.dataSource.page(1);
}); });
$("#defaultExport").on("click", function (e) {
const info = new EiInfo();
EiCommunicator.send("XSOG0801", "exportOrg", info, {
onSuccess: function (response) {
if (response.status == 0) {
NotificationUtil("导出成功");
let fileName = response.get("fileName");
let url = "../lessees/user/export/" + fileName;
window.open(url);
}
}, onFail: function (errorMsg, status, e) { /* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
console.log(errorMsg);
}
});
});
$("#customExport").on("click", function (e) {
const info = new EiInfo();
EiCommunicator.send("XSOG0801", "exportCustomUser", info, {
onSuccess: function (response) {
if (response.status == 0) {
NotificationUtil("导出成功");
let fileName = response.get("fileName");
let url = "../lessees/user/export/" + fileName;
window.open(url);
}
}, onFail: function (errorMsg, status, e) { /* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
console.log(errorMsg);
}
});
});
$("#customExportSettting_1").on("click", function (e) {
$("#exportSettingWindow").data("kendoWindow").center();
$("#exportSettingWindow").data("kendoWindow").open();
result4Grid.dataSource.page(1);
result5Grid.dataSource.page(1);
});
$("#customExportSettting_2").on("click", function (e) {
$("#exportSettingWindow").data("kendoWindow").center();
$("#exportSettingWindow").data("kendoWindow").open();
result4Grid.dataSource.page(1);
result5Grid.dataSource.page(1);
});
// 上传组件
(function () {
const fileUploader = function (options) {
const GET_IMP_INFO = "getImpInfo";
var element = $("#" + options.id);
// 执行导入前先在后台检测导入信息是否合法
var saveUrl = IPLATUI.CONTEXT_PATH + "/XS/UP/XSUPImport.jsp?ename="
+ options.ename + "&serviceName=" + options.serviceName
+ "&methodName=" + GET_IMP_INFO;
$.extend(options, {
async: {
saveUrl: saveUrl
},
success: function (data) {
// 前置检查成功时,执行导入
let eiInfo = new EiInfo()
eiInfo.set("impModel", options.impModel)
EiCommunicator.send(options.serviceName, options.methodName, eiInfo, {
onSuccess: function (response) {
IPLAT.alert(response.msg);
}, onFail: function (errorMsg, status, e) { /* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
console.log(errorMsg);
}
});
},
error: function (data) {
IPLAT.alert(data?.response?.msg);
}
});
return element.kendoUpload(options).data("kendoUpload");
};
fileUploader({
id: "fileAll_0",
ename: "fileAll_0",
serviceName: "XSOG0801",
methodName: "importOrgAndUser",
impModel: "0"
});
fileUploader({
id: "fileAll_1",
ename: "fileAll_1",
serviceName: "XSOG0801",
methodName: "importOrgAndUser",
impModel: "1"
});
fileUploader({
id: "fileAll_2",
ename: "fileAll_2",
serviceName: "XSOG0801",
methodName: "importOrgAndUser",
impModel: "2"
});
fileUploader({
id: "fileAll_3",
ename: "fileAll_3",
serviceName: "XSOG0801",
methodName: "importCustomUser",
impModel: "0"
});
fileUploader({
id: "fileAll_4",
ename: "fileAll_4",
serviceName: "XSOG0801",
methodName: "importCustomUser",
impModel: "1"
});
fileUploader({
id: "fileAll_5 ",
ename: "fileAll_5",
serviceName: "XSOG0801",
methodName: "importCustomUser",
impModel: "2"
});
})();
// 分割线组件 // 分割线组件
(function () { (function () {
splitter = $("#splitter").kendoSplitter({ splitter = $("#splitter").kendoSplitter({
...@@ -221,150 +94,29 @@ $(function () { ...@@ -221,150 +94,29 @@ $(function () {
window.closeDrawer = closeDrawer; window.closeDrawer = closeDrawer;
window.openDrawer = openDrawer; window.openDrawer = openDrawer;
})(); })();
// 注册模块
(function () {
$(window).load(function () {
resultGrid.setEiInfo(__eiInfo);
});
$(document.body).on("click", "#QUERY", function (e) {
var loginName = $("[name = 'inqu_status-0-loginName']").val();
var userName = $("[name = 'inqu_status-0-userName']").val();
var userGroupEname = $("[name = 'inqu_status-0-userGroupEname']").val();
$("#inqu_status-0-loginName").val(loginName);
$("#inqu_status-0-userName").val(userName);
$("#inqu_status-0-userGroupEname").val(userGroupEname);
resultGrid.dataSource.page(1);
});
var validator1 = IPLAT.Validator({
errorTemplate: "<span class='k-widget k-tooltip k-tooltip-validation' style='width: 300px; text-align: left'><span class='k-icon k-i-warning'> </span> #=message#</span>",
id: "registerUser",
groupName: "group1"
});
window.validator1 = validator1;
$("#inqu_status-0-loginName").change(function () {
var regex = /^[_a-zA-Z0-9]{1,64}$/;
var loginName = $(this).val();
loginName = loginName.trim();
if (!regex.test(loginName)) {
return false;
}
var inInfo = new EiInfo();
inInfo.set("loginName", loginName);
EiCommunicator.send("XS0102", "checkLoginName", inInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
$("#inqu_status-0-loginName-prompt").attr("style", "color:red");
$("#inqu_status-0-loginName-prompt").html("【" + ei.getMsg() + "】");
$("#REGISTERNEWUSER").attr("disabled", true);
} else {
$("#inqu_status-0-loginName-prompt").attr("style", "color:blue");
$("#inqu_status-0-loginName-prompt").html("【该登录账号可以使用】");
$("#REGISTERNEWUSER").attr("disabled", false);
}
}, onFail: function (ei) {
$("#inqu_status-0-loginName-prompt").html("【该登录账号无法使用】");
}
})
});
$("#inqu_status-0-password").change(function () {
var checkpasswordSwitch = $("#checkpasswordSwitch").val();
if ("on" == checkpasswordSwitch) {
var password = $(this).val();
password = password.trim();
var inInfo = new EiInfo();
inInfo.set("password", password);
EiCommunicator.send("XS0102", "checkPassword", inInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
$("#inqu_status-0-password-prompt").attr("style", "color:red");
$("#inqu_status-0-password-prompt").html("【" + ei.getMsg() + "】");
$("#REGISTERNEWUSER").attr("disabled", true);
} else {
$("#inqu_status-0-password-prompt").attr("style", "color:blue");
$("#inqu_status-0-password-prompt").html("【" + ei.getMsg() + "】");
$("#REGISTERNEWUSER").attr("disabled", false);
}
}, onFail: function (ei) {
$("#inqu_status-0-password-prompt").html("【" + ei.getMsg() + "】");
}
})
}
});
$("#REGISTERNEWUSER").click(function () {
var arr = Object.keys(window.validator1._errors);
if (arr.length > 0) {
IPLAT.alert("新增失败,请检查填写格式是否正确");
return false;
}
var eiInfo = new EiInfo();
eiInfo.setByNode("inqua");
if ($('#cryptoPasswordEnable').val() === 'on') {
var loginName = RSAEncrypt(eiInfo.blocks.details.rows[0][0]);
var userName = eiInfo.blocks.details.rows[0][1];
var rsaPassword = RSAEncrypt(eiInfo.blocks.details.rows[0][2]);
var rsaRePassword = RSAEncrypt(eiInfo.blocks.details.rows[0][3]);
eiInfo.blocks.details.rows[0][0] = loginName;
eiInfo.blocks.details.rows[0][1] = userName;
eiInfo.blocks.details.rows[0][2] = rsaPassword;
eiInfo.blocks.details.rows[0][3] = rsaRePassword;
}
EiCommunicator.send("XS0102", "insert", eiInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg());
} else {
IPLAT.alert({
message: '<b>注册成功!</b>',
okFn: function (e) {
$("#REGISTERUSER").data("kendoWindow").close();
result1Grid.dataSource.page(1);
},
title: '提示信息'
});
clearInput();
}
}, onFail: function (ei) {
IPLAT.alert(ei.getMsg());
}
})
const clearInput = () => {
$("#details-0-loginName").val("");
$("#details-0-userName").val("");
$("#details-0-password").val("");
$("#details-0-rePass").val("");
$("#details-0-mobile").val("");
$("#details-0-email").val("");
IPLAT.EFSelect.value($("#details-0-gender"), 1)
}
});
})();
} }
init(); init();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
IPLATUI.EFTree = { IPLATUI.EFTree = {
"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;
$("[name = 'inqu_status-0-parentOrgId']").val(labelValue); $("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-parentOrgType']").val(typeValue); $("[name = 'inqu_status-0-bizId']").val(labelValue);
$("[name = 'inqu_status-0-parentOrgEname']").val(eNameValue); $("[name = 'inqu_status-0-fileId']").val(eNameValue);
$("[name = 'inqu_status-0-orgCname']").val(_data.text); $("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel==null?0:_data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-companyCode']").val(_data.companyCode);
$("[name = 'inqu_status-0-type']").val(_data.type);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 编辑、删除树节点时,需要刷新的树节点 // 编辑、删除树节点时,需要刷新的树节点
$("[name = 'inqu_status3-0-orgParentId']").val(_data.parentId); $("[name = 'inqu_status-0-orgParentId']").val(_data.parentId);
}, },
/*ROOT:{label: 'root',text: '组织机构'},*/ /*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) { template: function (node) {
...@@ -385,6 +137,15 @@ $(function () { ...@@ -385,6 +137,15 @@ $(function () {
// title = title + ' [岗位]'; // title = title + ' [岗位]';
icon = 'fa fa-user' icon = 'fa fa-user'
break; break;
case ' ':
icon = 'fa fa-folder'
break;
case '10':
icon = 'fa fa-clipboard'
break;
case '20':
icon = 'fa fa-clipboard'
break;
default : default :
icon = 'fa fa-home' icon = 'fa fa-home'
} }
...@@ -444,70 +205,47 @@ $(function () { ...@@ -444,70 +205,47 @@ $(function () {
// 树节点增删改查 // 树节点增删改查
/** /**
* 树节点查询
*/
$("#search").on("click", () => {
let tree = $("#categoryTree").data("kendoTreeView");
let eiInfo = new EiInfo();
let leafName = $("#searchText").val();
if (leafName == null || leafName.trim() === '') {
tree.reload("root");
return
}
eiInfo.set("leafName", leafName);
EiCommunicator.send("XSOG0800", "searchNodePath", eiInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg());
} else {
// 获取所有满足条件的子节点路径
const allPath = ei.get("allPath")
if (allPath.length > 0) {
tree.reload("root");
// 根据路径一层层展开树节点
// 先剔除重复的节点
let expandNodes = []
for (let path of allPath) {
for (let index = 0; index < path.length - 1; index++) {
if (-1 === expandNodes.indexOf(path[index])) {
expandNodes.push(path[index]);
}
}
}
expandTreeNodeList(tree, expandNodes);
}
}
}, onFail: function (ei) {
IPLAT.alert(ei.getMsg());
}
});
})
/**
* 组织机构树节点新增(新增组织机构) * 组织机构树节点新增(新增组织机构)
*/ */
$("#add").on("click", () => { $("#add").on("click", () => {
const parentId = $("#inqu_status-0-parentId").val() const parentId = $("#inqu_status-0-parentId").val();
let projCode = $("#inqu_status-0-projCode").val();
let companyCode = $("#inqu_status-0-companyCode").val();
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
if (null == parentId || "" === parentId) { if (null == parentId || "" === parentId) {
IPLAT.alert("请在组织机构树选择任意节点后新增组织机构") message2("文档库", "请在文档库树选择公司节点后编辑文档库");
return
}
if (null == companyCode || "" === companyCode || "root" === companyCode) {
message2("文档库", "请在文档库树选择公司节点后编辑文档库");
return
}
if (leafLevel == 3) {
message2("文档库", "无法在当前节点新增");
return return
} }
// $("#inqu_status2-0-parentOrgId").val(parentId) if (type == "company"){
// $("#inqu_status2-0-parentOrgEname").val(parentId) let params = "&inqu_status-0-parentId=" + parentId+"&inqu_status-0-companyCode="+companyCode+"" +
// $("#inqu_status2-0-orgEname").val("") "&inqu_status-0-projCode="+projCode+"&inqu_status-0-leafLevel="+leafLevel;
// $("#inqu_status2-0-orgCname").val("") JSColorbox.open({
// IPLAT.EFSelect.value($("#inqu_status2-0-orgType"), "") href: "HGWD001G?methodName=initLoad" + params,
// result2Grid.dataSource.page(1) title: "<div style='text-align: center;'>新增项目</div>",
// $("#insertOrgWindow").data("kendoWindow").open(); width: "70%",
let params = "&inqu_status-0-parentId=" + parentId; height: "70%",
callbackName: addCallback
});
}else {
let params = "&inqu_status-0-parentId=" + parentId+"&inqu_status-0-companyCode="+companyCode+"" +
"&inqu_status-0-projCode="+projCode+"&inqu_status-0-leafLevel="+leafLevel;
JSColorbox.open({ JSColorbox.open({
href: "XSOG0801A?methodName=initLoad" + params, href: "HGWD001E?methodName=initLoad" + params,
title: "<div style='text-align: center;'>新增子组织机构</div>", title: "<div style='text-align: center;'>新增文件</div>",
width: "70%", width: "70%",
height: "70%", height: "70%",
callbackName: addCallback callbackName: addCallback
}); });
}
}) })
/** /**
...@@ -516,18 +254,18 @@ $(function () { ...@@ -516,18 +254,18 @@ $(function () {
$("#remove").on("click", () => { $("#remove").on("click", () => {
const orgId = $("#inqu_status-0-parentId").val() const orgId = $("#inqu_status-0-parentId").val()
if (null == orgId || "" === orgId || "root" === orgId) { if (null == orgId || "" === orgId || "root" === orgId) {
IPLAT.alert("请在文档库树选择任意节点后删除文档库") message2("文档库", "请在文档库树选择任意节点后删除文档库");
return return
} }
$("#deleteOrgWindow").data("kendoWindow").center() $("#deleteOrgWindow").data("kendoWindow").center()
$("#deleteOrgWindow").data("kendoWindow").open(); $("#deleteOrgWindow").data("kendoWindow").open();
}) })
/*删除组织机构*/
$("#deleteOrg").on("click", () => { $("#deleteOrg").on("click", () => {
const orgEname = $("#inqu_status-0-parentOrgEname").val() const orgEname = $("#inqu_status-0-fileId").val()
let eiInfo = new EiInfo(); let eiInfo = new EiInfo();
eiInfo.set("result-0-orgEname", orgEname) eiInfo.set("result-0-fileId", orgEname)
EiCommunicator.send("XSOG0801", "deleteOrgByEname", eiInfo, { EiCommunicator.send("HGWD001", "delete", eiInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (-1 == ei.getStatus()) { if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg()); IPLAT.alert(ei.getMsg());
...@@ -546,12 +284,12 @@ $(function () { ...@@ -546,12 +284,12 @@ $(function () {
} }
}); });
}) })
/*删除组织及子节点*/
$("#deleteOrgAndChildren").on("click", () => { $("#deleteOrgAndChildren").on("click", () => {
const orgId = $("#inqu_status-0-parentOrgId").val() const orgId = $("#inqu_status-0-parentId").val()
let eiInfo = new EiInfo(); let eiInfo = new EiInfo();
eiInfo.set("result-0-orgId", orgId) eiInfo.set("result-0-fileId", orgId)
EiCommunicator.send("XSOG0801", "deleteOrgAndChildrenById", eiInfo, { EiCommunicator.send("HGWD001", "deleteOrgAndChildrenById", eiInfo, {
onSuccess: function (ei) { onSuccess: function (ei) {
if (-1 == ei.getStatus()) { if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg()); IPLAT.alert(ei.getMsg());
...@@ -559,7 +297,7 @@ $(function () { ...@@ -559,7 +297,7 @@ $(function () {
IPLAT.NotificationUtil(ei.getMsg(), "success") IPLAT.NotificationUtil(ei.getMsg(), "success")
$("#deleteOrgWindow").data("kendoWindow").close(); $("#deleteOrgWindow").data("kendoWindow").close();
const tree = $('#categoryTree').data('kendoTreeView'); const tree = $('#categoryTree').data('kendoTreeView');
const parentId = $("#inqu_status3-0-orgParentId").val(); const parentId = $("#inqu_status-0-orgParentId").val();
// 刷新树节点 // 刷新树节点
tree.reload(parentId); tree.reload(parentId);
// 展开树 // 展开树
...@@ -572,22 +310,43 @@ $(function () { ...@@ -572,22 +310,43 @@ $(function () {
}) })
$("#edit").on("click", () => { $("#edit").on("click", () => {
const orgId = $("#inqu_status-0-parentOrgId").val() const orgId = $("#inqu_status-0-parentId").val();
let projCode = $("#inqu_status-0-projCode").val();
let companyCode = $("#inqu_status-0-companyCode").val();
let leafLevel = parseInt($("#inqu_status-0-leafLevel").val())+1;
let type = $("#inqu_status-0-type").val();
if (null == orgId || "" === orgId || "root" === orgId) { if (null == orgId || "" === orgId || "root" === orgId) {
IPLAT.alert("请在组织机构树选择任意节点后编辑组织机构") message2("文档库", "请在文档库树选择公司节点后编辑文档库");
return
}
if (null == companyCode || "" === companyCode || "root" === companyCode) {
message2("文档库", "请在文档库树选择公司节点后编辑文档库");
return
}
if (leafLevel == 1) {
message2("文档库", "无法在当前节点编辑");
return return
} }
// $("#inqu_status3-0-orgId").val(orgId) if (leafLevel == "2"){
// result3Grid.dataSource.page(1) let params = "&inqu_status-0-fileId="+orgId+"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-projCode="+projCode;
// $("#editOrgWindow").data("kendoWindow").open(); JSColorbox.open({
let params = "&inqu_status-0-orgId=" + orgId; href: "HGWD001G?methodName=initLoad" + params,
title: "<div style='text-align: center;'>编辑项目</div>",
width: "70%",
height: "70%",
callbackName: addCallback
});
}else if (leafLevel == 3){
let params = "&inqu_status-0-fileId=" + orgId +"&inqu_status-0-companyCode="+companyCode+"&inqu_status-0-projCode="+projCode;
JSColorbox.open({ JSColorbox.open({
href: "XSOG0801B?methodName=initLoad" + params, href: "HGWD001F?methodName=initLoad" + params,
title: "<div style='text-align: center;'>编辑组织机构</div>", title: "<div style='text-align: center;'>编辑文件</div>",
width: "70%", width: "70%",
height: "70%", height: "70%",
callbackName: editCallback callbackName: editCallback
}); });
}
}) })
$("#categoryTree").mousedown(function (e) { $("#categoryTree").mousedown(function (e) {
...@@ -612,17 +371,21 @@ $(function () { ...@@ -612,17 +371,21 @@ $(function () {
var data = tree.dataItem(uidNode[0]); var data = tree.dataItem(uidNode[0]);
const orgId = data.label; const orgId = data.label;
const parentOrgId = data.parentOrgId; const parentOrgId = data.parentId;
// 选中对应的树 // 选中对应的树
selectTreeNode(tree, orgId); selectTreeNode(tree, orgId);
// 设置当前选中的节点信息 // 设置当前选中的节点信息
$("[name = 'inqu_status-0-parentId']").val(orgId); $("[name = 'inqu_status-0-parentId']").val(orgId);
$("[name = 'inqu_status-0-parentOrgType']").val(data.type); $("[name = 'inqu_status-0-bizId']").val(orgId);
$("[name = 'inqu_status-0-parentOrgEname']").val(data.ename); $("[name = 'inqu_status-0-projCode']").val(data.projCode);
$("[name = 'inqu_status-0-orgCname']").val(data.text); $("[name = 'inqu_status-0-companyCode']").val(data.companyCode);
$("[name = 'inqu_status-0-type']").val(data.type);
$("[name = 'inqu_status-0-fileId']").val(data.ename);
$("[name = 'inqu_status-0-fileName']").val(data.text);
$("[name = 'inqu_status-0-leafLevel']").val(data.leafLevel==null?0:data.leafLevel);
resultGrid.dataSource.page(1); resultGrid.dataSource.page(1);
// 编辑、删除树节点时,需要刷新的树节点 // 编辑、删除树节点时,需要刷新的树节点
$("[name = 'inqu_status3-0-orgParentId']").val(parentOrgId); $("[name = 'inqu_status-0-orgParentId']").val(parentOrgId);
if (button.data("type") === "create") { if (button.data("type") === "create") {
$("#add").click() $("#add").click()
...@@ -640,6 +403,7 @@ $(function () { ...@@ -640,6 +403,7 @@ $(function () {
this.expandPath(['root']); this.expandPath(['root']);
}, 1000) }, 1000)
}, },
selectTreeNode: {},
// expandLevel:1, // expandLevel:1,
/** /**
* 开启结点拖拽功能,默认dragAndDrop = false不开启, * 开启结点拖拽功能,默认dragAndDrop = false不开启,
...@@ -649,105 +413,7 @@ $(function () { ...@@ -649,105 +413,7 @@ $(function () {
} }
}; };
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.deviceStatus;
let template = '';
if (item.id) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\')" >变更记录</a>';
}
return template;
}
}, {
field: "companyCode",
title: "公司名称",
filter: function (option) {
return _.filter(option.values, function (item) {
return item["param1Field"]!="root";
})
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
return dataItem["companyCode"];
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "文档库_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "projCode") {
let item = e.items[0];
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]["valueField"] === item["projCode"]) {
resultGrid.setCellValue(item, 'projName', projCodeBox[i]["textField"]);
if (isBlank(item["companyCode"])) {
resultGrid.setCellValue(item, 'companyCode',
projCodeBox[i]["param1Field"] == "null"
? "" : projCodeBox[i]["param1Field"]
);
resultGrid.setCellValue(item, 'companyName',
projCodeBox[i]["param2Field"] == "null"
? "" : projCodeBox[i]["param2Field"]
);
}
break;
}
}
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
IPLATUI.EFGrid = { IPLATUI.EFGrid = {
"result": { "result": {
...@@ -760,7 +426,7 @@ $(function () { ...@@ -760,7 +426,7 @@ $(function () {
const model = e.items[i]; const model = e.items[i];
if (model.isNew()) { if (model.isNew()) {
e.preventDefault(); e.preventDefault();
const orgId = $("#inqu_status-0-parentOrgId").val(); const orgId = $("#inqu_status-0-parentId").val();
if (orgId === "root" || orgId === "" || orgId == null) { if (orgId === "root" || orgId === "" || orgId == null) {
IPLAT.alert("请选择左侧组织机构组树节点后再进行新增"); IPLAT.alert("请选择左侧组织机构组树节点后再进行新增");
} else { } else {
...@@ -821,211 +487,36 @@ $(function () { ...@@ -821,211 +487,36 @@ $(function () {
} }
}) })
$("#EXPORT").on("click", () => { // 附件上传
$("#exportWindow").data("kendoWindow").center(); $("#UPLOAD_FILE").on("click", uploadFile);
$("#exportWindow").data("kendoWindow").open();
})
$("#IMPORT").on("click", () => {
$("#importWindow").data("kendoWindow").open();
})
}, },
columns: [
{
field: "operation",
title: "扩展信息",
width: 120,
readonly: true,
headerTemplate: "<span style='display:block;text-align:center;'>详细信息</span>",
template: "<span style='display:block;text-align: center;'>" +
// "<input class='i-btn-sm fa fa fa-eye' type='button' value='详细信息' onclick='user_ex_btn_func($(this))'>" +
"<button class='i-btn-sm fa fa fa-eye' value='详细信息' onclick='user_ex_btn_func($(this))'>" + "</button>" +
"</span>"
}
],
},
"result1": {
exportGrid: false,
loadComplete: (grid) => {
$(".k-grid-REGISTER").on("click", function (e) {
$("#REGISTERUSER").data("kendoWindow").open();
$("#inqu_status-0-loginName").val("");
$("#inqu_status-0-userName").val("");
$("#REGISTERUSER_wnd_title").css({"text-align": "justify", "font-size": "14px", "color": "#FFF"});
$("#REGISTERUSER_wnd_title").html("正在注册新用户");
});
/**
* 添加用户按钮
*/
$("#ADD_1").on("click", () => {
const users = result1Grid.getCheckedRows()
if (users.length === 0) {
IPLAT.alert("请选择要添加的用户")
return
}
const orgId = $("#inqu_status-0-parentOrgId").val()
var inInfo = new EiInfo();
var block = new EiBlock("result");
block.getBlockMeta().addMeta(new EiColumn("orgId"));
block.getBlockMeta().addMeta(new EiColumn("userId"));
block.getBlockMeta().addMeta(new EiColumn("loginName"));
for (let i = 0; i < users.length; i++) {
block.setCell(i, "orgId", orgId);
block.setCell(i, "userId", users[i].id);
block.setCell(i, "loginName", users[i].loginName);
}
inInfo.addBlock(block)
EiCommunicator.send("XSOG0801", "insertUserByOrgId", inInfo, {
onSuccess: function (ei) {
if (1 !== ei.getStatus()) {
IPLAT.alert(ei.getMsg())
}
if (-1 !== ei.getStatus()) {
resultGrid.dataSource.page(1)
$("#insertUser").data("kendoWindow").close();
}
}, onFail: function (ei) {
$("#inqu_status-0-loginName-prompt").html("【该登录账号无法被添加】");
}
})
})
}
},
"result2": {
columns: [{
field: "establishDate",
attributes: {
class: "i-input-readonly"
}
}],
onSuccess: (e) => {
if (e.type === "create") {
refreshTree();
}
},
},
"result3": {
columns: [{
field: "establishDate",
attributes: {
class: "i-input-readonly"
}
}],
onSuccess: (e) => {
if (e.type === "update") {
setTimeout(() => {
// 刷新树节点
const tree = $("#categoryTree").data("kendoTreeView");
const orgParentId = $("#inqu_status3-0-orgParentId").val()
const treeOrgId = $("#inqu_status3-0-orgId").val()
tree.reload(orgParentId)
// 选中树节点
selectTreeNode(tree, treeOrgId);
}, 500)
}
},
},
"result4": {
loadComplete: function (grid) {
$("#ADD_4").on("click", () => {
$("#inqu_status-6-codesetCode").val('iplat.org.userBasicTemplate');
$("#userBasicWindow").data("kendoWindow").center();
$("#userBasicWindow").data("kendoWindow").open();
result6Grid.dataSource.page(1);
})
},
onDelete: function (e) { onDelete: function (e) {
const rows = result4Grid.getCheckedRows(); // 阻止默认请求,使用自定义删除
for (let i = 0; i < rows.length; i++) {
if (result4Grid.getCheckedRows()[i]?.itemCode === 'loginName') {
IPLAT.alert("【loginName】不可删除");
e.preventDefault(); e.preventDefault();
break; deleteFunc();
}
}
}, },
onSave: function (e) { columns: [
const rows = result4Grid.getCheckedRows(); {
for (let i = 0; i < rows.length; i++) { field: "operator",
if (result4Grid.getCheckedRows()[i]?.itemCode === 'loginName') { title: "操作",
if (result4Grid.getCheckedRows()[i]?.itemStatus === '0') { readonly: true,
IPLAT.alert("【loginName】不可停止启用"); template: function (item) {
e.preventDefault(); let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
break; + 'href="' + downloadHref(item.docId) + '">附件下载</a>';
} template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
if (result4Grid.getCheckedRows()[i]?.sortId !== '0') { + 'onclick="changeFile(\'' + item.docId + '\',\''+item.bizId+'\')" target="_blank">附件变更</a>';
IPLAT.alert("【loginName】排序不可更改"); return template;
e.preventDefault();
break;
}
}
}
},
onSuccess: function (e) {
showPreview();
},
},
"result5": {
loadComplete: function () {
$("#ADD_5").on("click", () => {
$("#inqu_status-6-codesetCode").val('iplat.org.userCustomTemplate');
$("#userBasicWindow").data("kendoWindow").center();
$("#userBasicWindow").data("kendoWindow").open();
result6Grid.dataSource.page(1);
})
},
onSuccess: function (e) {
if (e.type === 'create') {
// 防止按钮新增后的数据被删除时,codeset为空,删除失败,因此手动进行一次刷新
result5Grid.dataSource.page(1);
}
showPreview();
}
},
"result6": {
loadComplete: function (grid) {
$("#ADD_6").on("click", () => {
const rows = grid.getCheckedRows();
if (rows.length === 0) {
IPLAT.alert("请选择需要新增的属性");
}
let eiInfo = new EiInfo();
eiInfo.set("rows", rows);
const currentTab = $("#exportSetting").data("kendoTabStrip").select().text();
const codesetCode = currentTab === '基础信息模板' ?
'iplat.org.userBasicTemplate' : 'iplat.org.userCustomTemplate';
eiInfo.set('codesetCode', codesetCode);
EiCommunicator.send("XSOG0801", "insertUserTableHeaderImpl", eiInfo, {
onSuccess: function (response) {
if (response.status > -1) {
result4Grid.dataSource.page(1);
result5Grid.dataSource.page(1);
$("#userBasicWindow").data("kendoWindow").close();
NotificationUtil(response.getMsg());
} else {
IPLAT.alert(response.getMsg());
}
}, onFail: function (errorMsg, status, e) { /* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
console.log(errorMsg);
} }
});
})
} }
],
} }
}; };
downKeyUp(); downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询 // 查询
query(); $("#BTN_DELETE").on("click", deleteFunc);
}); });
let query = function () { let query = function () {
...@@ -1188,6 +679,7 @@ const selectTreeNode = (tree, treeOrgId) => { ...@@ -1188,6 +679,7 @@ const selectTreeNode = (tree, treeOrgId) => {
let barElement = tree.findByUid(barDataItem.uid); let barElement = tree.findByUid(barDataItem.uid);
// 刷新完成后选中对应的树节点 // 刷新完成后选中对应的树节点
tree.select(barElement); tree.select(barElement);
setTreeNodeValue(barDataItem);
} else { } else {
selectTreeNode(tree, treeOrgId) selectTreeNode(tree, treeOrgId)
} }
...@@ -1196,6 +688,20 @@ const selectTreeNode = (tree, treeOrgId) => { ...@@ -1196,6 +688,20 @@ const selectTreeNode = (tree, treeOrgId) => {
} }
/** /**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.categoryTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.categoryTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.categoryTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.categoryTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.categoryTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel = nodeData.leafLevel;
}
/**
* 非对称加密 * 非对称加密
* @param str * @param str
* @returns {string} * @returns {string}
...@@ -1318,93 +824,88 @@ function showPreview() { ...@@ -1318,93 +824,88 @@ function showPreview() {
} }
/** /**
* 保存 * 文件上传
*
* @param id
*/ */
let save = function (btnNode) { function uploadFile() {
let rows = resultGrid.getCheckedRows(); let projCode =$("#inqu_status-0-projCode").val();
if (rows.length < 1) { if (isBlank(projCode)){
message("请选择数据"); message("请先选择项目!");
return; return;
} }
let flag = true; JSColorbox.open({
$.each(rows, function(index, item) { href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
let companyCode= item.get("companyCode"); "&inqu_status-0-bizId="+$("#inqu_status-0-bizId").val()+"" +
let projCode= item.get("projName"); "&inqu_status-0-operType=add" +
if(isBlank(companyCode)){ "&efParentFormEname=HGWD001",
message("选中的第"+(index+1)+"行\"公司\",不能为空!"); title: "<div style='text-align: center;'>附件上传</div>",
flag = false; width: "60%",
return false; height: "50%",
} callbackName: uploadFileCallback
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"所属项目\",不能为空!");
flag = false;
return false;
}
}); });
if(flag) { }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () { function changeFile(docId,bizId) {
JSUtils.submitGridsData("result", "HGWD001", "save", true); JSColorbox.open({
btnNode.attr("disabled", false); href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType=WD" +
} "&inqu_status-0-bizId="+bizId+"" +
"&inqu_status-0-ndocId="+docId+"" +
"&inqu_status-0-operType=update" +
"&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>附件变更</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
}); });
}
} }
/** /**
* 发布 * 附件上传回调
*
* @param data
*/ */
function updateRelease() { function uploadFileCallback(data) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.addBlock(JSUtils.checkedRows2Block("result")) inEiInfo.set("result-0-bizId", data.bizId);
EiCommunicator.send('HGWD001', 'updateRelease', inEiInfo, { inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-docName", data.docName);
inEiInfo.set("result-0-bizType", data.bizType);
inEiInfo.set("result-0-ndocId", data.ndocId);
let serviceName = data.operType == "add" ? "HGWD099" : "HGWD001";
let methodName = data.operType == "add" ? "insert" : "updateFile";
EiCommunicator.send(serviceName, methodName, inEiInfo, {
onSuccess(response) { onSuccess(response) {
if (response.status != -1) { resultGrid.dataSource.page(1);
NotificationUtil(response.msg);
query();
} else {
NotificationUtil(response.msg, "error");
}
}, },
onFail(errorMessage, status, e) { onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error"); NotificationUtil("执行失败!", "error");
} }
}, { }, {
async: false async: false
}
);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGWD099?methodName=initLoad&inqu_status-0-bizType=WD&inqu_status-0-matId=" + id + "&efParentFormEname=HGWD001",
title: "<div style='text-align: center;'>附件清单</div>",
width: "80%",
height: "80%",
}); });
} }
/** /**
* 显示详情 * 删除
*/ */
function showDetail(id,companyCode) { function deleteFunc() {
let url = "HGWD001A?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-companyCode="+companyCode; var rows = resultGrid.getCheckedRows();
JSColorbox.open({ if (rows.length == 0) {
href: url, message("请先勾选数据!");
title: "<div style='text-align: center;'>变更记录</div>", return;
width: "75%", }
height: "95%", JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD099", "delete", true,
function (e) {
var status = e.getStatus();
if (status !== -1) {
resultGrid.dataSource.page(1);
}
}); });
}
})
} }
...@@ -12,16 +12,13 @@ ...@@ -12,16 +12,13 @@
<EF:EFPage title="文档库"> <EF:EFPage title="文档库">
<EF:EFInput ename="__LOGIN_PUBLICKEY__" value="${login_PublicKey}" type="hidden"/>
<EF:EFInput ename="cryptoPasswordEnable" value="${crypto_PasswordEnable}" type="hidden"/>
<div id="splitter" class="i-fit-height"> <div id="splitter" class="i-fit-height">
<div id="left-pane" class="i-fit-height"> <div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档库树" id="tree" fitHeight="true"> <EF:EFRegion title="文档库树" id="tree" fitHeight="true">
<div class="row" style="display: block"> <div class="row" style="display: block">
<div class="col-md-12" style="display:flex;align-items: center"> <div class="col-md-12" style="display:flex;align-items: center">
<EF:EFInput ename="searchText" colWidth="8" inline="true"/> <%--<EF:EFInput ename="searchText" colWidth="8" inline="true"/>
<EF:EFButton ename="search" class="fa fa-search" layout="2"/> <EF:EFButton ename="search" class="fa fa-search" layout="2"/>--%>
<div style="display: none"> <div style="display: none">
<EF:EFButton ename="add" class="fa fa-plus" layout="2"/> <EF:EFButton ename="add" class="fa fa-plus" layout="2"/>
<EF:EFButton ename="remove" class="fa fa-trash-o" layout="2"/> <EF:EFButton ename="remove" class="fa fa-trash-o" layout="2"/>
...@@ -33,7 +30,7 @@ ...@@ -33,7 +30,7 @@
<div id="menu" style="margin-top: 12px; margin-bottom: 8px"> <div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="categoryTree" ename="tree_name" textField="text" valueField="label" <EF:EFTree bindId="categoryTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parent_id" hasChildren="leaf" pid="parentId"
serviceName="HGWD001D" methodName="query"> serviceName="HGWD001D" methodName="query">
</EF:EFTree> </EF:EFTree>
</div> </div>
...@@ -54,16 +51,21 @@ ...@@ -54,16 +51,21 @@
<div id="right-pane" class="i-fit-height"> <div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<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="文档库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="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="文档库名称" ename="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="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/> <EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden" value="WD"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" /> <EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div> </div>
</div>
</EF:EFRegion> </EF:EFRegion>
<EF:EFRegion id="resultRegion" title="附件详情" fitHeight="true"> <EF:EFRegion id="result" title="附件详情" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query"> <EF:EFGrid blockId="result" autoDraw="no" personal="true" serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<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"/>
...@@ -75,484 +77,16 @@ ...@@ -75,484 +77,16 @@
</div> </div>
</div> </div>
<div class="drawer-wrapper">
<div class="drawer-body">
<div class="close-btn"><span class="iconfont Icon-Close icRocon-Icon-Close"></span></div>
<div class="drawer-content ruleEditContent-${theme}">
<iframe id="iframeDrawer" src="${ctx}/web/XS4100" frameborder="0"></iframe>
</div>
</div>
</div>
<%--<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFSelect blockId="inqu_status" 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_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
&lt;%&ndash;<EF:EFAutoComplete blockId="inqu_status" row="0" ename="projName" cname="项目名称"
serviceName="HGSC002" queryMethod="queryComboBox" resultId="result" dataField="projName"/>&ndash;%&gt;
<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 blockId="inqu_status" row="0" ename="fileName" cname="文件名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>--%>
<%--<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" 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"/>
</EF:EFComboColumn>
<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:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>--%>
</EF:EFPage> </EF:EFPage>
<EF:EFWindow id="insertUser" width="58%" height="70%" top="100px" left="280px">
<EF:EFRegion id="inqu1" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status1-0-loginName" cname="用户账号"/>
<EF:EFInput ename="inqu_status1-0-userName" cname="用户姓名"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result1" title="记录集">
<EF:EFGrid blockId="result1" queryMethod="queryUserOutOfOrgId" autoBind="false" autoDraw="false"
checkMode="multiple, row">
<EF:EFColumn ename="userId" locked="true" cname="用户ID" hidden="true" primaryKey="true"/>
<EF:EFColumn ename="loginName" cname="登录账号" readonly="true"/>
<EF:EFColumn ename="userName" cname="用户姓名" readonly="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="insertOrgWindow" width="58%" height="70%" top="100px" left="280px">
<EF:EFRegion id="inqu2" title="查询条件">
<div class="row">
<EF:EFInput ename="inqu_status2-0-parentId" cname="上级Id" type="hidden"/>
<EF:EFInput ename="inqu_status2-0-fileId" cname="文件ID" type="hidden"/>
<EF:EFSelect blockId="inqu_status" 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_status" row="0" ename="projName" cname="项目名称" placeholder="模糊查询" colWidth="3"/>
<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 blockId="inqu_status" row="0" ename="fileName" cname="文件名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result2Region" title="子组织机构">
<EF:EFGrid blockId="result2" autoBind="false" autoDraw="false" checkMode="multiple, row" readonly="true"
queryMethod="query" insertMethod="save">
<EF:EFColumn ename="id" primaryKey="true" 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"/>
</EF:EFComboColumn>
<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:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="editOrgWindow" width="58%" height="70%" top="100px" left="280px">
<div style="display: none">
<EF:EFRegion id="inqu3" title="查询条件">
<EF:EFInput ename="inqu_status3-0-fileId" cname="文件Id" type="hidden"/>
<EF:EFInput ename="inqu_status2-0-parentId" cname="上级Id" type="hidden"/>
</EF:EFRegion>
</div>
<EF:EFRegion id="result3Region" title="子组织机构">
<EF:EFGrid blockId="result3" autoBind="false" autoDraw="false" checkMode="multiple, row"
queryMethod="queryOrgById" updateMethod="updateOrgById">
<EF:EFColumn ename="id" primaryKey="true" 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"/>
</EF:EFComboColumn>
<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:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="deleteOrgWindow" width="350px" height="200px"> <EF:EFWindow id="deleteOrgWindow" width="350px" height="200px">
<div class="kendo-del-message"> <div class="kendo-del-message">
<span>确认删除?</span> <span>确认删除?</span>
</div> </div>
<hr style="margin-top: 0"> <hr style="margin-top: 0">
<div style="display: flex;justify-content: flex-end;"> <div style="display: flex;justify-content: flex-end;">
<EF:EFButton ename="deleteOrg" cname="删除节点"/> <%--<EF:EFButton ename="deleteOrg" cname="删除节点"/>--%>
<EF:EFButton ename="deleteOrgAndChildren" cname="删除节点及子节点"/> <EF:EFButton ename="deleteOrgAndChildren" cname="删除文档节点"/>
</div> </div>
</EF:EFWindow> </EF:EFWindow>
<EF:EFWindow id="REGISTERUSER" height="75%" width="62%" top="100px" left="250px">
<EF:EFRegion id="inqua" title="注册新用户">
<div id="registerUser">
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>登录账号</span>
</div>
<div class="col-xs-3">
<EF:EFInput cname="登录账号" ename="details-0-loginName"
data-regex="/^[_a-zA-Z0-9]{1,64}$/"
data-errorPrompt="对不起,登录账号只能是不超过64位的英文字母或者数字字符或下划线"
validateGroupName="group1" required="required" inline="true"
value="${loginPrefix}"
oninput="this.value='${loginPrefix}' + this.value.slice(this.value.indexOf('${loginPrefix}')+('${loginPrefix}'.length));"/>
</div>
<div class="col-xs-7">
<span id="details-0-loginName-prompt">【登录账号只能由不超过64位的英文字母或者数字字符或者下划线组成。】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>用户姓名</span>
</div>
<div class="col-xs-3">
<EF:EFInput cname="用户姓名" ename="details-0-userName"
trim="false" data-regex="/^[^\x22\x27]+$/" value=""
data-errorPrompt="用户姓名应该由至少一个,最多128个字节大小的字符组成,并且不能包含控制字符和单,双引号"
validateGroupName="group1" inline="true"/>
</div>
<div class="col-xs-7">
<span id="details-0-userName-prompt">【用户姓名应该由至少一个,最多128个字节大小的字符组成,并且不能包含控制字符和单,双引号。】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>登录密码</span>
</div>
<div class="col-xs-3">
<EF:EFInput type="password" cname="登录密码" ename="details-0-password" validateGroupName="group1"
trim="false" data-regex="/${pwdRgx}/" data-errorPrompt="对不起,${pwdDesc}" inline="true"
value="" autocomplete="new-password"/>
</div>
<div class="col-xs-7">
<span id="details-0-password-prompt">【${passwordTip}】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>确认密码</span>
</div>
<div class="col-xs-3">
<EF:EFInput type="password" cname="确认密码" ename="details-0-rePass"
trim="false" data-regex="/${pwdRgx}/" validateGroupName="group1"
data-errorPrompt="对不起,${pwdDesc}"
inline="true" value="" autocomplete="new-password"/>
</div>
<div class="col-xs-7">
<span id="details-0-rePass-prompt">【请再次输入登录密码】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>手机号码</span>
</div>
<div class="col-xs-3">
<EF:EFInput blockId="details" cname="手机号码" ename="mobile" row="0" trim="false"
data-regex="/^1\d{10}$/" data-errorPrompt="手机号码只能是1开头的11位数字"
validateGroupName="group1" inline="true" value=""/>
</div>
<div class="col-xs-7">
<span id="details-0-mobile-prompt">【请输入手机号码】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>电子邮件</span>
</div>
<div class="col-xs-3">
<EF:EFInput blockId="details" cname="电子邮件" ename="email" row="0" trim="false"
required="false" value=""
data-rules="email" validateGroupName="group1" inline="true"/>
</div>
<div class="col-xs-7">
<span id="details-0-email-prompt">【请输入电子邮件】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>性别</span>
</div>
<div class="col-xs-3">
<EF:EFSelect ename="details-0-gender" cname="性别"
valueTemplate="#=textField#" inline="true"
style="width: 148.8px;">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFSelect>
</div>
<div class="col-xs-7">
<span id="details-0-sex-prompt">【请输入性别】</span>
</div>
</div>
</br>
</div>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="importWindow" width="58%" height="75%" top="100px" left="280px" title="组织机构及用户导入">
<EF:EFTab id="importWindowTab">
<div title="默认模板导入">
<EF:EFRegion id="uploadAll_0" title="增量导入(不覆盖重复项)">
<EF:EFInput ename="fileAll_0" type="file" accept=".xlsx" colWidth="12"/>
</EF:EFRegion>
<EF:EFRegion id="uploadAll_1" title="增量导入(覆盖重复项)">
<EF:EFInput ename="fileAll_1" type="file" accept=".xlsx" colWidth="12"/>
</EF:EFRegion>
<EF:EFRegion id="uploadAll_2" title="全量导入(删除所有已保存信息重新导入)">
<EF:EFInput ename="fileAll_2" type="file" accept=".xlsx" colWidth="12"/>
</EF:EFRegion>
</div>
<div title="自定义模板导入">
<EF:EFRegion id="uploadAll_3" title="增量导入(不覆盖重复项)">
<EF:EFInput ename="fileAll_3" type="file" accept=".xlsx" colWidth="12"/>
</EF:EFRegion>
<EF:EFRegion id="uploadAll_4" title="增量导入(覆盖重复项)">
<EF:EFInput ename="fileAll_4" type="file" accept=".xlsx" colWidth="12"/>
</EF:EFRegion>
<EF:EFRegion id="uploadAll_5" title="全量导入(删除所有已保存信息重新导入)">
<EF:EFInput ename="fileAll_5" type="file" accept=".xlsx" colWidth="12"/>
</EF:EFRegion>
<EF:EFRegion title="自定义导入模板设置">
<div style="margin-bottom: 4px;display: flex;justify-content: flex-end;padding-right: 8px">
<EF:EFButton ename="customExportSettting_1" cname="自定义导入模板"/>
</div>
</EF:EFRegion>
</div>
</EF:EFTab>
</EF:EFWindow>
<EF:EFWindow id="showXS4100ImageWindow" width="80%" height="90%" title="查看图片">
<img id="showXS4100Image" src="" width="100%" style="object-fit: contain">
</EF:EFWindow>
<EF:EFWindow id="exportWindow" width="400px" height="200px">
<div class="kendo-del-message">
<span>请选择导出方式或配置自定义导出模板</span>
</div>
<hr style="margin-top: 0">
<div class="row" style="display: flex;justify-content: flex-end;padding-right: 8px">
<EF:EFButton ename="defaultExport" cname="默认模板导出"/>
<EF:EFButton ename="customExport" cname="自定义模板导出"/>
<EF:EFButton ename="customExportSettting_2" cname="配置自定义导出模板"/>
</div>
</EF:EFWindow>
<EF:EFWindow id="exportSettingWindow" width="80%" height="90%" title="自定义导入/导出模板">
<EF:EFTab id="exportSetting">
<div id="userBasic" title="基础信息模板" value="userBasic">
<div id="resultGridDiv4">
<EF:EFRegion id="result4Region" title="自定义基础信息模板">
<EF:EFGrid blockId="result4" autoDraw="false" toolbarConfig="true"
serviceName="XSOG0801"
queryMethod="queryUserBasicDetailTemplate"
deleteMethod="deleteUserMetadata"
updateMethod="updateUserMetadata"
>
<EF:EFColumn ename="itemCode" cname="配置编码" readonly="true" primaryKey="true"/>
<EF:EFColumn ename="itemEname" cname="属性英文名" readonly="true"/>
<EF:EFColumn ename="itemCname" cname="表头中文名" required="true"/>
<EF:EFColumn ename="sortId" cname="排序" required="true" data-regex="/^[1-9]\\\d*$/" data-errorprompt="请输入正整数"/>
<EF:EFComboColumn ename="itemStatus" cname="启用" required="true">
<EF:EFOption label="是" value="1">
</EF:EFOption>
<EF:EFOption label="否" value="0">
</EF:EFOption>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
<div id="userCustom" title="扩展信息模板" value="userCustom">
<div id="resultGridDiv5">
<EF:EFRegion id="result5Region" title="自定义扩展信息模板">
<EF:EFGrid blockId="result5" autoDraw="false" toolbarConfig="true"
serviceName="XSOG0801"
queryMethod="queryUserCustomDetailTemplate"
deleteMethod="deleteUserMetadata"
updateMethod="updateUserMetadata"
insertMethod="insertUserCustomDetailTableHeader"
>
<EF:EFColumn ename="itemCode" cname="配置编码" required="true"
readonly="true" primaryKey="true"/>
<EF:EFColumn ename="itemEname" cname="属性英文名" required="true"/>
<EF:EFColumn ename="itemCname" cname="表头中文名" required="true"/>
<EF:EFColumn ename="sortId" cname="排序" required="true" data-regex="/^[1-9]\\\d*$/" data-errorprompt="请输入正整数"/>
<EF:EFComboColumn ename="itemStatus" cname="启用" required="true">
<EF:EFOption label="是" value="1">
</EF:EFOption>
<EF:EFOption label="否" value="0">
</EF:EFOption>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFTab>
<EF:EFRegion id="excelShowArea" title="表头预览" style="margin-top:8px">
<div id="excelTable" style="padding: 16px"></div>
<div style="overflow:hidden;width:100%;padding: 16px">
<table width="100%">
<tr class="tableRow0">
<td nowrap width="12%">自定义导入/导出模板说明</td>
<td>
<span class="contentHeader"></span>:自定义导出模板由”用户基础信息”、“用户所属组织机构路径”、“用户扩展信息”三部分组成。<br/>
<span class="contentHeader"></span>:可通过“启用”或“停止启用”控制该列是否生成。<br/>
<span class="contentHeader"></span>:“用户基础信息”仅可通过“选择属性”添加,“用户扩展信息”可通过“选择属性”添加,也可通过“新增”按钮新增。<br/>
<%-- <span class="contentHeader"></span>:“用户所属组织机构路径”由当前组织机构所拥有的层级自动生成。<br/>--%>
</td>
</tr>
<tr class="tableRow1">
<td>
<br>
</td>
</tr>
<tr class="tableRow2">
<td nowrap width="9%" style="color: red">注意</td>
<td>
<span class="contentHeader" style="color: red">”用户基础信息”中,【loginName】仅可修改表头中文名,不可删除或停止启用。</span><br>
<span class="contentHeader" style="color: red">“用户扩展信息”中,【新增】当前不存在的扩展属性时,会在导入时自动生成该扩展属性。</span><br>
<span class="contentHeader" style="color: red">导入组织机构信息时,请确保所有导入组织机构信息在“组织机构”区域下。</span><br>
</td>
</tr>
</table>
</div>
</EF:EFRegion>
</EF:EFWindow>
<EF:EFWindow id="userBasicWindow" width="80%" height="90%" title="用户属性">
<EF:EFRegion id="inqu6" title="查询" style="display:none">
<EF:EFInput ename="inqu_status-6-codesetCode" cname="编号"/>
</EF:EFRegion>
<EF:EFRegion id="userBasicShowArea" title="请选择需要添加的用户属性">
<EF:EFGrid blockId="result6" autoDraw="false" toolbarConfig="true"
serviceName="XSOG0801"
queryMethod="queryUserMetadataImpl"
>
<EF:EFColumn ename="ename" cname="属性编码" readonly="true" primaryKey="true"/>
<EF:EFColumn ename="cname" cname="属性说明" readonly="true"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFWindow>
\ No newline at end of file
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
/*{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.deviceStatus;
let template = '';
if (item.id) {
/!*template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';*!/
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\')" >变更记录</a>';
}
return template;
}
},*/ {
field: "companyCode",
title: "公司名称",
filter: function (option) {
return _.filter(option.values, function (item) {
return item["param1Field"]!="root";
})
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
title: "所属项目",
filter: function (option) {
let companyCode = option['companyCode'];
if (companyCode){
return _.filter(option.values, function (item) {
return item["param1Field"]=companyCode;
})
}
return option.values;
},
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"];
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "文档库_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "projCode") {
let item = e.items[0];
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]["valueField"] === item["projCode"]) {
resultGrid.setCellValue(item, 'projName', projCodeBox[i]["textField"]);
if (isBlank(item["companyCode"])) {
resultGrid.setCellValue(item, 'companyCode',
projCodeBox[i]["param1Field"] == "null"
? "" : projCodeBox[i]["param1Field"]
);
resultGrid.setCellValue(item, 'companyName',
projCodeBox[i]["param2Field"] == "null"
? "" : projCodeBox[i]["param2Field"]
);
}
break;
}
}
}
});
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
let companyCode = $("#inqu_status-0-companyCode").val();
let projCode = $("#inqu_status-0-projCode").val();
if (!isBlank(companyCode)){
item['companyCode'] = companyCode;
}
if (!isBlank(projCode)){
item['projCode'] = projCode;
}
item['parentId'] = $("#inqu_status-0-parentId").val();
item['leafLevel'] = $("#inqu_status-0-leafLevel").val();
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
});
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
let projCode= item.get("projCode");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"所属项目\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001E", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 发布
*/
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
}
);
}
/**
* 显示详情
*/
function showDetail(id,companyCode) {
let url = "HGWD001A?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-companyCode="+companyCode;
JSColorbox.open({
href: url,
title: "<div style='text-align: center;'>变更记录</div>",
width: "75%",
height: "95%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/29
Time: 15:24
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="文档库">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="上级组织Id" blockId="inqu_status" ename="parentId" row="0" type="hidden"/>
<EF:EFInput cname="上级组织编码" blockId="inqu_status" ename="fileId" row="0" type="hidden"/>
<EF:EFInput cname="公司代码" blockId="inqu_status" ename="companyCode" 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"/>
<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 blockId="inqu_status" row="0" ename="fileName" cname="文件名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<%--<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>--%>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0" hidden="true">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
<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:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
/*{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.deviceStatus;
let template = '';
if (item.id) {
/!*template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';*!/
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\')" >变更记录</a>';
}
return template;
}
},*/ {
field: "companyCode",
title: "公司名称",
filter: function (option) {
return _.filter(option.values, function (item) {
return item["param1Field"]!="root";
})
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
return dataItem["companyCode"];
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "文档库_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "projCode") {
let item = e.items[0];
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]["valueField"] === item["projCode"]) {
resultGrid.setCellValue(item, 'projName', projCodeBox[i]["textField"]);
if (isBlank(item["companyCode"])) {
resultGrid.setCellValue(item, 'companyCode',
projCodeBox[i]["param1Field"] == "null"
? "" : projCodeBox[i]["param1Field"]
);
resultGrid.setCellValue(item, 'companyName',
projCodeBox[i]["param2Field"] == "null"
? "" : projCodeBox[i]["param2Field"]
);
}
break;
}
}
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
});
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
let projCode= item.get("projName");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"所属项目\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001F", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 发布
*/
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
}
);
}
/**
* 显示详情
*/
function showDetail(id,companyCode) {
let url = "HGWD001A?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-companyCode="+companyCode;
JSColorbox.open({
href: url,
title: "<div style='text-align: center;'>变更记录</div>",
width: "75%",
height: "95%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/29
Time: 15:25
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<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="组织编码" blockId="inqu_status" ename="fileId" row="0" type="hidden"/>
<EF:EFInput cname="公司代码" blockId="inqu_status" ename="companyCode" 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"/>
<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 blockId="inqu_status" row="0" ename="fileName" cname="文件名称" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" 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"/>
</EF:EFComboColumn>--%>
<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:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$("#QUERY").on("click", query);
IPLATUI.EFGrid= {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 50, 100],
},
columns: [
/*{
field: "operator",
title: "操作",
template: function (item) {
let auditStatus = item.deviceStatus;
let template = '';
if (item.id) {
/!*template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="uploadFile(' + item.id + ')" >附件上传</a>';*!/
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDetail(' + item.id + ',\''+item.companyCode+'\')" >变更记录</a>';
}
return template;
}
},*/ {
field: "companyCode",
title: "公司名称",
filter: function (option) {
return _.filter(option.values, function (item) {
return item["param1Field"]!="root";
})
},
template: function (dataItem) {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['valueField'] === dataItem['companyCode']){
dataItem['companyName'] = companyCodeBox[i]['textField']
return companyCodeBox[i]['textField'];
}
}
return dataItem["companyCode"];
}
}, {
field: "projCode",
title: "所属项目",
filter: function (option) {
let companyCode = option['companyCode'];
if (companyCode){
return _.filter(option.values, function (item) {
return item["param1Field"]=companyCode;
})
}
return option.values;
},
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"];
}
}
],
exportGrid: {
exportFileName: function (gridInstance) {
// 导出的文件名包含时间戳 yyyy-MM-dd HH:mm:ss
return "文档库_" + kendo.toString(new Date(), IPLAT.FORMAT.DATE_14_PR);
},
exportFileType: "xls", // 默认值是xls,可选值为pdf[规划中]
exportBlockId: "result", // 默认值和blockId相同,导出的EiInfo中的指定数据块被导出
},
loadComplete: function(grid) {
//console.log(dayjs,"dayjs")
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
$("#RELEASE").click("click",updateRelease)
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field === "projCode") {
let item = e.items[0];
for (let i = 0; i < projCodeBox.length; i++) {
if (projCodeBox[i]["valueField"] === item["projCode"]) {
resultGrid.setCellValue(item, 'projName', projCodeBox[i]["textField"]);
if (isBlank(item["companyCode"])) {
resultGrid.setCellValue(item, 'companyCode',
projCodeBox[i]["param1Field"] == "null"
? "" : projCodeBox[i]["param1Field"]
);
resultGrid.setCellValue(item, 'companyName',
projCodeBox[i]["param2Field"] == "null"
? "" : projCodeBox[i]["param2Field"]
);
}
break;
}
}
}
});
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
let companyCode = $("#inqu_status-0-companyCode").val();
let projCode = $("#inqu_status-0-projCode").val();
if (!isBlank(companyCode)){
item['companyCode'] = companyCode;
}
if (!isBlank(projCode)){
item['projCode'] = projCode;
}
item['parentId'] = $("#inqu_status-0-parentId").val();
item['leafLevel'] = $("#inqu_status-0-leafLevel").val();
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
//禁用按钮
btnNode.attr("disabled", true);
save(btnNode);
},
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
//e.preventDefault();
//deleteFunc();
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onRowClick: function (e) {
}
}
}
});
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
};
/**
* 保存
*/
let save = function (btnNode) {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
let flag = true;
$.each(rows, function(index, item) {
let companyCode= item.get("companyCode");
let projCode= item.get("projCode");
if(isBlank(companyCode)){
message("选中的第"+(index+1)+"行\"公司\",不能为空!");
flag = false;
return false;
}
if(isBlank(projCode)){
message("选中的第"+(index+1)+"行\"所属项目\",不能为空!");
flag = false;
return false;
}
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD001G", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
/**
* 发布
*/
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
}
);
}
/**
* 显示详情
*/
function showDetail(id,companyCode) {
let url = "HGWD001A?methodName=initLoad&inqu_status-0-matId="+id+"&inqu_status-0-companyCode="+companyCode;
JSColorbox.open({
href: url,
title: "<div style='text-align: center;'>变更记录</div>",
width: "75%",
height: "95%",
});
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/29
Time: 19:11
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="文档库">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="上级组织Id" blockId="inqu_status" ename="parentId" row="0" type="hidden"/>
<EF:EFInput cname="上级组织编码" blockId="inqu_status" ename="fileId" row="0" type="hidden"/>
<EF:EFInput cname="公司代码" blockId="inqu_status" ename="companyCode" row="0" type="hidden"/>
<EF:EFInput cname="项目名称" blockId="inqu_status" ename="projName" row="0" placeholder="模糊查询项目"/>
<EF:EFInput cname="层级" blockId="inqu_status" ename="leafLevel" row="0" type="hidden"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<%--<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="160" align="center"/>--%>
<EF:EFColumn ename="parentId" cname="上级ID" hidden="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="80" align="center" defaultValue="0" hidden="true">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
<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:EFColumn ename="createdName" cname="创建人" align="center" width="100" readonly="true" required="false"
enable="false"/>
<EF:EFColumn ename="createdTime" cname="创建时间" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="120" readonly="true" required="false"
enable="false"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -10,13 +10,17 @@ $(function () { ...@@ -10,13 +10,17 @@ $(function () {
} }
$("#fileDocId").val(docId); $("#fileDocId").val(docId);
NotificationUtil("附件上传成功"); NotificationUtil("附件上传成功");
var matId = $("#inqu_status-0-matId").val(); var matId = $("#inqu_status-0-bizId").val();
var bizType = $("#inqu_status-0-bizType").val(); var bizType = $("#inqu_status-0-bizType").val();
var operType = $("#inqu_status-0-operType").val();
var ndocId = $("#inqu_status-0-ndocId").val();
var data = { var data = {
docId: docId, docId: docId,
docName: e.response.docName, docName: e.response.docName,
matId: matId, bizId: matId,
bizType: bizType bizType: bizType,
operType: operType,
ndocId: ndocId
} }
// saveTemp(e); // saveTemp(e);
try { try {
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/> <c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件上传"> <EF:EFPage title="附件上传">
<EF:EFInput cname="物料ID" ename="matId" 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="ndocId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="操作类型" ename="operType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/> <EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result"> <EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="wd_file" path="WD"/> <EF:EFUpload blockId="result" ename="uploadFile" docTag="wd_file" path="WD"/>
......
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