Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
60422ff2
Commit
60422ff2
authored
Aug 21, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.附件一对多的形式
parent
96c8bb80
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
299 additions
and
139 deletions
+299
-139
HgCwSqlConstant.java
...ava/com/baosight/hggp/hg/cw/constant/HgCwSqlConstant.java
+24
-0
HGCW999.java
src/main/java/com/baosight/hggp/hg/cw/domain/HGCW999.java
+0
-0
ServiceHGCW999.java
.../java/com/baosight/hggp/hg/cw/service/ServiceHGCW999.java
+3
-5
HGCW999.xml
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW999.xml
+73
-81
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+31
-5
HgWdSqlConstant.java
...ava/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
+1
-5
HGWD001B.java
src/main/java/com/baosight/hggp/hg/wd/domain/HGWD001B.java
+26
-2
HGWD001C.java
src/main/java/com/baosight/hggp/hg/wd/domain/HGWD001C.java
+25
-1
HGWD002.java
src/main/java/com/baosight/hggp/hg/wd/domain/HGWD002.java
+0
-0
ServiceHGWD001B.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001B.java
+2
-1
ServiceHGWD001C.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
+2
-1
ServiceHGWD002.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD002.java
+3
-2
ServiceHGWD099.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
+3
-4
HGWD001B.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001B.xml
+5
-3
HGWD001C.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001C.xml
+5
-3
HGWD002.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD002.xml
+91
-0
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+0
-24
sqlmap-config.xml
src/main/resources/resources/ibatis/sqlmap-config.xml
+1
-0
HGCW099.js
src/main/webapp/HG/CW/HGCW099.js
+1
-0
HGCW999.js
src/main/webapp/HG/CW/HGCW999.js
+1
-0
HGWD002.jsp
src/main/webapp/HG/WD/HGWD002.jsp
+2
-2
No files found.
src/main/java/com/baosight/hggp/hg/cw/constant/HgCwSqlConstant.java
0 → 100644
View file @
60422ff2
package
com
.
baosight
.
hggp
.
hg
.
cw
.
constant
;
/**
* @author:songx
* @date:2024/8/16,15:51
*/
public
class
HgCwSqlConstant
{
/**
* HGCW999 SQL定义
*
* @author:songx
* @date:2024/2/22,13:57
*/
public
static
class
HgCw999
{
// 预览自增
public
static
final
String
PREVIEW_INCR
=
"HGCW999.previewIncr"
;
// 下载自增
public
static
final
String
DOWNLOAD_INCR
=
"HGCW999.downloadIncr"
;
}
}
src/main/java/com/baosight/hggp/hg/cw/domain/HGCW999.java
View file @
60422ff2
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW999.java
View file @
60422ff2
...
...
@@ -2,8 +2,8 @@ package com.baosight.hggp.hg.cw.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.constant.S3Constant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cw.domain.HGCW003
;
import
com.baosight.hggp.hg.cw.domain.HGCW999
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.ds.domain.HGDS002
;
...
...
@@ -55,8 +55,7 @@ public class ServiceHGCW999 extends ServiceEPBase {
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
// 项目环境
String
projectEnv
=
ProjectInfo
.
getProjectEnv
();
if
(
CommonConstant
.
projectEnv
.
RUN
.
equalsIgnoreCase
(
projectEnv
))
{
if
(
CommonConstant
.
FileLocation
.
S3
.
equalsIgnoreCase
(
S3Constant
.
FILE_LOCATION
))
{
inInfo
=
super
.
query
(
inInfo
,
"HGCW999.queryRun"
,
new
HGCW999
());
}
else
{
inInfo
=
super
.
query
(
inInfo
,
"HGCW999.queryDev"
,
new
HGCW999
());
...
...
@@ -75,8 +74,7 @@ public class ServiceHGCW999 extends ServiceEPBase {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"docId"
,
docId
);
// 项目环境
String
projectEnv
=
ProjectInfo
.
getProjectEnv
();
if
(
CommonConstant
.
projectEnv
.
RUN
.
equalsIgnoreCase
(
projectEnv
))
{
if
(
CommonConstant
.
FileLocation
.
S3
.
equalsIgnoreCase
(
S3Constant
.
FILE_LOCATION
))
{
list
=
this
.
dao
.
query
(
"HGCW999.queryRun"
,
map
);
}
else
{
list
=
this
.
dao
.
query
(
"HGCW999.queryDev"
,
map
);
...
...
src/main/java/com/baosight/hggp/hg/cw/sql/HGCW999.xml
View file @
60422ff2
<?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-05-14 14:08:59
Version : 1.0
schema : hggp
tableName : HGCW999
ID BIGINT NOT NULL primarykey,
ACCOUNT_CODE VARCHAR,
COMPANY_CODE VARCHAR,
COMPANY_NAME VARCHAR,
DEP_CODE VARCHAR NOT NULL,
MAT_ID BIGINT,
DOC_ID VARCHAR,
CREATED_BY VARCHAR,
CREATED_NAME VARCHAR,
CREATED_TIME VARCHAR,
UPDATED_BY VARCHAR,
UPDATED_NAME VARCHAR,
UPDATED_TIME VARCHAR,
BIZ_TYPE VARCHAR
-->
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap
namespace=
"HGCW999"
>
<sql
id=
"column"
>
A.ID as "id",
<!-- 主键ID -->
A.ACCOUNT_CODE as "accountCode",
<!-- 企业编码 -->
A.COMPANY_CODE as "companyCode",
<!-- 公司编码 -->
A.COMPANY_NAME as "companyName",
<!-- 公司名称 -->
A.DEP_CODE as "depCode",
<!-- 部门编码 预留 -->
A.MAT_ID as "matId",
<!-- 物料ID -->
A.DOC_ID as "docId",
<!-- 文件ID -->
A.CREATED_BY as "createdBy",
<!-- 创建人 -->
A.CREATED_NAME as "createdName",
<!-- 创建人名称 -->
A.CREATED_TIME as "createdTime",
<!-- 创建时间 -->
A.UPDATED_BY as "updatedBy",
<!-- 修改人 -->
A.UPDATED_NAME as "updatedName",
<!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime",
<!-- 修改时间 -->
A.BIZ_TYPE as "bizType"
<!-- 业务类型 -->
<sql
id=
"column"
>
A.ID as "id",
<!-- 主键ID -->
A.ACCOUNT_CODE as "accountCode",
<!-- 企业编码 -->
A.COMPANY_CODE as "companyCode",
<!-- 公司编码 -->
A.COMPANY_NAME as "companyName",
<!-- 公司名称 -->
A.DEP_CODE as "depCode",
<!-- 部门编码 预留 -->
A.CREATED_BY as "createdBy",
<!-- 创建人 -->
A.CREATED_NAME as "createdName",
<!-- 创建人名称 -->
A.CREATED_TIME as "createdTime",
<!-- 创建时间 -->
A.UPDATED_BY as "updatedBy",
<!-- 修改人 -->
A.UPDATED_NAME as "updatedName",
<!-- 修改人名称 -->
A.UPDATED_TIME as "updatedTime",
<!-- 修改时间 -->
A.MAT_ID as "matId",
<!-- 物料ID -->
A.BIZ_TYPE as "bizType",
<!-- 业务类型 -->
A.DOC_ID as "docId",
<!-- 文件ID -->
<!--A.DOC_NAME as "docName",-->
<!-- 文件名称 -->
A.PREVIEW_NUM as "previewNum",
<!-- 预览次数 -->
A.DOWNLOAD_NUM as "downloadNum"
<!-- 下载次数 -->
</sql>
<sql
id=
"columnDev"
>
...
...
@@ -169,61 +153,69 @@
</select>
<insert
id=
"insert"
>
INSERT INTO ${hggpSchema}.HGCW999 (ID,
<!-- 主键ID -->
ACCOUNT_CODE,
<!-- 企业编码 -->
COMPANY_CODE,
<!-- 公司编码 -->
COMPANY_NAME,
<!-- 公司名称 -->
DEP_CODE,
<!-- 部门编码 预留 -->
MAT_ID,
<!-- 物料ID
-->
DOC_ID,
<!-- 文件ID
-->
CREATED_BY,
<!-- 创建人
-->
CREATED_NAME,
<!-- 创建人名称
-->
CREATED_TIME,
<!-- 创建时间
-->
UPDATED_BY,
<!-- 修改人
-->
UPDATED_NAME,
<!-- 修改人名称
-->
UPDATED_TIME,
<!-- 修改时间 -->
BIZ_TYPE
<!-- 业务类型 -->
)
VALUES (#id#, #accountCode#, #companyCode#, #companyName#, #depCode#, #matId#, #docId#, #createdBy#, #createdName#, #createdTime#, #updatedBy#, #updatedName#, #updatedTime#, #bizType#
)
INSERT INTO ${hggpSchema}.HGCW999 (
ACCOUNT_CODE,
<!-- 企业编码 -->
COMPANY_CODE,
<!-- 公司编码 -->
COMPANY_NAME,
<!-- 公司名称 -->
DEP_CODE,
<!-- 部门编码 预留 -->
CREATED_BY,
<!-- 创建人
-->
CREATED_NAME,
<!-- 创建人名称
-->
CREATED_TIME,
<!-- 创建时间
-->
MAT_ID,
<!-- 物料ID
-->
BIZ_TYPE,
<!-- 业务类型
-->
DOC_ID,
<!-- 文件ID
-->
DOC_NAME
<!-- 文件文件
-->
) VALUES (
#accountCode#, #companyCode#, #companyName#, #depCode#,
#createdBy#, #createdName#, #createdTime#, #matId#, #bizType#, #docId#, #docName#
)
</insert>
<delete
id=
"delete"
>
DELETE FROM ${hggpSchema}.HGCW999 WHERE
ID = #id#
DELETE FROM ${hggpSchema}.HGCW999 WHERE ID = #id#
</delete>
<delete
id=
"deleteMatId"
>
DELETE FROM ${hggpSchema}.HGCW999 WHERE
MAT_ID = #matId#
DELETE FROM ${hggpSchema}.HGCW999 WHERE MAT_ID = #matId#
</delete>
<update
id=
"update"
>
UPDATE ${hggpSchema}.HGCW999
SET
ACCOUNT_CODE = #accountCode#,
<!-- 企业编码 -->
COMPANY_CODE = #companyCode#,
<!-- 公司编码 -->
COMPANY_NAME = #companyName#,
<!-- 公司名称 -->
DEP_CODE = #depCode#,
<!-- 部门编码 预留 -->
MAT_ID = #matId#,
<!-- 物料ID -->
DOC_ID = #docId#,
<!-- 文件ID -->
CREATED_BY = #createdBy#,
<!-- 创建人 -->
CREATED_NAME = #createdName#,
<!-- 创建人名称 -->
CREATED_TIME = #createdTime#,
<!-- 创建时间 -->
UPDATED_BY = #updatedBy#,
<!-- 修改人 -->
UPDATED_NAME = #updatedName#,
<!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#,
<!-- 修改时间 -->
BIZ_TYPE = #bizType#
<!-- 业务类型 -->
WHERE
ID = #id#
</update>
<update
id=
"batchUpdate"
>
UPDATE ${hggpSchema}.HGCW999
SET
MAT_ID = #matId#,
<!-- 物料ID -->
UPDATED_BY = #updatedBy#,
<!-- 修改人 -->
UPDATED_NAME = #updatedName#,
<!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#
<!-- 修改时间 -->
WHERE
DOC_ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"docIds"
>
#docIds[]#
</iterate>
SET
BIZ_TYPE = #bizType#,
<!-- 业务类型 -->
MAT_ID = #matId#,
<!-- 物料ID -->
DOC_ID = #docId#,
<!-- 文件ID -->
DOC_NAME = #docName#,
<!-- 文件文件 -->
<include
refid=
"SqlBase.updateRevise"
/>
WHERE ID = #id#
</update>
<update
id=
"batchUpdate"
>
UPDATE ${hggpSchema}.HGCW999
SET
MAT_ID = #matId#,
<!-- 物料ID -->
UPDATED_BY = #updatedBy#,
<!-- 修改人 -->
UPDATED_NAME = #updatedName#,
<!-- 修改人名称 -->
UPDATED_TIME = #updatedTime#
<!-- 修改时间 -->
WHERE DOC_ID IN
<iterate
close=
")"
open=
"("
conjunction=
","
property=
"docIds"
>
#docIds[]#
</iterate>
</update>
<!-- 预览自增 -->
<update
id=
"previewIncr"
>
UPDATE ${hggpSchema}.HGCW999
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include
refid=
"SqlBase.updateRevise"
/>
WHERE DOC_ID = #docId#
</update>
<!-- 下载自增 -->
<update
id=
"downloadIncr"
>
UPDATE ${hggpSchema}.HGCW999
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include
refid=
"SqlBase.updateRevise"
/>
WHERE DOC_ID = #docId#
</update>
</sqlMap>
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
60422ff2
...
...
@@ -6,6 +6,7 @@ import com.baosight.hggp.core.dao.DaoBase;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cb.domain.HGCB001
;
import
com.baosight.hggp.hg.constant.HGSqlConstant
;
import
com.baosight.hggp.hg.cw.constant.HgCwSqlConstant
;
import
com.baosight.hggp.hg.cw.domain.*
;
import
com.baosight.hggp.hg.cw.vo.UserVO
;
import
com.baosight.hggp.hg.kc.domain.*
;
...
...
@@ -24,10 +25,6 @@ import java.math.BigDecimal;
import
java.math.BigInteger
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
...
...
@@ -1130,8 +1127,37 @@ public class HGCWTools {
}
}
/**
*
* @author:songx
* @date:2024/8/21,9:44
*/
public
static
class
HgCw999
{
/**
* 预览记录自增
*
* @param docId
*/
public
static
void
previewIncr
(
String
docId
)
{
AssertUtils
.
isEmpty
(
docId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGCW999
.
FIELD_DOC_ID
,
docId
);
DaoUtils
.
update
(
HgCwSqlConstant
.
HgCw999
.
PREVIEW_INCR
,
queryMap
);
}
/**
* 下载记录自增
*
* @param docId
*/
public
static
void
downloadIncr
(
String
docId
)
{
AssertUtils
.
isEmpty
(
docId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGCW999
.
FIELD_DOC_ID
,
docId
);
DaoUtils
.
update
(
HgCwSqlConstant
.
HgCw999
.
DOWNLOAD_INCR
,
queryMap
);
}
public
static
void
batchUpdate
(
List
<
Map
>
rows
,
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"业务ID不能为空!"
);
String
[]
docIds
=
rows
.
stream
().
map
(
row
->
row
.
get
(
"docId"
).
toString
()).
toArray
(
String
[]::
new
);
...
...
src/main/java/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
View file @
60422ff2
...
...
@@ -13,11 +13,7 @@ public class HgWdSqlConstant {
* @date:2024/2/22,13:57
*/
public
static
class
HgWd001
{
// 预览自增
public
static
final
String
PREVIEW_INCR
=
"HGWD001.previewIncr"
;
// 下载自增
public
static
final
String
DOWNLOAD_INCR
=
"HGWD001.downloadIncr"
;
}
}
src/main/java/com/baosight/hggp/hg/wd/domain/HGWD001B.java
View file @
60422ff2
...
...
@@ -32,6 +32,7 @@ public class HGWD001B extends DaoEPBase {
public
static
final
String
FIELD_UPDATED_TIME
=
"updatedTime"
;
/* 记录修改时间*/
public
static
final
String
FIELD_DELETE_FLAG
=
"deleteFlag"
;
/* 0-未删除,1-已删除*/
public
static
final
String
FIELD_FILE_ID
=
"fileId"
;
/* 文件ID*/
public
static
final
String
FIELD_DOC_ID
=
"docId"
;
/* 附件ID*/
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_ACCOUNT_CODE
=
"ACCOUNT_CODE"
;
/* 企业编码*/
...
...
@@ -44,6 +45,7 @@ public class HGWD001B extends DaoEPBase {
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_FILE_ID
=
"FILE_ID"
;
/* 文件ID*/
public
static
final
String
COL_DOC_ID
=
"DOC_ID"
;
/* 附件ID*/
public
static
final
String
QUERY
=
"HGWD001B.query"
;
public
static
final
String
COUNT
=
"HGWD001B.count"
;
...
...
@@ -62,6 +64,7 @@ public class HGWD001B extends DaoEPBase {
private
String
updatedTime
=
" "
;
/* 记录修改时间*/
private
Integer
deleteFlag
;
/* 0-未删除,1-已删除*/
private
String
fileId
=
" "
;
/* 文件ID*/
private
String
docId
=
" "
;
/* 附件ID*/
/**
* initialize the metadata.
...
...
@@ -113,8 +116,11 @@ public class HGWD001B extends DaoEPBase {
eiColumn
=
new
EiColumn
(
FIELD_FILE_ID
);
eiColumn
.
setDescName
(
"文件ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DOC_ID
);
eiColumn
.
setDescName
(
"附件ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
/**
...
...
@@ -301,6 +307,22 @@ public class HGWD001B extends DaoEPBase {
this
.
fileId
=
fileId
;
}
/**
* get the docId - 附件ID.
* @return the docId
*/
public
String
getDocId
()
{
return
this
.
docId
;
}
/**
* set the docId - 文件ID.
*
* @param docId - 文件ID
*/
public
void
setDocId
(
String
docId
)
{
this
.
docId
=
docId
;
}
/**
* get the value from Map.
*
* @param map - source data map
...
...
@@ -319,6 +341,7 @@ public class HGWD001B extends DaoEPBase {
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_TIME
)),
updatedTime
));
setDeleteFlag
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELETE_FLAG
)),
deleteFlag
));
setFileId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_FILE_ID
)),
fileId
));
setDocId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DOC_ID
)),
docId
));
}
/**
...
...
@@ -339,6 +362,7 @@ public class HGWD001B extends DaoEPBase {
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_FILE_ID
,
StringUtils
.
toString
(
fileId
,
eiMetadata
.
getMeta
(
FIELD_FILE_ID
)));
map
.
put
(
FIELD_DOC_ID
,
StringUtils
.
toString
(
docId
,
eiMetadata
.
getMeta
(
FIELD_DOC_ID
)));
return
map
;
}
...
...
src/main/java/com/baosight/hggp/hg/wd/domain/HGWD001C.java
View file @
60422ff2
...
...
@@ -32,6 +32,7 @@ public class HGWD001C extends DaoEPBase {
public
static
final
String
FIELD_UPDATED_TIME
=
"updatedTime"
;
/* 记录修改时间*/
public
static
final
String
FIELD_DELETE_FLAG
=
"deleteFlag"
;
/* 0-未删除,1-已删除*/
public
static
final
String
FIELD_FILE_ID
=
"fileId"
;
/* 文件ID*/
public
static
final
String
FIELD_DOC_ID
=
"docId"
;
/* 附件ID*/
public
static
final
String
COL_ID
=
"ID"
;
public
static
final
String
COL_ACCOUNT_CODE
=
"ACCOUNT_CODE"
;
/* 企业编码*/
...
...
@@ -44,6 +45,7 @@ public class HGWD001C extends DaoEPBase {
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_FILE_ID
=
"FILE_ID"
;
/* 文件ID*/
public
static
final
String
COL_DOC_ID
=
"DOC_ID"
;
/* 附件ID*/
public
static
final
String
QUERY
=
"HGWD001C.query"
;
public
static
final
String
COUNT
=
"HGWD001C.count"
;
...
...
@@ -62,6 +64,7 @@ public class HGWD001C extends DaoEPBase {
private
String
updatedTime
=
" "
;
/* 记录修改时间*/
private
Integer
deleteFlag
;
/* 0-未删除,1-已删除*/
private
String
fileId
=
" "
;
/* 文件ID*/
private
String
docId
=
" "
;
/* 附件ID*/
/**
* initialize the metadata.
...
...
@@ -113,7 +116,10 @@ public class HGWD001C extends DaoEPBase {
eiColumn
=
new
EiColumn
(
FIELD_FILE_ID
);
eiColumn
.
setDescName
(
"文件ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
eiColumn
=
new
EiColumn
(
FIELD_DOC_ID
);
eiColumn
.
setDescName
(
"附件ID"
);
eiMetadata
.
addMeta
(
eiColumn
);
}
...
...
@@ -301,6 +307,22 @@ public class HGWD001C extends DaoEPBase {
this
.
fileId
=
fileId
;
}
/**
* get the docId - 附件ID.
* @return the docId
*/
public
String
getDocId
()
{
return
this
.
docId
;
}
/**
* set the docId - 文件ID.
*
* @param docId - 文件ID
*/
public
void
setDocId
(
String
docId
)
{
this
.
docId
=
docId
;
}
/**
* get the value from Map.
*
* @param map - source data map
...
...
@@ -319,6 +341,7 @@ public class HGWD001C extends DaoEPBase {
setUpdatedTime
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_UPDATED_TIME
)),
updatedTime
));
setDeleteFlag
(
NumberUtils
.
toInteger
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DELETE_FLAG
)),
deleteFlag
));
setFileId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_FILE_ID
)),
fileId
));
setDocId
(
StringUtils
.
defaultIfEmpty
(
StringUtils
.
toString
(
map
.
get
(
FIELD_DOC_ID
)),
docId
));
}
/**
...
...
@@ -339,6 +362,7 @@ public class HGWD001C extends DaoEPBase {
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_FILE_ID
,
StringUtils
.
toString
(
fileId
,
eiMetadata
.
getMeta
(
FIELD_FILE_ID
)));
map
.
put
(
FIELD_DOC_ID
,
StringUtils
.
toString
(
docId
,
eiMetadata
.
getMeta
(
FIELD_DOC_ID
)));
return
map
;
}
...
...
src/main/java/com/baosight/hggp/hg/wd/domain/HGWD002.java
0 → 100644
View file @
60422ff2
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001B.java
View file @
60422ff2
...
...
@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.wd.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.wd.constant.HgWdConstant
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.hg.wd.domain.HGWD001B
;
...
...
@@ -92,7 +93,7 @@ public class ServiceHGWD001B extends ServiceBase {
List
<
HGWD001B
>
fWd001bs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001B
.
class
);
for
(
HGWD001B
fWd001b
:
fWd001bs
)
{
// 预览记录+1
HG
WDTools
.
HgWd001
.
previewIncr
(
fWd001b
.
getFile
Id
());
HG
CWTools
.
HgCw999
.
previewIncr
(
fWd001b
.
getDoc
Id
());
// 新增
DaoUtils
.
insert
(
HGWD001B
.
INSERT
,
fWd001b
);
}
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
View file @
60422ff2
...
...
@@ -2,6 +2,7 @@ package com.baosight.hggp.hg.wd.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.hg.wd.domain.HGWD001B
;
import
com.baosight.hggp.hg.wd.domain.HGWD001C
;
...
...
@@ -89,7 +90,7 @@ public class ServiceHGWD001C extends ServiceBase {
List
<
HGWD001C
>
fWd001cs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001C
.
class
);
for
(
HGWD001C
fWd001c
:
fWd001cs
)
{
// 下载记录+1
HG
WDTools
.
HgWd001
.
downloadIncr
(
fWd001c
.
getFile
Id
());
HG
CWTools
.
HgCw999
.
downloadIncr
(
fWd001c
.
getDoc
Id
());
// 新增
DaoUtils
.
insert
(
HGWD001C
.
INSERT
,
fWd001c
);
}
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD002.java
View file @
60422ff2
...
...
@@ -13,6 +13,7 @@ import com.baosight.hggp.hg.kc.tools.HGKCTools;
import
com.baosight.hggp.hg.kc.utils.HGKCUtils
;
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.xs.domain.Company
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.CommonMethod
;
...
...
@@ -48,7 +49,7 @@ public class ServiceHGWD002 extends ServiceBase {
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
try
{
CommonMethod
.
initBlock
(
inInfo
,
Arrays
.
asList
(
DdynamicEnum
.
PROJ_RECORD_BLOCK_ID
));
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGWD00
1
().
eiMetadata
);
inInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
new
HGWD00
2
().
eiMetadata
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"初始化失败"
);
}
...
...
@@ -68,7 +69,7 @@ public class ServiceHGWD002 extends ServiceBase {
Map
queryRow
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
// 仅查询已发布的文件
queryRow
.
put
(
HGWD001
.
FIELD_STATUS
,
HgWdConstant
.
FileStatus
.
S_1
);
inInfo
=
super
.
query
(
inInfo
,
HGWD00
1
.
QUERY
,
new
HGWD001
());
inInfo
=
super
.
query
(
inInfo
,
HGWD00
2
.
QUERY
,
new
HGWD002
());
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD099.java
View file @
60422ff2
...
...
@@ -3,6 +3,7 @@ package com.baosight.hggp.hg.wd.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.common.ChangeTypeEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.constant.S3Constant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.cw.domain.HGCW999
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
...
...
@@ -60,8 +61,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
// 项目环境
String
projectEnv
=
ProjectInfo
.
getProjectEnv
();
if
(
CommonConstant
.
projectEnv
.
RUN
.
equalsIgnoreCase
(
projectEnv
))
{
if
(
CommonConstant
.
FileLocation
.
S3
.
equalsIgnoreCase
(
S3Constant
.
FILE_LOCATION
))
{
inInfo
=
super
.
query
(
inInfo
,
"HGCW999.queryRun"
,
new
HGCW999
());
}
else
{
inInfo
=
super
.
query
(
inInfo
,
"HGCW999.queryDev"
,
new
HGCW999
());
...
...
@@ -80,8 +80,7 @@ public class ServiceHGWD099 extends ServiceEPBase {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"docId"
,
docId
);
// 项目环境
String
projectEnv
=
ProjectInfo
.
getProjectEnv
();
if
(
CommonConstant
.
projectEnv
.
RUN
.
equalsIgnoreCase
(
projectEnv
))
{
if
(
CommonConstant
.
FileLocation
.
S3
.
equalsIgnoreCase
(
S3Constant
.
FILE_LOCATION
))
{
list
=
this
.
dao
.
query
(
"HGCW999.queryRun"
,
map
);
}
else
{
list
=
this
.
dao
.
query
(
"HGCW999.queryDev"
,
map
);
...
...
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001B.xml
View file @
60422ff2
...
...
@@ -13,7 +13,8 @@
UPDATED_NAME as "updatedName",
<!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime",
<!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag",
<!-- 0-未删除,1-已删除 -->
FILE_ID as "fileId"
<!-- 文件ID -->
FILE_ID as "fileId",
<!-- 文件ID -->
DOC_ID as "docId"
<!-- 附件ID -->
</sql>
<sql
id=
"condition"
>
...
...
@@ -86,10 +87,11 @@
CREATED_NAME,
<!-- 记录创建名称 -->
CREATED_TIME,
<!-- 记录创建时间 -->
DELETE_FLAG,
<!-- 0-未删除,1-已删除 -->
FILE_ID
<!-- 文件ID -->
FILE_ID,
<!-- 文件ID -->
DOC_ID
<!-- 附件ID -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #fileId#
#deleteFlag#, #fileId#
, #docId#
)
</insert>
...
...
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001C.xml
View file @
60422ff2
...
...
@@ -13,7 +13,8 @@
UPDATED_NAME as "updatedName",
<!-- 记录修改名称 -->
UPDATED_TIME as "updatedTime",
<!-- 记录修改时间 -->
DELETE_FLAG as "deleteFlag",
<!-- 0-未删除,1-已删除 -->
FILE_ID as "fileId"
<!-- 文件ID -->
FILE_ID as "fileId",
<!-- 文件ID -->
DOC_ID as "docId"
<!-- 附件ID -->
</sql>
<sql
id=
"condition"
>
...
...
@@ -86,10 +87,11 @@
CREATED_NAME,
<!-- 记录创建名称 -->
CREATED_TIME,
<!-- 记录创建时间 -->
DELETE_FLAG,
<!-- 0-未删除,1-已删除 -->
FILE_ID
<!-- 文件ID -->
FILE_ID,
<!-- 文件ID -->
DOC_ID
<!-- 附件ID -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #fileId#
#deleteFlag#, #fileId#
, #docId#
)
</insert>
...
...
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD002.xml
0 → 100644
View file @
60422ff2
<?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=
"HGWD002"
>
<sql
id=
"column"
>
A.ID as "id",
A.ACCOUNT_CODE as "accountCode",
<!-- 企业编码 -->
A.DEP_CODE as "depCode",
<!-- 部门编码 -->
A.DELETE_FLAG as "deleteFlag",
<!-- 0-未删除,1-已删除 -->
A.COMPANY_CODE as "companyCode",
<!-- 公司编码 -->
A.COMPANY_NAME as "companyName",
<!-- 公司名称 -->
A.PROJ_CODE as "projCode",
<!-- 项目编码 -->
A.PROJ_NAME as "projName",
<!-- 项目名称 -->
A.FILE_ID as "fileId",
<!-- 文件ID -->
A.FILE_TYPE as "fileType",
<!-- 文件类型 -->
A.FILE_NAME as "fileName",
<!-- 文件名称 -->
A.DOC_VERSION as "docVersion",
<!-- 文件版本号 -->
A.RELEASE_DATE as "releaseDate",
<!-- 发布时间 -->
B.DOC_ID as "docId",
<!-- 文件号 -->
B.DOC_NAME as "docName",
<!-- 文件附件名称 -->
B.PREVIEW_NUM as "previewNum",
<!-- 预览次数 -->
B.DOWNLOAD_NUM as "downloadNum"
<!-- 下载次数 -->
</sql>
<sql
id=
"condition"
>
AND A.DELETE_FLAG = 0
<isNotEmpty
prepend=
" AND "
property=
"id"
>
A.ID = #id#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"accountCode"
>
A.ACCOUNT_CODE = #accountCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"depCode"
>
A.DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"companyName"
>
A.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"projName"
>
A.PROJ_NAME LIKE CONCAT('%', #projName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"fileId"
>
A.FILE_ID = #fileId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"fileType"
>
A.FILE_TYPE = #fileType#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"fileName"
>
A.FILE_NAME LIKE CONCAT('%', #fileName#, '%')
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"status"
>
A.STATUS = #status#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"docId"
>
B.DOC_ID = #docId#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"docName"
>
B.DOC_NAME LIKE CONCAT('%', #docName#, '%')
</isNotEmpty>
</sql>
<sql
id=
"orderBy"
>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
$orderBy$
</isNotEmpty>
<isEmpty
property=
"orderBy"
>
A.ID DESC, B.ID DESC
</isEmpty>
</dynamic>
</sql>
<select
id=
"query"
resultClass=
"com.baosight.hggp.hg.wd.domain.HGWD002"
>
SELECT
<include
refid=
"column"
/>
FROM ${hggpSchema}.HGWD001 A
INNER JOIN ${hggpSchema}.HGCW999 B ON A.ID = B.MAT_ID
WHERE 1=1
<include
refid=
"condition"
/>
<include
refid=
"orderBy"
/>
</select>
<select
id=
"count"
resultClass=
"int"
>
SELECT COUNT(*)
FROM ${hggpSchema}.HGWD001 A
INNER JOIN ${hggpSchema}.HGCW999 B ON A.ID = B.MAT_ID
WHERE 1=1
<include
refid=
"condition"
/>
</select>
</sqlMap>
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
60422ff2
...
...
@@ -48,30 +48,6 @@ public class HGWDTools {
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
.
get
(
0
);
}
/**
* 预览记录自增
*
* @param fileId
*/
public
static
void
previewIncr
(
String
fileId
)
{
AssertUtils
.
isEmpty
(
fileId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGWD001
.
FIELD_FILE_ID
,
fileId
);
DaoUtils
.
update
(
HgWdSqlConstant
.
HgWd001
.
PREVIEW_INCR
,
queryMap
);
}
/**
* 下载记录自增
*
* @param fileId
*/
public
static
void
downloadIncr
(
String
fileId
)
{
AssertUtils
.
isEmpty
(
fileId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGWD001
.
FIELD_FILE_ID
,
fileId
);
DaoUtils
.
update
(
HgWdSqlConstant
.
HgWd001
.
DOWNLOAD_INCR
,
queryMap
);
}
public
static
void
add
(
HGWD001A
hgwd001a
)
{
AssertUtils
.
isNull
(
hgwd001a
,
"文档对象不能为空"
);
DaoUtils
.
insert
(
HGWD001A
.
INSERT
,
hgwd001a
);
...
...
src/main/resources/resources/ibatis/sqlmap-config.xml
View file @
60422ff2
...
...
@@ -77,6 +77,7 @@
<sqlMap
resource=
"com/baosight/hggp/hg/cw/sql/HGCW015.xml"
/>
<sqlMap
resource=
"com/baosight/hggp/hg/cw/sql/HGCW016.xml"
/>
<sqlMap
resource=
"com/baosight/hggp/hg/cw/sql/HGCW017.xml"
/>
<sqlMap
resource=
"com/baosight/hggp/hg/cw/sql/HGCW999.xml"
/>
<!--配置-->
<sqlMap
resource=
"com/baosight/hggp/hg/pz/sql/HGPZ005.xml"
/>
...
...
src/main/webapp/HG/CW/HGCW099.js
View file @
60422ff2
...
...
@@ -17,6 +17,7 @@ $(function () {
console
.
log
(
$
(
"#inqu_status-0-bizType"
).
val
())
var
data
=
{
docId
:
docId
,
docName
:
e
.
response
.
docName
,
matId
:
matId
,
bizType
:
bizType
}
...
...
src/main/webapp/HG/CW/HGCW999.js
View file @
60422ff2
...
...
@@ -66,6 +66,7 @@ function uploadFileCallback(data) {
let
inEiInfo
=
new
EiInfo
();
inEiInfo
.
set
(
"result-0-matId"
,
data
.
matId
);
inEiInfo
.
set
(
"result-0-docId"
,
data
.
docId
);
inEiInfo
.
set
(
"result-0-docName"
,
data
.
docName
);
inEiInfo
.
set
(
"result-0-bizType"
,
data
.
bizType
);
EiCommunicator
.
send
(
'HGCW999'
,
'insert'
,
inEiInfo
,
{
onSuccess
(
response
)
{
...
...
src/main/webapp/HG/WD/HGWD002.jsp
View file @
60422ff2
...
...
@@ -32,8 +32,8 @@
</EF:EFComboColumn>
<EF:EFColumn
ename=
"fileName"
cname=
"文件名"
enable=
"false"
width=
"100"
align=
"left"
/>
<EF:EFColumn
ename=
"docVersion"
cname=
"版本号"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"docId"
cname=
"
文件号
"
enable=
"false"
width=
"120"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"docName"
cname=
"
文件
附件名称"
enable=
"false"
width=
"100"
align=
"left"
/>
<EF:EFColumn
ename=
"docId"
cname=
"
附件ID
"
enable=
"false"
width=
"120"
align=
"center"
hidden=
"true"
/>
<EF:EFColumn
ename=
"docName"
cname=
"附件名称"
enable=
"false"
width=
"100"
align=
"left"
/>
<EF:EFColumn
ename=
"previewNum"
cname=
"预览次数"
enable=
"false"
width=
"100"
align=
"right"
/>
<EF:EFColumn
ename=
"downloadNum"
cname=
"下载次数"
enable=
"false"
width=
"100"
align=
"right"
/>
</EF:EFGrid>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment