Commit fbad462e by liuyang

2024-03-26 新增企业log管理页面和PC动态log

parent 067be312
package com.baosight.hpjx.hp.xs.domain;
import com.baosight.iplat4j.core.util.NumberUtils;
import java.math.BigDecimal;
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:THpxs003.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-25 15:58:56 create
*/
public class HPXS003 extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "id"; /* ID*/
public static final String FIELD_COMPANY_CODE = "companyCode"; /* 企业编码 预留*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码 预留*/
public static final String FIELD_DOC_ID = "docId"; /* 文件标识*/
public static final String FIELD_DIR_ID = "dirId"; /* 目录标识*/
public static final String FIELD_DOC_NAME = "docName"; /* 文件名*/
public static final String FIELD_CHG_NAME = "chgName"; /* 物料文件名*/
public static final String FIELD_DOC_SIZE = "docSize"; /* 文件大小*/
public static final String FIELD_DOC_TAG = "docTag"; /* 文件标签*/
public static final String FIELD_REAL_PATH = "realPath"; /* 物理路径*/
public static final String FIELD_DELETE_FLAG = "deleteFlag"; /* 是否删除0:否1.是*/
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_TIME = "updatedTime"; /* 修改人名称*/
public static final String FIELD_UPDATED_NAME = "updatedName"; /* 修改时间*/
public static final String COL_ID = "ID"; /* ID*/
public static final String COL_COMPANY_CODE = "COMPANY_CODE"; /* 企业编码 预留*/
public static final String COL_DEP_CODE = "DEP_CODE"; /* 部门编码 预留*/
public static final String COL_DOC_ID = "DOC_ID"; /* 文件标识*/
public static final String COL_DIR_ID = "DIR_ID"; /* 目录标识*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 文件名*/
public static final String COL_CHG_NAME = "CHG_NAME"; /* 物料文件名*/
public static final String COL_DOC_SIZE = "DOC_SIZE"; /* 文件大小*/
public static final String COL_DOC_TAG = "DOC_TAG"; /* 文件标签*/
public static final String COL_REAL_PATH = "REAL_PATH"; /* 物理路径*/
public static final String COL_DELETE_FLAG = "DELETE_FLAG"; /* 是否删除0:否1.是*/
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_TIME = "UPDATED_TIME"; /* 修改人名称*/
public static final String COL_UPDATED_NAME = "UPDATED_NAME"; /* 修改时间*/
public static final String QUERY = "HPXS003.query";
public static final String COUNT = "HPXS003.count";
public static final String INSERT = "HPXS003.insert";
public static final String UPDATE = "HPXS003.update";
public static final String DELETE = "HPXS003.delete";
public static final String DELETE_FLAG = "HPXS003.deleteFlag";
private Long id = new Long(0); /* ID*/
private String companyCode = " "; /* 企业编码 预留*/
private String depCode = " "; /* 部门编码 预留*/
private String docId = " "; /* 文件标识*/
private String dirId = " "; /* 目录标识*/
private String docName = " "; /* 文件名*/
private String chgName = " "; /* 物料文件名*/
private BigDecimal docSize = new BigDecimal(0); /* 文件大小*/
private String docTag = " "; /* 文件标签*/
private String realPath = " "; /* 物理路径*/
private Integer deleteFlag; /* 是否删除0:否1.是*/
private String createdBy = " "; /* 创建人*/
private String createdName = " "; /* 创建人名称*/
private String createdTime = " "; /* 创建时间*/
private String updatedBy = " "; /* 修改人*/
private String updatedTime = " "; /* 修改人名称*/
private String updatedName = " "; /* 修改时间*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_ID);
eiColumn.setPrimaryKey(true);
eiColumn.setDescName("ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_COMPANY_CODE);
eiColumn.setDescName("企业编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DEP_CODE);
eiColumn.setDescName("部门编码 预留");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("文件标识");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DIR_ID);
eiColumn.setDescName("目录标识");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_CHG_NAME);
eiColumn.setDescName("物料文件名");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_SIZE);
eiColumn.setType("N");
eiColumn.setScaleLength(0);
eiColumn.setFieldLength(16);
eiColumn.setDescName("文件大小");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TAG);
eiColumn.setDescName("文件标签");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_REAL_PATH);
eiColumn.setDescName("物理路径");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DELETE_FLAG);
eiColumn.setDescName("是否删除0:否1.是");
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_TIME);
eiColumn.setDescName("修改人名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_UPDATED_NAME);
eiColumn.setDescName("修改时间");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPXS003() {
initMetaData();
}
/**
* get the id - ID.
* @return the id
*/
public Long getId() {
return this.id;
}
/**
* set the id - ID.
*
* @param id - ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* 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 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 docId - 文件标识.
* @return the docId
*/
public String getDocId() {
return this.docId;
}
/**
* set the docId - 文件标识.
*
* @param docId - 文件标识
*/
public void setDocId(String docId) {
this.docId = docId;
}
/**
* get the dirId - 目录标识.
* @return the dirId
*/
public String getDirId() {
return this.dirId;
}
/**
* set the dirId - 目录标识.
*
* @param dirId - 目录标识
*/
public void setDirId(String dirId) {
this.dirId = dirId;
}
/**
* get the docName - 文件名.
* @return the docName
*/
public String getDocName() {
return this.docName;
}
/**
* set the docName - 文件名.
*
* @param docName - 文件名
*/
public void setDocName(String docName) {
this.docName = docName;
}
/**
* get the chgName - 物料文件名.
* @return the chgName
*/
public String getChgName() {
return this.chgName;
}
/**
* set the chgName - 物料文件名.
*
* @param chgName - 物料文件名
*/
public void setChgName(String chgName) {
this.chgName = chgName;
}
/**
* get the docSize - 文件大小.
* @return the docSize
*/
public BigDecimal getDocSize() {
return this.docSize;
}
/**
* set the docSize - 文件大小.
*
* @param docSize - 文件大小
*/
public void setDocSize(BigDecimal docSize) {
this.docSize = docSize;
}
/**
* get the docTag - 文件标签.
* @return the docTag
*/
public String getDocTag() {
return this.docTag;
}
/**
* set the docTag - 文件标签.
*
* @param docTag - 文件标签
*/
public void setDocTag(String docTag) {
this.docTag = docTag;
}
public String getRealPath() {
return realPath;
}
public void setRealPath(String realPath) {
this.realPath = realPath;
}
/**
* 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 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 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 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 value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
setId(NumberUtils.toLong(StringUtils.toString(map.get(FIELD_ID)), id));
setCompanyCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_COMPANY_CODE)), companyCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDirId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DIR_ID)), dirId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setChgName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CHG_NAME)), chgName));
setDocSize(NumberUtils.toBigDecimal(StringUtils.toString(map.get(FIELD_DOC_SIZE)), docSize));
setDocTag(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TAG)), docTag));
setRealPath(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_REAL_PATH)), realPath));
setDeleteFlag(NumberUtils.toInteger(StringUtils.toString(map.get(FIELD_DELETE_FLAG)), deleteFlag));
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));
setUpdatedTime(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_TIME)), updatedTime));
setUpdatedName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_UPDATED_NAME)), updatedName));
}
/**
* 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_COMPANY_CODE, StringUtils.toString(companyCode, eiMetadata.getMeta(FIELD_COMPANY_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DIR_ID, StringUtils.toString(dirId, eiMetadata.getMeta(FIELD_DIR_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_CHG_NAME, StringUtils.toString(chgName, eiMetadata.getMeta(FIELD_CHG_NAME)));
map.put(FIELD_DOC_SIZE, StringUtils.toString(docSize, eiMetadata.getMeta(FIELD_DOC_SIZE)));
map.put(FIELD_DOC_TAG, StringUtils.toString(docTag, eiMetadata.getMeta(FIELD_DOC_TAG)));
map.put(FIELD_REAL_PATH, StringUtils.toString(realPath, eiMetadata.getMeta(FIELD_REAL_PATH)));
map.put(FIELD_DELETE_FLAG, StringUtils.toString(deleteFlag, eiMetadata.getMeta(FIELD_DELETE_FLAG)));
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_TIME, StringUtils.toString(updatedTime, eiMetadata.getMeta(FIELD_UPDATED_TIME)));
map.put(FIELD_UPDATED_NAME, StringUtils.toString(updatedName, eiMetadata.getMeta(FIELD_UPDATED_NAME)));
return map;
}
}
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoBase;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.ds.domain.HPDS002;
import com.baosight.hpjx.hp.sc.domain.HPSC002A;
import com.baosight.hpjx.hp.xs.domain.HPXS003;
import com.baosight.hpjx.util.ErrorCodeUtils;
import com.baosight.hpjx.util.FileUtils;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.hpjx.util.contants.ACConstants;
import com.baosight.iplat4j.core.ProjectInfo;
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.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/3/25
*/
public class ServiceHPXS003 extends ServiceEPBase {
private final String[] IMAGE_LIST = new String[]{"bmp", "gif", "jpg", "jpeg", "tiff", "png"};
@Override
public EiInfo initLoad(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
final EiInfo outEiInfo = super.query(inInfo, HPXS003.QUERY, new HPXS003());
//outInfo.getBlock(EiConstant.resultBlock).getRows().clear();
return outEiInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
return super.query(inInfo, HPXS003.QUERY,new HPXS003());
}
/**
* 查询最新企业log附件
* @param inInfo
* @return
*/
public EiInfo queryMaxLog(EiInfo inInfo) {
inInfo.setCell(EiConstant.queryBlock, ACConstants.ROW_CODE_0, HPXS003.FIELD_DELETE_FLAG,CommonConstant.YesNo.NO_0);
EiInfo eiInfo = super.query(inInfo, HPXS003.QUERY,new HPXS003());
String projectEnv = ProjectInfo.getProjectEnv();
eiInfo.setCell(EiConstant.resultBlock,ACConstants.ROW_CODE_0,"projectEnv",projectEnv);
return eiInfo;
}
@OperationLogAnnotation(operModul = "企业log上传管理", operType = "删除", operDesc = "删除6个月之前的历史数据")
@Override
public EiInfo delete(EiInfo inInfo) {
int i = 0;
try {
HPXS003 hpxs003 = new HPXS003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs003.fromMap(map);
hpxs003.setDeleteFlag(CommonConstant.YesNo.YES_1);
delectDoc(eiBlock.getCellStr(i,HPXS003.FIELD_DIR_ID));
DaoUtils.update(HPXS003.DELETE_FLAG, hpxs003.toMap());
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.delete", "删除")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleDeleteException(inInfo,i,e);
logError("删除失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "企业log上传管理", operType = "修改", operDesc = "修改log操作")
@Override
public EiInfo update(EiInfo inInfo) {
int i = 0;
try {
HPXS003 hpxs003 = new HPXS003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs003.fromMap(map);
hpxs003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.update(HPXS003.UPDATE, hpxs003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.update", "修改")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleUpdateException(inInfo,i,e);
logError("修改失败", e.getMessage());
return inInfo;
}
return inInfo;
}
@OperationLogAnnotation(operModul = "企业log上传管理", operType = "新增", operDesc = "新增log操作")
@Override
public EiInfo insert(EiInfo inInfo) {
int i = 0;
try {
HPXS003 hpxs003 = new HPXS003();
EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
for (i = 0; i < eiBlock.getRowCount(); i++) {
Map<?, ?> map = eiBlock.getRow(i);
hpxs003.fromMap(map);
hpxs003.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPXS003.INSERT, hpxs003);
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsgByKey("ep.1000", new String[]{String.valueOf(i), I18nMessages.getText("label.insert", "新增")});
} catch (PlatException e) {
e.printStackTrace();
inInfo.setStatus(EiConstant.STATUS_FAILURE);
ErrorCodeUtils.handleInsertException(inInfo,i,e);
logError("新增失败", e.getMessage());
return inInfo;
}
return inInfo;
}
/**
* 删除附件文件
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "企业log上传管理",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HPDS002> list = this.dao.query("HPXS003.query",map);
if (list.size() > 0) {
for (HPDS002 hpds002: list) {
String realPath = hpds002.getRealPath();
// 项目环境
String projectEnv = ProjectInfo.getProjectEnv();
if (projectEnv.equals(CommonConstant.projectEnv.RUN)) {
EiInfo queryInfo = new EiInfo();
queryInfo.set(HPSC002A.FIELD_DOC_ID,hpds002.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(HPDS002.DELETE,map);
}
}
public void getImage(PageContext pageContext) throws Exception {
HttpServletResponse response = (HttpServletResponse)pageContext.getResponse();
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
String docId = request.getParameter("docId");
Map document = getDocument(docId);
String docName = document.get("docName").toString();
String chgName = document.get("chgName").toString();
String docPath = document.get("realPath").toString();
String filePath = docPath + "/" + chgName;
response.reset();
OutputStream outputStream = response.getOutputStream();
String imageType = docName.substring(docName.lastIndexOf(".") + 1);
if (StringUtils.isNotEmpty(docName) && this.indexOf(this.IMAGE_LIST, imageType.toLowerCase()) > -1) {
response.setContentType("image/" + imageType);
response.setHeader("ragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0L);
File file = new File(filePath);
try {
FileInputStream fileInputStream = new FileInputStream(file);
Throwable var14 = null;
try {
byte[] buffer = new byte[1024];
int i;
while((i = fileInputStream.read(buffer)) > 0) {
outputStream.write(buffer, 0, i);
}
} catch (Throwable var33) {
var14 = var33;
throw var33;
} finally {
if (fileInputStream != null) {
if (var14 != null) {
try {
fileInputStream.close();
} catch (Throwable var32) {
var14.addSuppressed(var32);
}
} else {
fileInputStream.close();
}
}
}
} catch (IOException var35) {
logError("下载文件在服务器中不存在", var35.getMessage());
} finally {
outputStream.flush();
outputStream.close();
}
} else {
outputStream.flush();
outputStream.close();
}
}
public Map getDocument(String docId) {
String ROOT_PATH= "";
Map hashMap = new HashMap();
hashMap.put("fkey","docRootDir");
List<Map> queryPath = DaoBase.getInstance().query("EDCC03.query",hashMap);
if (queryPath.get(0).get("fvalue")!=null) {
ROOT_PATH= (String) queryPath.get(0).get("fvalue");
}
HashMap<String, String> docMap = new HashMap();
docMap.put("docId", docId);
List docList = this.dao.query("EUDM02.queryDocById", docMap);
if (null != docList && docList.size() != 0) {
Map document = (Map)docList.get(0);
document.put("realPath", ROOT_PATH + "/" + document.get("realPath"));
return document;
} else {
throw new PlatException("文件在服务器中不存在");
}
}
private int indexOf(String[] list, String element) {
int result = -1;
int i = 0;
for(int length = list.length; i < length; ++i) {
if (list[i].equals(element)) {
result = i;
break;
}
}
return result;
}
}
package com.baosight.hpjx.hp.xs.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/3/25
*/
public class ServiceHPXS099 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;
}
}
<?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-03-25 15:58:56
Version : 1.0
schema : hpjx
tableName : T_HPXS003
ID BIGINT NOT NULL primarykey,
COMPANY_CODE VARCHAR,
DEP_CODE VARCHAR,
DOC_ID VARCHAR NOT NULL,
DIR_ID VARCHAR,
DOC_NAME VARCHAR,
CHG_NAME VARCHAR,
DOC_SIZE DECIMAL,
DOC_TAG VARCHAR,
DELETE_FLAG TINYINT,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_TIME VARCHAR,
UPDATED_NAME VARCHAR
-->
<sqlMap namespace="HPXS003">
<sql id="authCondition">
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE=#companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE= #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCodes">
DEP CODE IN <iterate close=")" open="(" conjunction="," property="depCodes">#depcodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dirId">
DIR_ID = #dirId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chgName">
CHG_NAME = #chgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docSize">
DOC_SIZE = #docSize#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docTag">
DOC_TAG = #docTag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="realPath">
REAL_PATH = #realPath#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS003">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
DOC_ID as "docId", <!-- 文件标识 -->
DIR_ID as "dirId", <!-- 目录标识 -->
DOC_NAME as "docName", <!-- 文件名 -->
CHG_NAME as "chgName", <!-- 物料文件名 -->
DOC_SIZE as "docSize", <!-- 文件大小 -->
DOC_TAG as "docTag", <!-- 文件标签 -->
REAL_PATH as "realPath", <!-- 物理路径 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS003 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="queryMax" parameterClass="java.util.HashMap"
resultClass="com.baosight.hpjx.hp.xs.domain.HPXS003">
SELECT
ID as "id", <!-- ID -->
COMPANY_CODE as "companyCode", <!-- 企业编码 预留 -->
DEP_CODE as "depCode", <!-- 部门编码 预留 -->
DOC_ID as "docId", <!-- 文件标识 -->
DIR_ID as "dirId", <!-- 目录标识 -->
DOC_NAME as "docName", <!-- 文件名 -->
CHG_NAME as "chgName", <!-- 物料文件名 -->
DOC_SIZE as "docSize", <!-- 文件大小 -->
DOC_TAG as "docTag", <!-- 文件标签 -->
REAL_PATH as "realPath", <!-- 物理路径 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除0:否1.是 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_TIME as "updatedTime", <!-- 修改人名称 -->
UPDATED_NAME as "updatedName" <!-- 修改时间 -->
FROM ${hpjxSchema}.T_HPXS003 WHERE 1=1 AND CREATED_TIME = (SELECT MAX(CREATED_TIME) FROM ${hpjxSchema}.T_HPXS003 WHERE DELETE_FLAG = '0')
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
CREATED_TIME DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPXS003 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="dirId">
DIR_ID = #dirId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
DOC_NAME = #docName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="chgName">
CHG_NAME = #chgName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docSize">
DOC_SIZE = #docSize#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docTag">
DOC_TAG = #docTag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</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="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPXS003 (ID, <!-- ID -->
COMPANY_CODE, <!-- 企业编码 预留 -->
DEP_CODE, <!-- 部门编码 预留 -->
DOC_ID, <!-- 文件标识 -->
DIR_ID, <!-- 目录标识 -->
DOC_NAME, <!-- 文件名 -->
CHG_NAME, <!-- 物料文件名 -->
DOC_SIZE, <!-- 文件大小 -->
DOC_TAG, <!-- 文件标签 -->
REAL_PATH, <!-- 物理路径 -->
DELETE_FLAG, <!-- 是否删除0:否1.是 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_TIME, <!-- 修改人名称 -->
UPDATED_NAME <!-- 修改时间 -->
)
VALUES (#id#, #companyCode#, #depCode#, #docId#, #dirId#, #docName#, #chgName#, #docSize#, #docTag#, #realPath#,
#deleteFlag#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedTime#, #updatedName#)
</insert>
<delete id="delete">
DELETE FROM ${hpjxSchema}.T_HPXS003 WHERE
ID = #id#
</delete>
<!--逻辑删除-->
<update id="deleteFlag">
UPDATE ${hpjxSchema}.T_HPXS003
SET
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<include refid="authCondition" />
</update>
<update id="update">
UPDATE ${hpjxSchema}.T_HPXS003
SET
COMPANY_CODE = #companyCode#, <!-- 企业编码 预留 -->
DEP_CODE = #depCode#, <!-- 部门编码 预留 -->
DOC_ID = #docId#, <!-- 文件标识 -->
DIR_ID = #dirId#, <!-- 目录标识 -->
DOC_NAME = #docName#, <!-- 文件名 -->
CHG_NAME = #chgName#, <!-- 物料文件名 -->
DOC_SIZE = #docSize#, <!-- 文件大小 -->
DOC_TAG = #docTag#, <!-- 文件标签 -->
REAL_PATH = #realPath#,
DELETE_FLAG = #deleteFlag#, <!-- 是否删除0:否1.是 -->
CREATED_BY = #createdBy#, <!-- 创建人 -->
CREATED_NAME = #createdName#, <!-- 创建人名称 -->
CREATED_TIME = #createdTime#, <!-- 创建时间 -->
UPDATED_BY = #updatedBy#, <!-- 修改人 -->
UPDATED_TIME = #updatedTime#, <!-- 修改人名称 -->
UPDATED_NAME = #updatedName# <!-- 修改时间 -->
WHERE
ID = #id#
<include refid="authCondition" />
</update>
</sqlMap>
...@@ -2443,6 +2443,18 @@ $(function () { ...@@ -2443,6 +2443,18 @@ $(function () {
} }
}); });
} }
var info = new EiInfo()
EiCommunicator.send("HPXS003", "queryMaxLog", info, {
onSuccess: function (ei) {//返回结果集
let results = ei.getBlock("result").getMappedRows()
if (results.length>0){
$("#sidebar img").attr("src",downloadHref(results[0].docId),results[0].projectEnv);
}
}, onFail: function (ei) {
}
}, {async: false});
}) })
function timedisplay() { function timedisplay() {
...@@ -2518,4 +2530,15 @@ function changepassword(formEname,formCname){ ...@@ -2518,4 +2530,15 @@ function changepassword(formEname,formCname){
}); });
} }
function downloadHref(docId,projectEnv) {
// S3地址有外网
// return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/docFileDownload/' + docId)
// : ('/EU/DM/EUDM06.jsp?docId=' + docId));
// S3地址无外网
return IPLATUI.CONTEXT_PATH + ("run" == projectEnv ? ('/file/download/' + docId)
: ('/EU/DM/EUDM06.jsp?docId=' + docId));
}
...@@ -185,8 +185,8 @@ ...@@ -185,8 +185,8 @@
<div id="sidebar"> <div id="sidebar">
<div class="sidebar-content"> <div class="sidebar-content">
<!-- Side Header --> <!-- Side Header -->
<div class="side-header"> <div class="side-header" style="text-align: center;">
<img src="${ctx}/hpjx-logo.png" style="width:200px;height:55px;background-image: none;"/> <img src="${ctx}/hpjx-logo.png" style="height:55px;background-image: none;"/>
<%-- <span class="logo"></span>--%> <%-- <span class="logo"></span>--%>
<%--<span class="projectType">[<%=projectTypeDesc%>]</span>--%> <%--<span class="projectType">[<%=projectTypeDesc%>]</span>--%>
</div> </div>
...@@ -558,7 +558,6 @@ ...@@ -558,7 +558,6 @@
var theme = "${theme}"; var theme = "${theme}";
</script> </script>
<style> <style>
.icon-badge { .icon-badge {
......
$(function () {
$(".row").children().attr("class", "col-md-3");
$("#QUERY").on("click", query);
// 附件上传
$("#UPLOAD_FILE").on("click", uploadFile);
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 10,
pageSizes: [10, 20, 30, 50, 100, 200],
},
columns: [{
field: "operator",
template: function (item) {
let auditStatus = item.status;
let template = '';
let docId = item.docId;
let docName = item.docName
if (item.docId != null){
template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(docId) + '" target="_blank">附件预览</a>';
}
return template;
}
},{
field: "docName",
title: "文件名称",
template: function (item) {
let docId = item.docId;
let docName = item.docName
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(docId) + '" target="_blank">'+docName+'</a>';
return template;
}
}],
loadComplete: function(grid) {
// 此 grid 对象
// 处理父子级联动,通过监听 change 事件,判断父级节点是否发生变化
grid.dataSource.bind("change", function(e) {
// 判断父级节点是否发生变化
if (e.field == "factoryCode") {
// cell_label 表示子级节点 ,that 表示此 grid
var cell_label = "groupCode",that = grid;
// locked 表示是否为固定列
var locked = that.isCellLocked(cell_label);
// tr 表示 locked 和非 locked 的行,index 表示此行的第几列
var tr,index;
// 获取此 model 元素信息
var item = e.items[0];
var _uid = item.uid;
if (locked) {
tr = $(".k-grid-content-locked tr[data-uid="+ _uid +"]");
index = $("th[data-field='"+cell_label+"']").data("index");
} else {
tr = $(".k-grid-content tr[data-uid="+ _uid +"]");
index = parseInt($("th[data-field='"+cell_label+"']").data("index")) - that.lockedHeader.find("th").length;
}
// 获取子 cell(td)
var td = tr.children("td:eq("+index+")");
// 触发 td.click 事件,
td.trigger("click");
}
});
},
onSave: function (e) {
// 阻止默认请求,使用自定义保存
//e.preventDefault();
//let btnNode = $(this);
//禁用按钮
//btnNode.attr("disabled", true);
//saveResult(btnNode);
},
onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'update'
|| e.eiInfo.extAttr.methodName == 'insert') {
query();
}
},
onRowClick: function (e) {
/*var block = detailGrid.getEiBlock();
if (block != null) {
block.setRows([]);
detailGrid.setEiBlock(block);
}
var info = new EiInfo()
var parentId = e.model['planInfoNo'];
info.set("parentId", parentId);
EiCommunicator.send("HPSC004", "queryDetail", info, {
onSuccess: function (ei) {//返回结果集
detailGrid.setEiInfo(ei);
}, onFail: function (ei) {
}
}, {async: false});*/
},
}
}
});
let query = function () { resultGrid.dataSource.page(1);}
/**
* 文件上传
*
* @param id
*/
function uploadFile(id) {
JSColorbox.open({
href: "HPXS099?methodName=initLoad",
title: "<div style='text-align: center;'>附件上传</div>",
width: "60%",
height: "50%",
callbackName: uploadFileCallback
});
}
/**
* 附件上传回调
*
* @param e
*/
function uploadFileCallback(e) {
let result = new EiInfo();
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;
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);
EiCommunicator.send("HPXS003", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
resultGrid.dataSource.page(1);
},
onFail: function (ei) {
// 发生异常
NotificationUtil("执行失败,原因[" + ei + "]", "error");
}
}, {
async: false
});
}
/**
* 删除
*/
function deleteFunc() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HPSC002A", "delete", true);
}
})
}
/**
* 日期判断
* @param model 当前数据map
* @param rows 数据集合list
* @returns {boolean} 结束时间是否大于开始时间
*/
function check_time(model,rows){
for (var i=0;i<rows.length;i++){
if (model.planInfoNo == rows[i][5]) {
var start_time = rows[i][22];
var end_time = rows[i][23];
if (end_time < start_time) {
return false;
}
}
}
return true;
}
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 16:17
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" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="企业log管理">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput cname="文件名称" blockId="inqu_status" ename="docName" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="上传日期" endCname="至" blockId="inqu_status"
startName="createdDateFrom" endName="createdDateTo" row="0" role="date"
format="yyyy-MM-dd" satrtRatio="4:8" endRatio="4:8">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="docId" primaryKey="true" cname="文件标识ID" hidden="true"/>
<EF:EFColumn ename="companyCode" cname="企业编码" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn cname="文件名称" ename="docName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建人" ename="createdName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="创建时间" ename="createdTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
<EF:EFColumn cname="修改人" ename="updatedName" align="center" width="150" readonly="true" required="false" enable="false"/>
<EF:EFColumn cname="修改时间" ename="updatedTime" parseFormats="['yyyyMMddHHmmss']" editType="datetime"
dateFormat="yyyy-MM-dd HH:mm:ss" align="center" width="150" readonly="true" required="false"
enable="false"/>
</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("附件上传成功");
//console.log($("#fileDocId").val())
//saveTemp(e);
try {
parent.JSColorbox.setValueCallback(e);
} catch (e){
}
},
}
};
});
\ No newline at end of file
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/3/25
Time: 18:17
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="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="hk_fileLog" path="log"/>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
\ No newline at end of file
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