Commit 5941e5a3 by liuyang

2024-10-22

1.文档管理添加附件变更记录
parent 42c8c599
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.common.DdynamicEnum;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.core.enums.OrgTypeEnum;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD006;
import com.baosight.hggp.hg.xs.domain.Org;
import com.baosight.hggp.util.*;
import com.baosight.hggp.util.contants.ACConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/22
* @description
*/
public class ServiceHGWD006 extends ServiceEPBase{
@Override
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD006().eiMetadata);
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"初始化失败");
}
return inInfo;
}
@Override
public EiInfo query(EiInfo inInfo) {
Map row = EiInfoUtils.getFirstRow(inInfo);
row.remove(HGWD006.FIELD_FILE_NAME);
row.remove(HGWD006.FIELD_DOC_NAME);
return super.query(inInfo, HGWD006.QUERY, new HGWD006());
}
@Override
public EiInfo update(EiInfo inInfo) {
return super.update(inInfo, HGWD006.UPDATE);
}
@Override
public EiInfo insert(EiInfo inInfo) {
try {
List<HGWD006> resultRows = MapUtils.toDaoEPBases(inInfo, HGWD006.class);
for (HGWD006 hgwd006: resultRows) {
if (StringUtils.isNotEmpty(hgwd006.getChangeContent())){
DaoUtils.insert(HGWD006.INSERT, hgwd006);
}
}
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据保存成功!");
}catch (Exception e){
LogUtils.setMsg(inInfo,e,"新增失败");
}
return inInfo;
}
}
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
/**
* @author LiuYang
* @version 1.0 2024/10/22
* @description
*/
public class ServiceHGWD099B 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-10-22 14:00:02
Version : 1.0
schema : hggp
tableName : HGWD006
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
DEP_CODE VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
DELETE_FLAG TINYINT,
PROJ_CODE VARCHAR,
PROJ_NAME VARCHAR,
FILE_ID VARCHAR,
DOC_ID VARCHAR,
CHANGE_CONTENT VARCHAR
-->
<sqlMap namespace="HGWD006">
<sql id="condition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME like concat('%',#projName#,'%')
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId#
</isNotEmpty>
<!--<isNotEmpty prepend=" AND " property="fileName">
FILE_ID like concat('%',#fileName#,'%')
</isNotEmpty>-->
<!--<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>-->
<!--<isNotEmpty prepend=" AND " property="docName">
DOC_NAME like concat('%',#docName#,'%')
</isNotEmpty>-->
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="parentId">
PARENT_ID = #parentId#
</isNotEmpty>
</sql>
<select id="query" parameterClass="java.util.HashMap"
resultClass="com.baosight.hggp.hg.wd.domain.HGWD006">
SELECT
ID as "id", <!-- ID -->
ACCOUNT_CODE as "accountCode", <!-- 企业编码 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 记录创建者 -->
CREATED_NAME as "createdName", <!-- 记录创建名称 -->
CREATED_TIME as "createdTime", <!-- 记录创建时间 -->
UPDATED_BY as "updatedBy", <!-- 记录修改者 -->
UPDATED_NAME as "updatedName", <!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime", <!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 0-未删除,1-已删除 -->
PROJ_CODE as "projCode", <!-- 项目编码 -->
PROJ_NAME as "projName", <!-- 项目名称 -->
FILE_ID as "fileId", <!-- 文件ID -->
DOC_ID as "docId", <!-- 附件ID -->
CHANGE_CONTENT as "changeContent", <!-- 变更内容 -->
FILE_NAME as "fileName",
DOC_NAME as "docName"
FROM ${hggpSchema}.HGWD006 WHERE 1=1
<include refid="condition" />
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGWD006 WHERE 1=1
<include refid="condition" />
</select>
<!--
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="accountCode">
ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projCode">
PROJ_CODE = #projCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="projName">
PROJ_NAME = #projName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="fileId">
FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="docId">
DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="changeContent">
CHANGE_CONTENT = #changeContent#
</isNotEmpty>
-->
<insert id="insert">
INSERT INTO ${hggpSchema}.HGWD006 (ID, <!-- ID -->
ACCOUNT_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 记录创建者 -->
CREATED_NAME, <!-- 记录创建名称 -->
CREATED_TIME, <!-- 记录创建时间 -->
DELETE_FLAG, <!-- 0-未删除,1-已删除 -->
PROJ_CODE, <!-- 项目编码 -->
PROJ_NAME, <!-- 项目名称 -->
FILE_ID, <!-- 文件ID -->
DOC_ID, <!-- 附件ID -->
CHANGE_CONTENT, <!-- 变更内容 -->
FILE_NAME,
DOC_NAME,
PARENT_ID
)
VALUES (#id#, #accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #deleteFlag#,
#projCode#, #projName#, #fileId#, #docId#, #changeContent#, #fileName#, #docName#, #parentId#)
</insert>
<delete id="delete">
DELETE FROM ${hggpSchema}.HGWD006 WHERE
ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGWD006
SET
UPDATED_BY = #updatedBy#, <!-- 记录修改者 -->
UPDATED_NAME = #updatedName#, <!-- 记录修改名称 -->
UPDATED_TIME = #updatedTime#, <!-- 记录修改时间 -->
DELETE_FLAG = #deleteFlag#, <!-- 0-未删除,1-已删除 -->
PROJ_CODE = #projCode#, <!-- 项目编码 -->
PROJ_NAME = #projName#, <!-- 项目名称 -->
FILE_ID = #fileId#, <!-- 文件ID -->
DOC_ID = #docId#, <!-- 附件ID -->
CHANGE_CONTENT = #changeContent#, <!-- 变更内容 -->
FILE_NAME = #fileName#,
DOC_NAME = #docName#,
PARENT_ID = #parentId#
WHERE
ID = #id#
</update>
</sqlMap>
......@@ -6,13 +6,7 @@ import com.baosight.hggp.core.extapp.decheng.api.DcOpenApi;
import com.baosight.hggp.core.security.UserSessionUtils;
import com.baosight.hggp.hg.cw.domain.HGCW999;
import com.baosight.hggp.hg.wd.constant.HgWdSqlConstant;
import com.baosight.hggp.hg.wd.domain.HGWD001;
import com.baosight.hggp.hg.wd.domain.HGWD001A;
import com.baosight.hggp.hg.wd.domain.HGWD002;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.hg.wd.domain.HGWD005;
import com.baosight.hggp.hg.wd.domain.HGWD009;
import com.baosight.hggp.hg.wd.domain.HGWD099;
import com.baosight.hggp.hg.wd.domain.*;
import com.baosight.hggp.hg.wd.utils.HgWdUtils;
import com.baosight.hggp.hg.xs.domain.User;
import com.baosight.hggp.util.AssertUtils;
......@@ -363,6 +357,24 @@ public class HGWDTools {
return CollectionUtils.isEmpty(results) ? null : results.get(0);
}
}
public static class HgWd006 {
public static void add(HGWD099 hgwd099,HGWD001 hgwd001,String changeContent) {
HGWD006 hgwd006 = new HGWD006();
hgwd006.setProjCode(hgwd001.getProjCode());
hgwd006.setProjName(hgwd001.getProjName());
hgwd006.setFileId(hgwd001.getFileId());
hgwd006.setFileName(hgwd001.getFileName());
hgwd006.setDocId(hgwd099.getDocId());
hgwd006.setDocName(hgwd099.getDocName());
hgwd006.setChangeContent(changeContent);
hgwd006.setParentId(hgwd099.getId());
DaoUtils.insert(HGWD006.INSERT, hgwd006);
}
}
public static class HgWd099 {
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 500,
pageSizes: [20, 50, 100, 250, 500],
},
columns: [],
loadComplete: function (grid) {
},
onAdd: function (e) {
$.each(e.items, function (index, item) {
item['projCode'] = $("#inqu_status-0-projCode").val();
item['fileId'] = $("#inqu_status-0-fileId").val();
item['fileName'] = $("#inqu_status-0-fileName").val();
item['docId'] = $("#inqu_status-0-docId").val();
item['docName'] = $("#inqu_status-0-docName").val();
item['parentId'] = $("#inqu_status-0-parentId").val();
});
},
}
}
// 查询
$("#QUERY").on("click", query);
});
$(window).load(function () {
// 查
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/22
Time: 14:15
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<%@ page import="com.baosight.iplat4j.core.web.threadlocal.UserSession" %>
<%
String loginName = UserSession.getLoginName();
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="loginName" value="<%=loginName%>" />
<script type="text/javascript" src="${ctx}/common/js/dayjs.min.js"></script>
<EF:EFPage title="变更记录">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" row="0" ename="projCode" cname="项目编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="parentId" cname="上级Id" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="fileId" cname="目录ID" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="fileName" cname="目录名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="docId" cname="附件编码" type="hidden" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="docName" cname="附件名称" placeholder="模糊查询" colWidth="3"/>
<EF:EFInput blockId="inqu_status" row="0" ename="changeContent" cname="变更内容" placeholder="模糊查询" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" showCount="true" height="73vh" isFloat="true">
<EF:EFColumn ename="id" primaryKey="true" cname="内码" hidden="true"/>
<EF:EFColumn ename="fileId" cname="目录ID" width="160" enable="true" readonly="false" hidden="true" align="center" required="false"/>
<EF:EFColumn ename="fileName" cname="目录名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="docId" cname="附件ID" width="160" enable="true" readonly="false" hidden="true" align="center" required="false"/>
<EF:EFColumn ename="docName" cname="附件名称" width="160" enable="true" readonly="true" align="center" required="false"/>
<EF:EFColumn ename="changeContent" cname="变更内容" width="200" enable="true" readonly="true" align="center" required="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("附件上传成功");
var matId = $("#inqu_status-0-bizId").val();
var bizType = $("#inqu_status-0-bizType").val();
var operType = $("#inqu_status-0-operType").val();
var ndocId = $("#inqu_status-0-ndocId").val();
var typeIndex = e.response.docName.lastIndexOf(".");
var type = typeIndex == -1 ? e.response.docType : e.response.docName.substring(typeIndex);
let data = {
docId: docId,
docName: e.response.docName,
docType: type,
bizId: matId,
bizType: bizType,
operType: operType,
ndocId: ndocId,
changeContent: $("#result-0-changeContent").val()
}
// saveTemp(e);
try {
parent.JSColorbox.setValueCallback(data);
} catch (e){
}
},
}
};
function saveTemp(e) {
let docId = e.response.docId;
let docName = e.response.docName;
let docSize = e.response.docSize;
let docTag = e.response.docTag;
let docUrl = e.response.docUrl;
let result = new EiInfo();
result.set("result-0-docId",docId);
result.set("result-0-docName",docName);
result.set("result-0-docSize",docSize);
result.set("result-0-docTag",docTag);
result.set("result-0-realPath",docUrl);
result.set("result-0-bizType",$("#inqu_status-0-bizType").val());
result.set("result-0-matId",$("#inqu_status-0-matId").val());
EiCommunicator.send("HGDS002", "insert", result, {
onSuccess: function (ei) {
if (ei.getStatus() >= 0) {
if (ei.getStatus() == 0) {
NotificationUtil(ei, 'warning');
} else {
NotificationUtil(ei);
}
} else {
NotificationUtil(ei, "error");
}
},
onFail: function (ei) {
// 发生异常
NotificationUtil("操作失败,原因[" + ei + "]", "error");
}
});
}
});
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/22
Time: 15:38
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="附件上传">
<EF:EFInput cname="业务ID" ename="bizId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="文件ID" ename="ndocId" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="操作类型" ename="operType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFInput cname="业务类型" ename="bizType" blockId="inqu_status" row="0" type="hidden"/>
<EF:EFRegion id="result">
<EF:EFUpload blockId="result" ename="uploadFile" docTag="wd_file" path="WD"/>
</EF:EFRegion>
<EF:EFRegion id="detail">
<div class="row">
<EF:EFInput cname="变更内容" ename="result-0-changeContent" type="textarea" colWidth="8" ratio="2:8" required="true" readonly="false"/>
</div>
</EF:EFRegion>
<EF:EFInput ename="fileDocId" cname="" hidden="true"/>
</EF:EFPage>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment