Commit a634797c by 宋祥

1.委外加工增加文档选择功能

parent c2ca5d98
package com.baosight.hggp.hg.sc.domain;
import com.baosight.iplat4j.core.data.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.NumberUtils;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Project: <br>
* Title:Hgsc009a.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-09-29 14:12:44 create
*/
public class HGSC010D extends DaoEPBase {
private static final long serialVersionUID = 1L;
public static final String FIELD_ID = "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_CONTRACT_CODE = "contractCode"; /* 委托单号*/
public static final String FIELD_FILE_ID = "fileId"; /* 目录ID*/
public static final String FIELD_DOC_ID = "docId"; /* 附件ID*/
public static final String FIELD_DOC_NAME = "docName"; /* 附件名称*/
public static final String FIELD_DOC_TYPE = "docType"; /* 附件类型*/
public static final String COL_ID = "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_CONTRACT_CODE = "CONTRACT_CODE"; /* 委托单号*/
public static final String COL_FILE_ID = "FILE_ID"; /* 目录ID*/
public static final String COL_DOC_ID = "DOC_ID"; /* 附件ID*/
public static final String COL_DOC_NAME = "DOC_NAME"; /* 附件名称*/
public static final String COL_DOC_TYPE = "DOC_TYPE"; /* 附件类型*/
public static final String QUERY = "HGSC010D.query";
public static final String COUNT = "HGSC010D.count";
public static final String INSERT = "HGSC010D.insert";
public static final String UPDATE = "HGSC010D.update";
public static final String DELETE = "HGSC010D.delete";
private Long id = new Long(0); /* ID*/
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 contractCode = " "; /* 委托单号*/
private String fileId = " "; /* 文档ID*/
private String docId = " "; /* 附件ID*/
private String docName = " "; /* 附件名称*/
private String docType = " "; /* 附件类型*/
/**
* 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_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_CONTRACT_CODE);
eiColumn.setDescName("委托单号");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_FILE_ID);
eiColumn.setDescName("目录ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_ID);
eiColumn.setDescName("附件ID");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_NAME);
eiColumn.setDescName("附件名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_DOC_TYPE);
eiColumn.setDescName("附件类型");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HGSC010D() {
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 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 contractCode - 委托单号.
* @return the contractCode
*/
public String getContractCode() {
return this.contractCode;
}
/**
* set the contractCode - 委托单号.
*
* @param contractCode - 委托单号
*/
public void setContractCode(String contractCode) {
this.contractCode = contractCode;
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getDocId() {
return docId;
}
public void setDocId(String docId) {
this.docId = docId;
}
public String getDocName() {
return docName;
}
public void setDocName(String docName) {
this.docName = docName;
}
public String getDocType() {
return docType;
}
public void setDocType(String docType) {
this.docType = docType;
}
/**
* 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));
setContractCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_CONTRACT_CODE)), contractCode));
setFileId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_FILE_ID)), fileId));
setDocId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_ID)), docId));
setDocName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_NAME)), docName));
setDocType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DOC_TYPE)), docType));
}
/**
* 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_CONTRACT_CODE, StringUtils.toString(contractCode, eiMetadata.getMeta(FIELD_CONTRACT_CODE)));
map.put(FIELD_FILE_ID, StringUtils.toString(fileId, eiMetadata.getMeta(FIELD_FILE_ID)));
map.put(FIELD_DOC_ID, StringUtils.toString(docId, eiMetadata.getMeta(FIELD_DOC_ID)));
map.put(FIELD_DOC_NAME, StringUtils.toString(docName, eiMetadata.getMeta(FIELD_DOC_NAME)));
map.put(FIELD_DOC_TYPE, StringUtils.toString(docType, eiMetadata.getMeta(FIELD_DOC_TYPE)));
return map;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.sc.domain.HGSC010D;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
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 java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/21,11:07
*/
public class ServiceHGSC010D extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010D().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "委外加工", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
return super.query(inInfo, HGSC010D.QUERY, new HGSC010D());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 删除
*
* @param inInfo
* @return
*/
public EiInfo remove(EiInfo inInfo) {
try {
List<HGSC010D> fSc010Ds = MapUtils.toDaoEPBases(inInfo, HGSC010D.class);
for (HGSC010D fSc010D : fSc010Ds) {
DaoUtils.insert(HGSC010D.DELETE, fSc010D.toMap());
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fSc010Ds.size() + "]条数据删除成功!");
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "删除失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.sc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.sc.domain.HGSC010D;
import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
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 java.util.List;
import java.util.Map;
/**
* @author:songx
* @date:2024/10/21,11:07
*/
public class ServiceHGSC010D1 extends ServiceEPBase {
/**
* 初始化
*
* @param inInfo
* @return
*/
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGSC010D().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "委外加工", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryRow = EiInfoUtils.getFirstRow(inInfo);
// 未选择文件目录时,返回空
String fileId = MapUtils.getString(queryRow, HGWD001.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) {
return inInfo;
}
String parentId = MapUtils.getString(queryRow, HGWD001.FIELD_PARENT_ID);
String projCode = MapUtils.getString(queryRow, HGWD001.FIELD_PROJ_CODE);
// 判断是否备件制造图
boolean isSpare = HgWdUtils.HgWd001.isSpare(parentId, projCode);
// 仅查询已发布的文件
queryRow.put(HGWD001.FIELD_STATUS, HgWdConstant.FileStatus.S_1);
// 管理员、开放目录不做权限验证
if (!(isSpare || HgWdUtils.HgWd009.isManager())) {
queryRow.put(User.FIELD_USER_ID, UserSessionUtils.getUserId());
}
inInfo = super.query(inInfo, HGWD002.QUERY, new HGWD002());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 确认
*
* @param inInfo
* @return
*/
public EiInfo confirm(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String contractCode = MapUtils.getString(queryMap, HGSC010D.FIELD_CONTRACT_CODE);
AssertUtils.isEmpty(contractCode, "请先选择委托单");
List<HGSC010D> fSc010Ds = MapUtils.toDaoEPBases(inInfo, HGSC010D.class);
for (HGSC010D fSc010D : fSc010Ds) {
fSc010D.setContractCode(contractCode);
fSc010D.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGSC010D.INSERT, fSc010D);
}
inInfo.setMsg("操作成功!本次对[" + fSc010Ds.size() + "]条数据新增成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "新增失败");
}
return inInfo;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGSC010D">
<sql id="column">
T.ID as "id", <!-- ID -->
T.ACCOUNT_CODE as "accountCode", <!-- 账套 -->
T.DEP_CODE as "depCode", <!-- 部门编码 -->
T.CREATED_BY as "createdBy", <!-- 创建人 -->
T.CREATED_NAME as "createdName", <!-- 创建人名称 -->
T.CREATED_TIME as "createdTime", <!-- 创建时间 -->
T.UPDATED_BY as "updatedBy", <!-- 修改人 -->
T.UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
T.UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
T.DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
T.CONTRACT_CODE as "contractCode", <!-- 委托单号 -->
T.FILE_ID as "fileId", <!-- 目录ID -->
T.DOC_ID as "docId", <!-- 附件ID -->
T.DOC_NAME as "docName", <!-- 附件名称 -->
T.DOC_TYPE as "docType" <!-- 附件类型 -->
</sql>
<sql id="columnC">
C.PROJ_CODE as "projCode", <!-- 项目编码 -->
C.PROJ_NAME as "projName", <!-- 项目名称 -->
C.FILE_NAME as "fileName" <!-- 目录名称 -->
</sql>
<sql id="condition">
AND T.DELETE_FLAG = 0
<isNotEmpty prepend=" AND " property="id">
T.ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
T.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
T.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="contractCode">
T.CONTRACT_CODE = #contractCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
T.FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
T.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docName">
T.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
T.ID DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hggp.hg.sc.domain.HGSC010D">
SELECT
<include refid="column"/>,
<include refid="columnC"/>
FROM ${hggpSchema}.HGSC010D T, ${hggpSchema}.HGWD099 B, ${hggpSchema}.HGWD001 C
WHERE 1=1
AND T.DOC_ID = B.DOC_ID
AND B.BIZ_ID = C.FILE_ID
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*)
FROM ${hggpSchema}.HGSC010D T, ${hggpSchema}.HGWD099 B, ${hggpSchema}.HGWD001 C
WHERE 1=1
AND T.DOC_ID = B.DOC_ID
AND B.FILE_ID = C.FILE_ID
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGSC010D (
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
CONTRACT_CODE, <!-- 委托单号 -->
FILE_ID, <!-- 目录ID -->
DOC_ID, <!-- 附件ID -->
DOC_NAME, <!-- 附件名称 -->
DOC_TYPE
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#,
#contractCode#, #fileId#, #docId#, #docName#, #docType#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGSC010D SET DELETE_FLAG = 1 WHERE ID = #id#
</delete>
</sqlMap>
......@@ -8,45 +8,40 @@ $(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [{
field: "operator",
template: function (item) {
let params = "'" + item.companyCode + "', '" + item.companyName + "', '"
+ item.id + "', '" + item.contractCode + "'";
pageSize: 20, pageSizes: [10, 20, 50, 70, 100],
}, columns: [{
field: "operator", template: function (item) {
let params = "'" + item.companyCode + "', '" + item.companyName + "', '" + item.id + "', '"
+ item.contractCode + "'";
let template = '';
if (item.companyCode) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showFunc(' + params + ')" >详情</a>';
}
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showDoc(' + params + ')" >附件</a>';
+ 'onclick="showDoc(' + params + ')" >文档</a>';
return template;
}
}, {
field: "contractDate",
attributes: {
field: "contractDate", attributes: {
class: "i-input-readonly"
},
defaultValue: function () {
}, defaultValue: function () {
return currShortDate();
}
}],
beforeEdit: function (e) {
}], beforeEdit: function (e) {
let item = e.model;
if(item.subStatus == '1'){
if (item.subStatus == '1') {
e.preventDefault();
}
},
loadComplete: function (grid) {
}, loadComplete: function (grid) {
$("#BNT_SUBMIT").on("click", updateStatus);
grid.dataSource.bind("change", function (e) {
if (e.field == "companyCode") {
for (let i = 0; i < companyCodeBox.length; i++) {
if (companyCodeBox[i]['companyCode'] === e.items[0]['companyCode']) {
resultGrid.setCellValue(e.items[0],"companyName",companyCodeBox[i]['companyName']);
resultGrid.setCellValue(e.items[0], "companyName",
companyCodeBox[i]['companyName']
);
break;
}
}
......@@ -54,19 +49,17 @@ $(function () {
if (e.field == "supCode") {
for (let i = 0; i < supRecordCodeBox.length; i++) {
if (supRecordCodeBox[i]['valueField'] === e.items[0]['supCode']) {
resultGrid.setCellValue(e.items[0],"supName",supRecordCodeBox[i]['textField']);
resultGrid.setCellValue(e.items[0], "supName", supRecordCodeBox[i]['textField']);
break;
}
}
}
});
},
onSuccess: function (e) {
}, onSuccess: function (e) {
if (e.eiInfo.extAttr.methodName == 'save' || e.eiInfo.extAttr.methodName == 'delete') {
query();
}
},
onSave: function (e) {
}, onSave: function (e) {
// 阻止默认请求,使用自定义保存
e.preventDefault();
let btnNode = $(this);
......@@ -89,6 +82,7 @@ $(window).load(function () {
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 显示附件详情
* @param companyCode 公司编码
......@@ -96,13 +90,11 @@ let query = function () {
* @param parentId 父级ID
* @param contractCode 委托编号
*/
function showFunc(companyCode,companyName,parentId,contractCode) {
function showFunc(companyCode, companyName, parentId, contractCode) {
JSColorbox.open({
href: "HGSC010A?methodName=initLoad" +
"&inqu_status-0-companyCode=" + companyCode +
"&inqu_status-0-companyName=" + companyName +
"&inqu_status-0-parentId=" + parentId +
"&inqu_status-0-contractCode="+ contractCode,
href: "HGSC010A?methodName=initLoad" + "&inqu_status-0-companyCode=" + companyCode
+ "&inqu_status-0-companyName=" + companyName + "&inqu_status-0-parentId=" + parentId
+ "&inqu_status-0-contractCode=" + contractCode,
title: "<div style='text-align: center;'>委外详情</div>",
width: "90%",
height: "80%",
......@@ -166,8 +158,7 @@ function updateStatus() {
if (flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"提交\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGSC010", "updateStatus", true,
function (e) {
JSUtils.submitGridsData("result", "HGSC010", "updateStatus", true, function (e) {
var status = e.getStatus();
if (status !== -1) {
query();
......@@ -186,7 +177,7 @@ function updateStatus() {
* @param parentId
* @param contractCode
*/
let showDoc = function (companyCode, companyName, parentId, contractCode){
let showDoc = function (companyCode, companyName, parentId, contractCode) {
let params = {
"inqu_status-0-companyCode": companyCode,
"inqu_status-0-companyName": companyName,
......@@ -194,10 +185,10 @@ let showDoc = function (companyCode, companyName, parentId, contractCode){
"inqu_status-0-contractCode": contractCode
}
JSColorbox.open({
href: "HGWD002",
title: "<div style='text-align: center;'>文档管理</div>",
width: "100%",
height: "100%",
href: "HGSC010D",
title: "<div style='text-align: center;'>文档详情</div>",
width: "95%",
height: "95%",
params: params
});
}
......
$(function () {
IPLATUI.EFGrid.result = {
pageable: false,
columns: [{
field: "operator",
template: function (model) {
let param = "'" + model.fileId + "', '" + model.docId + "', '" + model.docType + "', '"
+ model.docName + "'";
let template = '';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showPreview(' + param + ')" >预览</a>';
return template;
}
}]
}
// 查询
$("#QUERY").on("click", query);
// 选择
$("#SELECT_DOC").on("click", selectDoc);
// 删除
$("#REMOVE").on("click", remove);
// 下载
$("#DOWNLOAD").on("click", download);
});
/**
* 页面加载完执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 预览
*
* @param fileId
* @param docId
* @param docType
* @param docName
*/
let showPreview = function (fileId, docId, docType, docName) {
addRecordWindow(fileId, docId, docType, docName);
}
/**
* 删除
*/
let remove = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.submitGridsData("result", "HGSC010D", "remove", true);
}
/**
* 选择附件
*/
let selectDoc = function () {
let params = {
"inqu_status-0-contractCode": $("#inqu_status-0-contractCode").val()
}
JSColorbox.open({
href: "HGSC010D1",
title: "<div style='text-align: center;'>选择文档</div>",
width: "95%",
height: "95%",
params: params,
callbackName: selectDocCallBack
});
}
/**
* 回调
*/
let selectDocCallBack = function () {
// 刷新页面
query();
// 关闭弹窗
JSColorbox.close();
}
\ No newline at end of file
<!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="查询条件">
<div class="row">
<EF:EFInput ename="contractCode" cname="委外单号" blockId="inqu_status" row="0" colWidth="3"
readonly="true"/>
<EF:EFInput ename="companyName" cname="公司名称" blockId="inqu_status" row="0" colWidth="3"
readonly="true"/>
<EF:EFInput ename="docName" cname="附件名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="结果集">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="100" align="center"/>
<EF:EFColumn ename="fielId" cname="目录ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="docType" cname="附件类型" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
<jsp:include page="/HG/WD/HGWD002A1.jsp"/>
\ No newline at end of file
$(function () {
const init = () => {
$("#HGSC010D1").css("padding-bottom", "8px")
sessionStorage.removeItem("__user_id__")
setTimeout(() => {
let parendId = $("inqu_status-0-parentId").val();
if (!isBlank(parendId)) {
resultGrid.dataSource.page(1);
}
// 显示授权按钮
showAuthButton();
}, 1000);
// 分割线组件
(function () {
splitter = $("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
}).data("kendoSplitter");
// 当 EFRegion 的 fitHeight="true" 时,需要为 splitter 中的 k-splitbar 加上 class="i-fit-height"。
$("#splitter").find(".k-splitbar").addClass("i-fit-height");
//加下面的延迟是为了处理 多界面同时刷新 界面展示不全的问题
var interval01 = setInterval(splitterInterval, 200);
function splitterInterval() {
if (document.getElementById("splitter").getElementsByClassName("k-splitbar").length !== 1) {
$("#splitter").kendoSplitter({
panes: [
{size: "25%", min: "20%", max: "80%", collapsible: true},
{},
{collapsible: true}
]
});
} else {
clearInterval(interval01);
}
}
})();
// 抽屉组件
(function () {
$(".close-btn span").on("click", function () {
closeDrawer()
})
function closeDrawer() {
$(".drawer-wrapper").css("transform", "translateX(-100%)");
// 重置splitter
splitter.collapse(".k-pane:first")
splitter.expand(".k-pane:first")
}
function openDrawer(url, userId) {
$(".drawer-wrapper").css("transform", "translateX(0%)");
const lastId = sessionStorage.getItem("__user_id__")
if (lastId !== userId) {
sessionStorage.setItem("__user_id__", userId);
}
if ($(".drawer-wrapper iframe").attr("src") === '') {
$(".drawer-wrapper iframe").attr("src", url)
}
refreshUserDetail();
function refreshUserDetail() {
if ($("#iframeDrawer")?.get(0)?.contentWindow?.refreshWindow) {
$("#iframeDrawer").get(0).contentWindow.refreshWindow()
return
}
setTimeout(() => {
refreshUserDetail();
}, 50)
}
}
window.closeDrawer = closeDrawer;
window.openDrawer = openDrawer;
})();
}
init();
IPLATUI.EFTree = {
"docTree": {
query: function (inInfo, model) {
inInfo.set("inqu_status-0-projCode", $("#inqu_status-0-projCode").val());
return inInfo;
},
select: function (e) {
var _data = this.dataItem(e.node);
var labelValue = _data.label;
setTreeNodeValue(_data);
$("[name = 'inqu_status-0-parentId']").val(labelValue);
$("[name = 'inqu_status-0-fileId']").val(_data.id);
$("[name = 'inqu_status-0-leafLevel']").val(_data.leafLevel == null ? 0 : _data.leafLevel);
$("[name = 'inqu_status-0-projCode']").val(_data.projCode);
$("[name = 'inqu_status-0-fileName']").val(_data.text);
resultGrid.dataSource.page(1);
// 显示授权按钮
showAuthButton();
},
/*ROOT:{label: 'root',text: '组织机构'},*/
template: function (node) {
var item = node.item;
var title = item.text;
let icon = 'fa fa-globe'
if (item.label !== 'root') {
switch (item.leafType) {
case 'P':
icon = 'fa fa-clipboard'
break;
case 'C':
icon = 'fa fa-folder'
break;
}
}
return ' <span class="' + icon
+ '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label
+ '">' + title + '</span>'
},
loadComplete: function (options) {
},
selectTreeNode: {
fileId: '',
parentId: '',
projCode: '',
companyCode: '',
leafLevel: '',
isAuth: '1'
}
}
};
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: [{
field: "docVersion",
template: function (model) {
return "v" + model.docVersion;
}
}, {
field: "docType",
template: function (row) {
if (!isBlank(row.docType) && row.docType.startsWith(".")) {
return row.docType.substring(1);
}
return row.docType == null ? "" : row.docType;
}
}],
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 确认选择
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
// query();
});
/**
* 查询
*/
let query = function () {
let fileId = $("#inqu_status-0-fileId").val();
if (isBlank(fileId)) {
message("请选择文件目录,再进行查询");
return;
}
resultGrid.dataSource.page(1);
}
/**
* 设置树节点的值
*
* @param nodeData
*/
let setTreeNodeValue = function (nodeData) {
IPLATUI.EFTree.docTree.selectTreeNode.fileId = nodeData.label;
IPLATUI.EFTree.docTree.selectTreeNode.parentId = nodeData.parentId;
IPLATUI.EFTree.docTree.selectTreeNode.fileName = nodeData.text;
IPLATUI.EFTree.docTree.selectTreeNode.companyCode = nodeData.companyCode;
IPLATUI.EFTree.docTree.selectTreeNode.projCode = nodeData.projCode;
IPLATUI.EFTree.docTree.selectTreeNode.leafLevel = nodeData.leafLevel;
IPLATUI.EFTree.docTree.selectTreeNode.isAuth = nodeData.isAuth;
}
/**
* 确认
*/
let confirm = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.submitGridsData("result", "HGSC010D1", "confirm", false,
function (res) {
if (res.status >= 0) {
parent.JSColorbox.setValueCallback();
}
}
);
}
\ No newline at end of file
<!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="文档浏览">
<div id="splitter" class="i-fit-height">
<div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div id="menu" style="margin-top: 12px; margin-bottom: 8px">
<EF:EFTree bindId="docTree" ename="tree_name" textField="text" valueField="label"
hasChildren="leaf" pid="parentId" serviceName="HGWD001D" methodName="queryTree"
expandLevel="1">
</EF:EFTree>
</div>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height">
<EF:EFRegion id="inqu" title="查询条件">
<EF:EFInput ename="contractCode" cname="委托单号" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="项目代码" ename="projCode" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="parentId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库id" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="类型" ename="type" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="层级" ename="leafLevel" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文档库名称" ename="fileName" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"
value="WD"/>
<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 cname="附件名称" ename="docName" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="上传时间" endCname="至" blockId="inqu_status" row="0"
startName="createdDateFrom" endName="createdDateTo" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="false">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" sort="setted"
checkMode="row">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="fileId" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="附件ID" enable="false" width="120" align="center" sort="false"
hidden="true"/>
<EF:EFComboColumn ename="fileType" cname="附件分类" enable="false" width="90" align="center">
<EF:EFCodeOption codeName="hggp.hgwd.fileType"/>
</EF:EFComboColumn>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="220" sort="true"/>
<EF:EFColumn ename="docType" cname="附件后缀" enable="false" width="110" align="center"
sort="true"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center"
sort="true"/>
<EF:EFColumn ename="updatedTime" cname="上传时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']"
dateFormat="yyyy-MM-dd HH:mm:ss" sort="true"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</EF:EFPage>
/**
* 下载
*/
let download = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选要下载的数据!");
return;
}
if (rows.length == 1) {
singleDownload(rows[0]);
} else {
batchDownload();
}
}
/**
* 单个下载
*
* @param row
*/
let singleDownload = function (row) {
let inInfo = new EiInfo();
inInfo.set("result-0-fileId", row['fileId']);
inInfo.set("result-0-docId", row['docId']);
EiCommunicator.send("HGWD001C", "add", inInfo, {
onSuccess(res) {
if (res.status > -1) {
window.open(CommonUtils.downloadFile(row['docId'], false), '_blank');
} else {
message(res.msg);
}
}
}, {async: false})
}
/**
* 批量下载
*
* @param fileId
* @param docId
*/
let batchDownload = function () {
JSUtils.submitGridsData("result", "HGWD001C", "batchDownload", false,
function (res) {
if (res.status > -1) {
window.open(res.extAttr.downloadUrl, '_blank');
}
}
);
}
\ No newline at end of file
......@@ -299,55 +299,3 @@ let preview = function () {
let showPreview = function (fileId, docId, docType, docName) {
addRecordWindow(fileId, docId, docType, docName);
}
/**
* 下载
*/
let download = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选要下载的数据!");
return;
}
if (rows.length == 1) {
singleDownload(rows[0]);
} else {
batchDownload();
}
}
/**
* 单个下载
*
* @param row
*/
let singleDownload = function (row) {
let inInfo = new EiInfo();
inInfo.set("result-0-fileId", row['fileId']);
inInfo.set("result-0-docId", row['docId']);
EiCommunicator.send("HGWD001C", "add", inInfo, {
onSuccess(res) {
if (res.status > -1) {
window.open(CommonUtils.downloadFile(row['docId'], false), '_blank');
} else {
message(res.msg);
}
}
}, {async: false})
}
/**
* 批量下载
*
* @param fileId
* @param docId
*/
let batchDownload = function () {
JSUtils.submitGridsData("result", "HGWD001C", "batchDownload", false,
function (res) {
if (res.status > -1) {
window.open(res.extAttr.downloadUrl, '_blank');
}
}
);
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
<script src="${ctx}/common/docxjs/jszip.min.js"></script>
<script src="${ctx}/common/docxjs/docx-preview.js"></script>
<script src="${ctx}/common/js/xlsx.full.min.js"></script>
<script src="${ctx}/HG/WD/HGWD001C1.js"></script>
<script src="${ctx}/HG/WD/HGWD002A1.js"></script>
<link rel="stylesheet" href="${ctx}/HG/WD/HGWD002A1.css">
......
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