Commit c6adb2a7 by 宋祥

1.批量下载文件

parent 43c7eb17
......@@ -10,30 +10,33 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
@EnableScheduling
@SpringBootApplication(scanBasePackages = "com.baosight")
@ServletComponentScan("com.baosight.iplat4j.core.web.servlet")
@ImportResource(locations = {"classpath*:spring/framework/platApplicationContext*.xml","classpath*:spring/framework/applicationContext*.xml"})
@ImportResource(locations = {"classpath*:spring/framework/platApplicationContext*.xml",
"classpath*:spring/framework/applicationContext*.xml"})
@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class})
public class HggpApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(HggpApplication.class);
app.run(args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(HggpApplication.class);
}
@Bean("multipartResolver")
public CommonsMultipartResolver multipartResolver(){
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("UTF-8");
resolver.setMaxInMemorySize(10000);
return resolver;
}
public static void main(String[] args) {
SpringApplication app = new SpringApplication(HggpApplication.class);
app.run(args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(HggpApplication.class);
}
@Bean("multipartResolver")
public CommonsMultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("UTF-8");
resolver.setMaxInMemorySize(10000);
return resolver;
}
}
......@@ -34,11 +34,16 @@ public class OSConstant {
/**
* 程序运行目录
*/
public final static String DOWN_DIR = USER_DIR + SEPARATOR + "download";
public final static String DOWN_DIR = USER_DIR + SEPARATOR + "file" + SEPARATOR + "download";
/**
* 二维码目录
*/
public final static String QRCODE_DIR = USER_DIR + SEPARATOR + "qrcode";
public final static String QRCODE_DIR = USER_DIR + SEPARATOR + "file" + SEPARATOR + "qrcode";
/**
* 压缩包目录
*/
public final static String ZIP_DIR = USER_DIR + SEPARATOR + "file" + SEPARATOR + "zip";
}
......@@ -22,6 +22,11 @@ public class S3Constant {
public static String ENDPOINT = PlatApplicationContext.getProperty("iplat4j.admin.objectStorage.s3.endpoint");
/**
* resource
*/
public static String RESOURCE = PlatApplicationContext.getProperty("iplat4j.admin.objectStorage.s3.resource");
/**
* bucket名称
*/
public static String BUCKET_NAME = PlatApplicationContext.getProperty("iplat4j.admin.objectStorage.s3.bucket");
......
package com.baosight.hggp.core.utils;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.constant.OSConstant;
import com.baosight.hggp.core.constant.S3Constant;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.FileUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
......@@ -10,6 +13,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import com.baosight.iplat4j.eu.dm.util.PlatFileUploader;
import java.util.List;
import java.util.Map;
/**
......@@ -73,4 +77,42 @@ public class Iplat4jUtils {
return document;
}
/**
* 压缩文件
*
* @param docIds
* @param zipName
* @return
*/
public static String compressFile(List<String> docIds, String zipName) throws Exception {
String zipFolderPath = OSConstant.ZIP_DIR + OSConstant.SEPARATOR + DateUtils.shortDate()
+ OSConstant.SEPARATOR + zipName;
FileUtils.createDirs(zipFolderPath);
String zipFilePath = zipFolderPath + ".zip";
if (CommonConstant.FileLocation.S3.equalsIgnoreCase(S3Constant.FILE_LOCATION)) {
for (String docId : docIds) {
Teudm05 dbDm05 = S3Utils.buildUrl(docId);
// 文件路径:压缩包路径+文件名称
String localFilePath = zipFolderPath + OSConstant.SEPARATOR + dbDm05.getResCname();
FileUtils.downloadUrlFile(dbDm05.getUrl(), localFilePath);
}
} else {
for (String docId : docIds) {
Map dbDm02 = Iplat4jUtils.getDoc02ById(docId);
String returnUrl = MapUtils.getString(dbDm02, "url");
String docName = MapUtils.getString(dbDm02, "docName");
// 文件路径:压缩包路径+文件名称
String localFilePath = zipFolderPath + OSConstant.SEPARATOR + docName;
FileUtils.fileCopy(returnUrl, localFilePath);
}
}
// 开始压缩
FileUtils.zip(zipFolderPath, zipFilePath);
// 压缩完删除本地文件
FileUtils.deleteFiles(zipFolderPath);
// 替换成HTTP地址
return S3Constant.RESOURCE + zipFilePath.replace(OSConstant.USER_DIR, "")
.replace(OSConstant.SEPARATOR, "/");
}
}
......@@ -17,6 +17,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import org.apache.commons.collections.CollectionUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -161,7 +162,7 @@ public class ServiceHGCW999 extends ServiceEPBase {
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
public void delectDoc(String docId) throws IOException {
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
......
......@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -133,7 +134,7 @@ public class ServiceHGPZ002A extends ServiceEPBase {
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
public void delectDoc(String docId) throws IOException {
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
......
......@@ -17,6 +17,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -127,7 +128,7 @@ public class ServiceHGPZ009A extends ServiceEPBase {
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "banner清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
public void delectDoc(String docId) throws IOException {
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
......
......@@ -16,6 +16,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -96,7 +97,7 @@ public class ServiceHGSB099 extends ServiceEPBase {
* 删除文件
* @param docId 文件ID
*/
public void delectDoc(String docId){
public void delectDoc(String docId) throws IOException {
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
......
......@@ -4,18 +4,12 @@ import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.common.ChangeTypeEnum;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoBase;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.core.tools.Iplat4jTools;
import com.baosight.hggp.core.utils.Iplat4jUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.cw.tools.HGCWTools;
import com.baosight.hggp.hg.dm.tools.HpDmTools;
import com.baosight.hggp.hg.pz.domain.HGPZ009;
import com.baosight.hggp.hg.pz.tools.HGPZTools;
import com.baosight.hggp.hg.sc.domain.HGSC008;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
......@@ -35,9 +29,7 @@ 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 org.apache.commons.collections.CollectionUtils;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
......@@ -249,6 +241,28 @@ public class ServiceHGWD001 extends ServiceEPBase {
return inInfo;
}
private static void cleanBaseInfo(HGWD099 hgwd099) {
hgwd099.setCreatedBy(null);
hgwd099.setCreatedName(null);
hgwd099.setCreatedTime(null);
hgwd099.setUpdatedBy(null);
hgwd099.setUpdatedName(null);
hgwd099.setUpdatedTime(null);
hgwd099.setDepCode(null);
hgwd099.setId(null);
}
private static void cleanBaseInfo(HGWD001 hgwd001) {
hgwd001.setCreatedBy(null);
hgwd001.setCreatedName(null);
hgwd001.setCreatedTime(null);
hgwd001.setUpdatedBy(null);
hgwd001.setUpdatedName(null);
hgwd001.setUpdatedTime(null);
hgwd001.setDepCode(null);
hgwd001.setId(null);
}
@OperationLogAnnotation(operModul = "文档库",operType = "修改",operDesc = "文档库-附件变更-变更附件操作")
public EiInfo updateFile(EiInfo inInfo) {
try {
......@@ -289,26 +303,28 @@ public class ServiceHGWD001 extends ServiceEPBase {
//排除登录用户
List<String> userIds = listByFile.stream().filter(item -> !item.getUserId().equals(UserSessionUtils.getUserId()))
.map(HGWD003::getExtId)
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
HGWDTools.interaction(String.format("[%s]项目变更附件通知",hgwd001.getProjName()),strFileName.substring(0,strFileName.length()-1),userIds);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
.filter(ObjectUtils::isNotBlank).distinct().collect(Collectors.toList());
HGWDTools.interaction(String.format("[%s]项目变更附件通知", hgwd001.getProjName()),
strFileName.substring(0, strFileName.length() - 1), userIds);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
return inInfo;
}
/**
* 初始化变更记录
* @param hgwd001 项目信息
* @param hgwd099 附件信息
* @param type 变更类型
* @return HGWD001A 变更记录
*/
public HGWD001A initHgwd001a(HGWD001 hgwd001,HGWD099 hgwd099,String type){
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
/**
* 初始化变更记录
*
* @param hgwd001 项目信息
* @param hgwd099 附件信息
* @param type 变更类型
* @return HGWD001A 变更记录
*/
public HGWD001A initHgwd001a(HGWD001 hgwd001, HGWD099 hgwd099, String type) {
HGWD001A hgwd001a = new HGWD001A();
hgwd001a.setCompanyCode(hgwd001.getCompanyCode());
hgwd001a.setCompanyName(hgwd001.getCompanyName());
hgwd001a.setProjCode(hgwd001.getProjCode());
hgwd001a.setProjName(hgwd001.getProjName());
......@@ -316,246 +332,250 @@ public class ServiceHGWD001 extends ServiceEPBase {
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_ADD.getCode());
}else if (ChangeTypeEnum.DELETE.getCode().equals(type)){
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_DELETE.getCode());
}else if (ChangeTypeEnum.UPLOAD_UPDATE.getCode().equals(type)){
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_UPDATE.getCode());
hgwd001a.setChangeStartCode(hgwd099.getDocId());
hgwd001a.setChangeStart(hgwd099.getDocName());
}else if (ChangeTypeEnum.RELEASE.getCode().equals(type)){
hgwd001a.setChangeType(ChangeTypeEnum.RELEASE.getCode());
hgwd001a.setChangeContent(hgwd001.getRemark().trim().length()==0?"附件发布":hgwd001.getRemark().trim());
hgwd001a.setChangeStart("V".concat(hgwd001.getDocVersion()+""));
hgwd001a.setChangeEnd("V".concat(hgwd001.getDocVersion()+1+""));
} else if (ChangeTypeEnum.UPLOAD_UPDATE.getCode().equals(type)) {
hgwd001a.setChangeType(ChangeTypeEnum.UPLOAD_UPDATE.getCode());
hgwd001a.setChangeStartCode(hgwd099.getDocId());
hgwd001a.setChangeStart(hgwd099.getDocName());
} else if (ChangeTypeEnum.RELEASE.getCode().equals(type)) {
hgwd001a.setChangeType(ChangeTypeEnum.RELEASE.getCode());
hgwd001a.setChangeContent(hgwd001.getRemark().trim().length() == 0 ? "附件发布" : hgwd001.getRemark().trim());
hgwd001a.setChangeStart("V".concat(hgwd001.getDocVersion() + ""));
hgwd001a.setChangeEnd("V".concat(hgwd001.getDocVersion() + 1 + ""));
}
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
return hgwd001a;
}
/**
* 删除组织及子节点
*
* @param inInfo
* @return
*/
public EiInfo deleteOrgAndChildrenById(EiInfo inInfo) {
try {
List<Map> rows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map idMap = new HashMap();
int sum = 0;
for (int i = 0; i < rows.size(); ++i) {
String orgId = rows.get(i).get("fileId").toString();
Map orgIdMap = new HashMap();
orgIdMap.put("parentId", orgId);
List orgIdChildList = this.dao.query("HGWD001.queryFileChild", orgIdMap);
for (int j = 0; j < orgIdChildList.size(); ++j) {
Map childMap = ((Map) orgIdChildList.get(j));
String childOrgId = childMap.get("id").toString();
idMap.put("id", childOrgId);
this.dao.update(HGWD001.DELETE, idMap);
Map memberMap = new HashMap();
memberMap.put(HGWD099.FIELD_BIZ_ID, ((Map) orgIdChildList.get(j)).get("fileId"));
DaoUtils.update("HGWD099.deleteBizId",memberMap); //删除附件记录
++sum;
}
}
inInfo.setMsg("删除[" + sum + "]条记录成功");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo query1(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo, "inqu_status1");
queryRow.put(HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId);
}
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.addRow(queryRow);
inInfo.setBlock(block);
return super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status1","result1","result1",null);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "文档库",operType = "复制附件",operDesc = "文档库-附件复制-附件复制操作")
public EiInfo save1(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> result1Rows = inInfo.getBlock("result1").getRows();
//List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
// 写入数据
for (Map result1Row:result1Rows) {
StringBuilder strFileName = new StringBuilder();
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(result1Row);
strFileName.append(hgwd001.getFileName()).append("上传附件:附件名称");
for (Map resultRow : resultRows) {
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
cleanBaseInfo(hgdm099);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgdm099.setBizId(hgwd001.getFileId());
hgdm099.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
strFileName.append(hgdm099.getDocName()).append(",");
HGWD001A hgwd001a =initHgwd001a(hgwd001, hgdm099,ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setChangeEnd(hgdm099.getDocName());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
HGWDTools.interaction(hgwd001, strFileName.substring(0, strFileName.length() - 1));
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 复制项目列表
* @param inInfo
* @return
*/
public EiInfo query2(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo, "inqu_status2");
queryRow.put(HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId);
}
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.addRow(queryRow);
inInfo.setBlock(block);
return super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status2","result2","result2",null);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "文档库",operType = "复制项目",operDesc = "文档库-复制项目-复制项目操作")
public EiInfo save2(EiInfo inInfo) {
try {
Map<String,String> queryMap= EiInfoUtils.getFirstRow(inInfo,EiConstant.queryBlock);
List<HGWD001> result1Rows = MapUtils.toDaoEPBases(inInfo.getBlock("result2").getRows(), HGWD001.class);
List<HGWD001> hgwd001List = HGWDTools.HgWd001.queryByParentId(queryMap.get(HGWD001.FIELD_PROJ_CODE),queryMap.get(HGWD001.FIELD_PARENT_ID));
if (queryMap.get("leafType").equals(HgWdConstant.LeafType.P)){
hgwd001List = HGWDTools.HgWd001.queryByProjCode(queryMap.get(HGWD001.FIELD_PROJ_CODE),queryMap.get(HGWD001.FIELD_PARENT_ID));
}
// 要复制项目
String parentId = result1Rows.get(0).getParentId();
if (!StringUtils.isNull(hgwd001List)){
hgwd001List.forEach(hgwd001 -> {
hgwd001.setParentId(parentId);
});
// 查询添加子节点
addNode(hgwd001List);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作复制文件成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "复制文件失败");
}
return inInfo;
}
public void addNode(List<HGWD001> hgwd001List){
List<String> fileIds = hgwd001List.stream().map(HGWD001::getFileId).collect(Collectors.toList());
List<HGWD001> hgwd001s = HGWDTools.HgWd001.listByParentIds(fileIds);
for (HGWD001 hgwd001:hgwd001List) {
String fileId = SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID);
if (!StringUtils.isNull(hgwd001s)){
hgwd001s.forEach(o -> {
if (o.getParentId().equals(hgwd001.getFileId())){
o.setParentId(fileId);
}
});
}
addCopyFile(hgwd001, fileId);
}
if (hgwd001s != null && hgwd001s.size() > 0){
addNode(hgwd001s);
}
}
private void addCopyFile(HGWD001 hgwd001, String fileId){
List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD", hgwd001.getFileId());
StringBuilder strFileName = new StringBuilder();
strFileName.append(hgwd001.getFileName()).append("上传附件:附件名称");
List<HGWD099> hgwd099s = hgwd099List.stream().filter(hgdm099 -> hgdm099.getBizId().equals(hgwd001.getFileId())).collect(Collectors.toList());
for (HGWD099 hgwd099 : hgwd099s) {
cleanBaseInfo(hgwd099);
hgwd099.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgwd099.setBizId(fileId);
hgwd099.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.insert(HGWD099.INSERT, hgwd099);
strFileName.append(hgwd099.getDocName()).append(",");
HGWD001A hgwd001a =initHgwd001a(hgwd001, hgwd099,ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeEndCode(hgwd099.getDocId());
hgwd001a.setChangeEnd(hgwd099.getDocName());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
//hgwd001.setParentId(parentId);
hgwd001.setFileId(fileId);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
cleanBaseInfo(hgwd001);
DaoUtils.insert(HGWD001.INSERT, hgwd001);
HGWDTools.interaction(hgwd001, strFileName.substring(0, strFileName.length() - 1));
}
public EiInfo queryProjectManager(EiInfo inInfo) {
try {
Map queryRow =EiInfoUtils.getFirstRow(inInfo);
Integer isManager =HGWDTools.HgWd003.isProjectManager(queryRow.get(HGWD001.FIELD_FILE_ID).toString());
inInfo.set("isManager", isManager);
}catch (Exception e){
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
private static void cleanBaseInfo(HGWD099 hgwd099){
hgwd099.setCreatedBy(null);
hgwd099.setCreatedName(null);
hgwd099.setCreatedTime(null);
hgwd099.setUpdatedBy(null);
hgwd099.setUpdatedName(null);
hgwd099.setUpdatedTime(null);
hgwd099.setDepCode(null);
hgwd099.setId(null);
}
private static void cleanBaseInfo(HGWD001 hgwd001){
hgwd001.setCreatedBy(null);
hgwd001.setCreatedName(null);
hgwd001.setCreatedTime(null);
hgwd001.setUpdatedBy(null);
hgwd001.setUpdatedName(null);
hgwd001.setUpdatedTime(null);
hgwd001.setDepCode(null);
hgwd001.setId(null);
}
hgwd001a.setChangeContent(hgwd001.getFileName());
hgwd001a.setMatId(hgwd001.getId());
return hgwd001a;
}
/**
* 删除组织及子节点
*
* @param inInfo
* @return
*/
public EiInfo deleteOrgAndChildrenById(EiInfo inInfo) {
try {
List<Map> rows = inInfo.getBlock(EiConstant.resultBlock).getRows();
Map idMap = new HashMap();
int sum = 0;
for (int i = 0; i < rows.size(); ++i) {
String orgId = rows.get(i).get("fileId").toString();
Map orgIdMap = new HashMap();
orgIdMap.put("parentId", orgId);
List orgIdChildList = this.dao.query("HGWD001.queryFileChild", orgIdMap);
for (int j = 0; j < orgIdChildList.size(); ++j) {
Map childMap = ((Map) orgIdChildList.get(j));
String childOrgId = childMap.get("id").toString();
idMap.put("id", childOrgId);
this.dao.update(HGWD001.DELETE, idMap);
Map memberMap = new HashMap();
memberMap.put(HGWD099.FIELD_BIZ_ID, ((Map) orgIdChildList.get(j)).get("fileId"));
DaoUtils.update("HGWD099.deleteBizId", memberMap); //删除附件记录
++sum;
}
}
inInfo.setMsg("删除[" + sum + "]条记录成功");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
public EiInfo query1(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo, "inqu_status1");
queryRow.put(HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId);
}
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.addRow(queryRow);
inInfo.setBlock(block);
return super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status1",
"result1", "result1", null);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "文档库", operType = "复制附件", operDesc = "文档库-附件复制-附件复制操作")
public EiInfo save1(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
List<Map> result1Rows = inInfo.getBlock("result1").getRows();
//List<Map<String, Object>> edcm01List = Iplat4jTools.EdCm01.list("hggp.hgwd.fileType");
// 写入数据
for (Map result1Row : result1Rows) {
StringBuilder strFileName = new StringBuilder();
HGWD001 hgwd001 = new HGWD001();
hgwd001.fromMap(result1Row);
strFileName.append(hgwd001.getFileName()).append("上传附件:附件名称");
for (Map resultRow : resultRows) {
HGWD099 hgdm099 = new HGWD099();
hgdm099.fromMap(resultRow);
cleanBaseInfo(hgdm099);
hgdm099.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgdm099.setBizId(hgwd001.getFileId());
hgdm099.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.insert(HGWD099.INSERT, hgdm099);
strFileName.append(hgdm099.getDocName()).append(",");
HGWD001A hgwd001a = initHgwd001a(hgwd001, hgdm099, ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeEndCode(hgdm099.getDocId());
hgwd001a.setChangeEnd(hgdm099.getDocName());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
HGWDTools.HgWd001.updateStatus(hgwd001);
HGWDTools.interaction(hgwd001, strFileName.substring(0, strFileName.length() - 1));
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 复制项目列表
*
* @param inInfo
* @return
*/
public EiInfo query2(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo, "inqu_status2");
queryRow.put(HGWD001.FIELD_DELETE_FLAG, CommonConstant.YesNo.NO_0);
// 非管理员仅查询自己有权限的项目
String userId = UserSessionUtils.getLoginName();
if (!HgWdUtils.HgWd009.isManager(userId)) {
queryRow.put(User.FIELD_USER_ID, userId);
}
EiBlock block = inInfo.getBlock(EiConstant.queryBlock);
block.addRow(queryRow);
inInfo.setBlock(block);
return super.query(inInfo, HGWD001.QUERY, new HGWD001(), false, new HGWD001().eiMetadata, "inqu_status2",
"result2", "result2", null);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
@OperationLogAnnotation(operModul = "文档库", operType = "复制项目", operDesc = "文档库-复制项目-复制项目操作")
public EiInfo save2(EiInfo inInfo) {
try {
Map<String, String> queryMap = EiInfoUtils.getFirstRow(inInfo, EiConstant.queryBlock);
List<HGWD001> result1Rows = MapUtils.toDaoEPBases(inInfo.getBlock("result2").getRows(), HGWD001.class);
List<HGWD001> hgwd001List = HGWDTools.HgWd001.queryByParentId(queryMap.get(HGWD001.FIELD_PROJ_CODE),
queryMap.get(HGWD001.FIELD_PARENT_ID));
if (queryMap.get("leafType").equals(HgWdConstant.LeafType.P)) {
hgwd001List = HGWDTools.HgWd001.queryByProjCode(queryMap.get(HGWD001.FIELD_PROJ_CODE),
queryMap.get(HGWD001.FIELD_PARENT_ID));
}
// 要复制项目
String parentId = result1Rows.get(0).getParentId();
if (!StringUtils.isNull(hgwd001List)) {
hgwd001List.forEach(hgwd001 -> {
hgwd001.setParentId(parentId);
});
// 查询添加子节点
addNode(hgwd001List);
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作复制文件成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "复制文件失败");
}
return inInfo;
}
public void addNode(List<HGWD001> hgwd001List) {
List<String> fileIds = hgwd001List.stream().map(HGWD001::getFileId).collect(Collectors.toList());
List<HGWD001> hgwd001s = HGWDTools.HgWd001.listByParentIds(fileIds);
for (HGWD001 hgwd001 : hgwd001List) {
String fileId = SequenceGenerator.getNextSequence(HGConstant.SequenceId.WD_FILE_ID);
if (!StringUtils.isNull(hgwd001s)) {
hgwd001s.forEach(o -> {
if (o.getParentId().equals(hgwd001.getFileId())) {
o.setParentId(fileId);
}
});
}
addCopyFile(hgwd001, fileId);
}
if (hgwd001s != null && hgwd001s.size() > 0) {
addNode(hgwd001s);
}
}
private void addCopyFile(HGWD001 hgwd001, String fileId) {
List<HGWD099> hgwd099List = HGWDTools.HgWd099.queryByBiz("WD", hgwd001.getFileId());
StringBuilder strFileName = new StringBuilder();
strFileName.append(hgwd001.getFileName()).append("上传附件:附件名称");
List<HGWD099> hgwd099s = hgwd099List.stream().filter(hgdm099 -> hgdm099.getBizId().equals(hgwd001.getFileId()))
.collect(Collectors.toList());
for (HGWD099 hgwd099 : hgwd099s) {
cleanBaseInfo(hgwd099);
hgwd099.setDeleteFlag(CommonConstant.YesNo.NO_0);
hgwd099.setBizId(fileId);
hgwd099.setStatus(HgWdConstant.FileStatus.S_0);
DaoUtils.insert(HGWD099.INSERT, hgwd099);
strFileName.append(hgwd099.getDocName()).append(",");
HGWD001A hgwd001a = initHgwd001a(hgwd001, hgwd099, ChangeTypeEnum.UPLOAD_ADD.getCode());
hgwd001a.setChangeEndCode(hgwd099.getDocId());
hgwd001a.setChangeEnd(hgwd099.getDocName());
HGWDTools.HgWd001.addHGWD001A(hgwd001a);
}
//hgwd001.setParentId(parentId);
hgwd001.setFileId(fileId);
hgwd001.setStatus(HgWdConstant.FileStatus.S_0);
cleanBaseInfo(hgwd001);
DaoUtils.insert(HGWD001.INSERT, hgwd001);
HGWDTools.interaction(hgwd001, strFileName.substring(0, strFileName.length() - 1));
}
public EiInfo queryProjectManager(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
Integer isManager = HGWDTools.HgWd003.isProjectManager(queryRow.get(HGWD001.FIELD_FILE_ID).toString());
inInfo.set("isManager", isManager);
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 批量下载
*
* @param inInfo
* @return
*/
public EiInfo batchDownload(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String fileName = MapUtils.getString(queryMap, HGWD001.FIELD_FILE_NAME);
String zipName = fileName + "_" + DateUtils.shortDateTime();
List<String> docIds = ObjectUtils.listKey(inInfo, HGWD099.FIELD_DOC_ID);
inInfo.set("downloadUrl", Iplat4jUtils.compressFile(docIds, zipName));
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "批量下载失败");
}
return inInfo;
}
}
......@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -115,7 +116,7 @@ public class ServiceHGXT099 extends ServiceEPBase {
* @param docId 文件ID
*/
@OperationLogAnnotation(operModul = "附件清单",operType = "删除",operDesc = "删除附件文件")
public void delectDoc(String docId){
public void delectDoc(String docId) throws IOException {
Map<String,Object> map = new HashMap<>();
map.put("docId",docId);
List<HGDS002> list = this.dao.query(HGDS002.QUERY,map);
......
package com.baosight.hggp.job;
import com.baosight.hggp.core.constant.OSConstant;
import com.baosight.hggp.util.DateUtil;
import com.baosight.hggp.util.DateUtils;
import com.baosight.hggp.util.FileUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.io.File;
import java.time.LocalDate;
import lombok.extern.slf4j.Slf4j;
/**
* @author:songx
* @date:2024/10/11,12:26
*/
@Slf4j
@Component
public class ClearZipJob {
/**
* 清理ZIP文件
*/
@Scheduled(cron = "0 15 3 * * ?")
public void clearZipFile() {
try {
File zipFolder = new File(OSConstant.ZIP_DIR);
File[] zipFolderFiles = zipFolder.listFiles();
if (zipFolderFiles.length == 0) {
log.warn("清理ZIP文件:无有效的文件");
}
for (File zipFolderFile : zipFolderFiles) {
String folderName = zipFolderFile.getName();
// 当天以前的文件夹全部删除
if (LocalDate.parse(folderName, DateUtils.SHORT_DATE).isBefore(LocalDate.now())) {
FileUtils.deleteFiles(zipFolderFile);
}
}
log.info("清理ZIP文件成功!!!");
} catch (Exception e) {
log.error("清理ZIP文件失败:{}", e.getMessage(), e);
}
}
}
......@@ -2,6 +2,8 @@ package com.baosight.hggp.util;
import com.baosight.hggp.core.constant.OSConstant;
import org.apache.poi.util.IOUtils;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
......@@ -18,9 +20,12 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DecimalFormat;
import java.time.LocalDateTime;
......@@ -30,6 +35,8 @@ import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import lombok.extern.slf4j.Slf4j;
......@@ -187,6 +194,40 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
/**
* 删除目录及文件
*
* @param path
* @return
*/
public static boolean deleteFiles(String path) {
return deleteFiles(Paths.get(path));
}
/**
* 删除目录及文件
*
* @param path
* @return
*/
public static boolean deleteFiles(Path path) {
try {
if (Files.isDirectory(path)) {
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) {
for (Path entry : directoryStream) {
deleteFiles(entry);
}
} catch (Exception e) {
log.error("删除文件失败,读取目录子文件失败:{}", e.getMessage(), e);
}
}
} catch (Exception e) {
log.error("删除文件失败:{}", e.getMessage(), e);
return false;
}
return deleteFile(path);
}
/**
* 删除目录及文件
*
* @param file
* @return
*/
......@@ -214,7 +255,25 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
public static boolean deleteFile(String path) {
Objects.requireNonNull(path);
// 路径为文件且不为空则进行删除
return deleteFile(new File(path));
return deleteFile(Paths.get(path));
}
/**
* 删除单个文件或目录
*
* @param path 被删除的文件
* @return
*/
public static boolean deleteFile(Path path) {
Objects.requireNonNull(path);
// 路径为文件且不为空则进行删除
try {
Files.delete(path);
} catch (Exception e) {
log.error("删除文件失败:{}", e.getMessage(), e);
return false;
}
return true;
}
/**
......@@ -266,43 +325,20 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
* @param targetPath
* @throws IOException
*/
public static void fileCope(String filePath, String targetPath) throws IOException {
// 获得流
FileInputStream fileInputStream = null;
//新文件输出流
FileOutputStream fileOutputStream = null;
try {
fileInputStream = new FileInputStream(filePath);
File targetFile = new File(targetPath);
//获取父目录
File parentFile = targetFile.getParentFile();
//判断是否存在
if (!parentFile.exists()) {
// 创建父目录文件夹
parentFile.mkdirs();
}
//判断文件是否存在
if (!targetFile.exists()) {
//创建文件
targetFile.createNewFile();
}
fileOutputStream = new FileOutputStream(targetFile);
public static void fileCopy(String filePath, String targetPath) throws IOException {
File targetFile = new File(targetPath);
creatFiles(targetPath);
try (FileInputStream fis = new FileInputStream(filePath);
FileOutputStream fos = new FileOutputStream(targetFile)) {
byte[] buffer = new byte[1024];
int len;
//将文件流信息读取文件缓存区,如果读取结果不为-1就代表文件没有读取完毕,反之已经读取完毕
while ((len = fileInputStream.read(buffer)) != -1) {
fileOutputStream.write(buffer, 0, len);
fileOutputStream.flush();
while ((len = fis.read(buffer)) != -1) {
fos.write(buffer, 0, len);
fos.flush();
}
} catch (Exception e) {
throw e;
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
if (fileOutputStream != null) {
fileOutputStream.close();
}
}
}
......@@ -464,16 +500,6 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
}
/**
* InputStream
*
* @param url
*/
public static InputStream downloadStreamFromUrl(String url) throws IOException {
URL httpUrl = new URL(url);
return httpUrl.openStream();
}
/**
* 文件下载
*
* @param file
......@@ -491,18 +517,48 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
}
/**
* 下载文件到本地
*
* @param httpUrl
* @param localFilePath
*/
public static void downloadUrlFile(String httpUrl, String localFilePath) throws IOException {
// 创建文件
FileUtils.creatFiles(localFilePath);
URL url = new URL(httpUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
try (InputStream is = connection.getInputStream();
OutputStream os = new FileOutputStream(localFilePath)) {
// 这里也很关键每次读取的大小为5M,不一次性读取完
byte[] buffer = new byte[1024 * 1024 * 1];
int len = 0;
while ((len = is.read(buffer)) != -1) {
os.write(buffer, 0, len);
}
} catch (IOException e) {
throw e;
} finally {
connection.disconnect();
}
}
/**
* 下载文件到前端
*
* @param url
* @param httpUrl
* @param fileName
* @param response
*/
public static void downloadUrlFile(String url, String fileName, boolean isPreview, HttpServletResponse response)
public static void downloadUrlFile(String httpUrl, String fileName, boolean isPreview, HttpServletResponse response)
throws IOException {
try (InputStream is = downloadStreamFromUrl(url);) {
URL url = new URL(httpUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
try (InputStream is = connection.getInputStream()) {
downloadFile(is, fileName, isPreview, response);
} catch (Exception e) {
throw e;
} finally {
connection.disconnect();
}
}
......@@ -572,4 +628,41 @@ public class FileUtils extends org.apache.commons.io.FileUtils {
}
}
/**
* 压缩文件夹.
*
* @param sourceFilePath 源文件夹路径
* @param zipFilePath 压缩包路径
*/
public static void zip(String sourceFilePath, String zipFilePath) throws IOException {
File zipFile = new File(zipFilePath);
if (zipFile.exists()) {
zipFile.delete();
}
try (FileOutputStream fos = new FileOutputStream(zipFile);
ZipOutputStream zos = new ZipOutputStream(fos)) {
File[] sourceFiles = new File(sourceFilePath).listFiles();
if (null == sourceFiles || sourceFiles.length < 1) {
log.info("待压缩的文件目录:" + sourceFilePath + "里面不存在文件,无需压缩.");
}
byte[] buffs = new byte[1024 * 10];
for (File sourceFile : sourceFiles) {
// 创建ZIP实体,并添加进压缩包
ZipEntry zipEntry = new ZipEntry(sourceFile.getName());
zos.putNextEntry(zipEntry);
// 读取待压缩的文件并写进压缩包里
try (FileInputStream fis = new FileInputStream(sourceFile);
BufferedInputStream bis = new BufferedInputStream(fis, 1024 * 10)) {
int read = 0;
while ((read = bis.read(buffs, 0, 1024 * 10)) != -1) {
zos.write(buffs, 0, read);
}
} catch (IOException e) {
throw e;
}
}
} catch (IOException e) {
throw e;
}
}
}
package com.baosight.hggp.util;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import org.apache.commons.collections.CollectionUtils;
import java.util.Collection;
......@@ -109,6 +111,22 @@ public class ObjectUtils extends org.apache.commons.lang.ObjectUtils {
/**
* 从集合MAP中取KEY
*
* @param inInfo
* @param keyName
* @return
*/
public static <T> List<T> listKey(EiInfo inInfo, String keyName) {
List<Map> items = inInfo.getBlock(EiConstant.resultBlock).getRows();
if (CollectionUtils.isEmpty(items)) {
return null;
}
return items.stream().map(item -> (T) item.get(keyName)).filter(ObjectUtils::isNotBlank).distinct()
.collect(Collectors.toList());
}
/**
* 从集合MAP中取KEY
*
* @param items
* @param keyName
* @return
......
......@@ -469,9 +469,9 @@ $(function () {
readonly: true,
template: function (item) {
let template = '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'href="' + downloadHref(item.docId) + '">附件下载</a>';
+ 'href="' + downloadHref(item.docId) + '">下载</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="changeFile(\'' + item.docId + '\',\''+item.bizId+'\')" target="_blank">附件变更</a>';
+ 'onclick="changeFile(\'' + item.docId + '\',\''+item.bizId+'\')" target="_blank">变更</a>';
return template;
}
}, {
......@@ -498,14 +498,16 @@ $(function () {
}
};
downKeyUp();
downKeyUp();
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
$("#SAVE1").on("click", saveFunc);
$("#SAVE2").on("click", saveProtFunc);
//确认发布
$("#confirmRelease").on("click", updateRelease);
// 查询
$("#BTN_DELETE").on("click", deleteFunc);
$("#SAVE1").on("click", saveFunc);
$("#SAVE2").on("click", saveProtFunc);
//确认发布
$("#confirmRelease").on("click", updateRelease);
// 批量下载
$("#BATCH_DOWNLOAD").on("click", batchDownload);
});
let query = function () {
......@@ -994,12 +996,30 @@ let isProjectManager = function (parentId) {
default:
$("#RELEASE").attr("disabled", true);
$("#UPLOAD_FILE").attr("disabled", true);
$("#COPY_FILE").attr("disabled", true);
$("#PREVIEW").attr("disabled", true);
$("#COPY_FILE").attr("disabled", true);
$("#PREVIEW").attr("disabled", true);
}
}
}
}, {
async: false
async: false
})
}
/**
* 批量下载
*/
let batchDownload = function () {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选要下载的数据!");
return;
}
JSUtils.submitGridsData("result", "HGWD001", "batchDownload", false,
function (res) {
if (res.status > -1) {
window.open(res.extAttr.downloadUrl, '_blank');
}
}
);
}
......@@ -71,7 +71,7 @@
serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center" sort="false"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="100" align="center" sort="false"/>
<EF:EFColumn ename="docName" cname="文件名称" enable="false" width="180"/>
<EF:EFColumn ename="docType" cname="文件类型" enable="false" width="110" align="center"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
......
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