Commit 33727bbc by liuyang

2024-08-20 文档库

parent ee49ba16
package com.baosight.hggp.common;
/**
* @author LiuYang
* @version 1.0 2024/8/20
* @description 变更类型
*/
public enum ChangeTypeEnum {
ADD("add", "添加"),
UPDATE("update", "修改"),
DELETE("delete", "删除"),
UPLOAD_ADD("uploadAdd", "附件添加"),
UPLOAD_DELETE("uploadDelete", "附件删除"),
RELEASE("release", "发布"),
;
private String code;
private String value;
ChangeTypeEnum(String code, String value) {
this.code = code;
this.value = value;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
......@@ -192,6 +192,11 @@
ID = #id#
</delete>
<delete id="deleteMatId">
DELETE FROM ${hggpSchema}.HGCW999 WHERE
MAT_ID = #matId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGCW999
SET
......
......@@ -78,7 +78,7 @@ public class HGWD001 extends DaoEPBase {
public static final String INSERT = "HGWD001.insert";
public static final String UPDATE = "HGWD001.update";
public static final String DELETE = "HGWD001.delete";
public static final String RELEASE_DATE = "HGWD001.releaseDate";
public static final String RELEASE_DATE = "HGWD001.updateReleaseDate";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
......@@ -89,7 +89,7 @@ public class HGWD001 extends DaoEPBase {
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Integer deleteFlag; /* 0-未删除,1-已删除*/
private Integer deleteFlag = 0; /* 0-未删除,1-已删除*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/
......@@ -100,7 +100,7 @@ public class HGWD001 extends DaoEPBase {
private String docId = " "; /* 文件号*/
private String docName = " "; /* 文件附件名称*/
private Integer docVersion = new Integer(0); /* 文件版本号*/
private Integer status; /* 状态*/
private Integer status = 0; /* 状态*/
private String remark = " "; /* 备注*/
private String releaseDate = " "; /* 发布时间*/
private Integer previewNum = new Integer(0); /* 预览次数*/
......
package com.baosight.hggp.hg.wd.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.data.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.core.util.StringUtils;
/**
* Project: <br>
* Title:Hgwd001a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-08-20 17:04:16 create
*/
public class HGWD001A extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id";
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 企业编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_CREATED_BY = "createdBy"; /* 记录创建者*/
public static final String FIELD_CREATED_NAME = "createdName"; /* 记录创建名称*/
public static final String FIELD_CREATED_TIME = "createdTime"; /* 记录创建时间*/
public static final String FIELD_UPDATED_BY = "updatedBy"; /* 记录修改者*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 记录修改名称*/
public static final String FIELD_UPDATED_TIME = "updatedTime"; /* 记录修改时间*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 0-未删除,1-已删除*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 公司编码*/
public static final String FIELD_COMPANY_NAME = "companyName"; /* 公司名称*/
public static final String FIELD_PROJ_CODE = "projCode"; /* 项目编码*/
public static final String FIELD_PROJ_NAME = "projName"; /* 项目名称*/
public static final String FIELD_CHANGE_TYPE = "changeType"; /* 变更类型*/
public static final String FIELD_CHANGE_CONTENT = "changeContent"; /* 变更内容*/
public static final String FIELD_CHANGE_START = "changeStart"; /* 变更前*/
public static final String FIELD_CHANGE_END = "changeEnd"; /* 变更后*/
public static final String FIELD_MAT_ID = "matId"; /* 上级ID*/
public static final String COL_ID = "ID";
public static final String COL_ACCOUNT_CODE = "ACCOUNT_CODE"; /* 企业编码*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码*/
public static final String COL_CREATED_BY = "CREATED_BY"; /* 记录创建者*/
public static final String COL_CREATED_NAME = "CREATED_NAME"; /* 记录创建名称*/
public static final String COL_CREATED_TIME = "CREATED_TIME"; /* 记录创建时间*/
public static final String COL_UPDATED_BY = "UPDATED_BY"; /* 记录修改者*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 记录修改名称*/
public static final String COL_UPDATED_TIME = "UPDATED_TIME"; /* 记录修改时间*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 0-未删除,1-已删除*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 公司编码*/
public static final String COL_COMPANY_NAME = "COMPANY_NAME"; /* 公司名称*/
public static final String COL_PROJ_CODE = "PROJ_CODE"; /* 项目编码*/
public static final String COL_PROJ_NAME = "PROJ_NAME"; /* 项目名称*/
public static final String COL_CHANGE_TYPE = "CHANGE_TYPE"; /* 变更类型*/
public static final String COL_CHANGE_CONTENT = "CHANGE_CONTENT"; /* 变更内容*/
public static final String COL_CHANGE_START = "CHANGE_START"; /* 变更前*/
public static final String COL_CHANGE_END = "CHANGE_END"; /* 变更后*/
public static final String QUERY = "HGWD001A.query";
public static final String COUNT = "HGWD001A.count";
public static final String INSERT = "HGWD001A.insert";
public static final String UPDATE = "HGWD001A.update";
public static final String DELETE = "HGWD001A.delete";
public static final String DELETE_MAT_ID = "HGWD001A.deleteMatId";
private Long id = new Long(0);
private String accountCode = " "; /* 企业编码*/
private String depCode = " "; /* 部门编码*/
private String createdBy = " "; /* 记录创建者*/
private String createdName = " "; /* 记录创建名称*/
private String createdTime = " "; /* 记录创建时间*/
private String updatedBy = " "; /* 记录修改者*/
private String updatedName = " "; /* 记录修改名称*/
private String updatedTime = " "; /* 记录修改时间*/
private Integer deleteFlag = 0; /* 0-未删除,1-已删除*/
private String companyCode = " "; /* 公司编码*/
private String companyName = " "; /* 公司名称*/
private String projCode = " "; /* 项目编码*/
private String projName = " "; /* 项目名称*/
private String changeType = " "; /* 变更类型*/
private String changeContent = " "; /* 变更内容*/
private String changeStart = " "; /* 变更前*/
private String changeEnd = " "; /* 变更后*/
private Long matId = new Long(0);
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName(" ");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ACCOUNT_CODE);
eiColumn.setDescName("企业编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_BY);
eiColumn.setDescName("记录创建者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_NAME);
eiColumn.setDescName("记录创建名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CREATED_TIME);
eiColumn.setDescName("记录创建时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_BY);
eiColumn.setDescName("记录修改者");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("记录修改名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_TIME);
eiColumn.setDescName("记录修改时间");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("0-未删除,1-已删除");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("公司编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_NAME);
eiColumn.setDescName("公司名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_CODE);
eiColumn.setDescName("项目编码");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_PROJ_NAME);
eiColumn.setDescName("项目名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_TYPE);
eiColumn.setDescName("变更类型");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_CONTENT);
eiColumn.setDescName("变更内容");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_START);
eiColumn.setDescName("变更前");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHANGE_END);
eiColumn.setDescName("变更后");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MAT_ID);
eiColumn.setDescName("上级ID");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGWD001A() {
initMetaData();
}
/**
* get the id .
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id .
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* get the accountCode - 企业编码.
* @return the accountCode
*/
public String getAccountCode() {
return this.accountCode;
}
/**
* set the accountCode - 企业编码.
*
* @param accountCode - 企业编码
*/
public void setAccountCode(String accountCode) {
this.accountCode = accountCode;
}
/**
* get the depCode - 部门编码.
* @return the depCode
*/
public String getDepCode() {
return this.depCode;
}
/**
* set the depCode - 部门编码.
*
* @param depCode - 部门编码
*/
public void setDepCode(String depCode) {
this.depCode = depCode;
}
/**
* get the createdBy - 记录创建者.
* @return the createdBy
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
* set the createdBy - 记录创建者.
*
* @param createdBy - 记录创建者
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
* get the createdName - 记录创建名称.
* @return the createdName
*/
public String getCreatedName() {
return this.createdName;
}
/**
* set the createdName - 记录创建名称.
*
* @param createdName - 记录创建名称
*/
public void setCreatedName(String createdName) {
this.createdName = createdName;
}
/**
* get the createdTime - 记录创建时间.
* @return the createdTime
*/
public String getCreatedTime() {
return this.createdTime;
}
/**
* set the createdTime - 记录创建时间.
*
* @param createdTime - 记录创建时间
*/
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
/**
* get the updatedBy - 记录修改者.
* @return the updatedBy
*/
public String getUpdatedBy() {
return this.updatedBy;
}
/**
* set the updatedBy - 记录修改者.
*
* @param updatedBy - 记录修改者
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
* get the updatedName - 记录修改名称.
* @return the updatedName
*/
public String getUpdatedName() {
return this.updatedName;
}
/**
* set the updatedName - 记录修改名称.
*
* @param updatedName - 记录修改名称
*/
public void setUpdatedName(String updatedName) {
this.updatedName = updatedName;
}
/**
* get the updatedTime - 记录修改时间.
* @return the updatedTime
*/
public String getUpdatedTime() {
return this.updatedTime;
}
/**
* set the updatedTime - 记录修改时间.
*
* @param updatedTime - 记录修改时间
*/
public void setUpdatedTime(String updatedTime) {
this.updatedTime = updatedTime;
}
/**
* get the deleteFlag - 0-未删除,1-已删除.
* @return the deleteFlag
*/
public Integer getDeleteFlag() {
return this.deleteFlag;
}
/**
* set the deleteFlag - 0-未删除,1-已删除.
*
* @param deleteFlag - 0-未删除,1-已删除
*/
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* get the companyCode - 公司编码.
* @return the companyCode
*/
public String getCompanyCode() {
return this.companyCode;
}
/**
* set the companyCode - 公司编码.
*
* @param companyCode - 公司编码
*/
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
/**
* get the companyName - 公司名称.
* @return the companyName
*/
public String getCompanyName() {
return this.companyName;
}
/**
* set the companyName - 公司名称.
*
* @param companyName - 公司名称
*/
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* get the projCode - 项目编码.
* @return the projCode
*/
public String getProjCode() {
return this.projCode;
}
/**
* set the projCode - 项目编码.
*
* @param projCode - 项目编码
*/
public void setProjCode(String projCode) {
this.projCode = projCode;
}
/**
* get the projName - 项目名称.
* @return the projName
*/
public String getProjName() {
return this.projName;
}
/**
* set the projName - 项目名称.
*
* @param projName - 项目名称
*/
public void setProjName(String projName) {
this.projName = projName;
}
/**
* get the changeType - 变更类型.
* @return the changeType
*/
public String getChangeType() {
return this.changeType;
}
/**
* set the changeType - 变更类型.
*
* @param changeType - 变更类型
*/
public void setChangeType(String changeType) {
this.changeType = changeType;
}
/**
* get the changeContent - 变更内容.
* @return the changeContent
*/
public String getChangeContent() {
return this.changeContent;
}
/**
* set the changeContent - 变更内容.
*
* @param changeContent - 变更内容
*/
public void setChangeContent(String changeContent) {
this.changeContent = changeContent;
}
/**
* get the changeStart - 变更前.
* @return the changeStart
*/
public String getChangeStart() {
return this.changeStart;
}
/**
* set the changeStart - 变更前.
*
* @param changeStart - 变更前
*/
public void setChangeStart(String changeStart) {
this.changeStart = changeStart;
}
/**
* get the changeEnd - 变更后.
* @return the changeEnd
*/
public String getChangeEnd() {
return this.changeEnd;
}
/**
* set the changeEnd - 变更后.
*
* @param changeEnd - 变更后
*/
public void setChangeEnd(String changeEnd) {
this.changeEnd = changeEnd;
}
public Long getMatId() {
return matId;
}
public void setMatId(Long matId) {
this.matId = matId;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setCreatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_BY)), createdBy));
setCreatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_NAME)), createdName));
setCreatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CREATED_TIME)), createdTime));
setUpdatedBy(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_BY)), updatedBy));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setCompanyName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_NAME)), companyName));
setProjCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_CODE)), projCode));
setProjName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_PROJ_NAME)), projName));
setChangeType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_TYPE)), changeType));
setChangeContent(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_CONTENT)), changeContent));
setChangeStart(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_START)), changeStart));
setChangeEnd(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHANGE_END)), changeEnd));
setMatId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_MAT_ID)), matId));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = new HashMap();
map.put(FIELD_ID, StringUtils.toString(id, eiMetadata.getMeta(FIELD_ID)));
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_CREATED_BY, StringUtils.toString(createdBy, eiMetadata.getMeta(FIELD_CREATED_BY)));
map.put(FIELD_CREATED_NAME, StringUtils.toString(createdName, eiMetadata.getMeta(FIELD_CREATED_NAME)));
map.put(FIELD_CREATED_TIME, StringUtils.toString(createdTime, eiMetadata.getMeta(FIELD_CREATED_TIME)));
map.put(FIELD_UPDATED_BY, StringUtils.toString(updatedBy, eiMetadata.getMeta(FIELD_UPDATED_BY)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
map.put(FIELD_UPDATED_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
map.put(FIELD_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_COMPANY_NAME, StringUtils.toString(companyName, eiMetadata.getMeta(FIELD_COMPANY_NAME)));
map.put(FIELD_PROJ_CODE, StringUtils.toString(projCode, eiMetadata.getMeta(FIELD_PROJ_CODE)));
map.put(FIELD_PROJ_NAME, StringUtils.toString(projName, eiMetadata.getMeta(FIELD_PROJ_NAME)));
map.put(FIELD_CHANGE_TYPE, StringUtils.toString(changeType, eiMetadata.getMeta(FIELD_CHANGE_TYPE)));
map.put(FIELD_CHANGE_CONTENT, StringUtils.toString(changeContent, eiMetadata.getMeta(FIELD_CHANGE_CONTENT)));
map.put(FIELD_CHANGE_START, StringUtils.toString(changeStart, eiMetadata.getMeta(FIELD_CHANGE_START)));
map.put(FIELD_CHANGE_END, StringUtils.toString(changeEnd, eiMetadata.getMeta(FIELD_CHANGE_END)));
map.put(FIELD_MAT_ID, StringUtils.toString(matId, eiMetadata.getMeta(FIELD_MAT_ID)));
return map;
}
}
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.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.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;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.resource.I18nMessages;
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;
/**
* @author LiuYang
* @version 1.0 2024/8/19
* @description 文档库
*/
public class ServiceHGWD001 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 = "删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HGWD001 hgwd001 = new HGWD001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgwd001.fromMap(map);
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);
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(HGWD001.DELETE, hgwd001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
LogUtils.setMsg(inInfo, e,"删除失败");
}
return inInfo;
}
/**
* 保存操作
*/
@OperationLogAnnotation(operModul = "文档库",operType = "保存",operDesc = "保存操作")
public EiInfo save(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
for (Map resultRow : resultRows) {
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(resultRow);
if (hgwd001.getId() == null || hgwd001.getId() == 0) {
this.add(hgwd001);
} else {
this.modify(hgwd001);
}
}
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) {
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())){
hgwd001a.setChangeContent("文件类型");
hgwd001a.setChangeStart(wd001.getFileType());
hgwd001a.setChangeEnd(hgwd001.getFileType());
HGWDTools.HgWd001.add(hgwd001a);
}
DaoUtils.update(HGWD001.UPDATE, hgwd001);
}
@OperationLogAnnotation(operModul = "文档库",operType = "发布",operDesc = "发布操作")
public EiInfo updateRelease(EiInfo inInfo){
int i = 0;
try {
HGWD001 hgwd001 = new HGWD001();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hgwd001.fromMap(map);
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.RELEASE.getCode());
hgwd001a.setMatId(hgwd001.getId());
hgwd001a.setChangeContent("发布");
if (wd001 != null){
hgwd001a.setChangeStart(wd001.getFileName());
}
hgwd001a.setChangeEnd(hgwd001.getFileName());
HGWDTools.HgWd001.add(hgwd001a);
hgwd001.setDocVersion(hgwd001.getDocVersion() + 1);
hgwd001.setStatus(HgWdConstant.FileStatus.S_1);
hgwd001.setReleaseDate(DateUtils.shortDateTime());
DaoUtils.update(HGWD001.RELEASE_DATE, hgwd001);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "发布成功")});
} catch (PlatException e) {
LogUtils.setMsg(inInfo, e, "发布失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.xs.domain.Company;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.util.DateUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Objects;
/**
* @author LiuYang
* @version 1.0 2024/8/20
* @description 变更记录
*/
public class ServiceHGWD001A extends ServiceEPBase {
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HGWD001A.QUERY,new HGWD001A());
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) {
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
if (block != null) {
String createdTime = inInfo.getCellStr(EiConstant.queryBlock,ACConstants.ROW_CODE_0,HGWD001A.FIELD_CREATED_TIME);
if (StringUtils.isNotEmpty(createdTime)){
block.setCell(ACConstants.ROW_CODE_0,HGWD001A.FIELD_CREATED_TIME, StringUtil.removeHorizontalLine(createdTime.toString()));
}
}
return super.query(inInfo, HGWD001A.QUERY,new HGWD001A());
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.ds.domain.HGDS002;
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.iplat4j.core.ProjectInfo;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/8/20
* @description 附件详情
*/
public class ServiceHGWD099 extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "文档库-附件清单A-初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGCW999().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "查询",operDesc = "文档库-附件清单A-查询")
@Override
public EiInfo query(EiInfo inInfo) {
try {
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
inInfo = super.query(inInfo, "HGCW999.queryRun", new HGCW999());
} else {
inInfo = super.query(inInfo, "HGCW999.queryDev", new HGCW999());
}
} catch (Throwable e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
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);
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (CommonConstant.projectEnv.RUN.equalsIgnoreCase(projectEnv)) {
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);
}
/**
* 新增操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "新增",operDesc = "文档库-附件清单A-新增操作")
@Override
public EiInfo insert(EiInfo inInfo) {
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());
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeContent("上传附件");
hgwd001a.setChangeEnd(fSc002A.getDocName());
hgwd001a.setChangeStart(fSc002A.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "文档库-附件清单A-删除操作")
@Override
public EiInfo delete(EiInfo inInfo) {
try {
Long matId = null;
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (int i = 0; i < resultRows.size(); i++) {
HGCW999 fSc002A = new HGCW999();
fSc002A.fromMap(resultRows.get(i));
matId = fSc002A.getMatId();
this.deleteEntity(fSc002A);
HGWD001 hgwd001 =HGWDTools.HgWd001.get(matId);
if (hgwd001 != null) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
hgwd001a.setChangeContent("删除附件");
hgwd001a.setChangeEnd(fSc002A.getDocName());
hgwd001a.setChangeStart(fSc002A.getDocId());
hgwd001a.setMatId(hgwd001.getId());
HGWDTools.HgWd001.add(hgwd001a);
}
}
//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) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 删除文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
if (list.size() > 0) {
String realPath = list.get(0).getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HGCW999.FIELD_DOC_ID,list.get(0).getDocId());
//获取文档信息
queryInfo.set(EiConstant.serviceId,"S_EU_0102");
EiInfo docInfo = XServiceManager.call(queryInfo);
//数据库
Map docInfoMap = docInfo.getMap("docMap");
if (docInfoMap.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("data",docInfoMap.get("url")+"-"+0);
eiInfo.set(EiConstant.serviceId,"S_EU_0105");
//调用接口
EiInfo outInfo = XServiceManager.call(eiInfo);
if(outInfo.getStatus() == EiConstant.STATUS_FAILURE){
LogUtils.setDetailMsg(outInfo, new Throwable(), "查询部件类型失败");
outInfo.setMsg("失败");
}
}
}else {
FileUtils.deleteFile(realPath);
}
this.dao.delete(HGDS002.DELETE,map);
}
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/8/20
* @description 上传附件
*/
public class ServiceHGWD099A extends ServiceEPBase {
/**
* 画面初始化.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "查询",operDesc = "初始化")
@Override
public EiInfo initLoad(EiInfo inInfo) {
return inInfo;
}
/**
* 附件上传.
*/
@OperationLogAnnotation(operModul = "附件上传",operType = "上传",operDesc = "附件上传")
public EiInfo form(EiInfo inInfo) {
return inInfo;
}
}
......@@ -154,6 +154,9 @@
#deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#,
#fileId#, #fileType#, #fileName#,
#docId#, #docName#, #docVersion#, #status#, #remark#, #releaseDate#
<selectKey resultClass="long" keyProperty="id">
SELECT MAX(ID) AS "id" FROM ${hggpSchema}.HGWD001
</selectKey>
)
</insert>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd"> <!-- table information
Generate time : 2024-08-20 17:04:16
Version : 1.0
schema : hggp
tableName : HGWD001A
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
CHANGE_TYPE TINYINT,
CHANGE_CONTENT VARCHAR,
CHANGE_START VARCHAR,
CHANGE_END VARCHAR
-->
<sqlMap namespace="HGWD001A">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME like concat('%',#createdName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME like concat('%',#createdTime#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like concat('%',#projName#,'%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeType">
CHANGE_TYPE = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStart">
CHANGE_START = #changeStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEnd">
CHANGE_END = #changeEnd#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="matId">
MAT_ID = #matId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.wd.domain.HGWD001A">
SELECT
ID as "id",
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
COMPANY_CODE as "companyCode", <!-- 公司编码 -->
COMPANY_NAME as "companyName", <!-- 公司名称 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
CHANGE_TYPE as "changeType", <!-- 变更类型 -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
CHANGE_START as "changeStart", <!-- 变更前 -->
CHANGE_END as "changeEnd", <!-- 变更后 -->
MAT_ID as "matId"
FROM ${hggpSchema}.HGWD001A WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGWD001A WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
COMPANY_NAME = #companyName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeType">
CHANGE_TYPE = #changeType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeStart">
CHANGE_START = #changeStart#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeEnd">
CHANGE_END = #changeEnd#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD001A (ID,
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
UPDATED_BY, <!-- 记录修改者 -->
UPDATED_NAME, <!-- 记录修改名称 -->
UPDATED_TIME, <!-- 记录修改时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE, <!-- 公司编码 -->
COMPANY_NAME, <!-- 公司名称 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
CHANGE_TYPE, <!-- 变更类型 -->
CHANGE_CONTENT, <!-- 变更内容 -->
CHANGE_START, <!-- 变更前 -->
CHANGE_END, <!-- 变更后 -->
MAT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #companyCode#, #companyName#, #projCode#, #projName#, #changeType#, #changeContent#, #changeStart#, #changeEnd#,#matId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGWD001A WHERE
ID = #id#
</delete>
<delete id="deleteMatId">
DELETE FROM ${hggpSchema}.HGWD001A WHERE
MAT_ID = #matId#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD001A
SET
ACCOUNT_CODE = #accountCode#, <!-- 企业编码 -->
DEP_CODE = #depCode#, <!-- 部门编码 -->
CREATED_BY = #createdBy#, <!-- 记录创建者 -->
CREATED_NAME = #createdName#, <!-- 记录创建名称 -->
CREATED_TIME = #createdTime#, <!-- 记录创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
COMPANY_CODE = #companyCode#, <!-- 公司编码 -->
COMPANY_NAME = #companyName#, <!-- 公司名称 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
CHANGE_TYPE = #changeType#, <!-- 变更类型 -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
CHANGE_START = #changeStart#, <!-- 变更前 -->
CHANGE_END = #changeEnd#, <!-- 变更后 -->
MAT_ID = #matId#
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -6,6 +6,7 @@ import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sb.domain.HGSB002;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.util.AssertUtils;
import org.apache.commons.collections.CollectionUtils;
......@@ -39,6 +40,18 @@ public class HGWDTools {
}
/**
* @param id
* @return
*/
public static HGWD001 get(Long id) {
AssertUtils.isNull(id, "文件ID不能为空");
Map queryMap = new HashMap();
queryMap.put(HGWD001.FIELD_ID, id);
List<HGWD001> results = DaoBase.getInstance().query(HGWD001.QUERY, queryMap);
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
/**
* 预览记录自增
*
* @param fileId
......@@ -62,6 +75,11 @@ public class HGWDTools {
DaoUtils.update(HgWdSqlConstant.HgWd001.DOWNLOAD_INCR, queryMap);
}
public static void add(HGWD001A hgwd001a) {
AssertUtils.isNull(hgwd001a, "文档对象不能为空");
DaoUtils.insert(HGWD001A.INSERT, hgwd001a);
}
}
}
$(function () {
var companyCodeBox = __eiInfo.getBlock("companyBox_block_id").getMappedRows();
var projCodeBox = __eiInfo.getBlock("proj_record_block_id").getMappedRows();
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
IPLATUI.EFAutoComplete = {
"inqu_status-0-deviceName": {
minLength: 1,
dataSource: {
pageSize: 10,
serverPaging: true,
serverFiltering: true
}
}
};
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: "公司名称",
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) {
}
}
}
//工厂类型下拉联动
/*$('input[name="inqu_status-0-companyCode"]').change(function () {
var companyCode=$("#inqu_status-0-companyCode").val();
$("#inqu_status-0-groupCode").kendoDropDownList({
dataSource: _.filter(groupCodeBox, function (item) {
return item["param3Field"] === companyCode;
}),
dataTextField: "textField",
dataValueField: "valueField",
required: "true",
optionLabelTemplate: "#:textField#",
valueTemplate: "#:textField#",
template: "#:textField#",
filter: "contains"
});
});*/
downKeyUp();
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
let query = function () {
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", "HGWD001", "save", true);
btnNode.attr("disabled", false);
}
});
}
}
function updateRelease() {
let inEiInfo = new EiInfo();
let rows = resultGrid.getCheckedRows();
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
}
);
}
/**
* 文件上传
*
* @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) {
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/5/9
Time: 15:01
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: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:EFAutoComplete blockId="inqu_status" row="0" ename="projName" cname="项目名称"
serviceName="HGSC002" queryMethod="queryComboBox" resultId="result" dataField="projName"/>--%>
<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">
<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="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="true" width="210" required="true"
align="center" filter="contains" sort="true">
<EF:EFOptions blockId="companyBox_block_id" textField="textField" valueField="valueField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="projName" cname="所属项目" width="160" enable="true" readonly="true" align="center" required="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: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="true" readonly="true" align="center" required="true"/>
<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:EFComboColumn ename="status" cname="状态" width="80" align="center" readonly="false" required="true" defaultValue="0">
<EF:EFCodeOption codeName="hggp.hgwd.status"/>
</EF:EFComboColumn>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 70, 100],
},
columns: [/*{
field: "operator",
title: "操作",
template: function (model) {
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showQueryRecord(\'' + model.fileId + '\')" >预览记录</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDownloadRecord(\'' + model.fileId + '\')" >下载记录</a>';
return template;
}
}, */{
field: "changeStart",
template: function (item) {
let template = item["changeStart"]
if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
template = "";
}
return template;
}
},{
field: "changeEnd",
template: function (item) {
let template = item["changeEnd"]
if (item.changeType == "uploadAdd" || item.changeType == "uploadDelete") {
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.changeStart) + '" target="_blank">'+item.changeEnd+'</a>';
}
return template;
}
}],
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/20
Time: 16:14
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:EFSelect blockId="inqu_status" row="0" ename="companyCode" cname="公司名称" colWidth="3" filter="contains" readonly="true">
<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="changeType" cname="变更类型" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="hggp.hgwd.changeType"/>
</EF:EFSelect>
<EF:EFInput blockId="inqu_status" row="0" ename="createdName" cname="创建人" placeholder="模糊查询" colWidth="3"/>
<EF:EFDatePicker cname="创建时间" blockId="inqu_status" ename="createdTime" row="0" colWidth="3"
format="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
<EF:EFInput blockId="inqu_status" row="0" ename="matId" cname="上级ID" type="hidden" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFComboColumn ename="companyCode" cname="公司名称"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" 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="projName" cname="所属项目" width="160" enable="true" readonly="false" align="center" required="true"/>
<%-- <EF:EFComboColumn ename="projCode" cname="所属项目" blockName="proj_record_block_id"
columnTemplate="#=textField#" itemTemplate="#=textField#"
textField="textField" valueField="valueField"
maxLength="16" readonly="false" width="200" required="true"
align="center" filter="contains" sort="true" />--%>
<EF:EFComboColumn ename="changeType" cname="变更类型" width="100" align="center" readonly="true" required="true" defaultValue="20">
<EF:EFCodeOption codeName="hggp.hgwd.changeType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="changeContent" cname="变更内容" width="160" enable="true" readonly="true" align="center" required="true"/>
<EF:EFColumn ename="changeStart" cname="变更前" width="160" enable="true" readonly="false" align="center" required="true"/>
<EF:EFColumn ename="changeEnd" cname="变更后" width="160" enable="true" readonly="true" align="center" required="true"/>
<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 () {
IPLATUI.EFGrid = {
"result": {
columns: [{
field: "operator",
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '" target="_blank">附件下载</a>';
return template;
}
}],
dataBound: function () {
}
}
};
$("#ef_form_head").hide();
// 查询
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 初始化查询
query();
});
/**
* 查询
*/
var query = function (e) {
resultGrid.dataSource.page(1);
}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HGWD099A?methodName=initLoad&inqu_status-0-bizType="+$("#inqu_status-0-bizType").val()+"&inqu_status-0-matId="+$("#inqu_status-0-matId").val(),
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param data
*/
function uploadFileCallback(data) {
let inEiInfo = new EiInfo();
inEiInfo.set("result-0-matId", data.matId);
inEiInfo.set("result-0-docId", data.docId);
inEiInfo.set("result-0-docName", data.docName);
inEiInfo.set("result-0-bizType", data.bizType);
EiCommunicator.send('HGWD099', 'insert', inEiInfo, {
onSuccess(response) {
resultGrid.dataSource.page(1);
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
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);
}
});
}
})
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/20
Time: 16:10
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件清单">
<EF:EFRegion id="inqu" title="查询区域" type="query">
<EF:EFInput cname="物料ID" ename="matId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3" />
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" isFloat="true">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="150"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="150"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
parseFormats="['yyyyMMddHHmmss']" editType="datetime" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="200" align="center"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFUpload = {
uploadFile: {
success: function(e) {
let docId = e.response.docId;
if (isBlank(docId)) {
return;
}
$("#fileDocId").val(docId);
NotificationUtil("附件上传成功");
var matId = $("#inqu_status-0-matId").val();
var bizType = $("#inqu_status-0-bizType").val();
var data = {
docId: docId,
docName: e.response.docName,
matId: matId,
bizType: bizType
}
// saveTemp(e);
try {
parent.JSColorbox.setValueCallback(data);
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/8/20
Time: 16:11
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<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="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="wd_file" path="WD"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
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