Commit 71c014dc by liuyang

2024-08-29 文档库变更

parent fc93070f
......@@ -36,6 +36,8 @@ public class HGDM099 extends DaoEPBase {
public static final String FIELD_BIZ_ID = "bizId"; /* 业务ID*/
public static final String FIELD_DOC_ID = "docId"; /* 文件ID*/
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_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
......@@ -51,6 +53,8 @@ public class HGDM099 extends DaoEPBase {
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_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 COUNT = "HGDM099.count";
......@@ -72,6 +76,8 @@ public class HGDM099 extends DaoEPBase {
private String bizId = " "; /* 业务ID*/
private String docId = " "; /* 文件ID*/
private String docName = " "; /* 文件名称*/
private Integer previewNum = new Integer(0); /* 预览次数*/
private Integer downloadNum = new Integer(0); /* 下载次数*/
/**
* initialize the metadata.
......@@ -136,6 +142,14 @@ public class HGDM099 extends DaoEPBase {
eiColumn.setDescName("文件名称");
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 {
public void setDocName(String 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.
*
......@@ -391,6 +438,8 @@ public class HGDM099 extends DaoEPBase {
setBizId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_BIZ_ID)), bizId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
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 {
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_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;
}
......
......@@ -15,7 +15,9 @@
BIZ_TYPE as "bizType", <!-- 业务类型 -->
BIZ_ID as "bizId", <!-- 业务ID -->
DOC_ID as "docId", <!-- 文件ID -->
DOC_NAME as "docName" <!-- 文件名称 -->
DOC_NAME as "docName", <!-- 文件名称 -->
PREVIEW_NUM as "previewNum", <!-- 预览次数 -->
DOWNLOAD_NUM as "downloadNum" <!-- 下载次数 -->
</sql>
<sql id="condition">
......@@ -93,10 +95,55 @@
)
</insert>
<delete id="deleteBizId">
UPDATE ${hggpSchema}.HGDM099
SET DELETE_FLAG = 1
WHERE BIZ_ID = #bizId#
</delete>
<delete id="delete">
UPDATE ${hggpSchema}.HGDM099
SET DELETE_FLAG = 1
WHERE ID = #id#
</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>
......@@ -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;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.common.CompanyTypeEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
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.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.sb.domain.HGSB001;
import com.baosight.hggp.hg.sb.domain.HGSB003;
import com.baosight.hggp.hg.sj.domain.HGSJ002;
import com.baosight.hggp.hg.dm.domain.HGDM099;
import com.baosight.hggp.hg.dm.tools.HpDmTools;
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.Company;
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.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
......@@ -81,15 +74,16 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001.setDeleteFlag(CommonConstant.YesNo.YES_1);
Map map1 = new HashMap();
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) {
if (hgwd001A.getChangeType().equals(ChangeTypeEnum.UPLOAD_ADD.getCode())
|| hgwd001A.getChangeType().equals(ChangeTypeEnum.UPLOAD_DELETE.getCode())) {
Iplat4jUtils.deleteFileByDocId(hgwd001A.getChangeStart());
}
}
DaoUtils.update("HGCW999.deleteMatId", map1); //删除附件记录
DaoUtils.update(HGWD001A.DELETE_MAT_ID, map1); //删除变更记录
}*/
DaoUtils.update("HGDM099.deleteBizId",
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);
DaoUtils.update(HGWD001.DELETE, hgwd001);
}
......@@ -212,26 +206,94 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo;
}
//树查询服务
public EiInfo queryTreeNode(EiInfo inInfo) {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
String node = MapUtils.getString(queryRow, "fileId");
//获取物料详情数据
String projCode = inInfo.getString("projCode");
String companyCode = inInfo.getString("companyCode");
String parentId = inInfo.getString("parentId");
Map queryMap = new HashMap();
queryMap.put("companyCode", StringUtils.isNotBlank(companyCode) ? companyCode : "null");
queryMap.put("projCode", StringUtils.isNotBlank(projCode) ? projCode : "null");
queryMap.put("parentId", StringUtils.isNotBlank(parentId) ? parentId : "null");
queryMap.put("pEname", "$".equals(node) ? "root" : node);
//2 查询节点
List rows = dao.query("HGWD001.queryTree", queryMap);
//3 增加节点block块
EiInfo outInfo = new EiInfo();
EiBlock outBlock = outInfo.addBlock(node);
outBlock.addRows(rows);
return outInfo;
@OperationLogAnnotation(operModul = "文档库",operType = "修改",operDesc = "文档库-附件清单A-修改附件操作")
public EiInfo updateFile(EiInfo inInfo) {
try {
String ndocId = inInfo.getCellStr(EiConstant.resultBlock, ACConstants.ROW_CODE_0, "ndocId");
List<HGDM099> hgdm099s = HpDmTools.HpDm099.getByBizId("WD",ndocId);
for (HGDM099 hgdm099:hgdm099s) {
DaoUtils.update(HGDM099.DELETE, hgdm099);
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a =initHgwd001a(hgwd001, hgdm099,ChangeTypeEnum.DELETE.getCode());
HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
}
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGDM099 hgdm099 = new HGDM099();
hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
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;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999;
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.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.util.FileUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.*;
import com.baosight.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
......@@ -44,7 +44,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW999().eiMetadata);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGDM099().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
......@@ -61,11 +61,9 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
inInfo = super.query(inInfo, "HGCW999.queryRun", new HGCW999());
} else {
inInfo = super.query(inInfo, "HGCW999.queryDev", new HGCW999());
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
if(StringUtils.isNotEmpty(queryRow.get(HGDM099.FIELD_BIZ_ID).toString())){
inInfo = super.query(inInfo, HGDM099.QUERY, new HGDM099());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
......@@ -73,39 +71,6 @@ public class ServiceHGWD099 extends ServiceEPBase {
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 {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRow);
this.add(fSc002A);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(fSc002A.getMatId());
HGDM099 hgdm099 = new HGDM099();
hgdm099.fromMap(resultRow);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGDM099.INSERT, hgdm099);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
......@@ -130,8 +96,8 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件");
hgwd001a.setChangeEnd(fSc002A.getDocName());
hgwd001a.setChangeStart(fSc002A.getDocId());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
......@@ -156,14 +122,12 @@ public class ServiceHGWD099 extends ServiceEPBase {
@Override
public EiInfo delete(EiInfo inInfo) {
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRow);
matId = fSc002A.getMatId();
this.deleteEntity(fSc002A);
HGWD001 hgwd001 = HGWDTools.HgWd001.get(matId);
HGDM099 hgdm099 = new HGDM099();
hgdm099.fromMap(resultRow);
DaoUtils.update(HGDM099.DELETE, hgdm099);
HGWD001 hgwd001 = HGWDTools.HgWd001.get(hgdm099.getBizId());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
......@@ -172,16 +136,14 @@ public class ServiceHGWD099 extends ServiceEPBase {
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件");
hgwd001a.setChangeEnd(fSc002A.getDocName());
hgwd001a.setChangeStart(fSc002A.getDocId());
hgwd001a.setChangeEnd(hgdm099.getDocName());
hgwd001a.setChangeStart(hgdm099.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
}
}
//List<HGCW999> hgcw999List = HGCWTools.HgCw999.queryByBiz(matId,"HT");
//inInfo.addBlock(EiConstant.resultBlock).addRows(hgcw999List);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
......
......@@ -149,7 +149,7 @@
RELEASE_DATE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,#leafLevel#,#parentId#
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,#leafLevel#,#parentId#,
#fileId#, #fileType#, #fileName#,
#docVersion#, #status#, #remark#, #releaseDate#
<selectKey resultClass="long" keyProperty="id">
......@@ -229,16 +229,21 @@
ORDER BY CREATED_TIME DESC
</select>
<!-- 组织机构子节点树查询 -->
<!-- 文档库子节点树查询 -->
<select id="queryOrganiation" resultClass="java.util.HashMap">
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 "ename",
A.FILE_NAME as "text",
A.FILE_TYPE as "leaf",
A.FILE_TYPE as "type",
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
WHERE 1=1
<isEmpty prepend=" AND " property="deletedQuery">
......@@ -248,7 +253,7 @@
A.PARENT_ID = #node#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
A.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
A.ACCOUNT_CODE = #accountCode#
......@@ -256,7 +261,37 @@
<isNotEmpty prepend=" AND " property="userId">
B.USER_ID = #userId#
</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
</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>
......@@ -61,6 +61,14 @@ public class HGWDTools {
AssertUtils.isNull(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 @@
ORG_NODE_TYPE as "leaf",
ORG_TYPE as "type",
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
<isEmpty prepend=" AND " property="deletedQuery">
IS_DELETED = '0'
......
......@@ -20,8 +20,7 @@ $(function () {
let template = '';
if (item.companyCode && item.projCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showUploadFile(\'' + item.companyCode + '\',\'' + item.companyName + '\',\'' + item.projCode + '\',\'' + item.projName + '\'' +
',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\',\'' + item.status + '\')" >计划详情</a>';
+ 'onclick="showUploadFile(\'' + item.companyCode + '\',\'' + item.projCode + '\',\'' + item.planMaterialCode + '\',\'' + item.planMaterialName + '\')" >计划详情</a>';
if (auditStatus == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' +
'onclick="updateStatus(' + item.id + ',1)" >提交</a>';
......@@ -245,16 +244,13 @@ let query = function () {
*
* @param id
*/
function showUploadFile(companyCode,companyName,projCode,projName,planMaterialCode,planMaterialName,status) {
function showUploadFile(companyCode,projCode,planMaterialCode,planMaterialName) {
JSColorbox.open({
href: "HGSC009A?methodName=initLoad&" +
"inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-status=" + status+
"&inqu_status-0-planMaterialCode=" + planMaterialCode +
"&inqu_status-0-projCode=" + projCode +
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-planMaterialName="+ planMaterialName +
"&inqu_status-0-projName=" + projName ,
"&inqu_status-0-planMaterialName="+ planMaterialName,
title: "<div style='text-align: center;'>材料计划清单</div>",
width: "80%",
height: "80%",
......
$(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 () {
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
var matId = $("#inqu_status-0-matId").val();
var matId = $("#inqu_status-0-bizId").val();
var bizType = $("#inqu_status-0-bizType").val();
var operType = $("#inqu_status-0-operType").val();
var ndocId = $("#inqu_status-0-ndocId").val();
var data = {
docId: docId,
docName: e.response.docName,
matId: matId,
bizType: bizType
bizId: matId,
bizType: bizType,
operType: operType,
ndocId: ndocId
}
// saveTemp(e);
try {
......
......@@ -13,7 +13,9 @@
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<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:EFRegion id="result">
<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